/* North Offaly CoderDojo — northoffalydojo.com
   Warm cream first, with a dark theme. Brand: #ffcc00 yellow, #008e13 green, #896a06 ochre.
   Spacing on a 4px grid: 4 8 12 16 24 32 48 64 96 */

:root {
  color-scheme: light;
  --bg: #fbf8f2;
  --bg-2: #f4efe3;
  --surface: #ffffff;
  --text: #1d1c19;
  --text-2: #55514a;
  --text-3: #6b665a;
  --line: rgba(29, 28, 25, 0.10);
  --line-strong: rgba(29, 28, 25, 0.18);
  --accent: #ffcc00;
  --accent-hover: #ffd633;
  --on-accent: #1d1c19;
  --link: #00700f;
  --green: #008e13;
  --tint: #fff6d1;
  --logo-north: #008e13;
  --logo-dojo: #1d1c19;
  --shadow: 0 1px 2px rgba(29, 28, 25, 0.04), 0 8px 24px rgba(29, 28, 25, 0.06);
  --header-bg: rgba(251, 248, 242, 0.82);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --fs-caption: 13px;
  --fs-small: 15px;
  --fs-body: 17px;
  --fs-h3: 20px;
  --fs-h2: clamp(28px, 3vw, 40px);
  --fs-h1: clamp(36px, 4.4vw, 56px);

  --r-control: 10px;
  --r-card: 18px;
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1200px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out-elastic: linear(0, 0.218 2.1%, 0.862 6.5%, 1.114, 1.296 10.7%, 1.346, 1.37 12.9%, 1.373, 1.364 14.5%, 1.315 16.2%, 1.032 21.8%, 0.941 24%, 0.891 25.9%, 0.877, 0.869 27.8%, 0.87, 0.882 30.7%, 0.907 32.4%, 0.981 36.4%, 1.012 38.3%, 1.036, 1.046 42.7% 44.1%, 1.042 45.7%, 0.996 53.3%, 0.988, 0.984 57.5%, 0.985 60.7%, 1.001 68.1%, 1.006 72.2%, 0.998 86.7%, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121210;
  --bg-2: #1a1916;
  --surface: #201f1b;
  --text: #f5f2ea;
  --text-2: #bab4a7;
  --text-3: #959083;
  --line: rgba(245, 242, 234, 0.10);
  --line-strong: rgba(245, 242, 234, 0.18);
  --link: #6bd97f;
  --tint: rgba(255, 204, 0, 0.10);
  --logo-north: #f5f2ea;
  --logo-dojo: #ffcc00;
  --shadow: none;
  --header-bg: rgba(18, 18, 16, 0.8);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121210;
    --bg-2: #1a1916;
    --surface: #201f1b;
    --text: #f5f2ea;
    --text-2: #bab4a7;
    --text-3: #959083;
    --line: rgba(245, 242, 234, 0.10);
    --line-strong: rgba(245, 242, 234, 0.18);
    --link: #6bd97f;
    --tint: rgba(255, 204, 0, 0.10);
    --logo-north: #f5f2ea;
    --logo-dojo: #ffcc00;
    --shadow: none;
    --header-bg: rgba(18, 18, 16, 0.8);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-body)/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 600; text-wrap: balance; color: var(--text); }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
.mono { font-family: var(--mono); font-size: var(--fs-caption); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 6px; }
.c-app { overflow-x: clip; }
.c-app.is-preloading main, .c-app.is-preloading .site-header { visibility: hidden; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: 16px; top: -64px; z-index: 200; padding: 12px 16px; border-radius: var(--r-control); background: var(--surface); color: var(--text); }
.skip:focus { top: 12px; }

/* Signature: the yellow cursor block from the logo intro, ending each page title */
.caret {
  display: inline-block; width: 0.42em; height: 0.8em; margin-left: 0.1em;
  background: var(--accent); border-radius: 2px; vertical-align: -0.04em;
}

/* Scroll reveal (once, no loop) */
.reveal-up { opacity: 0; translate: 0 16px; transition: opacity .6s var(--ease), translate .6s var(--ease); }
.reveal-up.is-in { opacity: 1; translate: 0 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 980px; border: 1px solid transparent;
  font: 500 16px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .15s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--text); }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 15px; }
.text-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 500; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* ---------- Intro splash (home, once per visit) ---------- */
.intro { z-index: 1024; position: fixed; inset: 0; background: var(--bg); display: flex; justify-content: center; align-items: center; }
.intro.hidden { display: none; }
.intro-logo { width: min(28em, 80vw); height: auto; overflow: visible; }
.intro .picto.hidden { display: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 120;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; min-height: 44px; flex: none; }
.lockup { width: 188px; height: auto; }
.lk-north { fill: var(--logo-north); }
.lk-dojo { fill: var(--logo-dojo); }
.nav { display: flex; align-items: center; }
.nav-list { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-list a:not(.btn) {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 12px;
  color: var(--text-2); text-decoration: none; font-size: var(--fs-small); font-weight: 500;
  transition: color .2s var(--ease), box-shadow .2s var(--ease);
}
.nav-list a:not(.btn):hover, .nav-list a[aria-current="page"] { color: var(--text); }
.nav-list a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
.nav-list .icon { width: 12px; height: 12px; color: var(--text-3); }
.nav-cta { margin-left: 12px; }
.nav-toggle { display: none; }

/* ---------- Home hero (physics) ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - 64px); min-height: calc(100svh - 64px);
  display: flex; justify-content: center; align-items: center;
  padding: 64px 0 160px; text-align: center; overflow: hidden;
}
.hero-container { position: relative; z-index: 3; width: 100%; padding: 0 var(--gutter); pointer-events: none; }
.hero-content { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.hero-meta { color: var(--text-3); }
.hero-title { font-size: var(--fs-h1); line-height: 1.06; letter-spacing: -0.035em; perspective: 700px; }
.hero-text { max-width: 560px; color: var(--text-2); font-size: 19px; line-height: 1.5; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; pointer-events: auto; }
.hero-hint { color: var(--text-3); }
.hint-key {
  display: inline-block; padding: 4px 8px; margin-right: 8px; border-radius: 6px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; color: var(--text); background: var(--surface);
}
.c-matter { position: absolute; inset: 0 0 -5px; z-index: 2; overflow: hidden; }
.matter-canvas { position: absolute; inset: 0; height: 100%; overflow: hidden; }
.matter-canvas canvas { display: block; cursor: grab; }
.matter-canvas canvas:active { cursor: grabbing; }

/* Click sparks */
.spark {
  position: fixed; width: 4px; height: 10px; border-radius: 10px; background: var(--green);
  pointer-events: none; z-index: 9999; transform-origin: 50% 100%;
  animation: spark-fly .32s cubic-bezier(.25, .46, .45, .94) forwards;
}
@keyframes spark-fly {
  0% { opacity: 1; transform: translate(-50%, -100%) rotate(var(--angle)) translateY(0) scale(.5); }
  20% { opacity: 1; }
  to { opacity: 0; transform: translate(-50%, -100%) rotate(var(--angle)) translateY(-40px) scale(1); }
}

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-tight { padding-top: 0; }
.section-head { display: grid; gap: 12px; max-width: 680px; margin-bottom: 48px; }
.section-head h2 { font-size: var(--fs-h2); line-height: 1.1; letter-spacing: -0.03em; }
.section-head p { color: var(--text-2); }
.section-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; max-width: none; }
.section-head-row > div { display: grid; gap: 12px; max-width: 680px; }
.eyebrow { color: var(--text-3); }

/* Page header (inner pages) */
.page-head { padding: 96px 0 64px; }
.page-head .eyebrow { margin-bottom: 16px; }
.page-head h1 { font-size: var(--fs-h1); line-height: 1.06; letter-spacing: -0.035em; max-width: 16ch; }
.page-head p.lead { margin-top: 24px; max-width: 620px; font-size: 19px; color: var(--text-2); }
.page-head .hero-actions { justify-content: flex-start; margin-top: 32px; }

/* Facts row (VWLAB metadata with corner ticks) */
.facts { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0 0 48px; padding: 24px 0 0; border-top: 1px solid var(--line); }
.fact { position: relative; padding: 0 16px 0 20px; }
.fact::before { content: ""; position: absolute; left: 0; top: 4px; width: 8px; height: 8px; border-left: 2px solid var(--green); border-top: 2px solid var(--green); }
.fact dt { font: 400 12px/1.5 var(--mono); color: var(--text-3); }
.fact dd { margin: 4px 0 0; font-size: var(--fs-small); font-weight: 500; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow); padding: 32px;
}
.card h3 { font-size: var(--fs-h3); letter-spacing: -0.02em; line-height: 1.25; }
.card p { color: var(--text-2); font-size: var(--fs-small); }

.groups { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.group { display: grid; gap: 16px; align-content: start; }
.group-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.group-tag { color: var(--text-3); }
.group ul { list-style: none; display: grid; gap: 8px; margin-top: 4px; }
.group li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); font-size: var(--fs-small); }
.group li .icon { margin-top: 3px; color: var(--green); }

/* Track cards (VWLAB chapter cards: hover fill + label scramble) */
.tracks { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.track {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
  min-height: 232px; padding: 32px 16px 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); text-decoration: none;
  transition: background-color .3s ease-in-out, border-color .3s ease-in-out;
}
.track::before, .track::after { content: ""; position: absolute; width: 8px; height: 8px; border: 0 solid var(--line-strong); }
.track::before { top: 8px; left: 8px; border-width: 1px 0 0 1px; }
.track::after { bottom: 8px; right: 8px; border-width: 0 1px 1px 0; }
.track:hover, .track:focus-visible { background: var(--tint); border-color: var(--green); text-decoration: none; }
.track-icon { width: 48px; height: 48px; margin-bottom: 4px; }
.track-icon circle { fill: var(--green); }
.track-icon circle:nth-of-type(2n) { fill: var(--accent); }
.track-icon .link { fill: none; stroke: color-mix(in srgb, var(--green) 30%, transparent); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; transition: stroke .25s ease-out; }
.track:hover .track-icon .link, .track:focus-visible .track-icon .link { stroke: var(--green); }
.btn-text { font: 500 14px/1.4 var(--mono); white-space: nowrap; }
.track-desc { font-size: 14px; line-height: 1.45; color: var(--text-2); max-width: 22ch; }

/* ---------- Showcase (Spencer Gabor card stack) ---------- */
.showcase {
  position: relative; container-type: inline-size;
  display: grid; grid-template-rows: auto 1fr auto;
  min-height: 90vh; padding: 64px var(--gutter);
  background: var(--bg-2); text-align: center; overflow: hidden;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.sc-top, .sc-bot { display: grid; gap: 4px; justify-items: center; }
.sc-top p, .sc-bot p { font-size: var(--fs-small); font-weight: 500; }
.sc-top small, .sc-bot small { color: var(--text-3); font-size: var(--fs-caption); }
.sc-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 48px; padding: 48px 0; }
.sc-line { font-size: var(--fs-h2); line-height: 1.1; letter-spacing: -0.03em; font-family: var(--font-display); font-weight: 600; margin: 0; }
.sc-line-muted { color: var(--text-3); }
.sc-line .word { display: inline-block; }
.sc-images { display: flex; justify-content: center; align-items: center; width: 100%; touch-action: pan-y; padding: 16px 0; }
.sc-card { position: relative; width: clamp(8rem, 100%, min(21cqi, 280px)); aspect-ratio: 1; flex: none; container-type: inline-size; }
.sc-card:not(:last-child) { margin-right: -6%; }
.sc-card .shadow, .sc-card .sc-face {
  translate: calc(var(--offsetX, 0) * 1px) calc(var(--offsetY, 0) * 1px + var(--translateY, 0%));
  rotate: calc(var(--rotate, 0deg) - var(--velocity, 0) * 0.25deg);
}
.sc-card:nth-child(1) { --rotate: 2deg; --translateY: 4%; }
.sc-card:nth-child(2) { --rotate: -3deg; --translateY: -6%; }
.sc-card:nth-child(3) { --rotate: 6deg; --translateY: 3%; }
.sc-card:nth-child(4) { --rotate: -2deg; --translateY: -2%; }
.sc-card .shadow { position: absolute; inset: 10%; border-radius: 18px; background: rgba(29, 28, 25, 0.22); filter: blur(24px); transform: translateY(16%); }
.sc-face {
  position: absolute; inset: 0; border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column; font-size: 6cqi; user-select: none;
  border: 1px solid rgba(29, 28, 25, 0.08); text-align: left;
}
.sc-card { scale: 0; transition: scale 1s var(--ease-out-elastic); transition-delay: calc(var(--delay) * 0.08s + 0.4s); }
.sc-line .word { scale: 1 0; translate: 0 30%; transition: scale .8s var(--ease-out-elastic), translate .8s var(--ease-out-elastic); transition-delay: calc(var(--delay) * 0.05s); }
.sc-top, .sc-bot { opacity: 0; transition: opacity 1.2s cubic-bezier(0.61, 1, 0.88, 1) .25s; }
.showcase[mounted] .sc-card { scale: 1; }
.showcase[mounted] .sc-line .word { scale: 1 1; translate: 0 0; }
.showcase[mounted] .sc-top, .showcase[mounted] .sc-bot { opacity: 1; }

.face-scratch { background: #ffcc00; padding: 12% 10%; gap: 4px; align-items: flex-start; justify-content: center; }
.blk { display: inline-flex; align-items: center; gap: 4px; font: 500 0.95em/1 var(--font); padding: 0.6em 0.8em; border-radius: 6px; color: #fff; background: #008e13; box-shadow: 0 2px 0 #00700f; }
.blk svg { width: 1.1em; height: 1.1em; flex: none; background: #fff; border-radius: 3px; padding: 1px; }
.blk-hat { border-radius: 14px 14px 6px 6px; background: #896a06; box-shadow: 0 2px 0 #5c4704; }
.blk-c { background: #1d1c19; box-shadow: 0 2px 0 #000; }
.blk-in { margin-left: 12%; background: #1a9a2c; }
.blk-in b { background: #fff; color: #1d1c19; border-radius: 99px; padding: .15em .5em; font-weight: 600; }
.blk-end { width: 46%; height: 10%; padding: 0; background: #1d1c19; border-radius: 0 0 6px 6px; box-shadow: 0 2px 0 #000; }

.face-code { background: #161512; color: #f5f2ea; }
.win-bar { display: flex; align-items: center; gap: 4px; padding: 8% 9% 5%; }
.win-bar i { width: 8px; height: 8px; border-radius: 50%; background: #3d3a33; }
.win-bar i:first-child { background: #ffcc00; }
.win-bar em { margin-left: 8px; font: 400 0.75em/1 var(--mono); font-style: normal; color: #959083; }
.face-code pre { margin: 0; padding: 4% 9%; font: 400 0.68em/1.75 var(--mono); white-space: pre; }
.face-code .k { color: #6bd97f; }
.face-code .f { color: #ffdb38; }
.face-code .s { color: #ffb36b; }
.face-code .c { color: #807b6f; }

.face-hat { background: #00700f; align-items: center; justify-content: center; gap: 8%; }
.leds { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2.4cqi; width: 62%; }
.leds i { aspect-ratio: 1; border-radius: 2px; background: rgba(0, 0, 0, 0.28); }
.leds i.on { background: #ffcc00; }
.leds i.g { background: #9be8a8; }
.hat-label { font: 500 0.7em/1 var(--mono); color: #f5f2ea; opacity: 0.85; }

.face-trophy { background: #fbf8f2; color: #1d1c19; padding: 10%; justify-content: space-between; }
.trophy-top { font: 500 0.7em/1.3 var(--mono); color: #6b665a; }
.trophy-title { font: 600 1.5em/1.05 var(--font-display); letter-spacing: -0.03em; }
.trophy-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.trophy-meta span { font: 500 0.66em/1 var(--mono); padding: .55em .7em; border-radius: 99px; background: #f4efe3; border: 1px solid rgba(29, 28, 25, 0.1); }
.trophy-meta span:first-child { background: #ffcc00; border-color: transparent; }

/* ---------- Steps ---------- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.steps-3 { grid-template-columns: repeat(3, 1fr); }
.step { display: grid; gap: 12px; align-content: start; padding-top: 24px; border-top: 1px solid var(--line-strong); }
.step-n { color: var(--text-3); }
.step h3 { font-size: var(--fs-h3); letter-spacing: -0.02em; }
.step p { color: var(--text-2); font-size: var(--fs-small); }

/* ---------- Split layouts ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.split-wide { grid-template-columns: 5fr 7fr; }
.split-center { align-items: center; }
.stack { display: grid; gap: 24px; align-content: start; }
.prose { display: grid; gap: 16px; color: var(--text-2); max-width: 640px; }
.prose h2 { font-size: var(--fs-h2); line-height: 1.1; letter-spacing: -0.03em; color: var(--text); }
.prose h3 { font-size: var(--fs-h3); letter-spacing: -0.02em; margin-top: 8px; }
.prose ul { padding-left: 20px; display: grid; gap: 8px; }
.prose strong { color: var(--text); font-weight: 600; }
.callout { padding: 16px 20px; border-radius: 12px; background: var(--tint); color: var(--text); font-size: var(--fs-small); }
.callout strong { font-weight: 600; }

/* CTA band */
.cta { display: flex; justify-content: space-between; align-items: center; gap: 32px; padding: 48px; }
.cta > div:first-child { display: grid; gap: 12px; max-width: 640px; }
.cta h2 { font-size: var(--fs-h2); line-height: 1.1; letter-spacing: -0.03em; }
.cta p { color: var(--text-2); }
.cta .hero-actions { flex: none; flex-wrap: nowrap; }

/* Help centre list */
.help-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; border-top: 1px solid var(--line); }
.help-list li { border-bottom: 1px solid var(--line); }
.help-list a {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 56px; padding: 12px 0; color: var(--text); text-decoration: none; font-weight: 500;
  transition: color .2s var(--ease);
}
.help-list a:hover { color: var(--link); }
.help-list .icon { color: var(--text-3); }

/* FAQ */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 56px; padding: 12px 0; cursor: pointer; list-style: none; font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--text-3); transition: rotate .2s var(--ease); }
.faq details[open] summary .icon { rotate: 45deg; }
.faq details p { padding: 0 0 20px; color: var(--text-2); max-width: 640px; }

/* Terminal */
.terminal {
  background: #161512; color: #f5f2ea; border-radius: var(--r-card); overflow: hidden;
  box-shadow: 0 24px 48px -24px rgba(29, 28, 25, 0.4);
  border: 1px solid rgba(245, 242, 234, 0.08);
}
.term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid rgba(245, 242, 234, 0.08); background: #1d1c18; }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3d3a33; }
.term-bar i:nth-child(1) { background: #ffcc00; }
.term-bar i:nth-child(2) { background: #008e13; }
.term-bar span { margin-left: 8px; color: #959083; }
.term-body { height: 280px; overflow-y: auto; padding: 16px; font: 400 13px/1.7 var(--mono); scrollbar-width: thin; scrollbar-color: #3d3a33 transparent; }
.term-body p { margin: 0 0 4px; white-space: pre-wrap; word-break: break-word; }
.term-body b { color: #ffcc00; font-weight: 500; }
.term-body a { color: #6bd97f; }
.t-dim { color: #a39e91; }
.t-cmd::before { content: "$ "; color: #6bd97f; }
.t-out { color: #d4cfc4; }
.t-err { color: #ff9b85; }
.term-input { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid rgba(245, 242, 234, 0.08); }
.t-prompt { color: #6bd97f; font: 400 14px/1 var(--mono); }
.term-input input { flex: 1; min-width: 0; min-height: 32px; background: transparent; border: 0; outline: 0; color: #f5f2ea; font: 400 16px/1.4 var(--mono); caret-color: #ffcc00; }
.term-input input::placeholder { color: #8a8578; }
.term-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 16px; }
.term-chips button {
  font: 400 12px/1 var(--mono); color: #f5f2ea; cursor: pointer; min-height: 36px; padding: 0 12px;
  background: #26241f; border: 1px solid rgba(245, 242, 234, 0.1); border-radius: 8px;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.term-chips button:hover { border-color: #ffcc00; color: #ffcc00; }

/* Vetting timeline */
.timeline { list-style: none; display: grid; counter-reset: t; }
.timeline li { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: 16px; padding-bottom: 32px; }
.timeline li::before {
  counter-increment: t; content: counter(t);
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line-strong);
  font: 500 12px/1 var(--mono); color: var(--text);
}
.timeline li::after { content: ""; position: absolute; left: 15.5px; top: 40px; bottom: 8px; width: 1px; background: var(--line-strong); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline li > div { display: grid; gap: 4px; padding-top: 4px; }
.timeline h3 { font-size: 17px; letter-spacing: -0.01em; }
.timeline p { color: var(--text-2); font-size: var(--fs-small); }

/* Contact */
.contact-cards { display: grid; gap: 16px; }
.contact-card { display: grid; gap: 8px; padding: 24px; }
.contact-card h3 { font-size: 17px; }
.contact-card a.big { font-size: 19px; font-weight: 500; word-break: break-word; }
.contact-card .mono { color: var(--text-3); }
.form { display: grid; gap: 20px; padding: 32px; }
.form h2 { font-size: var(--fs-h3); letter-spacing: -0.02em; }
.field { display: grid; gap: 8px; }
.field label { font-size: var(--fs-small); font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--r-control);
  background: var(--bg); color: var(--text); border: 1px solid var(--line-strong);
  font: 400 16px/1.4 var(--font); transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-note { color: var(--text-3); font-size: var(--fs-caption); }
.form .btn { justify-self: start; }

/* Register + subscribe forms */
.h3, .prose .h3 { font-size: var(--fs-h3); letter-spacing: -0.02em; line-height: 1.25; margin-top: 0; }
.form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 20px; }
.form legend { padding: 0; margin-bottom: 4px; }
.form legend h2 { font-size: var(--fs-h3); letter-spacing: -0.02em; }
.opt { margin-left: 4px; color: var(--text-3); font-weight: 400; font-size: var(--fs-caption); }
.hint, .form .hint { color: var(--text-3); font-size: var(--fs-caption); line-height: 1.45; }
.field [aria-invalid="true"] { border-color: #c4361d; }
.field-error, .form .field-error { color: #b3301a; font-size: var(--fs-caption); }
:root[data-theme="dark"] .form .field-error { color: #ff9b85; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .form .field-error { color: #ff9b85; } }
.check { display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: start; min-height: 44px; padding: 12px 16px; border-radius: var(--r-control); background: var(--bg); border: 1px solid var(--line); font-size: var(--fs-small); color: var(--text-2); cursor: pointer; transition: border-color .2s var(--ease); }
.check:hover { border-color: var(--line-strong); }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--green); cursor: pointer; }
.check:has(input[aria-invalid="true"]) { border-color: #c4361d; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-progress { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.form-progress-bar { display: block; height: 100%; width: 33.333%; background: var(--accent); border-radius: 4px; transition: width .3s var(--ease); }
.form-step-label { color: var(--text-3); margin-top: -8px; }
.form-nav { display: flex; gap: 12px; justify-content: space-between; }
.form-nav [data-next], .form-nav [type="submit"] { margin-left: auto; }
.form .form-error { padding: 12px 16px; border-radius: var(--r-control); background: color-mix(in srgb, #c4361d 10%, transparent); color: var(--text); font-size: var(--fs-small); }
.review { display: grid; gap: 4px; padding: 16px; border-radius: var(--r-control); background: var(--bg-2); font-size: var(--fs-small); }
.review:empty { display: none; }
.review dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.review dt { color: var(--text-3); }
.review dd { margin: 0; color: var(--text); word-break: break-word; }
.form-done { display: grid; gap: 16px; align-content: start; padding: 32px; }
.form-done h2 { font-size: var(--fs-h2); line-height: 1.1; letter-spacing: -0.03em; }
.form-done p { color: var(--text-2); }
.form-done .hero-actions { justify-content: flex-start; }
.form-done:focus { outline: none; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Footer ---------- */
.footer { background: var(--bg-2); border-top: 1px solid var(--line); padding: 64px 0 32px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 48px; align-items: start; }
.footer-brand { display: grid; gap: 16px; max-width: 340px; }
.footer-brand p { color: var(--text-2); font-size: var(--fs-small); }
.footer-col h2 { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; font-family: var(--font); }
.footer-links { list-style: none; display: grid; }
.footer-links a { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; color: var(--text-2); text-decoration: none; font-size: var(--fs-small); transition: color .2s var(--ease); }
.footer-links a:hover { color: var(--text); }
.footer-links .icon { width: 12px; height: 12px; }
.footer-base { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--text-3); font-size: var(--fs-caption); flex-wrap: wrap; }

/* Theme switcher (segmented control) */
.theme-switch { display: inline-flex; gap: 2px; padding: 2px; margin: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.theme-switch legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.theme-switch label { position: relative; display: block; }
.theme-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.theme-switch span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 10px;
  color: var(--text-2); font: 500 13px/1 var(--font); transition: background-color .2s var(--ease), color .2s var(--ease);
}
.theme-switch input:checked + span { background: var(--bg-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.theme-switch input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 1px; }
.theme-switch .icon { width: 14px; height: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .tracks { grid-template-columns: repeat(3, 1fr); }
  .facts { grid-template-columns: repeat(3, 1fr); row-gap: 24px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .groups, .split, .split-wide, .help-list { grid-template-columns: 1fr; }
  .split { gap: 48px; }
  .steps, .steps-3 { grid-template-columns: 1fr; }
  .cta { flex-direction: column; align-items: flex-start; padding: 32px; }
  .cta .hero-actions { flex-wrap: wrap; }
  .section-head-row { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed; top: 64px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    opacity: 0; transform: translateY(-8px); pointer-events: none; visibility: hidden;
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s .2s;
  }
  .nav.is-open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .2s var(--ease), transform .2s var(--ease); }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; width: 100%; padding: 8px var(--gutter) 24px; }
  .nav-list a:not(.btn) { min-height: 52px; font-size: 19px; color: var(--text); border-bottom: 1px solid var(--line); padding: 0; }
  .nav-list a[aria-current="page"] { box-shadow: none; color: var(--link); }
  .nav-cta { margin: 16px 0 0; }
  .nav-cta .btn { width: 100%; min-height: 48px; }
}
@media (max-width: 767px) {
  .section { padding: 64px 0; }
  .page-head { padding: 64px 0 48px; }
  .tracks { grid-template-columns: repeat(2, 1fr); }
  .track:last-child { grid-column: 1 / -1; }
  .track { min-height: 0; padding: 24px 12px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .card, .form { padding: 24px; }
  .field-row { grid-template-columns: 1fr; }
  .sc-images { display: grid; grid-template-columns: repeat(2, 40cqi); justify-content: center; }
  .sc-card { width: 40cqi; }
  .sc-card:not(:last-child) { margin-right: 0; }
  .sc-card:nth-child(odd) { margin-right: -4cqi; }
  .sc-card:nth-child(n+3) { margin-top: -5cqi; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 479px) {
  .hero { align-items: flex-start; padding: 48px 0 0; min-height: calc(100svh - 64px); }
  .hero-content { gap: 20px; }
  .hero-title { font-size: 36px; }
  .hero-text { font-size: 17px; }
  .hero-hint { display: none; }
  .c-matter { top: auto; height: 46svh; min-height: 20rem; bottom: -1.75rem; }
  .lockup { width: 164px; }
  .btn-text { white-space: normal; }
  .footer-inner { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-up { opacity: 1; translate: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
}
