/* ==========================================================================
   components.css - base type and every shared component.
   Rule: every colour, size and duration comes from tokens.css. The only raw
   values allowed here are 0, 1px hairlines (--hairline), and breakpoints
   inside @media. See "Design system" in CLAUDE.md.
   ========================================================================== */

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--ink); }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: var(--stroke) solid var(--accent); outline-offset: var(--space-1); }
code { font-family: var(--font-mono); font-size: 0.9em; color: var(--ink); }

h1 {
  font-family: var(--font-display); font-size: var(--text-4xl); line-height: var(--lh-display); letter-spacing: var(--tracking-display);
  font-weight: 500; margin: var(--space-5) 0; text-wrap: balance;
}
h1 em { font-style: normal; color: var(--accent); }
h2 {
  font-family: var(--font-display); font-size: var(--text-3xl); line-height: var(--lh-tight); letter-spacing: var(--tracking-heading);
  font-weight: 500; margin: var(--space-3) 0 0; text-wrap: balance;
}
h3 { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 500; letter-spacing: var(--tracking-title); margin: 0 0 var(--space-3); }
.eyebrow {
  font: 500 var(--text-xs)/var(--lh-none) var(--font-sans);
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--muted);
}
.lede { color: var(--muted); font-size: var(--text-lg); max-width: var(--measure-lede); margin: 0 0 var(--space-8); }
.muted { color: var(--muted); }
.note { font: 400 var(--text-sm)/var(--lh-copy) var(--font-sans); color: var(--muted); }
.fine { font-size: var(--text-sm); color: var(--muted); margin: var(--space-3) 0 0; }
.stack { display: flex; flex-direction: column; gap: var(--space-3); }

/* ---------- ASCII intro (index only) ---------- */
#intro { display: none; position: fixed; inset: 0; z-index: var(--z-intro); overflow: hidden; cursor: pointer; }
.js-intro #intro { display: block; }
.js-intro body { overflow: hidden; }
#intro.docking { pointer-events: none; cursor: default; }
#veil { position: absolute; inset: 0; background: var(--bg); }
#introCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* The header wordmark hides while the ASCII copy flies into its place. */
.js-intro .site-header .brand-word { opacity: 0; }
.brand-word { transition: opacity calc(var(--dur-slow) + 40ms) var(--ease); }
/* page reveal after the intro */
.rise { transition: opacity var(--dur-reveal) var(--ease), transform var(--dur-reveal) var(--ease-out); }
.js-intro.intro-running .rise { opacity: 0; transform: translateY(var(--space-3)); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font: inherit; font-size: var(--text-base); font-weight: 500;
  padding: var(--space-2) var(--space-4); white-space: nowrap; text-align: center;
  border: var(--hairline) solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--ink); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.btn--primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); }
.btn--sm { font-family: var(--font-sans); font-size: var(--text-sm); line-height: var(--lh-none); padding: var(--space-2) var(--space-3); }
/* disabled stays legible in both themes: muted text on a quiet fill, no fade */
.btn[disabled], .btn[disabled]:hover { background: var(--surface-2); border-color: var(--line); color: var(--muted); cursor: default; }
.linkbtn {
  background: none; border: 0; color: var(--muted); font: 500 var(--text-xs)/var(--lh-none) var(--font-sans);
  letter-spacing: var(--tracking-wide); text-transform: uppercase; cursor: pointer; padding: var(--space-2) 0;
}
.linkbtn:hover { color: var(--accent); }
.icon-btn {
  width: var(--size-icon-btn); height: var(--size-icon-btn); display: inline-grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); border: 0; padding: 0;
  font: 400 var(--text-2xl)/var(--lh-none) var(--font-sans); cursor: pointer; border-radius: var(--radius-sm);
}
.icon-btn svg { width: var(--size-icon); height: var(--size-icon); display: none; }
/* hover scramble glyph cells (site.js) */
.scr .ch { display: inline-block; text-align: center; white-space: pre; }
.scr .ch.x { color: var(--accent); }

/* ---------- header, nav, theme toggle ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: var(--z-header);
  background: var(--bg); border-bottom: var(--hairline) solid var(--line);
}
.site-header__bar { display: flex; align-items: center; gap: var(--space-4); padding-block: var(--space-3); }
/* The wordmark is the intro's word (Tektur 800, untracked caps) in solid --logo blue, with no separate mark (Sam). */
.brand {
  display: flex; align-items: center;
  font: 800 var(--text-lg)/var(--lh-none) var(--font-wordmark); text-transform: uppercase; color: var(--logo);
}
.nav {
  margin-left: auto; display: flex; align-items: center; gap: var(--space-1);
  background: var(--surface-2); padding: var(--space-2) var(--space-2);
}
.nav__link { font-size: var(--text-base); font-weight: 500; padding: var(--space-2) var(--space-4); white-space: nowrap; border: var(--hairline) solid transparent; }
.nav__link:hover { background: var(--bg); }
.nav__link[aria-current="page"] { background: var(--bg); box-shadow: inset 0 calc(-1 * var(--stroke)) 0 var(--accent); }
.site-header__tools { display: flex; align-items: center; gap: var(--space-2); }
.menu-toggle { display: none; transition: transform var(--dur-base) var(--ease); }
.menu-toggle[aria-expanded="true"] { transform: rotate(45deg); }
[data-theme-pref="light"] .theme-toggle .i-light,
[data-theme-pref="dark"] .theme-toggle .i-dark { display: block; }

/* ---------- sections, hero, section heads ---------- */
.hero { position: relative; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) var(--hairline), transparent var(--hairline)),
    linear-gradient(90deg, var(--grid-line) var(--hairline), transparent var(--hairline));
  background-size: var(--size-graph-paper) var(--size-graph-paper);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 70% 45%, var(--mask-on) 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 80% at 70% 45%, var(--mask-on) 30%, transparent 75%);
}
.section-head { margin-bottom: var(--space-9); }
.section-head p { color: var(--muted); font-size: var(--text-lg); margin: 0; max-width: var(--measure-copy); }
.actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.dots { position: relative; }
.dots::before {
  content: ""; position: absolute; z-index: -1;
  top: calc(-1 * var(--space-7)); right: calc(-1 * var(--space-2)); width: 62%; height: 70%;
  background: radial-gradient(circle, var(--brand-line) 1.3px, transparent 1.8px) 0 0 / var(--size-dot-grid) var(--size-dot-grid);
  -webkit-mask-image: linear-gradient(225deg, var(--mask-on) 10%, transparent 80%);
          mask-image: linear-gradient(225deg, var(--mask-on) 10%, transparent 80%);
}
@media (min-width: 768px) { .dots::before { right: calc(-1 * var(--space-7)); } }

/* ---------- spec list ---------- */
.spec { margin: var(--space-8) 0 0; max-width: var(--measure-lede); border-top: var(--hairline) solid var(--line); font: 400 var(--text-sm)/var(--lh-body) var(--font-sans); }
.spec > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-4); padding: var(--space-2) 0; border-bottom: var(--hairline) solid var(--line); }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; font-weight: 500; }

/* ---------- sheet / grid mock ---------- */
.sheet { margin: 0; background: var(--surface); border: var(--hairline) solid var(--line); font-family: var(--font-mono); font-size: var(--text-sm); }
.sheet__bar { display: flex; border-bottom: var(--hairline) solid var(--line); }
.sheet__ref { padding: var(--space-3); border-right: var(--hairline) solid var(--line); color: var(--muted); min-width: var(--size-row-head); }
.sheet__fx { padding: var(--space-3); overflow-x: auto; white-space: nowrap; min-width: 0; }
.sheet__fx b { color: var(--accent); font-weight: 500; }
.sheet__scroll { overflow-x: auto; }
.sheet__table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.sheet__table th, .sheet__table td { border: var(--hairline) solid var(--line); padding: var(--space-2) var(--space-3); text-align: left; white-space: nowrap; }
.sheet__table thead th, .sheet__table tbody th { background: var(--surface-2); color: var(--muted); font-weight: 400; text-align: center; font-size: var(--text-xs); }
.sheet__table tbody th { width: var(--size-row-head); }
.sheet__table td.num { text-align: right; }
.sheet__table .hdr td { color: var(--muted); }
.sheet__table td { transition: background-color var(--dur-slow) var(--ease); }
.sheet__table td.is-feeds.is-on { background: var(--accent-soft); box-shadow: inset 0 0 0 var(--hairline) var(--accent); }
.sheet__table td.is-crit.is-on { background: var(--accent-faint); }
.sheet__table td.is-target { color: var(--accent); font-weight: 500; box-shadow: inset 0 0 0 var(--stroke) var(--accent); }
.sheet__foot { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); align-items: center; padding: var(--space-3); border-top: var(--hairline) solid var(--line); color: var(--muted); font-size: var(--text-xs); }
.sheet__foot .btn { margin-left: auto; }
.sheet--lg { font-size: var(--text-base); }
.sheet--lg .sheet__table th, .sheet--lg .sheet__table td { padding: var(--space-3) var(--space-4); }
.key { display: inline-flex; align-items: center; gap: var(--space-2); }
.sw { width: var(--size-swatch); height: var(--size-swatch); display: inline-block; }
.sw--feeds { background: var(--accent-soft); box-shadow: inset 0 0 0 var(--hairline) var(--accent); }
.sw--crit { background: var(--accent-faint); border: var(--hairline) solid var(--line); }
.tag { border: var(--hairline) solid var(--line); padding: 2px var(--space-2); color: var(--ink); }
.spec .tag { font-weight: 400; color: var(--muted); margin-left: var(--space-2); white-space: nowrap; }

/* ---------- cards, tiles, numbered lists ---------- */
.card { border: var(--hairline) solid var(--line); background: var(--surface); padding: var(--space-7) var(--space-6); min-width: 0; }
.card--rec { border-color: var(--brand-line); background: linear-gradient(var(--accent-faint), var(--surface) 60%); }
.card--glass {
  position: relative; background: var(--glass); box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: var(--space-6);
}
.card-wrap { position: relative; isolation: isolate; }
.card-wrap::before {
  content: ""; position: absolute; z-index: -1; inset: calc(-1 * var(--space-5)) calc(-1 * var(--space-1)) calc(-1 * var(--space-5)) 30%;
  background: radial-gradient(circle, var(--brand-line) 1.3px, transparent 1.8px) 0 0 / var(--size-dot-grid) var(--size-dot-grid);
  -webkit-mask-image: linear-gradient(225deg, var(--mask-on) 10%, transparent 80%);
          mask-image: linear-gradient(225deg, var(--mask-on) 10%, transparent 80%);
}
@media (min-width: 640px) { .card-wrap::before { inset: calc(-1 * var(--space-5)) calc(-1 * var(--space-5)) calc(-1 * var(--space-5)) 30%; } }
.tile { padding: var(--space-7) var(--space-6); display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); }
.tile__big { font: 400 var(--text-stat)/var(--lh-none) var(--font-display); color: var(--accent); letter-spacing: var(--tracking-heading); }
.tile h3 { margin: 0; font-size: var(--text-lg); }
.tile p { margin: var(--space-1) 0 0; font-size: var(--text-sm); color: var(--muted); }
.tile:first-child p { color: var(--ink); }
.col-card { padding: var(--space-7) var(--space-6) var(--space-8); }
.col-card p { color: var(--muted); margin: 0; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; }
.steps li::before { content: counter(s); display: block; font: 500 var(--text-sm)/var(--lh-none) var(--font-mono); color: var(--accent); margin-bottom: var(--space-5); }
.quote { margin: 0; }
.quote blockquote { margin: 0; font-size: var(--text-quote); line-height: var(--lh-copy); letter-spacing: var(--tracking-title); }
.quote figcaption { margin: var(--space-3) 0 0; color: var(--muted); font: 500 var(--text-xs)/var(--lh-copy) var(--font-sans); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.quote cite { font-style: normal; }
.captions { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-5); counter-reset: c; }
.captions li { counter-increment: c; padding-left: var(--space-9); position: relative; color: var(--muted); }
.captions li::before {
  content: counter(c); position: absolute; left: 0; top: 2px; width: var(--size-icon); height: var(--size-icon);
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 500 var(--text-xs)/var(--lh-none) var(--font-mono);
}
.captions b { color: var(--ink); font-weight: 500; display: block; }
.numbered { list-style: none; counter-reset: w; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: var(--space-3); }
.numbered li { counter-increment: w; display: grid; grid-template-columns: var(--space-7) 1fr; color: var(--muted); }
.numbered li::before { content: counter(w); font: 500 var(--text-sm)/var(--lh-body) var(--font-mono); color: var(--accent); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chips li { border: var(--hairline) solid var(--line); background: var(--surface); padding: var(--space-2) var(--space-3); font: 500 var(--text-sm)/var(--lh-snug) var(--font-sans); }
.chips li::before { content: "✓ "; color: var(--accent); }
.badge { font: 500 var(--text-2xs)/var(--lh-none) var(--font-sans); letter-spacing: var(--tracking-wide); text-transform: uppercase; padding: var(--space-1) var(--space-2); background: var(--accent-soft); color: var(--accent); }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; border: var(--hairline) solid var(--line); }
.table { border-collapse: collapse; width: 100%; min-width: var(--table-min); font-size: var(--text-md); }
.table th, .table td { padding: var(--space-4); text-align: left; vertical-align: top; border-bottom: var(--hairline) solid var(--line); }
.table thead th { background: var(--surface-2); font: 500 var(--text-xs)/var(--lh-snug) var(--font-sans); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--muted); }
.table thead th.us { color: var(--ink); background: var(--accent-soft); }
.table tbody th { font-weight: 500; width: 20%; }
.table td { color: var(--muted); }
.table td.us { background: var(--accent-faint); color: var(--ink); }
.table tbody tr:last-child > * { border-bottom: 0; }

/* ---------- pledge ---------- */
.pledge {
  border: var(--hairline) solid var(--brand-line); outline: var(--hairline) solid var(--accent-soft); outline-offset: var(--space-1);
  padding: var(--space-10) clamp(var(--space-5), 5vw, var(--space-12)) var(--space-9); background: var(--accent-faint);
}
.commit { list-style: none; margin: var(--space-7) 0 0; padding: 0; }
.commit li { display: grid; grid-template-columns: var(--size-bullet) 1fr; column-gap: var(--space-4); padding: var(--space-4) 0; border-top: var(--hairline) solid var(--brand-line); }
.commit li::before { content: ""; grid-row: 1 / span 2; width: var(--size-bullet); height: var(--size-bullet); margin-top: var(--space-2); background: var(--brand); box-shadow: inset 0 0 0 var(--hairline) var(--accent); }
.commit b { font-weight: 500; font-size: var(--text-lg); grid-column: 2; }
.commit span { grid-column: 2; color: var(--muted); }
.sign { display: flex; align-items: flex-end; gap: var(--space-4); margin-top: var(--space-7); }
.sig { font: 400 var(--text-2xl)/var(--lh-none) var(--font-wordmark); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--accent); }
.sigline { flex: 1; border-bottom: var(--hairline) solid var(--accent); opacity: 0.5; margin-bottom: 3px; }
.band h2 { margin: 0; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: var(--space-5); }
.field__label { display: block; font-weight: 500; margin-bottom: var(--space-2); }
.field__label .req { color: var(--accent); }
.input {
  width: 100%; font: 400 var(--text-lg)/var(--lh-tight) var(--font-sans); padding: var(--space-3) var(--space-4);
  border: var(--hairline) solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius-sm);
}
.input:focus-visible { outline: var(--stroke) solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.help { color: var(--muted); font-size: var(--text-md); margin: var(--space-2) 0 0; }
.error { color: var(--danger); font-size: var(--text-md); margin: var(--space-2) 0 0; }
.error:empty { display: none; }
.check { display: flex; gap: var(--space-3); align-items: flex-start; font-size: var(--text-base); cursor: pointer; }
.check input { margin: var(--space-1) 0 0; width: var(--size-check); height: var(--size-check); accent-color: var(--accent); flex: none; }

/* ---------- download options, command boxes, passcode result ---------- */
.cmd { position: relative; border: var(--hairline) solid var(--line); background: var(--surface-2); padding: var(--space-3) var(--size-cmd-pad-end) var(--space-3) var(--space-4); font: 400 var(--text-sm)/var(--lh-copy) var(--font-mono); }
.cmd + .cmd { margin-top: calc(-1 * var(--space-2)); }
.cmd__label { display: block; font-family: var(--font-sans); color: var(--muted); font-size: var(--text-2xs); letter-spacing: var(--tracking-wide); text-transform: uppercase; margin-bottom: 2px; }
.cmd code { display: block; overflow-wrap: anywhere; font-size: var(--text-sm); }
.cmd .btn { position: absolute; top: var(--space-2); right: var(--space-2); }
.card .fname { font: 500 var(--text-md)/var(--lh-snug) var(--font-mono); color: var(--ink); }
.card h3.title-row { margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: center; }
.card p { margin: 0; color: var(--muted); }
.card .dl { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); padding-top: var(--space-2); }
.kv { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-2) 0; font: 400 var(--text-sm)/var(--lh-copy) var(--font-sans); border-bottom: var(--hairline) dashed var(--line); }
.kv span:first-child { color: var(--muted); flex: none; }
.kv span:last-child { text-align: right; overflow-wrap: anywhere; }
.label-row { font: 500 var(--text-xs)/var(--lh-none) var(--font-sans); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--muted); margin: var(--space-5) 0 var(--space-2); display: flex; justify-content: space-between; align-items: center; }
.code-box { font: 500 var(--text-base)/var(--lh-body) var(--font-mono); letter-spacing: 0.02em; overflow-wrap: anywhere; word-break: break-all; color: var(--ink); background: var(--accent-faint); border: var(--hairline) solid var(--accent-soft); padding: var(--space-4); margin: 0; user-select: all; transition: opacity var(--dur-base) var(--ease); }
.card .code-box { color: var(--ink); }
.card .code-box.empty { font-family: var(--font-sans); font-weight: 400; color: var(--muted); user-select: none; }
.rule { height: var(--hairline); background: var(--line); margin: var(--space-5) 0 var(--space-3); }
.counters { font: 400 var(--text-sm)/var(--lh-body) var(--font-sans); color: var(--muted); margin: 0; }
.counters b { color: var(--accent); font-weight: 500; }
@media (max-width: 639px) {
  .kv { flex-direction: column; gap: 2px; }
  .kv span:last-child { text-align: left; }
  .card { padding: var(--space-6) var(--space-4); }
}

/* ---------- install step cards ---------- */
.stepcard {
  text-align: left; font: inherit; color: inherit; cursor: pointer; background: var(--surface); border: var(--hairline) solid var(--line);
  padding: 0; display: flex; flex-direction: column; border-radius: var(--radius-sm);
  transition: border-color var(--dur-slow) var(--ease), background-color var(--dur-slow) var(--ease);
}
.stepcard.on { border-color: var(--brand-line); background: var(--accent-faint); box-shadow: inset 0 0 0 var(--hairline) var(--brand-line); }
.stepcard__ill { border-bottom: var(--hairline) solid var(--line); background: var(--surface); aspect-ratio: var(--ill-ratio); }
.stepcard.on .stepcard__ill { border-bottom-color: var(--brand-line); }
.stepcard__ill svg { width: 100%; height: 100%; display: block; }
.stepcard__txt { padding: var(--space-5) var(--space-5) var(--space-6); }
.stepcard__eb { font: 500 var(--text-xs)/var(--lh-none) var(--font-sans); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--muted); margin-bottom: var(--space-3); }
.stepcard.on .stepcard__eb { color: var(--accent); }
.stepcard h3 { margin-bottom: var(--space-2); }
.stepcard p { margin: 0; color: var(--muted); font-size: var(--text-base); }
.prog { height: var(--stroke); background: var(--line); margin-top: var(--space-4); overflow: hidden; }
.prog i { display: block; height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.prog.paused i { background: var(--brand-line); }
@media (max-width: 767px) {
  .stepcard { flex-direction: row; }
  .stepcard__ill { width: 42%; flex: none; aspect-ratio: auto; border-bottom: 0; border-right: var(--hairline) solid var(--line); }
}
@media (max-width: 639px) {
  .stepcard { flex-direction: column; }
  .stepcard__ill { width: auto; aspect-ratio: var(--ill-ratio); border-right: 0; border-bottom: var(--hairline) solid var(--line); }
}
.steps-cta { margin-top: var(--space-6); }
.step-ill { border: var(--hairline) solid var(--line); background: var(--surface); aspect-ratio: var(--ill-ratio); }
.step-ill svg { width: 100%; height: 100%; display: block; }
.eyebrow--step { display: block; color: var(--accent); margin: 0 0 var(--space-3); }
/* illustration motion */
.tile-drop { transform: translate(0, 0); }
.on .tile-drop { animation: drop 2.8s ease-in-out infinite; }
@keyframes drop { 0% { transform: translate(40px, -40px); opacity: 0; } 35%, 100% { transform: translate(0, 0); opacity: 1; } }
.on .ulin { animation: ul 2.8s ease-out infinite; transform-origin: left; transform-box: fill-box; }
@keyframes ul { 0% { transform: scaleX(0); } 40%, 100% { transform: scaleX(1); } }
/* illustration paint: SVG fills and strokes come from tokens so they follow the theme */
.fl-bg { fill: var(--bg); } .fl-surface-2 { fill: var(--surface-2); } .fl-ink { fill: var(--ink); } .fl-muted { fill: var(--muted); }
.fl-accent { fill: var(--accent); } .fl-soft { fill: var(--accent-soft); } .fl-faint { fill: var(--accent-faint); } .fl-brand { fill: var(--brand); }
.st-ink { stroke: var(--ink); } .st-line { stroke: var(--line); } .st-grid { stroke: var(--grid-line); } .st-accent { stroke: var(--accent); }

/* ---------- FAQ ---------- */
.accordion { border-top: var(--hairline) solid var(--line); }
.accordion details { border-bottom: var(--hairline) solid var(--line); }
.accordion summary { cursor: pointer; padding: var(--space-5) var(--space-10) var(--space-5) 0; font-size: var(--text-xl); font-weight: 500; list-style: none; position: relative; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; position: absolute; right: var(--space-2); top: var(--space-4); font: 400 var(--text-2xl)/var(--lh-snug) var(--font-sans); color: var(--accent); transition: transform var(--dur-base) var(--ease); }
.accordion details[open] summary::after { transform: rotate(45deg); }
.accordion details p { margin: 0 0 var(--space-5); color: var(--muted); max-width: var(--measure-faq); }

/* ---------- demo contract (features.html, index.html; see DESIGN-SYSTEM.md) ----------
   <figure class="demo col-span-12 md:col-span-6" data-demo="<id>">; every selector a demo adds is scoped
   under .demo[data-demo="<id>"] (or a .d-<id> prefix) in demos/<group>.css, tokens only. */
.demo { margin: 0; min-width: 0; background: var(--surface); border: var(--hairline) solid var(--line); display: flex; flex-direction: column; }
/* one look: stage, then the control row, then the caption, whatever the markup order */
.demo__stage { order: 0; } .demo__controls { order: 1; } .demo__cap { order: 2; }
.demo__stage { position: relative; background: var(--canvas-bg); border-bottom: var(--hairline) solid var(--line); }
.demo__stage canvas { display: block; width: 100%; cursor: pointer; }
.demo__controls { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; justify-content: flex-start; padding: var(--space-3); border-bottom: var(--hairline) solid var(--line); background: var(--surface-2); }
.demo__seg { display: inline-flex; border: var(--hairline) solid var(--line); background: var(--surface); }
.demo__seg button { font: 500 var(--text-sm)/var(--lh-none) var(--font-sans); color: var(--muted); background: none; border: 0; padding: var(--space-2) var(--space-3); cursor: pointer; transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.demo__seg button + button { border-left: var(--hairline) solid var(--line); }
.demo__seg button:hover { color: var(--ink); }
.demo__seg button:focus-visible { outline-offset: calc(-1 * var(--stroke)); }
.demo__seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.demo__seg button:disabled { color: var(--muted); background: var(--surface-2); cursor: default; }
.demo__cap { padding: var(--space-5) var(--space-6) var(--space-6); }
.demo__cap h3 { margin: 0 0 var(--space-1); }
.demo__cap p { margin: 0; color: var(--muted); font-size: var(--text-sm); }

/* ---------- footer ---------- */
/* Three columns from md: brand over the copyright line, an accordion of the site's sections, and a short
   promise with the two ways in. The <details> share one name, so opening a row closes the one open. */
.site-footer { border-top: var(--hairline) solid var(--line); padding-block: var(--space-10) var(--space-9); color: var(--muted); font-size: var(--text-md); interpolate-size: allow-keywords; }
.site-footer .grid { row-gap: var(--space-8); }
.site-footer__legal { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; }
.site-footer__nav details + details { border-top: var(--hairline) solid var(--line); }
.site-footer__nav summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-4) 0; list-style: none; cursor: pointer; color: var(--muted);
  transition: color var(--dur-fast) var(--ease);
}
.site-footer__nav summary::-webkit-details-marker { display: none; }
.site-footer__nav summary:hover, .site-footer__nav details[open] summary { color: var(--ink); }
.site-footer__nav summary::after {
  content: ""; flex: none; width: var(--space-2); height: var(--space-2);
  border-right: var(--hairline) solid currentColor; border-bottom: var(--hairline) solid currentColor;
  transform: translateY(-25%) rotate(45deg); transition: transform var(--dur-base) var(--ease);
}
.site-footer__nav details[open] summary::after { transform: translateY(25%) rotate(-135deg); }
/* the open panel slides; browsers without ::details-content just open it */
.site-footer__nav details::details-content {
  block-size: 0; overflow: hidden;
  transition: block-size var(--dur-base) var(--ease), content-visibility var(--dur-base) allow-discrete;
}
.site-footer__nav details[open]::details-content { block-size: auto; }
.site-footer__nav ul { list-style: none; margin: 0; padding: 0 0 var(--space-5); display: grid; gap: var(--space-3); }
.site-footer a { color: var(--muted); transition: color var(--dur-fast) var(--ease); }
.site-footer__nav a, .site-footer__side a { color: var(--ink); }
.site-footer a:hover { color: var(--accent); }
.site-footer__side h3 { margin: 0 0 var(--space-2); font: 500 var(--text-md)/var(--lh-snug) var(--font-sans); color: var(--ink); }
.site-footer__side p { margin: 0 0 var(--space-6); }
.site-footer__side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
@media (min-width: 768px) {
  .site-footer__brand, .site-footer__legal { grid-column-start: 1; }
  .site-footer__brand { align-self: start; }
  .site-footer__legal { grid-row: 2; align-self: end; }
  .site-footer__nav, .site-footer__side { grid-row: 1 / span 2; }
  .site-footer__nav { margin-top: calc(-1 * var(--space-4)); }   /* first row's text lines up with the brand */
}

/* ---------- narrow screens: nav collapses into a tray ---------- */
@media (max-width: 767px) {
  .menu-toggle { display: inline-grid; }
  .site-header__tools { margin-left: auto; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%; margin: 0;
    flex-direction: column; align-items: stretch; padding: var(--space-2) var(--gutter);
    background: var(--surface-2); border-bottom: var(--hairline) solid var(--line);
  }
  .nav.open { display: flex; }
  .nav__link { font-size: var(--text-2xl); padding: var(--space-3) var(--space-4); }
  .nav .btn { font-size: var(--text-2xl); padding: var(--space-3) var(--space-4); }
}
@media (min-width: 768px) { .site-header__tools { margin-left: var(--space-2); } }

.check a, #licenceNotice a { color: var(--accent); text-decoration: underline; }
.signups { margin: var(--space-5) 0 0; color: var(--muted); font-size: var(--text-md); }
.odo { font: 500 var(--text-lg)/1.2 var(--font-mono); color: var(--accent); }
.odo__col { display: inline-block; position: relative; overflow: hidden; width: 1ch; height: 1.2em; vertical-align: bottom; }
.odo__col span { position: absolute; left: 0; top: 0; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.odo__col span.enter { transform: translateY(100%); }
.odo__col span.leave { transform: translateY(-100%); }
.legal { max-width: 72ch; }
.legal h2 { margin: var(--space-9) 0 var(--space-3); font-size: var(--text-lg); }
.legal table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); }
.legal th, .legal td { border: var(--hairline) solid var(--line); padding: var(--space-2); text-align: left; vertical-align: top; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
