/* site.css: kit.v1d.io's own rules (rows 787 and 851), tokens only: the top bar, the Parts page, the page of a part with its preview, its tabs and its side column, and the lines the examples use. */
:root { --gutter: 32px; }
@media (max-width: 700px) { :root { --gutter: 16px; } }
html { background: var(--bg); color: var(--fg); font-family: var(--font); }
body { margin: 0; }
body[data-example] { padding: var(--space-3); }   /* a phone frame: the part, 12 px round it */
.topbar { display: flex; align-items: center; gap: calc(4 * var(--space-2)); padding: var(--space-4) var(--gutter); border-bottom: 1px solid var(--border); }
.brand { color: var(--fg); font-size: 26px; line-height: 0; }   /* the mark is sized by its parent's font-size */
.topbar nav { display: flex; align-items: center; gap: var(--space-6); }
.topbar nav a { display: flex; align-items: center; gap: var(--space-2); color: var(--muted); font-weight: 600; text-decoration: none; }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { color: var(--fg); }
.topbar .version { margin-left: auto; }
.topbar .part-chip { font-family: var(--font-mono); }
@media (max-width: 600px) {
  .brand { font-size: 22px; }
  .topbar { gap: var(--space-4); }
  .topbar nav { gap: var(--space-4); }
  .topbar nav a { flex-direction: column; justify-content: center; gap: 2px; font-size: var(--type-small); }
  .topbar .version { display: none; }
}
main, .site-foot { box-sizing: border-box; max-width: calc(1200px + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
/* row 1937: calm type (UX guideline §2): the site's titles 16 px at 600, never the browser's 700; the parts' own examples keep their sizes */
h1, h2, h3 { font-weight: 600; }
h1 { margin: 0 0 var(--space-2); font-size: var(--type-heading); }
.about { margin: 0 0 var(--space-4); color: var(--muted); max-width: 70ch; }
.muted { margin: 0; color: var(--muted); }
.muted a { color: var(--fg); }

/* the Parts page */
.page-title { margin: 0; padding: calc(4 * var(--space-2)) 0 var(--space-4); font-size: var(--type-heading); line-height: 1.2; }
/* the chips row stretches to the page and scrolls inside it under 900 px: a row shrunk to its content would be as wide as all its chips */
.tools { display: grid; gap: var(--space-4); padding-bottom: var(--space-6); }
.tools .part-search { justify-self: start; width: 100%; max-width: 520px; }
.parts-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  padding-bottom: calc(6 * var(--space-2)); }
.cell { display: flex; min-width: 0; }
.cell[hidden] { display: none; }
.cell > .part-card { flex: 1; }
/* the Rules page */
.rules { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  padding-bottom: calc(6 * var(--space-2)); }
.rules .none { grid-column: 1 / -1; margin: 0; color: var(--muted); }
.rule[hidden] { display: none; }
.rule-fix { margin: 0; color: var(--muted); line-height: 1.45; }
/* above the card's own link, so a chip goes to its part and the rest of the card to this one */
.uses { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-2); }
.card-foot { display: grid; gap: var(--space-2); }   /* what a part uses, then the apps that use it */
.uses-label { color: var(--muted); font-size: var(--type-small); font-weight: 600; }
.uses-chip { display: inline-flex; align-items: center; gap: var(--space-2); padding: 2px var(--space-3) 2px var(--space-1); border: 1px solid var(--border);
  border-radius: 999px;
  color: color-mix(in oklab, var(--fg) 82%, var(--muted)); font-size: var(--type-small); line-height: 1.2; text-decoration: none; white-space: nowrap; }
a.uses-chip:hover, .uses-more:hover { border-color: var(--control); color: var(--fg); }
.uses > .uses { flex-basis: 100%; }   /* the opened parts take their own row */
.uses[hidden] { display: none; }
.uses-more { font-family: inherit; background: none; cursor: pointer; }   /* "+N parts": the parts that use a part, folded */
.uses-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
a.uses-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* a box of 44 px to press under a finger */
@media (pointer: coarse) { a.uses-chip, .uses-more { position: relative; }
  a.uses-chip::after, .uses-more::after { content: ""; position: absolute; top: 50%; left: 50%; width: max(100%, 44px); height: 44px; transform: translate(-50%, -50%); } }
.parts-grid .none { grid-column: 1 / -1; margin: 0; color: var(--muted); }

/* the page of a part: its head, its tabs, the preview and the side column beside it (under it on a phone) */
.back { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-6) 0 var(--space-3); color: var(--muted); font-weight: 600;
  text-decoration: none; }
.back:hover { color: var(--fg); }
.part-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.part-head h1 { margin: 0; font-size: var(--type-heading); line-height: 1.2; }
.part-what { margin: var(--space-2) 0 0; color: var(--muted); max-width: 70ch; }
.page-tabs { display: flex; gap: var(--space-6); margin: var(--space-4) 0 var(--space-6); border-bottom: 1px solid var(--border); }
.page-tabs a { margin-bottom: -1px; padding: var(--space-3) 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600;
  text-decoration: none; }
.page-tabs a[aria-current="true"] { border-bottom-color: var(--fg); color: var(--fg); }
.part-layout { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); align-items: start; padding-bottom: calc(6 * var(--space-2)); }
@media (min-width: 900px) { .part-layout { grid-template-columns: minmax(0, 1fr) 320px; } }
.main-pane { display: grid; gap: var(--space-3); min-width: 0; }
.main-pane > .pane { min-width: 0; }   /* a long line of code scrolls inside its well, and never widens the page */
.mode-bar { margin-bottom: var(--space-4); }
.side { display: grid; gap: var(--space-4); min-width: 0; }
.side-row { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-1) 0; }
.info { position: relative; display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.info::after { content: ""; position: absolute; inset: -10px; }   /* a box of 44 px to press */
.info:hover, .info[aria-expanded="true"] { color: var(--fg); }
.info:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hint { margin: 0; color: var(--muted); font-size: var(--type-small); line-height: 1.4; }
.part-panel.closed .part-panel-head { cursor: pointer; }
.lines { display: grid; gap: var(--space-2); margin: 0; padding-left: var(--space-4); color: var(--muted); font-size: var(--type-small); line-height: 1.4; }
.lines[hidden] { display: none; }
.side-name { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; }
.side-link { color: var(--fg); text-decoration: none; }
.side-link:hover { text-decoration: underline; }
.ok { color: var(--live); }
.warn { color: var(--problem); }
iframe { display: block; box-sizing: content-box; width: 390px; max-width: 100%; height: 160px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.example-stack:not([hidden]) { display: grid; gap: var(--space-2); }
.example-caption { margin: var(--space-2) 0 0; color: var(--muted); font-size: var(--type-small); }
.example-none, .example-refused { margin: 0; padding: var(--space-3) var(--space-3); border-radius: var(--radius); background: var(--raised);
  font-size: var(--type-body); line-height: 1.5; }
.example-none { color: var(--muted); }
.example-refused { color: var(--warn); }
.site-foot { padding-top: calc(4 * var(--space-2)); padding-bottom: calc(6 * var(--space-2)); color: var(--muted); font-size: var(--type-small); }
#player video { display: block; width: 100%; max-width: 640px; border-radius: var(--radius); background: var(--card); }
#controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-3) 0; }
#controls input[type=range] { flex: 1 1 200px; min-width: 120px; }
.receipt { margin: 0; padding: var(--space-3) var(--space-3); border-radius: var(--radius); background: var(--raised); font-size: var(--type-small);
  overflow-x: auto; }

/* the Tokens page: sections of groups of swatches, rows and icons */
.token-section { display: grid; gap: var(--space-6); padding-bottom: calc(4 * var(--space-2)); }
.token-section > h2 { margin: 0; font-size: var(--type-heading); line-height: 1.2; }
.group { display: grid; gap: var(--space-3); }
.group > h3 { margin: 0; color: var(--muted); font-size: var(--type-small); }   /* a section label: 12 px sentence case in the muted colour */
.swatches { display: grid; gap: var(--space-4) var(--space-3); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.swatch { display: grid; gap: var(--space-1); align-content: start; min-width: 0; font-size: var(--type-small); }
.swatch-chip { height: 40px; border: 1px solid var(--border); border-radius: var(--radius-small); }
.swatch code, .token-row code { color: var(--fg); font-family: var(--font-mono); overflow-wrap: anywhere; }
.value { color: var(--muted); overflow-wrap: anywhere; }
.rows { display: grid; gap: var(--space-1); }
.token-row { display: grid; gap: var(--space-1) var(--space-4); align-items: center; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.2fr);
  padding: var(--space-2) 0; border-bottom: 1px solid var(--border); font-size: var(--type-small); }
@media (max-width: 700px) { .token-row { grid-template-columns: minmax(0, 1fr); } }
.sample { color: var(--fg); overflow-wrap: anywhere; }
.bar-well { display: block; min-width: 0; }
.bar-well > .bar { display: block; height: 8px; max-width: 100%; border-radius: 4px; background: var(--muted); }
.icons { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.icon-tile { display: grid; justify-items: center; align-content: center; gap: var(--space-2); min-width: 0; padding: var(--space-3) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--fg); font-size: var(--type-small); text-align: center; overflow-wrap: anywhere; }
.swatch[hidden], .token-row[hidden], .icon-tile[hidden], .group[hidden], .token-section[hidden] { display: none; }
/* the Cut page: the frame clock's card shows what the function says */
.clock-thumb { display: grid; gap: var(--space-1); padding: var(--space-3); font-variant-numeric: tabular-nums; }
.clock-thumb p { margin: 0; }
/* the Real jumps page (Skyvw row 73): the replay's stage, its corner and its pictures, as a jump's page in Skyvw has them */
.real-jumps-replay { margin: var(--space-3) 0; }
.real-jumps-stage > :first-child { position: absolute; inset: 0; width: 100%; height: 100%; }
.real-jumps-ground-status { position: absolute; bottom: var(--space-2); left: var(--space-2); padding: var(--space-1) var(--space-2); background: var(--bg);
  color: var(--fg); font-size: var(--type-small); }
.real-jumps-picture { display: block; }
.real-jumps-picture text { font-family: var(--font); font-size: var(--type-small); font-weight: 400; font-variant-numeric: tabular-nums; }
.real-jumps-corner { position: absolute; top: var(--space-2); right: var(--space-2); z-index: 6; display: grid; justify-items: end; gap: var(--space-1); pointer-events: none; }
.real-jumps-corner > b { padding: 0 var(--space-2); border-radius: var(--radius-small); background: color-mix(in oklab, var(--scrim) 70%, transparent);
  font-family: var(--font); font-size: var(--type-body); font-weight: 600; line-height: 24px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.real-jumps-corner > b + b { font-weight: 400; font-size: var(--type-small); line-height: 20px; color: var(--fg); }
.ground-bench-controls { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.cache-bench-controls { margin: var(--space-3) 0; }
.color-bench-controls { display: grid; gap: var(--space-1); margin: var(--space-4) 0; }
.color-bench-row { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); align-items: center; gap: var(--space-2); }
.color-bench-controls .part-range { min-width: 0; }
.color-bench-controls > button { justify-self: start; }
.color-bench-pictures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.color-bench-pictures[hidden] { display: none; }
.color-bench-pictures figure { margin: 0; min-width: 0; }
.color-bench-pictures canvas { display: block; width: 100%; height: auto; }
