@font-face {
  font-family: "Trace Sans";
  src: url("assets/fonts/texgyreheros-regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Trace Sans";
  src: url("assets/fonts/texgyreheros-bold.otf") format("opentype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Trace Serif";
  src: url("assets/fonts/texgyretermes-regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Trace Serif";
  src: url("assets/fonts/texgyretermes-bold.otf") format("opentype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Trace Serif";
  src: url("assets/fonts/texgyretermes-italic.otf") format("opentype");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  --page: #f8f5ef;
  --page-deep: #f4efe7;
  --panel: rgba(255, 253, 249, 0.88);
  --panel-solid: #fdfaf5;
  --figure-paper: #f8f4ed;
  --figure-paper-deep: #f4eee5;
  --figure-glow: rgba(255, 255, 255, 0.18);
  --figure-line: rgba(179, 160, 136, 0.12);
  --ink: #1b1815;
  --muted: #635d55;
  --line: rgba(27, 24, 21, 0.1);
  --line-strong: rgba(27, 24, 21, 0.16);
  --rose: #f3a1a6;
  --blue: #82a5ff;
  --mint: #76cbb4;
  --amber: #f1c06f;
  --shadow: 0 22px 52px rgba(62, 49, 34, 0.08);
  --shadow-soft: 0 12px 30px rgba(62, 49, 34, 0.05);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trace Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(64rem 42rem at 8% -8%, rgba(243, 161, 166, 0.115), transparent 70%),
    radial-gradient(88rem 58rem at 112% 28%, rgba(130, 165, 255, 0.07), transparent 74%),
    radial-gradient(44rem 28rem at 76% 72%, rgba(130, 165, 255, 0.03), transparent 80%),
    radial-gradient(48rem 28rem at 48% 10%, rgba(255, 255, 255, 0.3), transparent 76%),
    linear-gradient(180deg, var(--page) 0%, var(--page-deep) 100%);
  line-height: 1.62;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(27, 24, 21, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 24, 21, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 92%);
  z-index: -1;
}

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

a {
  color: inherit;
}

button {
  appearance: none;
  font: inherit;
}

code,
pre {
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Monaco, Consolas, monospace;
}

.container {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(248, 245, 239, 0.82);
  border-bottom: 1px solid rgba(27, 24, 21, 0.06);
}

.header-inner,
.footer-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-inner {
  min-height: 4.3rem;
  justify-content: flex-start;
}

.brand,
.site-nav a,
.footer-inner a {
  text-decoration: none;
}

.brand {
  font-family: "Trace Serif", serif;
  font-size: 1.22rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.94rem;
}

.section {
  padding: 3rem 0 1.2rem;
}

.hero {
  padding-top: 2.3rem;
}

.hero-inner {
  display: grid;
  gap: 1.8rem;
}

.hero-copy {
  max-width: 920px;
}

.hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.eyebrow,
.section-kicker,
.caption-label,
.band-label,
.metric-label,
.note-index {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.35rem 0.76rem;
  border: 1px solid rgba(27, 24, 21, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  font-size: 0.78rem;
  color: var(--ink);
  text-decoration: none;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.eyebrow-primary {
  border-color: rgba(27, 24, 21, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(246, 238, 227, 0.92));
  box-shadow: 0 10px 24px rgba(62, 49, 34, 0.08);
}

.eyebrow-primary:hover,
.eyebrow-primary:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(62, 49, 34, 0.11);
}

.eyebrow.subdued {
  color: var(--muted);
}

.acronym-line {
  margin: 1rem 0 0;
  color: #8c5c61;
  font-size: 0.95rem;
}

h1,
h2,
h3,
h4 {
  line-height: 1.06;
}

h1 {
  max-width: 17ch;
  margin: 0.95rem 0 0;
  font-family: "Trace Serif", serif;
  font-size: clamp(2.25rem, 4.35vw, 4.2rem);
  letter-spacing: -0.04em;
  line-height: 0.98;
}

h1 span {
  display: block;
}

.hero-summary {
  max-width: 58ch;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.35rem;
}

.hero-actions.left {
  justify-content: flex-start;
  margin-top: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.78rem 1.16rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.button-primary {
  background: linear-gradient(135deg, #232019 0%, #3d3427 100%);
  color: #faf6ef;
  box-shadow: 0 14px 30px rgba(38, 30, 19, 0.16);
}

.button-secondary {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
}

.button:hover,
.button:focus-visible,
.copy-button:hover,
.copy-button:focus-visible,
.gallery-card:hover,
.gallery-card:focus-visible,
.site-nav a:hover,
.site-nav a:focus-visible {
  transform: translateY(-2px);
}

.author-block {
  display: grid;
  gap: 0.45rem;
  margin-top: 1.35rem;
}

.author-line {
  margin: 0;
  font-size: 1rem;
}

.author-line a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition:
    border-color 180ms ease,
    color 180ms ease;
}

.author-line a:hover,
.author-line a:focus-visible {
  color: #6c5458;
  border-color: rgba(108, 84, 88, 0.24);
}

.affiliation-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-abstract {
  max-width: 70ch;
  margin-top: 1.45rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(27, 24, 21, 0.08);
}

.hero-abstract p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.72;
}

.hero-figure,
.feature-figure,
.mini-figure {
  margin: 0;
}

.media-frame {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ratio);
  overflow: visible;
  isolation: isolate;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 20%, var(--figure-glow), transparent 62%),
    linear-gradient(180deg, var(--figure-paper) 0%, var(--figure-paper-deep) 100%);
  box-shadow: inset 0 0 0 1px var(--figure-line);
}

.media-frame img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 14px 24px rgba(62, 49, 34, 0.07)) saturate(0.96);
}

.artboard-frame {
  overflow: hidden;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.14), transparent 62%),
    linear-gradient(180deg, var(--figure-paper) 0%, var(--figure-paper-deep) 100%);
}

.artboard-frame img {
  border-radius: 0;
  clip-path: inset(0 0 1px 0 round 0);
  mix-blend-mode: multiply;
  filter: drop-shadow(0 14px 24px rgba(62, 49, 34, 0.06)) saturate(0.96);
}

.figure-caption {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.75rem;
  margin-top: 0.6rem;
  align-items: start;
}

.caption-label,
.section-kicker,
.band-label,
.metric-label,
.note-index {
  display: inline-block;
  color: #7f6569;
  font-size: 0.76rem;
}

.caption-label {
  white-space: nowrap;
}

.figure-caption p,
.band-cell p,
.overview-prose p,
.schema-item p,
.results-list,
.metric-card p,
.gallery-copy span,
.citation-line,
.contact-block a {
  color: var(--muted);
}

.figure-caption p {
  margin: 0;
}

.overview-band {
  padding-top: 0.2rem;
}

.band-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(27, 24, 21, 0.08);
  border-radius: 22px;
  background: rgba(255, 253, 249, 0.78);
  box-shadow: var(--shadow-soft);
}

.band-cell {
  padding: 1rem 1.1rem;
  border-right: 1px solid rgba(27, 24, 21, 0.08);
}

.band-cell:last-child {
  border-right: 0;
}

.band-cell p {
  margin: 0.45rem 0 0;
}

.section-heading {
  display: grid;
  gap: 0.32rem;
  margin-bottom: 1rem;
}

.section-heading h2 {
  margin: 0;
  font-family: "Trace Serif", serif;
  font-size: clamp(2.25rem, 3.5vw, 3.7rem);
  letter-spacing: -0.04em;
}

.overview-grid,
.method-grid,
.results-grid,
.citation-grid {
  display: grid;
  gap: 1.15rem;
  align-items: start;
}

.overview-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
}

.overview-prose .lead,
.citation-copy .lead {
  margin-top: 0;
}

.lead {
  font-family: "Trace Serif", serif;
  font-size: 1.42rem;
  line-height: 1.4;
}

.lead.compact {
  font-size: 1.28rem;
}

.overview-prose p + p {
  margin-top: 1rem;
}

.overview-points {
  display: grid;
  gap: 0.82rem;
  margin-top: 1rem;
}

.overview-point {
  display: grid;
  grid-template-columns: 6.2rem minmax(0, 1fr);
  gap: 0.8rem;
  padding-top: 0.72rem;
  border-top: 1px solid rgba(27, 24, 21, 0.08);
}

.overview-label {
  display: inline-block;
  padding-top: 0.08rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7f6569;
  font-size: 0.76rem;
}

.overview-point p {
  margin: 0;
}

.trace-schema {
  display: grid;
  gap: 0.78rem;
  padding: 1.16rem 1.2rem 1rem;
  border: 1px solid rgba(27, 24, 21, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 249, 0.84);
  box-shadow: var(--shadow-soft);
}

.schema-head h3 {
  margin: 0.35rem 0 0;
  font-family: "Trace Serif", serif;
  font-size: 1.38rem;
}

.schema-list {
  display: grid;
  gap: 0;
}

.schema-item {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.56rem 0 0.62rem;
  border-top: 1px solid rgba(27, 24, 21, 0.08);
}

.schema-item:first-child {
  border-top: 0;
  padding-top: 0.3rem;
}

.schema-item:last-child {
  padding-bottom: 0.34rem;
}

.schema-item > div {
  display: grid;
  gap: 0.28rem;
  padding: 0.08rem 0 0.02rem;
}

.schema-index {
  align-self: center;
  color: rgba(27, 24, 21, 0.3);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.schema-item h4 {
  margin: 0;
  font-size: 1.08rem;
}

.schema-item p {
  margin: 0;
}

.pipeline-note {
  padding-top: 0.72rem;
  border-top: 1px solid rgba(27, 24, 21, 0.08);
}

.pipeline-note p {
  margin: 0.32rem 0 0;
  font-size: 1rem;
}

.method-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}

.method-notes {
  display: grid;
  gap: 0.9rem;
}

.method-note {
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 2px solid rgba(118, 203, 180, 0.42);
}

.method-note h3 {
  margin: 0.25rem 0 0.35rem;
  font-size: 1.08rem;
}

.method-note p {
  margin: 0;
  color: var(--muted);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.8rem;
}

.metric-card {
  display: grid;
  gap: 0.55rem;
  align-content: start;
  padding: 0.88rem;
  border: 1px solid rgba(27, 24, 21, 0.08);
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.84);
  box-shadow: var(--shadow-soft);
}

.metric-card-wide {
  background:
    linear-gradient(135deg, rgba(243, 161, 166, 0.1), rgba(255, 253, 249, 0.84));
}

.metric-label {
  line-height: 1.35;
}

.metric-value {
  font-size: clamp(1.85rem, 2.6vw, 2.55rem);
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  transition:
    transform 220ms ease,
    opacity 220ms ease;
}

.metric-value.is-counting {
  opacity: 0.74;
  transform: translateY(6px) scale(0.92);
}

.metric-value.is-animated {
  opacity: 1;
  transform: none;
  animation: metric-settle 460ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.metric-card p {
  margin: 0;
}

.metric-stack {
  display: grid;
  gap: 0.25rem;
  font-size: 1rem;
}

.metric-stack strong {
  color: var(--ink);
  font-size: 1.3rem;
}

.results-grid {
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  margin-top: 1rem;
}

.results-copy {
  padding-top: 0.2rem;
}

.results-list {
  margin: 0.7rem 0 0;
  padding-left: 1.1rem;
}

.results-list li + li {
  margin-top: 0.55rem;
}

.mini-figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.9rem;
  align-items: start;
}

.gallery-card {
  display: flex;
  flex-direction: column;
  gap: 0.52rem;
  align-self: start;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.gallery-card.span-7 {
  grid-column: span 7;
}

.gallery-card.span-5 {
  grid-column: span 5;
}

.gallery-card.span-4 {
  grid-column: span 4;
}

.gallery-card.span-8 {
  grid-column: span 8;
}

.gallery-media {
  border-radius: 0;
  box-shadow: none;
}

.gallery-copy {
  display: grid;
  gap: 0.12rem;
  padding-right: 0.5rem;
}

.gallery-copy strong {
  font-size: 1rem;
}

.citation-grid {
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
}

.citation-copy {
  display: grid;
  gap: 0.95rem;
}

.citation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.5rem;
  padding-top: 0.18rem;
}

.citation-meta p {
  margin: 0.26rem 0 0;
  color: var(--muted);
}

.contact-block {
  display: grid;
  gap: 0.3rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(27, 24, 21, 0.08);
}

.contact-block a {
  text-decoration: none;
}

.citation-line {
  margin: 0;
}

.citation-reference {
  padding-top: 0.9rem;
  border-top: 1px solid rgba(27, 24, 21, 0.08);
}

.bibtex-panel {
  padding: 1.35rem;
  border: 1px solid rgba(27, 24, 21, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 249, 0.86);
  box-shadow: var(--shadow-soft);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.bibtex-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  padding: 0.18rem;
  border: 1px solid rgba(27, 24, 21, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.bibtex-tab {
  padding: 0.42rem 0.78rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.bibtex-tab.is-active {
  background: #181716;
  color: #f4efe7;
  box-shadow: 0 8px 16px rgba(27, 24, 21, 0.12);
}

.copy-button {
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(27, 24, 21, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.bibtex-panel pre {
  margin: 0;
  padding: 1.15rem;
  border-radius: 18px;
  background: #181716;
  color: #f4efe7;
  font-size: 0.92rem;
  overflow-x: auto;
}

.bibtex-snippet[hidden] {
  display: none;
}

.site-footer {
  padding: 2rem 0 3rem;
}

.footer-inner {
  justify-content: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(27, 24, 21, 0.08);
  color: var(--muted);
  text-align: center;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: rgba(18, 17, 15, 0.82);
  backdrop-filter: blur(16px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #faf6ef;
  cursor: pointer;
}

.lightbox-figure {
  width: min(92vw, 1180px);
  margin: 0;
  padding: 0.85rem;
  border-radius: 28px;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.16), transparent 58%),
    linear-gradient(180deg, var(--figure-paper) 0%, var(--figure-paper-deep) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 28px 78px rgba(18, 17, 15, 0.24);
}

.lightbox-figure img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 18px;
  background: transparent;
  mix-blend-mode: multiply;
}

.lightbox-figure figcaption {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.8rem;
  color: var(--muted);
}

.lightbox-title {
  font-size: 1.04rem;
  color: var(--ink);
}

@keyframes metric-settle {
  0% {
    opacity: 0.74;
    transform: translateY(6px) scale(0.92);
  }

  62% {
    opacity: 1;
    transform: translateY(-2px) scale(1.04);
  }

  100% {
    opacity: 1;
    transform: none;
  }
}

.has-js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 650ms ease,
    transform 650ms ease;
}

.has-js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .metric-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .overview-grid,
  .method-grid,
  .results-grid,
  .citation-grid,
  .mini-figure-grid {
    grid-template-columns: 1fr;
  }

  .citation-meta {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(100% - 1.25rem, 1180px);
  }

  .header-inner,
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .band-grid,
  .metric-strip,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .band-cell {
    border-right: 0;
    border-bottom: 1px solid rgba(27, 24, 21, 0.08);
  }

  .band-cell:last-child {
    border-bottom: 0;
  }

  .gallery-card,
  .gallery-card.span-7,
  .gallery-card.span-5,
  .gallery-card.span-4,
  .gallery-card.span-8 {
    grid-column: span 1;
  }

  .figure-caption {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .overview-point {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .panel-head,
  .panel-actions {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .has-js .reveal {
    opacity: 1;
    transform: none;
  }
}
