:root {
  --ink: #10283f;
  --ink-soft: #17344c;
  --paper: #f7f8fa;
  --paper-2: #e9eef3;
  --text: #eef3f7;
  --muted: #b9c7d2;
  --dark-muted: #5a6d7d;
  --line: rgba(238, 243, 247, 0.19);
  --dark-line: rgba(16, 40, 63, 0.18);
  --accent: #a8c7da;
  --accent-dark: #2e648e;
  --warm: #a78642;
  --max: 1240px;
  --pad: clamp(1.25rem, 3.2vw, 3.5rem);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -6rem;
  z-index: 1000;
  padding: .75rem 1rem;
  color: #fff;
  background: var(--accent-dark);
}

.skip-link:focus { top: 1rem; }

.scroll-progress {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
}

.scroll-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
}

.site-header {
  position: sticky;
  z-index: 90;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: .75rem var(--pad);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 12, 11, .9);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: inherit;
  font-weight: 700;
  letter-spacing: -.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--ink);
  background: var(--accent);
  font-size: .75rem;
  letter-spacing: -.04em;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 2rem);
}

.site-header nav a {
  color: #c3cac1;
  font-size: .8rem;
  font-weight: 650;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
}

.site-header nav a:hover,
.site-header nav a:focus-visible { color: var(--accent); }

.site-header nav .nav-repo {
  padding: .56rem .8rem;
  color: var(--ink);
  background: var(--paper);
}

.nav-toggle {
  display: none;
  padding: .5rem .7rem;
  color: var(--text);
  border: 1px solid var(--line);
  background: transparent;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .93fr) minmax(420px, 1.07fr);
  min-height: calc(100vh - 70px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero::before {
  position: absolute;
  inset: 0 50% 0 0;
  pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 82px 82px;
  content: "";
  opacity: .12;
  mask-image: linear-gradient(to bottom, transparent, black 25%, transparent 95%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(4rem, 8vw, 8rem) var(--pad);
}

.eyebrow,
.micro-label,
.aside-label,
.chart-label {
  margin: 0 0 1.25rem;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4rem, 8.7vw, 8.2rem);
  font-weight: 400;
  letter-spacing: -.06em;
  line-height: .82;
}

.hero h1 span,
.hero h1 strong { display: block; }
.hero h1 strong { color: #c8dce8; font-weight: 600; }

.hero-title {
  max-width: 700px;
  margin: clamp(2rem, 4vw, 3.4rem) 0 0;
  color: #f2f4ee;
  font-size: clamp(1.25rem, 2vw, 1.85rem);
  font-weight: 650;
  letter-spacing: -.035em;
  line-height: 1.18;
}

.hero-summary {
  max-width: 660px;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.author-line {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  margin-top: 1.8rem;
  font-size: .88rem;
}

.author-line span + span { color: var(--muted); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  min-width: 190px;
  gap: 1rem;
  padding: .92rem 1.1rem;
  border: 1px solid var(--line);
  font-size: .82rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-decoration: none;
}

.button-primary { color: #fff; border-color: var(--accent-dark); background: var(--accent-dark); }
.button-ghost:hover { color: var(--accent); border-color: var(--accent); }

.hero-media {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: #202420;
}

.hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-media::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(10, 12, 11, .78), transparent 30%);
  content: "";
}

.hero-media figcaption {
  position: absolute;
  z-index: 2;
  right: 1.4rem;
  bottom: 1.4rem;
  left: 1.4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.hero-media figcaption span:last-child { color: var(--accent); }

.hero-index {
  position: absolute;
  z-index: 3;
  top: 1rem;
  right: 1rem;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: #fff;
  background: var(--accent-dark);
  font-weight: 800;
}

.metric-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: var(--max);
  margin: 0 auto;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.metric-rail div {
  min-height: 150px;
  padding: 2rem;
  border-right: 1px solid var(--line);
}

.metric-rail div:last-child { border-right: 0; }
.metric-rail strong { display: block; color: #c8dce8; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.9rem, 3vw, 3.4rem); font-weight: 500; letter-spacing: -.045em; line-height: 1; }
.metric-rail span { display: block; margin-top: .8rem; color: var(--muted); font-size: .8rem; }

.section {
  padding: clamp(5rem, 10vw, 9rem) var(--pad);
}

.section > * {
  width: min(100%, var(--max));
  margin-right: auto;
  margin-left: auto;
}

.section-light,
.representation-section {
  color: var(--ink);
  background: var(--paper);
}

.section-dark { background: var(--ink-soft); }
.generation-section { color: var(--ink); background: var(--paper-2); }

.section-kicker {
  display: flex;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid currentColor;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .68;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .44fr);
  gap: clamp(2rem, 8vw, 8rem);
  align-items: end;
  margin-top: clamp(2rem, 4vw, 3.5rem);
  margin-bottom: clamp(3rem, 7vw, 6rem);
}

.section-heading h2,
.resource-heading h2 {
  max-width: 900px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 5.5vw, 5.7rem);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: 1;
}

.section-heading p,
.resource-heading p { margin: 0; color: inherit; font-size: 1.05rem; opacity: .68; }

.abstract-layout {
  display: grid;
  grid-template-columns: minmax(240px, .32fr) minmax(0, .68fr);
  gap: clamp(2rem, 8vw, 9rem);
  align-items: start;
  padding-top: 1.5rem;
  border-top: 1px solid var(--dark-line);
}

.abstract-aside { position: sticky; top: 100px; }
.abstract-aside p:last-child { max-width: 340px; margin: 0; font-size: 1.45rem; font-weight: 600; letter-spacing: -.035em; line-height: 1.25; }
.abstract-layout details { border-bottom: 1px solid var(--dark-line); }
.abstract-layout summary { display: flex; justify-content: space-between; cursor: pointer; list-style: none; padding: 1.3rem 0; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.abstract-layout summary::after { content: "+"; }
.abstract-layout details[open] summary::after { content: "−"; }
.abstract-layout details p { margin: 0 0 1.4rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.15rem, 1.7vw, 1.45rem); line-height: 1.65; }

.workflow-figure,
.performance-figure {
  position: relative;
  display: block;
  padding: 1rem;
  color: inherit;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
}

.workflow-figure img,
.performance-figure img { background: #fff; }
.workflow-figure span,
.performance-figure span { display: flex; justify-content: space-between; margin-top: .8rem; color: var(--ink); font-size: .75rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.steps article { min-height: 310px; padding: 1.8rem; border-right: 1px solid var(--line); }
.steps article:last-child { border-right: 0; }
.step-number { color: #c8dce8; font-size: .78rem; font-weight: 850; }
.steps h3 { margin: 5rem 0 1rem; font-size: 1.7rem; letter-spacing: -.035em; }
.steps p { margin: 0; color: var(--muted); }

.generation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--dark-line);
  background: var(--dark-line);
}

.video-panel { margin: 0; background: var(--paper); }
.video-panel-wide { grid-column: 1 / -1; }
.video-panel video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #111; }
.video-panel:not(.video-panel-wide) video { aspect-ratio: 16 / 8.2; }
.video-panel figcaption { display: flex; justify-content: space-between; gap: 1.5rem; padding: 1rem 1.2rem; }
.video-panel figcaption strong { font-size: .9rem; }
.video-panel figcaption span { color: var(--dark-muted); font-size: .8rem; text-align: right; }

.results-layout {
  display: grid;
  grid-template-columns: minmax(0, .68fr) minmax(270px, .32fr);
  gap: 1px;
  border: 1px solid var(--dark-line);
  background: var(--dark-line);
}

.chart-card { min-width: 0; padding: clamp(1.2rem, 3vw, 2.4rem); background: #fff; }
.chart-toolbar { display: flex; justify-content: space-between; gap: 1.5rem; align-items: flex-start; }
.chart-toolbar > div:first-child { display: flex; flex-direction: column; }
.chart-label { margin: 0 0 .35rem; color: var(--accent-dark); }
.chart-toolbar strong { font-size: 1.8rem; }
.segmented-control { display: inline-flex; border: 1px solid var(--dark-line); }
.segmented-control button { padding: .62rem .8rem; color: var(--dark-muted); border: 0; border-right: 1px solid var(--dark-line); background: transparent; cursor: pointer; }
.segmented-control button:last-child { border-right: 0; }
.segmented-control button.is-active { color: #fff; background: var(--accent-dark); }

.bar-chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(.5rem, 1.5vw, 1.2rem);
  align-items: end;
  height: 360px;
  margin-top: 2rem;
  padding: 2.2rem 0 0;
  border-bottom: 1px solid var(--dark-line);
  background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), rgba(10,12,11,.08) 25%);
}

.bar-item { display: flex; height: 100%; flex-direction: column; justify-content: flex-end; align-items: stretch; text-align: center; }
.bar-value { margin-bottom: .4rem; font-size: .75rem; font-weight: 800; }
.bar { min-height: 2px; background: #9aa19a; transition: height .5s ease; }
.bar.generated { background: var(--accent-dark); }
.bar-name { min-height: 3.4rem; padding-top: .65rem; color: var(--dark-muted); font-size: .68rem; font-weight: 750; line-height: 1.2; }
.chart-legend { display: flex; gap: 1.2rem; margin-top: 1rem; color: var(--dark-muted); font-size: .73rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: .45rem; }
.chart-legend i { display: inline-block; width: 12px; height: 12px; background: #9aa19a; }
.chart-legend i.generated { background: var(--accent-dark); }
.chart-note { margin: 1rem 0 0; color: var(--dark-muted); font-size: .75rem; }

.result-notes { display: grid; gap: 1px; background: var(--dark-line); }
.result-notes article { padding: 1.6rem; background: var(--paper-2); }
.result-value { color: var(--accent-dark); font-size: clamp(2.1rem, 4vw, 3.4rem); font-weight: 700; letter-spacing: -.055em; }
.result-notes h3 { margin: .55rem 0 .4rem; font-size: 1rem; }
.result-notes p { margin: 0; color: var(--dark-muted); font-size: .8rem; }

.performance-figure { margin-top: 2rem; border-color: var(--dark-line); }
.evidence-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 2rem; border-top: 1px solid var(--dark-line); border-left: 1px solid var(--dark-line); }
.evidence-strip div { min-height: 170px; padding: 1.4rem; border-right: 1px solid var(--dark-line); border-bottom: 1px solid var(--dark-line); }
.evidence-strip strong { display: block; color: var(--accent-dark); font-size: clamp(1.8rem, 3vw, 3.2rem); letter-spacing: -.06em; }
.evidence-strip span { display: block; margin-top: .8rem; color: var(--dark-muted); font-size: .78rem; }

.demo-console { display: grid; grid-template-columns: 250px minmax(0, 1fr); border: 1px solid var(--line); }
.demo-selector { display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.demo-selector button {
  display: flex;
  justify-content: space-between;
  padding: 1.3rem;
  color: var(--muted);
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}
.demo-selector button.is-active { color: #fff; background: var(--accent-dark); }
.demo-selector button span { font-size: .68rem; }
.demo-viewer { margin: 0; min-width: 0; }
.demo-viewer video { width: 100%; max-height: 720px; aspect-ratio: 16 / 10; object-fit: cover; background: #050605; }
.demo-viewer figcaption { display: flex; justify-content: space-between; gap: 1.5rem; padding: 1.2rem 1.4rem; border-top: 1px solid var(--line); }
.demo-viewer figcaption div { display: flex; gap: .9rem; align-items: baseline; }
.demo-viewer figcaption div span { color: var(--accent); font-size: .7rem; font-weight: 800; }
.demo-viewer figcaption p { max-width: 500px; margin: 0; color: var(--muted); font-size: .8rem; text-align: right; }

.context-demo { margin-top: clamp(3rem, 7vw, 6rem); }
.context-copy { display: grid; grid-template-columns: minmax(170px, .2fr) minmax(0, .48fr) minmax(280px, .32fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: end; }
.context-demo h3 { margin: 0; font-size: clamp(2rem, 4vw, 4rem); letter-spacing: -.055em; line-height: 1.02; }
.context-demo p { margin: 0; color: var(--muted); }
.context-video-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: clamp(2rem, 4vw, 3.5rem); border: 1px solid var(--line); background: var(--line); }
.context-video-pair figure { min-width: 0; margin: 0; background: #111; }
.context-video-pair video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #050605; }
.context-video-pair figcaption { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border-top: 1px solid var(--line); background: var(--ink); }
.context-video-pair figcaption strong { font-size: .82rem; }
.context-video-pair figcaption span { color: var(--muted); font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; }

.representation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; border: 1px solid var(--dark-line); background: var(--dark-line); }
.representation-grid figure { margin: 0; background: #fff; }
.representation-grid img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.representation-grid figcaption { display: flex; justify-content: space-between; padding: 1rem 1.2rem; border-top: 1px solid var(--dark-line); }
.representation-grid figcaption span { color: var(--accent-dark); font-size: .75rem; font-weight: 800; }

.resource-section { background: var(--paper-2); color: var(--ink); }
.resource-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .35fr); gap: clamp(2rem, 8vw, 8rem); align-items: end; margin-top: 3rem; }
.resource-links { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 5rem; border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); }
.resource-links a,
.resource-links button { display: flex; justify-content: space-between; gap: 1rem; padding: 1.3rem; color: var(--ink); border: 0; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); background: transparent; font-weight: 800; text-decoration: none; cursor: pointer; }
.resource-links a:hover,
.resource-links button:hover { color: var(--text); background: var(--ink); }
.resource-links b { font-size: .72rem; }
#bibtex { overflow-x: auto; margin-top: 1.5rem; padding: 1.5rem; color: var(--text); background: var(--ink); font-size: .78rem; line-height: 1.6; }

.code-release {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 4rem;
  border: 1px solid var(--dark-line);
  background: var(--dark-line);
}

.code-release article {
  min-height: 220px;
  padding: 1.4rem;
  background: var(--paper);
}

.code-release article > span {
  color: var(--accent-dark);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
}

.code-release h3 {
  margin: 3.5rem 0 .7rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 500;
}

.code-release p { margin: 0; color: var(--dark-muted); font-size: .85rem; }

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: 2rem var(--pad);
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: .78rem;
}

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

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .hero-media { min-height: 62vw; border-top: 1px solid var(--line); border-left: 0; }
  .hero-index { top: auto; bottom: 1rem; }
  .metric-rail { grid-template-columns: 1fr 1fr; }
  .metric-rail div:nth-child(2) { border-right: 0; }
  .metric-rail div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .section-heading,
  .resource-heading { grid-template-columns: 1fr; gap: 1.5rem; align-items: start; }
  .results-layout { grid-template-columns: 1fr; }
  .result-notes { grid-template-columns: repeat(3, 1fr); }
  .evidence-strip { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .site-header { min-height: 62px; }
  .nav-toggle { display: block; }
  .site-header nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    padding: 1rem var(--pad) 1.5rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-bottom: 1px solid var(--line);
    background: var(--ink);
  }
  .site-header nav.is-open { display: flex; }
  .site-header nav a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .site-header nav .nav-repo { margin-top: .8rem; padding: .8rem; text-align: center; }
  .hero { min-height: auto; }
  .hero-copy { padding-top: 5rem; }
  .hero h1 { font-size: clamp(3.9rem, 22vw, 7rem); }
  .hero-media { min-height: 78vw; }
  .hero-media figcaption { flex-direction: column; }
  .metric-rail { grid-template-columns: 1fr; border-right: 0; border-left: 0; }
  .metric-rail div { min-height: 120px; border-right: 0; border-bottom: 1px solid var(--line); }
  .section { padding-top: 4.5rem; padding-bottom: 4.5rem; }
  .section-heading h2,
  .resource-heading h2 { font-size: clamp(2.6rem, 13vw, 4.2rem); }
  .abstract-layout { grid-template-columns: 1fr; }
  .abstract-aside { position: static; }
  .steps { grid-template-columns: 1fr; }
  .steps article { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .steps article:last-child { border-bottom: 0; }
  .steps h3 { margin-top: 2.5rem; }
  .generation-grid { grid-template-columns: 1fr; }
  .video-panel-wide { grid-column: auto; }
  .video-panel figcaption { flex-direction: column; gap: .3rem; }
  .video-panel figcaption span { text-align: left; }
  .chart-toolbar { flex-direction: column; }
  .segmented-control { width: 100%; }
  .segmented-control button { flex: 1; }
  .bar-chart { gap: .35rem; height: 300px; }
  .bar-name { font-size: .59rem; }
  .result-notes { grid-template-columns: 1fr; }
  .evidence-strip { grid-template-columns: 1fr; }
  .demo-console { grid-template-columns: 1fr; }
  .demo-selector { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); }
  .demo-selector button { flex: 1; border-right: 1px solid var(--line); border-bottom: 0; }
  .demo-selector button:last-child { border-right: 0; }
  .demo-viewer figcaption { flex-direction: column; }
  .demo-viewer figcaption p { text-align: left; }
  .context-copy { grid-template-columns: 1fr; align-items: start; }
  .context-video-pair { grid-template-columns: 1fr; }
  .representation-grid { grid-template-columns: 1fr; }
  .resource-links { grid-template-columns: 1fr; }
  .code-release { grid-template-columns: 1fr; }
  footer { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
