:root {
  --bg: #fbfaf7;
  --band: #f3f1ec;
  --surface: #ffffff;
  --text: #17161a;
  --muted: #55525c;
  --border: #e2dfd8;
  --accent: #3d5afe;
  --accent-soft: #e9edff;
  --accent-text: #ffffff;
  --code-bg: #ffffff;
  --radius: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --band: #18181b;
    --surface: #1d1d21;
    --text: #f0eff2;
    --muted: #a9a6b0;
    --border: #2c2c32;
    --accent: #8597ff;
    --accent-soft: #1f2440;
    --accent-text: #0d0d10;
    --code-bg: #0d1117;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.top-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
}

.top nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  justify-content: flex-end;
  font-size: 0.95rem;
}

.top nav a {
  display: inline-block;
  padding: 6px 0;
  color: var(--muted);
  text-decoration: none;
}

.top nav a:hover { color: var(--text); }

/* Type */

h1, h2, h3 { letter-spacing: -0.025em; line-height: 1.1; }

h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  margin: 0 0 22px;
}

h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  margin: 0 0 18px;
}

h3 {
  font-size: 1.8rem;
  margin: 0 0 6px;
}

p { margin: 0 0 16px; }

.eyebrow, .kicker {
  color: var(--accent);
  font-weight: 650;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

.aka {
  margin-left: 8px;
  color: var(--muted);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.lede {
  font-size: 1.25rem;
  color: var(--muted);
  max-width: 34ch;
}

.section-lede {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 60ch;
  margin-bottom: 48px;
}

:not(pre) > code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85em;
  background: var(--accent-soft);
  padding: 0.12em 0.4em;
  border-radius: 5px;
}

/* Buttons */

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

.actions.center { justify-content: center; }

.button {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

/* Code */

.code {
  margin: 0;
  min-width: 0;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px rgb(0 0 0 / 0.05);
}

.code figcaption {
  padding: 10px 18px;
  font-size: 0.82rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

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

.code pre code.hljs,
.code pre code {
  display: block;
  padding: 18px;
  background: transparent;
  font: 0.8rem/1.6 ui-monospace, "SF Mono", Menlo, monospace;
}

.compiler pre code { color: #d14343; }

@media (prefers-color-scheme: dark) {
  .compiler pre code { color: #ff8a80; }
}

.stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

/* Hero and project links */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
  gap: 40px;
  align-items: center;
  padding-top: 64px;
  padding-bottom: 48px;
}

.hero-example { min-width: 0; }
.hero-example-note { font-size: 0.95rem; color: var(--muted); margin: 18px 0 12px; }
.more { font-weight: 600; text-decoration: none; }
.more::after { content: " →"; }

/* Demos */

.demos {
  background: var(--band);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 56px 0;
}

.demo {
  min-width: 0;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.uses {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Closing */

.cta {
  text-align: center;
  padding-top: 56px;
  padding-bottom: 64px;
  border-top: 1px solid var(--border);
}

.cta p {
  color: var(--muted);
  font-size: 1.15rem;
}

footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Ecosystem overview: use the existing palette, with rules rather than more cards. */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.skip-link {
  position: fixed;
  top: 8px;
  left: 16px;
  z-index: 20;
  padding: 8px 16px;
  background: var(--surface);
  color: var(--text);
  transform: translateY(-180%);
}
.skip-link:focus { transform: none; }
.hero-note { font-size: 0.92rem; color: var(--muted); margin-top: 20px; margin-bottom: 0; }
.libraries, .evidence { padding-top: 48px; padding-bottom: 56px; border-top: 1px solid var(--border); }
.libraries .section-lede, .demos .section-lede { margin-bottom: 28px; }
.library-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 56px; }
.library-grid article { border-top: 2px solid var(--accent); padding-top: 18px; min-width: 0; }
.library-grid h3 { font-size: 1.5rem; }
.library-grid h3 a { color: var(--text); text-decoration: none; }
.library-grid h3 a:hover { text-decoration: underline; }
.library-grid p { font-size: 1rem; }
.library-grid .adoption { color: var(--muted); font-size: 0.92rem; }
.library-links, .guide-start { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 0.95rem; }
.library-links a, .guide-start a { padding: 4px 0; }
.application-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
.demo p { font-size: 1rem; }
.demo .actions { margin: 24px 0 16px; }
.evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.evidence h3 { font-size: 1.2rem; line-height: 1.3; margin: 24px 0 12px; }
.evidence p { font-size: 0.95rem; color: var(--muted); }
pre:focus-visible { outline-offset: -4px; }
.guide-start { margin: -16px 0 36px; }

@media (max-width: 900px) {
  .library-grid { gap: 28px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .lede { max-width: none; }
}

@media (max-width: 720px) {
  /* The primary documentation links stay available on phones, without a JS menu. */
  body { font-size: 17px; }
  .top { position: static; }
  .top-inner { align-items: flex-start; flex-direction: column; gap: 4px; }
  .top nav { justify-content: flex-start; gap: 0 18px; }
  .hero { padding-top: 36px; }
  .library-grid, .application-grid, .evidence-grid { grid-template-columns: minmax(0, 1fr); }
  .library-grid { gap: 28px; }
  .libraries, .evidence { padding-top: 36px; padding-bottom: 36px; }
  .evidence h3 { margin-top: 0; }
  .evidence h2 { margin-bottom: 28px; }
  .evidence-grid { gap: 16px; }
}

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

/* Core's module families share one foundation; keep the overview compact. */
.core-overview { padding-top: 48px; padding-bottom: 48px; border-top: 1px solid var(--border); }
.core-overview .section-lede { margin-bottom: 24px; }
.core-areas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 48px; margin: 0 0 24px; }
.core-areas dt { font-weight: 600; margin-bottom: 6px; }
.core-areas dd { margin: 0; color: var(--muted); font-size: 1rem; }
@media (max-width: 720px) {
  .core-overview { padding-top: 36px; padding-bottom: 36px; }
  .core-areas { grid-template-columns: minmax(0, 1fr); }
}
