/*
 * The docs skin. One stylesheet for every page under /docs. The umbrella
 * page inlines its own because it is one file and has no sibling to share
 * with; this one has eight, so it is a file.
 *
 * The tokens are www/index.html's, verbatim, because a docs site that drifts
 * from the product's palette reads as somebody else's docs.
 */
:root {
  --bg: hsl(60 10% 98%); --card: hsl(0 0% 100%); --border: hsl(120 6% 86%);
  --fg: hsl(120 8% 8%); --muted-fg: hsl(120 4% 38%); --muted: hsl(120 8% 93%);
  --primary: hsl(75 70% 36%); --primary-soft: hsl(75 70% 36% / .12); --primary-fg: #fff;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: hsl(120 6% 4%); --card: hsl(120 4% 7%); --border: hsl(120 4% 14%);
    --fg: hsl(0 0% 98%); --muted-fg: hsl(110 4% 58%); --muted: hsl(120 4% 12%);
    --primary: hsl(75 88% 60%); --primary-soft: hsl(75 88% 60% / .12); --primary-fg: hsl(120 8% 6%);
  }
}
:root[data-theme="dark"] {
  --bg: hsl(120 6% 4%); --card: hsl(120 4% 7%); --border: hsl(120 4% 14%);
  --fg: hsl(0 0% 98%); --muted-fg: hsl(110 4% 58%); --muted: hsl(120 4% 12%);
  --primary: hsl(75 88% 60%); --primary-soft: hsl(75 88% 60% / .12); --primary-fg: hsl(120 8% 6%);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: "Geist", Inter, system-ui, sans-serif;
  font-feature-settings: "cv11","ss01"; -webkit-font-smoothing: antialiased;
  line-height: 1.65; min-height: 100vh; display: flex; flex-direction: column;
}
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
.mono, code, pre { font-family: "Geist Mono", ui-monospace, SFMono-Regular, monospace; font-variant-numeric: tabular-nums; }
.wrap { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }

/* ── Masthead ─────────────────────────────────────────────────────────────── */
.masthead { border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 600; text-decoration: none; }
.brand svg { width: 20px; height: 22px; color: var(--primary); }
.brand .tag { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-fg); border: 1px solid var(--border); border-radius: 999px; padding: .1rem .45rem; font-weight: 500; }
.masthead ul { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; font-size: .875rem; color: var(--muted-fg); }
.masthead ul a { text-decoration: none; }
.masthead ul a:hover { color: var(--fg); }
@media (max-width: 620px) { .masthead ul li:nth-child(n+3) { display: none; } }

/* ── Shell ────────────────────────────────────────────────────────────────── */
.shell { flex: 1; display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 3rem; padding: 2.5rem 0 5rem; align-items: start; }
/* `align-items: start` is the desktop rule; in a column flex it would size
   each item to its content, and one 30rem table would widen the whole page. */
@media (max-width: 900px) { .shell { display: flex; flex-direction: column; align-items: stretch; gap: 1.5rem; padding-top: 1.5rem; } }

aside { position: sticky; top: 84px; font-size: .875rem; }
/*
 * Under 900px the sidebar stops being a sidebar. Stacking it above the page
 * puts six hundred pixels of navigation in front of every first sentence, so
 * it moves below the article and packs into two columns. The masthead and
 * each page's own pager carry navigation until the reader gets there.
 */
@media (max-width: 900px) {
  aside { order: 2; position: static; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem 1.25rem; background: var(--card); }
  aside ul { display: grid; grid-template-columns: 1fr 1fr; gap: .1rem .75rem; }
  aside h2 { margin-top: 1.25rem; }
  article { order: 1; max-width: none; }
}
aside h2 { font-size: .7rem; letter-spacing: .11em; text-transform: uppercase; color: var(--muted-fg); font-weight: 600; margin: 1.5rem 0 .5rem; }
aside h2:first-child { margin-top: 0; }
aside ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
aside a { display: block; padding: .3rem .6rem; margin-left: -.6rem; border-radius: 8px; color: var(--muted-fg); text-decoration: none; }
aside a:hover { color: var(--fg); background: var(--muted); }
aside a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); font-weight: 500; }

/* ── Prose ────────────────────────────────────────────────────────────────── */
article { max-width: 46rem; min-width: 0; }
article > .eyebrow { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); font-weight: 600; }
h1 { font-size: clamp(2rem, 4.5vw, 2.75rem); line-height: 1.08; letter-spacing: -.035em; font-weight: 700; margin: .6rem 0 .75rem; text-wrap: balance; }
.lede { font-size: 1.06rem; color: var(--muted-fg); margin: 0 0 2rem; }
h2 { font-size: 1.4rem; letter-spacing: -.022em; margin: 2.75rem 0 .75rem; scroll-margin-top: 84px; }
h3 { font-size: 1.05rem; letter-spacing: -.012em; margin: 1.75rem 0 .5rem; scroll-margin-top: 84px; }
article p, article li { color: var(--muted-fg); }
article p { margin: 0 0 1rem; }
article strong { color: var(--fg); font-weight: 600; }
article ul, article ol { margin: 0 0 1rem; padding-left: 1.25rem; }
article li { margin-bottom: .4rem; }
article li::marker { color: var(--border); }
article a { color: var(--primary); text-decoration-color: color-mix(in srgb, var(--primary) 35%, transparent); text-underline-offset: 3px; }
article a:hover { text-decoration-color: var(--primary); }
code { font-size: .875em; background: var(--muted); border-radius: 5px; padding: .1em .35em; color: var(--fg); word-break: break-word; }
pre { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; overflow-x: auto; font-size: .82rem; line-height: 1.6; }
pre code { background: none; padding: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 3rem 0; }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.scroll-x { overflow-x: auto; margin: 0 0 1.25rem; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; min-width: 30rem; }
th { text-align: left; font-weight: 500; color: var(--muted-fg); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; padding: 0 1rem .6rem 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: .7rem 1rem .7rem 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); color: var(--muted-fg); vertical-align: top; }
td:first-child { color: var(--fg); }
tr:last-child td { border-bottom: 0; }
td .sub { display: block; font-size: .8rem; color: var(--muted-fg); }
th .sub { display: block; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: .75rem; color: color-mix(in srgb, var(--muted-fg) 75%, transparent); }

/* ── Blocks ───────────────────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.35rem; margin: 0 0 1.25rem; }
.card > :last-child { margin-bottom: 0; }
.card h3 { margin-top: 0; }
.note { border-left: 3px solid var(--primary); background: var(--primary-soft); border-radius: 0 10px 10px 0; padding: .9rem 1.1rem; margin: 0 0 1.25rem; font-size: .92rem; }
.note > :last-child { margin-bottom: 0; }
.note b { color: var(--fg); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin: 0 0 1.5rem; }
.cards a { display: flex; flex-direction: column; gap: .3rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; text-decoration: none; transition: border-color .18s ease, transform .18s ease; }
.cards a:hover { border-color: var(--primary); transform: translateY(-2px); }
.cards a b { color: var(--fg); font-size: .98rem; font-weight: 600; }
.cards a span { color: var(--muted-fg); font-size: .875rem; line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { .cards a { transition: none; } }

.addr { font-size: .8rem; word-break: break-all; }
.pill { display: inline-block; font-size: .65rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; padding: .15rem .45rem; border-radius: 999px; background: var(--primary-soft); color: var(--primary); vertical-align: middle; }
.pill.grey { background: var(--muted); color: var(--muted-fg); }

.pager { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--border); margin-top: 3rem; padding-top: 1.25rem; font-size: .9rem; }
.pager a { text-decoration: none; color: var(--primary); font-weight: 500; }
.pager span { color: var(--muted-fg); }

footer { border-top: 1px solid var(--border); padding: 1.25rem 0 2rem; font-size: .8rem; color: var(--muted-fg); }
footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
footer a { text-decoration: none; }
footer a:hover { color: var(--fg); }
