:root {
  color-scheme: light dark;
  --ink: #17212b;
  --muted: #566776;
  --paper: #f5f1e8;
  --panel: #fffdf8;
  --blue: #315b7d;
  --blue-dark: #23445f;
  --line: #d9d2c4;
  --accent: #c76b3c;
  --primary-ink: #fff;
  --table-heading: #eee9df;
  --row-line: #e9e3d8;
  --row-hover: #faf7f0;
  --pill: #dce9f2;
  --pill-line: #bfd2e0;
  --callout: #e8f0f5;
  --callout-line: #c8dae6;
  --caution: #f6e9df;
  --caution-line: #e5c8b5;
  --badge-ink: #7e472b;
  --badge: #f2ded1;
  --code-ink: #eaf2f8;
  --code-background: #17212b;
  --focus-ring: rgba(49, 91, 125, .18);
  --secondary-hover: rgba(49, 91, 125, .07);
  --panel-shadow: rgba(23, 33, 43, .08);
  --button-shadow: rgba(49, 91, 125, .22);
  --code-shadow: rgba(23, 33, 43, .14);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e7edf2;
    --muted: #a9bac8;
    --paper: #10161c;
    --panel: #182129;
    --blue: #80b7dd;
    --blue-dark: #a9d4f0;
    --line: #34434f;
    --accent: #ee9465;
    --primary-ink: #0d151c;
    --table-heading: #202c35;
    --row-line: #2c3a45;
    --row-hover: #202b34;
    --pill: #223746;
    --pill-line: #3b5b70;
    --callout: #1c303d;
    --callout-line: #355569;
    --caution: #36281f;
    --caution-line: #624630;
    --badge-ink: #f2b18b;
    --badge: #462f24;
    --code-ink: #eaf2f8;
    --code-background: #0b1116;
    --focus-ring: rgba(128, 183, 221, .28);
    --secondary-hover: rgba(128, 183, 221, .12);
    --panel-shadow: rgba(0, 0, 0, .24);
    --button-shadow: rgba(0, 0, 0, .28);
    --code-shadow: rgba(0, 0, 0, .34);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

a { color: inherit; }

.site-header,
main,
footer {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 700;
  text-decoration: none;
}

nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px 24px; }
nav a { color: var(--muted); text-decoration: none; font-size: .94rem; }
nav a:hover { color: var(--blue); }

.hero { padding: 104px 0 72px; }

.release-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 52px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 14px 34px var(--panel-shadow);
}

.release-banner > div { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.release-label {
  color: var(--accent);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.release-banner strong { color: var(--ink); font-size: 1.18rem; }
.release-meta { color: var(--muted); font-size: .86rem; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2, h3 { line-height: 1.12; }

h1, h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
}

h1 {
  max-width: 940px;
  margin: 0;
  font-size: clamp(3rem, 7vw, 6.25rem);
  letter-spacing: -.045em;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
  letter-spacing: -.025em;
}

h3 { margin: 0 0 10px; font-size: 1.05rem; }

.lede {
  max-width: 720px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: 1.18rem;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

.button {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--blue);
  border-radius: 4px;
  font-weight: 700;
  text-decoration: none;
}

.primary { color: var(--primary-ink); background: var(--blue); }
.primary:hover { background: var(--blue-dark); }
.release-download {
  min-height: 54px;
  padding-inline: 26px;
  box-shadow: 0 12px 28px var(--button-shadow);
  font-size: 1rem;
}
.secondary { color: var(--blue); }
.secondary:hover { background: var(--secondary-hover); }

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 72px 0 0;
  padding: 0;
  border-block: 1px solid var(--line);
  list-style: none;
}

.facts li { padding: 20px 18px; border-right: 1px solid var(--line); }
.facts li:first-child { padding-left: 0; }
.facts li:last-child { border-right: 0; }
.facts strong, .facts span { display: block; }
.facts strong { color: var(--blue); font-size: 1.08rem; }
.facts span { color: var(--muted); font-size: .82rem; }

.section { padding: 88px 0; border-top: 1px solid var(--line); }

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin-top: 42px;
  background: var(--line);
  border: 1px solid var(--line);
}

.grid article { min-height: 190px; padding: 32px; background: var(--panel); }
.grid p, .split p, .status > p { margin: 0; color: var(--muted); }
.card-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--blue);
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
}
.card-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.split {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 64px;
  align-items: center;
}

.split p:not(.eyebrow) { margin-top: 22px; }

pre {
  overflow-x: auto;
  margin: 0;
  padding: 30px;
  color: var(--code-ink);
  background: var(--code-background);
  border-radius: 6px;
  box-shadow: 0 18px 45px var(--code-shadow);
  line-height: 1.7;
}

.status {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  column-gap: 64px;
}

.status .text-link {
  grid-column: 2;
  margin-top: 22px;
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 42px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: .82rem;
}

/* Distribution formula and API reference. */
.reference-hero { padding: 82px 0 54px; }
.reference-hero h1 { max-width: none; font-size: clamp(2.8rem, 6vw, 5.4rem); }

.reference-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 30px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}
.reference-summary strong { color: var(--blue); font-size: 1.08rem; }

.reference-key,
.reference-notes {
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: 64px;
  padding: 62px 0;
  border-top: 1px solid var(--line);
}
.key-copy p { margin: 0 0 16px; color: var(--muted); }
.key-copy .notation { font-size: .9rem; }

.method,
.methods span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  min-height: 25px;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .03em;
}
.method.yes { color: var(--primary-ink); background: var(--blue); }

.catalog { padding: 76px 0 88px; border-top: 1px solid var(--line); }
.catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
}
.search-box {
  display: grid;
  gap: 6px;
  width: min(360px, 100%);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.search-box input {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  font-size: .94rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.search-box input:focus { outline: 3px solid var(--focus-ring); border-color: var(--blue); }

.catalog-section {
  margin: 62px 0 12px;
  color: var(--blue-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 600;
}
.section-note { max-width: 780px; margin: 0 0 18px; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--panel); }

.distribution-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
  line-height: 1.45;
}
.distribution-table th {
  padding: 12px 14px;
  color: var(--muted);
  background: var(--table-heading);
  border-bottom: 1px solid var(--line);
  font-size: .72rem;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
}
.distribution-table td { padding: 13px 14px; border-bottom: 1px solid var(--row-line); vertical-align: top; }
.distribution-table tr:last-child td { border-bottom: 0; }
.distribution-table tbody tr:hover { background: var(--row-hover); }
.distribution-table th:first-child { width: 20%; }
.distribution-table th:nth-child(2) { width: 24%; }
.distribution-table th:nth-child(3) { width: 44%; }
.distribution-table th:last-child { width: 12%; }
.distribution-table td:first-child code { color: var(--blue-dark); font-weight: 750; }
.distribution-table td:first-child a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.distribution-table td:nth-child(2) { color: var(--muted); }
.methods { white-space: nowrap; color: var(--blue-dark); font-family: "SFMono-Regular", Consolas, monospace; font-weight: 800; letter-spacing: .08em; }
.methods span { margin-left: 5px; color: var(--badge-ink); background: var(--badge); letter-spacing: 0; }

.notes-grid { display: grid; gap: 26px; }
.notes-grid article { padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.notes-grid article:last-child { padding-bottom: 0; border-bottom: 0; }
.notes-grid p { margin: 0; color: var(--muted); }
.notes-grid a { color: var(--blue); font-weight: 700; }

/* Custom-distribution guide. */
.guide-hero { padding: 82px 0 56px; }
.guide-hero h1 { max-width: 980px; font-size: clamp(2.8rem, 6vw, 5.4rem); }
.version-pill {
  display: inline-flex;
  margin-top: 28px;
  padding: 6px 12px;
  color: var(--blue-dark);
  background: var(--pill);
  border: 1px solid var(--pill-line);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.guide-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding: 22px 0;
  border-block: 1px solid var(--line);
  text-align: left;
}
.guide-toc strong { color: var(--ink); }
.guide-toc a { color: var(--blue); font-weight: 650; }
.guide-section { padding: 76px 0; border-bottom: 1px solid var(--line); }
.guide-section > h2 { max-width: 900px; margin-bottom: 28px; }
.guide-section > h3 { margin-top: 42px; font-size: 1.25rem; }
.guide-section > p,
.example-copy p,
.guide-columns p,
.policy-grid p,
.callout { max-width: 820px; color: var(--muted); }
.guide-example {
  display: grid;
  grid-template-columns: .95fr 1.05fr;
  gap: 44px;
  align-items: start;
  margin-top: 48px;
  padding-top: 48px;
  border-top: 1px solid var(--line);
}
.guide-example pre { font-size: .84rem; }
.guide-columns,
.policy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin-top: 34px;
  background: var(--line);
  border: 1px solid var(--line);
}
.guide-columns article,
.policy-grid article { padding: 28px; background: var(--panel); }
.policy-grid { grid-template-columns: repeat(3, 1fr); }
.formula-panel {
  overflow-x: auto;
  margin: 22px 0;
  padding: 18px 22px;
  background: var(--panel);
  border-left: 3px solid var(--blue);
}
.callout {
  margin-top: 34px;
  padding: 20px 24px;
  background: var(--callout);
  border: 1px solid var(--callout-line);
  border-radius: 4px;
}
.callout strong { color: var(--ink); }
.callout.caution { background: var(--caution); border-color: var(--caution-line); }
.guide-section pre { margin: 24px 0 34px; }
.guide-section a { color: var(--blue); font-weight: 700; }
.troubleshooting-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.troubleshooting-table th,
.troubleshooting-table td { padding: 14px 16px; border-bottom: 1px solid var(--row-line); vertical-align: top; }
.troubleshooting-table th { color: var(--muted); background: var(--table-heading); text-align: left; }
.troubleshooting-table th:first-child { width: 22%; }
.troubleshooting-table th:nth-child(2) { width: 31%; }
.guide-next { border-bottom: 0; }

/* Learning hub and tutorial/vignette pages. */
.learning-intro { max-width: 780px; }
.learning-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 42px;
  background: var(--line);
  border: 1px solid var(--line);
}
.learning-card { min-height: 250px; padding: 30px; background: var(--panel); }
.learning-card h3 { font-size: 1.18rem; }
.learning-card p { color: var(--muted); }
.card-kicker {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.lesson-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 32px 0;
  padding: 0;
  list-style: none;
  counter-reset: lesson;
}
.lesson-steps li {
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  counter-increment: lesson;
}
.lesson-steps li::before {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  content: "0" counter(lesson);
  font-weight: 800;
}
.lesson-steps strong { display: block; margin-bottom: 6px; }
.lesson-steps span { color: var(--muted); font-size: .9rem; }
.version-note {
  margin: 28px 0;
  padding: 20px 24px;
  color: var(--blue-dark);
  background: var(--pill);
  border: 1px solid var(--pill-line);
  border-left: 4px solid var(--blue);
}
.result-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 28px 0;
  background: var(--line);
  border: 1px solid var(--line);
}
.result-strip div { padding: 20px; background: var(--panel); }
.result-strip strong, .result-strip span { display: block; }
.result-strip span { color: var(--muted); font-size: .86rem; }

.distribution-table td:nth-child(3) mjx-container { margin: 0 !important; }

@media (max-width: 760px) {
  .site-header { align-items: flex-start; padding: 20px 0; }
  nav { flex-direction: column; gap: 4px; text-align: right; }
  .hero { padding-top: 70px; }
  .release-banner { align-items: stretch; flex-direction: column; }
  .release-banner .button { justify-content: center; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .facts li { border-bottom: 1px solid var(--line); }
  .facts li:nth-child(2) { border-right: 0; }
  .facts li:nth-child(3), .facts li:nth-child(4) { border-bottom: 0; }
  .grid, .split, .status { grid-template-columns: 1fr; }
  .split, .status { gap: 32px; }
  .status .text-link { grid-column: 1; }
  .reference-key, .reference-notes { grid-template-columns: 1fr; gap: 28px; }
  .guide-example, .guide-columns, .policy-grid, .learning-grid,
  .lesson-steps, .result-strip { grid-template-columns: 1fr; }
  .catalog-heading { align-items: stretch; flex-direction: column; }
  .distribution-table { min-width: 850px; }
  footer { flex-direction: column; }
}
