@font-face {
  font-family: Jost;
  src: url("assets/jost-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ground: #18191b;
  --surface: #292b2e;
  --ink: #eff0f1;
  --muted: #b9bbbf;
  --accent: #ff5630;
  --field: #eff0f1;
  --field-ink: #18191b;
  --field-muted: #51545a;
  --field-deep: #dadddf;
  --canvas: #ffffff;
  --gutter: clamp(1.25rem, 4.4vw, 4rem);
  --heading: clamp(2.15rem, 1.1rem + 3.1vw, 4.4rem);
  --lead: clamp(1.25rem, 1.05rem + 0.85vw, 1.8rem);
  --body: clamp(1.0625rem, 1rem + 0.23vw, 1.1875rem);
  --small: 0.9375rem;
  --cut: 13px;
  --frame: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 var(--body)/1.55 Jost, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.035em; line-height: 1; text-wrap: balance; }
h2 { font-size: var(--heading); }
h3 { font-size: var(--lead); line-height: 1.12; }
p { text-wrap: pretty; }
a { color: inherit; }
img { display: block; width: 100%; height: auto; }
button { font: inherit; }
small { display: block; font-size: var(--small); font-weight: 400; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 5px;
}
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 2;
  transform: translateY(-160%);
  padding: 0.5rem 0.8rem;
  background: var(--canvas);
  color: var(--field-ink);
}
.skip-link:focus { transform: none; }
.wrap {
  width: min(calc(100% - 2 * var(--gutter)), 78rem);
  margin-inline: auto;
}
.header-inner {
  min-height: 5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  font-size: var(--lead);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  text-decoration: none;
}
.wordmark img { width: 1.06em; flex: none; }
nav { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2.25rem); }
nav a, .footer-inner a { text-decoration: none; }
nav a:hover, .footer-inner a:hover, .text-link:hover { text-decoration: underline; text-underline-offset: 0.22em; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.83fr) minmax(0, 1.17fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5.5rem);
  padding-block: clamp(3rem, 7.5vw, 7rem) clamp(4rem, 8.5vw, 9.25rem);
}
.hero h1 {
  display: flex;
  align-items: center;
  gap: clamp(0.6rem, 3.1cqi, 1.2rem);
  font-size: clamp(2.6rem, 21cqi, 6.85rem);
  letter-spacing: -0.052em;
  line-height: 0.92;
}
.hero-mark { width: clamp(2.5rem, 17.8cqi, 5.65rem); flex: none; }
.paper-title {
  margin-top: 1.65rem;
  font-size: var(--lead);
  font-weight: 500;
  line-height: 1.17;
  max-width: 26ch;
}
.hero-summary {
  max-width: 37ch;
  margin-top: 1.4rem;
}
.hero-copy { container-type: inline-size; }
.hero-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.94fr) minmax(0, 1.42fr);
  gap: clamp(0.38rem, 0.9vw, 0.7rem);
  max-width: 30rem;
  margin-top: 1.9rem;
}
.hero-resource {
  background: var(--surface);
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.58rem;
  min-height: 3.8rem;
  padding: 0.6rem 0.5rem;
  text-decoration: none;
  line-height: 1.1;
}
.hero-resource strong { display: block; font-size: 1rem; }
.hero-resource small { margin-top: 0.24rem; font-size: 0.8125rem; }
.hero-resource:not(.code-resource) small, .paper-resource .resource-icon { color: var(--muted); }
.resource-icon { display: block; width: 1.55rem; height: 1.55rem; object-fit: contain; flex: none; }
.code-resource { background: var(--accent); color: var(--field-ink); }
a.hero-resource:hover { background: var(--ink); color: var(--field-ink); }
a.hero-resource:hover small { color: var(--field-ink); }
@container (max-width: 25rem) {
  .hero-resource { flex-direction: column; justify-content: flex-start; gap: 0.4rem; text-align: center; }
  .hero-resource strong { font-size: 0.9375rem; }
}
.button {
  background: var(--accent);
  color: var(--field-ink);
  clip-path: var(--frame);
  display: inline-block;
  padding: 0.72rem 1.4rem;
  font-weight: 700;
  text-decoration: none;
}
.button:hover { background: var(--ink); }
.button:focus-visible { outline-offset: -6px; }
.text-link { font-weight: 500; text-underline-offset: 0.23em; }
.hero-figure { align-self: center; }
.hero-media {
  --cut: 28px;
  clip-path: var(--frame);
  overflow: hidden;
  background: var(--accent);
  padding: 0 0 0 8px;
}
.hero-media-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--ground);
  overflow: hidden;
}
.hero-media img {
  width: 100%;
  aspect-ratio: 1.04;
  object-fit: cover;
  object-position: 50% 57%;
}
.timestamps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 0.35rem 0 0.5rem;
  color: var(--field-ink);
  font-size: var(--small);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.timestamps span { padding-left: 0.8rem; }
.hero-caption {
  display: grid;
  gap: 0.15rem;
  padding-top: 1rem;
}
.hero-caption strong { font-weight: 500; font-size: var(--lead); }

.section { padding-block: clamp(4rem, 8vw, 7.5rem); }
.light {
  color-scheme: light;
  color: var(--field-ink);
  background: var(--field);
}
.section-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: clamp(1.1rem, 4vw, 4rem);
  margin-bottom: clamp(1.8rem, 4vw, 3.6rem);
}
.section-intro p { max-width: 55ch; }

.intro-figure {
  background: var(--canvas);
  padding: clamp(0.6rem, 1.6vw, 1.4rem);
}
.intro-figure figcaption {
  color: var(--field-muted);
  padding-top: 0.85rem;
  font-size: var(--small);
}
.evolution-cycle {
  background: var(--surface);
  padding: clamp(1rem, 3vw, 2.5rem);
  clip-path: var(--frame);
}
.cycle-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: clamp(1.2rem, 3.6vw, 3rem);
}
.cycle-tabs button {
  color: var(--ink);
  background: var(--ground);
  border: 0;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  font-weight: 500;
}
.cycle-tabs button[aria-selected="true"] {
  background: var(--accent);
  color: var(--field-ink);
  font-weight: 700;
}
.cycle-tabs button:hover:not([aria-selected="true"]) { color: var(--accent); }
.cycle-tabs button:focus-visible { outline-offset: -5px; }
.cycle-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: center;
  gap: clamp(1rem, 4vw, 3rem);
}
.cycle-panel + .cycle-panel { margin-top: 2rem; }
.evolution-cycle.enhanced .cycle-panel { margin-top: 0; }
.cycle-panel h3 { margin-bottom: 0.6rem; }
.cycle-panel p { max-width: 48ch; }
.stage-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}
.stage-flow > div { background: var(--ground); padding: 0.85rem 0.65rem; }
.stage-flow dt { color: var(--muted); font-size: var(--small); }
.stage-flow dd {
  font-size: var(--heading);
  font-weight: 500;
  line-height: 1.1;
}
.stage-flow var { white-space: nowrap; }
.stage-flow :is(sub, sup) { font-size: 0.48em; }
.evolution-visual {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.05rem, 4vw, 3.2rem);
  margin-top: clamp(1.5rem, 5vw, 3.8rem);
}
.evolution-visual img { background: var(--canvas); }
.evolution-visual h3 { margin-bottom: 0.6rem; }
.evolution-visual p { max-width: 36ch; }
.animation-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.1rem;
  margin-top: 1.15rem;
}
.animation-actions button { border: 0; cursor: pointer; }

.method-accordion {
  display: flex;
  align-items: stretch;
  gap: 0.3rem;
}
.method-accordion details {
  display: block;
  min-width: 0;
  flex: 0 0 3.5rem;
  background: var(--field-deep);
}
.method-accordion details[open] { flex: 1 1 auto; background: var(--canvas); }
.method-accordion details:not([open]) { position: relative; }
.method-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.95rem 1.25rem;
  font-size: var(--lead);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.method-accordion summary::-webkit-details-marker { display: none; }
.method-accordion summary::after { content: "+"; }
.method-accordion details[open] summary::after { content: "−"; }
.method-accordion summary:hover { background: var(--field-deep); }
.method-accordion summary:focus-visible { outline-offset: -4px; }
.method-accordion details:not([open]) summary {
  position: absolute;
  inset: 0;
  writing-mode: vertical-rl;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 0.9rem 0;
}
.method-accordion details:not([open]) summary:hover { background: var(--accent); }
.method-accordion details:not([open]) > .method-panel { display: none; }
.method-panel { padding: 0 1.25rem 1.25rem; }
.method-panel > p { max-width: 65ch; }
.method-figure { margin-top: 0.85rem; }
.method-figure a, .case-picture a { display: block; }
.refinement-copy { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }

.benchmark-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0 0.3rem;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.benchmark-table thead th { font-weight: 500; color: var(--muted); }
.benchmark-table thead th:first-child { width: 51%; }
.benchmark-table :is(th, td) { padding: 0.85rem 1.05rem; overflow-wrap: anywhere; }
.benchmark-table tbody tr { background: var(--surface); }
.benchmark-table tbody th { font-weight: 500; }
.benchmark-table tbody td { font-size: var(--lead); font-weight: 500; }
.benchmark-table small { color: var(--muted); }
.benchmark-table .score { color: var(--accent); font-weight: 700; }
.research-figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.8rem, 3vw, 2.3rem);
  margin-top: clamp(1.4rem, 4vw, 3rem);
}
.result-figure a { display: block; background: var(--canvas); }
.result-figure figcaption { color: var(--muted); padding-top: 0.75rem; }
.result-figure figcaption strong { display: block; color: var(--ink); font-size: var(--lead); }
.scaling-figure { margin-top: clamp(1.5rem, 5vw, 4rem); }
.scaling-figure a { padding: 0.6rem; }
.efficiency {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  margin-top: clamp(2rem, 5.5vw, 4.5rem);
}
.efficiency h3 { margin-bottom: 0.55rem; }
.efficiency p { max-width: 49ch; }
.timings { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.timings dt { font-weight: 500; }
.timings dd { color: var(--ink); font-size: var(--lead); font-weight: 700; font-variant-numeric: tabular-nums; }
.timings small, .timetable p { color: var(--muted); }
.timetable p { margin-top: 1rem; font-size: var(--small); }

.case-controls { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.15rem; }
.case-controls button {
  background: var(--field-deep);
  color: var(--field-ink);
  border: 0;
  clip-path: var(--frame);
  font-weight: 500;
  padding: 0.6rem 1rem;
  cursor: pointer;
}
.case-controls button[aria-selected="true"] { background: var(--ground); color: var(--ink); }
.case-controls button:hover:not([aria-selected="true"]) { background: var(--accent); }
.case-controls button:focus-visible { outline-offset: -5px; }
.case {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  align-items: center;
  gap: clamp(1.2rem, 4vw, 3.5rem);
}
.case + .case { margin-top: 2.5rem; }
.cases.enhanced .case { margin-top: 0; }
.case-picture {
  clip-path: var(--frame);
  background: var(--canvas);
  padding: 0.75rem;
}
.case-picture a { display: grid; place-items: center; aspect-ratio: 1 / 1; }
.case-picture img { height: 100%; max-height: 34rem; object-fit: contain; }
.case-copy h3 { margin-bottom: 0.8rem; }
.case-copy > p { max-width: 42ch; }
.events { display: grid; gap: 0.6rem; margin-top: 1.1rem; max-width: 28rem; }
.events > div { background: var(--field-deep); padding: 0.6rem 0.8rem; }
.events dt { font-weight: 500; }
.events dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.9rem; font-weight: 700; }
.events small { color: var(--field-muted); }
.case-answer { margin-top: 1rem; font-size: var(--lead); font-weight: 700; }

.site-footer { padding-block: clamp(2.5rem, 5vw, 5rem) 1.3rem; }
.code-band {
  --cut: 24px;
  display: grid;
  gap: 0.55rem;
  clip-path: var(--frame);
  background: var(--accent);
  color: var(--field-ink);
  text-decoration: none;
  padding: clamp(1.1rem, 3.7vw, 3rem);
}
.code-band strong { font-size: var(--heading); line-height: 0.98; letter-spacing: -0.045em; }
.code-band:hover, .code-band:focus-visible { background: var(--ink); }
.code-band:focus-visible { outline-offset: -7px; }
.resource-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.8rem;
}
.resource-links a {
  color: var(--ink);
  text-decoration: none;
  background: var(--surface);
  padding: 0.9rem 1.15rem;
  overflow-wrap: anywhere;
}
.resource-links a:hover strong { text-decoration: underline; }
.resource-links span { display: block; color: var(--muted); font-size: var(--small); }
.resource-links strong { font-size: var(--lead); }
.footer-inner {
  margin-top: 1.7rem;
  padding-block: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.45rem;
}
.footer-inner p, .footer-inner > a:last-child { color: var(--muted); font-size: var(--small); }

@media (max-width: 760px) {
  .header-inner { min-height: 4.2rem; }
  .header-inner nav { gap: clamp(0.55rem, 2.2vw, 1rem); font-size: var(--small); }
  .header-inner nav :is(a:last-child, .overview-link) { display: none; }
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 1.8rem; }
  .paper-title { max-width: 25ch; margin-top: 1rem; }
  .hero-summary { max-width: 39ch; margin-top: 0.85rem; }
  .hero-actions { margin-top: 1.25rem; }
  .hero-media { --cut: 20px; }
  .hero-caption { padding-top: 0.7rem; }
  .section-intro, .efficiency, .case, .cycle-panel, .evolution-visual, .research-figures, .resource-links { grid-template-columns: 1fr; }
  .cycle-tabs button { font-size: var(--small); padding: 0.6rem 0.35rem; }
  .stage-flow dd { font-size: var(--lead); }
  .method-accordion { flex-direction: column; }
  .method-accordion details { flex-basis: auto; }
  .method-accordion details:not([open]) summary {
    position: static;
    writing-mode: horizontal-tb;
    justify-content: space-between;
    padding: 0.85rem 1rem;
  }
  .method-accordion summary { padding: 0.85rem 1rem; }
  .method-panel { padding: 0 0.8rem 0.85rem; }
  .refinement-copy { grid-template-columns: 1fr; gap: 0.65rem; }
  .benchmark-table thead th:first-child { width: 44%; }
  .benchmark-table :is(th, td) { padding: 0.65rem 0.5rem; }
  .benchmark-table thead, .benchmark-table small { font-size: var(--small); }
  .efficiency, .case { align-items: start; }
  .case-picture a { aspect-ratio: auto; }
  .case-picture img { height: auto; max-height: 32rem; }
  .case-copy { padding-bottom: 0.35rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-media-inner { animation: open-frame 0.85s both; }
  .hero-media img { animation: settle-frame 1.15s both; }
  .in-view { animation: reveal 0.58s both; }
  .hero .paper-title.in-view, .section-intro p.in-view { animation-delay: 70ms; }
  .hero .hero-summary.in-view { animation-delay: 140ms; }
  .hero .hero-actions.in-view { animation-delay: 210ms; }
  :is(.case, .cycle-panel).is-current { animation: swap-frame 0.26s both; }
  .button, .case-controls button, .code-band, .hero-resource { transition: background-color 0.18s ease, color 0.18s ease; }
}

@keyframes open-frame {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0); }
}
@keyframes settle-frame {
  from { transform: scale(1.1); }
  to { transform: scale(1); }
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes swap-frame {
  from { opacity: 0.45; }
  to { opacity: 1; }
}
