:root {
  --ink: #111111;
  --muted: #595959;
  --line: #dddddd;
  --paper: #ffffff;
  --canvas: #fafafa;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); line-height: 1.6; }
img { display: block; max-width: 100%; }
a { color: inherit; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .75rem 1rem; background: var(--ink); color: white; }
.skip-link:focus { top: 1rem; }

.nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; width: 100%; padding: .85rem max(5vw, 1.25rem); background: var(--paper); border-bottom: 1px solid var(--line); }
.wordmark { color: var(--ink); font-weight: 700; letter-spacing: .08em; text-decoration: none; }
.nav-links { display: flex; gap: 1.4rem; }
.nav-links a { color: var(--muted); font-size: .92rem; font-weight: 600; text-decoration: none; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--ink); }

.hero { overflow: hidden; padding: clamp(4rem, 8vw, 7rem) max(5vw, 1.25rem) clamp(3rem, 6vw, 5rem); background: var(--paper); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; max-width: 1420px; margin: auto; }
.eyebrow, .section-kicker { margin: 0 0 .75rem; color: var(--ink); font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: var(--serif); line-height: 1.08; letter-spacing: -.025em; }
h1 { max-width: 820px; font-size: clamp(2.6rem, 4.4vw, 4.2rem); }
h1 span { color: var(--ink); }
h2 { font-size: clamp(2rem, 3.2vw, 3rem); }
h3 { margin: 0; line-height: 1.2; }
.authors { max-width: 820px; margin: 1.65rem 0 .25rem; font-size: clamp(1rem, 1.6vw, 1.22rem); font-weight: 600; }
.affiliations { margin: 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2rem; }
.button { display: inline-flex; min-width: 7.5rem; align-items: center; justify-content: center; gap: .45rem; padding: .78rem 1.1rem; border: 1px solid var(--line); border-radius: 2px; background: white; color: var(--ink); font-weight: 700; text-decoration: none; transition: background-color .15s ease, border-color .15s ease; }
.button:hover { background: var(--canvas); border-color: var(--ink); }
.button.primary:hover { background: #333333; }
.button.primary { border-color: var(--ink); background: var(--ink); color: white; }
.button.placeholder { color: var(--muted); border-style: dashed; cursor: default; }
.button.placeholder:hover { background: var(--paper); border-color: var(--line); }
.button small { padding: .08rem .32rem; border-radius: 2px; background: var(--canvas); font-size: .64rem; text-transform: uppercase; }
.hero-figure { margin: 0; }

.section { max-width: 1420px; margin: auto; padding: clamp(4rem, 8vw, 7.5rem) max(5vw, 1.25rem); }
.intro { display: grid; grid-template-columns: .8fr 1.2fr; column-gap: 8vw; row-gap: 2rem; align-items: start; }
.intro-copy { max-width: 760px; font-size: clamp(1.2rem, 2.1vw, 1.65rem); line-height: 1.55; }
.intro-copy p { margin: 0 0 1rem; }
.intro-copy p:last-child { margin-bottom: 0; }
.motivation-video { grid-column: 1 / -1; width: 100%; }
.motivation-video video { display: block; width: 100%; height: auto; }
.section-heading { max-width: 900px; margin-bottom: 2.6rem; }
.section-heading > p:last-child { max-width: 760px; margin: 1.2rem 0 0; color: var(--muted); font-size: 1.15rem; }
.section-heading.compact { margin-bottom: 2rem; }

.method { max-width: none; background: var(--canvas); }
.method > * { max-width: 1320px; margin-left: auto; margin-right: auto; }
.method .section-heading > p:last-child, .method .lead { max-width: none; }
.wide-figure { overflow: hidden; margin-top: 0; margin-bottom: 2.2rem; padding: 1rem; background: white; border: 1px solid var(--line); }
.wide-figure img { width: 100%; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.steps article { padding: 1.5rem; background: white; }
.steps span { display: block; margin-bottom: 1.1rem; color: var(--ink); font-weight: 700; }
.steps h3 { margin-bottom: .55rem; font-size: 1.2rem; }
.steps p { margin: 0; color: var(--muted); }
.method-note { margin-top: 1.4rem; padding: 1rem 1.2rem; border-left: 2px solid var(--ink); background: var(--canvas); }

.evaluation .section-heading, .evaluation .lead { max-width: none; }
.phase-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.phase-card { padding: clamp(1.5rem, 3vw, 2.5rem); border: 1px solid var(--line); }
.phase-card h3 { font-family: var(--serif); font-size: 2rem; }
.phase-card > p:not(.phase-label) { color: var(--muted); font-size: 1.05rem; }
.phase-label { margin: 0 0 .4rem; color: var(--ink); font-size: .78rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.static-card, .online-card { background: var(--paper); }
.phase-flow { display: flex; align-items: center; gap: .7rem; margin-top: 1.5rem; color: var(--ink); font-size: .88rem; font-weight: 700; }
.phase-flow span { flex: 1; padding: .7rem; border: 1px solid var(--line); background: var(--paper); text-align: center; }
.phase-flow b { color: var(--ink); }
.phase-flow-loop { position: relative; margin-bottom: 1.5rem; }
.phase-flow-loop::after { content: ""; position: absolute; left: 15%; right: 15%; top: 100%; height: 1.25rem; border: 1px solid var(--ink); border-top: 0; pointer-events: none; }
.phase-flow-loop::before { content: ""; position: absolute; left: 15%; top: 100%; width: .45rem; height: .45rem; border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); transform: translateX(-50%) rotate(45deg); pointer-events: none; }

.benchmark { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 3vw, 3rem); align-items: start; max-width: 1420px; background: var(--paper); color: var(--ink); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.benchmark-copy { align-self: start; }
.benchmark-explanation { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin: 0; border: 1px solid var(--line); background: var(--line); }
.benchmark-explanation .lead { max-width: none; margin: 0; padding: 1.5rem; background: var(--paper); color: var(--muted); font-size: 1rem; }
.benchmark-explanation strong { display: block; margin-bottom: .55rem; color: var(--ink); font-size: 1.2rem; line-height: 1.2; }
.benchmark .section-kicker { color: var(--muted); }
.lead { max-width: 620px; font-size: 1.25rem; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem; margin: 2rem 0 0; }
.stats div { padding: 1rem; border-top: 1px solid var(--line); background: var(--paper); }
.stats dt { font-family: var(--serif); font-size: 1.75rem; font-weight: 700; }
.stats dd { margin: .1rem 0 0; color: var(--muted); font-size: .88rem; }
.benchmark figure { min-width: 0; margin: 0; }
.benchmark figure img { width: 100%; height: auto; }
.benchmark-categories { display: flex; flex-direction: column; width: 100%; align-self: stretch; }
.benchmark .benchmark-categories img { flex: 1 1 0; min-height: 0; height: 0; object-fit: contain; }
.benchmark-viewpoints { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 3rem); align-items: start; }
.benchmark-viewpoints figure img { aspect-ratio: 1381 / 1174; object-fit: contain; }
.benchmark figcaption { margin-top: .75rem; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.benchmark figcaption strong { color: var(--ink); }

.result-block { display: grid; grid-template-columns: .65fr 1.35fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; margin-top: 3rem; padding-top: 3rem; border-top: 1px solid var(--line); }
.result-block.reverse { grid-template-columns: .65fr 1.35fr; }
.result-block figure { margin: 0; }
.result-text h3 { font-family: var(--serif); font-size: 2rem; }
.result-text p:last-child { color: var(--muted); font-size: 1.05rem; }
.result-number { margin: 0 0 .5rem; color: var(--ink); font-weight: 700; }
.takeaway { margin-top: 3rem; padding: 1.2rem 1.4rem; border-left: 2px solid var(--ink); background: var(--canvas); color: var(--ink); font-size: clamp(1.05rem, 2vw, 1.35rem); }

.citation { display: grid; grid-template-columns: .7fr 1.3fr; gap: 5vw; max-width: none; background: var(--canvas); }
.citation > div:first-child { max-width: 520px; }
.citation > div:first-child p:last-child { color: var(--muted); }
.code-wrap { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); background: white; }
pre { overflow-x: auto; margin: 0; padding: 1.5rem; color: var(--ink); font-size: .86rem; line-height: 1.55; }
.code-wrap pre { padding-top: 3.5rem; }
.copy-button { position: absolute; top: .75rem; right: .75rem; padding: .5rem .75rem; border: 1px solid var(--line); border-radius: 2px; background: white; color: var(--ink); font: 700 .78rem var(--sans); cursor: pointer; }

footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.6rem max(5vw, 1.25rem); border-top: 1px solid var(--line); background: var(--paper); color: var(--muted); }
footer p { margin: 0; }
footer div { display: flex; gap: 1.4rem; }
footer a { text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .hero-grid, .intro, .benchmark, .citation { grid-template-columns: 1fr; }
  .hero-figure { max-width: 650px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .phase-grid, .result-block, .result-block.reverse { grid-template-columns: 1fr; }
  .result-text { max-width: 680px; }
  .benchmark-explanation { grid-template-columns: 1fr; }
  .benchmark-categories { max-width: 400px; justify-self: center; }
  .benchmark .benchmark-categories img { flex: none; height: auto; }
}

@media (max-width: 580px) {
  .benchmark-viewpoints { grid-template-columns: 1fr; gap: 2rem; }
  .benchmark-viewpoints figure img { aspect-ratio: auto; }
  h1 { font-size: 2.35rem; }
  .actions .button { flex: 1 1 calc(50% - .7rem); }
  .steps, .stats { grid-template-columns: 1fr; }
  .phase-flow { flex-direction: column; align-items: stretch; }
  .phase-flow b { transform: rotate(90deg); text-align: center; }
  .phase-flow-loop { margin-right: 1.25rem; margin-bottom: 0; }
  .phase-flow-loop::after { left: 100%; right: auto; top: 1.4rem; bottom: 1.4rem; width: 1rem; height: auto; border: 1px solid var(--ink); border-left: 0; }
  .phase-flow-loop::before { left: 100%; top: 1.4rem; transform: translateY(-50%) rotate(-45deg); }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}
