:root {
  color-scheme: dark;
  --bg: #0b0b09;
  --line: #302c23;
  --line-soft: #24221c;
  --text: #f1eee6;
  --muted: #aaa396;
  --faint: #827b6d;
  --gold: #d9ab5d;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
::selection { background: var(--gold); color: var(--bg); }
.shell { width: min(100% - 56px, 1120px); margin-inline: auto; }
.skip-link { position: absolute; top: -100px; left: 20px; z-index: 100; padding: 12px 16px; background: var(--gold); color: var(--bg); }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.site-header { border-bottom: 1px solid var(--line-soft); }
.site-header-inner { width: min(100% - 56px, 1120px); min-height: 72px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { font-size: 15px; font-weight: 640; letter-spacing: -.025em; white-space: nowrap; }
.top-nav { display: flex; align-items: center; gap: 30px; }
.top-nav a { color: var(--muted); font-size: 12px; white-space: nowrap; }
.top-nav a:hover, .section-nav a:hover, .footer-links a:hover { color: var(--gold); }
.top-nav a span, .footer-links a span { margin-left: 2px; color: var(--faint); }

.hero { padding-block: 110px 112px; border-bottom: 1px solid var(--line); }
.hero-copy { max-width: 880px; }
.eyebrow { margin: 0 0 27px; color: var(--gold); font-size: 11px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
.hero h1 { margin-bottom: 42px; font-size: clamp(42px, 5vw, 66px); line-height: 1.08; font-weight: 590; letter-spacing: -.055em; }
.hero h1 span { color: var(--text); }
.hero h1 .title-accent { color: var(--gold); }
.byline { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.byline a { text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.byline span { margin-inline: 5px; color: var(--faint); }

.article-layout { display: grid; grid-template-columns: 160px minmax(0, 760px); justify-content: space-between; gap: 72px; padding-block: 96px 112px; }
.section-nav-inner { position: sticky; top: 30px; display: flex; flex-direction: column; gap: 14px; padding-left: 20px; border-left: 1px solid var(--line); }
.section-nav a { color: var(--faint); font-size: 12px; }
.article-section { scroll-margin-top: 32px; padding-bottom: 58px; margin-bottom: 60px; border-bottom: 1px solid var(--line-soft); }
.article-section-last { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.article-section h2 { margin-bottom: 25px; font-size: clamp(28px, 3vw, 36px); line-height: 1.18; font-weight: 590; letter-spacing: -.04em; }
.article-section h3 { margin: 30px 0 10px; color: var(--text); font-size: 15px; font-weight: 630; }
.article-section > p { max-width: 710px; color: #c7c0b4; font-size: 16px; line-height: 1.78; }
.article-section > p a { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.article-section > p:last-child { margin-bottom: 0; }
.article-section p + p { margin-top: 17px; }
.article-section h3 + p { margin-top: 0; }

.formula-figure { margin: 34px 0; padding-block: 6px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.formula-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line-soft); }
.formula-name { padding-top: 5px; color: var(--muted); font-size: 12px; }
.formula-math { overflow-x: auto; color: var(--text); font-family: Georgia, "Times New Roman", serif; font-size: 17px; line-height: 2; white-space: nowrap; }
.formula-math i { font-style: italic; }
.formula-math sub, .formula-math sup { font-size: 68%; }
.formula-figure figcaption { padding-block: 15px 17px; color: var(--muted); font-size: 12px; line-height: 1.6; }

.result-tables { display: grid; gap: 31px; margin: 34px 0 37px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.data-table caption { margin-bottom: 11px; color: var(--muted); font-size: 12px; text-align: left; }
.data-table thead { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.data-table tbody { border-bottom: 1px solid var(--line); }
.data-table th, .data-table td { padding: 11px 10px; text-align: right; }
.data-table th:first-child { padding-left: 0; text-align: left; }
.data-table th:last-child, .data-table td:last-child { padding-right: 0; }
.data-table thead th { color: var(--muted); font-size: 12px; font-weight: 500; }
.data-table tbody th { color: var(--text); font-weight: 500; }
.data-table tbody td { color: var(--text); }
.data-table tbody tr:last-child td:last-child { color: var(--gold); }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { padding-block: 40px 34px; }
.footer-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.footer-brand { font-size: 17px; font-weight: 620; letter-spacing: -.025em; }
.footer-top > a { color: var(--muted); font-size: 12px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px 30px; margin-top: 26px; padding-bottom: 28px; border-bottom: 1px solid var(--line-soft); }
.footer-links a { color: var(--muted); font-size: 12px; }
.footer-author { display: block; padding-top: 19px; color: var(--faint); font-size: 12px; }

@media (max-width: 800px) {
  .article-layout { display: block; padding-block: 70px 90px; }
  .section-nav { display: none; }
  .hero { padding-block: 86px 82px; }
}

@media (max-width: 580px) {
  .shell, .site-header-inner { width: min(100% - 36px, 1120px); }
  .site-header-inner { min-height: 64px; gap: 12px; }
  .brand { font-size: 13px; }
  .top-nav { gap: 13px; }
  .top-nav a { font-size: 11px; }
  .top-nav a span { display: none; }
  .hero { padding-block: 72px 73px; }
  .hero h1 { font-size: clamp(38px, 10vw, 52px); }
  .article-section { padding-bottom: 47px; margin-bottom: 48px; }
  .article-section > p { font-size: 15px; }
  .formula-row { display: block; }
  .formula-name { display: block; margin-bottom: 6px; }
  .formula-math { font-size: 16px; }
  .data-table { font-size: 12px; }
  .data-table thead th { font-size: 11px; }
  .data-table th, .data-table td { padding-inline: 5px; }
}

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