:root {
  --ink: #172235;
  --muted: #5d6878;
  --blue: #174b90;
  --blue-deep: #0c315f;
  --gold: #c68a2e;
  --gold-soft: #f5ead8;
  --line: #dce2e8;
  --white: #ffffff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 4%, rgba(198, 138, 46, 0.09), transparent 24rem),
    linear-gradient(180deg, #fbfaf7 0%, #ffffff 42rem);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(198, 138, 46, 0.55);
  outline-offset: 4px;
}

section, figure { scroll-margin-top: 96px; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--blue-deep);
  color: white;
  font-size: 0.82rem;
  font-weight: 700;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.section-shell {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  background: rgba(251, 250, 247, 0.86);
  backdrop-filter: blur(18px);
}

.site-nav {
  width: min(1180px, calc(100% - 40px));
  height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid rgba(23, 34, 53, 0.1);
}

.wordmark {
  justify-self: start;
  font-size: 1.03rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.wordmark span { color: var(--gold); }

.nav-links {
  display: flex;
  gap: 27px;
  color: #556274;
  font-size: 0.78rem;
  font-weight: 700;
}

.nav-links a,
.nav-paper { transition: color 180ms ease; }

.nav-links a:hover,
.nav-paper:hover { color: var(--blue); }

.nav-paper {
  justify-self: end;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.hero {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 86px 0 60px;
  text-align: center;
}

.hero h1 {
  max-width: 1360px;
  margin: 0 auto;
  font-family: "Manrope", "Inter", "Segoe UI", sans-serif;
  font-size: clamp(2.35rem, 4.35vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.052em;
  line-height: 1.06;
}

.hero h1 .title-mark { color: var(--blue); }

.hero h1 .title-main {
  display: block;
  white-space: nowrap;
}

.hero h1 .title-tail {
  max-width: none;
  margin: 17px auto 0;
  display: block;
  color: #41516a;
  font-size: 0.42em;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.22;
  white-space: nowrap;
}

.authors {
  margin: 32px auto 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px 22px;
  color: #26364b;
  font-size: 1.08rem;
  font-weight: 600;
}

.affiliations {
  margin: 14px 0 0;
  color: #6e7988;
  font-size: 0.95rem;
  font-weight: 500;
}

.hero-actions {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  min-width: 143px;
  padding: 13px 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--blue);
  border-radius: 999px;
  font-size: 0.87rem;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(23, 75, 144, 0.14);
}

.button-primary { background: var(--blue); color: white; }
.button-primary:hover { background: var(--blue-deep); }
.button-secondary { background: rgba(255, 255, 255, 0.74); color: var(--blue); }

.teaser-section {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.figure-frame {
  overflow: hidden;
  padding: clamp(10px, 1.7vw, 21px);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 28px 70px rgba(28, 43, 67, 0.1);
}

.figure-frame img { width: 100%; height: auto; display: block; }
.teaser-frame img { aspect-ratio: 16 / 9; object-fit: contain; }

.figure-caption {
  max-width: 1200px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  text-align: center;
  white-space: nowrap;
}

.overview {
  margin-top: 138px;
  display: block;
}

.section-index {
  margin: 0 0 20px;
  color: var(--gold);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-heading h2,
.citation-copy h2 {
  margin: 0;
  font-family: "Manrope", "Inter", "Segoe UI", sans-serif;
  font-size: clamp(2rem, 3.55vw, 3.35rem);
  font-weight: 700;
  letter-spacing: -0.042em;
  line-height: 1.12;
}

.section-heading h2 em { color: var(--blue); font-style: italic; }
.overview-heading {
  margin-bottom: 30px;
  text-align: left;
}

.overview-copy { padding-top: 0; }

.contribution-list {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  list-style: none;
}

.contribution-list li {
  padding: 28px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfd;
}

.contribution-list li + li { padding-top: 28px; }

.contribution-list li > span {
  padding-top: 3px;
  color: var(--gold);
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.contribution-list h3 {
  margin: 0 0 8px;
  font-family: "Manrope", "Inter", "Segoe UI", sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.contribution-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.68;
}

.overview-copy .previous-work {
  margin: 28px 0 0;
  padding: 18px 20px;
  border-left: 3px solid var(--gold);
  background: var(--gold-soft);
  color: #695638;
  font-size: 0.9rem;
  line-height: 1.65;
}

.previous-work a {
  width: fit-content;
  margin-top: 10px;
  display: block;
  color: var(--blue);
  font-weight: 700;
}

.compact-heading {
  max-width: 800px;
  margin: 0 auto 42px;
  text-align: center;
}

.compact-heading .section-index { margin-bottom: 16px; }

.section-heading-only { margin-bottom: 32px; }
.section-heading-only .section-index { margin-bottom: 0; }

.section-intro {
  max-width: 680px;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.video-section { margin-top: 136px; }

.video-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #061a31;
  border: 1px solid #223d5d;
  border-radius: 22px;
  box-shadow: 0 34px 80px rgba(12, 49, 95, 0.22);
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.interactive-section { margin-top: 144px; }

.interactive-heading {
  max-width: 1180px;
}

.interactive-heading h2 {
  max-width: none;
  white-space: nowrap;
}

.interactive-heading .section-intro {
  max-width: 780px;
  white-space: normal;
}

.asset-viewer {
  --viewer-progress: 8%;
  overflow: hidden;
  background: #081e38;
  border: 1px solid rgba(92, 139, 188, 0.55);
  border-radius: 24px;
  box-shadow: 0 35px 85px rgba(12, 49, 95, 0.2);
  color: white;
}

.viewer-controlbar {
  position: relative;
  z-index: 2;
  min-height: 74px;
  padding: 15px 19px;
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(7, 28, 53, 0.94);
}

.viewer-objectbar { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.viewer-lightbar { border-top: 1px solid rgba(255, 255, 255, 0.1); }

.viewer-control-label {
  flex: 0 0 auto;
  width: 92px;
  margin: 0;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.viewer-choices {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.viewer-choice,
.viewer-actions button,
.viewer-error button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.68);
  cursor: pointer;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-weight: 700;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease,
    transform 160ms ease;
}

.viewer-choice {
  min-height: 36px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.045);
  border-radius: 999px;
  font-size: 0.76rem;
  white-space: nowrap;
}

.viewer-choice:hover,
.viewer-actions button:hover,
.viewer-error button:hover {
  border-color: rgba(255, 255, 255, 0.34);
  color: white;
}

.viewer-choice.is-active {
  background: white;
  border-color: white;
  color: #0d315b;
}

.viewer-choice:disabled { cursor: wait; opacity: 0.58; }

.light-swatch {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
  box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.28);
}

.swatch-original { background: linear-gradient(135deg, #203b5e, #e2a45d); }
.swatch-fireplace { background: linear-gradient(135deg, #3b1d18, #f4a43f 70%, #fff0bc); }
.swatch-forest { background: linear-gradient(135deg, #163f35, #6f9f63 58%, #d8c88d); }
.swatch-night { background: linear-gradient(135deg, #07152f, #294c8f 65%, #d4dcff); }
.swatch-snow { background: linear-gradient(135deg, #7d9cb1, #eaf5fa 65%, #ffffff); }
.swatch-sunset { background: linear-gradient(135deg, #40234b, #db704b 58%, #ffd27d); }
.swatch-gray { background: linear-gradient(135deg, #727b87, #c4c9cf); }

.viewer-stage {
  position: relative;
  height: clamp(460px, 56vw, 650px);
  min-height: 460px;
  overflow: hidden;
  background-color: #0b294b;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    radial-gradient(circle at 50% 48%, rgba(54, 105, 159, 0.56), transparent 40%);
  background-size: 38px 38px, 38px 38px, auto;
}

#viewer-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
  opacity: 0;
  transition: opacity 280ms ease;
}

#viewer-canvas:active { cursor: grabbing; }
.asset-viewer[data-viewer-state="ready"] #viewer-canvas { opacity: 1; }

.viewer-badge {
  position: absolute;
  top: 17px;
  left: 18px;
  padding: 7px 10px;
  background: rgba(3, 18, 35, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.viewer-actions {
  position: absolute;
  top: 15px;
  right: 16px;
  display: flex;
  gap: 7px;
}

.viewer-actions button {
  min-height: 34px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(3, 18, 35, 0.64);
  border-radius: 9px;
  backdrop-filter: blur(10px);
  font-size: 0.68rem;
}

.viewer-actions button[aria-pressed="true"] {
  background: rgba(198, 138, 46, 0.84);
  border-color: rgba(255, 226, 181, 0.46);
  color: white;
}

.viewer-actions span { font-size: 1rem; line-height: 1; }

.viewer-status,
.viewer-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(7, 27, 51, 0.42);
  text-align: center;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.asset-viewer[data-viewer-state="ready"] .viewer-status {
  visibility: hidden;
  opacity: 0;
}

.viewer-status p,
.viewer-error p {
  margin: 17px 20px 12px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
  font-weight: 650;
}

.viewer-spinner {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: viewer-spin 900ms linear infinite;
}

.viewer-progress {
  overflow: hidden;
  width: min(230px, 58vw);
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.viewer-progress span {
  width: var(--viewer-progress);
  height: 100%;
  display: block;
  background: linear-gradient(90deg, var(--gold), #f5d496);
  border-radius: inherit;
  transition: width 180ms ease;
}

.viewer-error[hidden] { display: none; }
.viewer-error { z-index: 4; background: rgba(7, 27, 51, 0.9); }

.viewer-error button {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.viewer-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  margin: 0;
  padding: 7px 11px;
  background: rgba(3, 18, 35, 0.55);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.66rem;
  font-weight: 600;
  transform: translateX(-50%);
  white-space: nowrap;
}

.viewer-hint span { margin: 0 5px; color: var(--gold); }

.viewer-noscript {
  margin: 0;
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.asset-viewer:fullscreen {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
}

.asset-viewer:fullscreen .viewer-stage {
  height: calc(100vh - 148px);
}

@keyframes viewer-spin { to { transform: rotate(360deg); } }

.method-section { margin-top: 146px; }
.method-figure, .result-figure { margin: 0; }

.scrollable-figure {
  overflow-x: auto;
  scrollbar-color: rgba(23, 75, 144, 0.35) transparent;
}

.stage-grid {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.stage-grid article {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfd;
}

.stage-grid article:first-child { border-top: 3px solid var(--gold); }
.stage-grid article:last-child { border-top: 3px solid var(--blue); }

.stage-grid span {
  color: var(--gold);
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stage-grid article:last-child span { color: var(--blue); }

.stage-grid h3 {
  margin: 12px 0 11px;
  font-family: "Manrope", "Inter", "Segoe UI", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
}

.stage-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.68;
}

.results-section {
  margin-top: 150px;
  padding: 128px 0 132px;
  background: #f2f5f8;
  border-block: 1px solid #e1e7ec;
}

.results-heading { margin-bottom: 52px; }
.result-block + .result-block { margin-top: 112px; }
.result-copy { max-width: 760px; margin-bottom: 30px; }

.result-label {
  margin: 0 0 16px;
  color: var(--ink);
  font-family: "Manrope", "Inter", "Segoe UI", sans-serif;
  font-size: clamp(1.75rem, 3vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.18;
  text-transform: none;
}

.result-copy > p:last-child {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.result-figure .figure-frame {
  padding: 14px;
  box-shadow: 0 24px 60px rgba(28, 43, 67, 0.08);
}

.result-figure figcaption {
  margin-top: 13px;
  color: #7a8491;
  font-size: 0.78rem;
  text-align: center;
}

.indirect-block .result-label { color: var(--ink); }

.citation-section {
  margin-top: 140px;
  margin-bottom: 138px;
  display: grid;
  grid-template-columns: minmax(250px, 0.65fr) minmax(0, 1.35fr);
  gap: clamp(40px, 8vw, 110px);
  align-items: start;
}

.citation-copy p:last-child { margin: 20px 0 0; color: var(--muted); line-height: 1.7; }

.code-card {
  overflow: hidden;
  background: #0d223d;
  border: 1px solid #264362;
  border-radius: 18px;
  box-shadow: 0 25px 65px rgba(13, 34, 61, 0.18);
}

.code-toolbar {
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.74rem;
}

.code-toolbar button {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  color: white;
  cursor: pointer;
  font: inherit;
}

.code-card pre {
  overflow-x: auto;
  margin: 0;
  padding: 24px;
  color: #dce9f6;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.79rem;
  line-height: 1.7;
}

footer {
  width: min(1180px, calc(100% - 40px));
  min-height: 105px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

footer p { margin: 0; }

footer > div {
  justify-self: end;
  display: flex;
  gap: 20px;
  font-weight: 700;
}

footer > div a:hover { color: var(--blue); }

@media (max-width: 900px) {
  .site-nav { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .citation-section { grid-template-columns: 1fr; gap: 32px; }
  .overview-copy { max-width: none; padding-top: 0; }
  .hero h1 .title-main,
  .hero h1 .title-tail { white-space: normal; }
  .interactive-heading h2,
  .interactive-heading .section-intro { white-space: normal; }
  .viewer-controlbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .viewer-control-label { width: auto; }
  .viewer-choices {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }
  footer { grid-template-columns: 1fr auto; }
  footer p { display: none; }
}

@media (max-width: 700px) {
  .section-shell { width: min(100% - 28px, 1120px); }
  .site-nav { width: min(100% - 28px, 1180px); height: 62px; }
  .hero { width: min(100% - 28px, 1180px); padding: 58px 0 45px; }
  .hero h1 { font-size: clamp(2.15rem, 10.5vw, 3.45rem); }
  .hero h1 .title-tail { margin-top: 13px; font-size: 0.54em; }
  .authors { gap: 8px 15px; font-size: 0.98rem; }
  .affiliations { font-size: 0.87rem; line-height: 1.5; }
  .teaser-section { width: calc(100% - 20px); }
  .figure-frame { border-radius: 16px; }
  .teaser-frame { overflow-x: auto; }
  .teaser-frame img { width: 900px; max-width: none; }
  .figure-caption { padding: 0 12px; white-space: normal; }
  .overview, .video-section, .interactive-section, .method-section { margin-top: 94px; }
  .section-index { font-size: 1.12rem; }
  .contribution-list { grid-template-columns: 1fr; }
  .contribution-list li { padding: 24px; }
  .contribution-list li + li { padding-top: 24px; }
  .compact-heading { margin-bottom: 30px; }
  .video-frame { border-radius: 15px; }
  .asset-viewer { border-radius: 17px; }
  .viewer-controlbar { min-height: 0; padding: 13px 14px; }
  .viewer-stage { height: 470px; min-height: 470px; }
  .viewer-actions button { width: 35px; justify-content: center; font-size: 0; }
  .viewer-actions button span { font-size: 1rem; }
  .viewer-badge { top: 13px; left: 13px; }
  .viewer-hint { bottom: 11px; }
  .method-figure .scrollable-figure img { width: 1020px; max-width: none; }
  .stage-grid { grid-template-columns: 1fr; }
  .stage-grid article { padding: 24px; }
  .results-section { margin-top: 102px; padding: 88px 0; }
  .results-heading { margin-bottom: 34px; }
  .result-block + .result-block { margin-top: 82px; }
  .result-figure .scrollable-figure img { width: 1120px; max-width: none; }
  .citation-section { margin-top: 92px; margin-bottom: 92px; }
  .code-card pre { padding: 20px; font-size: 0.72rem; }
  footer { width: calc(100% - 28px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .nav-links a, .nav-paper, .viewer-choice, .viewer-actions button,
  #viewer-canvas { transition: none; }
  .viewer-spinner { animation: none; }
}
