:root {
  color-scheme: light;
  --ink: #0f1620;
  --ink-2: #26313d;
  --muted: #5a6b78;
  --quiet: #84929d;
  --paper: #ffffff;
  --card: #ffffff;
  --wash: #f4f7fa;
  --wash-2: #eaf0f5;
  --line: #dde5ec;
  --line-strong: #c4d0da;

  --blue: #1b64c4;
  --blue-soft: #eaf2fd;
  --green: #16916f;
  --green-soft: #e7f5ef;
  --purple: #7b4ad1;
  --purple-soft: #f1ebfc;
  --accent: var(--blue);
  --vep-path: #d84545;

  /* Brand ink — the navy of the CENO "N"; flips to light on dark surfaces. */
  --brand-ink: #0e1c2e;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px rgba(15, 22, 32, 0.12);
  --soft-shadow: 0 10px 30px rgba(15, 22, 32, 0.06);

  --maxw: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.lightbox-open {
  overflow: hidden;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(200px, auto) minmax(0, 1fr) minmax(220px, auto);
  gap: 24px;
  align-items: center;
  min-height: 72px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.brand,
.lab-link,
.topbar nav,
.resource-row {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: block;
  flex: none;
  width: auto;
  height: 27px;
}

/* Ink-colored letterforms (the "N") follow the active theme. */
.ceno-ink {
  fill: var(--brand-ink);
}

.brand small {
  padding-left: 12px;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.topbar nav {
  justify-content: center;
  gap: 2px;
  overflow-x: auto;
}

.topbar nav a {
  padding: 8px 13px;
  border-radius: 8px;
  color: #43515d;
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.topbar nav a:hover {
  color: var(--ink);
  background: var(--wash-2);
}

.lab-link {
  justify-content: flex-end;
}

.lab-link img {
  display: block;
  width: min(280px, 24vw);
  height: auto;
}

/* ---------- Layout ---------- */
main {
  width: 100%;
}

.hero,
.band > *,
.act > * {
  width: min(var(--maxw), calc(100% - 48px));
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
  padding: 64px 0 58px;
  width: min(var(--maxw), calc(100% - 48px));
  margin: 0 auto;
}

.hero-copy {
  min-width: 0;
  text-align: center;
}

h1 {
  max-width: 20ch;
  margin: 0 auto 22px;
  font-size: clamp(2.4rem, 4.6vw, 3.7rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.subtitle {
  max-width: 52ch;
  margin: 0 auto 22px;
  color: #33424e;
  font-size: 1.16rem;
  line-height: 1.6;
}

.subtitle strong {
  color: var(--ink);
}

.subtitle em {
  font-style: normal;
  font-weight: 700;
  color: var(--ink);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 26px;
}

.tag {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.tag-blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.tag-green {
  color: var(--green);
  background: var(--green-soft);
}

.tag-purple {
  color: var(--purple);
  background: var(--purple-soft);
}

.authors {
  display: grid;
  justify-items: center;
  gap: 3px;
  margin-bottom: 24px;
  color: var(--muted);
}

.authors strong {
  color: var(--ink);
  font-size: 1rem;
}

.resource-row {
  flex-wrap: wrap;
  gap: 10px;
}

.resource-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  background: #fff;
  transition: border-color 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.resource-row .brand-action:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.resource-row a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.resource-row .primary-action {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(120deg, var(--blue), var(--purple));
}

.resource-row .primary-action:hover {
  color: #fff;
  filter: brightness(1.06);
}

.resource-row.compact {
  margin-top: 18px;
}

.hero-copy .resource-row {
  justify-content: center;
}

/* ---------- Hero figure ---------- */
.hero-figure {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.figure-meta {
  display: grid;
  gap: 6px;
  padding: 16px 20px 18px;
  border-top: 1px solid var(--line);
}

.figure-meta span {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.figure-meta strong {
  color: var(--ink-2);
  line-height: 1.3;
}

/* ---------- Figure buttons (thumbnails) ---------- */
.figure-thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #fff;
  line-height: 0;
}

.figure-thumb img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.zoom-hint {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 7px 12px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  background: rgba(15, 22, 32, 0.82);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
}

.figure-thumb:hover .zoom-hint,
.figure-thumb:focus-visible .zoom-hint {
  opacity: 1;
  transform: translateY(0);
}

.hero-thumb img {
  padding: 20px;
}

/* ---------- Section bands ---------- */
.band {
  padding: 72px 0;
}

.band:nth-of-type(even) {
  background: var(--wash);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-heading {
  max-width: 760px;
  margin: 0 auto 40px;
  text-align: center;
}

.section-heading .kicker {
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 0 0 14px;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.16;
  letter-spacing: -0.01em;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.62;
}

/* ---------- Stages (the 3-act spine) ---------- */
.stages {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 14px;
  margin: 0 auto 36px;
  padding: 0;
  list-style: none;
}

.stage {
  position: relative;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 26px 24px 28px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--stage, var(--accent));
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.stage-blue {
  --stage: var(--blue);
}

.stage-green {
  --stage: var(--green);
}

.stage-purple {
  --stage: var(--purple);
}

.stage-index {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--stage);
}

.stage h3 {
  margin: 2px 0 0;
  font-size: 1.35rem;
}

.stage-sub {
  margin: 0 0 10px;
  color: var(--stage);
  font-size: 0.9rem;
  font-weight: 700;
}

.stage p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.58;
}

.stage-arrow {
  display: grid;
  place-items: center;
  color: var(--line-strong);
  font-size: 1.6rem;
  font-weight: 700;
}

/* ---------- Scale strip ---------- */
.scale-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(120deg, #10161f, #182634);
  box-shadow: var(--soft-shadow);
}

.scale-strip article {
  padding: 24px 26px;
}

.scale-strip article + article {
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.scale-strip strong {
  display: block;
  margin-bottom: 8px;
  font-size: 2rem;
  line-height: 1;
  background: linear-gradient(120deg, #7fb4ff, #c6a6ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.scale-strip span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ---------- Act sections (colored) ---------- */
.act {
  padding: 76px 0;
  border-top: 1px solid var(--line);
}

.act-blue {
  --accent: var(--blue);
  background: linear-gradient(180deg, var(--blue-soft), #fff 55%);
}

.act-green {
  --accent: var(--green);
  background: linear-gradient(180deg, var(--green-soft), #fff 55%);
}

.act-purple {
  --accent: var(--purple);
  background: linear-gradient(180deg, var(--purple-soft), #fff 55%);
}

.act-head {
  max-width: 760px;
  margin: 0 auto 34px;
  text-align: center;
}

.act-label {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--accent);
}

.act-head h2 {
  margin: 0 0 14px;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1.16;
  letter-spacing: -0.01em;
}

.act-head p {
  margin: 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.62;
}

.act-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
}

/* ---------- Figure block ---------- */
.figure-block {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.figure-block figcaption {
  padding: 14px 20px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ---------- Stat list ---------- */
.stat-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-content: start;
}

.stat-list article {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.stat-list strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 2.1rem;
  line-height: 1;
  letter-spacing: -0.01em;
}

.stat-list strong small {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-list span {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

/* ---------- Benchmark ---------- */
.benchmark-body {
  display: grid;
  grid-template-columns: minmax(240px, 0.34fr) minmax(0, 1.66fr);
  gap: 26px;
  align-items: start;
}

.rank-callout {
  display: grid;
  gap: 14px;
  align-content: start;
  align-self: start;
  position: sticky;
  top: 88px;
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.rank-big {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.rank-big strong {
  font-size: 3rem;
  line-height: 1;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--blue), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.rank-big.alt strong {
  background: none;
  -webkit-text-fill-color: initial;
  color: var(--muted);
}

.rank-big span {
  color: var(--ink-2);
  font-weight: 700;
  font-size: 0.98rem;
}

.rank-callout p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.figure-block.wide {
  grid-column: auto;
}

/* ---------- Paper ---------- */
.paper-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 22px;
  align-items: start;
}

.paper-card,
.citation-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.paper-card {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 22px;
  align-content: start;
  padding: 22px;
}

.paper-card img {
  display: block;
  width: 160px;
  aspect-ratio: 0.76;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  object-position: top center;
  background: var(--wash);
}

.paper-card small,
.citation-box small {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.paper-card strong {
  display: block;
  margin: 8px 0 10px;
  color: var(--ink-2);
  font-size: 1.14rem;
  line-height: 1.3;
}

.paper-card p {
  margin: 0 0 4px;
  color: var(--muted);
  line-height: 1.6;
}

.citation-box {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 22px;
}

.citation-box pre {
  overflow-x: auto;
  margin: 0;
  padding: 18px;
  border-radius: 10px;
  color: #d7e3f2;
  background: #101820;
}

.citation-box code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  line-height: 1.6;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  padding: 20px;
}

.lightbox.is-open {
  display: grid;
  place-items: center;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(7, 12, 16, 0.82);
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1540px, 96vw);
  height: min(940px, 94vh);
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

.lightbox-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.lightbox-toolbar strong {
  display: block;
  margin-bottom: 4px;
}

.lightbox-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.icon-button,
.nav-button {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 700;
  background: #fff;
}

.icon-button {
  min-height: 40px;
  padding: 0 16px;
}

.icon-button:hover,
.nav-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lightbox-stage {
  position: relative;
  min-height: 0;
  overflow: auto;
  padding: 18px 66px;
  background: #f6f8fa;
  text-align: center;
}

.lightbox-stage img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.nav-button {
  position: absolute;
  top: 50%;
  min-width: 54px;
  min-height: 44px;
  transform: translateY(-50%);
}

.nav-button.prev {
  left: 14px;
}

.nav-button.next {
  right: 14px;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(27, 100, 196, 0.35);
  outline-offset: 2px;
}

/* ---------- Footer ---------- */
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(var(--maxw), calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.92rem;
  border-top: 1px solid var(--line);
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand img {
  flex: none;
  width: 40px;
  height: 35px;
}

.footer-brand span {
  display: grid;
  gap: 2px;
}

.footer-brand strong {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.footer-brand small {
  color: var(--muted);
  font-size: 0.8rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .lab-link img {
    width: min(240px, 40vw);
  }

  .hero {
    gap: 34px;
    padding: 48px 0 40px;
  }

  .stages {
    grid-template-columns: 1fr;
  }

  .stage-arrow {
    transform: rotate(90deg);
    padding: 2px 0;
  }

  .act-body,
  .benchmark-body,
  .paper-layout {
    grid-template-columns: 1fr;
  }

  .rank-callout {
    position: static;
  }

  .stat-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 12px 16px;
  }

  .brand small {
    display: none;
  }

  .hero,
  .band > *,
  .act > *,
  footer {
    width: calc(100% - 32px);
  }

  .band,
  .act {
    padding: 52px 0;
  }

  .scale-strip {
    grid-template-columns: 1fr 1fr;
  }

  .scale-strip article {
    padding: 18px 20px;
  }

  .scale-strip article:nth-child(odd) {
    border-left: 0;
  }

  .stat-list {
    grid-template-columns: 1fr;
  }

  .paper-card {
    grid-template-columns: 1fr;
  }

  .citation-box pre {
    white-space: pre-wrap;
    word-break: break-word;
  }

  .paper-card img {
    width: 100%;
    max-height: 360px;
  }

  .lightbox {
    padding: 10px;
  }

  .lightbox-panel {
    width: 100%;
    height: 94vh;
  }

  .lightbox-stage {
    padding: 12px;
  }

  .nav-button {
    top: auto;
    bottom: 12px;
    transform: none;
    background: rgba(255, 255, 255, 0.94);
  }

  .nav-button.prev {
    left: 12px;
  }

  .nav-button.next {
    right: 12px;
  }

  footer {
    display: grid;
  }
}

@media (max-width: 440px) {
  h1 {
    font-size: 2.1rem;
  }

  .scale-strip {
    grid-template-columns: 1fr;
  }

  .scale-strip article {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .scale-strip article:first-child {
    border-top: 0;
  }
}

/* ============================================================
   Header controls: theme toggle + mobile menu
   ============================================================ */
.topbar-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink-2);
  background: var(--card);
  transition: border-color 0.15s, color 0.15s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 3px auto;
  border-radius: 2px;
  background: var(--ink-2);
  transition: transform 0.22s, opacity 0.22s;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* ============================================================
   Benchmark baselines
   ============================================================ */
.baselines {
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-strong);
}

.baselines small {
  display: block;
  margin-bottom: 10px;
  color: var(--quiet);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.baselines ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.baselines li {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--wash);
}

/* ============================================================
   Hero glow
   ============================================================ */
.hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -40px;
  right: -60px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(123, 74, 209, 0.18), rgba(27, 100, 196, 0.1) 45%, transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}

/* ============================================================
   Scroll reveal + active nav
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: none;
}

.topbar nav a.active {
  color: var(--accent);
  background: var(--wash-2);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================================
   Dark theme
   ============================================================ */
[data-theme="dark"] {
  --ink: #eaf1f8;
  --ink-2: #c6d2dd;
  --muted: #94a4b2;
  --quiet: #7f8e9c;
  --paper: #0d131a;
  --card: #141d27;
  --wash: #121a23;
  --wash-2: #1a242f;
  --line: #26313d;
  --line-strong: #384654;

  --blue: #5c9bf1;
  --blue-soft: rgba(92, 155, 241, 0.16);
  --green: #37c39a;
  --green-soft: rgba(55, 195, 154, 0.16);
  --purple: #a98bf3;
  --purple-soft: rgba(169, 139, 243, 0.18);
  --vep-path: #f0736f;

  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  --soft-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);

  /* The navy "N" would vanish on a dark surface — carry it in light ink instead. */
  --brand-ink: #eaf1f8;
}

[data-theme="dark"] .topbar {
  background: rgba(13, 19, 26, 0.82);
  border-bottom-color: var(--line);
}

[data-theme="dark"] .brand small {
  color: var(--muted);
}

[data-theme="dark"] .topbar nav a {
  color: #aebdc9;
}

[data-theme="dark"] .subtitle {
  color: var(--ink-2);
}

[data-theme="dark"] .resource-row a:not(.primary-action),
[data-theme="dark"] .hero-figure,
[data-theme="dark"] .stage,
[data-theme="dark"] .figure-block,
[data-theme="dark"] .stat-list article,
[data-theme="dark"] .rank-callout,
[data-theme="dark"] .paper-card,
[data-theme="dark"] .citation-box,
[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .menu-toggle,
[data-theme="dark"] .icon-button,
[data-theme="dark"] .nav-button,
[data-theme="dark"] .lightbox-panel {
  background: var(--card);
}

[data-theme="dark"] .act-blue {
  background: linear-gradient(180deg, rgba(92, 155, 241, 0.1), var(--paper) 55%);
}

[data-theme="dark"] .act-green {
  background: linear-gradient(180deg, rgba(55, 195, 154, 0.1), var(--paper) 55%);
}

[data-theme="dark"] .act-purple {
  background: linear-gradient(180deg, rgba(169, 139, 243, 0.1), var(--paper) 55%);
}

/* keep scientific figures on white so the PNGs read correctly */
[data-theme="dark"] .figure-thumb,
[data-theme="dark"] .hero-thumb img,
[data-theme="dark"] .paper-card img {
  background: #fff;
}

/* Present figures as an intentional light "plate" in dark mode. The PNGs are
   colored scientific diagrams, so inverting would corrupt the data colors;
   instead give them a white matte, rounded inner corners, and a firmer frame. */
[data-theme="dark"] .figure-thumb:not(.hero-thumb) {
  padding: 16px;
}

[data-theme="dark"] .figure-thumb img {
  border-radius: 6px;
}

[data-theme="dark"] .figure-block,
[data-theme="dark"] .hero-figure {
  border-color: var(--line-strong);
}

[data-theme="dark"] .lab-link img {
  filter: brightness(0) invert(1) opacity(0.85);
}

/* ============================================================
   Refinements: numerals, generation band, benchmark highlights,
   stats-strip framing, monospace
   ============================================================ */

/* Tabular, lining figures so stacked numbers align cleanly */
.stat-list strong,
.scale-strip strong,
.rank-big strong,
.capability-grid strong,
.stat-list strong small {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/* Eyebrow that frames the dark stats strip as an intentional band */
.strip-eyebrow {
  margin: 0 auto 14px;
  color: var(--quiet);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-align: center;
}

/* Tie the dark strip to the brand palette with a thin top accent */
.scale-strip {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.scale-strip::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(120deg, var(--blue), var(--purple));
}

/* In dark mode the strip must separate from the near-black page */
[data-theme="dark"] .scale-strip {
  background: linear-gradient(120deg, #172230, #1f2e3f);
  border-color: var(--line-strong);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}

/* ---------- Generation capability grid ---------- */
.capability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.capability-grid article {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--purple);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--soft-shadow);
}

.capability-grid strong {
  color: var(--ink);
  font-size: 1.42rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.capability-grid span {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* ---------- Benchmark task highlights ---------- */
.task-highlights {
  display: grid;
  gap: 10px;
  margin: 4px 0 2px;
  padding: 0;
  list-style: none;
}

.task-highlights li {
  padding-left: 18px;
  position: relative;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.task-highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: linear-gradient(120deg, var(--blue), var(--purple));
}

.task-highlights strong {
  color: var(--ink-2);
  font-weight: 700;
}

/* Monospace for the citation block */
.citation-box code {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

@media (max-width: 1080px) {
  .capability-grid {
    grid-template-columns: 1fr;
  }
}

/* Stats strip: drop to two columns before the numbers crowd (tablet range).
   Scoped to >440px so the <=440px single-column rule below still wins on phones. */
@media (min-width: 441px) and (max-width: 900px) {
  .scale-strip {
    grid-template-columns: 1fr 1fr;
  }

  .scale-strip article:nth-child(odd) {
    border-left: 0;
  }

  .scale-strip article:nth-child(n + 3) {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
}

@media (max-width: 860px) {
  .topbar {
    position: sticky;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .topbar nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 14px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--card);
    box-shadow: var(--shadow);
  }

  .topbar nav.open {
    display: flex;
  }

  .topbar nav a {
    padding: 12px 12px;
    font-size: 1rem;
  }

  .menu-toggle {
    display: block;
  }

  .lab-link {
    display: none;
  }
}

/* ============================================================
   Dynamic illustrations
   (1) hero DNA read/score/write ribbon
   (2) animated metric count-ups (JS-driven, no extra CSS)
   (3) long-context scale bar
   (4) stage-flow pulse
   ============================================================ */

/* ---------- (1) Hero DNA ribbon ---------- */
.dna-ribbon {
  max-width: 560px;
  margin: 0 auto 24px;
}

.dna-track {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  height: 60px;
  padding: 0 14px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--wash);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 1rem;
  line-height: 1;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}

.dna-base {
  position: relative;
  flex: 0 0 auto;
  width: 1ch;
  text-align: center;
  color: var(--quiet);
  animation: dnaBaseIn 0.32s ease both;
  transition: color 0.3s ease;
}

.dna-base.is-write {
  color: var(--purple);
  font-weight: 600;
}

.dna-base.is-score {
  font-weight: 700;
}

.dna-base.is-score.is-benign {
  color: var(--green);
}

.dna-base.is-score.is-path {
  color: var(--vep-path);
}

.dna-score-bubble {
  position: absolute;
  left: 50%;
  bottom: 100%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 7px;
  padding: 2px 7px;
  border-radius: 6px;
  color: #fff;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  transform: translateX(-50%);
  animation: dnaBubbleIn 0.3s ease both;
}

.dna-score-bubble.is-benign {
  background: var(--green);
}

.dna-score-bubble.is-path {
  background: var(--vep-path);
}

.dna-score-bubble .vep-sub {
  letter-spacing: 0.02em;
}

.dna-score-bubble .vep-delta {
  font-variant-numeric: tabular-nums;
  opacity: 0.95;
}

.dna-score-bubble .vep-tag {
  padding: 0 4px;
  border-radius: 4px;
  font-family: Inter, sans-serif;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.22);
}

.dna-score-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  border: 4px solid transparent;
  transform: translateX(-50%);
}

.dna-score-bubble.is-benign::after {
  border-top-color: var(--green);
}

.dna-score-bubble.is-path::after {
  border-top-color: var(--vep-path);
}

@keyframes dnaBaseIn {
  from {
    opacity: 0;
    transform: translateX(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes dnaBubbleIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.dna-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  row-gap: 4px;
  margin-top: 10px;
  color: var(--quiet);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dna-dot {
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border-radius: 50%;
}

.dna-legend .dna-dot:first-child {
  margin-left: 0;
}

.dna-dot.read {
  background: var(--quiet);
}
.dna-dot.benign {
  background: var(--green);
}
.dna-dot.path {
  background: var(--vep-path);
}
.dna-dot.write {
  background: var(--purple);
}

/* ---------- (3) Long-context scale bar ---------- */
.context-scale {
  max-width: 720px;
  margin: 0 auto 40px;
}

.context-scale-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.context-scale-head span {
  color: var(--quiet);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.context-scale-head strong {
  color: var(--ink-2);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.context-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--wash-2);
}

.context-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  transition: width 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.context-scale.in-view .context-fill {
  width: 100%;
}

.context-stop {
  position: absolute;
  top: 50%;
  display: grid;
  justify-items: center;
  gap: 0;
  transform: translate(-50%, -50%);
  color: var(--muted);
}

.context-stop i {
  width: 10px;
  height: 10px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--paper);
}

.context-stop small {
  position: absolute;
  top: 14px;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.context-stop:first-of-type small {
  left: 0;
  transform: none;
}

.context-stop:last-of-type small {
  right: 0;
  left: auto;
}

.context-head {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 0 0 rgba(123, 74, 209, 0.5);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: left 1.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

.context-scale.in-view .context-head {
  left: 100%;
  opacity: 1;
  animation: contextPulse 2.4s ease-in-out 1.6s infinite;
}

@keyframes contextPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(123, 74, 209, 0.45);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(123, 74, 209, 0);
  }
}

/* ---------- (4) Stage-flow pulse ---------- */
.stage-arrow {
  color: var(--line-strong);
  animation: stageFlow 2.8s ease-in-out infinite;
}

.stages .stage-arrow:last-of-type {
  animation-delay: 1.4s;
}

@keyframes stageFlow {
  0%,
  100% {
    color: var(--line-strong);
    transform: translateX(0);
  }
  50% {
    color: var(--purple);
    transform: translateX(4px);
  }
}

[data-theme="dark"] .context-stop i {
  background: var(--card);
}

@media (prefers-reduced-motion: reduce) {
  .context-fill,
  .context-head {
    transition: none;
  }
  .context-scale .context-fill {
    width: 100%;
  }
  .context-scale .context-head {
    left: 100%;
    opacity: 1;
    animation: none;
  }
  .stage-arrow {
    animation: none;
    color: var(--line-strong);
  }
}

@media (max-width: 1080px) {
  /* arrows are rotated 90deg in the vertical stack: nudge downward */
  @keyframes stageFlow {
    0%,
    100% {
      color: var(--line-strong);
      transform: rotate(90deg) translateX(0);
    }
    50% {
      color: var(--purple);
      transform: rotate(90deg) translateX(4px);
    }
  }
}

/* ---------- (5) Benchmark rank bars ---------- */
.rank-bars {
  display: grid;
  gap: 9px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}

.rank-bar {
  display: grid;
  gap: 4px;
}

.rank-bar-label {
  color: var(--ink-2);
  font-size: 0.82rem;
  font-weight: 600;
}

.rank-bar-label b {
  margin-right: 4px;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
}

.rank-bar.ceno .rank-bar-label b {
  color: var(--purple);
}

.rank-bar-track {
  height: 7px;
  border-radius: 999px;
  background: var(--wash-2);
  overflow: hidden;
}

.rank-bar-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--line-strong);
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.rank-bar.ceno .rank-bar-track i {
  background: linear-gradient(90deg, var(--blue), var(--purple));
}

.rank-bars.in-view .rank-bar-track i {
  width: var(--w);
}

/* ---------- (6) Enhancer design: prompt -> generate ---------- */
.design-gen {
  max-width: 720px;
  margin: 0 auto 26px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--purple);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--soft-shadow);
  text-align: left;
}

.gen-prompt {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 11px;
}

.gen-label {
  color: var(--quiet);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gen-token {
  padding: 2px 9px;
  border-radius: 6px;
  color: #fff;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--purple);
}

.gen-arrow {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.gen-count {
  margin-left: auto;
  color: var(--purple);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.gen-count.done {
  color: var(--green);
}

.gen-seq {
  display: block;
  height: 84px;
  overflow: hidden;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--muted);
  word-break: break-all;
}

.gen-seq .motif {
  padding: 1px 2px;
  border-radius: 3px;
  color: #fff;
  font-weight: 600;
  background: var(--purple);
}

.typer-cursor {
  display: inline-block;
  width: 0.55ch;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: -0.15em;
  background: var(--purple);
  animation: typerBlink 1s steps(1) infinite;
}

@keyframes typerBlink {
  50% {
    opacity: 0;
  }
}

/* ---------- (7) Copy-to-clipboard citation ---------- */
.citation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.copy-cite {
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--card);
  transition: border-color 0.15s, color 0.15s;
}

.copy-cite:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-cite.copied {
  border-color: var(--green);
  color: var(--green);
}

/* ---------- (8) Drifting hero glow ---------- */
.hero::before {
  animation: glowDriftA 17s ease-in-out infinite;
}

.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  bottom: -80px;
  left: -60px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(27, 100, 196, 0.16), transparent 70%);
  filter: blur(12px);
  pointer-events: none;
  animation: glowDriftB 21s ease-in-out infinite;
}

@keyframes glowDriftA {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-34px, 22px) scale(1.08);
  }
}

@keyframes glowDriftB {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(30px, -20px) scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rank-bar-track i {
    transition: none;
  }
  .rank-bars .rank-bar-track i {
    width: var(--w);
  }
  .typer-cursor {
    animation: none;
  }
  .hero::before,
  .hero::after {
    animation: none;
  }
}



/* ---------- Demo video section ---------- */
.video-frame {
  margin: 0 auto;
  max-width: 960px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.video-frame video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-frame figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.94rem;
}

.video-download {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.video-download:hover {
  text-decoration: underline;
}
