@import url('./tokens.css');

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: var(--border-strong) var(--surface-base); }
h1, h2, h3 { text-wrap: balance; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--surface-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
::selection { background: var(--accent); color: var(--text-inverse); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; border-radius: 6px; }

/* ambient layers */
.field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0.9; }
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.07; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 620px at 88% 6%, rgb(42 60 255 / 0.10), transparent 62%),
    radial-gradient(760px 560px at 0% 70%, rgb(255 159 67 / 0.12), transparent 62%),
    radial-gradient(640px 480px at 60% 100%, rgb(15 118 110 / 0.08), transparent 62%);
}

.page { position: relative; z-index: 2; width: 100%; max-width: 100%; overflow-x: clip; }

/* ---------- nav (minimal split) ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: var(--space-4) clamp(16px, 4vw, 48px);
  transition: background-color var(--motion-base) var(--ease-out), border-color var(--motion-base) var(--ease-out);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: rgb(244 243 238 / 0.82); backdrop-filter: blur(14px); border-color: var(--border-subtle); }
.brand { display: inline-flex; align-items: center; gap: var(--space-3); font-weight: 600; letter-spacing: -0.01em; }
.brand-mark svg { width: 30px; height: 30px; fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.brand-mark svg circle { stroke: var(--border-strong); }
.nav-links { position: relative; display: flex; gap: var(--space-2); padding: var(--space-1); border: 1px solid var(--border-subtle); border-radius: var(--radius-full); background: rgb(255 255 255 / 0.7); backdrop-filter: blur(10px); }
.nav-links a { font-size: 14px; color: var(--text-secondary); padding: 6px 14px; border-radius: var(--radius-full); transition: color var(--motion-fast) var(--ease-out), background-color var(--motion-fast) var(--ease-out); }
.nav-links a:hover { color: var(--text-primary); background: var(--surface-hover); }
.nav-right { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-4); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font: 600 15px/1 var(--font-sans); padding: 16px 26px; border-radius: var(--radius-full);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background-color var(--motion-fast) var(--ease-out), border-color var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
}
.btn .arrow { display: inline-block; transition: transform var(--motion-base) var(--ease-out); }
.btn-primary { background: var(--accent); color: var(--text-inverse); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-primary); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--border-glow); }
.btn-sm { padding: 10px 18px; font-size: 13px; }
.btn-xl { padding: 22px 36px; font-size: 18px; }

/* ---------- hero (artistic asymmetry) ---------- */
.hero {
  position: relative; min-height: 100svh;
  padding: 180px clamp(16px, 5vw, 80px) var(--space-9);
  display: grid; grid-template-columns: minmax(0, 1fr); align-content: center;
}
.hero-copy { position: relative; z-index: 2; max-width: 72rem; }
.hero-title {
  font-size: clamp(3rem, 5.8vw, 6rem); line-height: 1.0; letter-spacing: -0.035em; font-weight: 700;
  margin: 0 0 var(--space-6);
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero-title .line-inner { display: inline-block; will-change: transform; }
.hero-title em { font-style: normal; color: var(--accent); }
.pill-img {
  display: inline-block; vertical-align: middle; width: 1.9em; height: 0.82em; margin: 0 0.12em 0.14em 0;
  border-radius: var(--radius-full); position: relative; overflow: hidden; isolation: isolate;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.5), 0 6px 20px -6px rgb(42 60 255 / 0.5);
}
.pill-img::before {
  content: ''; position: absolute; inset: 0; background-size: 220% 100%;
  background-image: linear-gradient(110deg, #2a3cff 0%, #7c3aed 22%, #d4208f 44%, #ff9f43 66%, #0f766e 88%, #2a3cff 100%);
  animation: pill-drift 9s linear infinite;
}
@keyframes pill-drift { to { background-position: -220% 0; } }
.hero-sub { max-width: 60ch; font-size: clamp(17px, 1.35vw, 20px); color: var(--text-secondary); margin: 0 0 var(--space-7); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-4); }

.specimen {
  position: absolute; z-index: 1; right: clamp(16px, 5vw, 80px); bottom: 6vh; margin: 0;
  width: clamp(260px, 30vw, 460px);
}
.specimen-frame {
  position: relative; aspect-ratio: 1; border: 1px solid var(--border-subtle); border-radius: var(--radius-xl);
  background: radial-gradient(circle at 50% 45%, rgb(42 60 255 / 0.07), transparent 65%), rgb(255 255 255 / 0.72);
  backdrop-filter: blur(6px); box-shadow: var(--shadow-md);
  overflow: hidden;
}
.specimen-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.specimen-hud span { position: absolute; font-size: 11px; color: var(--text-muted); letter-spacing: 0.04em; }
.specimen-hud b { color: var(--accent-text); font-weight: 400; }
.specimen-hud .tl { top: 16px; left: 18px; } .specimen-hud .tr { top: 16px; right: 18px; }
.specimen-hud .bl { bottom: 16px; left: 18px; } .specimen-hud .br { bottom: 16px; right: 18px; }
.crosshair { position: absolute; inset: 0; pointer-events: none; }
.crosshair::before, .crosshair::after { content: ''; position: absolute; background: rgb(42 60 255 / 0.16); }
.crosshair::before { left: 50%; top: 12%; bottom: 12%; width: 1px; }
.crosshair::after { top: 50%; left: 12%; right: 12%; height: 1px; }
.specimen figcaption { margin-top: var(--space-3); font-size: 13px; color: var(--text-muted); text-align: right; }

/* ---------- chapters ---------- */
.chapter { position: relative; padding: var(--space-9) clamp(16px, 5vw, 80px); max-width: 1480px; margin: 0 auto; }
.chapter-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--space-5); margin-bottom: var(--space-7); }
.chapter-title { font-size: clamp(2rem, 3.4vw, 3.25rem); line-height: 1.05; letter-spacing: -0.03em; font-weight: 650; margin: 0; max-width: 56rem; }
.chapter-sub { color: var(--text-muted); font-size: 14px; margin: 0; max-width: 22rem; }

/* ---------- horizontal accordion ---------- */
.accordion { display: flex; gap: var(--space-3); height: 600px; }
.slice {
  --sig: var(--accent);
  position: relative; flex: 1 1 0; min-width: 80px; display: flex;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface-raised); box-shadow: var(--shadow-sm);
  transition: flex-grow var(--motion-slow) var(--ease-out), border-color var(--motion-base) var(--ease-out);
}
.slice.is-open { flex-grow: 10; border-color: color-mix(in oklab, var(--sig) 45%, var(--border-subtle)); box-shadow: var(--shadow-md); }
.slice-trigger {
  position: absolute; inset: 0 auto 0 0; width: 80px; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: var(--space-5) 0; background: none; border: 0; color: var(--text-primary); cursor: pointer; font: inherit;
}
.slice.is-open .slice-trigger { width: 80px; }
.slice-label { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.slice-num { font-family: var(--font-mono); font-size: 12px; color: var(--sig); }
.slice-body { position: absolute; inset: 0 0 0 80px; display: grid; grid-template-columns: 0.9fr 1.1fr; opacity: 0; transition: opacity var(--motion-base) var(--ease-out); pointer-events: none; }
.slice.is-open .slice-body { opacity: 1; pointer-events: auto; transition-delay: 220ms; }
.slice-media { position: relative; overflow: hidden; border-right: 1px solid var(--border-subtle); }
.slice-media::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in oklab, var(--sig) 22%, transparent), transparent 62%),
    radial-gradient(circle, color-mix(in oklab, var(--sig) 18%, transparent) 1px, transparent 1.4px) 0 0/22px 22px,
    color-mix(in oklab, var(--sig) 7%, var(--surface-raised));
  transform: scale(1.08);
  transition: transform 1.2s var(--ease-out);
}
.slice-media svg { position: absolute; inset: 8%; width: 84%; height: 84%; overflow: visible; }
.slice-media svg .s { fill: none; stroke: var(--sig); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.slice-media svg .f { fill: var(--sig); }
.slice-media svg .q { fill: color-mix(in oklab, var(--sig) 14%, white); stroke: var(--sig); stroke-width: 1.5; }
.slice-media svg .d { fill: none; stroke: var(--text-muted); stroke-width: 1.5; stroke-dasharray: 4 6; }
.slice-media svg text { font: 500 11px var(--font-mono); fill: var(--text-secondary); }
.slice.is-open .slice-media::before { transform: scale(1); }
.slice-content { padding: var(--space-6); display: flex; flex-direction: column; justify-content: flex-end; gap: var(--space-4); min-width: 0; }
.slice-content h3 { font-size: clamp(1.4rem, 2vw, 2rem); line-height: 1.12; letter-spacing: -0.02em; margin: 0; }
.slice-content p { color: var(--text-secondary); margin: 0; }
.stack { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: 0; }
.stack li { font-size: 12px; color: var(--text-secondary); border: 1px solid var(--border-strong); border-radius: var(--radius-full); padding: 4px 10px; }
.link-arrow { color: var(--sig); font-weight: 600; display: inline-flex; gap: var(--space-2); align-items: center; margin-top: var(--space-2); }
.link-arrow span { transition: transform var(--motion-base) var(--ease-out); }

/* ---------- bento: 4 cols x 2 rows, dense ----------
   a: c1-2 r1-2 | b: c3-4 r1 | c: c3 r2 | d: c4 r2  => 8/8 cells filled */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(240px, auto); grid-auto-flow: dense; gap: var(--space-4); }
.cell {
  --mx: 50%; --my: 50%;
  position: relative; overflow: hidden; padding: var(--space-6);
  background: radial-gradient(420px circle at var(--mx) var(--my), rgb(42 60 255 / var(--spot, 0)), transparent 60%), var(--surface-raised);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  transition: border-color var(--motion-base) var(--ease-out);
}
.cell:hover { --spot: 0.08; border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.cell h3 { font-size: 22px; line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 var(--space-2); max-width: 22ch; }
.cell p { color: var(--text-secondary); font-size: 15px; margin: 0; max-width: 42ch; }
.cell-a { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; }
.cell-b { grid-column: span 2; }
.cell-c p, .cell-d p { margin-top: auto; font-size: 14px; }

.cell-c, .cell-d { display: flex; flex-direction: column; gap: var(--space-4); }
.cell-c p, .cell-d p { margin-top: auto; font-size: 14px; }
.cell .big { white-space: nowrap; font-size: clamp(2rem, 2.9vw, 2.9rem); line-height: 1; letter-spacing: -0.04em; font-weight: 700; margin: auto 0 0; display: flex; align-items: baseline; gap: var(--space-3); }
.cell .big small { font-size: 14px; letter-spacing: 0; font-weight: 500; color: var(--text-muted); }
.cell .big s { text-decoration: none; color: var(--text-muted); font-weight: 500; }
.cell .big .arrow-to { color: var(--sig); font-size: 0.6em; }

.dist { width: 100%; margin-top: auto; overflow: visible; }
.dist path { fill: none; stroke-width: 2.5; }
.dist-base { stroke: var(--text-muted); stroke-dasharray: 5 6; }
.dist-cand { stroke: var(--sig-eval); }
.dist-bar { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 2 4; }
.legend { display: flex; gap: var(--space-5); font-size: 12px; color: var(--text-muted); margin-top: var(--space-4); }
.legend i { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 6px; }
.k-base { background: var(--text-muted); } .k-cand { background: var(--sig-eval); } .k-bar { background: var(--accent); }

.bars { display: grid; gap: var(--space-3); margin-top: var(--space-5); }
.bar-row { display: grid; grid-template-columns: 9rem 1fr auto; gap: var(--space-4); align-items: center; font-size: 13px; color: var(--text-secondary); }
.bar-track { height: 14px; border-radius: 99px; background: var(--surface-overlay); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: var(--w); border-radius: 99px; background: var(--c, var(--accent)); transform-origin: 0 50%; }
.bar-row b { font-weight: 500; color: var(--text-primary); min-width: 7ch; text-align: right; }

/* ---------- scrub text ---------- */
.chapter-center { display: flex; justify-content: center; padding-block: var(--space-10); }
.scrub { max-width: 64rem; margin: 0; font-size: clamp(1.75rem, 3.2vw, 3rem); line-height: 1.3; letter-spacing: -0.02em; font-weight: 550; text-wrap: pretty; }
.scrub .w { opacity: 0.1; }

/* ---------- plates (scale & fade) ---------- */
.plates { display: flex; flex-direction: column; gap: var(--space-8); }
.plate { margin: 0; position: relative; border-radius: var(--radius-xl); overflow: hidden; aspect-ratio: 16 / 8; border: 1px solid var(--border-subtle); background: var(--surface-overlay); box-shadow: var(--shadow-md); transform-origin: 50% 50%; }
.plate-img { position: absolute; inset: 0; background: var(--img) left top/cover; }
.plate-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgb(244 243 238 / 0.55)); }
.plate figcaption { position: absolute; z-index: 2; left: var(--space-6); bottom: var(--space-6); width: min(36rem, calc(100% - 2 * var(--space-6))); display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-5) var(--space-6); border-radius: var(--radius-lg); background: rgb(255 255 255 / 0.9); backdrop-filter: blur(14px); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-lg); }
.plate figcaption span { font-size: 13px; color: var(--sig); }
.plate figcaption strong { font-size: clamp(1.1rem, 1.7vw, 1.6rem); line-height: 1.3; letter-spacing: -0.02em; font-weight: 600; max-width: 48rem; }
.plate code { font-family: var(--font-mono); font-size: 0.8em; color: var(--sig); }

/* ---------- carousel ---------- */
.carousel { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-8); align-items: center; padding: var(--space-8) 0; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.carousel-glyphs { display: flex; }
.carousel-glyphs span {
  width: 60px; height: 60px; border-radius: 99px; display: grid; place-items: center; margin-left: -20px;
  font-family: var(--font-mono); font-size: 12px; color: var(--sig);
  background: radial-gradient(circle at 30% 30%, color-mix(in oklab, var(--sig) 22%, white), var(--surface-raised));
  border: 1px solid color-mix(in oklab, var(--sig) 40%, var(--border-strong));
  box-shadow: 0 0 0 4px var(--surface-base), var(--shadow-sm);
  transition: transform var(--motion-base) var(--ease-out), opacity var(--motion-base) var(--ease-out);
}
.carousel-glyphs span:first-child { margin-left: 0; }
.carousel-glyphs span.is-dim { opacity: 0.35; transform: scale(0.9); }
.carousel-track { position: relative; min-height: 13rem; grid-column: 2; }
.quote { position: absolute; inset: 0; margin: 0; opacity: 0; visibility: hidden; }
.quote.is-active { opacity: 1; visibility: visible; }
.quote p { font-size: clamp(1.4rem, 2.4vw, 2.2rem); line-height: 1.3; letter-spacing: -0.02em; margin: 0 0 var(--space-5); max-width: 52rem; }
.quote cite { font-style: normal; font-size: 14px; color: var(--text-muted); }
.carousel-controls { grid-column: 2; display: flex; align-items: center; gap: var(--space-4); }
.carousel-count { font-size: 13px; color: var(--text-muted); min-width: 4ch; text-align: center; }
.carousel-count b { color: var(--text-primary); font-weight: 400; }
.icon-btn { width: 44px; height: 44px; border-radius: 99px; border: 1px solid var(--border-strong); background: transparent; color: var(--text-primary); display: grid; place-items: center; cursor: pointer; transition: background-color var(--motion-fast) var(--ease-out), border-color var(--motion-fast) var(--ease-out); }
.icon-btn:hover { background: var(--surface-hover); border-color: var(--border-glow); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- CTA + footer ---------- */
.cta { position: relative; text-align: center; padding: var(--space-10) clamp(16px, 5vw, 80px); display: flex; flex-direction: column; align-items: center; gap: var(--space-6); }
.cta::before { content: ''; position: absolute; inset: 20% 10%; z-index: -1; background: radial-gradient(ellipse at center, rgb(42 60 255 / 0.14), transparent 65%); }
.cta-title { font-size: clamp(3rem, 6.6vw, 6rem); line-height: 0.98; letter-spacing: -0.04em; font-weight: 750; margin: 0; max-width: 80rem; }
.cta-title em { font-style: normal; color: var(--accent); }
.cta .btn-primary { box-shadow: 0 14px 34px -10px rgb(42 60 255 / 0.6); }
.cta-sub { color: var(--text-secondary); font-size: 18px; margin: 0; max-width: 36rem; }
.footer { display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; align-items: center; padding: var(--space-6) clamp(16px, 5vw, 80px) var(--space-7); border-top: 1px solid var(--border-subtle); color: var(--text-muted); font-size: 13px; }
.footer-links { display: flex; gap: var(--space-5); }
.footer-links a { color: var(--text-secondary); transition: color var(--motion-fast) var(--ease-out); }
.footer-links a:hover { color: var(--accent-text); }
.footer-clock b { color: var(--text-secondary); font-weight: 400; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- icons: one authored stroke family ---------- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 1em; height: 1em; vertical-align: -0.14em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.badge .i { width: 1.1em; height: 1.1em; }

/* ---------- motion layer ----------
   Press feedback 160ms ease-out; hover colour 150ms ease; on-screen morphs use
   --ease-in-out; any hover-driven movement is gated to fine pointers. */
.btn { transition: background-color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease), scale var(--motion-press) var(--ease-out); }
.chip, .icon-btn { transition: background-color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease), scale var(--motion-press) var(--ease-out); }
/* `scale` composes with GSAP's inline magnetic transform instead of fighting it */
.btn:active, .chip:active, .icon-btn:active { scale: 0.97; }
.btn .arrow, .link-arrow span { display: inline-block; transition: transform var(--motion-base) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover .arrow, .link-arrow:hover span { transform: translateX(4px); }
  .slice:hover .slice-media::before { transform: scale(1.04); }
}

/* horizontal accordion: the slice morphs on screen, its content arrives after */
.slice { transition: flex-grow var(--motion-slow) var(--ease-in-out), border-color var(--motion-base) var(--ease); }
.slice-body { transition: opacity var(--motion-base) var(--ease-out); }
.slice.is-open .slice-body { transition-delay: 180ms; }
.slice-body > *, .slice-content > * { opacity: 0; transform: translateY(8px); transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out); }
.slice.is-open .slice-body > *, .slice.is-open .slice-content > * { opacity: 1; transform: none; }
.slice.is-open .slice-body > :nth-child(1), .slice.is-open .slice-content > :nth-child(1) { transition-delay: 220ms; }
.slice.is-open .slice-body > :nth-child(2), .slice.is-open .slice-content > :nth-child(2) { transition-delay: 270ms; }
.slice.is-open .slice-body > :nth-child(3), .slice.is-open .slice-content > :nth-child(3) { transition-delay: 320ms; }
.slice.is-open .slice-body > :nth-child(4), .slice.is-open .slice-content > :nth-child(4) { transition-delay: 370ms; }
.slice.is-open .slice-body > :nth-child(5), .slice.is-open .slice-content > :nth-child(5) { transition-delay: 420ms; }

/* reading progress under the nav: state, scrubbed linearly */
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--sig); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }

/* one-shot clip reveal for chapter titles (marketing surfaces only; JS adds .reveal) */
.reveal { clip-path: inset(0 0 100% 0); transition: clip-path var(--motion-slow) var(--ease-in-out); }
.reveal.is-visible { clip-path: inset(0 0 -10% 0); }

@media (prefers-reduced-motion: reduce) {
  /* fewer and gentler, not zero: keep fades and colour, drop movement and loops */
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-property: opacity, color, background-color, border-color, box-shadow !important; }
  .btn:active, .chip:active, .icon-btn:active { scale: none; }
  .slice-body > *, .slice-content > * { transform: none; }
  .reveal { clip-path: none; }
  .scrub .w { opacity: 1; }
}

/* scroll-spy: a clipped copy of the links in the active style, so text colour and
   pill move as one surface (tab-indicator recipe) */
.nav-links-active { position: absolute; inset: 0; display: flex; gap: var(--space-2); padding: var(--space-1); pointer-events: none;
  clip-path: inset(0 100% 0 0 round 999px); transition: clip-path var(--motion-base) var(--ease-in-out); }
.nav-links-active span { font-size: 14px; padding: 6px 14px; border-radius: var(--radius-full); background: var(--accent); color: var(--text-inverse); white-space: nowrap; }
.specimen-hud .cursor { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); color: var(--text-muted); opacity: 0; transition: opacity var(--motion-fast) var(--ease); }
.specimen:hover .specimen-hud .cursor { opacity: 1; }
.quote { will-change: transform, opacity; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .nav { grid-template-columns: 1fr auto; row-gap: var(--space-3); }
  .nav-links { grid-column: 1 / -1; grid-row: 2; justify-self: start; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .hero { padding-top: 168px; }
  .specimen { position: relative; right: auto; bottom: auto; width: min(420px, 100%); margin: var(--space-8) 0 0 auto; }
  .accordion { flex-direction: column; height: auto; }
  .slice { min-height: 72px; flex: none; }
  .slice-trigger { position: relative; width: 100%; flex-direction: row; padding: var(--space-5); inset: auto; }
  .slice.is-open .slice-trigger { width: 100%; }
  .slice-label { writing-mode: horizontal-tb; transform: none; }
  .slice-body { position: relative; inset: auto; display: none; grid-template-columns: 1fr; }
  .slice.is-open { flex-direction: column; }
  .slice.is-open .slice-body { display: grid; }
  .slice-media { aspect-ratio: 16 / 9; border-right: 0; border-bottom: 1px solid var(--border-subtle); }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell-a, .cell-b { grid-column: span 2; }
  .cell-a { grid-row: span 1; min-height: 380px; }
  .slice-label { display: flex; gap: var(--space-3); align-items: baseline; }
  .carousel { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .bar-row { grid-template-columns: 6.5rem 1fr auto; }
  .carousel-track, .carousel-controls { grid-column: 1; }
}
@media (max-width: 640px) {
  .hero { padding-top: 156px; }
  .hero-title { font-size: 2.6rem; }
  .cta-title { font-size: 2.75rem; }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .cell-a, .cell-b { grid-column: span 1; }
  .plate { aspect-ratio: 4 / 5; }
  .plate figcaption { left: var(--space-4); bottom: var(--space-4); width: calc(100% - 2 * var(--space-4)); padding: var(--space-4); }
  .slice-content { padding: var(--space-5); }
  .carousel-track { min-height: 18rem; }
}

