/* =========================================================
   SUPERORGANISM — design tokens & system theme
   ========================================================= */

:root {
  /* Light tokens (default) */
  --color-bg: #F3EDE3;
  --color-surface: #ECE3D2;
  --color-surface-2: #E4D7BE;
  --color-text: #0E0B08;
  --color-text-muted: #5A4F44;
  --color-accent: #C2410C;        /* Formic Ember */
  --color-accent-soft: #E0631D;
  --color-accent-deep: #7C2D12;   /* Queen Mahogany */
  --color-data: #84CC16;          /* Leafcutter Chartreuse, sparingly */
  --color-border: rgba(14, 11, 8, 0.10);
  --color-border-strong: rgba(14, 11, 8, 0.22);
  --shadow-press: 0 1px 0 rgba(14, 11, 8, 0.08);

  /* Typography */
  --font-display: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Type scale, 1.333 ratio rooted at 1rem */
  --size-2xs: 0.703rem;
  --size-xs: 0.844rem;
  --size-sm: 1rem;
  --size-md: 1.25rem;
  --size-lg: 1.563rem;
  --size-xl: 2.083rem;
  --size-2xl: 2.777rem;
  --size-3xl: 3.7rem;
  --size-4xl: 4.93rem;
  --size-5xl: 6.575rem;
  --size-6xl: 8.768rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 10rem;

  /* Layout */
  --content-max: 76rem;
  --content-pad: clamp(1.25rem, 4vw, 3rem);
  --section-pad-y: clamp(4rem, 10vw, 10rem);

  /* Radii — kept tight, this is healthcare-bold not soft-app */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-pill: 999px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0E0B08;
    --color-surface: #181310;
    --color-surface-2: #221B16;
    --color-text: #F3EDE3;
    --color-text-muted: #A89684;
    --color-accent: #EA580C;
    --color-accent-soft: #F97316;
    --color-accent-deep: #C2410C;
    --color-data: #A3E635;
    --color-border: rgba(243, 237, 227, 0.10);
    --color-border-strong: rgba(243, 237, 227, 0.22);
    --shadow-press: 0 1px 0 rgba(243, 237, 227, 0.06);
    color-scheme: dark;
  }
}

/* Manual theme override removed — system preference only. */

/* =========================================================
   Reset & base
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--size-sm);
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--color-accent); color: var(--color-bg); }

.skip {
  position: absolute;
  top: -100px;
  left: 1rem;
  padding: 0.75rem 1rem;
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: var(--radius-sm);
  z-index: 100;
}
.skip:focus { top: 1rem; }

/* =========================================================
   Header
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-4) var(--content-pad);
  background: color-mix(in oklab, var(--color-bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--color-border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-text);
}
.brand-mark { width: 1.6rem; height: 1.6rem; color: var(--color-accent); }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--size-md);
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  justify-content: center;
  gap: clamp(0.75rem, 2.5vw, 2rem);
  font-size: var(--size-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}
.nav a { padding: 0.4rem 0.2rem; transition: color 0.2s ease; position: relative; }
.nav a:hover { color: var(--color-text); }
.nav a:hover::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--color-accent);
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  color: var(--color-text);
  transition: background 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover { background: var(--color-surface); transform: translateY(-1px); }
.theme-toggle .icon { width: 1rem; height: 1rem; fill: currentColor; }
.theme-toggle .icon-moon { display: none; }

:root[data-theme="dark"] .theme-toggle .icon-sun,
:root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon,
:root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: none; }
}

@media (max-width: 720px) {
  .nav { display: none; }
  .site-header { grid-template-columns: auto 1fr auto; }
}

/* =========================================================
   Typography utilities
   ========================================================= */

.display {
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 0;
  letter-spacing: -0.025em;
  line-height: 0.96;
  color: var(--color-text);
  margin: 0;
}
h1.display { font-size: clamp(3rem, 9vw, var(--size-6xl)); }
h2.display { font-size: clamp(2.2rem, 6vw, var(--size-4xl)); line-height: 1; }
.display em {
  font-style: italic;
  color: var(--color-accent);
  font-weight: 500;
}

.eyebrow,
.kicker {
  font-size: var(--size-2xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-accent);
  margin: 0 0 var(--space-5);
}

.lede {
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 1.6vw, var(--size-md));
  line-height: 1.5;
  color: var(--color-text-muted);
  max-width: 52ch;
  margin: 0;
}

.prose {
  font-size: var(--size-md);
  line-height: 1.55;
  color: var(--color-text);
  max-width: 60ch;
  margin: 0;
}

/* =========================================================
   Buttons
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  font-size: var(--size-sm);
  font-weight: 500;
  letter-spacing: 0.005em;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  min-height: 48px;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--shadow-press);
}
.btn-primary {
  background: var(--color-accent);
  color: #F3EDE3;
}
.btn-primary:hover { background: var(--color-accent-deep); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border-strong);
}
.btn-ghost:hover { border-color: var(--color-text); background: var(--color-surface); }
.btn-large { padding: 1.15rem 2rem; font-size: var(--size-md); }

.cta-row { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }

/* =========================================================
   Hero
   ========================================================= */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding: clamp(3rem, 8vw, 7rem) var(--content-pad) clamp(3rem, 7vw, 6rem);
  max-width: var(--content-max);
  margin: 0 auto;
  min-height: clamp(620px, 78vh, 880px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -10% -20% 0 -20%;
  background:
    radial-gradient(45% 60% at 80% 30%, color-mix(in oklab, var(--color-accent) 22%, transparent), transparent 70%),
    radial-gradient(60% 80% at 10% 90%, color-mix(in oklab, var(--color-accent-deep) 18%, transparent), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.hero-inner { position: relative; z-index: 2; }

.hero-stage {
  position: relative;
  align-self: stretch;
  display: grid;
  place-items: center;
  min-height: 320px;
}
.hero-stage .trail { width: 100%; height: 100%; max-height: 520px; color: var(--color-accent); }
.hero-tag {
  position: absolute;
  bottom: 0;
  right: 0;
  font-size: var(--size-2xs);
  font-style: italic;
  color: var(--color-text-muted);
  letter-spacing: 0.12em;
  font-family: var(--font-display);
}

.ant-march g.ant {
  fill: var(--color-text);
  color: var(--color-text);
  opacity: 0.86;
}
.ant-march { animation: march 14s linear infinite; transform-origin: 0 0; }
@keyframes march {
  0%   { transform: translate(-80px, 480px) rotate(-15deg) scale(1); }
  20%  { transform: translate(180px, 380px) rotate(-30deg) scale(1.05); }
  40%  { transform: translate(360px, 470px) rotate(0deg) scale(1); }
  60%  { transform: translate(540px, 400px) rotate(-25deg) scale(1.05); }
  80%  { transform: translate(720px, 360px) rotate(-15deg) scale(1.1); }
  100% { transform: translate(900px, 320px) rotate(-10deg) scale(1.1); }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-stage { min-height: 280px; order: 2; }
}

/* =========================================================
   Strip (social-proof-ish marquee)
   ========================================================= */

.strip {
  border-block: 1px solid var(--color-border-strong);
  background: var(--color-surface);
}
.strip-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(0.6rem, 2vw, 2rem);
  padding: var(--space-5) var(--content-pad);
  max-width: var(--content-max);
  margin: 0 auto;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(0.95rem, 1.4vw, var(--size-md));
  color: var(--color-text);
  text-align: center;
}
.strip-inner > span:nth-child(even) {
  color: var(--color-accent);
  font-style: normal;
  font-family: var(--font-body);
}

/* =========================================================
   Sections
   ========================================================= */

.section {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--section-pad-y) var(--content-pad);
}
.section-tinted {
  background: var(--color-surface);
  max-width: none;
  border-block: 1px solid var(--color-border);
}
.section-tinted > .section-head,
.section-tinted > .powers {
  max-width: var(--content-max);
  margin-inline: auto;
}

.section-head { margin-bottom: var(--space-8); max-width: 56ch; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
}
@media (max-width: 760px) {
  .two-col { grid-template-columns: 1fr; gap: var(--space-6); }
}

/* =========================================================
   Powers list — interactive, so cards are allowed
   ========================================================= */

.powers {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--color-border-strong);
  border-left: 1px solid var(--color-border-strong);
}
@media (max-width: 1024px) { .powers { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .powers { grid-template-columns: 1fr; } }
.power {
  position: relative;
  padding: var(--space-6) var(--space-5);
  border-right: 1px solid var(--color-border-strong);
  border-bottom: 1px solid var(--color-border-strong);
  background: transparent;
  transition: background 0.25s ease;
}
.power:hover { background: var(--color-surface-2); }
.power:hover .power-index { color: var(--color-accent); }
.power-index {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: var(--size-md);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  letter-spacing: 0.1em;
  transition: color 0.25s ease;
}
.power h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 2.2vw, var(--size-xl));
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-4);
  color: var(--color-text);
}
.power p {
  margin: 0;
  font-size: var(--size-sm);
  line-height: 1.55;
  color: var(--color-text-muted);
}

/* =========================================================
   Chemistry split
   ========================================================= */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}
.split-text > .kicker { margin-bottom: var(--space-4); }
.split-text .display { margin-bottom: var(--space-6); }
.split-text .prose + .prose { margin-top: var(--space-5); }
.split-figure {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  max-width: 460px;
  justify-self: end;
  color: var(--color-accent);
}
.split-figure svg { width: 100%; height: 100%; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split-figure { justify-self: center; }
}

/* =========================================================
   Stats — large numerals
   ========================================================= */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0;
  border-top: 1px solid var(--color-border-strong);
  border-left: 1px solid var(--color-border-strong);
  margin: 0;
}
.stat {
  padding: var(--space-6) var(--space-5);
  border-right: 1px solid var(--color-border-strong);
  border-bottom: 1px solid var(--color-border-strong);
}
.stat dt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, var(--size-4xl));
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--color-accent);
  margin: 0 0 var(--space-3);
  font-variant-numeric: tabular-nums;
}
.stat dd {
  margin: 0;
  font-size: var(--size-sm);
  line-height: 1.5;
  color: var(--color-text-muted);
  max-width: 32ch;
}

/* =========================================================
   Final CTA
   ========================================================= */

.final-cta {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(5rem, 12vw, 10rem) var(--content-pad);
  text-align: left;
  border-top: 1px solid var(--color-border-strong);
}
.final-cta .display { margin-bottom: var(--space-5); font-size: clamp(3.5rem, 12vw, var(--size-6xl)); }
.final-cta .lede { margin-bottom: var(--space-7); max-width: 48ch; }

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-8) var(--content-pad) var(--space-6);
}
.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  gap: var(--space-3);
}
.footer-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--size-md);
  margin: 0;
  color: var(--color-text);
}
.footer-meta {
  margin: 0;
  font-size: var(--size-sm);
  color: var(--color-text-muted);
  max-width: 60ch;
}
.footer-sources {
  margin: var(--space-5) 0 0;
  font-size: var(--size-xs);
  color: var(--color-text-muted);
  font-style: italic;
}

/* =========================================================
   Reveal animations
   ========================================================= */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .hero-trail { stroke-dashoffset: 0 !important; }
  .radial-core { animation: none !important; }
  .ant-march { animation: none !important; }
}

/* =========================================================
   Read progress bar (top)
   ========================================================= */

.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 60;
  pointer-events: none;
  background: transparent;
}
.read-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--color-accent);
  transition: width 0.08s linear;
}

/* =========================================================
   Long-read prose column
   ========================================================= */

.section-prose .prose-column {
  max-width: 64ch;
  margin-inline: 0;
  display: grid;
  gap: var(--space-5);
}
.section-prose .prose { max-width: none; }
.prose-aside {
  margin-top: var(--space-7);
  max-width: 64ch;
  color: var(--color-text-muted);
  border-left: 2px solid var(--color-accent);
  padding-left: var(--space-4);
  font-style: italic;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--size-md);
  line-height: 1.45;
}

.prose-opener {
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
  line-height: 1.5;
}
.dropcap {
  float: left;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 4.6rem;
  line-height: 0.85;
  padding: 0.2rem 0.6rem 0 0;
  color: var(--color-accent);
  font-feature-settings: "ss01";
  animation: dropIn 0.7s 0.08s both ease-out;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.pullquote {
  margin: var(--space-4) 0;
  padding: var(--space-5) 0 var(--space-5) var(--space-6);
  border-left: 3px solid var(--color-accent);
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.4rem, 2.6vw, var(--size-xl));
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--color-text);
  max-width: 32ch;
}

/* =========================================================
   Timeline (history section)
   ========================================================= */

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--color-border-strong);
  border-left: 1px solid var(--color-border-strong);
}
.tl {
  padding: var(--space-6) var(--space-5);
  border-right: 1px solid var(--color-border-strong);
  border-bottom: 1px solid var(--color-border-strong);
  position: relative;
}
.tl-when {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  color: var(--color-accent);
  font-size: var(--size-md);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-4);
}
.tl h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--size-md);
  line-height: 1.1;
  margin: 0 0 var(--space-3);
  color: var(--color-text);
}
.tl p {
  margin: 0;
  font-size: var(--size-sm);
  line-height: 1.5;
  color: var(--color-text-muted);
}
.tl em { color: var(--color-text); font-style: italic; }

@media (max-width: 960px) { .timeline { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .timeline { grid-template-columns: 1fr; } }

/* =========================================================
   Castes
   ========================================================= */

.castes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}
.caste {
  display: grid;
  gap: var(--space-3);
}
.caste-fig {
  width: 80px;
  height: 96px;
  color: var(--color-accent);
  opacity: 0.95;
  margin-bottom: var(--space-3);
}
.caste h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--size-lg);
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--color-text);
}
.caste p {
  margin: 0;
  font-size: var(--size-sm);
  line-height: 1.55;
  color: var(--color-text-muted);
}
@media (max-width: 960px) { .castes { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .castes { grid-template-columns: 1fr; } }

/* =========================================================
   Case study layout
   ========================================================= */

.section-case .case-head { max-width: 56ch; margin-bottom: var(--space-7); }
.case-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.case-grid-flip { grid-template-columns: 1fr 360px; }
.case-grid-flip .case-fig { order: 2; }
.case-grid-flip .case-text { order: 1; }
.case-fig {
  position: sticky;
  top: 96px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  color: var(--color-accent);
}
.case-fig svg { width: 100%; height: auto; }
.case-text {
  display: grid;
  gap: var(--space-5);
}
.case-text .prose { font-size: var(--size-md); max-width: 64ch; }
.case-text em { color: var(--color-text); font-style: italic; }

@media (max-width: 900px) {
  .case-grid,
  .case-grid-flip { grid-template-columns: 1fr; }
  .case-grid-flip .case-fig { order: 0; }
  .case-grid-flip .case-text { order: 1; }
  .case-fig { position: relative; top: 0; max-width: 420px; }
}

/* =========================================================
   Ant simulation sandbox
   ========================================================= */

.sim-lede { margin-top: var(--space-5); }

.ant-sim-frame {
  position: relative;
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  padding: var(--space-3);
  border-radius: var(--radius-md);
}
.ant-sim {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  border-radius: var(--radius-sm);
  display: block;
}
.ant-sim canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  image-rendering: pixelated;
  cursor: crosshair;
}
.ant-sim-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.ant-sim-btn {
  font-family: var(--font-body);
  font-size: var(--size-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.45rem 0.9rem;
  min-height: 32px;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.ant-sim-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.ant-sim-btn:active { transform: translateY(1px); }
.ant-sim-hint {
  font-size: var(--size-2xs);
  font-style: italic;
  color: var(--color-text-muted);
  margin-left: auto;
  font-family: var(--font-display);
}
.ant-sim-caption {
  margin: var(--space-3) 0 0;
  font-size: var(--size-2xs);
  color: var(--color-text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 0.04em;
  font-family: var(--font-body);
}
.ant-sim-swatch {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  vertical-align: middle;
}
.ant-sim-swatch--a { background: var(--color-accent); }
.ant-sim-swatch--b { background: var(--color-data); }
@media (max-width: 600px) {
  .ant-sim-hint { margin-left: 0; width: 100%; }
}

/* =========================================================
   Reading list
   ========================================================= */

.readlist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--color-border-strong);
}
.readlist li {
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--color-border-strong);
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-6);
  align-items: baseline;
}
.readlist-meta {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--size-sm);
  color: var(--color-accent);
  letter-spacing: 0.02em;
}
.readlist h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 2.2vw, var(--size-xl));
  line-height: 1.1;
  margin: 0 0 var(--space-3);
  color: var(--color-text);
}
.readlist p {
  margin: 0;
  font-size: var(--size-sm);
  line-height: 1.5;
  color: var(--color-text-muted);
  max-width: 56ch;
}
@media (max-width: 700px) {
  .readlist li { grid-template-columns: 1fr; gap: var(--space-2); }
}

/* =========================================================
   Motion polish: hero trail draw, radial pulse, stagger
   ========================================================= */

.hero-trail {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  transition: stroke-dashoffset 1.6s ease-out;
}
.hero.is-visible .hero-trail { stroke-dashoffset: 0; }

.ant-march { transform-origin: 0 0; }

.radial-core {
  transform-origin: 160px 160px;
  animation: breathe 3.6s ease-in-out infinite;
  animation-play-state: paused;
}
.split.is-visible .radial-core { animation-play-state: running; }
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.06); opacity: 1; }
}

/* Power stagger uses --i index */
.power[data-reveal] {
  transition-delay: calc(var(--i, 0) * 60ms);
}

/* Number countup hidden visual jitter */
.num { font-variant-numeric: tabular-nums; }

/* =========================================================
   Hero — live simulation at the top of the page
   ========================================================= */

.hero-sim {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  background: var(--color-bg);
  margin-top: -1px;
}

.hero-sim-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--color-bg);
  display: block;
}
.hero-sim-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  image-rendering: pixelated;
  cursor: crosshair;
}

.hero-sim-overlay {
  position: absolute;
  top: clamp(5rem, 14vh, 9rem);
  left: clamp(1.25rem, 4vw, 3rem);
  right: clamp(1.25rem, 4vw, 3rem);
  z-index: 4;
  pointer-events: none;
  max-width: 64ch;
  display: grid;
  gap: var(--space-4);
}
.hero-sim-overlay .eyebrow {
  margin: 0;
  text-shadow: 0 1px 12px var(--color-bg);
}
.hero-sim-overlay .display {
  font-size: clamp(2.6rem, 7.5vw, var(--size-5xl));
  line-height: 0.96;
  margin: 0;
  text-shadow:
    0 2px 18px color-mix(in oklab, var(--color-bg) 70%, transparent),
    0 1px 0 color-mix(in oklab, var(--color-bg) 90%, transparent);
  letter-spacing: -0.025em;
}
.hero-sim-overlay .lede {
  margin: 0;
  max-width: 46ch;
  color: var(--color-text);
  text-shadow: 0 1px 12px var(--color-bg);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
}

.hero-sim-controls.ant-sim-controls {
  margin-top: var(--space-4);
  pointer-events: auto;
  background: color-mix(in oklab, var(--color-surface) 78%, transparent);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-strong);
  backdrop-filter: saturate(140%) blur(8px);
  width: max-content;
  max-width: 100%;
}

.hero-sim-scroll {
  position: absolute;
  bottom: clamp(1.5rem, 4vh, 3rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  font-size: var(--size-xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text);
  background: color-mix(in oklab, var(--color-surface) 70%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  transition: transform 0.2s ease, background 0.2s ease;
  animation: heroBob 2.6s ease-in-out infinite;
}
.hero-sim-scroll:hover {
  background: color-mix(in oklab, var(--color-surface) 95%, transparent);
  transform: translateX(-50%) translateY(-2px);
}
.hero-sim-scroll svg { color: var(--color-accent); }
@keyframes heroBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(6px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-sim-scroll { animation: none; }
}

@media (max-width: 720px) {
  .hero-sim-overlay { top: 5rem; }
  .hero-sim-overlay .display { font-size: clamp(2rem, 9vw, 3rem); }
  .hero-sim-controls.ant-sim-controls { padding: 0.4rem 0.6rem; }
}

/* Hide the old hero-stage if any HTML still references it. */
.hero-stage[hidden] { display: none; }
