:root {
  --paper: #ffffff;
  --paper-soft: #f8fafc;
  --ink: #111827;
  --muted: #64748b;
  --line: #e2e8f0;
  --color: #d94f72;
  --texture: #c78624;
  --structure: #3f8f91;
  --violet: #7662a8;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #ffffff;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
figure { margin: 0; }
.section-shell { width: min(calc(100% - 44px), var(--max)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 62px;
  padding: 0 max(22px, calc((100% - var(--max)) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 720; letter-spacing: -.025em; }
.brand-mark { display: inline-flex; gap: 3px; }
.brand-mark i { width: 6px; height: 19px; display: block; border-radius: 4px; transform: skew(-8deg); }
.brand-mark i:nth-child(1) { background: var(--color); }
.brand-mark i:nth-child(2) { background: var(--texture); }
.brand-mark i:nth-child(3) { background: var(--structure); }
nav { display: flex; gap: 25px; color: var(--muted); font-size: 13px; font-weight: 600; }
nav a { transition: color .2s ease; }
nav a:hover { color: var(--ink); }

main { display: flex; flex-direction: column; }
.hero { order: 1; }
.tldr { order: 2; }
.analysis { order: 3; }
.method { order: 4; }
.results { order: 5; }
.control-section { order: 6; }
.pairwise-results { order: 7; }
.citation { order: 8; }

.hero { padding-top: 78px; text-align: center; }
h1 {
  margin: 0 0 4px;
  font-size: clamp(58px, 8vw, 98px);
  line-height: .98;
  letter-spacing: -.058em;
  font-weight: 670;
  text-wrap: balance;
}
.paper-title {
  margin: 12px auto 22px;
  font-size: clamp(21px, 2.5vw, 31px);
  line-height: 1.15;
  letter-spacing: -.035em;
  font-weight: 450;
}
.paper-authors {
  margin: -8px auto 20px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .01em;
}
.hero-deck {
  max-width: 830px;
  margin: 0 auto;
  color: #475569;
  font-size: clamp(17px, 1.9vw, 22px);
  line-height: 1.55;
  letter-spacing: -.012em;
}
.color-text { color: var(--color); }
.texture-text { color: var(--texture); }
.structure-text { color: var(--structure); }
.hero-actions { margin: 29px 0 48px; display: flex; justify-content: center; gap: 9px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 102px;
  padding: 10px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 680;
  cursor: default;
  user-select: none;
}
.button-dark { color: var(--paper); background: var(--ink); }
.button-light { background: transparent; }
.hero-actions a.button { cursor: pointer; transition: color .18s ease, background .18s ease; }
.hero-actions a.button-dark:hover { color: var(--ink); background: var(--paper); }
.hero-actions a.button:focus-visible { outline: 2px solid var(--structure); outline-offset: 3px; }
.hero-figure { overflow: hidden; }
.hero-figure img { width: 100%; }

.section-kicker, .mini-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h2 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(38px, 4.6vw, 58px);
  line-height: 1.04;
  letter-spacing: -.032em;
  font-weight: 700;
  text-wrap: balance;
}
h3 {
  margin: 0 0 10px;
  font-size: clamp(24px, 2.7vw, 36px);
  line-height: 1.12;
  letter-spacing: -.025em;
  font-weight: 650;
  text-wrap: balance;
}
.section-heading { max-width: 910px; margin-bottom: 48px; }
.section-heading > p:last-child { max-width: 650px; color: var(--muted); font-size: 17px; }
.section-heading.center { margin-inline: auto; text-align: center; }

.tldr {
  margin-top: 95px;
  padding: 54px 0;
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 72px;
  border-block: 1px solid var(--line);
}
.tldr h2 { font-size: clamp(35px, 4vw, 52px); }
.tldr-copy > p { margin: 0 0 26px; color: #475569; font-size: 19px; }
.attribute-legend { display: flex; flex-wrap: wrap; }
.tag { display: inline-flex; flex-direction: column; padding: 0 22px; }
.tag:first-child { padding-left: 0; }
.tag + .tag { border-left: 1px solid var(--line); }
.tag b { font-size: 14px; }
.tag small { color: var(--muted); font-size: 11px; font-weight: 500; }
.tag-color b { color: var(--color); }
.tag-texture b { color: var(--texture); }
.tag-structure b { color: var(--structure); }

.analysis, .method, .results, .pairwise-results, .citation { padding-top: 100px; }

.analysis-step {
  display: grid;
  grid-template-columns: .76fr 1.24fr;
  gap: 42px;
  align-items: center;
  margin: 14px 0 42px;
  padding: 24px 0;
}
.analysis-step.reverse .step-copy { order: 3; }
.analysis-step.reverse .step-visual { order: 2; }
.step-copy p:last-child, .latent-card p:last-child { color: var(--muted); }
.step-visual { overflow: hidden; background: #fff; }
.step-visual img { width: 100%; cursor: zoom-in; }
.latent-card {
  max-width: 850px;
  margin-top: 26px;
  padding: 28px 0 28px 34px;
  border-left: 4px solid var(--violet);
}
.latent-card h3 { max-width: 720px; }
.latent-card p:last-child { max-width: 680px; margin-bottom: 0; }

.method .section-heading { max-width: 1080px; }
.method .section-heading h2 { font-size: clamp(38px, 4.4vw, 56px); }
.method-figure { margin-bottom: 22px; }
.method-figure img { width: 100%; }
.method-routes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 34px 0 28px;
  border-block: 1px solid var(--line);
}
.method-route { padding: 25px 30px 24px; }
.method-route:first-child { padding-left: 0; }
.method-route:last-child { padding-right: 0; }
.method-route + .method-route { border-left: 1px solid var(--line); }
.method-route > span {
  display: block;
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.route-color > span { color: var(--color); }
.route-texture > span { color: var(--texture); }
.route-structure > span { color: var(--structure); }
.method-route h3 { margin-bottom: 6px; font-size: 19px; letter-spacing: -.015em; }
.method-route p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.method-summary {
  max-width: 760px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}

.comparison-carousel { padding-top: 4px; }
.comparison-topline, .carousel-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 13px;
}
.comparison-topline {
  min-height: 112px;
  align-items: flex-start;
  flex-direction: column;
  padding: 8px 0 5px 28px;
  border-left: 1px solid var(--line);
}
.comparison-topline p { margin: 0; }
[data-comparison-prompt], [data-tier-prompt] {
  color: var(--ink);
  font-size: clamp(21px, 2.1vw, 27px);
  font-style: normal;
  font-weight: 680;
  letter-spacing: -.025em;
  line-height: 1.15;
}
[data-comparison-prompt]::before, [data-tier-prompt]::before {
  content: "Prompt  ·";
  display: inline-block;
  margin-right: 9px;
  color: var(--structure);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  vertical-align: .23em;
}
.comparison-context { display: grid; grid-template-columns: auto minmax(260px, 1fr); gap: 28px; align-items: stretch; margin-bottom: 26px; }
.comparison-references { display: grid; grid-template-columns: repeat(3, 112px); gap: 9px; }
.comparison-outputs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.comparison-references img, .comparison-outputs img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.comparison-references figure, .comparison-outputs figure { position: relative; }
.comparison-references figcaption, .comparison-outputs figcaption, .tier-images figcaption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
}
.comparison-outputs .ours img { outline: 2px solid var(--ink); outline-offset: -2px; }
.comparison-outputs .ours figcaption { color: var(--ink); font-weight: 800; }
.attribute-color figcaption { color: var(--color); }
.attribute-texture figcaption { color: var(--texture); }
.attribute-structure figcaption { color: var(--structure); }
.carousel-controls { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.comparison-navigation { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.comparison-controls { margin-top: 0; }
.comparison-controls .carousel-arrow {
  width: 50px;
  height: 50px;
  border-color: var(--ink);
  color: white;
  background: var(--ink);
  font-size: 22px;
}
.comparison-controls .carousel-arrow:hover { color: var(--ink); background: white; }
.carousel-dots { display: flex; align-items: center; gap: 7px; }
.carousel-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, .22);
  cursor: pointer;
  transition: width .25s ease, border-radius .25s ease, background .25s ease;
}
.carousel-dots button.active { width: 23px; border-radius: 8px; background: var(--ink); }
.carousel-arrow {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 19px;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.carousel-arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
.carousel-arrow:hover { border-color: rgba(15, 23, 42, .35); background: white; }

.control-section {
  margin-top: 112px;
  padding: 94px 0;
  border-block: 1px solid var(--line);
  background: var(--paper-soft);
}
.section-heading.split { max-width: none; display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: end; }
.control-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.control-card { padding: 0; border: 0; background: transparent; }
.control-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; font-weight: 750; }
.control-card-head output { padding: 3px 8px; background: rgba(15, 23, 42, .06); font-size: 11px; font-variant-numeric: tabular-nums; }
.control-images { display: grid; grid-template-columns: .48fr 20px 1.35fr; align-items: center; gap: 10px; }
.control-images img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #ddd; }
.control-images figcaption, .pairwise-reference figcaption { margin-top: 6px; color: var(--muted); font-size: 9px; letter-spacing: .09em; text-align: center; text-transform: uppercase; }
.control-arrow { color: var(--muted); text-align: center; }
input[type="range"] { width: 100%; height: 32px; margin: 19px 0 4px; appearance: none; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: #dbe3ea; }
input[type="range"]::-moz-range-track { height: 8px; border-radius: 8px; background: #dbe3ea; }
input[type="range"]::-webkit-slider-thumb { width: 30px; height: 30px; margin-top: -11px; appearance: none; border: 5px solid var(--paper); border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,.24); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border: 5px solid var(--paper); border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,.24); }
.color-control input::-webkit-slider-thumb { background: var(--color); }
.texture-control input::-webkit-slider-thumb { background: var(--texture); }
.structure-control input::-webkit-slider-thumb { background: var(--structure); }
.color-control input::-moz-range-thumb { background: var(--color); }
.texture-control input::-moz-range-thumb { background: var(--texture); }
.structure-control input::-moz-range-thumb { background: var(--structure); }
.range-labels, .pairwise-range-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; letter-spacing: .07em; text-transform: uppercase; }

.result-gallery { margin-top: 96px; padding-top: 72px; border-top: 1px solid var(--line); }
.gallery-heading { display: flex; justify-content: space-between; align-items: end; gap: 35px; margin-bottom: 34px; }
.gallery-heading h3 { max-width: 620px; margin: 0; font-family: "Newsreader", Georgia, serif; font-size: clamp(30px, 3.5vw, 44px); font-weight: 700; }
.gallery-heading p { max-width: 420px; margin: 0; color: var(--muted); }
.tier-tabs, .pairwise-tabs { display: flex; gap: 4px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.tier-tabs button, .pairwise-tabs button {
  padding: 10px 15px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}
.tier-tabs button:hover, .pairwise-tabs button:hover { color: var(--ink); }
.tier-tabs button.active, .pairwise-tabs button.active { color: var(--ink); border-bottom-color: var(--color); }
.tier-gallery { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 17px; }
.tier-content { display: flex; min-width: 0; flex-direction: column; }
.tier-images { min-height: 285px; display: flex; align-items: center; justify-content: center; gap: 14px; }
.tier-reference-group { display: flex; gap: 9px; }
.tier-reference-group figure { width: clamp(105px, 14vw, 166px); }
.tier-output { width: clamp(205px, 27vw, 330px); }
.tier-images img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.tier-output img { outline: 3px solid var(--color); outline-offset: -3px; }
.tier-output figcaption { color: var(--color); }
.tier-arrow { color: var(--muted); font-size: 22px; }
.carousel-meta {
  align-items: end;
  margin-top: 20px;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
}

.benchmark-summary {
  display: grid;
  grid-template-columns: .72fr 1.28fr;
  gap: 64px;
  align-items: start;
  margin-top: 92px;
  padding-top: 72px;
  border-top: 1px solid var(--line);
}
.benchmark-copy h3 { font-family: "Newsreader", Georgia, serif; font-size: clamp(29px, 3.2vw, 40px); }
.benchmark-copy > p:last-child { max-width: 340px; margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.benchmark-table-wrap { overflow-x: auto; }
.benchmark-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.benchmark-table th, .benchmark-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.benchmark-table th:first-child, .benchmark-table td:first-child { padding-left: 0; text-align: left; }
.benchmark-table thead th { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.benchmark-table tbody th { font-weight: 550; }
.benchmark-ours { background: var(--paper-soft); }
.benchmark-ours th, .benchmark-ours td { color: var(--ink); font-weight: 750 !important; }

.pairwise-demo {
  display: grid;
  grid-template-columns: minmax(120px,.55fr) minmax(300px,1.35fr) minmax(120px,.55fr);
  align-items: center;
  gap: 30px;
  max-width: 920px;
  margin: 0 auto;
}
.pairwise-reference img, .pairwise-center > img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #fff; }
.pairwise-center { text-align: center; }
.pairwise-center input[type="range"] { margin-top: 22px; }
.pairwise-center input[type="range"]::-webkit-slider-thumb { background: var(--violet); }
.pairwise-center input[type="range"]::-moz-range-thumb { background: var(--violet); }

.citation { padding-bottom: 112px; display: grid; grid-template-columns: .8fr 1.2fr; gap: 70px; align-items: start; }
.citation-note { color: var(--muted); }
.code-wrap { position: relative; }
pre { margin: 0; padding: 28px; overflow-x: auto; color: #f8fafc; background: #0f172a; font: 13px/1.7 "SFMono-Regular", Consolas, monospace; }
.copy-button { position: absolute; top: 11px; right: 11px; padding: 7px 10px; border: 0; color: white; background: rgba(255,255,255,.12); cursor: pointer; font-size: 11px; }
footer { width: min(calc(100% - 44px), var(--max)); margin: 0 auto; padding: 31px 0 46px; display: flex; justify-content: space-between; align-items: center; gap: 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.content-leave { opacity: 0; transform: translateY(7px); transition: opacity .15s ease, transform .15s ease; }
.content-enter { animation: content-in .36s cubic-bezier(.22,1,.36,1); }
@keyframes content-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 28px;
  border: 0;
  background: rgba(18,18,16,.91);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.image-lightbox.open { opacity: 1; visibility: visible; }
.image-lightbox img { max-width: min(1500px, 96vw); max-height: 92vh; object-fit: contain; background: white; cursor: zoom-out; }
.image-lightbox span { position: absolute; top: 13px; right: 20px; color: white; font-size: 29px; font-weight: 300; }
.paper-frame img, .step-visual img, .comparison-carousel img, .tier-gallery img { cursor: zoom-in; }

@media (max-width: 900px) {
  nav { display: none; }
  .tldr, .citation, .section-heading.split, .benchmark-summary { grid-template-columns: 1fr; gap: 28px; }
  .tldr { padding: 44px 0; }
  .analysis-step, .analysis-step.reverse { grid-template-columns: 1fr; gap: 20px; }
  .analysis-step .step-visual, .analysis-step.reverse .step-visual { grid-column: 1 / -1; order: 3; }
  .analysis-step.reverse .step-copy { order: 2; }
  .control-grid { grid-template-columns: 1fr; }
  .method-routes { grid-template-columns: 1fr; }
  .method-route, .method-route:first-child, .method-route:last-child { padding: 20px 0; }
  .method-route + .method-route { border-left: 0; border-top: 1px solid var(--line); }
  .comparison-outputs { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 620px) {
  .section-shell { width: min(calc(100% - 24px), var(--max)); }
  .site-header { padding-inline: 14px; }
  .hero { padding-top: 66px; }
  h1 { font-size: 54px; }
  .paper-title { font-size: 20px; }
  .analysis, .method, .results, .pairwise-results, .citation { padding-top: 88px; }
  .method .section-heading h2 { white-space: normal; }
  .comparison-context { grid-template-columns: 1fr; gap: 15px; }
  .comparison-references { grid-template-columns: repeat(3, 1fr); }
  .comparison-topline { min-height: 0; padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .comparison-outputs { grid-template-columns: repeat(2, 1fr); }
  .gallery-heading { display: block; }
  .gallery-heading p { margin-top: 12px; }
  .tier-tabs, .pairwise-tabs { overflow-x: auto; }
  .tier-tabs button, .pairwise-tabs button { flex: 0 0 auto; padding-inline: 10px; }
  .tier-gallery { grid-template-columns: 32px minmax(0,1fr) 32px; gap: 6px; }
  .carousel-arrow { width: 32px; height: 32px; font-size: 15px; }
  .tier-images { min-height: 0; flex-wrap: wrap; gap: 8px; }
  .tier-reference-group { width: 100%; justify-content: center; }
  .tier-reference-group figure { width: calc((100% - 18px) / 3); }
  .tier-arrow { display: none; }
  .tier-output { width: 62%; }
  .pairwise-demo { grid-template-columns: 1fr 1fr; gap: 14px; }
  .pairwise-center { grid-column: 1 / -1; grid-row: 2; }
  footer { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .content-leave, .content-enter { opacity: 1 !important; transform: none !important; transition: none !important; animation: none !important; }
}
