:root {
  --bg: #000;
  --text: #f4f4f4;
  --muted: #a7a7a7;
  --line: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(255, 255, 255, 0.08);
  --page-width: 900px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar,
.page {
  width: min(calc(100% - 32px), var(--page-width));
  margin-inline: auto;
}

/* ── Top bar ─────────────────────────────────────────── */
.topbar {
  padding: 24px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
}

.brand-text,
.nav a,
.eyebrow,
.index {
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.brand-text {
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.nav a {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav a:hover,
.authors a:hover,
.hero-links a:hover {
  color: #fff;
}

/* ── Page ────────────────────────────────────────────── */
.page {
  padding: 40px 0 80px;
}

/* ── Hero ────────────────────────────────────────────── */
.hero {
  padding: 44px 0 56px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.hero-mark {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.hero-logo {
  width: 112px;
  height: 112px;
  display: block;
  object-fit: contain;
}

.eyebrow,
.index {
  margin: 0;
  color: #d0d0d0;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  font-weight: 600;
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

h1 {
  margin-top: 14px;
  font-size: clamp(3.2rem, 8vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero-subtitle {
  max-width: 760px;
  margin: 20px auto 0;
  color: #d8d8d8;
  font-size: 1.18rem;
  line-height: 1.8;
}

.authors,
.hero-links {
  margin-top: 22px;
}

.authors {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  color: var(--muted);
  line-height: 1.9;
}

.authors span {
  margin-inline: 10px;
  color: rgba(255, 255, 255, 0.28);
}

.hero-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
}

.hero-links a {
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  padding-bottom: 2px;
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Sections ────────────────────────────────────────── */
.section {
  padding: 44px 0 0;
}

.section + .section {
  margin-top: 12px;
}

.section-head {
  margin-bottom: 18px;
}

h2 {
  margin-top: 8px;
  font-size: clamp(1.9rem, 4vw, 3rem);
  letter-spacing: -0.04em;
}

.text-block,
.simple-list,
.code-stack,
.citation-block {
  max-width: 100%;
}

.text-block p,
.simple-item p {
  color: #d5d5d5;
  font-size: 1.04rem;
  line-height: 1.95;
}

.text-block em {
  font-style: italic;
  color: #fff;
}

/* ── Simple list (numbered items) ────────────────────── */
.simple-list {
  border-top: 1px solid var(--line-soft);
}

.simple-item {
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--line-soft);
}

.simple-item h3 {
  margin-top: 8px;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

/* ── Highlight callout ───────────────────────────────── */
.highlight-item {
  padding: 24px 0 28px;
  border-bottom: 1px solid var(--line-soft);
}

.highlight-item h3 {
  margin-top: 8px;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  color: #fff;
}

.highlight-item p {
  color: #d5d5d5;
  font-size: 1.04rem;
  line-height: 1.95;
}

.highlight-tag {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Metrics list ────────────────────────────────────── */
.metrics-list {
  border-top: 1px solid var(--line-soft);
  margin-top: 18px;
}

.metric-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  gap: 12px;
  font-size: 1.04rem;
  line-height: 1.8;
  color: #d5d5d5;
}

.metric-item strong {
  color: #fff;
  flex-shrink: 0;
}

/* ── Questions list ──────────────────────────────────── */
.questions-list {
  border-top: 1px solid var(--line-soft);
  margin-top: 18px;
}

.question-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 1.04rem;
  line-height: 1.8;
  color: #d8d8d8;
  font-style: italic;
}

/* ── CTA section ─────────────────────────────────────── */
.cta-block {
  margin-top: 18px;
  padding: 36px;
  border: 1px solid var(--line);
  text-align: center;
}

.cta-block p {
  color: #d5d5d5;
  font-size: 1.04rem;
  line-height: 1.95;
  max-width: 680px;
  margin: 0 auto;
}

.cta-block p + p {
  margin-top: 14px;
}

.cta-link {
  display: inline-block;
  margin-top: 24px;
  padding: 10px 28px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.2s;
}

.cta-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* ── Code blocks ─────────────────────────────────────── */
.code-stack {
  display: grid;
  gap: 18px;
}

.code-card {
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line-soft);
}

.code-card h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

pre {
  margin: 0;
  overflow-x: auto;
}

.copy-block {
  position: relative;
  border: 1px solid var(--line-soft);
  background: #050505;
}

.copy-button {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #0b0b0b;
  color: #f4f4f4;
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.copy-button:hover {
  background: #111;
}

code,
pre {
  font-family: "SFMono-Regular", "JetBrains Mono", "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.88rem;
  line-height: 1.8;
  color: #f1f1f1;
}

.copy-block pre {
  padding: 18px;
  padding-top: 44px;
}

/* ── Comparison table ────────────────────────────────── */
.comparison-table {
  margin-top: 24px;
  border: 1px solid var(--line-soft);
  overflow-x: auto;
}

.table-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  border-bottom: 1px solid var(--line-soft);
}

.table-row:last-child {
  border-bottom: none;
}

.table-header {
  background: #050505;
}

.table-header .table-cell {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d0d0d0;
}

.table-cell {
  padding: 12px 16px;
  font-size: 0.92rem;
  color: #d5d5d5;
  line-height: 1.6;
}

.label-cell {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.highlight-cell {
  color: #fff;
}

/* ── Formula blocks ──────────────────────────────────── */
.formula {
  margin-top: 12px;
  padding: 14px 18px;
  background: #050505;
  border: 1px solid var(--line-soft);
  font-family: "SFMono-Regular", "JetBrains Mono", "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.92rem;
  color: #e8e8e8;
  line-height: 1.6;
}

.formula.large {
  font-size: 1.05rem;
  text-align: center;
  padding: 20px;
}

/* ── Score block ─────────────────────────────────────── */
.score-block {
  margin-top: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  text-align: center;
}

.score-block .eyebrow {
  margin-bottom: 12px;
}

/* ── Results grid ────────────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 24px;
}

.result-card {
  padding: 24px;
  border: 1px solid var(--line-soft);
  background: #050505;
}

.result-card .eyebrow {
  margin-bottom: 12px;
}

.result-score {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 4px;
}

.result-score span {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-left: 6px;
  vertical-align: middle;
}

.result-score.good {
  color: #4ade80;
}

.result-score.poor {
  color: #f87171;
}

.result-grade {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.result-detail {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.result-card > p:last-child {
  font-size: 0.95rem;
  color: #d5d5d5;
  line-height: 1.8;
}

/* ── Citation ────────────────────────────────────────── */
.citation-block {
  padding: 0 0 24px;
  border-bottom: 1px solid var(--line-soft);
}

/* ── Footer ──────────────────────────────────────────── */
.footer {
  padding: 40px 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
}

.footer a {
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 1px;
}

.footer a:hover {
  color: #fff;
}

.footer span {
  margin-inline: 8px;
  color: rgba(255, 255, 255, 0.2);
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .page {
    padding-top: 28px;
  }

  h1 {
    font-size: clamp(2.8rem, 16vw, 4.4rem);
  }

  .hero-subtitle,
  .text-block p,
  .simple-item p,
  .highlight-item p,
  .metric-item,
  .question-item,
  .cta-block p {
    font-size: 1rem;
    line-height: 1.85;
  }

  .authors span {
    display: none;
  }

  .authors a {
    display: block;
    width: 100%;
  }

  .cta-block {
    padding: 24px 18px;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .table-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .table-header {
    display: none;
  }

  .table-cell {
    padding: 8px 16px;
  }

  .label-cell {
    padding-top: 14px;
    font-weight: 600;
  }
}
