:root {
  --bg: #f7f8fc;
  --panel: #ffffff;
  --text: #111827;
  --muted: #5b6475;
  --line: #e3e7ef;
  --blue: #3156d4;
  --blue-dark: #1f3aa0;
  --green: #0a8c61;
  --soft-blue: #edf2ff;
  --shadow: 0 24px 70px rgba(38, 55, 99, 0.12);
  --radius: 24px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 12%, rgba(49, 86, 212, 0.12), transparent 32rem),
    radial-gradient(circle at 88% 20%, rgba(10, 140, 97, 0.10), transparent 30rem),
    linear-gradient(180deg, #f8faff 0%, var(--bg) 40%, #ffffff 100%);
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(17, 24, 39, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(17, 24, 39, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 72px;
  padding: 0 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(227, 231, 239, 0.8);
}

.brand, .nav { display: flex; align-items: center; gap: 16px; }
.brand { font-weight: 800; letter-spacing: -0.02em; }
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: 0 12px 30px rgba(49, 86, 212, 0.22);
}
.nav a {
  font-size: 14px;
  color: var(--muted);
  font-weight: 650;
}
.nav a:hover { color: var(--blue-dark); }

main { position: relative; z-index: 1; }
.section, .hero {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
}
.hero {
  min-height: calc(100vh - 72px);
  padding: 86px 0 60px;
  align-items: center;
}
.section { padding: 88px 0; }
.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  gap: 54px;
}
.compact-grid { align-items: center; }

.eyebrow {
  margin: 0 0 16px;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 900;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 24px;
  max-width: 680px;
  font-size: clamp(56px, 7vw, 96px);
  line-height: 0.92;
  letter-spacing: -0.075em;
}
h2 {
  margin-bottom: 16px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}
h3 { margin-bottom: 8px; line-height: 1.2; }
.lead {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.45;
}
.hero-actions { display: flex; gap: 14px; margin: 32px 0; flex-wrap: wrap; }
.button, .mini-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--blue-dark);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(36, 46, 89, 0.08);
}
.button { padding: 13px 20px; }
.button-primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.button:hover, .mini-button:hover { transform: translateY(-1px); }

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 26px;
}
.metric-strip div, .formula-card, .cards article, .result-highlights article, .demo-card, .resource-grid a, .bibtex-card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.metric-strip div { padding: 20px; }
.metric-strip strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.04em;
}
.metric-strip span { color: var(--muted); font-size: 13px; }

.paper-figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #fff;
  box-shadow: var(--shadow);
}
.paper-figure img { width: 100%; height: auto; }
.hero-figure { padding: 16px; }
.wide-figure { padding: 12px; }

.section-heading {
  max-width: 760px;
  margin-bottom: 34px;
}
.section-heading p:not(.eyebrow), .section p { color: var(--muted); font-size: 17px; }
.formula-card { padding: 30px; }
.formula-label, .box-label {
  display: inline-block;
  color: var(--blue);
  background: var(--soft-blue);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.formula {
  margin: 22px 0 14px;
  padding: 18px;
  overflow-x: auto;
  border-radius: 16px;
  background: #101828;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.cards, .result-highlights, .resource-grid, .split-figures, .prefix-grid {
  display: grid;
  gap: 18px;
}
.three-cards { grid-template-columns: repeat(3, 1fr); margin-top: 22px; }
.cards article { padding: 24px; }
.card-index {
  display: block;
  margin-bottom: 36px;
  color: var(--blue);
  font-weight: 900;
  letter-spacing: 0.1em;
}

.results-section { width: min(1240px, calc(100% - 48px)); }
.result-highlights { grid-template-columns: repeat(4, 1fr); margin-bottom: 32px; }
.result-highlights article { padding: 22px; }
.result-highlights span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.result-highlights strong {
  display: block;
  margin: 10px 0;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.055em;
}
.result-highlights p { font-size: 14px; margin-bottom: 0; }
.figure-stack { display: grid; gap: 24px; }
.split-figures { grid-template-columns: 1.55fr 0.75fr; align-items: stretch; }
.small-figure { display: flex; align-items: center; padding: 10px; }

.demo-section { width: min(1040px, calc(100% - 48px)); }
.demo-card { padding: 28px; }
.problem-box {
  padding: 22px;
  border-radius: 18px;
  background: #f7f9ff;
  border: 1px solid var(--line);
}
.problem-box p { margin: 12px 0 0; font-size: 20px; color: var(--text); }
.prefix-grid { grid-template-columns: repeat(2, 1fr); margin: 20px 0; }
.prefix-card {
  text-align: left;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.prefix-card strong { display: block; margin: 16px 0 8px; font-size: 18px; }
.prefix-card p { margin-bottom: 0; color: var(--muted); }
.prefix-card:hover, .prefix-card.active {
  transform: translateY(-2px);
  border-color: rgba(49, 86, 212, 0.45);
  box-shadow: 0 18px 45px rgba(49, 86, 212, 0.12);
}
.demo-output {
  border-radius: 20px;
  border: 1px solid rgba(10, 140, 97, 0.25);
  background: linear-gradient(180deg, rgba(10, 140, 97, 0.10), rgba(10, 140, 97, 0.04));
  padding: 24px;
}
.demo-output h3 { margin-top: 16px; color: #066646; }
.demo-output p { margin-bottom: 0; color: #2d3b38; }

.resource-grid { grid-template-columns: repeat(4, 1fr); }
.resource-grid a { padding: 22px; }
.resource-grid strong { display: block; font-size: 20px; }
.resource-grid span { color: var(--muted); }
.bibtex-card { margin-top: 22px; padding: 22px; }
.bibtex-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mini-button { padding: 8px 14px; }
pre {
  margin: 18px 0 0;
  overflow-x: auto;
  padding: 18px;
  border-radius: 16px;
  background: #111827;
  color: #e5e7eb;
  font-size: 14px;
  line-height: 1.5;
}
.footer {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  padding: 42px 0 56px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.footer a { color: var(--blue-dark); font-weight: 800; }

@media (max-width: 980px) {
  .site-header { padding: 0 24px; }
  .nav { gap: 12px; }
  .section-grid, .split-figures { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 58px; }
  .metric-strip, .three-cards, .result-highlights, .resource-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .site-header { height: auto; padding: 14px 20px; align-items: flex-start; }
  .nav { display: none; }
  .section, .hero, .results-section, .demo-section, .footer { width: min(100% - 28px, var(--max)); }
  .section { padding: 62px 0; }
  .hero { padding: 44px 0; }
  h1 { font-size: 54px; }
  .metric-strip, .three-cards, .result-highlights, .resource-grid, .prefix-grid { grid-template-columns: 1fr; }
  .paper-figure { border-radius: 18px; }
  .footer { flex-direction: column; }
}
