:root {
  --ink: #10201c;
  --muted: #56645f;
  --paper: #ffffff;
  --soft: #f4f7f1;
  --tint: #edf5f2;
  --line: #d9e3dc;
  --forest: #12372f;
  --green: #2f7d58;
  --blue: #366f8a;
  --gold: #c78a2e;
  --coral: #b75745;
  --shadow: 0 16px 40px rgba(16, 32, 28, 0.12);
  --max: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

section[id],
.heatmap-home[id] {
  scroll-margin-top: 88px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
}

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

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 100;
  transform: translateY(-160%);
  background: var(--paper);
  color: var(--forest);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--forest);
  font-weight: 800;
  text-decoration: none;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(16, 32, 28, 0.14));
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.site-nav a {
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--green);
}

.hero {
  padding: 58px 24px;
  color: #ffffff;
  background: var(--forest);
}

.hero-inner {
  max-width: var(--max);
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(440px, 0.78fr);
  gap: 58px;
  align-items: center;
  margin: 0 auto;
}

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

.hero-title-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hero-logo {
  width: clamp(72px, 7vw, 98px);
  height: clamp(72px, 7vw, 98px);
  object-fit: contain;
  filter: drop-shadow(0 18px 32px rgba(0, 0, 0, 0.28));
}

.hero h1 {
  margin: 0;
  font-size: clamp(60px, 6.4vw, 86px);
  line-height: 0.95;
  font-weight: 850;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 650px;
  margin: 24px 0 0;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
}

.hero-copy {
  max-width: 640px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 17px;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.button-primary {
  color: var(--forest);
  background: #ffffff;
}

.button-primary:hover,
.button-primary:focus-visible {
  background: #eff8f3;
}

.button-secondary {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.12);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
}

.button-dark {
  color: #ffffff;
  background: var(--forest);
}

.button-dark:hover,
.button-dark:focus-visible {
  background: var(--green);
}

.paper-spotlight {
  min-width: 0;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.22);
}

.paper-spotlight .section-label {
  margin-bottom: 10px;
}

.paper-summary {
  min-width: 0;
}

.publication-title {
  max-width: none;
  color: var(--forest);
  font-size: 34px;
  line-height: 1.04;
}

.publication-recognition {
  margin: 10px 0 0;
  color: var(--green);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.paper-title-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 13px;
  align-items: start;
  margin-top: 18px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.paper-title-copy {
  min-width: 0;
}

.paper-title-copy span {
  display: block;
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.paper-title-copy strong {
  display: block;
  margin-top: 5px;
  color: var(--forest);
  font-size: 16px;
  line-height: 1.28;
}

.status-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--forest);
  background: #ffffff;
}

.status-icon svg {
  width: 27px;
  height: 27px;
}

.publication-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--forest);
  background: var(--paper);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.publication-link:hover,
.publication-link:focus-visible {
  border-color: var(--green);
  color: var(--green);
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.stat {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 36px;
  background: var(--paper);
}

.stat strong {
  color: var(--forest);
  font-size: 34px;
  line-height: 1;
}

.stat span {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.section {
  padding: 88px 24px;
}

.section-light {
  background: var(--soft);
}

.section-white {
  background: var(--paper);
}

.section-tint {
  background: var(--tint);
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.78fr);
  gap: 56px;
  align-items: center;
}

.section-label {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  max-width: 850px;
  font-size: 42px;
  line-height: 1.08;
  font-weight: 820;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.section-copy p:not(.section-label),
.section-heading p:not(.section-label) {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.section-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 42px;
}

.section-heading.align-left {
  align-items: flex-start;
  text-align: left;
}

.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.link-list a,
.resource-list a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--forest);
  background: var(--paper);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.link-list a:hover,
.link-list a:focus-visible,
.resource-list a:hover,
.resource-list a:focus-visible {
  border-color: var(--green);
  color: var(--green);
}

.schema-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.schema-row {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.schema-row:last-child {
  border-bottom: 0;
}

.schema-row span:first-child {
  color: var(--forest);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 800;
}

.schema-row span:last-child {
  color: var(--muted);
  font-size: 14px;
}

.featured-figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.featured-figure img {
  width: 100%;
  max-height: 720px;
  object-fit: contain;
  background: #ffffff;
}

figcaption {
  padding: 14px 16px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.figure-explorer {
  margin-top: 32px;
}

.figure-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.figure-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--paper);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.figure-button:hover,
.figure-button:focus-visible {
  border-color: var(--green);
  color: var(--green);
}

.figure-button.is-active {
  border-color: var(--forest);
  color: #ffffff;
  background: var(--forest);
}

.figure-stage {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
}

.figure-stage img {
  width: 100%;
  max-height: 760px;
  object-fit: contain;
  background: #ffffff;
}

.heatmap-home {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(420px, 1fr);
  gap: 28px;
  align-items: stretch;
  margin-top: 32px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.heatmap-home-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
}

.heatmap-home-copy h3 {
  max-width: 560px;
  font-size: 30px;
  line-height: 1.12;
}

.heatmap-home-copy p:not(.section-label) {
  max-width: 580px;
  margin: 18px 0 0;
  color: var(--muted);
}

.heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 24px;
}

.heatmap-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--paper);
  font-size: 13px;
  font-weight: 800;
}

.heatmap-legend i {
  width: 11px;
  height: 11px;
  border: 1px solid rgba(16, 32, 28, 0.18);
  border-radius: 2px;
}

.key-correct {
  background: #2ecc71;
}

.key-wrong {
  background: #e74c3c;
}

.key-invalid {
  background: #f1c40f;
}

.key-unsure {
  background: #3498db;
}

.key-missing {
  background: #ffffff;
}

.heatmap-preview {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 380px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
}

.heatmap-preview:hover,
.heatmap-preview:focus-visible {
  border-color: var(--green);
}

.heatmap-preview-top,
.heatmap-preview-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.heatmap-preview-top {
  border-bottom: 1px solid var(--line);
}

.heatmap-preview-top strong {
  color: var(--forest);
}

.heatmap-preview-bottom {
  border-top: 1px solid var(--line);
}

.heatmap-preview-grid {
  min-height: 300px;
  background:
    linear-gradient(90deg, rgba(16, 32, 28, 0.13) 1px, transparent 1px) 0 0 / 18px 100%,
    linear-gradient(0deg, rgba(16, 32, 28, 0.11) 1px, transparent 1px) 0 0 / 100% 17px,
    linear-gradient(135deg, rgba(231, 76, 60, 0.95) 0 15%, rgba(255, 255, 255, 0.94) 15% 24%, rgba(52, 152, 219, 0.95) 24% 38%, rgba(241, 196, 15, 0.92) 38% 49%, rgba(46, 204, 113, 0.95) 49% 100%),
    repeating-linear-gradient(90deg, rgba(46, 204, 113, 0.72) 0 26px, rgba(231, 76, 60, 0.7) 26px 43px, rgba(255, 255, 255, 0.74) 43px 55px, rgba(52, 152, 219, 0.7) 55px 69px, rgba(241, 196, 15, 0.72) 69px 78px);
  background-blend-mode: normal, normal, multiply, normal;
}

.citation-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.paper-spotlight .citation-panel {
  margin-top: 12px;
  padding: 14px;
  background: #ffffff;
}

.citation-panel-top .citation-code {
  max-height: 168px;
}

.citation-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.citation-panel h3 {
  color: var(--forest);
}

.copy-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--forest);
  background: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.copy-button:hover,
.copy-button:focus-visible,
.copy-button.is-copied {
  border-color: var(--green);
  color: var(--green);
}

.citation-panel pre {
  margin: 16px 0 0;
  overflow: hidden;
}

.citation-code {
  display: block;
  max-height: 340px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #eefbf6;
  background: #102d27;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.5;
  overflow: auto;
  white-space: pre;
}

.resources-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.7fr);
  gap: 48px;
  align-items: start;
}

.resource-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--forest);
}

.site-footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
}

.site-footer a {
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
  }

  .site-nav {
    width: 100%;
    gap: 0;
    justify-content: space-between;
  }

  .hero {
    min-height: auto;
    padding: 56px 20px;
  }

  .hero-inner,
  .stats-band,
  .two-column,
  .heatmap-home,
  .resources-layout {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 58px;
  }

  .hero-logo {
    width: 74px;
    height: 74px;
  }

  .hero-subtitle {
    font-size: 22px;
  }

  .heatmap-home {
    padding: 22px;
  }

  .publication-link {
    width: 100%;
  }

  .publication-title {
    font-size: 30px;
  }

  .stat {
    min-height: 110px;
  }
}

@media (max-width: 600px) {
  .site-nav {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 14px 18px;
    font-size: 13px;
  }

  .hero-content {
    width: auto;
    margin: 0;
    padding: 0;
  }

  .hero {
    padding: 48px 16px;
  }

  .hero h1 {
    font-size: 46px;
  }

  .hero-title-lockup {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .hero-logo {
    width: 64px;
    height: 64px;
  }

  .hero-subtitle {
    font-size: 20px;
  }

  .hero-copy {
    font-size: 16px;
  }

  .hero-actions,
  .link-list,
  .heatmap-legend {
    flex-direction: column;
    align-items: stretch;
  }

  .button,
  .heatmap-legend span,
  .link-list a {
    width: 100%;
  }

  .paper-spotlight {
    padding: 16px;
  }

  .citation-panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .copy-button {
    width: 100%;
  }

  .publication-title {
    font-size: 28px;
  }

  .paper-title-card {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 64px 16px;
  }

  h2 {
    font-size: 32px;
  }

  .schema-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .heatmap-home {
    padding: 16px;
  }

  .heatmap-home-copy h3 {
    font-size: 25px;
  }

  .heatmap-preview {
    min-height: 300px;
  }

  .heatmap-preview-top,
  .heatmap-preview-bottom {
    flex-direction: column;
    gap: 4px;
  }

  .site-footer {
    flex-direction: column;
    padding: 24px 20px;
  }
}

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