/* Hallmark · pre-emit critique: P5 H5 E4 S5 R5 V5
 * Hallmark · genre: atmospheric · macrostructure: Marquee Hero (centred-logo variant)
 * theme: Lumen · drop: day (Day Foundry — cool bone canvas, deep indigo refracts)
 * enrichment: apparatus · thread indicator (hand-built CSS, one per page) + centred brand mark
 * nav: N5 Floating pill → replaced by edge bar w/ link row (subpages require real links)
 * footer: Ft4 Inline single line + legal link row
 * Day Foundry physics: NO perpetual motion. apparatus reveals once, then rests.
 */

/* ═══ Tokens · Lumen Day Foundry ═══════════════════════════ */
/* Light theme (default) */
:root,
[data-theme="light"] {
  --color-paper:        oklch(97% 0.008 265);
  --color-paper-2:      oklch(94.5% 0.009 265);
  --color-paper-3:      oklch(91% 0.010 265);
  --color-rule:         oklch(87.5% 0.010 265);
  --color-rule-2:       oklch(79% 0.012 265);
  --color-ink:          oklch(18% 0.014 265);
  --color-ink-2:        oklch(33% 0.014 265);
  --color-muted:        oklch(50% 0.014 265);
  --color-accent:       oklch(46% 0.24 268);
  --color-accent-2:     oklch(55% 0.20 24);
  --color-accent-ink:   oklch(98% 0.004 265);
  --color-glow:         oklch(58% 0.22 268 / 0.28);
  --color-glow-2:       oklch(58% 0.22 268 / 0.12);
  --color-paper-emit:   oklch(46% 0.24 268 / 0.03);
  --color-emit-card:    oklch(46% 0.24 268 / 0.045);
  --color-emit-card-hi: oklch(46% 0.24 268 / 0.10);
  --color-sheen:        oklch(100% 0 0 / 0.55);
  --rule-blueprint:     oklch(18% 0.014 265 / 0.045);
  --color-focus:        oklch(46% 0.24 268);

  /* Semantic aliases for easier theming */
  --bg-primary:   var(--color-paper);
  --bg-secondary: var(--color-paper-2);
  --bg-tertiary:  var(--color-paper-3);
  --border-subtle: var(--color-rule);
  --border-strong: var(--color-rule-2);
  --text-primary: var(--color-ink);
  --text-secondary: var(--color-ink-2);
  --text-muted: var(--color-muted);
  --accent-primary: var(--color-accent);
  --accent-secondary: var(--color-accent-2);
}

/* Dark theme */
[data-theme="dark"] {
  --color-paper:        oklch(12% 0.008 265);
  --color-paper-2:      oklch(15% 0.009 265);
  --color-paper-3:      oklch(18% 0.010 265);
  --color-rule:         oklch(25% 0.010 265);
  --color-rule-2:       oklch(35% 0.012 265);
  --color-ink:          oklch(95% 0.004 265);
  --color-ink-2:        oklch(80% 0.010 265);
  --color-muted:        oklch(55% 0.014 265);
  --color-accent:       oklch(65% 0.22 268);
  --color-accent-2:     oklch(70% 0.18 24);
  --color-accent-ink:   oklch(12% 0.008 265);
  --color-glow:         oklch(65% 0.22 268 / 0.35);
  --color-glow-2:       oklch(65% 0.22 268 / 0.15);
  --color-paper-emit:   oklch(65% 0.22 268 / 0.05);
  --color-emit-card:    oklch(65% 0.22 268 / 0.07);
  --color-emit-card-hi: oklch(65% 0.22 268 / 0.14);
  --color-sheen:        oklch(100% 0 0 / 0.15);
  --rule-blueprint:     oklch(95% 0.004 265 / 0.04);
  --color-focus:        oklch(65% 0.22 268);

  --bg-primary:   var(--color-paper);
  --bg-secondary: var(--color-paper-2);
  --bg-tertiary:  var(--color-paper-3);
  --border-subtle: var(--color-rule);
  --border-strong: var(--color-rule-2);
  --text-primary: var(--color-ink);
  --text-secondary: var(--color-ink-2);
  --text-muted: var(--color-muted);
  --accent-primary: var(--color-accent);
  --accent-secondary: var(--color-accent-2);
}

/* Theme transition */
*,
*::before,
*::after {
  transition:
    background-color var(--dur-mid) var(--ease-out),
    border-color var(--dur-mid) var(--ease-out),
    color var(--dur-mid) var(--ease-out),
    box-shadow var(--dur-mid) var(--ease-out);
}

/* Disable transitions during theme switch to prevent flash */
[data-theme-transitioning] *,
[data-theme-transitioning] *::before,
[data-theme-transitioning] *::after {
  transition-duration: 0ms !important;
}

/* ═══ Shared tokens (not theme-specific) ════════════════════════ */
:root {
  --font-display: "Instrument Serif", "Tiempos Headline", ui-serif, Georgia, serif;
  --font-body:    "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  --text-xs:   0.6875rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-md:   1.1875rem;
  --text-lg:   1.5rem;
  --text-xl:   1.9375rem;
  --text-display: clamp(2.5rem, 5.4vw + 0.5rem, 4.75rem);
  --text-title:   clamp(2rem, 3.6vw + 0.4rem, 3.25rem);
  --text-sub:     clamp(1.5rem, 2.4vw + 0.3rem, 2.25rem);

  --space-3xs: 0.125rem;
  --space-2xs: 0.25rem;
  --space-xs:  0.5rem;
  --space-sm:  0.75rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --space-4xl: 8rem;

  --page-max: 74rem;
  --page-gutter: clamp(1.25rem, 4.5vw, 3rem);
  --banner-height: 4.5rem;
  --radius-card: 16px;
  --radius-btn: 999px;
  --tracking-micro: 0.10em;

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft:   cubic-bezier(0.32, 0.08, 0.24, 1);
  --dur-micro:   120ms;
  --dur-short:   220ms;
  --dur-mid:     420ms;
  --dur-long:    680ms;

  --z-base: 1;
  --z-raised: 10;
  --z-sheet: 200;
  --z-nav: 300;
  --z-skip: 500;

  --shadow-card: 0 1px 2px oklch(18% 0.014 265 / 0.04);
  --shadow-lift: 0 18px 40px -24px oklch(18% 0.014 265 / 0.28);
  --shadow-pop:  0 28px 60px -30px oklch(18% 0.014 265 / 0.34);
}

/* ═══ Base · two registers: lowercase prose, UPPERCASE mono labels ═══ */
*, *::before, *::after { box-sizing: border-box; }

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--banner-height) + var(--space-lg));
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--color-paper);
  color: var(--color-ink-2);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-base);
  line-height: 1.6;
  text-transform: lowercase;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, table { margin: 0; }
ul, ol { padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
em { font-style: normal; }
strong { font-weight: 600; color: var(--color-ink); }

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

.skip-link {
  position: absolute;
  left: var(--space-md);
  top: -120px;
  z-index: var(--z-skip);
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: var(--space-xs) var(--space-md);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  border-radius: var(--radius-btn);
}
.skip-link:focus { top: var(--space-md); }

.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;
  border: 0;
}

/* ═══ Registers ════════════════════════════════════════════ */
.eyebrow,
.meter__label,
.card__label,
.stage__num,
.shot__hint,
.shot__cap,
.nav__link,
.foot__dev,
.foot__legal a,
.kv__val {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-accent);
}
.eyebrow::before {
  content: "";
  width: 1.25rem;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.wordmark {
  font-family: var(--font-display);
  font-size: var(--text-md);
  letter-spacing: -0.01em;
  color: var(--color-ink);
  line-height: 1;
}

/* The logo jpgs carry a near-white ground; multiply drops it into the canvas. */
.mark { mix-blend-mode: multiply; }
.nav__mark { width: 2rem; height: 2rem; }

/* Dark mode: logo images have dark art on white ground.
   multiply works in light mode (white becomes transparent).
   In dark mode, invert makes dark art light and white bg dark. */
[data-theme="dark"] .mark {
  mix-blend-mode: normal;
  filter: invert(1) contrast(1.2);
}

/* ═══ Buttons ══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 44px;
  padding: 0.7rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--dur-short) var(--ease-soft),
    border-color var(--dur-short) var(--ease-soft),
    color var(--dur-short) var(--ease-soft),
    box-shadow var(--dur-short) var(--ease-soft),
    transform var(--dur-micro) var(--ease-soft);
}
.btn--primary {
  background: var(--color-accent);
  color: var(--color-accent-ink);
  box-shadow: var(--shadow-card);
}
.btn--primary:hover,
.btn--primary:focus-visible {
  background: oklch(41% 0.24 268);
  box-shadow: 0 0 0 4px var(--color-glow-2);
}
.btn--primary:active { transform: translateY(1px); }

.btn--quiet {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-rule-2);
}
.btn--quiet:hover,
.btn--quiet:focus-visible {
  border-color: var(--color-ink);
  background: oklch(100% 0 0 / 0.7);
}
.btn--quiet:active { transform: translateY(1px); }

.btn--sm { min-height: 40px; padding: 0.5rem 1.1rem; font-size: var(--text-xs); }
.btn--lg { min-height: 52px; padding: 0.9rem 1.85rem; font-size: var(--text-base); }

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ═══ Theme Toggle ═════════════════════════════════════════ */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  transition:
    border-color var(--dur-short) var(--ease-out),
    background-color var(--dur-short) var(--ease-out),
    transform var(--dur-micro) var(--ease-out);
}
.theme-toggle:hover {
  border-color: var(--border-strong);
  background: var(--bg-tertiary);
}
.theme-toggle:active {
  transform: scale(0.95);
}
.theme-toggle__icon {
  position: absolute;
  transition:
    opacity var(--dur-short) var(--ease-out),
    transform var(--dur-short) var(--ease-out);
}
.theme-toggle__icon--sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
.theme-toggle__icon--moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.8);
}
[data-theme="dark"] .theme-toggle__icon--sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.8);
}
[data-theme="dark"] .theme-toggle__icon--moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* ═══ Loader / Skeleton Screen ══════════════════════════════ */
.loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg-primary);
  display: grid;
  place-items: center;
  transition:
    opacity var(--dur-long) var(--ease-out),
    visibility var(--dur-long) var(--ease-out);
}
.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader__inner {
  display: grid;
  gap: var(--space-lg);
  justify-items: center;
  text-align: center;
}
.loader__mark {
  width: 80px;
  height: 80px;
  background:
    radial-gradient(60% 60% at 50% 0%, var(--color-emit-card) 0%, transparent 70%),
    var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  animation: loader-pulse 1.6s var(--ease-soft) infinite;
}
@keyframes loader-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--color-glow-2); }
  50% { box-shadow: 0 0 0 12px var(--color-glow-2); }
}
.loader__text {
  display: grid;
  gap: var(--space-2xs);
  width: 100%;
  max-width: 160px;
}
.loader__bar {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: loader-shimmer 1.4s var(--ease-out) infinite;
}
.loader__bar:nth-child(2) { width: 70%; animation-delay: 0.1s; }
.loader__bar:nth-child(3) { width: 45%; animation-delay: 0.2s; }
@keyframes loader-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Skeleton loaders for content */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: loader-shimmer 1.4s var(--ease-out) infinite;
  border-radius: 4px;
}
.skeleton--text {
  height: 1em;
  width: 100%;
}
.skeleton--title {
  height: 2.5rem;
  width: 60%;
  max-width: 300px;
  border-radius: 2px;
}
.skeleton--card {
  aspect-ratio: 9/16;
  border-radius: var(--radius-card);
}
.skeleton--circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}
.skeleton--btn {
  width: 140px;
  height: 44px;
  border-radius: var(--radius-btn);
}

/* ═══ Nav · edge bar with link row ═════════════════════════ */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: var(--z-nav);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background-color var(--dur-short) var(--ease-out),
    border-color var(--dur-short) var(--ease-out),
    box-shadow var(--dur-short) var(--ease-out);
}
.nav.is-scrolled {
  background: var(--color-paper);
  border-bottom-color: var(--color-rule);
  box-shadow: 0 1px 0 oklch(18% 0.014 265 / 0.02);
}
.nav__inner {
  position: relative;
  max-width: var(--page-max);
  margin: 0 auto;
  padding-inline: var(--page-gutter);
  min-height: var(--banner-height);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-right: auto;
  min-width: 0;
  padding-block: var(--space-xs);
}
.nav__links {
  display: none;
  align-items: center;
  gap: var(--space-lg);
}
.nav__link {
  position: relative;
  color: var(--color-ink-2);
  padding-block: 0.35rem;
  transition: color var(--dur-short) var(--ease-out);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-mid) var(--ease-soft);
}
.nav__link:hover,
.nav__link:focus-visible { color: var(--color-ink); }
.nav__link:hover::after,
.nav__link:focus-visible::after { transform: scaleX(1); }
.nav__link[aria-current="page"] { color: var(--color-ink); }
.nav__link[aria-current="page"]::after { transform: scaleX(1); }

.nav__toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-right: calc(var(--space-2xs) * -1);
  border: 1px solid var(--color-rule);
  border-radius: 10px;
  color: var(--color-ink);
  transition: border-color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out);
}
.nav__toggle:hover { border-color: var(--color-rule-2); background: oklch(100% 0 0 / 0.7); }
.nav__bars { display: grid; gap: 5px; width: 17px; }
.nav__bars i {
  display: block;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transition: transform var(--dur-short) var(--ease-soft), opacity var(--dur-short) var(--ease-soft);
}
.nav__toggle[aria-expanded="true"] .nav__bars i:first-child { transform: translateY(3.25px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__bars i:last-child { transform: translateY(-3.25px) rotate(-45deg); }

/* Scroll progress hairline */
.nav__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1.5px;
  background: var(--color-accent);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  opacity: 0.85;
}

/* Mobile sheet */
.sheet {
  position: fixed;
  inset: var(--banner-height) 0 auto;
  z-index: var(--z-sheet);
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-rule);
  box-shadow: var(--shadow-pop);
  padding: var(--space-md) var(--page-gutter) var(--space-lg);
  display: grid;
  gap: var(--space-2xs);
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity var(--dur-mid) var(--ease-soft),
    transform var(--dur-mid) var(--ease-soft),
    visibility 0s linear var(--dur-mid);
  visibility: hidden;
}
.sheet.is-open {
  opacity: 1;
  transform: none;
  visibility: visible;
  transition:
    opacity var(--dur-mid) var(--ease-soft),
    transform var(--dur-mid) var(--ease-soft),
    visibility 0s linear 0s;
}
.sheet__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-rule);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-ink);
  letter-spacing: -0.015em;
}
.sheet__link::after {
  content: "→";
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-accent);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
}
.sheet__link:hover::after,
.sheet__link:focus-visible::after { opacity: 1; transform: none; }
.sheet__link[aria-current="page"] { color: var(--color-accent); }
.sheet__cta { margin-top: var(--space-md); }

@media (min-width: 62rem) {
  .nav__links { display: flex; }
  .nav__toggle, .sheet { display: none; }
  .nav__inner > .btn { display: inline-flex; }
}
@media (max-width: 61.999rem) {
  .nav__inner > .btn { display: none; }
}

/* ═══ Hero · centred brand mark ════════════════════════════ */
.hero {
  position: relative;
  overflow: clip;
  padding: calc(var(--banner-height) + var(--space-2xl)) var(--page-gutter) var(--space-3xl);
  background:
    linear-gradient(var(--rule-blueprint) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, var(--rule-blueprint) 1px, transparent 1px) 0 0 / 48px 48px,
    radial-gradient(56% 46% at 50% 8%, var(--color-paper-emit) 0%, transparent 68%),
    var(--color-paper);
}
.hero__inner {
  max-width: 56rem;
  margin: 0 auto;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: var(--space-lg);
}
.hero__mark {
  width: min(24rem, 78vw);
  filter: drop-shadow(0 14px 30px oklch(18% 0.014 265 / 0.10));
  animation: mark-in var(--dur-long) var(--ease-out) backwards;
}
@keyframes mark-in {
  from { opacity: 0; transform: translateY(10px) scale(0.975); }
  to   { opacity: 1; transform: none; }
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-display);
  line-height: 1.03;
  letter-spacing: -0.032em;
  color: var(--color-ink);
  max-width: 17ch;
  overflow-wrap: anywhere;
  animation: rise-in var(--dur-long) var(--ease-out) 140ms backwards;
}
.hero__title em {
  color: var(--color-accent-2);
  position: relative;
  white-space: nowrap;
}
.hero__title em::after {
  content: "";
  position: absolute;
  left: 0.05em;
  right: 0.05em;
  bottom: 0.04em;
  height: 1px;
  background: var(--color-accent-2);
  transform-origin: left;
  animation: pivot-underline 320ms var(--ease-soft) 900ms backwards;
}
@keyframes pivot-underline {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.hero__lede {
  font-size: var(--text-md);
  line-height: 1.55;
  color: var(--color-ink-2);
  max-width: 52ch;
  animation: rise-in var(--dur-long) var(--ease-out) 240ms backwards;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  animation: rise-in var(--dur-long) var(--ease-out) 340ms backwards;
}
.hero__note {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  color: var(--color-muted);
  animation: rise-in var(--dur-long) var(--ease-out) 430ms backwards;
}

/* ═══ Meter strip ══════════════════════════════════════════ */
.meter {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-xs);
  padding: var(--space-md) var(--page-gutter);
  border-block: 1px solid var(--color-rule);
  background: var(--color-paper-2);
  justify-items: center;
  text-align: center;
}
.meter__label { color: var(--color-muted); }
.meter__bars {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 26px;
  width: 100%;
  max-width: 40rem;
}
.meter__bars > span {
  flex: 1;
  min-width: 1px;
  height: var(--h);
  background: var(--color-accent);
  opacity: 0.34;
  border-radius: 0.5px;
}
@media (min-width: 44rem) {
  .meter {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-lg);
    text-align: left;
  }
  .meter__label { white-space: nowrap; }
  .meter__label:last-of-type { text-align: right; }
}

/* ═══ Sections · shared heads ══════════════════════════════ */
.identity,
.thread,
.glance,
.shots,
.close {
  padding: var(--space-3xl) var(--page-gutter);
}
.identity__inner,
.thread__inner,
.glance__inner,
.shots__inner,
.close__inner {
  max-width: var(--page-max);
  margin: 0 auto;
}
.section__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-title);
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--color-ink);
  max-width: 18ch;
  margin-block: var(--space-sm) var(--space-md);
  overflow-wrap: anywhere;
}
.section__title em { color: var(--color-accent-2); }
.section__lede {
  font-size: var(--text-md);
  line-height: 1.55;
  color: var(--color-ink-2);
  max-width: 58ch;
}
.section__head { max-width: 58ch; }

/* ═══ 01 · cards with inner emission + one-shot sheen ═════ */
.cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-2xl);
}
.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-card);
  padding: var(--space-lg);
  background:
    radial-gradient(88% 66% at 50% 0%, var(--color-emit-card) 0%, transparent 72%),
    var(--color-paper-2);
  box-shadow: var(--shadow-card);
  transition:
    transform var(--dur-short) var(--ease-soft),
    border-color var(--dur-short) var(--ease-soft),
    box-shadow var(--dur-short) var(--ease-soft);
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 38%,
    var(--color-sheen) 50%,
    transparent 62%
  );
  transform: translateX(-120%);
  opacity: 0;
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-5px);
    border-color: var(--color-rule-2);
    box-shadow: var(--shadow-lift);
  }
  .card:hover::after {
    opacity: 0.5;
    animation: sheen 900ms var(--ease-soft);
  }
  .card:hover .card__label { color: var(--color-accent); }
}
@keyframes sheen {
  from { transform: translateX(-120%); }
  to   { transform: translateX(120%); }
}
.card__label {
  color: var(--color-muted);
  margin-bottom: var(--space-md);
  transition: color var(--dur-short) var(--ease-out);
}
.card__body {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-ink-2);
  max-width: 46ch;
}
.kv { display: grid; }
.kv li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-md);
  padding-block: var(--space-sm);
  border-bottom: 1px solid var(--color-rule);
  font-size: var(--text-sm);
  color: var(--color-ink-2);
}
.kv li:last-child { border-bottom: 0; padding-bottom: 0; }
.kv__val { color: var(--color-accent); white-space: nowrap; }
.kv__val--off { color: var(--color-accent-2); }

@media (min-width: 40rem) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards > :first-child { grid-column: span 2; }
}
@media (min-width: 62rem) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cards > :first-child { grid-column: auto; }
}

/* ═══ 02 · thread apparatus + stages ══════════════════════ */
.thread__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2xl);
  align-items: center;
  margin-top: var(--space-2xl);
}

.apparatus { display: grid; gap: var(--space-sm); justify-items: center; }
.thread-frame {
  position: relative;
  width: min(19rem, 78vw);
  aspect-ratio: 1 / 1.2;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-card);
  background:
    linear-gradient(var(--rule-blueprint) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(90deg, var(--rule-blueprint) 1px, transparent 1px) 0 0 / 26px 26px,
    var(--color-paper-2);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px) scale(0.99);
  transition:
    opacity var(--dur-long) var(--ease-out),
    transform var(--dur-long) var(--ease-out);
}
.apparatus.is-in .thread-frame { opacity: 1; transform: none; }

.thread-frame__spine {
  position: absolute;
  left: 50%;
  top: 8%;
  bottom: 8%;
  width: 1px;
  margin-left: -0.5px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--color-rule-2) 10%,
    var(--color-rule-2) 90%,
    transparent 100%
  );
}
.node {
  position: absolute;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: var(--color-paper);
  border: 1.5px solid var(--color-rule-2);
}
.node--a { top: 22%; }
.node--b { top: 48%; }
.node--c { top: 74%; }
.node--blocked {
  top: 90%;
  border-color: var(--color-accent-2);
  border-style: dashed;
  display: grid;
  place-items: center;
}
.node__bar { width: 6px; height: 1.5px; background: var(--color-accent-2); }

/* one-shot travel: pulse rides the spine once, lands, blocked node acknowledges */
.pulse {
  position: absolute;
  left: 50%;
  top: 22%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-glow-2);
  opacity: 0;
}
.apparatus.is-in .pulse {
  animation: thread-travel 2.2s var(--ease-soft) 320ms forwards;
}
@keyframes thread-travel {
  0%   { top: 22%; opacity: 0; }
  14%  { opacity: 1; }
  78%  { top: 74%; opacity: 1; }
  100% { top: 90%; opacity: 0; }
}
.pulse--rest {
  position: absolute;
  left: 50%;
  top: 90%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--color-accent);
  opacity: 0;
  transform: scale(0.4);
}
.apparatus.is-in .pulse--rest {
  animation: rest-in 420ms var(--ease-out) 2500ms forwards;
}
@keyframes rest-in {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 0.9; transform: scale(1); }
}
.apparatus.is-in .node--blocked {
  animation: ack 620ms var(--ease-out) 2480ms backwards;
}
@keyframes ack {
  0%   { transform: scale(1); box-shadow: 0 0 0 0 var(--color-glow); }
  40%  { transform: scale(1.32); box-shadow: 0 0 0 7px oklch(55% 0.20 24 / 0.10); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 oklch(55% 0.20 24 / 0); }
}

.thread-frame__stencil {
  position: absolute;
  left: var(--space-sm);
  top: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  color: var(--color-muted);
}
.apparatus__cap {
  font-size: var(--text-sm);
  color: var(--color-muted);
  text-align: center;
  max-width: 32ch;
}
.callout {
  position: absolute;
  top: var(--y);
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-ink-2);
  white-space: nowrap;
}
.callout--left  { left: var(--space-sm); right: calc(50% + 8px); }
.callout--right { left: calc(50% + 8px); right: var(--space-sm); flex-direction: row-reverse; }
.callout__text { white-space: nowrap; }
.callout__line { flex: 1 1 auto; min-width: 0.5rem; height: 1px; background: var(--color-rule-2); }
.callout--hold { color: var(--color-accent-2); }
.callout--hold .callout__line { background: oklch(55% 0.20 24 / 0.4); }

.stage-list { border-top: 1px solid var(--color-rule); }
.stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-lg);
  padding-block: var(--space-lg);
  border-bottom: 1px solid var(--color-rule);
  align-items: start;
  transition: background-color var(--dur-short) var(--ease-out);
}
.stage.is-current { background: linear-gradient(90deg, var(--color-paper-emit) 0%, transparent 70%); }
.stage__rail { display: grid; justify-items: center; gap: var(--space-sm); padding-top: 0.35rem; }
.stage__num { color: var(--color-muted); transition: color var(--dur-short) var(--ease-out); }
.stage__mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--color-rule-2);
  transition:
    background-color var(--dur-short) var(--ease-out),
    border-color var(--dur-short) var(--ease-out),
    box-shadow var(--dur-short) var(--ease-out);
}
.stage.is-current .stage__num { color: var(--color-accent); }
.stage.is-current .stage__mark {
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-glow-2);
}
.stage__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-sub);
  line-height: 1.1;
  letter-spacing: -0.028em;
  color: var(--color-ink);
  margin-bottom: var(--space-2xs);
}
.stage__text {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-ink-2);
  max-width: 48ch;
}

@media (min-width: 62rem) {
  .thread__layout { grid-template-columns: auto minmax(0, 1fr); gap: var(--space-3xl); }
  .apparatus { justify-items: start; }
  .apparatus__cap { text-align: left; }
}

/* ═══ 03 · spec ═══════════════════════════════════════════ */
.spec { margin-top: var(--space-lg); }
.spec th,
.spec td {
  text-align: left;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-rule);
  font-size: var(--text-sm);
  vertical-align: baseline;
}
.spec tr { transition: background-color var(--dur-short) var(--ease-out); }
.spec tbody tr:hover { background: oklch(100% 0 0 / 0.6); }
.spec th {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  color: var(--color-muted);
  width: 42%;
  padding-right: var(--space-md);
}
.spec td { font-weight: 500; color: var(--color-ink); }

/* ═══ 04 · screenshot slots ════════════════════════════════ */
.shots { background: var(--color-paper-2); border-block: 1px solid var(--color-rule); }
.shots__head { margin-bottom: var(--space-2xl); }
.shots__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-lg);
}
.shot { display: grid; justify-items: center; }
.shot__frame {
  position: relative;
  aspect-ratio: 9 / 16;
  max-height: 24rem;
  width: 100%;
  max-width: 14rem;
  border: 1px dashed var(--color-rule-2);
  border-radius: var(--radius-card);
  background:
    radial-gradient(78% 58% at 50% 0%, var(--color-emit-card) 0%, transparent 72%),
    var(--color-paper);
  display: grid;
  place-content: center;
  gap: var(--space-2xs);
  text-align: center;
  padding: var(--space-md);
  transition:
    border-color var(--dur-short) var(--ease-out),
    transform var(--dur-short) var(--ease-soft);
}
.shot:hover .shot__frame { border-color: var(--color-accent); transform: translateY(-4px); }
.shot__hint { color: var(--color-muted); }
.shot__hint-sub {
  font-family: var(--font-display);
  font-size: var(--text-md);
  color: var(--color-ink);
}
.shot__cap { margin-top: var(--space-sm); text-align: center; color: var(--color-muted); }
.shot__frame::before {
  content: "";
  position: absolute;
  inset: var(--space-sm);
  border: 1px solid var(--color-rule);
  border-radius: 10px;
  pointer-events: none;
}
@media (min-width: 40rem) {
  .shots__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ═══ 05 · close ═══════════════════════════════════════════ */
.close { padding-block: var(--space-4xl); }
.close__inner { display: grid; justify-items: center; text-align: center; gap: var(--space-lg); }
.close__mark { width: min(15rem, 62vw); }
.close__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-title);
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--color-ink);
  max-width: 16ch;
  overflow-wrap: anywhere;
}
.close__title em { color: var(--color-accent-2); }
.close__lede { font-size: var(--text-md); color: var(--color-ink-2); max-width: 50ch; line-height: 1.55; }

/* ═══ Footer · inline credits + legal row ══════════════════ */
.foot {
  padding: var(--space-xl) var(--page-gutter) var(--space-2xl);
  border-top: 1px solid var(--color-rule);
  background: var(--color-paper-2);
}
.foot__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: grid;
  gap: var(--space-lg);
}
.foot__line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-xs) var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.foot__dev { color: var(--color-ink); }
.foot__sep { opacity: 0.6; }
.foot__link {
  color: var(--color-ink-2);
  padding-block: 0.15rem;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}
.foot__link:hover,
.foot__link:focus-visible { color: var(--color-accent); border-bottom-color: currentColor; }
.foot__legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-rule);
}
.foot__legal a {
  position: relative;
  color: var(--color-muted);
  padding-block: 0.3rem;
  transition: color var(--dur-short) var(--ease-out);
}
.foot__legal a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-mid) var(--ease-soft);
}
.foot__legal a:hover,
.foot__legal a:focus-visible,
.foot__legal a[aria-current="page"] { color: var(--color-ink); }
.foot__legal a:hover::after,
.foot__legal a:focus-visible::after,
.foot__legal a[aria-current="page"]::after { transform: scaleX(1); }

/* ═══ Reveal · Scroll-locked animations ══════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--dur-long) var(--ease-out),
    transform var(--dur-long) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 80ms);
  will-change: opacity, transform;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--i, 0) * 60ms);
}

/* Staggered children reveal */
.reveal-group { }
.reveal-group > * {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity var(--dur-mid) var(--ease-out),
    transform var(--dur-mid) var(--ease-out);
}
.reveal-group.is-in > * {
  opacity: 1;
  transform: none;
}
.reveal-group.is-in > *:nth-child(1)  { transition-delay: 0ms; }
.reveal-group.is-in > *:nth-child(2)  { transition-delay: 60ms; }
.reveal-group.is-in > *:nth-child(3)  { transition-delay: 120ms; }
.reveal-group.is-in > *:nth-child(4)  { transition-delay: 180ms; }
.reveal-group.is-in > *:nth-child(5)  { transition-delay: 240ms; }
.reveal-group.is-in > *:nth-child(6)  { transition-delay: 300ms; }
.reveal-group.is-in > *:nth-child(7)  { transition-delay: 360ms; }
.reveal-group.is-in > *:nth-child(8)  { transition-delay: 420ms; }

/* Slide-in from left/right */
.reveal-slide-left {
  opacity: 0;
  transform: translateX(-32px);
  transition:
    opacity var(--dur-long) var(--ease-out),
    transform var(--dur-long) var(--ease-out);
}
.reveal-slide-left.is-in { opacity: 1; transform: none; }

.reveal-slide-right {
  opacity: 0;
  transform: translateX(32px);
  transition:
    opacity var(--dur-long) var(--ease-out),
    transform var(--dur-long) var(--ease-out);
}
.reveal-slide-right.is-in { opacity: 1; transform: none; }

/* Scale fade */
.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition:
    opacity var(--dur-mid) var(--ease-out),
    transform var(--dur-mid) var(--ease-out);
}
.reveal-scale.is-in { opacity: 1; transform: scale(1); }

/* Parallax reveal for hero elements */
.reveal-parallax {
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  transition:
    opacity var(--dur-long) var(--ease-out),
    transform var(--dur-long) var(--ease-out);
}
.reveal-parallax.is-in { opacity: 1; transform: none; }

/* Text line-by-line reveal */
.reveal-lines {
  overflow: hidden;
}
.reveal-lines .line {
  display: block;
  opacity: 0;
  transform: translateY(1.2em);
  transition:
    opacity var(--dur-mid) var(--ease-out),
    transform var(--dur-mid) var(--ease-out);
}
.reveal-lines.is-in .line {
  opacity: 1;
  transform: none;
}

/* ═══ Reduced motion · everything collapses to final state ══ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
  .reveal,
  .reveal-group > *,
  .reveal-slide-left,
  .reveal-slide-right,
  .reveal-scale,
  .reveal-parallax,
  .reveal-lines .line { opacity: 1; transform: none; }
  .reveal-group > * { transition-delay: 0ms !important; }
  .hero__mark, .hero__title, .hero__lede, .hero__actions, .hero__note {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .hero__title em::after { transform: scaleX(1); animation: none; }
  .thread-frame { opacity: 1; transform: none; }
  .pulse { opacity: 0; animation: none; }
  .pulse--rest { opacity: 0.9; transform: scale(1); animation: none; }
  .node--blocked { animation: none; }
  .card:hover { transform: none; }
  .card:hover::after { animation: none; opacity: 0; }
  .shot:hover .shot__frame { transform: none; }
  .nav__progress { display: none; }
  .loader { display: none; }
}
