:root {
  color-scheme: light;
  --paper: #faf9f6;
  --ink: #242823;
  --muted: #565d53;
  --line: #d7dbd1;
  --accent: #285b40;
  --code: #f0f1eb;
  --radius-control: 4px;
  --radius-panel: 6px;
  --radius-frame: 8px;
}
* { box-sizing: border-box; }
html { font-size: 17px; scroll-padding-top: 2rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, sans-serif;
  line-height: 1.7;
}
header, main, footer { max-width: 990px; margin-inline: auto; padding-inline: 32px; }
header { border-bottom: 1px solid var(--line); }
nav { display: flex; flex-wrap: wrap; gap: 10px 26px; }
header nav { align-items: baseline; gap: 10px 18px; padding-block: 24px; }
header a { font-size: .88rem; text-decoration: none; }
header a:not(:first-child) { padding: 4px 8px; border-radius: var(--radius-control); }
header a:first-child {
  margin-right: auto;
  font-family: ui-monospace, monospace;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -.06em;
}
header a[aria-current]:not(:first-child) { color: var(--ink); background: var(--code); font-weight: 600; }
header a[href="playground.html"], header a[href="playground.html"][aria-current] {
  padding: 6px 12px;
  background: var(--accent);
  color: white;
  font-weight: 600;
}
header a[href="playground.html"]:hover { background: #1c4830; }
header a[href="playground.html"][aria-current] { text-decoration: underline; text-underline-offset: 3px; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
main { padding-block: 56px 72px; }
h1, h2, h3 { line-height: 1.2; font-weight: 600; }
h1 { margin: 12px 0 24px; font-size: clamp(2.2rem, 5.5vw, 3.55rem); letter-spacing: -.045em; }
h2 { margin-top: 48px; margin-bottom: 18px; font-size: 1.45rem; letter-spacing: -.02em; }
p, dl, details { max-width: 75ch; }
p { margin-block: 16px; }
.lead { max-width: 56ch; font-size: 1.22rem; line-height: 1.6; color: var(--muted); }
.eyebrow, .section-label {
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: .75rem;
  letter-spacing: .035em;
}
.intro-links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-block: 28px 56px; }
.intro-links a { padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius-control); background: #fff; font-size: .85rem; text-decoration: none; }
.intro-links a[href="playground.html"] { padding: 7px 13px; border: 2px solid var(--accent); }
.section-label { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); }
.section-label + h2 { margin-top: 16px; }
pre, code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .87em; }
pre { background: var(--code); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 22px 24px; overflow-x: auto; line-height: 1.65; tab-size: 8; }
pre code { font-size: 1em; }
p code, dd code { overflow-wrap: anywhere; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 36px; }
.features section { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-frame); background: #fff; }
.features h2 { font-size: 1.08rem; margin-top: 0; }
.features p { margin-bottom: 0; font-size: .91rem; color: var(--muted); }
.reading { display: grid; grid-template-columns: 180px 1fr; gap: 16px 26px; }
dt { font-weight: 600; }
dd { margin: 0; color: var(--muted); }
.api-list dt { margin-top: 22px; }
.api-list dd { margin-top: 8px; }
.contents { font-size: .88rem; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--code); margin-block: 28px; }
summary { cursor: pointer; color: var(--accent); }
details { padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: #fff; }
footer { display: flex; flex-wrap: wrap; gap: 12px 24px; padding-block: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
footer span { margin-right: auto; }
.skip { position: absolute; left: 16px; top: -100px; background: var(--paper); padding: 8px 16px; border-radius: var(--radius-control); }
.skip:focus { top: 8px; }
@media (max-width: 640px) {
  header, main, footer { padding-inline: 20px; }
  header nav { gap: 12px 8px; }
  header a:first-child { width: 100%; }
  main { padding-top: 36px; }
  .features { grid-template-columns: 1fr; gap: 14px; }
  .features h2 { margin-bottom: 8px; }
  .reading { grid-template-columns: 1fr; gap: 6px; }
  .reading dd { margin-bottom: 12px; }
  pre { padding: 16px; }
}
@media print {
  header, footer, .skip, .contents { display: none; }
  body { background: white; color: black; }
  main { max-width: none; padding: 0; }
  pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  a { color: inherit; }
}
