/*
 * DesignAChip powered by Aizen, preview site stylesheet. Load css/tokens.css first, it holds the brand tokens.
 *
 * Contents
 *   1. Names used on this site, all pointing at the brand tokens (dark is the default, light is a full second theme)
 *   2. Base
 *   3. Shell, rail, top bar, preview bar
 *   4. Components (hud panel, buttons, tags, tables, forms)
 *   5. Template lights (DASH speed lines, HAYDN resonance pulses, LIAM slow glow)
 *   6. Pages (home, wizard, family, market, protect, claims, abilities, pricing, sign up)
 *   7. Start screen and world layer
 *   8. Reduced motion, paused motion and small screens
 *
 * Fonts. The brand names Chakra Petch, Schibsted Grotesk and JetBrains Mono. This site loads no font file
 * from anywhere, so those names apply only where a visitor already has them installed. Everyone else gets the
 * system fonts that follow them in the stack.
 * Motion. Nothing flashes. The fastest repeating change is a slow drift, pulse or breath with a period of
 * about two seconds or more. Every colour that carries text is checked by tests/contrast.test.js.
 */

/* 1. Names used on this site ------------------------------------------------------------- */
:root {
  --font-display: var(--cz-font-display);
  --font-body: var(--cz-font-body);
  --font-mono: var(--cz-font-mono);

  --bg: var(--cz-color-bg);
  --panel: color-mix(in srgb, var(--cz-color-surface) 88%, transparent);
  --panel-solid: var(--cz-color-surface);
  --panel-raised: color-mix(in srgb, var(--cz-color-surface) 90%, var(--cz-color-border-strong));
  --panel-inset: color-mix(in srgb, var(--cz-color-surface-sunken) 75%, transparent);
  --edge: var(--cz-color-hud-edge);
  --edge-strong: var(--cz-color-primary);
  --scrim: color-mix(in srgb, var(--cz-color-bg) 72%, transparent);
  --scrim-content: color-mix(in srgb, var(--cz-color-bg) 62%, transparent);

  --ink: var(--cz-color-text);
  --ink-2: var(--cz-color-text-muted);
  --link: var(--cz-color-link);
  --primary: var(--cz-color-primary);
  --primary-hover: var(--cz-color-primary-hover);
  --on-primary: var(--cz-color-on-primary);
  --focus: var(--cz-color-focus);

  --dash: var(--cz-color-realm-dash);
  --haydn: var(--cz-color-realm-haydn);
  --liam: var(--cz-color-realm-liam);

  --tone-ok: var(--cz-color-pass);
  --tone-warn: var(--cz-color-caution);
  --tone-fail: var(--cz-color-fail);
  --tone-info: var(--cz-color-primary);
  --tone-note: var(--cz-color-text-muted);
  --tone-derived: var(--cz-color-text);
  --tone-stop-bg: var(--cz-color-fail);
  --tone-stop-ink: var(--cz-color-bg);

  --radius: var(--cz-radius-md);
  --rail-w: 17rem;

  /* Colours the canvas world reads (js/world.js). Hex only, so the script can read them. */
  --w-sky-top: var(--cz-color-surface-sunken);
  --w-sky-mid: var(--cz-color-bg);
  --w-line: var(--cz-color-primary);
  --w-star: var(--cz-color-text);
  --w-dial: var(--cz-color-border-strong);
}

/* 2. Base --------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: var(--cz-weight-body) 1.0625rem/var(--cz-leading-body) var(--font-body);
  overflow-x: hidden;
}
[hidden] { display: none !important; }
img, svg, canvas { max-width: 100%; }
a { color: var(--link); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: var(--cz-focus-width) solid var(--focus); outline-offset: var(--cz-focus-offset); border-radius: 2px; }
::selection { background: var(--primary); color: var(--on-primary); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: var(--cz-weight-display); line-height: var(--cz-leading-heading); margin: 0 0 0.6em; letter-spacing: var(--cz-tracking-display); }
h1 { font-size: clamp(2.1rem, 1.2rem + 4.2vw, 3.6rem); text-shadow: var(--cz-glow-text); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.7vw, 2.25rem); margin-top: 0; text-shadow: var(--cz-glow-text); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li { margin-bottom: 0.3em; }
code, pre, kbd { font-family: var(--font-mono); font-size: 0.88em; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
hr { border: 0; border-top: 1px solid var(--cz-color-border); margin: 2rem 0; }
dl { margin: 0; }
dt { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: var(--cz-tracking-label); text-transform: uppercase; color: var(--ink-2); }
dd { margin: 0 0 0.7em; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 0.75rem; top: -4rem; z-index: 200; padding: 0.7rem 1rem; background: var(--primary); color: var(--on-primary); font-weight: 600; border-radius: var(--radius); }
.skip:focus { top: 0.75rem; }
.prose { max-width: var(--cz-measure); }
.muted { color: var(--ink-2); }
.small { font-size: 0.9rem; }
.mono { font-family: var(--font-mono); }
.label { font-family: var(--font-mono); font-weight: var(--cz-weight-mono); font-size: 0.75rem; letter-spacing: var(--cz-tracking-label); text-transform: uppercase; color: var(--ink-2); }
.eyebrow { font-family: var(--font-mono); font-weight: var(--cz-weight-mono); font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 0.9rem; }

/* 3. Shell, rail, top bar, preview bar ---------------------------------------------------- */
.shell { display: block; min-height: 100vh; }

.preview-bar {
  display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; align-items: baseline; justify-content: center;
  padding: 0.55rem 1rem;
  background: var(--cz-color-surface-sunken);
  border-bottom: 2px solid var(--tone-warn);
  color: var(--ink); font-size: 0.92rem; line-height: 1.4; text-align: center;
}
.preview-bar strong { font-family: var(--font-mono); font-weight: var(--cz-weight-mono); letter-spacing: var(--cz-tracking-label); text-transform: uppercase; color: var(--tone-warn); }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 1rem;
  background: var(--scrim);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--edge);
}
.topbar .brand { margin-right: auto; }
.brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
.logo { display: block; height: auto; }
.topbar .logo { width: 11rem; }
.rail .logo { width: 13.5rem; }
.logo--light { display: none; }
:root[data-theme="light"] .logo--dark { display: none; }
:root[data-theme="light"] .logo--light { display: block; }

.aizen-block { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; color: var(--ink-2); }
.aizen-plate { display: inline-flex; background: #07131A; padding: 4px; border-radius: 4px; flex: none; }
.aizen-plate img { width: 32px; height: 32px; display: block; }
.aizen-block strong { color: var(--ink); font-weight: 600; }

.rail { display: none; padding: 0.5rem 1rem 1rem; background: var(--panel-solid); border-bottom: 1px solid var(--edge); }
.rail.is-open { display: block; }
.rail ol { list-style: none; margin: 0; padding: 0; }
.rail li { margin: 0; }
.rail a.nav-link {
  display: flex; align-items: baseline; gap: 0.8rem;
  padding: 0.7rem 0.6rem; min-height: 44px;
  text-decoration: none; color: var(--ink);
  border-left: 3px solid transparent;
}
.rail a.nav-link .n { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-2); letter-spacing: 0.08em; }
.rail a.nav-link:hover { background: var(--panel-inset); }
.rail a.nav-link[aria-current="page"] { border-left-color: var(--primary); background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 14%, transparent), transparent); font-weight: 600; }
.rail__foot { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--edge); font-size: 0.85rem; color: var(--ink-2); display: grid; gap: 0.8rem; }
.rail__foot .label { display: block; margin-bottom: 0.25rem; }
.rail__tools { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; min-width: 44px; padding: 0.4rem 0.8rem;
  background: var(--panel-inset); color: var(--ink);
  border: 1px solid var(--edge); border-radius: var(--radius);
  font: 500 0.9rem var(--font-body); cursor: pointer;
}
.icon-btn:hover { border-color: var(--edge-strong); }
.icon-btn[aria-pressed="true"] { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, var(--panel-inset)); }

main { display: block; padding: 1.25rem 1rem 3rem; outline: none; }
.wrap { max-width: 72rem; margin: 0 auto; }

.page { display: none; position: relative; }
.page.is-active { display: block; }
/* A readability plane behind the page text, so text stays legible wherever the glow of the world sits. */
.page.wrap::before { content: ""; position: absolute; z-index: -1; inset: -0.8rem -1rem; background: var(--scrim-content); border-radius: 6px; pointer-events: none; }
.no-js .page { display: block; margin-bottom: 3rem; }
/* Only the title moves in, and only by a few pixels, so no content is ever hidden by an animation that has not run. */
.page.is-active > h1, .page.is-active > .hero h1, .page.is-active > .start-head h1 { animation: title-in var(--cz-motion-slow) var(--cz-motion-ease); }
@keyframes title-in { from { transform: translateY(6px); } to { transform: none; } }

.site-footer { padding: 2rem 1rem 3rem; border-top: 1px solid var(--edge); background: var(--scrim); font-size: 0.92rem; color: var(--ink-2); }
.site-footer p { margin: 0 0 0.6em; max-width: 80ch; }
.site-footer strong { color: var(--ink); }
.site-footer .aizen-block { margin: 1rem 0; }
.footer-notice { padding: 0.8rem 1rem; border-left: 3px solid var(--tone-warn); background: var(--panel-inset); max-width: 80ch; margin-bottom: 1rem; color: var(--ink); }
.footer-notice p { color: var(--ink); }

@media (min-width: 70em) {
  .shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); grid-template-rows: 1fr auto; }
  .topbar { display: none; }
  .rail {
    display: block; position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
    grid-row: 1 / span 2;
    padding: 1.4rem 0.9rem 1.2rem;
    border-bottom: 0; border-right: 1px solid var(--edge);
    background: linear-gradient(180deg, color-mix(in srgb, var(--cz-color-surface-sunken) 94%, transparent), color-mix(in srgb, var(--cz-color-surface-sunken) 76%, transparent));
  }
  .rail .brand { margin: 0 0.4rem 1.6rem; }
  main { padding: 2.2rem clamp(1.5rem, 3.5vw, 3.5rem) 4rem; }
  .site-footer { grid-column: 2; padding: 2rem clamp(1.5rem, 3.5vw, 3.5rem) 3rem; }
}
@media (max-width: 69.99em) { .rail .brand { display: none; } }
@media (max-width: 39.99em) { .rail__tools { display: none; } .rail.is-open .rail__tools { display: flex; } }

/* 4. Components --------------------------------------------------------------------------- */
/* A HUD panel has two cut corners (top right, bottom left) and two corner brackets (top left, bottom right). The cut and bracket sizes are brand tokens. */
.hud {
  --cut: var(--cz-hud-cut);
  position: relative;
  border: 1px solid var(--edge);
  border-radius: 0;
  padding: 1.1rem 1.15rem;
  background:
    linear-gradient(to bottom left, transparent 50%, var(--edge) 50% calc(50% + 1.5px), transparent calc(50% + 1.5px)) top right / var(--cut) var(--cut) no-repeat,
    linear-gradient(to top right, transparent 50%, var(--edge) 50% calc(50% + 1.5px), transparent calc(50% + 1.5px)) bottom left / var(--cut) var(--cut) no-repeat,
    var(--panel);
  background-origin: border-box;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  box-shadow: inset 0 0 24px color-mix(in srgb, var(--primary) 6%, transparent);
}
.hud::before, .hud::after {
  content: ""; position: absolute; width: var(--cz-hud-bracket); height: var(--cz-hud-bracket); pointer-events: none;
  border: 2px solid var(--primary);
}
.hud::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.hud::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.hud > .label:first-child { display: block; margin-bottom: 0.7rem; }
.hud--raised { background-color: var(--panel-raised); background-image:
  linear-gradient(to bottom left, transparent 50%, var(--edge) 50% calc(50% + 1.5px), transparent calc(50% + 1.5px)),
  linear-gradient(to top right, transparent 50%, var(--edge) 50% calc(50% + 1.5px), transparent calc(50% + 1.5px)),
  linear-gradient(var(--panel-raised), var(--panel-raised)); }
.hud--flat { clip-path: none; }
.hud--flat::before, .hud--flat::after { display: none; }
.hud h2, .hud h3 { margin-top: 0; }
.hud > :last-child { margin-bottom: 0; }

.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.stack > * + * { margin-top: 1rem; }
.section { margin-top: clamp(2rem, 5vw, 3.5rem); }
.section > h2 { margin-bottom: 0.4em; }
.section > .lede { margin-bottom: 1.2rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 46px; padding: 0.55rem 1.15rem;
  background: var(--panel-inset); color: var(--ink);
  border: 1px solid var(--edge-strong); border-radius: var(--radius);
  font: 600 1rem var(--font-body); text-decoration: none; cursor: pointer;
  transition: background-color var(--cz-motion-base), border-color var(--cz-motion-base);
}
.btn:hover { background: var(--panel-raised); }
.btn--primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); box-shadow: var(--cz-glow-pulse); }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn--quiet { border-color: var(--edge); font-weight: 500; }
.btn--small { min-height: 40px; padding: 0.35rem 0.8rem; font-size: 0.92rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

/* Tags. Evidence labels, check results, statuses. Always text with a shape, never colour alone. */
.tag {
  --t: var(--tone-note);
  display: inline-flex; align-items: center; gap: 0.4em;
  padding: 0.12em 0.55em 0.12em 0.45em;
  font-family: var(--font-mono); font-size: 0.74rem; font-weight: var(--cz-weight-mono); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--t); border: 1px solid currentColor; border-radius: 3px;
  background: var(--panel-inset); white-space: nowrap; vertical-align: 0.1em;
}
.tag::before { content: ""; width: 0.62em; height: 0.62em; background: currentColor; flex: none; }
.tag--VERIFIED, .tag--PASS, .tag--built, .tag--available { --t: var(--tone-ok); }
.tag--VERIFIED::before, .tag--PASS::before, .tag--built::before, .tag--available::before { border-radius: 50%; }
.tag--SUPPORTED { --t: var(--tone-info); }
.tag--SUPPORTED::before { clip-path: inset(10% round 2px); }
.tag--ESTIMATE, .tag--REVIEW, .tag--partly_built, .tag--PROPOSAL { --t: var(--tone-warn); }
.tag--ESTIMATE::before, .tag--REVIEW::before, .tag--partly_built::before, .tag--PROPOSAL::before { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.tag--DERIVED, .tag--GOAL_ONLY { --t: var(--tone-derived); }
.tag--DERIVED::before { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.tag--GOAL_ONLY::before { background: transparent; border: 2px solid currentColor; border-radius: 50%; }
.tag--CONTESTED, .tag--FAIL { --t: var(--tone-fail); }
.tag--CONTESTED::before, .tag--FAIL::before { clip-path: polygon(20% 0, 50% 30%, 80% 0, 100% 20%, 70% 50%, 100% 80%, 80% 100%, 50% 70%, 20% 100%, 0 80%, 30% 50%, 0 20%); }
.tag--UNKNOWN, .tag--NOTE, .tag--planned { --t: var(--tone-note); border-style: dashed; }
.tag--UNKNOWN::before, .tag--NOTE::before, .tag--planned::before { background: transparent; border: 2px dotted currentColor; border-radius: 50%; }
.tag--STOP, .tag--HOLD { background: var(--tone-stop-bg); color: var(--tone-stop-ink); border-color: var(--tone-stop-bg); }
.tag--STOP::before, .tag--HOLD::before { clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.tag--tpl { text-transform: none; letter-spacing: 0.02em; }
/* The template marker shapes from the brand rules, triangle for DASH, diamond for HAYDN, dot for LIAM. */
.tag--rdash { --t: var(--dash); }
.tag--rdash::before { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.tag--rhaydn { --t: var(--haydn); }
.tag--rhaydn::before { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.tag--rliam { --t: var(--liam); }
.tag--rliam::before { border-radius: 50%; }
.tag--pro { --t: var(--primary); }
.tag--ultra { --t: var(--cz-color-text); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--cz-color-border); border-radius: var(--radius); background: var(--panel); }
.table-wrap:focus-visible { outline-offset: -3px; }
table { border-collapse: collapse; width: 100%; font-size: 0.96rem; }
caption { text-align: left; padding: 0.7rem 0.9rem; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: var(--cz-tracking-label); text-transform: uppercase; color: var(--ink-2); }
th, td { padding: 0.65rem 0.9rem; text-align: left; vertical-align: top; border-top: 1px solid var(--cz-color-border); }
thead th { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: var(--cz-tracking-label); text-transform: uppercase; color: var(--ink-2); font-weight: var(--cz-weight-mono); background: var(--panel-inset); border-top: 0; }
tbody th { font-weight: 600; }
td ul { margin: 0; padding-left: 1.1em; }
.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }

/* Forms */
.field { margin: 0 0 1.25rem; }
.field > label, .field > legend, .field-label { display: block; font-weight: 600; margin-bottom: 0.3rem; padding: 0; }
.field .req { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tone-warn); margin-left: 0.5rem; font-weight: var(--cz-weight-mono); }
.field .help { display: block; font-size: 0.9rem; color: var(--ink-2); margin-bottom: 0.45rem; max-width: 62ch; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
input[type="text"], input[type="number"], input[type="email"], select, textarea {
  width: 100%; max-width: 40rem; min-height: 46px; padding: 0.55rem 0.75rem;
  background: var(--panel-inset); color: var(--ink);
  border: 1px solid var(--cz-color-border-strong); border-radius: var(--radius);
  font: 400 1rem var(--font-body);
}
input[type="number"] { font-family: var(--font-mono); }
textarea { min-height: 6.5rem; resize: vertical; line-height: 1.5; }
select { appearance: auto; }
input:hover, select:hover, textarea:hover { border-color: var(--edge-strong); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 1px; }
.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choice {
  position: relative; display: inline-flex; align-items: center; gap: 0.55rem;
  min-height: 44px; padding: 0.35rem 0.8rem 0.35rem 0.6rem;
  background: var(--panel-inset); border: 1px solid var(--cz-color-border-strong); border-radius: var(--radius); cursor: pointer;
}
.choice:hover { border-color: var(--edge-strong); }
.choice input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--primary); }
.choice:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--panel-inset)); }
.choice:has(input:focus-visible) { outline: var(--cz-focus-width) solid var(--focus); outline-offset: var(--cz-focus-offset); }

.callout { padding: 0.9rem 1.1rem; border-left: 4px solid var(--edge-strong); background: var(--panel-inset); border-radius: 0 var(--radius) var(--radius) 0; }
.callout > :last-child { margin-bottom: 0; }
.callout--warn { border-left-color: var(--tone-warn); }
.callout--fail { border-left-color: var(--tone-fail); }
.callout--ok { border-left-color: var(--tone-ok); }
.callout .label { display: block; margin-bottom: 0.3rem; }

details { border: 1px solid var(--cz-color-border); border-radius: var(--radius); background: var(--panel); margin-bottom: 0.7rem; }
summary { cursor: pointer; padding: 0.75rem 1rem; font-weight: 600; min-height: 44px; list-style-position: inside; }
summary:hover { background: var(--panel-inset); }
details[open] > summary { border-bottom: 1px solid var(--cz-color-border); }
details > .details-body { padding: 1rem; }
details > .details-body > :last-child { margin-bottom: 0; }

.status-line { min-height: 1.5em; font-size: 0.95rem; color: var(--ink-2); }
.copy-box { font-family: var(--font-mono); font-size: 0.95rem; word-break: break-all; padding: 0.7rem 0.9rem; background: var(--panel-inset); border: 1px solid var(--cz-color-border); border-radius: var(--radius); }

/* Rendered markdown of the downloadable documents */
.md { max-width: 80ch; }
.md h3 { font-size: 1.45rem; text-shadow: none; }
.md h4 { font-size: 1.15rem; margin-top: 1.4rem; }
.md blockquote { margin: 0 0 1em; padding: 0.5rem 1rem; border-left: 3px solid var(--edge-strong); background: var(--panel-inset); }
.md .table-wrap { margin-bottom: 1rem; }

/* 5. Template lights ------------------------------------------------------------------------- */
.tpl { --r: var(--dash); position: relative; overflow: hidden; isolation: isolate; }
.tpl--dash { --r: var(--dash); }
.tpl--haydn { --r: var(--haydn); }
.tpl--liam { --r: var(--liam); }
.tpl.hud { border-color: color-mix(in srgb, var(--r) 60%, transparent); }
.tpl.hud::before, .tpl.hud::after { border-color: var(--r); }
.tpl__name { font-family: var(--font-mono); font-weight: var(--cz-weight-mono); font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--r); margin: 0 0 0.35rem; display: flex; align-items: center; gap: 0.5em; }
.tpl__name::before { content: ""; width: 0.7em; height: 0.7em; background: currentColor; flex: none; }
.tpl--dash .tpl__name::before { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.tpl--haydn .tpl__name::before { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.tpl--liam .tpl__name::before { border-radius: 50%; }
.tpl h3 { margin-bottom: 0.4em; }
.fx { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.8; }
:root[data-theme="light"] .fx { opacity: 0.55; }

/* DASH, speed lines */
.fx--dash::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(90deg, transparent, var(--dash)), linear-gradient(90deg, transparent, var(--dash)),
    linear-gradient(90deg, transparent, var(--dash)), linear-gradient(90deg, transparent, var(--dash)),
    linear-gradient(90deg, transparent, var(--dash)), linear-gradient(90deg, transparent, var(--dash));
  background-size: 150px 2px, 90px 1px, 210px 2px, 120px 1px, 180px 1px, 110px 2px;
  background-position: 0 14%, 40px 30%, 80px 46%, 20px 62%, 100px 78%, 60px 92%;
  background-repeat: repeat-x;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 100%);
  opacity: 0.5;
  animation: dash-run 2.6s linear infinite;
}
@keyframes dash-run { to { background-position: 150px 14%, 130px 30%, 290px 46%, 140px 62%, 280px 78%, 170px 92%; } }

/* HAYDN, layered resonance pulses */
.fx--haydn i {
  position: absolute; left: 78%; top: 28%; width: 28rem; height: 28rem; margin: -14rem 0 0 -14rem; border-radius: 50%;
  border: 2px solid var(--haydn); opacity: 0; transform: scale(0.1);
  animation: haydn-pulse 6s ease-out infinite;
}
.fx--haydn i:nth-child(2) { animation-delay: 2s; }
.fx--haydn i:nth-child(3) { animation-delay: 4s; }
@keyframes haydn-pulse { 0% { transform: scale(0.08); opacity: 0.7; } 70% { opacity: 0.12; } 100% { transform: scale(1); opacity: 0; } }

/* LIAM, a slow glow. The breath is 6 seconds, between 70 and 100 percent, as the brand motion rules allow. */
.fx--liam::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 108%, color-mix(in srgb, var(--liam) 55%, transparent), color-mix(in srgb, var(--liam) 12%, transparent) 55%, transparent 75%);
  animation: ember-breathe var(--cz-motion-breathe) ease-in-out infinite;
}
.fx--liam i { position: absolute; bottom: -6px; width: 4px; height: 4px; background: var(--liam); opacity: 0; animation: ember-rise 11s ease-in infinite; }
.fx--liam i:nth-child(1) { left: 22%; animation-delay: 0s; }
.fx--liam i:nth-child(2) { left: 55%; animation-delay: 4s; width: 3px; height: 3px; }
.fx--liam i:nth-child(3) { left: 80%; animation-delay: 7.5s; }
@keyframes ember-breathe { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }
@keyframes ember-rise { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 0.8; } 100% { transform: translateY(-9rem); opacity: 0; } }

/* Template cards in the wizard */
.pick-card { position: relative; display: block; cursor: pointer; }
.pick-card > input { position: absolute; opacity: 0; width: 100%; height: 100%; top: 0; left: 0; margin: 0; cursor: pointer; z-index: 2; }
.pick-card .hud { display: block; height: 100%; padding-bottom: 1.3rem; transition: border-color var(--cz-motion-base), box-shadow var(--cz-motion-base); }
.pick-card:hover .hud { border-color: var(--r); }
.pick-card > input:checked + .hud { border-color: var(--r); box-shadow: inset 0 0 0 2px var(--r), inset 0 0 30px color-mix(in srgb, var(--r) 22%, transparent); background-color: var(--panel-raised); }
.pick-card > input:focus-visible + .hud { outline: var(--cz-focus-width) solid var(--focus); outline-offset: -5px; }
.pick-card .pick { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 0.4rem; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.pick-card .pick::before { content: ""; width: 1rem; height: 1rem; border: 2px solid var(--r); border-radius: 3px; }
.pick-card > input:checked + .hud .pick { color: var(--r); }
.pick-card > input:checked + .hud .pick::before { background: var(--r); box-shadow: inset 0 0 0 3px var(--panel-solid); }
.stat-list { list-style: none; padding: 0; margin: 0.6rem 0 0; font-size: 0.92rem; }
.stat-list li { padding-left: 1rem; position: relative; margin-bottom: 0.2rem; }
.stat-list li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 0.45rem; height: 2px; background: var(--r); }

/* 6. Pages -------------------------------------------------------------------------------- */
.hero { display: grid; gap: 1.5rem; align-items: start; padding-top: clamp(0.5rem, 3vw, 2rem); }
.hero h1 { max-width: 16ch; text-wrap: balance; }
.hero .lead { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem); max-width: 56ch; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 1rem; }
.hero .fineprint { font-size: 0.92rem; color: var(--ink-2); }
@media (min-width: 62em) { .hero { grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 0.8fr); gap: 3rem; } }
.status-panel dl { display: grid; grid-template-columns: 1fr; gap: 0; }
.status-panel dd { font-family: var(--font-mono); font-size: 0.92rem; margin-bottom: 0.9rem; }
.status-panel .status-mark { display: block; width: 6rem; height: auto; margin: 0 0 1rem; }

.steps-3 { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.steps-3 li { counter-increment: s; margin: 0; }
.steps-3 .num-badge { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; line-height: 1; color: var(--primary); display: block; margin-bottom: 0.4rem; }

.example-card h3 { font-size: 1.1rem; }
.example-card .verdict { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; margin: 0.2rem 0 0.4rem; }
.example-card .tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.6rem 0; }

/* Wizard */
.start-head { max-width: 62ch; }
.loader-bar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 1rem 0 0.4rem; }
.wizard { display: grid; gap: 1.25rem; margin-top: 1.25rem; }
.stepper { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.stepper li { margin: 0; }
.stepper button {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; min-width: 44px; padding: 0.3rem 0.7rem;
  background: var(--panel-inset); color: var(--ink); border: 1px solid var(--cz-color-border-strong); border-radius: var(--radius); cursor: pointer;
  font: 500 0.88rem var(--font-body);
}
.stepper button .sn { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-2); }
.stepper button .st { display: none; }
.stepper button[aria-current="step"] { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 16%, var(--panel-inset)); }
.stepper button[aria-current="step"] .st { display: inline; }
.stepper button[aria-current="step"] .sn { color: var(--ink); }
.show-all .stepper button .st { display: inline; }
.wizard-panel { min-height: 14rem; }
.wizard-section > h2 { outline: none; }
.wizard-section > h2 .label { display: block; margin-bottom: 0.35rem; font-size: 0.78rem; }
.wizard-panel .step-lead { color: var(--ink-2); max-width: 62ch; }
.wizard-nav { display: flex; justify-content: space-between; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }
.show-all .wizard-section { display: block !important; margin-bottom: 1.5rem; }

.build-status .verdict-line { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.verdict-title { font-family: var(--font-display); font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); font-weight: 700; line-height: 1.1; margin: 0 0 0.3rem; }
.verdict--stop .verdict-title, .verdict--no .verdict-title { color: var(--tone-fail); }
.verdict--yes .verdict-title { color: var(--tone-ok); }
.verdict--prove .verdict-title { color: var(--tone-warn); }
.check-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.7rem 0; padding: 0; list-style: none; }
.check-chips li { margin: 0; }
.ledger-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); gap: 0.5rem; margin: 0.7rem 0; }
.ledger-mini div { background: var(--panel-inset); border: 1px solid var(--cz-color-border-strong); padding: 0.4rem 0.6rem; border-radius: var(--radius); }
.ledger-mini .n { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; line-height: 1; display: block; }
.ledger-mini .k { font-size: 0.74rem; color: var(--ink-2); line-height: 1.2; display: block; margin-top: 0.2rem; }
.tier-reco { border: 1px solid var(--edge-strong); border-radius: var(--radius); padding: 0.8rem 1rem; background: var(--panel-inset); margin: 0.9rem 0 0; }
.tier-reco .tier-name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.tier-reco p { margin: 0.35rem 0 0; font-size: 0.96rem; }
.missing-list { list-style: none; padding: 0; margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.missing-list button { min-height: 36px; padding: 0.2rem 0.6rem; background: var(--panel-inset); color: var(--ink); border: 1px solid var(--tone-warn); border-radius: var(--radius); cursor: pointer; font: 500 0.85rem var(--font-mono); }

@media (min-width: 64em) {
  .wizard { grid-template-columns: minmax(0, 1fr) 24rem; align-items: start; }
  .wizard > .build-status { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; overflow-x: hidden; }
}
@media (max-width: 63.99em) { .wizard > .build-status { order: -1; } }

.target-card { padding: 0.9rem; border: 1px solid var(--cz-color-border-strong); border-radius: var(--radius); background: var(--panel-inset); margin-bottom: 0.9rem; max-width: 46rem; }
.target-card .grid--2 { gap: 0.2rem 1rem; }
.target-card .field { margin-bottom: 0.8rem; }
.target-card legend { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.6rem; font-weight: var(--cz-weight-mono); }
.row-card { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; margin-bottom: 0.6rem; }
.row-card .field { margin: 0; flex: 1 1 10rem; }

.full-report > section { margin-top: 2rem; }
.check-group { margin-bottom: 1.2rem; }
.check-group h4 { font-family: var(--font-mono); font-size: 0.78rem; font-weight: var(--cz-weight-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.check-group td.gname, .check-group th.gname { white-space: nowrap; font-size: 0.9rem; }
.finding-list { margin: 0; padding-left: 1.1em; }
.finding-list .physical { color: var(--tone-fail); font-weight: 600; }
.doc-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.8rem 0; }

/* Family and template page */
.tpl-detail { margin-bottom: 1.5rem; scroll-margin-top: 1rem; }
.tpl-detail h3 { margin-top: 1.2rem; }
.kv { display: grid; grid-template-columns: 1fr; gap: 0.1rem 1.5rem; }
@media (min-width: 40em) { .kv { grid-template-columns: 11rem 1fr; } .kv dt { padding-top: 0.25rem; } }
.two-col { columns: 2 16rem; column-gap: 2rem; }
.two-col li { break-inside: avoid; }

/* Market */
.unknown-box .big { font-family: var(--font-display); font-size: clamp(2rem, 1.4rem + 3vw, 3.2rem); font-weight: 700; line-height: 1; margin: 0.3rem 0 0.6rem; }
.entry { margin-bottom: 0.9rem; }
.entry h4 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 0 0 0.4rem; font-size: 1.1rem; }
.entry .src { font-size: 0.88rem; word-break: break-all; }

/* Claims */
.claim-card .ask { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; margin: 0.3rem 0 0.6rem; }
.verdict-badge { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; }
.calc { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); align-items: end; }
.calc output { display: block; font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1.1; }

/* Pricing */
.tier-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); align-items: stretch; }
.tier-card { --r: var(--primary); }
.tier-card--ultra { --r: var(--cz-color-text); }
.tier-card .price { font-family: var(--font-display); font-size: clamp(2.4rem, 1.8rem + 2.4vw, 3.4rem); font-weight: 700; line-height: 1; margin: 0.4rem 0; }
.tier-card .price small { font-family: var(--font-body); font-size: 1rem; font-weight: 400; color: var(--ink-2); }
.tier-card ul { list-style: none; padding: 0; margin: 1rem 0; }
.tier-card li { padding-left: 1.2rem; position: relative; margin-bottom: 0.45rem; }
.tier-card li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 0.6rem; height: 2px; background: var(--r); }
.tier-card.is-reco { box-shadow: inset 0 0 0 2px var(--r), inset 0 0 34px color-mix(in srgb, var(--r) 18%, transparent); }
.tier-card.hud { border-color: var(--r); }
.tier-card.hud::before, .tier-card.hud::after { border-color: var(--r); }
.stub-note { border-style: dashed; border-color: var(--tone-warn); }
.proposal-line { font-size: 0.9rem; color: var(--ink-2); margin-top: 0.4rem; }

/* Protect */
.hash-out { margin-top: 1rem; }

/* Dialog (checkout stub) */
dialog { max-width: min(34rem, calc(100vw - 2rem)); padding: 0; border: 1px solid var(--edge-strong); border-radius: var(--radius); background: var(--panel-solid); color: var(--ink); }
dialog::backdrop { background: rgb(2 6 10 / 0.72); }
dialog .dlg-body { padding: 1.3rem 1.4rem; }
dialog .dlg-body > :last-child { margin-bottom: 0; }

/* 7. Start screen and world layer ---------------------------------------------------------- */
#world { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; display: block; background: var(--bg); }
.vignette { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse 120% 90% at 50% 40%, transparent 35%, var(--bg) 120%); opacity: 0.7; }
:root[data-theme="light"] .vignette { opacity: 0.3; }

.splash { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 1.5rem; background: var(--bg); color: var(--ink); transition: opacity var(--cz-motion-slow) ease; }
.splash.is-leaving { opacity: 0; pointer-events: none; }
.splash__panel { width: min(34rem, 100%); }
.splash__title { font-family: var(--font-display); font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); font-weight: 700; margin: 0 0 1rem; letter-spacing: 0.03em; text-shadow: var(--cz-glow-text); }
.splash__lines { font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.9; margin: 0 0 1.2rem; padding: 0; list-style: none; min-height: 12rem; }
.splash__lines li { margin: 0; display: flex; gap: 0.6rem; opacity: 0; animation: splash-line var(--cz-motion-slow) ease-out forwards; }
.splash__lines .ok { color: var(--tone-ok); margin-left: auto; }
.splash__lines .dots { flex: 1; overflow: hidden; white-space: nowrap; color: var(--ink-2); }
@keyframes splash-line { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.splash__bar { height: 3px; background: var(--cz-color-border); position: relative; overflow: hidden; }
.splash__bar::after { content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: var(--primary); animation: splash-fill 1.5s ease-out forwards; }
@keyframes splash-fill { to { transform: scaleX(1); } }
.splash__hint { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); margin-top: 0.9rem; }

/* 8. Reduced motion, paused motion and small screens -------------------------------------- */
/* Effects become still images. Lines, rings and glow keep a fixed, readable pose. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .splash { display: none; }
  .fx--dash::before { opacity: 0.45; }
  .fx--haydn i { opacity: 0.35; }
  .fx--haydn i:nth-child(1) { transform: scale(0.35); }
  .fx--haydn i:nth-child(2) { transform: scale(0.65); opacity: 0.25; }
  .fx--haydn i:nth-child(3) { transform: scale(0.95); opacity: 0.15; }
  .fx--liam::before { opacity: 1; }
  .fx--liam i { opacity: 0.6; transform: translateY(-3rem); }
  .fx--liam i:nth-child(2) { transform: translateY(-5rem); }
  .fx--liam i:nth-child(3) { transform: translateY(-2rem); }
}
.reduce-motion .splash { display: none; }
/* The visitor pressed the pause control. The same still poses apply and nothing moves. */
.motion-paused *, .motion-paused *::before, .motion-paused *::after { animation-play-state: paused !important; transition: none !important; }

@media (max-width: 40em) {
  body { font-size: 1rem; }
  .hud { padding: 0.95rem 0.95rem; }
  main { padding-left: 0.9rem; padding-right: 0.9rem; }
  th, td { padding: 0.55rem 0.65rem; }
  .fx--haydn i { width: 18rem; height: 18rem; margin: -9rem 0 0 -9rem; }
}
@media (forced-colors: active) {
  .tag, .hud, .btn { border: 1px solid CanvasText; }
  .hud { clip-path: none; }
  .fx { display: none; }
}
@media print {
  #world, .vignette, .splash, .rail, .topbar, .fx, .preview-bar { display: none !important; }
  body { background: #fff; color: #000; }
  .page { display: block !important; }
  .hud { clip-path: none; }
}

/* 9. Information pages, plain-word meanings, ethos ------------------------------------------ */
.nav-link--cta { font-weight: 600; }
.nav-link--cta .n { color: var(--primary); }
.believe { counter-reset: b; list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); max-width: 60rem; }
.believe li { counter-increment: b; margin: 0; padding: 0.9rem 1rem 0.9rem 3.1rem; position: relative; border: 1px solid var(--edge); background: var(--panel); }
.believe li::before { content: counter(b); position: absolute; left: 0.9rem; top: 0.85rem; font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; line-height: 1; color: var(--primary); }
.believe strong { display: block; margin-bottom: 0.2rem; }
.founder-line { margin-top: 1.4rem; max-width: 62ch; padding-left: 0.9rem; border-left: 3px solid var(--edge-strong); color: var(--ink-2); }
.site-footer .founder-line { color: var(--ink); margin-top: 0; }
.gloss { white-space: normal; }
.gloss__def { color: var(--ink-2); font-size: 0.92em; }
.solution h2 { font-size: 1.3rem; margin-bottom: 0.5em; }
.solution .row { margin-top: 0.6rem; }
.check-chips { display: flex; flex-wrap: wrap; gap: 0.3rem 0.5rem; }
.check-chips li { display: inline-flex; align-items: baseline; gap: 0.25rem; }
details.tech > summary { font-weight: 500; font-size: 0.92rem; color: var(--ink-2); }
.glossary dd { margin-bottom: 0.9rem; }
.example-card .tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.kv dd .tags { margin: 0; }
.part-link { margin-top: 0.4rem; }
.solution__dl { display: grid; gap: 0.1rem; margin: 0 0 0.6rem; }
.solution__dl dd { margin: 0 0 0.7rem; }
.part .num-badge { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; line-height: 1; color: var(--primary); display: block; margin-bottom: 0.3rem; }
.part .kv { margin-bottom: 0.4rem; }
