:root {
  --ink: #172235;
  --muted: #5b6b7d;
  --soft: #eef5f3;
  --paper: #fffdf9;
  --panel: rgba(255, 255, 255, 0.78);
  --line: rgba(32, 52, 74, 0.12);
  --teal: #2e7a78;
  --teal-deep: #145f63;
  --coral: #d98762;
  --amber: #f1c56d;
  --blue: #5277b8;
  --shadow: 0 20px 60px rgba(35, 50, 72, 0.12);
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
  background:
    radial-gradient(circle at top left, rgba(82, 119, 184, 0.16), transparent 34rem),
    radial-gradient(circle at 80% 8%, rgba(241, 197, 109, 0.18), transparent 28rem),
    linear-gradient(135deg, #f7fbfb 0%, #fff8ef 52%, #f4f7ff 100%);
  min-width: 320px;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 34, 53, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 34, 53, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 70%);
  z-index: -1;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid rgba(32, 52, 74, 0.08);
  background: rgba(255, 253, 249, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(20, 95, 99, 0.18);
  border-radius: var(--radius);
  color: var(--teal-deep);
  background: linear-gradient(135deg, rgba(46, 122, 120, 0.13), rgba(241, 197, 109, 0.24));
  box-shadow: 0 10px 26px rgba(20, 95, 99, 0.1);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  padding: 8px 11px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 180ms ease, background 180ms ease;
}

.site-nav a:hover {
  color: var(--teal-deep);
  background: rgba(46, 122, 120, 0.08);
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  align-items: start;
  gap: clamp(26px, 4vw, 58px);
  padding: clamp(54px, 8vw, 94px) 0 38px;
}

.hero-copy {
  min-width: 0;
}

.hero-copy > * {
  min-width: 0;
}

.eyebrow-row,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pill {
  display: inline-block;
  max-width: 100%;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(20, 95, 99, 0.18);
  border-radius: var(--radius);
  color: var(--teal-deep);
  background: rgba(238, 245, 243, 0.86);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: normal;
  overflow-wrap: anywhere;
}

.pill-soft {
  color: #7b5732;
  border-color: rgba(217, 135, 98, 0.2);
  background: rgba(255, 247, 234, 0.88);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin: 18px 0 12px;
  font-size: clamp(4rem, 11vw, 8.8rem);
  line-height: 0.9;
  font-weight: 850;
  letter-spacing: 0;
}

.paper-title {
  max-width: 760px;
  margin-bottom: 18px;
  color: #223149;
  font-size: clamp(1.35rem, 2.6vw, 2.45rem);
  line-height: 1.08;
  font-weight: 820;
  overflow-wrap: anywhere;
}

.hero-subtitle {
  max-width: 720px;
  margin-bottom: 26px;
  color: #48596e;
  font-size: clamp(1rem, 1.5vw, 1.22rem);
  overflow-wrap: anywhere;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid rgba(32, 52, 74, 0.15);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(35, 50, 72, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
  border-color: rgba(20, 95, 99, 0.35);
  box-shadow: 0 18px 36px rgba(35, 50, 72, 0.12);
}

.button-primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--teal-deep), var(--blue));
}

.author-block {
  margin-top: 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
}

.author-block p {
  margin-bottom: 6px;
}

.author-block p:last-child {
  margin-bottom: 0;
}

.affiliation,
.author-note {
  color: var(--muted);
  font-size: 0.93rem;
}

.hero-figure {
  align-self: start;
  min-width: 0;
}

.image-frame {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(32, 52, 74, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.image-frame img {
  width: 100%;
  height: auto;
  cursor: zoom-in;
}

.hero-figure img {
  object-fit: contain;
  padding: 14px;
  background: linear-gradient(135deg, rgba(247, 251, 251, 0.9), rgba(255, 248, 239, 0.95));
}

figcaption {
  padding: 10px 14px 13px;
  color: var(--muted);
  border-top: 1px solid rgba(32, 52, 74, 0.09);
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.78);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 16px 42px rgba(35, 50, 72, 0.08);
}

.stat-card,
.method-step,
.metric-card,
.paper-table-card,
.bibtex-card {
  border: 1px solid rgba(32, 52, 74, 0.1);
  border-radius: var(--radius);
  background: var(--panel);
}

.stat-card {
  padding: 18px;
}

.stat-label,
.section-kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--teal-deep);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-bottom: 7px;
  font-size: 1.08rem;
}

.stat-card p,
.method-step p,
.metric-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(26px, 5vw, 74px);
  padding-top: 84px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3.2vw, 3.1rem);
  line-height: 1.05;
  font-weight: 850;
  letter-spacing: 0;
}

.body-copy {
  color: #3f5063;
  font-size: 1.02rem;
}

.section-copy {
  margin-top: 16px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.method-section,
.results-section,
.visual-section,
.ablation-section,
.efficiency-section,
.bibtex-section {
  padding-top: 88px;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.method-step {
  min-height: 210px;
  padding: 20px;
}

.method-step span {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  margin-bottom: 18px;
  border-radius: var(--radius);
  color: var(--teal-deep);
  background: rgba(46, 122, 120, 0.11);
  font-weight: 850;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.18rem;
  line-height: 1.25;
}

.wide-figure {
  margin-top: 18px;
}

.wide-figure img {
  background: #fff;
}

.table-scan {
  overflow-x: auto;
}

.table-scan img {
  width: max(100%, 1080px);
  max-width: none;
  background: #fff;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric-card {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(247, 251, 251, 0.72)),
    linear-gradient(135deg, rgba(46, 122, 120, 0.08), rgba(241, 197, 109, 0.1));
}

.metric-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-bottom: 2px;
  color: var(--teal-deep);
  font-size: clamp(1.65rem, 2.7vw, 2.65rem);
  line-height: 1;
}

.paper-table-card {
  margin-bottom: 18px;
  padding: 18px;
  box-shadow: 0 16px 42px rgba(35, 50, 72, 0.08);
}

.table-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.table-title h3 {
  margin: 0;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid rgba(32, 52, 74, 0.1);
  border-radius: var(--radius);
  background: #fff;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.94rem;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(32, 52, 74, 0.09);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--teal-deep);
  background: rgba(238, 245, 243, 0.9);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td:not(:first-child) {
  color: #244c5a;
  font-weight: 850;
}

tr:last-child td {
  border-bottom: 0;
}

.figure-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 16px;
  align-items: stretch;
}

.ablation-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(360px, 0.78fr);
  gap: clamp(22px, 4vw, 54px);
  align-items: center;
}

.ablation-layout .section-heading {
  margin-bottom: 0;
}

.ablation-figure img {
  width: 100%;
  height: auto;
  background: #fff;
}

.figure-grid .image-frame {
  display: flex;
  flex-direction: column;
}

.figure-grid img {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #fff;
}

.bibtex-section {
  padding-bottom: 92px;
}

.bibtex-card {
  position: relative;
  overflow: hidden;
  padding: 0;
  background: #172235;
  box-shadow: var(--shadow);
}

pre {
  margin: 0;
  overflow-x: auto;
  padding: 24px;
  color: #f7fbfb;
  font-size: 0.92rem;
  line-height: 1.6;
}

.copy-button,
.lightbox-close {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  cursor: pointer;
}

.copy-button {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 8px 11px;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 34px;
  background: rgba(15, 24, 36, 0.82);
}

.image-lightbox[aria-hidden="false"] {
  display: flex;
}

.image-lightbox img {
  max-width: min(96vw, 1500px);
  max-height: 88vh;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

.lightbox-close {
  position: fixed;
  top: 22px;
  right: 22px;
  padding: 9px 12px;
}

@media (max-width: 980px) {
  .hero,
  .two-column,
  .ablation-layout,
  .figure-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 42px;
  }

  .hero-figure img {
    min-height: 0;
  }

  .stat-grid,
  .method-grid,
  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

  @media (max-width: 680px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 18px;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .site-nav a {
    padding: 7px 8px;
  }

  .section-shell {
    width: min(1180px, calc(100% - 28px));
  }

  .hero-copy,
  .eyebrow-row,
  .button-row,
  .paper-title,
  .hero-subtitle,
  .author-block {
    width: min(100%, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
  }

  h1 {
    font-size: clamp(3.4rem, 20vw, 5.8rem);
    max-width: calc(100vw - 28px);
  }

  .paper-title {
    font-size: clamp(1.08rem, 5.8vw, 1.46rem);
    line-height: 1.14;
    overflow-wrap: anywhere;
  }

  .eyebrow-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .pill {
    width: fit-content;
    max-width: 100%;
  }

  .author-block {
    padding: 14px;
  }

  .stat-grid,
  .method-grid,
  .metric-strip {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .two-column,
  .method-section,
  .results-section,
  .visual-section,
  .ablation-section,
  .efficiency-section,
  .bibtex-section {
    padding-top: 62px;
  }

  .method-step {
    min-height: 0;
  }

  .table-title {
    display: block;
  }

  pre {
    padding: 58px 18px 20px;
    font-size: 0.82rem;
  }

  .image-lightbox {
    padding: 16px;
  }
}
