/* PIXA Keychain's site. The tokens are Pixtopia's (src/theme/tokens.ts, DESIGN.md): charcoal steps, one
   spark accent, and the Prism only in the mark and the art. Dark first, and light checked too. */

@font-face { font-family: Geist; src: url(/keychain/fonts/Geist_400Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Geist; src: url(/keychain/fonts/Geist_500Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Geist; src: url(/keychain/fonts/Geist_600SemiBold.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Geist; src: url(/keychain/fonts/Geist_700Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url(/keychain/fonts/GeistMono_400Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url(/keychain/fonts/GeistMono_500Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --prism-pink: #ff4f8b;
  --prism-amber: #ffb547;
  --prism-mint: #3ee0a1;
  --prism-sky: #4ca8ff;
  --focus: rgba(76, 168, 255, 0.55);
  --gutter: clamp(16px, 3.4vw, 48px);
  --gap: clamp(12px, 1.6vw, 24px);
  --band: clamp(88px, 12vw, 192px);
  --max: 1560px;
  --sans: Geist, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --spring: cubic-bezier(0.2, 0.9, 0.25, 1);
}
:root,
:root[data-theme='dark'] {
  color-scheme: dark;
  --canvas: #0b0b0c;
  --surface: #151515;
  --raised: #1c1c1c;
  --hover: #232323;
  --border: #262626;
  --border-strong: #363636;
  --ink: #f5f5f5;
  --ink-2: #a3a3a3;
  --ink-3: #737373;
  --primary: #f5f5f5;
  --on-primary: #0b0b0c;
  --spark: #ff4f8b;
  --success: #3ee0a1;
  --warning: #ffb547;
  --danger: #ff6b6b;
  --glass: rgba(21, 21, 21, 0.75);
}
:root[data-theme='light'] {
  color-scheme: light;
  --canvas: #fafafa;
  --surface: #ffffff;
  --raised: #f4f4f5;
  --hover: #ededee;
  --border: #e7e7e9;
  --border-strong: #d4d4d8;
  --ink: #0b0b0c;
  --ink-2: #52525b;
  --ink-3: #71717a;
  --primary: #0b0b0c;
  --on-primary: #fafafa;
  --spark: #e0186a;
  --success: #0e8f63;
  --warning: #b8751c;
  --danger: #c0352d;
  --glass: rgba(255, 255, 255, 0.75);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; background: var(--canvas); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 17px/calc(1.5 * var(--line-scale, 1)) var(--sans);
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; }
a { color: inherit; }
p, h1, h2, h3, h4, ul, ol, dl, dd, figure, pre { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
code, kbd, pre { font-family: var(--mono); letter-spacing: 0; }
::selection { background: var(--spark); color: #fff; }

.glyph { width: 20px; height: 20px; fill: currentColor; flex: none; }

.wrap { width: min(100%, var(--max)); margin-inline: auto; padding-inline: var(--gutter); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
.band { padding-block: var(--band); }
.rule { border-top: 1px solid var(--border); }

/* Type. Headings are Geist Bold, tight, and big enough to do the work on their own. */
.h1, .h2 { font-weight: 700; text-wrap: balance; }
.h2 { font-size: clamp(44px, 7.4vw, 124px); line-height: calc(0.94 * var(--line-scale, 1)); letter-spacing: -0.05em; }
.h3 { font-size: clamp(24px, 2.5vw, 38px); line-height: calc(1.08 * var(--line-scale, 1)); letter-spacing: -0.035em; font-weight: 600; }
.h4 { font-size: 17px; line-height: calc(1.3 * var(--line-scale, 1)); letter-spacing: -0.02em; font-weight: 600; }
.lead { font-size: clamp(19px, 1.75vw, 26px); line-height: calc(1.32 * var(--line-scale, 1)); letter-spacing: -0.022em; color: var(--ink-2); text-wrap: pretty; max-width: 31em; }
.body { color: var(--ink-2); text-wrap: pretty; max-width: 36em; }
.small { font-size: 14px; line-height: calc(1.45 * var(--line-scale, 1)); color: var(--ink-2); }
.body a, .small a, .answer a, .lead a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--border-strong); }
.body a:hover, .small a:hover, .answer a:hover, .lead a:hover { text-decoration-color: var(--ink); }
.inline { font-size: 0.88em; background: var(--raised); border-radius: 4px; padding: 0.1em 0.34em; color: var(--ink); white-space: nowrap; }

/* Buttons, as in the app: monochrome, 10 px corners, a little spring on press. */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border-radius: 10px;
  font-weight: 500; font-size: 16px; text-decoration: none; white-space: nowrap;
  transition: transform 180ms var(--spring), background-color 120ms linear, border-color 120ms linear;
}
.button:active { transform: scale(0.96); }
.button.primary { background: var(--primary); color: var(--on-primary); }
.button.primary:hover { background: var(--ink-2); }
.button.secondary { background: var(--raised); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border-strong); }
.button.secondary:hover { background: var(--hover); }
.button.small-button { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.button.small-button .glyph { width: 16px; height: 16px; }
.button[aria-disabled='true'], .button:disabled { background: var(--raised); color: var(--ink-3); box-shadow: none; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* The top bar. Glass only once there's something behind it. */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  transition: background-color 180ms linear, box-shadow 180ms linear;
}
.nav.scrolled {
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: inset 0 -1px 0 var(--border);
}
.nav-inner { display: flex; align-items: center; gap: clamp(12px, 2vw, 28px); height: 64px; }
.nav-home { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; margin-right: auto; }
.nav-home svg { width: 26px; height: 26px; }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 1.8vw, 26px); }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--ink); }
.nav-tools { display: flex; align-items: center; gap: 8px; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; color: var(--ink-2); }
.icon-button:hover { background: var(--raised); color: var(--ink); }
.mark-ink { fill: var(--ink); }
.prism-a { fill: var(--prism-pink); }
.prism-b { fill: var(--prism-amber); }
.prism-c { fill: var(--prism-mint); }
.prism-d { fill: var(--prism-sky); }
@media (max-width: 860px) {
  .nav-links .wide-only { display: none; }
}
@media (max-width: 460px) {
  .nav-links { gap: 12px; }
  .nav-home span { display: none; }
}

/* The opening: a huge P, and the camera flies through its window into the gatehouse. */
.flight { position: relative; height: 270vh; height: 270svh; }
.flight-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; isolation: isolate; background: var(--canvas); }
.flight-scene { position: absolute; left: 0; top: 0; width: 480px; height: 320px; transform-origin: 0 0; z-index: 0; }
.flight-scene img { width: 480px; height: 320px; image-rendering: pixelated; }
.flight-mask { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; shape-rendering: crispEdges; }
/* The script puts these in place before they're first seen, so nothing jumps. */
.js .flight-stage:not(.ready) .flight-mask, .js .flight-stage:not(.ready) .flight-scene { visibility: hidden; }
.flight-wall { fill: var(--canvas); }
.prism-pixel { transform-box: fill-box; animation: hop 620ms steps(6, end) both; }
.prism-pixel:nth-of-type(2) { animation-delay: 90ms; }
.prism-pixel:nth-of-type(3) { animation-delay: 180ms; }
.prism-pixel:nth-of-type(4) { animation-delay: 270ms; }
@keyframes hop { 0%, 100% { transform: none; } 35% { transform: translateY(-55%); } 62% { transform: translateY(-14%); } }

/* No z-index or opacity on this box: either would make it a stacking context, and the headline could
   no longer blend with the mark behind it. */
.hero-copy {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end; gap: clamp(20px, 2.6vh, 32px);
  padding: 88px var(--gutter) clamp(24px, 4.4vh, 48px);
  pointer-events: none;
}
.hero-foot { position: relative; z-index: 2; pointer-events: auto; }
/* Difference keeps the headline readable wherever it crosses the P: dark on the mark, light off it. */
.h1 {
  position: relative; z-index: 2;
  font-size: min(11.8vw, 21vh); line-height: calc(0.86 * var(--line-scale, 1)); letter-spacing: -0.058em;
  color: #fff; mix-blend-mode: difference;
  margin-left: -0.04em;
}
.h1 span { display: block; }
.hero-foot { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: end; }
.hero-text { grid-column: 1 / span 5; display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.hero-text .lead { font-size: clamp(17px, 1.45vw, 21px); }
.hero-note { font-size: 13px; line-height: calc(1.4 * var(--line-scale, 1)); color: var(--ink-2); min-height: 18px; }
.hero-note .glyph { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }

.flight-caption {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0;
  padding: 0 var(--gutter) clamp(20px, 3.4vh, 40px);
  opacity: 0; visibility: hidden;
}
.flight-caption p { font-size: clamp(22px, 2.75vw, 44px); line-height: calc(1.08 * var(--line-scale, 1)); letter-spacing: -0.035em; font-weight: 600; color: var(--ink); max-width: 32em; text-wrap: balance; }
.flight-caption .quiet { color: var(--ink-2); display: block; }
[data-theme='light'] .flight-caption .quiet { color: #27272a; }

/* Upright screens put the P above the words, and the words below the scene on a page-coloured panel. */
.upright .hero-foot { display: block; }
.upright .flight-caption { background: var(--canvas); padding-top: 16px; border-top: 1px solid var(--border); }
.upright .flight-caption .quiet { color: var(--ink-2); }
@media (max-width: 719px) {
  .flight { height: 240vh; height: 240svh; }
  .h1 { font-size: min(16.6vw, 13vh); line-height: calc(0.88 * var(--line-scale, 1)); }
  .hero-text { gap: 12px; }
  .hero-text .lead { font-size: 16px; line-height: calc(1.34 * var(--line-scale, 1)); }
  .hero-copy { padding-bottom: 20px; gap: 14px; }
  .flight-caption p { font-size: 24px; }
  .hero-copy .button { min-height: 46px; padding: 0 16px; font-size: 15px; }
}
.calm .flight-mask, .calm .h1, .calm .hero-foot, .calm .flight-caption { transition: opacity 400ms linear, visibility 400ms linear; }
.arrived .flight-mask, .arrived .h1, .arrived .hero-foot { opacity: 0; visibility: hidden; }
.arrived .flight-caption { opacity: 1; visibility: visible; }
.no-flight .flight { height: auto; }
.no-flight .flight-stage { position: relative; }

/* Everything after the flight sits on the page's own colour and slides up over the last frame. */
main { position: relative; z-index: 1; background: var(--canvas); }

/* Wallet windows, always the real thing. */
.screen {
  position: relative; aspect-ratio: 435 / 600; overflow: hidden;
  border-radius: 14px; background: var(--canvas);
  box-shadow: 0 0 0 1px var(--border-strong), 0 12px 32px rgba(0, 0, 0, 0.6);
}
[data-theme='light'] .screen { box-shadow: 0 0 0 1px var(--border-strong), 0 12px 32px rgba(0, 0, 0, 0.12); }
.screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }

/* In plain words. The window beside them is taller than the tabs and code, so the slack goes under the code. */
.words-grid { grid-template-rows: auto auto 1fr; }
.words-head { grid-column: 1 / -1; margin-bottom: clamp(32px, 5vw, 80px); display: grid; gap: clamp(16px, 2vw, 28px); }
.words-tabs { grid-column: 1 / span 6; display: flex; flex-wrap: wrap; gap: 6px; align-self: start; margin-bottom: 24px; }
.chip {
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: background-color 120ms linear, color 120ms linear, transform 180ms var(--spring);
}
.chip:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--border-strong); }
.chip:active { transform: scale(0.96); }
.chip[aria-selected='true'] { background: var(--primary); color: var(--on-primary); box-shadow: none; font-weight: 600; }
.words-left { grid-column: 1 / span 6; display: flex; flex-direction: column; gap: clamp(20px, 2vw, 32px); }
.words-right { grid-column: 8 / span 5; grid-row: 2 / span 2; }
.words-right .screen { max-width: 470px; margin-left: auto; }
.words-site { display: flex; flex-direction: column; gap: 10px; }
.label { font: 400 13px/calc(1.2 * var(--line-scale, 1)) var(--mono); color: var(--ink-2); }
.words-note { display: flex; flex-direction: column; gap: 8px; }
.words-code { min-height: 13.5em; }
@media (max-width: 899px) {
  .words-tabs, .words-left { grid-column: 1 / -1; }
  .words-right { grid-column: 1 / -1; grid-row: auto; margin-top: 32px; }
  .words-right .screen { margin-inline: auto; max-width: min(100%, 420px); }
  .words-tabs { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
  .words-tabs::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .words-code { min-height: 0; }
}

/* The whole wallet: the list on the left, the window that goes with it held still on the right. */
.wallet-head { grid-column: 1 / -1; margin-bottom: clamp(32px, 6vw, 96px); display: grid; gap: clamp(16px, 2vw, 28px); }
.wallet-list { grid-column: 1 / span 7; }
.wallet-item { padding-block: clamp(32px, 11vh, 120px); display: grid; gap: 14px; border-top: 1px solid var(--border); }
.wallet-item:last-child { border-bottom: 1px solid var(--border); }
.wallet-item .h3 { font-size: clamp(30px, 4.3vw, 68px); line-height: calc(1 * var(--line-scale, 1)); letter-spacing: -0.045em; font-weight: 700; transition: color 240ms linear; }
.js .wallet-item:not(.is-active) .h3 { color: var(--ink-3); }
.wallet-item .inline-shot { display: none; }
.wallet-held { grid-column: 9 / span 4; position: sticky; top: max(88px, calc(50vh - 300px)); align-self: start; }
.wallet-held .screen img { position: absolute; inset: 0; opacity: 0; transition: opacity 240ms linear; }
.wallet-held .screen img.is-active { opacity: 1; }
@media (max-width: 899px) {
  .wallet-list { grid-column: 1 / -1; }
  .wallet-held { display: none; }
  .wallet-item { padding-block: 32px; }
  .js .wallet-item:not(.is-active) .h3 { color: var(--ink); }
  .wallet-item .inline-shot { display: block; margin-top: 12px; max-width: min(100%, 360px); }
}

/* What stays and what leaves. The one number gets the wallet's own pixel digits. */
.keys-head { grid-column: 1 / -1; margin-bottom: clamp(32px, 5vw, 72px); }
.pixel-figure { grid-column: 1 / span 7; display: flex; flex-direction: column; gap: 16px; align-self: start; }
.pixel-number { width: 100%; height: auto; color: var(--ink); shape-rendering: crispEdges; }
.pixel-number .mark { fill: var(--spark); }
.pixel-figure .body { max-width: 26em; }
.facts { grid-column: 9 / span 4; display: grid; align-self: start; }
.facts li { padding-block: 16px; border-top: 1px solid var(--border); display: grid; gap: 4px; }
.facts li:last-child { border-bottom: 1px solid var(--border); }
.ledger { grid-column: 1 / -1; margin-top: clamp(56px, 8vw, 120px); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 32px; }
.ledger-col.stays { grid-column: 1 / span 4; }
.ledger-col.leaves { grid-column: 5 / span 8; }
.ledger-col .h3 { margin-bottom: 18px; }
.ledger-row { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: var(--gap); padding-block: 16px; border-top: 1px solid var(--border); }
.stays .ledger-row { grid-template-columns: 1fr; }
.ledger-row:last-child { border-bottom: 1px solid var(--border); }
.ledger-row dt, .stays .ledger-row span { font-weight: 500; font-size: 16px; line-height: calc(1.4 * var(--line-scale, 1)); }
.ledger-row dd { color: var(--ink-2); font-size: 16px; line-height: calc(1.45 * var(--line-scale, 1)); text-wrap: pretty; }
.candour {
  grid-column: 1 / -1; margin-top: clamp(56px, 8vw, 120px);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 24px;
  padding-top: 24px; border-top: 2px solid var(--ink);
}
.candour-lead { grid-column: 1 / span 5; display: grid; gap: 14px; align-content: start; }
.candour-list { grid-column: 7 / span 6; display: grid; gap: 14px; }
.candour-list li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; color: var(--ink-2); font-size: 16px; line-height: calc(1.45 * var(--line-scale, 1)); }
.candour-list .glyph { margin-top: 2px; color: var(--ink-3); }
@media (max-width: 899px) {
  .pixel-figure, .facts, .ledger-col.stays, .ledger-col.leaves, .candour-lead, .candour-list { grid-column: 1 / -1; }
  .facts { margin-top: 32px; }
  .ledger-row { grid-template-columns: 1fr; row-gap: 2px; }
}

/* Open source: the town builds, full width, and the page carries on under it. */
.open-art { position: relative; overflow: hidden; height: clamp(300px, 46vw, 760px); background: var(--surface); }
.open-art img { position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); image-rendering: pixelated; width: max(100%, 960px); height: auto; }
.open-head { grid-column: 1 / span 9; display: grid; gap: clamp(16px, 2vw, 28px); }
.open-columns { grid-column: 1 / -1; margin-top: clamp(40px, 6vw, 96px); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 40px; }
.open-check { grid-column: 1 / span 7; display: grid; gap: 16px; align-content: start; }
.open-help { grid-column: 9 / span 4; display: grid; gap: 0; align-content: start; }
.open-help .h3 { margin-bottom: 16px; }
.line-link { display: grid; grid-template-columns: minmax(0, 1fr) 20px; gap: 12px; padding-block: 14px; border-top: 1px solid var(--border); text-decoration: none; }
.line-link:last-child { border-bottom: 1px solid var(--border); }
.line-link strong { font-weight: 500; display: block; }
.line-link span { color: var(--ink-2); font-size: 14px; line-height: calc(1.4 * var(--line-scale, 1)); display: block; }
.line-link .glyph { color: var(--ink-3); margin-top: 2px; transition: transform 180ms var(--spring), color 120ms linear; }
.line-link:hover .glyph { color: var(--ink); transform: translateX(3px); }
@media (max-width: 899px) {
  .open-head, .open-check, .open-help { grid-column: 1 / -1; }
}

/* Code: monochrome, the words that matter a step brighter. */
.code { position: relative; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); border-radius: 14px; overflow: hidden; }
.code-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px; box-shadow: inset 0 -1px 0 var(--border); min-height: 44px; }
.code-top .label { color: var(--ink-2); }
.copy { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); padding: 6px 8px; border-radius: 6px; flex: none; }
.copy:hover { background: var(--raised); color: var(--ink); }
.copy .glyph { width: 16px; height: 16px; }
.code pre { padding: 16px; overflow-x: auto; font-size: 13.5px; line-height: calc(1.6 * var(--line-scale, 1)); color: var(--ink-2); tab-size: 2; }
.code code { font-family: inherit; }
.tok-k, .tok-f { color: var(--ink); }
.tok-k { font-weight: 500; }
.tok-s { color: var(--ink); }
.tok-c { color: var(--ink-3); }

/* Build for it. */
.build-head { grid-column: 1 / span 6; display: grid; gap: clamp(16px, 2vw, 28px); align-content: start; }
.build-code { grid-column: 7 / span 6; display: grid; gap: 12px; align-content: start; }
.build-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.build-points { grid-column: 1 / -1; margin-top: clamp(40px, 6vw, 88px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 24px; }
.build-points li { border-top: 1px solid var(--border); padding-top: 14px; display: grid; gap: 6px; align-content: start; }
@media (max-width: 999px) {
  .build-head, .build-code { grid-column: 1 / -1; }
  .build-code { margin-top: 32px; }
}
@media (max-width: 719px) {
  .build-points { grid-template-columns: 1fr; }
}

/* Getting it. These really are steps, so they're numbered. */
.get-head { grid-column: 1 / span 6; display: grid; gap: 20px; align-content: start; }
.get-version { width: min(100%, 420px); height: auto; color: var(--ink); }
.checksum { display: grid; gap: 4px; padding-top: 14px; border-top: 1px solid var(--border); margin-top: 4px; }
.checksum dt { font: 400 13px/calc(1.4 * var(--line-scale, 1)) var(--mono); color: var(--ink); }
.checksum dd { font-size: 12px; line-height: calc(1.5 * var(--line-scale, 1)); color: var(--ink-2); overflow-wrap: anywhere; }
.checksum code { font-size: 12px; }
.get-steps { grid-column: 7 / span 6; counter-reset: step; display: grid; }
.get-steps li { counter-increment: step; display: grid; grid-template-columns: 44px minmax(0, 1fr); padding-block: 18px; border-top: 1px solid var(--border); }
.get-steps li:last-child { border-bottom: 1px solid var(--border); }
.get-steps li::before { content: counter(step); font: 400 15px/calc(1.5 * var(--line-scale, 1)) var(--mono); color: var(--ink-2); }
.get-steps .h4 { margin-bottom: 4px; }
.get-side { grid-column: 7 / span 6; margin-top: 18px; display: grid; gap: 8px; }
.new-in { display: grid; gap: 6px; }
@media (max-width: 899px) {
  .get-head, .get-steps, .get-side { grid-column: 1 / -1; }
  .get-steps { margin-top: 32px; }
}

/* Questions. */
.faq-head { grid-column: 1 / -1; margin-bottom: clamp(32px, 5vw, 72px); }
.faq-group { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); padding-block: clamp(20px, 2.4vw, 32px); border-top: 1px solid var(--border); }
.faq-group > .h3 { grid-column: 1 / span 4; position: sticky; top: 88px; align-self: start; }
.faq-list { grid-column: 5 / span 8; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: 0; }
.faq-item summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) 20px; gap: 16px;
  padding-block: 16px; font-size: clamp(17px, 1.4vw, 20px); font-weight: 500; line-height: calc(1.3 * var(--line-scale, 1)); letter-spacing: -0.02em;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .glyph { margin-top: 2px; color: var(--ink-3); }
.faq-item summary .minus { display: none; }
.faq-item[open] summary .plus { display: none; }
.faq-item[open] summary .minus { display: block; }
.faq-item summary:hover .glyph { color: var(--ink); }
.answer { color: var(--ink-2); padding: 0 36px 20px 0; max-width: 40em; text-wrap: pretty; display: grid; gap: 10px; }
@media (max-width: 899px) {
  .faq-group > .h3, .faq-list { grid-column: 1 / -1; }
  .faq-group > .h3 { position: static; margin-bottom: 8px; }
}
@supports (interpolate-size: allow-keywords) {
  .faq-item { interpolate-size: allow-keywords; }
  .faq-item::details-content { height: 0; overflow: clip; transition: height 280ms var(--spring), content-visibility 280ms allow-discrete; }
  .faq-item[open]::details-content { height: auto; }
}

.footer { border-top: 1px solid var(--border); padding-block: 40px 56px; position: relative; z-index: 1; background: var(--canvas); }
.footer-inner { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 32px; }
.footer-mark { grid-column: 1 / span 5; display: grid; gap: 12px; align-content: start; }
.footer-mark svg { width: 40px; height: 40px; }
.footer-links { grid-column: 7 / span 6; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px var(--gap); }
.footer-links h2 { font-size: 13px; font-weight: 400; color: var(--ink-2); margin-bottom: 10px; }
.footer-links a { display: block; padding-block: 4px; font-size: 14px; text-decoration: none; color: var(--ink); }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 719px) {
  .footer-mark, .footer-links { grid-column: 1 / -1; }
  .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The developers guide. */
.docs-hero { padding-top: clamp(120px, 15vw, 208px); padding-bottom: clamp(40px, 6vw, 88px); }
.docs-hero-grid { align-items: end; row-gap: 32px; }
.docs-title { grid-column: 1 / span 8; font-size: clamp(52px, 9vw, 152px); line-height: calc(0.9 * var(--line-scale, 1)); letter-spacing: -0.055em; font-weight: 700; }
.docs-lead { grid-column: 1 / span 7; margin-top: clamp(20px, 2.4vw, 32px); }
.status {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px; line-height: calc(1.3 * var(--line-scale, 1)); color: var(--ink-2);
  padding: 8px 12px 8px 10px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--border);
}
.status .glyph { width: 16px; height: 16px; }
.status[data-state='found'] { color: var(--ink); }
.status[data-state='found'] .glyph { color: var(--success); }
.docs-layout { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: clamp(24px, 4vw, 72px); align-items: start; }
.docs-index { position: sticky; top: 88px; display: grid; gap: 2px; max-height: calc(100vh - 112px); overflow-y: auto; scrollbar-width: none; }
.docs-index a { font-size: 14px; color: var(--ink-2); text-decoration: none; padding: 5px 0; display: block; }
.docs-index a:hover { color: var(--ink); }
.docs-index a.is-active { color: var(--ink); font-weight: 500; }
.docs-section { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: clamp(24px, 3vw, 56px); padding-block: clamp(36px, 5vw, 72px); border-top: 1px solid var(--border); }
.docs-section:first-child { border-top: 0; padding-top: 0; }
.docs-section.single { display: block; }
.docs-prose { display: grid; gap: 14px; align-content: start; }
.docs-prose .h3 { font-size: clamp(28px, 3vw, 44px); letter-spacing: -0.04em; font-weight: 700; margin-bottom: 4px; }
.docs-prose .h4 { margin-top: 10px; }
.docs-prose ul { display: grid; gap: 8px; color: var(--ink-2); }
.docs-prose li { padding-left: 16px; position: relative; text-wrap: pretty; }
.docs-prose li::before { content: ''; position: absolute; left: 0; top: 0.62em; width: 6px; height: 6px; background: var(--ink-3); }
.docs-code { display: grid; gap: 12px; align-content: start; min-width: 0; }
.docs-table-wrap { overflow-x: auto; }
.docs-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: calc(1.45 * var(--line-scale, 1)); }
.docs-table th { text-align: left; font-weight: 400; color: var(--ink-2); padding: 8px 12px 8px 0; font-size: 13px; }
.docs-table td { padding: 10px 12px 10px 0; border-top: 1px solid var(--border); color: var(--ink-2); vertical-align: top; }
.docs-table td:first-child { color: var(--ink); white-space: nowrap; }
.docs-table code { font-size: 13px; }
.keys-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.keys-row > div { padding-top: 12px; border-top: 2px solid var(--border-strong); display: grid; gap: 4px; align-content: start; }
.keys-row .refused { border-top-color: var(--danger); }
.try { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); border-radius: 14px; padding: 16px; display: grid; gap: 14px; }
.try-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.try-output { display: grid; gap: 12px; }
.try-output[hidden] { display: none; }
.try-pre { font-size: 12.5px; line-height: calc(1.55 * var(--line-scale, 1)); color: var(--ink-2); background: var(--raised); border-radius: 10px; padding: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.try-verdict { display: flex; gap: 8px; font-size: 14px; line-height: calc(1.4 * var(--line-scale, 1)); color: var(--ink); }
.try-verdict .glyph { width: 18px; height: 18px; margin-top: 1px; }
.try-verdict[data-state='match'] .glyph { color: var(--success); }
.try-verdict[data-state='mismatch'] .glyph { color: var(--danger); }
.ref-group { margin-top: clamp(32px, 4vw, 56px); }
.ref-group > .h4 { color: var(--ink-2); font-weight: 400; font-size: 14px; letter-spacing: -0.011em; margin-bottom: 8px; }
.ref-item { border-top: 1px solid var(--border); }
.ref-group .ref-item:last-child { border-bottom: 1px solid var(--border); }
.ref-item summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr) 20px; gap: 16px; padding-block: 12px; align-items: baseline; }
.ref-item summary::-webkit-details-marker { display: none; }
.ref-name { font: 500 14px/calc(1.4 * var(--line-scale, 1)) var(--mono); color: var(--ink); }
.ref-short { font-size: 14px; line-height: calc(1.4 * var(--line-scale, 1)); color: var(--ink-2); }
.ref-item summary .glyph { width: 16px; height: 16px; color: var(--ink-3); align-self: center; transition: transform 180ms var(--spring); }
.ref-item[open] summary .glyph { transform: rotate(180deg); }
.ref-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 40px); padding: 4px 0 24px; align-items: start; }
.ref-body > :only-child { grid-column: 1 / -1; }
.docs-footer-cta { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 1099px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); }
  .docs-index { display: none; }
  .docs-section { grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
  .ref-body { grid-template-columns: minmax(0, 1fr); }
  .docs-title, .docs-lead { grid-column: 1 / -1; }
}
@media (max-width: 719px) {
  .ref-item summary { grid-template-columns: minmax(0, 1fr) 20px; gap: 4px 12px; }
  .ref-short { grid-column: 1; grid-row: 2; }
  .ref-item summary .glyph { grid-column: 2; grid-row: 1 / span 2; }
  .keys-row { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .button:active, .chip:active { transform: none; }
  .line-link:hover .glyph { transform: none; }
}

/* Static language links remain usable with JavaScript disabled. */
.languages { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 32px; font-size: 14px; }
.languages a { color: var(--ink-2); text-decoration: none; padding-block: 4px; }
.languages a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.languages a[aria-current='page'] { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
/* Geist has no Chinese or Thai glyphs; the existing system-ui fallback supplies them. */
:root:lang(th) { --line-scale: 1.166667; }
html:lang(th) body, html:lang(th) body * { letter-spacing: 0 !important; }
html:lang(zh-Hans) :is(.h1, .h2, .h3, .h4, .docs-title) { letter-spacing: 0; }
html:lang(th) :is(.h1, .h2, .docs-title) { line-height: 1.2; }
@media (max-width: 719px) {
  html:not(:lang(en)) .nav-inner { flex-wrap: wrap; height: auto; min-height: 64px; padding-block: 10px; gap: 8px 12px; }
  html:not(:lang(en)) .nav-links { order: 3; flex-basis: 100%; justify-content: center; gap: 16px; }
  html:not(:lang(en)) .nav-links a { white-space: normal; text-align: center; }
  html:not(:lang(en)) .button { white-space: normal; text-align: center; padding-block: 8px; }
}

/* Each language's flag beside its name. Our own pixels (src/lib/flags.ts, written to /flags by scripts/flags-site.ts),
   not emoji: flag emoji differ from system to system and Windows has none. */
.languages a::before { content: ""; display: inline-block; width: 18px; height: 12px; margin-right: 6px; vertical-align: -1px; background: center / 100% 100% no-repeat; image-rendering: pixelated; }
.languages a[hreflang="en"]::before { background-image: url("/flags/en.svg"); }
.languages a[hreflang="es"]::before { background-image: url("/flags/es.svg"); }
.languages a[hreflang="de"]::before { background-image: url("/flags/de.svg"); }
.languages a[hreflang="fr"]::before { background-image: url("/flags/fr.svg"); }
.languages a[hreflang^="zh"]::before { background-image: url("/flags/zh.svg"); }
.languages a[hreflang="th"]::before { background-image: url("/flags/th.svg"); }
