:root {
  --bg: #f8fafc;
  --ink: #0f172a;
  --muted: #475569;
  --card: #ffffff;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --soft: #dbeafe;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  --header-height: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: clip;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #e0f2fe 0, transparent 34rem), var(--bg);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  text-decoration: none;
  font-weight: 700;
}

.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(248, 250, 252, 0.92);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  min-height: var(--header-height);
}

.nav-start {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.group-logo-link {
  display: block;
  flex-shrink: 0;
  text-decoration: none;
}

.group-logo {
  width: clamp(110px, 18vw, 160px);
  height: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
  min-width: 0;
}

.brand-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--ink);
  color: white;
  letter-spacing: -0.04em;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.95rem;
  color: var(--muted);
}

.nav-links a {
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a:hover { color: var(--ink); }

.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  padding: clamp(48px, 8vw, 90px) 0 clamp(40px, 6vw, 56px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  font-size: clamp(0.72rem, 1.8vw, 0.78rem);
  font-weight: 800;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0;
  font-size: clamp(1.85rem, 5.5vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
}

h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

h3 { margin: 0 0 8px; font-size: 1.12rem; }

.lead {
  margin: clamp(16px, 3vw, 28px) 0 0;
  max-width: 760px;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--muted);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(20px, 3vw, 32px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.06);
}

.button.primary { background: var(--accent); color: white; border-color: var(--accent); }
.button:hover { transform: translateY(-1px); }

.hero-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: clamp(18px, 3vw, 24px);
  box-shadow: var(--shadow);
}

.metric { padding: 18px 0; border-bottom: 1px solid var(--line); }
.metric:last-child { border-bottom: 0; }
.metric strong {
  display: block;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1;
  letter-spacing: -0.06em;
}
.metric span { display: block; margin-top: 8px; color: var(--muted); font-size: 0.95rem; }

.paper-info {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.paper-info > div,
.affiliation-card,
.card,
.download-card,
.citation-box,
pre {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(18px, 3vw, 24px);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.05);
}

.affiliation-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.affiliation-logo-link { display: inline-block; width: fit-content; }

.affiliation-logo {
  width: min(220px, 100%);
  height: auto;
}

.affiliation-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.affiliation-text a { color: var(--accent); font-weight: 700; text-decoration: none; }
.affiliation-text a:hover { text-decoration: underline; }

.paper-info h2 { font-size: 1rem; letter-spacing: 0; margin-bottom: 6px; }
.paper-info p { margin: 0; color: var(--muted); }
.paper-info a { color: var(--accent); font-weight: 600; text-decoration: none; }
.paper-info a:hover { text-decoration: underline; }

.section { padding: clamp(48px, 8vw, 70px) 0; }
.section-heading { max-width: 680px; }
.prose { max-width: 880px; font-size: clamp(1rem, 2vw, 1.08rem); color: var(--muted); }

.dataset-section,
.citation-section {
  background: rgba(219, 234, 254, 0.45);
  border-block: 1px solid rgba(191, 219, 254, 0.8);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 32px);
  align-items: start;
}

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

.dataset-layout {
  display: grid;
  gap: clamp(24px, 4vw, 36px);
}

.download-card { display: grid; gap: 12px; }

.download-card--full {
  width: 100%;
}

.download-card--full > h3 {
  margin: 0;
  font-size: 1.12rem;
}

.download-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.dataset-about {
  display: grid;
  gap: 18px;
}

.dataset-about-title {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.cards--about {
  margin-top: 0;
}

.card h4 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.download-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 700;
}

.download-link::after { content: "→"; flex-shrink: 0; }
.download-link.disabled { opacity: 0.55; pointer-events: none; }

.fineprint { margin: 8px 0 0; color: var(--muted); font-size: 0.93rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 28px;
}

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

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

.result-item {
  display: flex;
  gap: 18px;
  padding: clamp(16px, 3vw, 22px);
  border-radius: 24px;
  background: white;
  border: 1px solid var(--line);
}

.result-item span { color: var(--accent); font-weight: 900; flex-shrink: 0; }
.result-item p { margin: 0; color: var(--muted); }

pre {
  overflow-x: auto;
  margin: 24px 0 0;
  color: #1e293b;
  -webkit-overflow-scrolling: touch;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(0.78rem, 2vw, 0.92rem);
}

.citation-layout {
  display: grid;
  gap: clamp(18px, 3vw, 24px);
}

.citation-intro {
  max-width: none;
}

.citation-intro .muted {
  margin: 12px 0 0;
  max-width: 72ch;
}

.citation-box {
  width: 100%;
  min-width: 0;
}

.citation-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.citation-box pre {
  margin: 0;
  clear: both;
}

.copy-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  background: var(--ink);
  color: white;
  cursor: pointer;
  white-space: nowrap;
}

.footer {
  padding: clamp(24px, 4vw, 28px) 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
}

.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(12px, 3vw, 24px);
}

.footer-logo-link { display: block; flex-shrink: 0; }

.footer-logo {
  width: clamp(100px, 22vw, 140px);
  height: auto;
  opacity: 0.92;
}

.footer p { margin: 0; font-size: 0.95rem; }
.footer a { text-decoration: none; font-weight: 700; color: var(--accent); }
.footer-top { color: var(--ink); white-space: nowrap; }

/* Mobile navigation */
body.nav-open { overflow: hidden; }

@media (max-width: 900px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    inset: var(--header-height) 0 0 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 16px 24px;
    background: rgba(248, 250, 252, 0.98);
    border-top: 1px solid var(--line);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    overflow-y: auto;
  }

  .nav-links a {
    padding: 14px 12px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
  }

  .nav-links a:hover { background: var(--soft); }

  body.nav-open .nav-links {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.nav-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  body.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }

  body.nav-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .paper-info { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .grid-2,
  .cards,
  .result-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .container { width: min(1120px, calc(100% - 24px)); }

  .nav-start { gap: 10px; }

  .brand-name { display: none; }

  .cta-row .button {
    flex: 1 1 100%;
    width: 100%;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }

  .footer-logo-link { margin: 0 auto; }

  .citation-toolbar {
    justify-content: stretch;
  }

  .copy-button {
    width: 100%;
  }

  .citation-intro .muted {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .group-logo { width: 96px; }
  .brand-mark { width: 32px; height: 32px; font-size: 0.85rem; }
}

@media (min-width: 901px) and (max-width: 1024px) {
  .paper-info { grid-template-columns: 1fr 1fr; }
  .affiliation-card { grid-column: 1 / -1; }
}
