/* ═══════════════════════════════════════════════════════════════════════════
   McMtn Labs — v3 / ALPINE
   Refined alpine design: cream paper, dark green ink, sage accents.
   ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* light (default) — alpine paper */
  --cream:        #F1ECDD;
  --paper:        #FBF7EA;   /* lightest surface, used for elevated cards */
  --paper-2:      #E8E1CA;   /* slightly deeper, secondary surfaces */
  --ink:          #0F1410;
  --ink-soft:     #2A2F28;
  --ink-mute:     #5C6157;
  --ink-faint:    #A1A294;

  --green-deep:   #1F6A35;   /* primary accent — forest, more saturated for contrast against ink */
  --green-mid:    #2E8C4A;   /* secondary — fresh forest */
  --green-light:  #A8C39A;   /* tertiary — lichen */
  --green-tint:   #D8E2C7;   /* palest — backgrounds */

  --user-accent:  #1F6A35;   /* user-picked color (tweak target) */
  --accent:       var(--user-accent);   /* alias */
  --on-accent:    #F1ECDD;

  --rule:         rgba(30,61,42,0.85);
  --rule-soft:    rgba(30,61,42,0.16);
  --rule-hair:    rgba(30,61,42,0.10);

  --gutter:       clamp(20px, 3.4vw, 56px);
  --max-w:        1280px;
  --rail-w:       180px;

  --sans:  "Plus Jakarta Sans", -apple-system, system-ui, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, monospace;
}

:root[data-theme="dark"] {
  --cream:        #0F1612;
  --paper:        #161D18;
  --paper-2:      #1E2620;
  --ink:          #ECE7D6;
  --ink-soft:     #C8C2AE;
  --ink-mute:     #8A8C7C;
  --ink-faint:    #4F5247;

  /* Derive sage from the user-picked accent so it stays harmonious */
  --green-deep:   color-mix(in srgb, var(--user-accent) 22%, #D8E2C7 78%);
  --green-mid:    color-mix(in srgb, var(--user-accent) 40%, #D8E2C7 60%);
  --green-light:  #3A6D44;
  --green-tint:   #1F2A20;

  --accent:       var(--green-deep);
  --on-accent:    #0F1612;

  --rule:         rgba(200,221,184,0.55);
  --rule-soft:    rgba(200,221,184,0.18);
  --rule-hair:    rgba(200,221,184,0.10);
}

:root[data-density="compact"] {
  --gutter:    clamp(16px, 2.6vw, 40px);
  --max-w:     1200px;
}
:root[data-density="comfy"] {
  --gutter:    clamp(28px, 4.6vw, 80px);
  --max-w:     1380px;
}

/* ─── Base ─────────────────────────────────────────────────────────────── */

html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "ss02";
}

a { color: inherit; text-decoration: none; }
strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; }

::selection { background: var(--green-light); color: var(--ink); }
:root[data-theme="dark"] ::selection { background: var(--green-mid); color: var(--cream); }

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

/* Topographic background — very subtle */
.topo-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.10;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 800'><g fill='none' stroke='%231E3D2A' stroke-width='0.5'><path d='M-50 220 Q 150 180 320 240 T 700 200 T 900 260'/><path d='M-50 290 Q 180 260 360 320 T 700 290 T 900 330'/><path d='M-50 370 Q 200 340 400 390 T 720 370 T 900 410'/><path d='M-50 450 Q 220 410 440 470 T 740 440 T 900 480'/><path d='M-50 530 Q 240 490 480 550 T 760 520 T 900 550'/><path d='M-50 610 Q 260 570 520 630 T 780 600 T 900 630'/></g></svg>");
  background-size: 1100px 1100px;
}
:root[data-theme="dark"] .topo-bg {
  opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 800'><g fill='none' stroke='%23A8C39A' stroke-width='0.5'><path d='M-50 220 Q 150 180 320 240 T 700 200 T 900 260'/><path d='M-50 290 Q 180 260 360 320 T 700 290 T 900 330'/><path d='M-50 370 Q 200 340 400 390 T 720 370 T 900 410'/><path d='M-50 450 Q 220 410 440 470 T 740 440 T 900 480'/><path d='M-50 530 Q 240 490 480 550 T 760 520 T 900 550'/><path d='M-50 610 Q 260 570 520 630 T 780 600 T 900 630'/></g></svg>");
}

main { position: relative; z-index: 1; }

/* ─── Topbar (sticky, restrained) ──────────────────────────────────────── */

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: color-mix(in srgb, var(--cream) 90%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule-soft);
}
.topbar-inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 16px var(--gutter);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center; gap: 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px;
  letter-spacing: -0.01em; color: var(--ink);
  white-space: nowrap;
}
.brand .mark {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  color: var(--green-deep);
}
.brand .mark svg { width: 22px; height: 22px; }
.nav-main {
  display: flex; justify-content: center; gap: 28px;
  font-family: var(--mono);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.03em;
}
.nav-main a {
  color: var(--ink-mute);
  transition: color .15s;
}
.nav-main a:hover { color: var(--green-deep); }
.nav-main a .n { color: var(--ink-faint); margin-right: 4px; }
.cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-deep);
  color: var(--on-accent);
  padding: 9px 18px;
  font-size: 13px; font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: 100px;
  transition: background .15s, transform .15s;
}
.cta:hover { background: var(--green-mid); transform: translateY(-1px); }
@media (max-width: 940px) {
  /* Compact nav: shrink gap, hide §0X prefix, smaller type */
  .nav-main { gap: 14px; font-size: 11px; letter-spacing: 0.02em; }
  .nav-main a .n { display: none; }
  .topbar-inner { gap: 14px; }
}
@media (max-width: 640px) {
  /* Drop nav entirely on phones — just brand + CTA */
  .nav-main { display: none; }
  .topbar-inner { grid-template-columns: 1fr auto; padding: 12px var(--gutter); }
  .cta { padding: 8px 14px; font-size: 12px; }
}

/* ─── Section frame ────────────────────────────────────────────────────── */

section {
  padding: clamp(32px, 3.5vw, 56px) 0 clamp(72px, 8vw, 120px);
  position: relative;
}

.sec-head {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  gap: clamp(24px, 4vw, 56px);
  margin-bottom: clamp(48px, 6vw, 80px);
  align-items: start;
}
.sec-rail {
  font-family: var(--mono);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  border-top: 1px solid var(--rule);
  padding-top: 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.sec-rail .num {
  color: var(--green-deep);
  font-weight: 700;
}
.sec-head .body { padding-top: 6px; }
.sec-kicker {
  font-family: var(--mono);
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--green-deep);
  margin-bottom: 24px;
  display: inline-flex; align-items: center; gap: 10px;
}
h2.sec-title {
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 20ch;
  margin-bottom: 24px;
  text-wrap: balance;
}
h2.sec-title .green { color: var(--green-deep); }
h2.sec-title em { color: var(--green-mid); font-style: italic; font-weight: 600; }
.sec-lede {
  font-size: clamp(1.0625rem, 1.35vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 60ch;
  font-weight: 400;
}

@media (max-width: 760px) {
  .sec-head { grid-template-columns: 1fr; gap: 14px; }
}

/* ─── Hero ─────────────────────────────────────────────────────────────── */

.hero {
  padding: clamp(56px, 6vw, 96px) 0 0;
  display: flex; flex-direction: column;
  position: relative;
  border-bottom: 1px solid var(--rule-soft);
}
.hero-inner {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(20px, 3vw, 40px) 0 clamp(48px, 6vw, 90px);
  align-items: start;
}
.hero-rail {
  font-family: var(--mono);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  border-top: 1px solid var(--rule);
  padding-top: 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.hero-rail .num { color: var(--green-deep); font-weight: 700; }
.hero-body { min-width: 0; max-width: 100%; }
.hero-kicker {
  font-family: var(--mono);
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--green-deep);
  margin-bottom: 28px;
  display: inline-flex; align-items: center; gap: 10px;
}
.hero-title {
  font-size: clamp(2.2rem, 7vw, 6rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--ink);
  max-width: 14ch;
  text-wrap: balance;
}
.hero-title .green { color: var(--green-deep); }
.hero-title em { color: var(--green-mid); font-style: italic; font-weight: 600; }
.hero-sub {
  margin-top: 28px;
  font-size: clamp(1.0625rem, 1.4vw, 1.3125rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 52ch;
}
.hero-sub strong { color: var(--ink); font-weight: 600; }
.hero-actions {
  margin-top: 36px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--green-deep);
  color: var(--on-accent);
  padding: 14px 26px;
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: 100px;
  transition: background .15s, transform .15s;
}
.btn-primary:hover { background: var(--green-mid); transform: translateY(-1px); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); font-size: 15px; font-weight: 500;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 4px;
  transition: color .15s, border-color .15s;
}
.btn-ghost:hover { color: var(--green-deep); border-color: var(--green-deep); }

/* Mountain ridge silhouette */
.hero-ridge {
  width: 100%;
  height: clamp(180px, 22vw, 320px);
  border-top: 1px solid var(--rule-soft);
}
.hero-ridge svg { display: block; width: 100%; height: 100%; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
}

/* ─── §01 OS ───────────────────────────────────────────────────────────── */

#os {
  border-bottom: 1px solid var(--rule-soft);
}
.os-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0px, 0vw, 0px);
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
}
.os-panel {
  padding: clamp(28px, 4vw, 56px);
  position: relative;
}
.os-panel + .os-panel { border-left: 1px solid var(--rule-soft); }

.os-panel.inverted {
  background: var(--green-deep);
  color: var(--on-accent);
}
.os-panel.inverted .os-name,
.os-panel.inverted .os-tagline,
.os-panel.inverted p strong { color: var(--cream); }
.os-panel.inverted p { color: color-mix(in srgb, var(--cream) 78%, transparent); }
.os-panel.inverted .os-tag .lyr { color: var(--green-light); }
.os-panel.inverted .os-tag { color: color-mix(in srgb, var(--cream) 70%, transparent); }
.os-panel.inverted .tag-chip { border-color: color-mix(in srgb, var(--cream) 35%, transparent); color: var(--cream); }
.os-panel.inverted .os-tag { border-color: color-mix(in srgb, var(--cream) 32%, transparent); }

.os-tag {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-mute);
  margin-bottom: 24px;
  padding: 6px 12px;
  border: 1px solid var(--rule-soft);
  border-radius: 100px;
}
.os-tag .lyr { color: var(--green-deep); }

.os-name {
  font-size: clamp(2rem, 3.6vw, 2.875rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--green-deep);
  margin-bottom: 10px;
}
.os-tagline {
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  font-weight: 500;
  color: var(--ink-mute);
  margin-bottom: 28px;
  max-width: 32ch;
  font-style: italic;
}
.os-panel p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 14px;
  max-width: 50ch;
}
.os-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 28px;
}
.tag-chip {
  font-family: var(--mono);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border: 1px solid var(--rule-soft);
  border-radius: 100px;
  color: var(--ink-soft);
  background: transparent;
  white-space: nowrap;
}
.tag-chip.hot {
  background: var(--green-light);
  border-color: var(--green-light);
  color: var(--green-deep);
}
.os-panel.inverted .tag-chip.hot {
  background: var(--green-light);
  border-color: var(--green-light);
  color: var(--green-deep);
}

@media (max-width: 860px) {
  .os-grid { grid-template-columns: 1fr; }
  .os-panel + .os-panel { border-left: none; border-top: 1px solid var(--rule-soft); }
}

/* ─── §02 Lifecycle diagram ────────────────────────────────────────────── */

#lifecycle {
  border-bottom: 1px solid var(--rule-soft);
}
.ascent-stage {
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
}
.ascent-frame-h {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule-soft);
  font-family: var(--mono);
  font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--ink-mute);
}
.ascent-frame-h .pin { color: var(--green-deep); margin-right: 6px; }
.ascent-frame-h .legend { display: flex; gap: 18px; }
.ascent-frame-h .legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); }
.ascent-frame-h .legend .swatch { width: 9px; height: 9px; border-radius: 50%; }
.ascent-frame-h .legend .swatch.h { background: var(--green-deep); }
.ascent-frame-h .legend .swatch.a { background: var(--green-light); }

.ascent-mode { display: none; }
.ascent-mode.is-active { display: block; }

.ascent-profile {
  padding: 30px clamp(16px, 2.5vw, 36px) 0;
  background: var(--paper);
}
.ascent-profile svg { display: block; width: 100%; height: auto; }

.ascent-stations {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--rule-soft);
}
.ascent-station {
  padding: 24px 20px;
  border-right: 1px solid var(--rule-soft);
  background: var(--paper);
}
.ascent-station:last-child { border-right: none; }
.ascent-station .st-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-bottom: 8px;
}
.ascent-station .st-head .l { color: var(--green-deep); }
.ascent-station .st-head .alt { color: var(--ink-mute); }
.ascent-station .st-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 4px;
}
.ascent-station .st-sub {
  font-size: 0.8125rem;
  color: var(--ink-mute);
  margin-bottom: 18px;
}
.ascent-station .st-row {
  padding-top: 12px;
  border-top: 1px solid var(--rule-soft);
  margin-top: 12px;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.ascent-station .st-row:first-of-type { margin-top: 0; border-top: none; padding-top: 0; }
.ascent-station .st-row .who {
  font-family: var(--mono);
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  display: block; margin-bottom: 4px;
}
.ascent-station .st-row.h .who { color: var(--green-deep); }
.ascent-station .st-row.a .who { color: var(--green-mid); }

@media (max-width: 1000px) {
  .ascent-stations { grid-template-columns: repeat(2, 1fr); }
  .ascent-station { border-bottom: 1px solid var(--rule-soft); }
}
@media (max-width: 560px) {
  .ascent-stations { grid-template-columns: 1fr; }
  .ascent-station { border-right: none; }
}

.ascent-summit {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px;
  background: var(--green-deep);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
}
.ascent-summit .alt {
  font-family: var(--mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.06em;
  opacity: 0.78;
}

/* TABLE mode */
.ascent-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.9375rem;
  background: var(--paper);
}
.ascent-table th, .ascent-table td {
  text-align: left;
  padding: 16px 20px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}
.ascent-table thead th {
  font-family: var(--mono);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-mute);
  background: var(--paper-2);
}
.ascent-table .col-lyr { width: 60px; color: var(--green-deep); font-family: var(--mono); font-weight: 600; font-size: 12px; }
.ascent-table .col-alt { width: 90px; color: var(--ink-mute); font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.ascent-table .col-name {
  font-weight: 700;
  color: var(--ink);
  width: 22%;
  font-size: 1.0625rem;
  line-height: 1.2;
}
.ascent-table .col-name small {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-mute);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-top: 4px;
}
.ascent-table .col-h, .ascent-table .col-a { color: var(--ink-soft); line-height: 1.6; }

/* ─── §03 Team ─────────────────────────────────────────────────────────── */

#team {
  border-bottom: 1px solid var(--rule-soft);
}
.team-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(40px, 5vw, 80px);
  align-items: start;
}
.team-h { position: sticky; top: 100px; }

.team-role {
  font-family: var(--mono);
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--green-deep);
  margin-bottom: 18px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.team-role .count { color: var(--ink-faint); font-weight: 500; }

.team-h h3, .team-a h3 {
  font-size: clamp(1.625rem, 2.5vw, 2.125rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 24px;
  max-width: 22ch;
}
.team-h h3 .green, .team-a h3 .green { color: var(--green-deep); }
.team-h p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 14px;
  max-width: 46ch;
}
.team-h p strong { color: var(--ink); font-weight: 600; }
.team-h ul {
  list-style: none;
  margin-top: 28px;
  border-top: 1px solid var(--rule-soft);
}
.team-h li {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.9375rem;
  color: var(--ink);
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
}
.team-h li::before {
  content: counter(humanresp, decimal-leading-zero);
  counter-increment: humanresp;
  font-family: var(--mono); font-size: 11px;
  color: var(--green-deep); font-weight: 600;
  letter-spacing: 0.06em;
  padding-top: 1px;
}
.team-h ul { counter-reset: humanresp; }

.roster {
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
}
.roster-row {
  display: grid;
  grid-template-columns: 44px 1fr 1.4fr;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--rule-soft);
  align-items: start;
  transition: background .15s;
}
.roster-row:last-child { border-bottom: none; }
.roster-row:hover { background: var(--green-tint); }
.roster-row .num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--green-deep);
  font-weight: 600;
  letter-spacing: 0.06em;
  padding-top: 4px;
}
.roster-row .body {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.roster-row .body .role {
  display: block;
  font-family: var(--mono);
  font-style: normal;
  font-size: 11px;
  font-weight: 500;
  color: var(--green-deep);
  letter-spacing: 0.04em;
  margin-top: 6px;
}
.roster-row .desc {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
@media (max-width: 940px) {
  .team-grid { grid-template-columns: 1fr; }
  .team-h { position: static; }
}
@media (max-width: 600px) {
  .roster-row { grid-template-columns: 32px 1fr; padding: 18px 18px; }
  .roster-row .desc { grid-column: 2; }
}

/* ─── §04 Production ───────────────────────────────────────────────────── */

#prodai {
  border-bottom: 1px solid var(--rule-soft);
}
.surf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
}
.surf {
  padding: clamp(28px, 3.5vw, 48px);
  border-bottom: 1px solid var(--rule-soft);
}
.surf:nth-child(odd) { border-right: 1px solid var(--rule-soft); }
.surf:nth-child(5) {
  grid-column: 1 / -1;
  background: var(--green-deep);
  color: var(--on-accent);
  border-right: none;
  border-bottom: none;
}
.surf:nth-child(5) p { color: color-mix(in srgb, var(--cream) 78%, transparent); }
.surf:nth-child(5) p strong { color: var(--cream); }
.surf:nth-child(5) .surf-kicker { color: var(--green-light); }
.surf:nth-child(5) h4 { color: var(--cream); }
.surf:nth-child(5) h4 .green { color: var(--green-light); }
.surf:nth-child(3), .surf:nth-child(4) { border-bottom: 1px solid var(--rule-soft); }

.surf-kicker {
  font-family: var(--mono);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--green-deep);
  margin-bottom: 18px;
  display: inline-flex; align-items: center; gap: 8px;
}
.surf h4 {
  font-size: clamp(1.375rem, 2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 18px;
  max-width: 22ch;
}
.surf h4 .green { color: var(--green-deep); }
.surf p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 14px;
  max-width: 56ch;
}
.surf p strong { color: var(--ink); font-weight: 600; }

@media (max-width: 800px) {
  .surf-grid { grid-template-columns: 1fr; }
  .surf:nth-child(odd) { border-right: none; }
}

/* ─── §05 The compounding loop ─────────────────────────────────────────── */

#loop {
  border-bottom: 1px solid var(--rule-soft);
}
/* Reuses .ascent-stage / .ascent-frame-h / .ascent-profile / .ascent-summit
   from §02 — same alpine card shell, different content. */
.loop-phases {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule-soft);
  background: var(--paper);
}
.loop-phase {
  padding: 24px 20px;
  border-right: 1px solid var(--rule-soft);
}
.loop-phase:last-child { border-right: none; }
.loop-phase .ph-num {
  font-family: var(--mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--green-deep);
  margin-bottom: 8px;
}
.loop-phase .ph-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 4px;
}
.loop-phase .ph-sub {
  font-size: 0.8125rem;
  color: var(--ink-mute);
  margin-bottom: 14px;
}
.loop-phase .ph-desc {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

@media (max-width: 1000px) {
  .loop-phases { grid-template-columns: repeat(2, 1fr); }
  .loop-phase { border-bottom: 1px solid var(--rule-soft); }
  .loop-phase:nth-child(2n) { border-right: none; }
}
@media (max-width: 560px) {
  .loop-phases { grid-template-columns: 1fr; }
  .loop-phase { border-right: none; }
}

/* ─── §06 Result (pillars) ─────────────────────────────────────────────── */

#result {
  border-bottom: 1px solid var(--rule-soft);
}
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(20px, 2.5vw, 36px);
}
.pillar-card {
  padding: clamp(28px, 3.2vw, 44px) clamp(28px, 3vw, 40px) clamp(32px, 4vw, 48px);
  background: var(--paper);
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  position: relative;
  display: flex; flex-direction: column;
}
.pillar-card .pnum {
  font-family: var(--mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--green-deep);
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule-soft);
  text-transform: uppercase;
}
.pillar-card h3 {
  font-size: clamp(1.875rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--green-deep);
  margin-bottom: 18px;
}
.pillar-card p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

@media (max-width: 880px) {
  .pillars-grid { grid-template-columns: 1fr; }
}

/* ─── §06 Contact ──────────────────────────────────────────────────────── */

#contact {
  border-bottom: 1px solid var(--rule-soft);
}
.contact-block {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
.contact-body h2 {
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 24px;
  max-width: 16ch;
}
.contact-body h2 .green { color: var(--green-deep); }
.contact-body p {
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 52ch;
  margin-bottom: 36px;
}
.contact-email {
  display: inline-flex; align-items: center; gap: 14px;
  background: var(--green-deep);
  color: var(--on-accent);
  padding: 18px 28px;
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: 100px;
  transition: background .15s, transform .15s;
}
.contact-email:hover { background: var(--green-mid); transform: translateY(-1px); }
.contact-email .arrow { transition: transform .2s; }
.contact-email:hover .arrow { transform: translate(2px, -2px); }
@media (max-width: 760px) {
  .contact-block { grid-template-columns: 1fr; }
}

/* ─── Footer (colophon) ────────────────────────────────────────────────── */

footer {
  padding: 32px var(--gutter);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 20px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  align-items: center;
}
footer .foot-l strong { color: var(--ink); font-weight: 700; font-family: var(--sans); font-size: 14px; letter-spacing: -0.01em; }
footer .foot-c { text-align: center; }
footer .foot-r { text-align: right; }
footer .foot-r a { color: var(--green-deep); border-bottom: 1px solid var(--rule-soft); }
footer .foot-r a:hover { color: var(--green-mid); border-color: var(--green-mid); }
@media (max-width: 720px) {
  footer { grid-template-columns: 1fr; gap: 8px; text-align: left; }
  footer .foot-c, footer .foot-r { text-align: left; }
}

/* ─── Reveal-on-scroll ─────────────────────────────────────────────────── */

.reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ─── Scrollbar ────────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--rule-soft); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-mid); }

/* ─── Anchor offset (sticky topbar) ─────────────────────────────────────── */
/* Keep section headings clear of the sticky topbar when jumping via #anchors.
   Tight value (just clearing the ~60px topbar) so content lands close to header. */
main section[id] { scroll-margin-top: 64px; }

/* ─── Mobile refinements ───────────────────────────────────────────────── */

/* Tap target: .btn-ghost is an underlined link; bump the top hit area
   without moving the underline away from the text baseline. */
.btn-ghost { padding: 12px 4px 4px; }

@media (max-width: 760px) {
  /* The mountain-profile SVG renders its labels at ~3px on small screens.
     Hide the SVG; the .ascent-stations cards below carry the same info. */
  .ascent-profile { display: none; }
  .ascent-frame-h { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .ascent-frame-h .legend { gap: 12px; }
  .ascent-summit { padding: 14px 18px; font-size: 14px; }
  .ascent-summit .alt { display: none; }

  /* Smaller section padding on phones — same asymmetric pattern, tighter values */
  section { padding: clamp(24px, 5vw, 40px) 0 clamp(48px, 9vw, 72px); }
  main section[id] { scroll-margin-top: 56px; }
}

@media (max-width: 640px) {
  /* Drop the topo background on phones — small perf win, less visual noise */
  .topo-bg { display: none; }

  /* Tighter hero on phones */
  .hero-inner { padding: 16px 0 32px; }
  .hero-rail { padding-top: 10px; gap: 2px; }
  .hero-sub { margin-top: 20px; }
  .hero-actions { margin-top: 24px; gap: 12px; }

  /* Pillars/OS chips: ensure they wrap without horizontal overflow */
  .os-tags, .pillars-grid { gap: 8px; }
}
