/* ============================================================
   MargenticOS — landing page
   Warm, precise, editorial. System sans, weights 400 / 500 only.
   No shadows, no gradients, no glow.
   ============================================================ */

:root {
  --page-shell: #EDE8DF;   /* warm beige page background */
  --content:    #F8F4EE;   /* warm off-white content area */
  --card:       #FFFFFF;   /* white cards */
  --card-border:#E8E2D8;   /* hairline card / divider border */
  --green:      #1C3A2A;   /* dark green brand colour */
  --green-deep: #16301F;   /* slightly deeper green for panels */
  --accent:     #A8D4B8;   /* accent green */
  --text:       #1A1916;   /* primary text */
  --muted:      #9A9488;   /* secondary text / eyebrows */

  --maxw: 1100px;
  --gutter: clamp(24px, 5vw, 72px);
  --section-y: clamp(84px, 12vw, 168px);
  --radius: 10px;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page-shell);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.62;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The off-white content panel sits on the beige shell. */
.page {
  background: var(--content);
  max-width: 1280px;
  margin: 0 auto;
  min-height: 100vh;
  border-left: 1px solid var(--card-border);
  border-right: 1px solid var(--card-border);
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Typography primitives ---------- */
h1, h2, h3, p { margin: 0; }

.eyebrow {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.6;
  color: var(--text);
}

.body-text {
  color: var(--text);
}

.body-text + .body-text { margin-top: 1.25em; }

.measure { max-width: 60ch; }

/* Section heading scale */
.section-head {
  font-weight: 500;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 18ch;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--content);
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 999px;
  padding: 0.85em 1.5em;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn:hover { background: var(--green-deep); border-color: var(--green-deep); }

.btn .arrow {
  display: inline-block;
  transition: transform 0.18s ease;
}
.btn:hover .arrow { transform: translateX(3px); }

.btn-ghost {
  background: transparent;
  color: var(--green);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}
.btn-ghost:hover { background: transparent; color: var(--green-deep); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--content);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.is-stuck { border-bottom-color: var(--card-border); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
  padding-bottom: 22px;
}

.wordmark {
  font-size: 1.42rem;
  font-weight: 500;
  letter-spacing: -0.022em;
  color: var(--text);
  text-decoration: none;
}
.wordmark .os { color: #2E7049; }

.header-cta { font-size: 0.9rem; padding: 0.7em 1.25em; }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-top: clamp(56px, 9vw, 120px); padding-bottom: var(--section-y); }

.hero .eyebrow { display: block; margin-bottom: 28px; }

.hero h1 {
  font-weight: 400;
  font-size: clamp(2.3rem, 5.2vw, 4.1rem);
  line-height: 1.06;
  letter-spacing: -0.032em;
  max-width: 17ch;
  text-wrap: balance;
}

.hero .sub {
  margin-top: 32px;
  max-width: 56ch;
  font-size: clamp(1.08rem, 1.5vw, 1.28rem);
  line-height: 1.58;
  color: #4a463f;
  font-weight: 400;
}

.hero .hero-cta { margin-top: 44px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.hero .hero-note { font-size: 0.92rem; color: var(--muted); }

/* Hairline section divider */
.divider { border: 0; border-top: 1px solid var(--card-border); margin: 0; }

/* ============================================================
   SECTION SHELL
   ============================================================ */
.section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.section .eyebrow { display: block; margin-bottom: 22px; }

/* ---------- The Problem ---------- */
.problem .section-head { max-width: 20ch; }
.problem-grid {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 56px;
  align-items: start;
}
.problem-grid .col-left { max-width: 64ch; }
.problem-grid .body-text + .body-text { margin-top: 1.5em; }

/* ---------- Options ---------- */
.options .section-head { max-width: 24ch; }
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 56px;
}
.option-card {
  background: var(--card);
  border: 1px solid #BDDAB0;
  border-radius: var(--radius);
  padding: clamp(28px, 3vw, 40px);
}
.option-card .opt-index {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 18px;
}
.option-card h3 {
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.012em;
  margin-bottom: 12px;
}
.option-card p { color: #4a463f; font-size: 1rem; line-height: 1.56; }

.root-cause {
  margin-top: 20px;
  background: var(--green);
  color: var(--content);
  border-radius: var(--radius);
  padding: clamp(34px, 4vw, 56px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.root-cause .rc-label {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.root-cause p {
  font-size: clamp(1.12rem, 1.8vw, 1.42rem);
  line-height: 1.5;
  letter-spacing: -0.012em;
  max-width: 46ch;
}
.root-cause .rc-emphasis { color: var(--accent); }

/* ============================================================
   HOW IT WORKS — stacking / folding scroll
   ============================================================ */
.how { padding-top: var(--section-y); }
.how .section-head { max-width: 14ch; }

.steps {
  position: relative;
  margin-top: 56px;
  padding-bottom: var(--section-y);
}

/* Static hairline connecting steps 01-04, aligned with the step-number column */
.steps::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: var(--section-y);
  left: calc(clamp(32px, 4vw, 56px) + 46px);
  width: 1px;
  background: var(--accent);
  z-index: 0;
}

.step {
  position: sticky;
  top: 104px;
  z-index: 1;
  background: var(--card);
  border: 1px solid #BDDAB0;
  border-radius: var(--radius);
  padding: clamp(32px, 4vw, 56px);
  margin-bottom: 30vh;
  transform-origin: center top;
  will-change: transform;
}
.step:last-child { margin-bottom: 0; }

.step-grid {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: clamp(20px, 4vw, 56px);
  align-items: start;
}

.step-num {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--green);
}

.step-body h3 {
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1.15;
  margin-bottom: 16px;
  max-width: 22ch;
}
.step-body p { color: #4a463f; max-width: 56ch; }

/* Dashboard image slot inside step 04 */
.dash-slot {
  margin-top: 28px;
  width: 100%;
  height: clamp(220px, 30vw, 360px);
  border: 1px dashed var(--card-border);
  border-radius: var(--radius);
}

/* ============================================================
   WHY (differentiators)
   ============================================================ */
.why .section-head { max-width: 16ch; }
.why-list {
  margin-top: 64px;
  display: grid;
  gap: 0;
}
.why-item {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: clamp(24px, 5vw, 80px);
  padding: clamp(34px, 4vw, 52px) 0;
  border-top: 1px solid var(--card-border);
  align-items: start;
}
.why-item:last-child { border-bottom: 1px solid var(--card-border); }
.why-item h3 {
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  font-weight: 500;
  letter-spacing: -0.016em;
  line-height: 1.18;
  max-width: 14ch;
}
.why-item p { color: #4a463f; }

/* ============================================================
   FOUNDER
   ============================================================ */
.founder-grid {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 56px;
  align-items: start;
}
.founder-body { max-width: 70ch; }
.founder-body .body-text { font-size: 1.08rem; }
.founder-body .body-text + .body-text { margin-top: 1.35em; }
.founder-name { font-weight: 500; color: var(--text); }
.founder-signoff {
  margin-top: 2.4em;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
}
.founder-signoff a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--card-border);
  transition: color 0.18s ease, border-color 0.18s ease;
}
.founder-signoff a:hover { color: var(--green); border-bottom-color: var(--green); }

/* ============================================================
   FINAL CTA — dark green panel
   ============================================================ */
.final {
  background: var(--green);
  color: var(--content);
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}
.final .eyebrow { color: var(--accent); display: block; margin-bottom: 24px; }
.final h2 {
  font-weight: 400;
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.026em;
  max-width: 18ch;
}
.final p {
  margin-top: 28px;
  max-width: 54ch;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.55;
  color: #d6dcd3;
}
.final .final-cta { margin-top: 40px; }
.btn-on-green {
  background: var(--content);
  color: var(--green);
  border-color: var(--content);
}
.btn-on-green:hover { background: #ffffff; border-color: #ffffff; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--green-deep);
  color: #b9c2b8;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 30px;
  padding-bottom: 30px;
  font-size: 0.9rem;
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer .wordmark { color: var(--content); }
.site-footer .wordmark .os { color: var(--accent); }

/* ============================================================
   RESPONSIVE — mobile is designed, not an afterthought
   ============================================================ */
@media (max-width: 860px) {
  body { font-size: 17px; }

  .page { border-left: 0; border-right: 0; }

  .header-cta { display: none; }

  .problem-grid { grid-template-columns: 1fr; margin-top: 36px; }

  .options-grid { grid-template-columns: 1fr; margin-top: 36px; }

  .why-item {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 30px 0;
  }
  .why-item h3 { max-width: none; }

  .founder-grid { grid-template-columns: 1fr; gap: 32px; margin-top: 36px; }

  /* Steps: lighter stacking on small screens */
  .step {
    top: 80px;
    margin-bottom: 14vh;
    padding: 28px 24px;
  }
  /* Hairline sits at the far-left edge on mobile */
  .steps::before { left: 0; bottom: var(--section-y); }
  .step-grid { grid-template-columns: 1fr; gap: 14px; }
  .step-num { font-size: 1.9rem; }
}

@media (max-width: 520px) {
  :root { --gutter: 22px; }
  .hero h1 { letter-spacing: -0.026em; }
  .root-cause { padding: 28px 22px; }
}

/* Respect reduced motion: drop the sticky stacking transforms */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .step { transform: none !important; }
}
