:root {
  --bg: #fafaf9;
  --bg-elev: #fff;
  --fg: #111113;
  --fg-muted: #5c5c66;
  --line: #e6e6e3;
  --accent: #15803d;
  --accent-soft: #dcfce7;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b0b0d;
  --bg-elev: #131316;
  --fg: #f2f2f0;
  --fg-muted: #9a9aa3;
  --line: #232329;
  --accent: #5ee26b;
  --accent-soft: #10311a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid; }
html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body { background: var(--bg); min-height: 100dvh; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; cursor: pointer; }
h1, h2, h3, p { font-size: inherit; font-weight: inherit; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--fg-muted); }
.accent { color: var(--accent); }
.fg { color: var(--fg); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: .5rem; top: .5rem; z-index: 50; background: var(--accent); color: var(--bg); padding: .25rem .75rem; border-radius: .25rem; }

/* Layout */
.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1rem; }
section.block { border-top: 1px solid var(--line); padding: 5rem 0; scroll-margin-top: 5rem; }
.split { display: grid; gap: 2.5rem; }
.eyebrow { font-size: .875rem; font-weight: 500; color: var(--accent); }
.lede { margin-top: .5rem; font-size: 1.5rem; line-height: 2rem; font-weight: 600; letter-spacing: -.025em; max-width: 42rem; }
.stack > * + * { margin-top: 1.5rem; }
.small { font-size: .875rem; line-height: 1.25rem; }
.xs { font-size: .75rem; line-height: 1rem; }
.prose-link { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.prose-link:hover { text-decoration-color: var(--accent); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.nav { height: 3.5rem; display: flex; align-items: center; justify-content: space-between; }
.brand { font-weight: 600; letter-spacing: -.025em; }
.nav-links { display: none; align-items: center; gap: 1.25rem; font-size: .875rem; color: var(--fg-muted); }
.nav-links a:hover { color: var(--fg); }
.nav-phone { display: flex; align-items: center; gap: .5rem; }
.chip-btn { border: 1px solid var(--line); border-radius: .375rem; padding: .25rem .5rem; font-size: .75rem; color: var(--fg-muted); }
.chip-btn:hover { color: var(--fg); }
.menu-btn { border: 1px solid var(--line); border-radius: .375rem; padding: .25rem .625rem; font-size: .875rem; }
.mobile-menu { border-top: 1px solid var(--line); background: var(--bg); }
.mobile-menu .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; padding-top: .75rem; padding-bottom: .75rem; font-size: .875rem; }
.mobile-menu a { border-radius: .375rem; padding: .5rem; }
.mobile-menu a:hover { background: var(--bg-elev); }
[data-theme="dark"] .when-light, :root:not([data-theme="dark"]) .when-dark { display: none; }

/* Hero */
.hero { display: flex; flex-direction: column; gap: 2.5rem; padding: 4rem 0 5rem; }
.hero-top { display: flex; flex-direction: column-reverse; gap: 2rem; }
.hero-copy { max-width: 42rem; }
.hero-kicker { margin-bottom: .75rem; font-size: .875rem; font-weight: 500; color: var(--accent); }
.hero h1 { font-size: 2.25rem; line-height: 2.5rem; font-weight: 600; letter-spacing: -.025em; }
.hero-sub { margin-top: 1rem; font-size: 1.5rem; line-height: 2rem; color: var(--fg-muted); }
.hero-body { margin-top: 1.5rem; max-width: 36rem; color: var(--fg-muted); }
.portrait { width: 7rem; height: 7rem; flex-shrink: 0; border-radius: 9999px; border: 1px solid var(--line); object-fit: cover; }
.btn-row { margin-top: 2rem; display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.btn { display: inline-block; border-radius: .375rem; padding: .625rem 1rem; text-align: center; font-size: .875rem; font-weight: 500; border: 1px solid var(--line); }
.btn:hover { background: var(--bg-elev); }
.btn-primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent); opacity: .9; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.stats.ruled { border-top: 1px solid var(--line); padding-top: 2rem; }
.stat { display: flex; flex-direction: column; gap: .25rem; }
.stat-value { font-size: 1.875rem; line-height: 2.25rem; font-weight: 600; letter-spacing: -.025em; }
.stat-label { font-size: .875rem; color: var(--fg-muted); }
.stat-note { font-size: .75rem; color: color-mix(in oklab, var(--fg-muted) 70%, transparent); }

/* Cards */
.tiles { display: grid; gap: 1rem; }
.tile { border: 1px solid var(--line); background: var(--bg-elev); border-radius: .5rem; padding: 1rem; }
.tile-head { display: flex; align-items: center; justify-content: space-between; }
.tile-title { font-weight: 500; color: var(--fg); }
.tile p { margin-top: .25rem; font-size: .875rem; }

.cards { margin-top: 2.5rem; display: grid; gap: 1.25rem; }
.card { display: flex; flex-direction: column; gap: 1rem; border: 1px solid var(--line); background: var(--bg-elev); border-radius: .75rem; padding: 1.5rem; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.card-title { font-size: 1.25rem; line-height: 1.75rem; font-weight: 600; letter-spacing: -.025em; }
.card-title a:hover { color: var(--accent); }
.pill { border-radius: 9999px; padding: .125rem .5rem; font-size: .75rem; font-weight: 500; background: var(--accent-soft); color: var(--accent); }
.pill.quiet { background: color-mix(in oklab, var(--fg-muted) 15%, transparent); color: var(--fg-muted); }
.card-desc { color: var(--fg-muted); }
.metrics { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.metrics div { display: flex; align-items: baseline; gap: .375rem; }
.metrics dd { font-weight: 500; }
.metrics dt { font-size: .75rem; color: var(--fg-muted); }
.bullets { margin-left: 1rem; font-size: .875rem; color: var(--fg-muted); }
.bullets li { list-style: disc; padding-left: .25rem; }
.bullets li + li { margin-top: .375rem; }
.bullets strong { color: var(--fg); font-weight: 600; }
.card-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 1rem; padding-top: .5rem; font-size: .875rem; }
.card-foot .go { font-weight: 500; color: var(--accent); }
.card-foot .go:hover { text-decoration: underline; }
.card-foot a:not(.go) { color: var(--fg-muted); }
.card-foot a:not(.go):hover { color: var(--fg); }

.minis { margin-top: 1.25rem; display: grid; gap: .75rem; }
.mini { display: flex; flex-direction: column; gap: .25rem; border: 1px solid var(--line); background: var(--bg-elev); border-radius: .5rem; padding: .875rem 1rem; font-size: .875rem; }
.mini:hover { border-color: color-mix(in oklab, var(--accent) 50%, var(--line)); }
.mini-head { display: flex; justify-content: space-between; gap: 1rem; }
.mini-title { font-weight: 500; color: var(--fg); }
.mini p { color: var(--fg-muted); }

.install { margin-top: 1.25rem; border: 1px solid var(--line); background: var(--bg-elev); border-radius: .75rem; padding: 1rem 1.25rem; }
.install-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.install code { min-width: 0; font-family: var(--font-mono); font-size: .8125rem; overflow-x: auto; white-space: nowrap; }
.install p { margin-top: .5rem; }

/* Charts */
.charts { margin-top: 3rem; display: grid; gap: 2.5rem; }
figure.chart { position: relative; }
figure.chart figcaption { margin-bottom: .75rem; }
figure.chart figcaption span { display: block; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); }
.chart .axis { fill: var(--fg-muted); font-size: 11px; }
.chart .bar { fill: var(--accent); fill-opacity: .85; transition: fill-opacity .15s; }
.chart .bar.hot { fill-opacity: 1; }
.chart .bar-label { fill: var(--fg); font-size: 11px; font-weight: 500; }
.chart .hbar-track { fill: color-mix(in oklab, var(--fg-muted) 12%, transparent); }
.chart .hbar-name { fill: var(--fg); font-size: 12px; }
.tip { pointer-events: none; position: absolute; z-index: 10; border: 1px solid var(--line); background: var(--bg-elev); border-radius: .375rem; padding: .375rem .625rem; font-size: .75rem; box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.tip b { display: block; color: var(--fg); font-family: var(--font-mono); }
.tip span { display: block; color: var(--fg-muted); }
details.table { margin-top: .5rem; font-size: .75rem; color: var(--fg-muted); }
details.table summary { cursor: pointer; }
details.table summary:hover { color: var(--fg); }
details.table table { margin-top: .5rem; width: 100%; max-width: 20rem; border-collapse: collapse; }
details.table th { text-align: left; font-weight: 500; padding: .25rem 0; }
details.table td { padding: .25rem 0; border-top: 1px solid var(--line); }
details.table td:last-child, details.table th:last-child { text-align: right; }

/* Timeline */
.timeline { border-left: 1px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1.25rem 1.5rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; top: .375rem; left: -5px; width: .625rem; height: .625rem; border-radius: 9999px; border: 2px solid var(--bg); background: var(--accent); }
.timeline .when { display: block; font-size: .75rem; color: var(--fg-muted); }
.timeline .what { color: var(--fg); }

.talk { border: 1px solid var(--line); background: var(--bg-elev); border-radius: .75rem; padding: 1.5rem; }
.talk .row { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.talk .btn { padding: .5rem 1rem; color: var(--fg); }
.talk .btn-primary { color: var(--bg); }
.talk .btn:not(.btn-primary):hover { background: var(--bg); }
.links a:hover { color: var(--fg); }

/* Footer */
.site-footer { margin-top: 6rem; border-top: 1px solid var(--line); }
.site-footer .wrap { display: flex; flex-direction: column; gap: .75rem; padding-top: 2rem; padding-bottom: 2rem; font-size: .875rem; color: var(--fg-muted); }
.site-footer .links { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }

@media (min-width: 640px) {
  .nav-links { display: flex; }
  .nav-phone, .mobile-menu { display: none !important; }
  .hero { padding-top: 6rem; }
  .hero-top { flex-direction: row; align-items: flex-start; justify-content: space-between; }
  .hero h1 { font-size: 3.75rem; line-height: 1; }
  .hero-sub { font-size: 1.875rem; line-height: 2.25rem; }
  .portrait { width: 10rem; height: 10rem; }
  .btn-row { display: flex; flex-wrap: wrap; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stat-value { font-size: 2.25rem; line-height: 2.5rem; }
  .split { grid-template-columns: 1fr 2fr; }
  .tiles, .cards, .charts { grid-template-columns: 1fr 1fr; }
  .minis { grid-template-columns: repeat(3, 1fr); }
  .site-footer .wrap { flex-direction: row; align-items: center; justify-content: space-between; }
}

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