/* =========================================================================
   tagliavia.dev
   Palette derives from the Tagliavia mark's own gradient (#091a45 → #1b76ff).
   Committed single-theme: the deep navy world is the brand's world, not an
   omission. Semantic ember is reserved for cost/waste states only.
   ========================================================================= */

:root {
  /* ---- color ---- */
  --ink:        #05091A;   /* ground — deeper than brand navy so navy reads raised */
  --ink-2:      #080F26;   /* alternating band */
  --abyss:      #0B1638;   /* panels, brand navy family */
  --abyss-2:    #101E48;   /* panel hover / raised */
  --signal:     #1B76FF;   /* brand accent — spent one place at a time */
  --signal-dim: #0E4CB8;
  --signal-ghost: rgba(27, 118, 255, .13);
  --haze:       #93A6C9;   /* secondary text: blue-biased neutral, chosen not inherited */
  --haze-dim:   #5D6E92;
  --bone:       #E8EDF7;   /* primary text */
  --ember:      #FF8A4C;   /* semantic ONLY: cost, waste, the "before" */
  --ember-dim:  #A3512A;
  --line:       rgba(147, 166, 201, .17);
  --line-soft:  rgba(147, 166, 201, .09);

  /* ---- type ---- */
  --f-display: "Archivo", system-ui, sans-serif;
  --f-body:    "Newsreader", Georgia, serif;
  --f-mono:    "IBM Plex Mono", ui-monospace, monospace;

  --t-hero:  clamp(2.9rem, 7.6vw, 6.75rem);
  --t-h2:    clamp(2rem, 4.3vw, 3.5rem);
  --t-h3:    clamp(1.35rem, 2.1vw, 1.9rem);
  --t-h4:    clamp(1.05rem, 1.4vw, 1.25rem);
  --t-lede:  clamp(1.075rem, 1.35vw, 1.3rem);
  --t-body:  clamp(1rem, 1.05vw, 1.075rem);
  --t-small: .875rem;
  --t-mono:  .72rem;

  /* ---- layout ---- */
  --rail-w: 210px;   /* reserve covers the widest rail label plus clearance */
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --col:    1180px;                    /* content column; widens on large screens */
  --shell:  1600px;                    /* header's outer bound, so it doesn't sprawl */
  --wrap:   min(var(--col), 100% - (var(--gutter) * 2));
  --band-y: clamp(4rem, 10vh, 9.5rem);
  --r:      4px;   /* small radii, deliberately not rounded-lg */

  /* ---- brand mark ----
     Sized in em against the mono text sitting on the same line, so the ratio
     holds at every breakpoint. Floor is 1.3em; these sit well above it. */
  --logo-topbar: 2.7em;
  --logo-foot:   3.2em;
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--f-body);
  font-size: var(--t-body);
  font-weight: 300;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--signal); color: #fff; padding: .75rem 1.25rem;
  font-family: var(--f-mono); font-size: var(--t-small);
}
.skip:focus { left: 1rem; top: 1rem; }

/* =========================================================================
   Shared primitives
   ========================================================================= */

.wrap { width: var(--wrap); margin-inline: auto; }

.eyebrow {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--signal);
  display: flex;
  gap: .6rem;
  align-items: center;
  margin-bottom: 1.5rem;
}
.eyebrow__sep { color: var(--haze-dim); }

.h2 {
  font-family: var(--f-display);
  font-size: var(--t-h2);
  font-weight: 700;
  letter-spacing: -.032em;
  line-height: 1.02;
  text-wrap: balance;
  margin: 0 0 1.5rem;
  max-width: 20ch;
}
.h3 {
  font-family: var(--f-display);
  font-size: var(--t-h3);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.12;
  text-wrap: balance;
  margin: 0 0 1rem;
}

.lede {
  font-size: var(--t-lede);
  color: var(--haze);
  max-width: 60ch;
  line-height: 1.62;
  margin-bottom: 3.5rem;
}
.lede--wide { max-width: 68ch; }
.lede em { color: var(--bone); font-style: italic; }

.link {
  font-family: var(--f-mono);
  font-size: var(--t-small);
  letter-spacing: .02em;
  color: var(--signal);
  text-decoration: none;
  border-bottom: 1px solid var(--signal-ghost);
  padding-bottom: 2px;
  transition: border-color .25s, color .25s;
  align-self: start;
}
.link:hover { border-color: var(--signal); }

.btn {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: var(--t-small);
  font-weight: 500;
  letter-spacing: .04em;
  padding: .95rem 1.7rem;
  border-radius: var(--r);
  text-decoration: none;
  transition: background .25s, border-color .25s, color .25s, transform .25s;
}
.btn--solid { background: var(--signal); color: #fff; border: 1px solid var(--signal); }
.btn--solid:hover { background: #3d8bff; border-color: #3d8bff; transform: translateY(-2px); }
.btn--ghost { border: 1px solid var(--line); color: var(--bone); }
.btn--ghost:hover { border-color: var(--signal); color: var(--signal); }

.pullquote {
  margin: 4.5rem 0 0;
  padding: 2.5rem 0 2.5rem 2.5rem;
  border-left: 2px solid var(--signal);
  max-width: 75%;
}
.pullquote p {
  font-family: var(--f-body);
  font-style: italic;
  font-size: clamp(1.45rem, 2.7vw, 2.3rem);
  line-height: 1.32;
  letter-spacing: -.01em;
  color: var(--bone);
  text-wrap: balance;
}

code {
  font-family: var(--f-mono);
  font-size: .86em;
  color: var(--signal);
}

/* =========================================================================
   Top bar
   ========================================================================= */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  /* Aligns the header with the content instead of pinning it to the screen
     edges, which reads as sprawl on a wide monitor. */
  padding: .9rem max(var(--gutter), calc((100% - var(--shell)) / 2));
  background: rgba(5, 9, 26, .82);                        /* fallback */
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .35s, background .35s;
}
.topbar.is-stuck { border-bottom-color: var(--line-soft); }

/* The mark takes the mono size of the links beside it, then scales past it. */
.topbar__mark {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  font-size: var(--t-mono);
}
.topbar__mark img {
  height: var(--logo-topbar);
  width: auto;
  transition: opacity .25s;
}
.topbar__mark:hover img { opacity: .78; }

.topbar__nav {
  display: flex;
  align-items: center;
  gap: clamp(.9rem, 2.2vw, 2rem);
  min-width: 0;
}
.topbar__back { color: var(--bone) !important; }
.topbar__nav a {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: var(--haze);
  transition: color .25s;
}
.topbar__nav a:hover { color: var(--bone); }
.topbar__cta {
  border: 1px solid var(--line);
  padding: .55rem 1rem;
  border-radius: var(--r);
  color: var(--bone) !important;
}
.topbar__cta:hover { border-color: var(--signal); color: var(--signal) !important; }
.topbar__cta--short { display: none; }

/* ---- language switcher ---- */
.lang {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: .1em;
  flex-shrink: 0;
}
.lang a {
  color: var(--haze-dim);
  text-decoration: none;
  padding: .35rem .15rem;
  transition: color .25s;
}
.lang a:hover { color: var(--bone); }
.lang a[aria-current="true"] { color: var(--signal); }
.lang__sep { color: var(--line); }

/* =========================================================================
   Index rail — the page indexes itself
   ========================================================================= */

.rail {
  position: fixed;
  /* Track the content column on wide screens instead of drifting to the
     viewport edge, so the index stays visibly attached to what it indexes. */
  left: max(var(--gutter), calc((100% - var(--col)) / 2 - var(--rail-w)));
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: none;
  padding-left: 1.15rem;
}
.rail__list { display: flex; flex-direction: column; gap: .95rem; }
.rail__list a {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--haze-dim);
  transition: color .3s;
}
.rail__n { font-variant-numeric: tabular-nums; opacity: .55; }
.rail__t {
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .3s, transform .3s;
}
.rail:hover .rail__t { opacity: 1; transform: none; }
.rail__list a:hover { color: var(--haze); }
.rail__list a.is-active { color: var(--signal); }
.rail__list a.is-active .rail__n { opacity: 1; }
.rail__list a.is-active .rail__t { opacity: 1; transform: none; }

.rail__trace {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 1px;
  background: var(--line);
}
.rail__trace i {
  position: absolute;
  inset: 0 0 auto 0;
  display: block;
  height: 0;
  background: var(--signal);
  box-shadow: 0 0 10px var(--signal);
}

@media (min-width: 1180px) {
  .rail { display: block; }
  /* Width flows from the margins instead of being fixed: a fixed 1180px column
     pushed right by the rail reserve was clipping off-screen at 1180–1460
     viewports. width:auto + max-width can never overflow.
     .hero__inner gets the same treatment in its own block, placed after its
     base rule — same specificity, so source order decides. */
  .wrap {
    width: auto;
    max-width: var(--col);
    margin-left: max(calc(var(--rail-w) + 2.5rem), calc((100% - var(--col)) / 2));
    margin-right: var(--gutter);
  }
}

/* Large and ultrawide displays: let the column grow rather than stranding it
   in the middle of the screen. Measure stays capped by the ch limits on text. */
@media (min-width: 1800px) { :root { --col: 1360px; } }
@media (min-width: 2400px) { :root { --col: 1460px; --shell: 1900px; } }

/* =========================================================================
   00 · Hero
   ========================================================================= */

.hero {
  position: relative;
  min-height: 100vh;      /* fallback for browsers without small-viewport units */
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 0 5rem;
  overflow: hidden;
}
.hero__field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .5;
  pointer-events: none;
}
.hero__inner { position: relative; width: var(--wrap); margin-inline: auto; }

/* Must follow the .hero__inner base rule: margin-inline auto there would win
   on source order otherwise. Mirrors the .wrap column rules. */
@media (min-width: 1180px) {
  .hero__inner {
    width: auto;
    max-width: var(--col);
    margin-left: max(calc(var(--rail-w) + 2.5rem), calc((100% - var(--col)) / 2));
    margin-right: var(--gutter);
  }
}

/* Case-study hero: shorter than the homepage's full-viewport statement. */
.hero--project {
  min-height: auto;
  padding: clamp(8rem, 18vh, 12rem) 0 clamp(4rem, 9vh, 7rem);
}
.hero__h1--project { font-size: clamp(2.4rem, 5.8vw, 5rem); }

.hero__eyebrow { margin-bottom: 2rem; }
.hero__eyebrow span:first-child { color: var(--bone); }

.hero__h1 {
  font-family: var(--f-display);
  font-size: var(--t-hero);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: .93;
  margin: 0 0 2rem;
  text-wrap: balance;
}

.hero__lede {
  font-size: var(--t-lede);
  color: var(--haze);
  max-width: 54ch;
  line-height: 1.62;
  margin-bottom: 2.75rem;
}

.hero__acts { display: flex; flex-wrap: wrap; gap: .85rem; margin-bottom: 4rem; }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin: 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line-soft);
  max-width: 46rem;
}
.hero__meta div { display: flex; flex-direction: column; gap: .3rem; }
.hero__meta dt {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--haze-dim);
}
.hero__meta dd { margin: 0; font-size: var(--t-small); color: var(--bone); }

.hero__scroll {
  position: absolute;
  bottom: 2rem;
  right: clamp(1.25rem, 3vw, 2.5rem);
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--haze-dim);
  writing-mode: vertical-rl;
}

/* =========================================================================
   Bands
   ========================================================================= */

.band { padding: var(--band-y) 0; position: relative; }
.band--alt { background: var(--ink-2); border-block: 1px solid var(--line-soft); }

/* ---- 01 · Pillars ---- */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  overflow: hidden;
}
.pillar {
  background: var(--ink);
  padding: clamp(1.85rem, 3vw, 2.85rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: background .35s;
}
.pillar:hover { background: var(--abyss); }
.pillar__kicker {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--signal);
}
.pillar__h {
  font-family: var(--f-display);
  font-size: var(--t-h4);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.25;
  margin: 0;
  text-wrap: balance;
}
.pillar p { color: var(--haze); }

/* ---- 02 · Method ---- */
.method { display: flex; flex-direction: column; }
.method__step {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: clamp(1rem, 2.5vw, 2.5rem);
  padding: 2.25rem 0;
  border-top: 1px solid var(--line-soft);
  align-items: start;
}
.method__step:last-child { border-bottom: 1px solid var(--line-soft); }
.method__n {
  font-family: var(--f-mono);
  font-size: var(--t-small);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--signal);
  letter-spacing: .06em;
  padding-top: .35rem;
}
.method__body { max-width: 60ch; }
.method__body h3 {
  font-family: var(--f-display);
  font-size: var(--t-h4);
  font-weight: 700;
  letter-spacing: -.015em;
  margin: 0 0 .55rem;
}
.method__body p { color: var(--haze); }

/* ---- 03 · Dark-code defense ---- */
.defense {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  margin-bottom: 5rem;
}
.def { border-top: 2px solid var(--signal); padding-top: 1.25rem; }
.def__h {
  font-family: var(--f-display);
  font-size: var(--t-h4);
  font-weight: 700;
  letter-spacing: -.015em;
  margin: 0 0 .5rem;
}
.def p { color: var(--haze); font-size: var(--t-small); line-height: 1.6; }
.def em { color: var(--bone); }

.gates__h { margin-bottom: 2rem; }
.gates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  overflow: hidden;
}
.gate {
  background: var(--ink);
  padding: clamp(1.6rem, 2.5vw, 2.25rem);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.gate__n {
  font-family: var(--f-mono);
  font-size: var(--t-small);
  font-variant-numeric: tabular-nums;
  color: var(--signal);
}
.gate__h {
  font-family: var(--f-display);
  font-size: var(--t-h4);
  font-weight: 700;
  letter-spacing: -.015em;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .6rem;
}
.gate__h span {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--haze-dim);
}
.gate p { color: var(--haze); font-size: var(--t-small); line-height: 1.62; }

/* =========================================================================
   04 · Engram
   ========================================================================= */

.pains {
  display: grid;
  /* Explicit counts, not auto-fit: six items must divide evenly or the last
     row is left as an orphan beside empty cells. */
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 1rem;
}
.pains li {
  background: var(--ink-2);
  padding: 1.4rem 1.25rem;
  font-family: var(--f-mono);
  font-size: var(--t-small);
  color: var(--haze);
  transition: background .3s, color .3s;
}
.pains li:hover { background: var(--abyss); color: var(--bone); }
.pains__cap {
  font-size: var(--t-small);
  color: var(--haze-dim);
  font-style: italic;
  margin-bottom: clamp(2.5rem, 5vh, 4rem);
}

/* ---- feature teaser (homepage → engram.html) ---- */
.feature {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color .35s;
}
.feature:hover { border-color: var(--signal-dim); }

.feature__body {
  background: var(--ink);
  padding: clamp(1.75rem, 3vw, 2.85rem);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  transition: background .35s;
}
.feature:hover .feature__body { background: var(--abyss); }
.feature__kicker {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--signal);
}
.feature__h {
  font-family: var(--f-display);
  font-size: var(--t-h3);
  font-weight: 700;
  letter-spacing: -.022em;
  line-height: 1.14;
  margin: 0;
  text-wrap: balance;
}
.feature__pts { display: flex; flex-direction: column; gap: .6rem; }
.feature__pts li {
  position: relative;
  padding-left: 1.15rem;
  color: var(--haze);
  font-size: var(--t-small);
  line-height: 1.5;
}
.feature__pts li::before {
  content: "";
  position: absolute;
  left: 0; top: .62em;
  width: 5px; height: 5px;
  background: var(--signal);
}
.feature__go {
  margin-top: auto;
  font-family: var(--f-mono);
  font-size: var(--t-small);
  color: var(--signal);
  display: inline-flex;
  gap: .5rem;
}
.feature:hover .feature__go span { transform: translateX(3px); }
.feature__go span { transition: transform .3s; }

.feature__viz {
  background: var(--abyss);
  padding: clamp(1.75rem, 3vw, 2.85rem);
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  justify-content: center;
}
.feature__vizcap {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--haze-dim);
}
.fig { display: flex; flex-direction: column; gap: .35rem; }
.fig__label {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  color: var(--haze);
}
.fig__num {
  font-family: var(--f-mono);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
  line-height: 1;
}
.fig__num--ember  { color: var(--ember); }
.fig__num--signal { color: var(--signal); }
.fig__bar { height: 2px; background: var(--line-soft); overflow: hidden; }
.fig__fill { display: block; height: 100%; }
.fig__fill--ember  { width: 100%; background: var(--ember); }
.fig__fill--signal { width: 44%;  background: var(--signal); }
.fig__note {
  font-size: var(--t-small);
  color: var(--haze-dim);
  line-height: 1.5;
}

/* ---- spec list ---- */
.specs__h { margin-top: 4.5rem; }
.specs { display: flex; flex-direction: column; margin: 0; }
.spec {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: clamp(1rem, 2.5vw, 2rem);
  padding: 1.35rem 0;
  border-top: 1px solid var(--line-soft);
}
.spec:last-child { border-bottom: 1px solid var(--line-soft); }
.spec dt {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--signal);
}
.spec dd {
  margin: 0;
  font-size: var(--t-small);
  color: var(--haze);
  line-height: 1.6;
  max-width: 62ch;
}

/* ---- pinned scene ---- */
.scene { position: relative; margin: clamp(4rem, 9vh, 7rem) 0; }
.scene__track { height: 200vh; }
.scene__stage {
  position: sticky;
  top: 0;
  height: 100vh;          /* fallback */
  height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.scene__eyebrow { justify-content: flex-start; }
.scene__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  overflow: hidden;
}
.col {
  background: var(--ink);
  padding: clamp(1.5rem, 2.6vw, 2.25rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 0;
}
.col--after { background: var(--abyss); }
.col__head h3 {
  font-family: var(--f-display);
  font-size: var(--t-h4);
  font-weight: 700;
  letter-spacing: -.015em;
  margin: 0 0 .25rem;
}
.col__sub {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--haze-dim);
}

.col__meter { display: flex; flex-direction: column; gap: .6rem; }
.ticker {
  font-family: var(--f-mono);
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: .5rem;
}
.ticker small {
  font-size: var(--t-mono);
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--haze-dim);
}
.ticker--ember { color: var(--ember); }
.ticker--signal { color: var(--signal); }

.bar { height: 2px; background: var(--line-soft); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; }
.col--before .bar i { background: var(--ember); }
.col--after  .bar i { background: var(--signal); }

.stack { display: flex; flex-direction: column; gap: .5rem; }
.stack li {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  color: var(--haze-dim);
  padding: .5rem .75rem;
  border-left: 2px solid var(--ember-dim);
  background: rgba(255, 138, 76, .05);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .4s, transform .4s;
}
.stack li.is-in { opacity: 1; transform: none; }
.stack--code li {
  border-left-color: var(--signal);
  background: var(--signal-ghost);
  color: var(--bone);
  padding: .7rem .85rem;
  overflow-x: auto;
  white-space: nowrap;
}
.stack--code code { color: var(--bone); }

.col__returns {
  opacity: 0;
  transition: opacity .4s;
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--haze-dim);
  display: flex;
  align-items: center;
  gap: .7rem;
}
.col__returns::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}
.stack--out li {
  border-left-color: var(--signal-dim);
  background: transparent;
  color: var(--haze);
  padding: .35rem 0 .35rem .85rem;
  overflow-x: auto;
  white-space: nowrap;
}
.stack--out code { color: var(--haze); }

.col__note {
  font-size: var(--t-small);
  color: var(--ember);
  line-height: 1.55;
  margin-top: auto;
}
.col__note--assembled { color: var(--haze); }

.scene__delta {
  margin-top: 1.75rem;
  font-size: var(--t-small);
  color: var(--haze);
  max-width: 62ch;
}
.scene__delta strong { color: var(--bone); font-weight: 400; }

/* ---- self-learning loop ---- */
.loop {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  overflow: hidden;
}
.loop__step {
  background: var(--ink-2);
  padding: clamp(1.4rem, 2.2vw, 1.9rem);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.loop__n {
  font-family: var(--f-mono);
  font-size: var(--t-small);
  font-variant-numeric: tabular-nums;
  color: var(--signal);
}
.loop__step h4 {
  font-family: var(--f-display);
  font-size: var(--t-h4);
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0;
}
.loop__step p { color: var(--haze); font-size: var(--t-small); line-height: 1.55; }
/* The feedback path: 04 returns to 01, drawn rather than asserted. */
.loop__return {
  height: 2rem;
  margin: 0 2.5rem;
  border: 1px solid var(--signal-dim);
  border-top: 0;
  border-radius: 0 0 var(--r) var(--r);
  position: relative;
}
/* Arrowhead only where the path arrives — back at step 01. */
.loop__return::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 7px;
  height: 7px;
  border-top: 1px solid var(--signal);
  border-left: 1px solid var(--signal);
  transform: rotate(45deg);
  transform-origin: top left;
}

.loop__cap {
  display: flex;
  gap: .7rem;
  font-size: var(--t-small);
  color: var(--haze-dim);
  max-width: 62ch;
  margin: 1.1rem 0 5rem;
}
.loop__glyph { color: var(--signal); flex-shrink: 0; }

.clients {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 3.5rem;
}
.clients li {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: .08em;
  color: var(--haze);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: .6rem 1rem;
}

/* ---- architecture ---- */
.arch {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(1rem, 2.5vw, 2.5rem);
  align-items: stretch;
  margin-bottom: 1.5rem;
}
.arch__side {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(1.5rem, 2.5vw, 2.25rem);
  background: var(--abyss);
}
.arch__side--store { background: transparent; }
.arch__side h4 {
  font-family: var(--f-display);
  font-size: var(--t-h4);
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin: 0 0 .35rem;
}
.arch__sub {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  color: var(--haze-dim);
  letter-spacing: .06em;
  margin-bottom: 1rem;
}
.arch__body { font-size: var(--t-small); color: var(--haze); }
.arch__list { display: flex; flex-direction: column; gap: .4rem; }
.arch__list li {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  color: var(--haze);
  padding-left: 1rem;
  position: relative;
}
.arch__list li::before {
  content: "";
  position: absolute;
  left: 0; top: .5em;
  width: 4px; height: 4px;
  background: var(--signal);
}
.arch__flow {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}
.arch__op {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--signal);
  border: 1px solid var(--signal-dim);
  border-radius: var(--r);
  padding: .5rem .8rem;
  white-space: nowrap;
}
.arch__op--learn { background: var(--signal); color: #fff; border-color: var(--signal); }
.arch__cap {
  font-size: var(--t-small);
  color: var(--haze);
  max-width: 68ch;
  overflow-x: auto;
}

/* =========================================================================
   05 · Writing
   ========================================================================= */

.posts { display: flex; flex-direction: column; margin-bottom: 2.5rem; }
.post { border-top: 1px solid var(--line-soft); }
.post:last-child { border-bottom: 1px solid var(--line-soft); }
.post__a {
  display: grid;
  grid-template-columns: 8.5rem 1fr auto;
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: baseline;
  padding: 1.85rem 0;
  text-decoration: none;
  transition: padding-left .3s, background .3s;
}
.post__a:hover { padding-left: 1rem; background: var(--signal-ghost); }
.post__date {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem .65rem;
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--haze-dim);
  font-variant-numeric: tabular-nums;
}
.post__kind {
  color: var(--signal);
  border: 1px solid var(--signal-ghost);
  border-radius: 2px;
  padding: .15rem .4rem;
  letter-spacing: .12em;
}
.post__t {
  font-family: var(--f-display);
  font-size: var(--t-h4);
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.3;
  margin: 0 0 .35rem;
  text-wrap: balance;
}
.post__x { font-size: var(--t-small); color: var(--haze); max-width: 62ch; }
.post__go { font-family: var(--f-mono); font-size: var(--t-small); color: var(--signal); }

.posts__empty {
  border: 1px dashed var(--line);
  border-radius: var(--r);
  padding: 2rem;
  font-family: var(--f-mono);
  font-size: var(--t-small);
  color: var(--haze-dim);
}
.posts__all { align-self: start; }

@media (max-width: 700px) {
  .post__a { grid-template-columns: 1fr; gap: .5rem; }
  .post__go { display: none; }
}

/* =========================================================================
   Article — long-form reading
   Measure is the whole job here: one column, ~68ch, nothing competing with it.
   ========================================================================= */

.article { padding: clamp(7.5rem, 16vh, 11rem) 0 0; }

.article__head { margin-bottom: clamp(3rem, 6vh, 4.5rem); }
.article__title {
  font-family: var(--f-display);
  font-size: clamp(2.1rem, 4.6vw, 3.9rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.02;
  text-wrap: balance;
  margin: 0 0 1.5rem;
  max-width: 22ch;
}
.article__deck {
  font-size: var(--t-lede);
  line-height: 1.55;
  color: var(--haze);
  max-width: 58ch;
  margin-bottom: 2rem;
}
.article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1.1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--haze-dim);
}
.article__meta span[aria-hidden] { color: var(--line); }

.article__origin {
  margin-top: 1.5rem;
  padding: .9rem 1.1rem;
  border-left: 2px solid var(--signal-dim);
  background: var(--signal-ghost);
  border-radius: 0 var(--r) var(--r) 0;
  font-size: var(--t-small);
  color: var(--haze);
  max-width: 62ch;
}
.article__origin a { color: var(--signal); text-decoration: none; border-bottom: 1px solid var(--signal-ghost); }
.article__origin a:hover { border-bottom-color: var(--signal); }

/* ---- executive summary ---- */
.summary {
  max-width: 68ch;
  margin-bottom: 3.5rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  background: var(--abyss);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
}
.summary__h {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 1.25rem;
}
.summary ul { display: flex; flex-direction: column; gap: 1rem; }
.summary li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 1.03rem;
  line-height: 1.62;
  color: var(--haze);
}
.summary li strong { color: var(--bone); font-weight: 400; }
.summary li::before {
  content: "";
  position: absolute;
  left: 0; top: .62em;
  width: 5px; height: 5px;
  background: var(--signal);
}

/* ---- prose ---- */
.prose { max-width: 68ch; }
.prose > * + * { margin-top: 1.5rem; }
.prose p {
  font-size: 1.115rem;
  line-height: 1.75;
  color: var(--bone);
}
.prose h2 {
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 2.6vw, 2.05rem);
  font-weight: 700;
  letter-spacing: -.024em;
  line-height: 1.14;
  text-wrap: balance;
  margin-top: 3.75rem;
  margin-bottom: -.35rem;   /* the following p supplies the gap */
}
.prose h3 {
  font-family: var(--f-display);
  font-size: var(--t-h4);
  font-weight: 700;
  letter-spacing: -.015em;
  margin-top: 2.5rem;
  margin-bottom: -.5rem;
}
.prose strong { font-weight: 500; color: #fff; }
.prose em { font-style: italic; }
.prose a {
  color: var(--signal);
  text-decoration: none;
  border-bottom: 1px solid var(--signal-ghost);
}
.prose a:hover { border-bottom-color: var(--signal); }

.prose ul, .prose ol { display: flex; flex-direction: column; gap: .85rem; }
.prose li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 1.06rem;
  line-height: 1.65;
  color: var(--haze);
}
.prose li strong { color: var(--bone); }
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0; top: .68em;
  width: 5px; height: 5px;
  background: var(--signal);
}
.prose ol { counter-reset: prose-n; }
.prose ol li { counter-increment: prose-n; padding-left: 2.1rem; }
.prose ol li::before {
  content: counter(prose-n, decimal-leading-zero);
  position: absolute;
  left: 0; top: .1em;
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  color: var(--signal);
}

.prose blockquote {
  margin: 2.75rem 0;
  padding: .5rem 0 .5rem 2rem;
  border-left: 2px solid var(--signal);
}
.prose blockquote p {
  font-style: italic;
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  line-height: 1.38;
  color: var(--bone);
  text-wrap: balance;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line-soft);
  margin: 3.5rem 0;
}

/* ---- article footer ---- */
.article__end {
  max-width: 68ch;
  margin-top: 4.5rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.article__byline { font-size: var(--t-small); color: var(--haze); }
.article__acts { display: flex; flex-wrap: wrap; gap: .75rem; }

@media (max-width: 760px) {
  .article { padding-top: 6.5rem; }
  .prose p { font-size: 1.06rem; }
  .prose h2 { margin-top: 2.75rem; }
  .prose blockquote { padding-left: 1.25rem; margin: 2rem 0; }
}

/* =========================================================================
   06 · Contact + footer
   ========================================================================= */

.contact__h { max-width: 16ch; }
.contact__acts { display: flex; flex-wrap: wrap; gap: .85rem; }

/* ---- contact form ---- */
.form {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  max-width: 48rem;
}
.form__hp {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.35rem;
}

.field { display: flex; flex-direction: column; gap: .5rem; margin: 0; }
.field label {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--haze);
}
.field__opt {
  letter-spacing: .04em;
  text-transform: none;
  color: var(--haze-dim);
}

.form input,
.form select,
.form textarea {
  font-family: var(--f-body);
  font-size: 1rem;                 /* 16px minimum — stops iOS zooming on focus */
  font-weight: 300;
  line-height: 1.5;
  color: var(--bone);
  background: var(--abyss);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: .8rem 1rem;
  width: 100%;
  min-height: 3rem;
  transition: border-color .25s, background .25s;
  -webkit-appearance: none;
  appearance: none;
}
.form textarea { resize: vertical; min-height: 9rem; }
.form input::placeholder,
.form textarea::placeholder { color: var(--haze-dim); opacity: 1; }

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--signal);
  background: var(--abyss-2);
}
.form input:focus-visible,
.form select:focus-visible,
.form textarea:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

.form select {
  /* Custom caret: native select arrows don't honour a dark ground consistently. */
  background-image:
    linear-gradient(45deg, transparent 50%, var(--haze) 50%),
    linear-gradient(135deg, var(--haze) 50%, transparent 50%);
  background-position:
    calc(100% - 1.15rem) calc(50% + 2px),
    calc(100% - .8rem)   calc(50% + 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
  cursor: pointer;
}
.form option { background: var(--abyss); color: var(--bone); }

.form__foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .85rem 1.35rem;
  margin-top: .35rem;
}
.form__note { font-size: var(--t-small); color: var(--haze-dim); }

.form__status {
  font-family: var(--f-mono);
  font-size: var(--t-small);
  line-height: 1.5;
  padding: .9rem 1.1rem;
  border-radius: var(--r);
  border-left: 2px solid var(--haze-dim);
  background: rgba(147, 166, 201, .06);
  display: none;
}
.form__status.is-shown { display: block; }
.form__status.is-ok {
  color: var(--bone);
  border-left-color: var(--signal);
  background: var(--signal-ghost);
}
.form__status.is-error {
  color: var(--ember);
  border-left-color: var(--ember);
  background: rgba(255, 138, 76, .07);
}
.form.is-sending button[type="submit"] { opacity: .55; pointer-events: none; }

.foot { padding: 3.5rem 0; border-top: 1px solid var(--line-soft); }
.foot__grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem 2.5rem;
}
.foot__mark {
  display: flex;
  align-items: center;
  font-size: var(--t-mono);
}
.foot__mark img {
  height: var(--logo-foot);
  width: auto;
  opacity: .85;
  transition: opacity .25s;
}
.foot__mark:hover img { opacity: 1; }
.foot__line {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--haze-dim);
  margin-right: auto;
}
.foot__nav { display: flex; gap: 1.5rem; }
.foot__nav a {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--haze);
  transition: color .25s;
}
.foot__nav a:hover { color: var(--signal); }

/* =========================================================================
   Motion
   ========================================================================= */

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .75s cubic-bezier(.2,.7,.3,1), transform .75s cubic-bezier(.2,.7,.3,1);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* =========================================================================
   Responsive ladder
   Widest first. Each step only undoes what the previous one can no longer
   carry — no rule is repeated across breakpoints.
   ========================================================================= */

/* --- Laptop: rail is gone (see the 1180px min-width rule), reclaim the space --- */
@media (max-width: 1180px) {
  .feature { grid-template-columns: 1fr .8fr; }
  .spec { grid-template-columns: 9rem 1fr; }
}

/* --- Tablet landscape --- */
@media (max-width: 1024px) {
  .topbar__nav { gap: 1rem; }
  .arch { gap: 1rem; }
  .arch__side { padding: 1.5rem; }
}

/* --- Tablet portrait: the pinned scene stops being viable --- */
@media (max-width: 900px) {
  .arch { grid-template-columns: 1fr; }
  .arch__flow { flex-direction: row; flex-wrap: wrap; justify-content: center; }

  /* A pinned scene can't hold two stacked columns — let it flow instead. */
  .scene { margin: 3rem 0; }
  .scene__track { height: 0; }
  .scene__stage {
    position: static;
    height: auto;
    overflow: visible;
    display: block;
  }
  .col__note { margin-top: 1rem; }

  .feature { grid-template-columns: 1fr; }
  .feature__viz { flex-direction: row; flex-wrap: wrap; gap: 1.25rem 2.5rem; align-items: flex-end; }
  .feature__vizcap, .fig__note { flex-basis: 100%; }
  .fig { flex: 1 1 10rem; }
}

/* --- Mobile: single column, nav reduced to what a thumb needs --- */
@media (max-width: 760px) {
  /* In-page links live in the rail on desktop; on mobile they'd crowd out the
     mark, so keep the brand, the page link, and the one action that matters. */
  /* Direct children only — the language switcher's links are nested in .lang
     and must survive. */
  .topbar__nav > a:not(.topbar__cta):not(.topbar__back):not(.topbar__page) { display: none; }
  .topbar__nav a { padding-block: .5rem; }   /* larger tap target */

  .hero { min-height: auto; padding: 7.5rem 0 4rem; }
  .hero__eyebrow { flex-direction: column; align-items: flex-start; gap: .35rem; }
  .hero__eyebrow .eyebrow__sep { display: none; }
  .hero__acts { margin-bottom: 3rem; }
  .hero__meta { gap: 1.35rem 2rem; }
  .hero__scroll { display: none; }

  .method__step { grid-template-columns: 1fr; gap: .5rem; padding: 1.85rem 0; }
  .method__n { padding-top: 0; }

  .spec { grid-template-columns: 1fr; gap: .4rem; }

  .defense { gap: 2rem; margin-bottom: 3.5rem; }
  .lede { margin-bottom: 2.5rem; }
  .pullquote { padding: 1.5rem 0 1.5rem 1.5rem; margin-top: 3rem; max-width: none; }

  .post__a { padding: 1.5rem 0; }
  .post__a:hover { padding-left: 0; }        /* no hover shift on touch */

  .foot { padding: 2.5rem 0; }
  .foot__grid { gap: 1.25rem; }
  .foot__line { margin-right: 0; flex-basis: 100%; order: 3; }
  .foot__nav { gap: 1.25rem; }
}

/* --- Small phones --- */
@media (max-width: 480px) {
  :root { --logo-topbar: 2.4em; }

  .btn { padding: .85rem 1.25rem; }
  .hero__acts { gap: .6rem; }
  .hero__acts .btn, .contact__acts .btn { flex: 1 1 100%; text-align: center; }
  .contact__acts { gap: .6rem; }

  .hero__meta { padding-top: 1.5rem; gap: 1.15rem 1.75rem; }
  .clients { gap: .45rem; }
  .clients li { padding: .5rem .75rem; }

  .col, .feature__body, .feature__viz, .gate, .pillar, .loop__step {
    padding: 1.35rem 1.15rem;
  }
  .loop__return { margin: 0 1.15rem; }
  .ticker { font-size: 2rem; }
}

/* --- Narrowest supported --- */
@media (max-width: 440px) {
  /* The header can carry the mark, one action and the language switcher — no
     more. The back link is redundant (the mark links home) and Engram stays
     reachable from the hero, the case-study card and the footer. */
  .topbar__back { display: none; }
  .topbar__page { display: none; }
  .topbar__cta--long  { display: none; }
  .topbar__cta--short { display: inline; }
}

@media (max-width: 360px) {
  :root { --gutter: 1rem; --logo-topbar: 2.2em; }
  .topbar__nav { gap: .7rem; }
  .topbar__cta { padding: .5rem .7rem; }
  /* Column direction must also drop the wrap it inherits from the 900px rule,
     or the figures wrap into a second column and leave the container. */
  .feature__viz { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .feature__viz .fig { flex: 0 0 auto; }
}

/* Fixed-count grids reflow to counts that divide evenly, so the last row is
   never a lone card sitting beside empty cells. */
@media (max-width: 1180px) { .pains { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .loop    { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .defense { grid-template-columns: 1fr; }
  .gates   { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .pains { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .loop  { grid-template-columns: 1fr; } }
@media (max-width: 380px) { .pains { grid-template-columns: 1fr; } }

@media (max-width: 620px) {
  .form__row { grid-template-columns: 1fr; }
  .form__foot .btn { width: 100%; text-align: center; }
}

/* =========================================================================
   Device class, not just width
   ========================================================================= */

/* Touch devices — including large ones like iPad Pro in landscape, where the
   rail is wide enough to show but no pointer will ever hover it. */
@media (hover: none) {
  .rail__t { opacity: 1; transform: none; }
  .rail__list a { padding-block: .3rem; }        /* thumb-sized targets */
  .post__a:hover { padding-left: 0; background: transparent; }
  .btn--solid:hover { transform: none; }
  .feature:hover .feature__go span { transform: none; }
}

/* Short viewports — laptops at 1280×800 and iPad in landscape. The pinned
   scene must fit the stage without clipping, so compress rather than unpin. */
@media (min-width: 901px) and (max-height: 880px) {
  .scene__eyebrow { margin-bottom: 1rem; }
  .scene__grid .col { gap: .9rem; padding: 1.35rem; }
  .scene__grid .ticker { font-size: clamp(1.5rem, 3vw, 2rem); }
  .scene__grid .stack li { padding: .4rem .7rem; }
  .scene__grid .stack--out li { padding: .26rem 0 .26rem .7rem; }
  .scene__grid .stack--code li { padding: .5rem .7rem; }
  .scene__delta { margin-top: 1.1rem; }
}

/* Anything shorter than the scene can hold: stop pinning entirely.
   scripts/main.js mirrors this in PIN_MIN_HEIGHT. */
@media (max-height: 640px) {
  .scene__track { height: 0; }
  .scene__stage { position: static; height: auto; overflow: visible; display: block; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  [data-reveal], .stack li, .col__returns { opacity: 1; transform: none; }
  .scene__track { height: 0; }
  .scene__stage { position: static; height: auto; padding: 2rem 0; }
  .hero__field { display: none; }
}
