/* gapapp.app website layer, on GAP Design System v2.

   Load order: tokens.css, gap.css (both copied verbatim from
   ../designs/gap-design-kit-v2/design-system; never edit them here), then this.
   Pages put class="gap" on <body> and data-theme on <html>.

   Every colour, radius and shadow below is a kit token. The kit is sized for app
   screens, so a website needs a few page-scale values it does not have yet: the
   page width, the display sizes for page headings, and body text at 16px. They
   are the --site-* properties right here, and nowhere else. Proposed for the kit
   as web tokens. */

@font-face { font-family: "Inter"; src: url("fonts/InterVariable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("fonts/InterDisplay-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("fonts/InterDisplay-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/IBMPlexMono-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }

:root {
  --site-max: 1080px;            /* page column */
  --site-gutter: 24px;           /* 2 x space-5 */
  --site-h1: clamp(34px, 5.4vw, 56px);
  --site-h2: clamp(24px, 3vw, 30px);
  --site-h3: 17px;
  --site-body: 16px;
  --site-lede: 18px;
  --site-section: 72px;          /* space between page sections */
}

/* ---------- Page ---------------------------------------------------------- */
html { background: var(--bg); scroll-behavior: smooth; }
body.gap {
  margin: 0; min-height: 100vh;
  font-size: var(--site-body); line-height: 1.6;
  background: var(--bg) radial-gradient(900px 520px at 12% 0%, var(--bg-glow), transparent 70%) no-repeat;
  padding: 0 var(--site-gutter) 64px;
}
.gap a { color: var(--tap); font-weight: 600; text-decoration: none; }
.gap a:hover { text-decoration: underline; }
.gap b, .gap strong { font-weight: 700; color: var(--ink); }
.gap img { max-width: 100%; }
.gap ul, .gap ol { margin: 0; padding: 0; }
.gap p { margin: 0; }
.gap fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.gap [hidden] { display: none !important; }
.gap code, .gap kbd {
  font-family: var(--font-mono); font-size: 0.86em; font-weight: 500;
  background: var(--inset); color: var(--ink); border-radius: var(--radius-sm);
  padding: 1px 6px; white-space: nowrap;
}
.gap kbd { background: var(--selected); color: var(--on-selected); font-weight: 700; }
/* Long names (paths, folder names) break rather than push the page sideways. */
.gap p, .gap li, .gap td, .gap dd, .gap figcaption { overflow-wrap: anywhere; }
.gap p code, .gap li code, .gap td code { white-space: normal; }
.gap pre { margin: 0; }
.gap pre code { background: none; padding: 0; font-size: inherit; color: inherit; white-space: inherit; font-weight: inherit; }
.page { max-width: var(--site-max); margin: 0 auto; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 10; }
.skip:focus { left: 16px; }
.icon { width: 20px; height: 20px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header and footer ------------------------------------------- */
.top { display: flex; align-items: center; gap: var(--space-5); padding-top: 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: var(--space-4); color: var(--ink) !important; margin-right: auto; }
.brand:hover { text-decoration: none !important; }
.brand img { height: 30px; width: auto; display: block; }
[data-theme="light"] .brand img { filter: invert(1); }
.brand .name { font: 700 19px/24px var(--font-display); letter-spacing: -.01em; }
.brand .name span { color: var(--ink-muted); }
/* Page links: tappable pills (blue edge); the current page is solid blue. */
.navlinks { list-style: none; display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.navlinks a {
  display: inline-flex; align-items: center; height: var(--size-control); padding: 0 12px;
  border-radius: var(--radius-pill); background: var(--tap-soft); box-shadow: inset 0 0 0 1.5px var(--tap);
  color: var(--ink); font-size: 13px; font-weight: 700; white-space: nowrap;
}
.navlinks a:hover { text-decoration: none; }
.navlinks a[aria-current="page"] { background: var(--selected); color: var(--on-selected); box-shadow: none; }
.theme-btn {
  height: var(--size-control); padding: 0 12px; border: 0; border-radius: var(--radius-pill); cursor: pointer;
  background: var(--tap-soft); box-shadow: inset 0 0 0 1.5px var(--tap); color: var(--ink);
  font: 700 13px/1 var(--font-sans); white-space: nowrap;
}
footer.page { display: flex; flex-wrap: wrap; gap: var(--space-5); justify-content: space-between; align-items: center;
  margin-top: var(--site-section); padding-top: var(--space-6); border-top: 1px solid var(--divider); font-size: 13px; color: var(--ink-muted); }
footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-5); }

/* ---------- Type --------------------------------------------------------- */
.gap h1 { font: 800 var(--site-h1)/1.06 var(--font-display); letter-spacing: -.025em; margin: 0 0 18px; text-wrap: balance; }
.gap h1 span { color: var(--ink-muted); }
.gap h2 { font: 700 var(--site-h2)/1.2 var(--font-display); letter-spacing: -.015em; margin: 0 0 10px; text-wrap: balance; }
.gap h3 { font: 700 var(--site-h3)/1.35 var(--font-sans); margin: 0; }
.eyebrow { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); margin: 0 0 8px; }
.lede { font-size: var(--site-lede); line-height: 1.6; color: var(--ink-muted); max-width: 64ch; margin: 0 0 28px; text-wrap: pretty; }
.lede b { color: var(--ink); }
.more { font-size: 14px; color: var(--ink-muted); margin-top: 14px; }
.fine { font-size: 13px; color: var(--ink-muted); margin-top: 18px; max-width: 80ch; }
section.page { padding-top: var(--site-section); }
section.page > hgroup, .page > hgroup { margin: 0; }

/* Neutral fact chip: information, not a control and not a status. */
.fact { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: var(--radius-pill);
  background: var(--disc); color: var(--on-disc); font-size: 12px; font-weight: 700; white-space: nowrap; }
.fact svg { width: 14px; height: 14px; }
.facts { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.facts .fact { display: inline-block; line-height: 26px; }

/* ---------- Hero --------------------------------------------------------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 48px; align-items: center; padding: 56px 0 8px; }
@media (max-width: 860px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.hero .intro { font-size: var(--site-lede); line-height: 1.6; color: var(--ink-muted); max-width: 50ch; margin: 0 0 26px; text-wrap: pretty; }
.hero .intro b { color: var(--ink); }
.hero .fact { margin-bottom: 18px; }
.ctas { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: 0 0 18px; }
.gap .btn.lg { height: var(--size-input); padding: 0 18px; font-size: 15px; border-radius: var(--radius-lg); }
.gap .btn:hover { text-decoration: none; }
.gap a.btn.primary { color: var(--on-selected); }
.gap a.btn.secondary { color: var(--ink); }
.btn small { font-weight: 600; opacity: .8; font-size: 12px; margin-left: 4px; }

/* Phone frame holding a Library screen built from kit components. */
.device { justify-self: center; width: 100%; max-width: 340px; border-radius: 34px; padding: 10px; background: var(--card-static); border: 1px solid var(--card-static-edge); box-shadow: var(--shadow-float); }
.device .scr { border-radius: 26px; overflow: hidden; background: var(--bg) radial-gradient(260px 180px at 20% 0%, var(--bg-glow), transparent 70%) no-repeat; padding: 14px var(--space-5) var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); }
.device .lhead { display: flex; align-items: center; gap: var(--space-3); }
.device .lhead .t { flex: 1; min-width: 0; }
.device .lhead b { display: block; font: 700 21px/26px var(--font-display); }
.device .lhead .t span { display: block; font-size: 12px; line-height: 16px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device .tabsrow { display: flex; gap: var(--space-2); }
.device .stab { height: 30px; padding: 0 12px; border-radius: var(--radius-pill); display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; background: var(--card-top); color: var(--ink-muted); }
.device .stab.on { background: var(--ink); color: var(--card-top); }   /* Library tracks: picked source tab, design/kit-departures.md #4 */
/* Library tracks: game card with no edge, design/kit-departures.md #1 */
.device .game { border-radius: var(--radius-card); padding: var(--space-5); background: linear-gradient(160deg, var(--card-top), var(--card-bottom) 75%); box-shadow: var(--shadow-card); }
.device .game .gt { font-weight: 700; font-size: 15px; line-height: 20px; }
.device .game .gs { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.device .strip { border-radius: var(--radius-card); padding: 10px var(--space-5); background: var(--success-band); display: flex; align-items: center; gap: var(--space-3); }
.device .strip .t { flex: 1; min-width: 0; }
.device .strip b { display: block; font-size: 13.5px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device .strip .t span { display: block; font-size: 12px; line-height: 16px; color: var(--success); font-weight: 600; }
.device .sq { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--danger-band); color: var(--danger); flex: none; }
.device .rd { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--selected); color: var(--on-selected); flex: none; }
.device .sq svg, .device .rd svg { width: 16px; height: 16px; }
.device .bar { margin-top: 6px; height: 54px; border-radius: var(--radius-card); background: var(--card-top); box-shadow: var(--shadow-card); display: flex; padding: 5px; gap: 4px; }
.device .bar span { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--ink-muted); border-radius: 13px; }
.device .bar span svg { width: 18px; height: 18px; }
.device .bar span.on { background: var(--selected); color: var(--on-selected); }   /* Library tracks bottom nav, departure #2 */

/* ---------- Cards and grids ---------------------------------------------- */
.grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--space-5); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.gap .card { padding: 18px; display: flex; flex-direction: column; gap: var(--space-4); }
.gap .card > p, .gap .card li { font-size: 15px; line-height: 1.6; color: var(--ink-muted); text-wrap: pretty; }
.gap .card > p b { color: var(--ink); }
.gap .card h3 { display: flex; align-items: center; gap: var(--space-4); }
.gap .card h3 .disc svg { width: 20px; height: 20px; }
.gap .card.tap { padding-right: 48px; color: var(--ink); }
.gap a.card.tap:hover { text-decoration: none; }
.gap .card .path { margin-top: auto; font: 500 12px/1.5 var(--font-mono); color: var(--ink-muted); background: var(--inset); border-radius: var(--radius-md); padding: 8px 10px; overflow-wrap: anywhere; }
.bits { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: auto; }
.bits li { font-size: 12px !important; line-height: 16px !important; font-weight: 600; color: var(--ink) !important; background: var(--inset); border-radius: var(--radius-sm); padding: 4px 8px; }
.uses { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: 22px; }
.uses li { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: var(--radius-pill); background: var(--card-static); border: 1px solid var(--card-static-edge); font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.q { font-size: 15px !important; }

/* A hint: read-only, flat, with a sparkle. Warnings use the kit's .alert. */
.hint { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--card-static); border: 1px solid var(--card-static-edge); font-size: 14px; line-height: 1.55; color: var(--ink-muted); margin-top: 14px; }
.hint svg { width: 18px; height: 18px; color: var(--tap); flex: none; margin-top: 2px; }
.hint strong { color: var(--ink); }
.gap .alert { font-size: 14px; line-height: 1.55; margin-top: 14px; }
.gap .alert strong { color: var(--warning); }

/* ---------- Split (text + code) ------------------------------------------ */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 32px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } }
.ticks { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.ticks li { display: flex; gap: 10px; font-size: 15px; line-height: 1.55; color: var(--ink-muted); }
.ticks li svg { width: 18px; height: 18px; color: var(--success); flex: none; margin-top: 3px; }
.ticks b { color: var(--ink); }

/* ---------- Code and terminal panels ------------------------------------- */
.file, .term { border-radius: 14px; background: var(--inset); border: 1px solid var(--card-static-edge); overflow: hidden; margin: 14px 0; }
.file .term-bar, .term .term-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--divider); font-size: 12px; font-weight: 700; color: var(--ink-muted); }
.term-bar .name { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-weight: 500; }
.term-dots { display: none; }
.file .acts { display: flex; gap: 6px; }
.file .acts a, .file .acts button { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border: 0; border-radius: var(--radius-pill); background: var(--tap-soft); color: var(--tap); font: 800 12px/1 var(--font-sans); cursor: pointer; }
.file .acts a:hover { text-decoration: none; }
.file pre, .term-body, .gap pre.cmd { padding: 14px 16px; font: 500 13px/1.65 var(--font-mono); color: var(--ink); overflow-x: auto; white-space: pre; margin: 0; }
.file pre.short { font-size: 13px; }
.gap pre.cmd { background: var(--inset); border-radius: var(--radius-lg); margin-top: 10px; }
.c-com { color: var(--ink-muted); }
.c-key, .c-fn, .c-str, .c-num { color: inherit; }
/* In the terminal mocks: what to read is marked, what to type is a key. */
.t-dim { color: var(--ink-muted); }
.t-look { background: var(--tap-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--tap); border-radius: 4px; padding: 0 4px; margin: 0 -4px; }
.t-note, .t-enter { color: var(--ink-muted); font-style: normal; }
.t-key { background: var(--selected); color: var(--on-selected); border-radius: 4px; padding: 0 6px; font-weight: 700; }
.t-cmd { font-weight: 700; }
.t-cursor::after { content: ""; display: inline-block; width: 7px; height: 1.05em; vertical-align: -.15em; background: var(--ink); animation: t-blink 1.1s steps(1) infinite; }
@keyframes t-blink { 50% { opacity: 0; } }

/* ---------- Setup guide -------------------------------------------------- */
.panel { border-radius: var(--radius-dialog); padding: 22px; background: var(--card-static); border: 1px solid var(--card-static-edge); }
.picker { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.picker fieldset { display: flex; flex-direction: column; gap: 8px; }
.picker legend { font-size: 13px; font-weight: 700; padding: 0; margin-bottom: 8px; }
.gap .picker .seg { max-width: 640px; flex-wrap: wrap; border-radius: var(--radius-lg); }
.gap .picker .seg button { flex: 1 1 auto; height: auto; min-height: 34px; padding: 6px 14px; white-space: normal; border-radius: var(--radius-md); }
.gap .picker .seg button[aria-pressed="true"] { background: var(--selected); box-shadow: none; color: var(--on-selected); font-weight: 700; }
.guide-title { font: 700 22px/1.25 var(--font-display); margin: 4px 0 6px; }
.guide-intro { font-size: 15px; color: var(--ink-muted); margin-bottom: 18px; max-width: 70ch; }
.part { margin-top: 24px; }
.part h4 { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.steps { list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 12px; }
.steps > li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.6; text-wrap: pretty; }
.steps > li::before { counter-increment: step; content: counter(step); width: 26px; height: 26px; border-radius: 50%; background: var(--disc); color: var(--on-disc); font-size: 12px; font-weight: 800; display: grid; place-items: center; flex: none; }
.steps > li > div { flex: 1; min-width: 0; }
.caution { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 20px; }
.caution svg { width: 18px; height: 18px; color: var(--warning); flex: none; margin-top: 2px; }

/* ---------- Downloads ---------------------------------------------------- */
.dl { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-5); }
.dl .label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.dl .label.rec { color: var(--success); }
.dl .btns { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.dl .btn { justify-content: space-between; width: 100%; }
.dl .who { font-size: 14px; color: var(--ink-muted); line-height: 1.5; }
.dl .btns .who { margin-top: 4px; font-size: 13px; }
.dl .size { font-size: 13px; color: var(--ink-muted); }
.links { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 20px; font-size: 15px; }

/* ---------- Companion ---------------------------------------------------- */
.gap .badge.soon { margin-bottom: 14px; }
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: var(--space-4); margin: 6px 0 26px; }
.node { border-radius: var(--radius-card); padding: 16px; text-align: center; background: var(--card-static); border: 1px solid var(--card-static-edge); }
.node .disc { margin: 0 auto 10px; }
.node b { display: block; font: 700 15px/20px var(--font-sans); }
.node span { display: block; font-size: 13px; color: var(--ink-muted); margin-top: 4px; line-height: 1.45; }
.node.mid { background: linear-gradient(160deg, var(--bar-top), var(--bar-bottom) 75%); border: 0; color: var(--on-bar); }
.node.mid span { color: var(--on-bar); opacity: .85; }
.node.mid .disc { background: var(--tap-soft); color: var(--on-bar); }
.wire { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.wire svg { width: 20px; height: 20px; color: var(--tap); }
@media (max-width: 760px) { .flow { grid-template-columns: 1fr; } .wire { flex-direction: row; justify-content: center; } .wire svg { transform: rotate(90deg); } }
.table-wrap { overflow-x: auto; border-radius: var(--radius-card); background: var(--card-static); border: 1px solid var(--card-static-edge); padding: 4px 6px; margin-top: 24px; }
.compare, .trouble, .api, .ref { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare th, .compare td, .trouble th, .trouble td { text-align: left; padding: 11px 12px; border-top: 1px solid var(--divider); vertical-align: top; }
.compare thead th, .trouble thead th, .ref thead th { border-top: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.compare tbody th, .trouble tbody th { font-weight: 700; width: 36%; }
.compare td, .trouble td { color: var(--ink-muted); }
.compare .yes { color: var(--ink); font-weight: 600; }
.compare .yes::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success); margin-right: 7px; vertical-align: 1px; }
.compare .no { color: var(--ink-muted); }

/* ---------- Closing call to action --------------------------------------- */
.cta { border-radius: var(--radius-dialog); padding: clamp(24px, 4vw, 40px); margin-top: var(--site-section);
  background: linear-gradient(160deg, var(--bar-top), var(--bar-bottom) 75%); color: var(--on-bar);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px; box-shadow: var(--shadow-float); }
.cta h2 { color: var(--on-bar); }
.cta p { color: var(--on-bar); opacity: .88; max-width: 54ch; }
.cta .right { display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* ---------- Docs pages (Quick start, API, Playground) -------------------- */
.qs-hero { padding: 48px 0 8px; max-width: 780px; }
.qs-hero .intro { font-size: var(--site-lede); line-height: 1.6; color: var(--ink-muted); margin: 0 0 20px; max-width: 62ch; }
.qs-hero .intro b { color: var(--ink); }
.qs-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 900px) { .qs-layout { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }
.toc { position: sticky; top: 20px; padding-top: 48px; }
.toc p { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); margin: 0 0 8px; }
.toc ol { list-style: none; display: flex; flex-direction: column; gap: 2px; counter-reset: toc; }
.toc a { display: flex; gap: 10px; padding: 6px 10px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.toc a::before { counter-increment: toc; content: counter(toc); color: var(--ink-muted); min-width: 1.1em; font-variant-numeric: tabular-nums; }
.toc a:hover { background: var(--tap-soft); color: var(--ink); text-decoration: none; }
.qs-step { padding-top: 48px; }
.qs-step > h2 { display: flex; align-items: center; gap: 12px; }
.qs-step > h2 .stepnum { width: 30px; height: 30px; font-size: 14px; }
.qs-step > p, .qs-step li { font-size: 15px; line-height: 1.65; }
.qs-step > p { margin: 0 0 14px; max-width: 70ch; text-wrap: pretty; color: var(--ink-muted); }
.qs-step > p b { color: var(--ink); }
.plain { margin: 0 0 16px 1.2em !important; display: flex; flex-direction: column; gap: 6px; max-width: 70ch; color: var(--ink-muted); }
.plain b { color: var(--ink); }
.explain { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-4); margin: 0 0 8px; }
.explain li { border-radius: 14px; background: var(--card-static); border: 1px solid var(--card-static-edge); padding: 12px 14px; font-size: 14px !important; line-height: 1.55 !important; color: var(--ink-muted); }
.explain code { white-space: normal; overflow-wrap: anywhere; }
.tabs { margin: 6px 0 0; max-width: 360px; }
.gap .tabs button[aria-pressed="true"] { background: var(--selected); box-shadow: none; color: var(--on-selected); font-weight: 700; }
.shot { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-5); margin: 16px 0 18px; }
.shot figure { margin: 0; border-radius: var(--radius-card); background: var(--card-static); border: 1px solid var(--card-static-edge); padding: 16px; }
.shot figcaption { font-size: 13px; color: var(--ink-muted); margin-top: 10px; }
.phone { width: 150px; margin: 0 auto; aspect-ratio: 9 / 16; border-radius: 18px; background: var(--inset); position: relative; overflow: hidden; }
.phone .time { position: absolute; top: 30%; left: 0; right: 0; text-align: center; font: 700 22px var(--font-display); }
.phone .btn-start, .target-tile span { border-radius: 50%; background: var(--selected); color: var(--on-selected); display: grid; place-items: center; }
.phone .btn-start { position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); width: 52px; height: 52px; }
.phone .crop { position: absolute; left: 50%; bottom: calc(18% - 6px); transform: translateX(-50%); width: 64px; height: 64px; border: 2px dashed var(--warning); border-radius: 6px; }
.target-tile { width: 96px; height: 96px; margin: 24px auto; border: 2px dashed var(--warning); border-radius: 8px; background: var(--inset); display: grid; place-items: center; }
.target-tile span { width: 72px; height: 72px; }
.phone svg, .target-tile svg { width: 22px; height: 22px; }
.api td { padding: 9px 12px; border-top: 1px solid var(--divider); vertical-align: top; color: var(--ink-muted); }
.api td:first-child { font: 500 13px var(--font-mono); color: var(--ink); white-space: nowrap; width: 1%; }
.api tr:first-child td { border-top: 0; }
.api tr.grp td { font: 700 12px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); padding-top: 16px; }

/* API reference */
.api-search { width: 100%; max-width: 420px; height: var(--size-input); padding: 0 14px; border: 0; border-radius: var(--radius-lg);
  font: 500 15px var(--font-sans); background: var(--tap-soft); box-shadow: inset 0 0 0 1.5px var(--tap); color: var(--ink); }
.api-search::placeholder { color: var(--ink-muted); }
.api-search:focus { outline: none; box-shadow: inset 0 0 0 2.5px var(--selected), 0 0 0 4px var(--focus-ring); }
.api-group { padding-top: 44px; }
.api-group > h2 { margin-bottom: 6px; }
.api-group > p { font-size: 15px; color: var(--ink-muted); margin: 0 0 12px; max-width: 72ch; }
.ref td { padding: 10px 12px; border-top: 1px solid var(--divider); vertical-align: top; color: var(--ink-muted); line-height: 1.55; }
.ref th { text-align: left; padding: 10px 12px; }
.ref tbody tr:first-child td { border-top: 0; }
.ref td:first-child { font: 500 13px/1.55 var(--font-mono); color: var(--ink); width: 34%; overflow-wrap: anywhere; }
.ref td:nth-child(2) { font: 500 12px/1.55 var(--font-mono); width: 16%; overflow-wrap: anywhere; }
.flag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; margin-left: 6px; border-radius: var(--radius-sm); font: 800 11px/1 var(--font-sans); letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px; white-space: nowrap; }
.flag.gated { background: var(--warning-band); color: var(--warning); }
.flag.newer { background: var(--disc); color: var(--on-disc); }
.flag.inplace { background: var(--inset); color: var(--ink-muted); }
@media (max-width: 640px) {
  .ref, .ref tbody, .ref tr, .ref td { display: block; width: 100% !important; }
  .ref thead { display: none; }
  .ref tr { border-top: 1px solid var(--divider); padding: 8px 0; }
  .ref td { border: 0 !important; padding: 2px 12px; }
}
.callout { border-radius: 14px; padding: 12px 14px; background: var(--card-static); border: 1px solid var(--card-static-edge); font-size: 14px; color: var(--ink-muted); margin: 14px 0; max-width: 80ch; }
.callout.warn { background: var(--warning-band); border: 0; color: var(--ink); }
.callout b { color: var(--ink); }
.noresults { display: none; color: var(--ink-muted); padding: 30px 0; }

/* Playground */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-5); margin: 18px 0; }
.shots figure { margin: 0; }
.shots img, .shot-wide, .shot-tall { display: block; height: auto; border-radius: 14px; border: 1px solid var(--card-static-edge); }
.shots img { width: 100%; }
.shots figcaption { font-size: 13px; color: var(--ink-muted); margin-top: 8px; line-height: 1.45; }
.shot-wide { width: 100%; max-width: 540px; margin: 12px 0 16px; }
.shot-tall { width: 100%; max-width: 270px; margin: 12px 0 16px; }
.dlrow { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: 16px 0 6px; }

/* ---------- Small screens and motion ------------------------------------- */
@media (max-width: 520px) {
  body.gap { padding: 0 16px 48px; }
  .gap .btn.lg { width: 100%; }
  .panel { padding: 16px; }
  .brand .name span { display: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .t-cursor::after { animation: none; } }

/* ---------- Section rhythm ----------------------------------------------- */
/* Sections take turns: plain on the page ground, or a full-width band on the
   flat card surface. Each section also has an accent, from the kit's data
   colours (never the status colours, and never as a border, so the blue edge
   still means only "tappable"). It colours the eyebrow and the icon discs. */
body.gap { overflow-x: clip; }
section.page { --accent: var(--data-time); }
#build, #downloads { --accent: var(--success); }
#companion { --accent: var(--data-medal); }
#need, #setup, #guide { --accent: var(--data-coin); }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--accent, var(--ink-muted)); }
section.page .eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: currentColor; }
section.page .card h3 .disc, section.page .node:not(.mid) .disc, .steps-accent .stepnum {
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
}

section.band { position: relative; isolation: isolate; margin-top: var(--site-section); padding-block: 64px; }
section.band + section.band { margin-top: 0; }
section.band::before {
  content: ""; position: absolute; z-index: -1; inset: 0 calc(50% - 50vw);
  background: var(--card-static); border-block: 1px solid var(--card-static-edge);
}
/* On a band, read-only cards drop to the page ground so they still read as cards. */
section.band .gap .card, section.band .card:not(.tap), section.band .table-wrap, section.band .node:not(.mid) { background: var(--bg); }
/* GAP Companion is its own product, so its band carries a glow in its accent. */
#companion.band::before {
  background:
    radial-gradient(640px 360px at 88% 0%, color-mix(in srgb, var(--data-medal) 22%, transparent), transparent 70%),
    radial-gradient(560px 360px at 0% 100%, color-mix(in srgb, var(--data-time) 14%, transparent), transparent 70%),
    var(--card-static);
}

/* Hero: a stronger two-colour glow than the page's. */
.hero { position: relative; isolation: isolate; }
.hero::before, .qs-hero::before {
  content: ""; position: absolute; z-index: -1; inset: -60px calc(50% - 50vw) 0;
  background:
    radial-gradient(520px 340px at 78% 40%, color-mix(in srgb, var(--data-medal) 20%, transparent), transparent 70%),
    radial-gradient(620px 380px at 18% 30%, color-mix(in srgb, var(--data-time) 16%, transparent), transparent 70%);
  pointer-events: none;
}
/* Docs pages: the intro sits on a band; each step is ruled off from the last. */
.qs-hero { position: relative; isolation: isolate; padding-bottom: 40px; margin-bottom: 8px; }
.qs-hero::before { inset: 0 calc(50% - 50vw); border-bottom: 1px solid var(--card-static-edge);
  background:
    radial-gradient(520px 300px at 85% 20%, color-mix(in srgb, var(--data-medal) 18%, transparent), transparent 70%),
    radial-gradient(600px 340px at 10% 0%, color-mix(in srgb, var(--data-time) 14%, transparent), transparent 70%),
    var(--card-static); }
.qs-step + .qs-step, .api-group + .api-group { margin-top: 40px; border-top: 1px solid var(--divider); }
.qs-step > h2 .stepnum { background: color-mix(in srgb, var(--data-time) 16%, transparent); color: var(--data-time); }
@media (max-width: 520px) { section.band { padding-block: 44px; } }
.qs-hero { max-width: none; }
.qs-hero > * { max-width: 780px; }
