:root {
  --paper: #f6f7f4;
  --paper-bright: #ffffff;
  --ink: #152238;
  --ink-soft: #4e5b6c;
  --navy: #102b4e;
  --navy-deep: #091b34;
  --teal: #0b8a87;
  --teal-pale: #dcefed;
  --coral: #e56751;
  --gold: #d7a43e;
  --violet: #7355b7;
  --rule: #d5dcd9;
  --rule-dark: #aeb9b5;
  --display: "Newsreader", Georgia, serif;
  --body: "Manrope", sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --shell: min(1380px, calc(100vw - 48px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}
button, a { font: inherit; }
a { color: var(--teal); }
img { display: block; max-width: 100%; }
button { letter-spacing: 0; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 999;
  transform: translateY(-160%);
  padding: 10px 14px;
  color: #fff;
  background: var(--navy);
}
.skip-link:focus { transform: translateY(0); }

.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  border-bottom: 1px solid rgba(16, 43, 78, 0.12);
  background: rgba(246, 247, 244, 0.94);
  backdrop-filter: blur(14px);
}
.nav-inner {
  width: var(--shell);
  height: 70px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--navy);
  font-family: var(--display);
  font-size: 23px;
  font-weight: 600;
}
.wordmark:hover { color: var(--navy); }
.wordmark-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: contain;
}
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
}
.nav-links a:hover { color: var(--teal); }
.nav-toggle {
  width: 40px;
  height: 40px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  color: var(--navy);
  background: transparent;
}

.project-hero {
  position: relative;
  min-height: 790px;
  padding: 160px 24px 54px;
  overflow: hidden;
  color: var(--navy-deep);
  background-image: url("../images/project/case-anydressing.png");
  background-position: center;
  background-size: cover;
}
.hero-wash {
  position: absolute;
  inset: 0;
  background: rgba(247, 248, 246, 0.94);
}
.project-hero::before,
.project-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.project-hero::before {
  top: 70px;
  right: 8%;
  width: 220px;
  height: 4px;
  background: var(--coral);
}
.project-hero::after {
  left: 0;
  bottom: 0;
  width: 38%;
  height: 8px;
  background: var(--teal);
}
.hero-content {
  position: relative;
  z-index: 2;
  width: min(1160px, 100%);
  margin: 0 auto;
  text-align: center;
}
.hero-title-lockup {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 34px;
  text-align: left;
}
.hero-logo {
  width: 132px;
  height: 132px;
  object-fit: contain;
}
.hero-title-copy { min-width: 0; }
.eyebrow,
.section-index {
  margin: 0 0 18px;
  color: var(--teal);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.project-hero h1 {
  margin: 0;
  color: var(--navy-deep);
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0;
}
.hero-project-name {
  display: block;
  color: var(--teal);
  font-size: 104px;
  line-height: 0.82;
}
.hero-project-name > span { color: var(--navy-deep); }
.hero-paper-title {
  display: block;
  max-width: 940px;
  margin-top: 18px;
  color: var(--navy-deep);
  font-size: 46px;
  line-height: 1.04;
}
.hero-acronym {
  max-width: 900px;
  margin: 30px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  color: var(--navy);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
}
.hero-acronym span { white-space: nowrap; }
.hero-acronym strong {
  margin-right: 5px;
  color: var(--teal);
  font-size: 17px;
}
.hero-lede {
  max-width: 900px;
  margin: 22px auto 0;
  color: #334257;
  font-size: clamp(18px, 1.7vw, 23px);
  line-height: 1.55;
}
.hero-actions {
  margin-top: 34px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.action-button {
  min-height: 44px;
  padding: 10px 17px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--navy);
  border-radius: 4px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.68);
  font-size: 14px;
  font-weight: 700;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}
.action-button:hover { transform: translateY(-2px); color: #fff; background: var(--navy); }
.action-primary { color: #fff; background: var(--navy); }
.hero-stats {
  position: relative;
  z-index: 2;
  width: min(1180px, 100%);
  margin: 70px auto 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule-dark);
  border-bottom: 1px solid var(--rule-dark);
}
.hero-stats div { min-width: 0; padding: 18px 20px; text-align: left; }
.hero-stats div + div { border-left: 1px solid var(--rule-dark); }
.hero-stats strong {
  display: block;
  color: var(--navy);
  font-family: var(--display);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.1;
}
.hero-stats span { color: var(--ink-soft); font-size: 13px; }

.section-band { padding: 112px 0; border-bottom: 1px solid var(--rule); }
.page-shell { width: var(--shell); margin: 0 auto; }
.narrow-shell { max-width: 1120px; }
.section-heading { max-width: 900px; margin-bottom: 52px; }
.section-heading h2,
.template-copy h2 {
  margin: 0;
  color: var(--navy-deep);
  font-family: var(--display);
  font-size: clamp(40px, 4.4vw, 64px);
  font-weight: 600;
  line-height: 1.04;
}
.section-deck {
  max-width: 820px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 18px;
}
.abstract-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 64px;
  color: var(--ink-soft);
}
.abstract-grid p { margin: 0; }
.lead-paragraph { color: var(--ink) !important; font-family: var(--display); font-size: 28px; line-height: 1.45; }
.contribution-strip {
  margin-top: 72px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule-dark);
  border-bottom: 1px solid var(--rule-dark);
}
.contribution-strip article { padding: 30px 28px 34px; }
.contribution-strip article + article { border-left: 1px solid var(--rule-dark); }
.contribution-number { color: var(--coral); font-family: var(--mono); font-size: 13px; }
.contribution-strip h3 { margin: 14px 0 8px; color: var(--navy); font-size: 19px; }
.contribution-strip p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }

.teaser-showcase {
  padding: 82px 0;
  background: #f5f1e8;
}
.teaser-layout {
  display: grid;
  grid-template-columns: 0.58fr 1.42fr;
  gap: 58px;
  align-items: center;
}
.teaser-copy h2 {
  margin: 0;
  color: var(--navy-deep);
  font-family: var(--display);
  font-size: clamp(39px, 4vw, 58px);
  font-weight: 600;
  line-height: 1.04;
}
.teaser-copy > p:not(.section-index) {
  margin: 23px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
}
.teaser-card {
  margin: 0;
  padding: 14px;
  border-top: 6px solid var(--coral);
  background: var(--paper-bright);
  box-shadow: 0 18px 42px rgba(16, 43, 78, 0.12);
}

.method-band { background: var(--paper-bright); }
.figure-stage { margin: 0; }
.image-zoom {
  position: relative;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: zoom-in;
}
.figure-stage .image-zoom {
  border-top: 1px solid var(--rule-dark);
  border-bottom: 1px solid var(--rule-dark);
}
.image-zoom img { width: 100%; display: block; transition: transform 260ms ease; }
.image-zoom:hover img { transform: scale(1.008); }
.image-zoom > span {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 8px 11px;
  color: #fff;
  background: rgba(9, 27, 52, 0.9);
  font-size: 12px;
  font-weight: 700;
}
figure figcaption { margin-top: 14px; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.method-steps {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule);
}
.method-steps article { padding: 28px 25px 0 0; display: flex; gap: 18px; }
.method-steps article + article { padding-left: 25px; border-left: 1px solid var(--rule); }
.method-steps article > span {
  flex: 0 0 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--navy);
  font-family: var(--mono);
  font-size: 13px;
}
.method-steps h3 { margin: 0 0 8px; color: var(--navy); font-size: 17px; }
.method-steps p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }

.gallery-band { background: #eef3f1; }
.variant-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  align-items: center;
  gap: 18px;
}
.variant-gallery figure,
.poster-grid figure { margin: 0; background: var(--paper-bright); }
.variant-gallery figure { min-width: 0; border-top: 5px solid var(--teal); }
.variant-gallery > figure:nth-child(2) { border-top-color: var(--coral); }
.landscape-stack {
  width: 100%;
  max-width: 520px;
  display: grid;
  gap: 18px;
  justify-self: center;
}
.landscape-stack figure:first-child { border-top-color: var(--gold); }
.landscape-stack figure:last-child { border-top-color: var(--violet); }
.variant-gallery figcaption {
  margin: 0;
  padding: 16px 18px 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--rule);
}
.variant-gallery figcaption strong { color: var(--navy); }
.variant-gallery figcaption span { color: var(--ink-soft); }
.case-heading { max-width: 850px; margin: 96px 0 32px; }
.case-heading h3 { margin: 0; color: var(--navy); font-family: var(--display); font-size: 34px; line-height: 1.18; }
.poster-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.poster-grid figure { border: 1px solid var(--rule); }
.poster-grid .poster-featured { grid-column: 1 / -1; }
.poster-grid figcaption { margin: 0; padding: 12px 15px; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.comparison-stage { margin: 70px 0 0; }
.comparison-stage .image-zoom { border: 1px solid var(--rule); background: #fff; }

.template-band { background: var(--paper-bright); }
.template-layout { display: grid; grid-template-columns: 0.8fr 1.5fr; gap: 80px; align-items: center; }
.template-copy > p:not(.section-index) { margin: 26px 0 0; color: var(--ink-soft); }
.template-facts {
  margin: 42px 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule-dark);
  border-bottom: 1px solid var(--rule-dark);
}
.template-facts div { padding: 18px 12px; }
.template-facts div + div { border-left: 1px solid var(--rule); }
.template-facts dt { color: var(--navy); font-family: var(--display); font-size: 32px; line-height: 1; }
.template-facts dd { margin: 7px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.35; }
.control-row { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 7px; }
.control-row span { padding: 6px 9px; border: 1px solid var(--rule-dark); color: var(--navy); font-family: var(--mono); font-size: 10px; text-transform: uppercase; }
.template-figure { margin: 0; }

.benchmark-band { background: #f5f1e8; }
.benchmark-layout { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 64px; align-items: center; }
.benchmark-layout figure { margin: 0; }
.metric-list { border-top: 1px solid var(--rule-dark); }
.metric-list article { padding: 20px 0; display: flex; gap: 16px; border-bottom: 1px solid var(--rule-dark); }
.metric-icon { flex: 0 0 34px; height: 34px; display: grid; place-items: center; color: #fff; background: var(--teal); }
.metric-list article:nth-child(2) .metric-icon { background: var(--coral); }
.metric-list article:nth-child(3) .metric-icon { background: var(--violet); }
.metric-list article:nth-child(4) .metric-icon { color: var(--navy); background: var(--gold); }
.metric-list h3 { margin: 0 0 4px; color: var(--navy); font-size: 16px; }
.metric-list p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.dataset-breakdown {
  margin-top: 54px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--rule-dark);
  border-bottom: 1px solid var(--rule-dark);
}
.dataset-breakdown span { padding: 16px; color: var(--ink-soft); font-size: 12px; }
.dataset-breakdown span + span { border-left: 1px solid var(--rule-dark); }
.dataset-breakdown strong { margin-right: 6px; color: var(--navy); font-size: 20px; }

.results-block {
  margin-top: 72px;
  padding-top: 54px;
  border-top: 1px solid var(--rule-dark);
}
.results-heading {
  max-width: 820px;
  margin-bottom: 28px;
}
.results-heading h3 {
  margin: 0;
  color: var(--navy-deep);
  font-family: var(--display);
  font-size: clamp(34px, 3.6vw, 52px);
  font-weight: 600;
  line-height: 1.08;
}
.results-heading > p:last-child {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
}
.results-table-wrap {
  overflow-x: auto;
  border-top: 4px solid var(--navy);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 16px 36px rgba(16, 43, 78, 0.08);
}
.results-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.results-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.results-table th,
.results-table td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--rule);
  text-align: right;
  white-space: nowrap;
}
.results-table th:first-child,
.results-table td:first-child { text-align: left; }
.results-table thead th {
  color: var(--navy);
  background: #edf1ef;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.results-table tbody th { color: var(--navy); font-weight: 700; }
.results-table tbody tr:hover { background: rgba(11, 138, 135, 0.05); }
.results-table .ours {
  color: var(--navy-deep);
  background: var(--teal-pale);
}
.results-table .ours th {
  position: relative;
  padding-left: 30px;
}
.results-table .ours th::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 50%;
  width: 5px;
  height: 24px;
  background: var(--teal);
  transform: translateY(-50%);
}
.results-table .reference { color: var(--ink-soft); background: #f8f8f5; }
.results-note {
  max-width: 980px;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.open-source-band {
  padding: 76px 0;
  color: #fff;
  background: var(--navy-deep);
}
.open-source-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 56px;
}
.open-source-band .section-index { color: #7fd8d3; }
.open-source-band h2 {
  max-width: 800px;
  margin: 0;
  color: #fff;
  font-family: var(--display);
  font-size: clamp(38px, 4.6vw, 62px);
  font-weight: 600;
  line-height: 1.04;
}
.open-source-band p:not(.section-index) {
  max-width: 760px;
  margin: 18px 0 0;
  color: #c7d2df;
  font-size: 16px;
}
.open-source-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.open-source-band .action-button {
  border-color: #d4dce6;
  color: #fff;
  background: transparent;
}
.open-source-band .action-button:hover { color: var(--navy-deep); background: #fff; }
.open-source-band .action-primary { border-color: var(--teal); background: var(--teal); }

.site-footer { padding: 36px 0; color: #6a7582; background: #eef0ed; font-size: 12px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-inner > div { display: flex; align-items: baseline; gap: 12px; }
.footer-inner strong { color: var(--navy); font-family: var(--display); font-size: 20px; }
.footer-inner p { margin: 0; }

.image-dialog {
  width: min(96vw, 1640px);
  max-width: none;
  padding: 46px 18px 18px;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: 0 30px 100px rgba(0,0,0,0.35);
}
.image-dialog::backdrop { background: rgba(6, 18, 34, 0.84); }
.image-dialog img { max-height: 86vh; margin: 0 auto; object-fit: contain; }
.dialog-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: 0;
  color: var(--navy);
  background: transparent;
  cursor: pointer;
}
.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--navy);
  color: #fff;
  background: var(--navy);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

.reveal { opacity: 1; transform: none; }

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

@media (max-width: 980px) {
  :root { --shell: min(100% - 32px, 820px); }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: 70px;
    right: 16px;
    width: 220px;
    padding: 12px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border: 1px solid var(--rule);
    background: var(--paper-bright);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px; }
  .project-hero { min-height: 0; padding-top: 135px; }
  .hero-title-lockup { grid-template-columns: 108px minmax(0, 1fr); gap: 24px; }
  .hero-logo { width: 108px; height: 108px; }
  .hero-project-name { font-size: 82px; }
  .hero-paper-title { margin-top: 14px; font-size: 38px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-stats div:nth-child(3) { border-left: 0; border-top: 1px solid var(--rule-dark); }
  .hero-stats div:nth-child(4) { border-top: 1px solid var(--rule-dark); }
  .section-band { padding: 84px 0; }
  .abstract-grid, .teaser-layout, .template-layout, .benchmark-layout { grid-template-columns: 1fr; gap: 44px; }
  .contribution-strip, .method-steps { grid-template-columns: repeat(2, 1fr); }
  .contribution-strip article:nth-child(3) { border-left: 0; border-top: 1px solid var(--rule-dark); }
  .method-steps article:nth-child(3) { padding-left: 0; border-left: 0; }
  .variant-gallery { grid-template-columns: 1fr 1fr; }
  .variant-gallery .landscape-stack { grid-column: 1 / -1; max-width: 620px; }
  .dataset-breakdown { grid-template-columns: repeat(3, 1fr); }
  .dataset-breakdown span:nth-child(4) { border-left: 0; border-top: 1px solid var(--rule-dark); }
  .dataset-breakdown span:nth-child(5) { border-top: 1px solid var(--rule-dark); }
  .open-source-inner { grid-template-columns: 1fr; align-items: start; gap: 34px; }
  .open-source-actions { justify-content: flex-start; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .nav-inner { height: 62px; }
  .nav-links { top: 62px; }
  .project-hero { padding: 112px 18px 38px; background-position: 48% center; }
  .hero-title-lockup { grid-template-columns: 1fr; justify-items: center; gap: 15px; text-align: center; }
  .hero-logo { width: 96px; height: 96px; }
  .hero-project-name { font-size: 50px; line-height: 0.9; }
  .hero-paper-title { margin-top: 14px; font-size: 28px; line-height: 1.08; }
  .hero-acronym { gap: 6px 14px; font-size: 11px; }
  .hero-acronym strong { font-size: 15px; }
  .hero-lede { font-size: 17px; }
  .hero-stats { margin-top: 48px; }
  .hero-stats div { padding: 14px 10px; }
  .hero-stats strong { font-size: 25px; }
  .hero-stats span { font-size: 10px; }
  .section-band { padding: 66px 0; }
  .section-heading { margin-bottom: 34px; }
  .section-heading h2, .template-copy h2 { font-size: 40px; }
  .abstract-grid { gap: 24px; }
  .lead-paragraph { font-size: 23px; }
  .contribution-strip, .method-steps, .poster-grid { grid-template-columns: 1fr; }
  .poster-grid .poster-featured { grid-column: auto; }
  .variant-gallery { grid-template-columns: 1fr; }
  .variant-gallery .landscape-stack { grid-column: auto; max-width: none; }
  .variant-gallery .portrait-balanced { width: min(100%, 330px); justify-self: center; }
  .contribution-strip article + article { border-left: 0; border-top: 1px solid var(--rule-dark); }
  .method-steps article, .method-steps article + article { padding: 22px 0; border-left: 0; border-bottom: 1px solid var(--rule); }
  .case-heading { margin-top: 68px; }
  .case-heading h3 { font-size: 28px; }
  .template-facts { grid-template-columns: 1fr; }
  .template-facts div + div { border-left: 0; border-top: 1px solid var(--rule); }
  .dataset-breakdown { grid-template-columns: repeat(2, 1fr); }
  .dataset-breakdown span:nth-child(3), .dataset-breakdown span:nth-child(5) { border-left: 0; border-top: 1px solid var(--rule-dark); }
  .dataset-breakdown span:nth-child(4) { border-left: 1px solid var(--rule-dark); }
  .results-block { margin-top: 56px; padding-top: 42px; }
  .results-table th, .results-table td { padding: 13px 14px; }
  .open-source-band { padding: 64px 0; }
  .open-source-actions { flex-direction: column; align-items: stretch; }
  .open-source-actions .action-button { justify-content: center; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
