/* Production homepage styles: selective scroll treatment adopted from issue #22. */

:root {
  --paper: #ffffff;
  --canvas: #f4f7fa;
  --ink: #0f2747;
  --muted: #556579;
  --line: #d7e2ed;
  --blue: #2563eb;
  --blue-deep: #174ea6;
  --blue-soft: #eaf3fc;
  --teal: #4ba3a0;
  --teal-deep: #2c7371;
  --teal-soft: #e5f4f3;
  --radius: 8px;

  /* dark chapter */
  --night: #061527;
  --night-2: #0a2440;
  --night-ink: #e9f2fc;
  --night-muted: #a3bdd8;
  --night-line: rgba(159, 197, 233, .22);
  --glow-teal: #6fd6d1;
  --glow-blue: #82b4ff;
  --warn: #e0a26a;

  --ease: cubic-bezier(.22, .7, .2, 1);
  --ease-out: cubic-bezier(.22, .7, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--night); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
h1, h2, h3 { margin-top: 0; letter-spacing: -.01em; line-height: 1.03; }
p { margin-top: 0; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--glow-teal); outline-offset: 3px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.button { display: inline-flex; min-height: 50px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius); padding: 14px 20px; font-weight: 850; line-height: 1.1; text-align: center; transition: transform .25s var(--ease-out), background-color .25s ease; }
.button.primary { background: var(--blue); color: var(--paper); box-shadow: 0 10px 30px rgba(37, 99, 235, .28); }
.button.primary:hover { background: #3b76f6; transform: translateY(-2px); }

.kicker { margin-bottom: 16px; color: var(--teal-deep); font-size: .76rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.note { color: var(--muted); font-size: .92rem; font-weight: 700; line-height: 1.6; }

.site-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px clamp(16px, 4vw, 48px); border-bottom: 1px solid transparent; background: rgba(6, 21, 39, .72); color: var(--night-ink); backdrop-filter: blur(12px); transition: background-color .4s ease, border-color .4s ease, color .4s ease; }
.site-header.is-light { border-bottom-color: var(--line); background: rgba(248, 250, 252, .9); color: var(--ink); }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 40px; height: 40px; object-fit: contain; }
.site-header:not(.is-light) .brand-mark { filter: brightness(0) invert(1); opacity: .92; }
.brand-name { font-size: .9rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.nav { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px; font-size: .88rem; font-weight: 760; }
.nav a { padding: 9px 11px; border-radius: 6px; opacity: .82; transition: opacity .2s ease, background-color .2s ease; }
.nav a:hover { opacity: 1; }
.nav .nav-cta { background: var(--blue); color: var(--paper); opacity: 1; }
.nav .nav-cta:hover { background: #3b76f6; }

/* --- dark chapter shell ----------------------------------------------- */

.darkzone { position: relative; z-index: 1; background: radial-gradient(120% 90% at 78% 12%, #0d2b4c 0%, var(--night) 62%); color: var(--night-ink); }
/* The sticky graphic stops at the end of this zone; fade it out so it does not
   end on a hard cut against the light chapters. */
.darkzone::after { position: absolute; right: 0; bottom: 0; left: 0; z-index: 0; height: 420px; background: linear-gradient(rgba(6, 21, 39, 0) 0%, rgba(6, 21, 39, .82) 52%, var(--night) 100%); content: ""; pointer-events: none; }
.darkzone h1, .darkzone h2, .darkzone h3 { color: var(--night-ink); }
.darkzone .kicker { color: var(--glow-teal); }
.darkzone .note { color: var(--night-muted); }

.systemfield { position: sticky; top: 0; z-index: 0; height: 100svh; margin-bottom: -100svh; pointer-events: none; }
.field { width: 100%; height: 100%; opacity: var(--field-opacity, 1); }
.field-grid { color: #7fb0e6; opacity: calc(.05 + var(--p, 0) * .07); transition: opacity .4s linear; }

/* --tangle defaults to 1 so the graphic renders in its resolved, ordered state
   when this page is read without JavaScript. */
.tangles path { fill: none; stroke: var(--warn); stroke-width: 1.6; opacity: .55; }
.tangles, .deadends, .ghosts { opacity: calc(1 - var(--tangle, 1)); }
.deadends circle { fill: none; stroke: var(--warn); stroke-width: 1.6; opacity: .6; }
.ghosts rect { fill: none; stroke: #9db6d0; stroke-width: 1.2; stroke-dasharray: 5 6; opacity: .45; }

.routes path { fill: none; stroke: var(--glow-blue); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: var(--draw, 0); opacity: calc(.25 + var(--route, 1) * .55); }
.flow path { fill: none; stroke-width: 3.5; stroke-linecap: round; opacity: var(--flow, 0); }

.node > rect { fill: rgba(8, 26, 46, .82); stroke: var(--warn); stroke-width: 1.5; transition: stroke .6s ease, fill .6s ease; }
.node text { fill: var(--night-muted); font-size: 15px; font-weight: 700; text-anchor: middle; transition: fill .6s ease; }
/* The same six glyphs as the capability tiles further down the page, so the
   graphic and that chapter are visibly naming the same six systems. */
.node-icon { fill: none; stroke: var(--warn); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: stroke .6s ease; }
.field.is-ordered .node > rect { fill: rgba(10, 36, 64, .9); stroke: var(--glow-teal); }
.field.is-ordered .node text { fill: #d8ecff; }
.field.is-ordered .node-icon { stroke: var(--glow-teal); }
.field.is-chaotic .node { animation: drift 5.5s ease-in-out infinite alternate; }
.field.is-chaotic .node:nth-child(2n) { animation-duration: 6.8s; }
.field.is-chaotic .node:nth-child(3n) { animation-duration: 4.9s; }

@keyframes drift { from { opacity: .82; } to { opacity: 1; } }

/* --- hero -------------------------------------------------------------- */

.hero { position: relative; z-index: 1; display: grid; align-content: center; min-height: calc(100svh - 118px); padding: clamp(56px, 9vh, 110px) clamp(18px, 5vw, 72px) 64px; }
.hero::before { position: absolute; inset: 0; background: linear-gradient(96deg, rgba(6, 21, 39, .94) 0%, rgba(6, 21, 39, .8) 40%, rgba(6, 21, 39, .1) 74%); content: ""; }
.hero-inner { position: relative; width: min(1120px, 100%); margin-inline: auto; }
.hero h1 { margin-bottom: 26px; font-weight: 900; }
.hero-lead { display: block; font-size: clamp(1.6rem, 3.6vw, 3rem); font-weight: 800; letter-spacing: -.02em; opacity: .82; }
.hero-run { display: block; max-width: 980px; margin-top: .08em; background: linear-gradient(96deg, var(--night-ink) 12%, var(--glow-teal) 72%); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: clamp(3.5rem, 6.5vw, 6.8rem); font-weight: 900; letter-spacing: -.045em; line-height: .9; }
.lede { max-width: 640px; margin-bottom: 28px; color: var(--night-muted); font-size: clamp(1.02rem, 1.6vw, 1.22rem); line-height: 1.7; }
.hero-actions { margin: 0 0 18px; }
.hero .note { max-width: 600px; margin: 0; }
.scroll-cue { position: absolute; bottom: 22px; left: 50%; margin: 0; color: var(--night-muted); font-size: .72rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; translate: -50% 0; }
.scroll-cue span { display: block; width: 1px; height: 34px; margin: 0 auto 10px; background: linear-gradient(var(--glow-teal), transparent); animation: cue 2.2s ease-in-out infinite; }

@keyframes cue { 0%, 100% { transform: scaleY(.4); transform-origin: top; opacity: .5; } 50% { transform: scaleY(1); transform-origin: top; opacity: 1; } }

/* --- pinned RUN scene --------------------------------------------------- */

.run-scene { position: relative; z-index: 1; height: 420svh; }
.run-stage { position: sticky; top: 0; display: grid; align-items: center; height: 100svh; }
.run-stage::before { position: absolute; inset: 0; background: linear-gradient(95deg, rgb(6, 21, 39) 0%, rgb(6, 21, 39) 58%, rgba(6, 21, 39, .82) 66%, rgba(6, 21, 39, 0) 76%); content: ""; }
.run-copy { position: relative; width: min(1120px, 100%); margin-inline: auto; padding-inline: clamp(18px, 5vw, 72px); }
.run-states { position: relative; min-height: 20.5rem; }
.run-state { position: absolute; top: 0; right: 0; left: 0; max-width: 620px; }
.run-state:not(.is-active) { pointer-events: none; }
.run-state h3 { margin-bottom: 20px; font-weight: 900; }
.q-run { display: block; font-size: clamp(3.4rem, 9.5vw, 8.4rem); letter-spacing: -.05em; line-height: .84; opacity: 0; }
.q-word { display: block; margin-top: .06em; color: var(--glow-teal); font-size: clamp(1.9rem, 5vw, 4.1rem); letter-spacing: -.03em; }
.state-index { margin-bottom: 14px; color: var(--glow-blue); font-size: .78rem; font-weight: 900; letter-spacing: .18em; }
.state-body { margin-bottom: 14px; color: var(--night-ink); font-size: clamp(1.02rem, 1.5vw, 1.2rem); font-weight: 700; line-height: 1.6; }
.state-chip { display: inline-block; margin: 0; border-left: 2px solid rgba(224, 162, 106, .8); padding: 4px 0 4px 12px; color: var(--night-muted); font-size: .93rem; line-height: 1.55; }

.run-state.is-active .q-run { opacity: 1; }
.run-state :is(.state-index, .q-word, .state-body, .state-chip) { opacity: 0; transform: translateY(20px); transition: opacity .5s ease, transform .55s var(--ease-out); }
.run-state.is-active :is(.state-index, .q-word, .state-body, .state-chip) { opacity: 1; transform: none; }
.run-state.is-active .q-word { transition-delay: .04s; }
.run-state.is-active .state-body { transition-delay: .11s; }
.run-state.is-active .state-chip { transition-delay: .17s; }

.run-rail { display: flex; gap: 8px; width: 210px; margin: 40px 0 0; }
.run-rail span { position: relative; height: 3px; flex: 1; overflow: hidden; border-radius: 3px; background: rgba(159, 197, 233, .22); }
.run-rail span::after { position: absolute; inset: 0; background: var(--glow-teal); content: ""; transform: scaleX(var(--seg, 0)); transform-origin: left; transition: transform .3s linear; }

/* --- light chapters ----------------------------------------------------- */

/* One continuous field rather than per-chapter background bands: chapters are
   separated by spacing and a hairline, and the page deepens toward the water of
   the closing panel. */
.lightzone { position: relative; z-index: 1; margin-bottom: 100svh; background: linear-gradient(180deg, #f7fbff 0%, #eef6fd 38%, #e4f1fb 72%, #d9ecfa 100%); color: var(--ink); }
.lightzone > section + section { border-top: 1px solid rgba(15, 39, 71, .07); }
.lightzone > section { position: relative; z-index: 1; }

.lightzone h2 { font-size: clamp(2rem, 4.2vw, 3.7rem); font-weight: 880; }
.lightzone h3 { font-size: 1.24rem; font-weight: 850; line-height: 1.22; }
/* `:not([class])` keeps this from overriding .kicker, .label, .step-num, and .note. */
.lightzone p:not([class]) { color: var(--muted); font-size: 1rem; line-height: 1.7; }
.section-head { width: min(1120px, 100%); margin: 0 auto 40px; }
.section-head h2 { max-width: 820px; color: var(--ink); }
.section-lede { max-width: 620px; margin: 18px 0 0; }

.plan { padding: clamp(72px, 9vw, 118px) clamp(18px, 5vw, 72px); }
/* Timeline: the rail sits above the cards and draws left to right with scroll,
   while each numbered badge straddles it. */
/* One thread runs through all three numbered badges and draws left to right as
   the section is scrolled. */
.plan-steps { position: relative; display: grid; width: min(1120px, 100%); grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-inline: auto; }
.plan-rail { position: absolute; top: 49px; right: 0; left: 0; z-index: 2; height: 2px; background: linear-gradient(90deg, var(--blue) 0%, var(--teal) 100%); transform: scaleX(var(--rail, 0)); transform-origin: left; transition: transform .2s linear; }
.plan-steps article { position: relative; border: 1px solid #c6d8e9; background: var(--paper); padding: 28px; box-shadow: 0 10px 26px rgba(15, 39, 71, .05); }
.step-num { position: relative; z-index: 3; display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; margin: 0 0 22px; border: 4px solid var(--paper); border-radius: 999px; background: var(--blue); color: var(--paper); font-size: .82rem; font-weight: 900; }
.plan-steps h3 { margin-bottom: 10px; color: var(--ink); }
.plan-steps p:last-child { margin-bottom: 0; }

.ways { padding: clamp(72px, 9vw, 118px) clamp(18px, 5vw, 72px); }
.way-grid { display: grid; width: min(1120px, 100%); grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-inline: auto; }
.way-grid article { border: 1px solid var(--line); background: var(--paper); padding: 28px; box-shadow: 0 10px 26px rgba(15, 39, 71, .05); transition: transform .4s var(--ease-out), box-shadow .4s ease; }
.way-grid article:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(15, 39, 71, .08); }
.way-grid article:nth-child(2) { background: var(--teal-soft); border-color: rgba(75, 163, 160, .45); }
.label { margin-bottom: 12px; color: var(--blue); font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.way-grid h3 { margin-bottom: 12px; color: var(--ink); }
.way-grid p:last-child { margin-bottom: 0; }

.systems { padding: clamp(72px, 9vw, 118px) clamp(18px, 5vw, 72px); }
.system-grid { display: grid; width: min(1120px, 100%); grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0 auto; padding: 0; list-style: none; }
.system-grid li { display: flex; align-items: center; gap: 16px; border: 1px solid rgba(75, 163, 160, .42); background: rgba(255, 255, 255, .78); padding: 20px; transition: transform .4s var(--ease-out), background-color .3s ease, border-color .3s ease; }
.system-grid li:hover { border-color: var(--teal-deep); background: var(--paper); transform: translateY(-3px); }
.sys-icon { display: grid; width: 46px; height: 46px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: rgba(44, 115, 113, .12); }
.sys-icon svg { width: 25px; height: 25px; fill: none; stroke: var(--teal-deep); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sys-label { color: var(--ink); font-size: 1.02rem; font-weight: 800; line-height: 1.3; }

.outcomes { padding: clamp(72px, 9vw, 118px) clamp(18px, 5vw, 72px); }
.outcome-list { width: min(1120px, 100%); margin: 0 auto; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.outcome-list li { border-bottom: 1px solid var(--line); }
.mask { display: block; overflow: hidden; }
.mask-in { display: flex; align-items: baseline; gap: clamp(14px, 3vw, 40px); padding: clamp(16px, 2.4vw, 26px) 0; color: var(--ink); font-size: clamp(1.4rem, 3.4vw, 2.7rem); font-weight: 860; letter-spacing: -.02em; line-height: 1.1; }
.mask-in em { color: var(--teal-deep); font-size: .74rem; font-style: normal; font-weight: 900; letter-spacing: .16em; }
.outcome-list li:hover .mask-in { color: var(--blue-deep); }



/* --- scroll-revealed CTA ------------------------------------------------ */

.cta-reveal { position: fixed; right: 0; bottom: 0; left: 0; z-index: 0; display: grid; align-content: center; height: 100svh; padding: 40px clamp(18px, 5vw, 72px) 70px; background: radial-gradient(110% 80% at 20% 20%, #10375f 0%, var(--night) 64%); color: var(--night-ink); }
.cta-inner { position: relative; width: min(760px, 100%); margin-inline: auto; text-align: center; opacity: var(--cta, 1); transform: translateY(calc(34px * (1 - var(--cta, 1)))); }

/* The drop lands here. Rings start once the panel is mostly uncovered, so the
   impact reads as the arrival of the closing message. */
/* Ripples only exist below the surface line, so mask off everything above it.
   That also keeps the founder note and headline clear of stray arcs. */
.water { position: absolute; inset: 0; overflow: hidden; pointer-events: none; -webkit-mask-image: linear-gradient(to bottom, transparent calc(var(--surface, 52%) - 1px), #000 var(--surface, 52%)); mask-image: linear-gradient(to bottom, transparent calc(var(--surface, 52%) - 1px), #000 var(--surface, 52%)); }
.water-line { position: absolute; top: var(--surface, 52%); right: 0; left: 0; height: 1px; background: linear-gradient(90deg, rgba(111, 214, 209, 0), rgba(111, 214, 209, .2) 34%, rgba(111, 214, 209, .2) 66%, rgba(111, 214, 209, 0)); opacity: 0; transition: opacity .8s ease; }
.ripples { position: absolute; top: var(--surface, 52%); left: var(--drop-x, 66%); opacity: 0; transition: opacity .5s ease; }
.ripples span { position: absolute; top: 0; left: 0; width: min(760px, 84vw); height: 168px; border: 1px solid rgba(133, 226, 220, .55); border-radius: 50%; }
/* Resting state, which is what a reduced-motion visitor sees. */
.ripples span:nth-child(1) { opacity: .3; transform: translate(-50%, -50%) scale(.32); }
.ripples span:nth-child(2) { opacity: .24; transform: translate(-50%, -50%) scale(.58); }
.ripples span:nth-child(3) { opacity: .17; transform: translate(-50%, -50%) scale(.84); }
.cta-reveal.is-open .water-line, .cta-reveal.is-open .ripples { opacity: 1; }

.cta-reveal.is-open .ripples span { animation: ripple 5.4s cubic-bezier(.16, .74, .3, 1) infinite; }
.cta-reveal.is-open .ripples span:nth-child(2) { animation-delay: 1.8s; }
.cta-reveal.is-open .ripples span:nth-child(3) { animation-delay: 3.6s; }

@keyframes ripple {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.06); }
  12% { opacity: .42; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.18); }
}

/* A calm guide introduction, not a testimonial card: no pill, no border, no
   badge chrome. Just the founder, what he believes, and room around it. */
.founder { display: grid; justify-items: center; gap: 14px; margin: 0 auto 36px; }
.founder-avatar { width: 92px; height: 92px; border-radius: 14px; border: 1px solid rgba(159, 197, 233, .3); object-fit: cover; object-position: 50% 40%; }
.founder p { margin: 0; max-width: 52ch; color: var(--night-muted); font-size: .95rem; line-height: 1.65; text-align: center; }
.founder strong { display: block; margin-bottom: 6px; color: var(--night-ink); font-size: 1.16rem; font-weight: 760; letter-spacing: -.01em; }

/* Closing context, not a trailer on the previous chapter: this grounds the offer
   alongside the founder and the call to action instead of scrolling away above it. */
.cta-location { max-width: 620px; margin: 26px auto 0; padding-top: 22px; border-top: 1px solid var(--night-line); color: var(--night-muted); font-size: .9rem; font-weight: 650; line-height: 1.6; }

.cta-footer { position: absolute; right: 0; bottom: 22px; left: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin: 0; color: var(--night-muted); font-size: .8rem; font-weight: 700; opacity: var(--cta, 1); }
.site-footer { display: contents; }
.cta-footer a:hover { color: var(--night-ink); }
.cta-inner .kicker { color: var(--glow-teal); }
.cta-inner h2 { margin-bottom: 18px; color: var(--night-ink); font-size: clamp(2rem, 4.4vw, 3.6rem); font-weight: 880; }
.cta-inner > p { margin-bottom: 26px; color: var(--night-muted); font-size: clamp(1.02rem, 1.6vw, 1.18rem); line-height: 1.7; }
.cta-inner .note { margin: 20px 0 0; color: var(--night-muted); }

/* --- reveal utilities --------------------------------------------------- */

.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .8s var(--ease-out); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .plan-steps .reveal:nth-of-type(2) { transition-delay: .12s; }
.js .plan-steps .reveal:nth-of-type(3) { transition-delay: .24s; }
.js .way-grid .reveal:nth-child(2) { transition-delay: .1s; }
.js .way-grid .reveal:nth-child(3) { transition-delay: .2s; }
.js .system-grid .reveal { transform: translateY(20px) scale(.96); }
.js .system-grid .reveal.is-in { transform: none; }
.js .system-grid .reveal:nth-child(2) { transition-delay: .07s; }
.js .system-grid .reveal:nth-child(3) { transition-delay: .14s; }
.js .system-grid .reveal:nth-child(4) { transition-delay: .21s; }
.js .system-grid .reveal:nth-child(5) { transition-delay: .28s; }
.js .system-grid .reveal:nth-child(6) { transition-delay: .35s; }
.js .system-grid .sys-icon svg > * { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .system-grid .reveal.is-in .sys-icon svg > * { stroke-dashoffset: 0; transition: stroke-dashoffset .8s ease .15s; }
.js .outcome-list .reveal { opacity: 1; transform: none; }
.js .outcome-list .mask-in { transform: translateY(115%); transition: transform .85s var(--ease-out); }
.js .outcome-list .reveal.is-in .mask-in { transform: none; }
.js .outcome-list .reveal:nth-child(2) .mask-in { transition-delay: .07s; }
.js .outcome-list .reveal:nth-child(3) .mask-in { transition-delay: .14s; }
.js .outcome-list .reveal:nth-child(4) .mask-in { transition-delay: .21s; }
.js .outcome-list .reveal:nth-child(5) .mask-in { transition-delay: .28s; }
.js .outcome-list .reveal:nth-child(6) .mask-in { transition-delay: .35s; }

/* Selective mode: the RUN sequence and the closing reveal keep their motion, and
   every other chapter shares one entrance — same distance, same duration, no
   per-item stagger, no scale, no mask, no icon drawing. The point is that the
   light chapters read as one calm system rather than six separate effects. */
[data-motion="selective"] .reveal { transform: translateY(18px); transition: opacity .55s ease, transform .55s var(--ease-out); transition-delay: 0s !important; }
[data-motion="selective"] .reveal.is-in { transform: none; }
[data-motion="selective"] .mask-in { transform: none !important; transition: none !important; }
[data-motion="selective"] .sys-icon svg > *, [data-motion="off"] .sys-icon svg > * { stroke-dasharray: none; stroke-dashoffset: 0; }
[data-motion="selective"] .plan-rail { transform: none; }
[data-motion="selective"] .way-grid article:hover, [data-motion="selective"] .system-grid li:hover { transform: none; }

/* --- static scene: no JS, reduced motion, motion off, or narrow screens --- */

.no-js .run-scene, .static-scene .run-scene { height: auto; }
.no-js .run-stage, .static-scene .run-stage { position: static; height: auto; padding-block: clamp(54px, 8vw, 90px); }
.no-js .run-stage::before, .static-scene .run-stage::before { background: linear-gradient(180deg, rgba(6, 21, 39, .55), rgba(6, 21, 39, .92)); }
.no-js .run-states, .static-scene .run-states { position: static; display: grid; min-height: 0; gap: 14px; }
.no-js .run-state, .static-scene .run-state { position: static; max-width: none; border: 1px solid var(--night-line); border-radius: 10px; padding: clamp(20px, 3vw, 30px); background: rgba(6, 21, 39, .78); backdrop-filter: blur(6px); }
.no-js .run-state h3, .static-scene .run-state h3 { margin-bottom: 14px; }
.no-js .q-run, .static-scene .q-run { display: inline; font-size: clamp(2.2rem, 8vw, 3.4rem); opacity: 1; }
.no-js .q-word, .static-scene .q-word { display: inline; margin-left: .16em; font-size: clamp(2.2rem, 8vw, 3.4rem); }
.no-js .run-state :is(.state-index, .q-word, .state-body, .state-chip), .static-scene .run-state :is(.state-index, .q-word, .state-body, .state-chip) { opacity: 1; transform: none; transition: none; }
.no-js .run-rail, .static-scene .run-rail { display: none; }
.no-js .systemfield, .static-scene .systemfield { height: 62svh; margin-bottom: -62svh; }
/* Stacked cards sit on top of the graphic, so hold it further back. */
.no-js .field, .static-scene .field { opacity: .5; }
/* Motion off: the whole page is legible and complete without a single transition. */
[data-motion="off"] * { animation: none !important; transition: none !important; }
[data-motion="off"] .reveal, [data-motion="off"] .mask-in { opacity: 1 !important; transform: none !important; }
[data-motion="off"] .scroll-cue { display: none; }
[data-motion="off"] .plan-rail { transform: none; }

/* --- responsive --------------------------------------------------------- */

@media (max-width: 980px) {
  .plan-steps, .way-grid { grid-template-columns: 1fr; }
  .plan-rail { display: none; }
  .system-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .site-header { padding-inline: 16px; }
  .brand-name { display: none; }
  .nav { font-size: .82rem; }
  .hero { min-height: auto; padding-top: clamp(40px, 8vh, 72px); }
  .scroll-cue { display: none; }
  .cta-footer { bottom: 64px; }
}

@media (max-height: 720px) {
  .founder { margin-bottom: 22px; gap: 10px; }
  .founder-avatar { width: 66px; height: 66px; }
  .founder p { font-size: .88rem; }
  .founder strong { font-size: 1.05rem; }
  .cta-inner h2 { margin-bottom: 12px; font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
  .cta-inner > p { margin-bottom: 18px; }
  .cta-location { margin-top: 18px; padding-top: 16px; font-size: .85rem; }
}

@media (max-width: 620px) {
  .system-grid { grid-template-columns: 1fr; }
  .nav a:not(.nav-cta) { display: none; }
  /* The closing panel is fixed, so its content cannot be allowed to outgrow the
     viewport. The meta row rejoins the flow and the type steps down. */
  .cta-reveal { padding: 30px 18px 34px; overflow-y: auto; overscroll-behavior: contain; }
  .cta-footer { position: static; margin-top: 20px; }
  .founder { gap: 10px; margin-bottom: 24px; }
  .founder-avatar { width: 64px; height: 64px; }
  .founder strong { font-size: 1rem; }
  .founder p { font-size: .84rem; }
  .cta-inner h2 { margin-bottom: 12px; font-size: clamp(1.55rem, 7vw, 2rem); }
  .cta-inner > p { margin-bottom: 18px; font-size: .95rem; }
  .cta-inner .note { margin-top: 16px; font-size: .84rem; }
  .cta-location { margin-top: 16px; padding-top: 14px; font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
  .reveal, .mask-in { opacity: 1 !important; transform: none !important; }
  .scroll-cue { display: none; }
}
