/* K-Rae: tokens (Anodized Swiss light / Obsidian Lab dark), type, header, buttons, and the hero. */
:root {
  color-scheme: light dark;
  --paper: #e6e9ee;
  --card: #f8f9fb;
  --well: #111318;
  --well-ink: #f8f9fb;
  --ink: #111318;
  --muted: #4b5260;
  --line: #111318;
  --shadow: #111318;
  --on-accent: #111318;
  --on-blue: #f8f9fb;
  --red: #ee4b1a;
  --red-ink: #bd340b;
  --red-hover: #ff6233;
  --red-shadow: #9a2b0a;
  --yel: #f4c92b;
  --yel-shadow: #a8870a;
  --blue: #185adb;
  --grid: rgba(17, 19, 24, 0.07);
  --stripe: rgba(17, 19, 24, 0.07);
  --top-bg: rgba(230, 233, 238, 0.94);
  --hazard-dark: #252933;
  --led-off: #4b5260;
  --led-ring: rgba(248, 249, 251, 0.35);
  --key-border: rgba(248, 249, 251, 0.55);
  --roller-hub: #4b5260;
  --roller-dot: #e6e9ee;
  --sw-bezel: #252933;
  --power-off: #b8bec8;
  --power-off-ink: #111318;
  --knob-off: #7d8594;
  --knob-off-sh: #4b5260;
  --cta-btn-bg: #f8f9fb;
  --cta-btn-ink: #111318;
  --station-hover-line: #111318;
  --station-no-bg: #111318;
  --station-no-ink: #f8f9fb;
  --station-no-border: #111318;
  --breaker-b: #111318;
  --bot-stroke: #111318;
  --bot-visor: #111318;
  --bot-eye: #f8f9fb;
  --bot-2: #f8f9fb;
  --bw: 2.5px;
  --display: "Big Shoulders Display", Impact, "Arial Narrow", sans-serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

:root[data-theme="light"] { color-scheme: light; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0b0f14;
  --card: #141b24;
  --well: #06090d;
  --well-ink: #e8eef5;
  --ink: #e8eef5;
  --muted: #94a3b8;
  --line: #546a85;
  --shadow: #253345;
  --on-accent: #0b0f14;
  --on-blue: #0b0f14;
  --red: #ff5226;
  --red-ink: #ff5226;
  --red-hover: #ff6b45;
  --red-shadow: #99260b;
  --yel: #f5b719;
  --yel-shadow: #9e7205;
  --blue: #38bdf8;
  --grid: rgba(148, 179, 214, 0.08);
  --stripe: rgba(11, 15, 20, 0.1);
  --top-bg: rgba(11, 15, 20, 0.94);
  --hazard-dark: #1c2533;
  --led-off: #334155;
  --led-ring: rgba(232, 238, 245, 0.28);
  --key-border: #546a85;
  --roller-hub: #243040;
  --roller-dot: #546a85;
  --sw-bezel: #1c2533;
  --power-off: #1d2530;
  --power-off-ink: #e8eef5;
  --knob-off: #526175;
  --knob-off-sh: #283342;
  --cta-btn-bg: #0b0f14;
  --cta-btn-ink: #e8eef5;
  --station-hover-line: #38bdf8;
  --station-no-bg: #06090d;
  --station-no-ink: #f5b719;
  --station-no-border: #546a85;
  --breaker-b: #f5b719;
  --bot-stroke: #8fa3bc;
  --bot-visor: #0b0f14;
  --bot-eye: #e8eef5;
  --bot-2: #e8eef5;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0b0f14;
    --card: #141b24;
    --well: #06090d;
    --well-ink: #e8eef5;
    --ink: #e8eef5;
    --muted: #94a3b8;
    --line: #546a85;
    --shadow: #253345;
    --on-accent: #0b0f14;
    --on-blue: #0b0f14;
    --red: #ff5226;
    --red-ink: #ff5226;
    --red-hover: #ff6b45;
    --red-shadow: #99260b;
    --yel: #f5b719;
    --yel-shadow: #9e7205;
    --blue: #38bdf8;
    --grid: rgba(148, 179, 214, 0.08);
    --stripe: rgba(11, 15, 20, 0.1);
    --top-bg: rgba(11, 15, 20, 0.94);
    --hazard-dark: #1c2533;
    --led-off: #334155;
    --led-ring: rgba(232, 238, 245, 0.28);
    --key-border: #546a85;
    --roller-hub: #243040;
    --roller-dot: #546a85;
    --sw-bezel: #1c2533;
    --power-off: #1d2530;
    --power-off-ink: #e8eef5;
    --knob-off: #526175;
    --knob-off-sh: #283342;
    --cta-btn-bg: #0b0f14;
    --cta-btn-ink: #e8eef5;
    --station-hover-line: #38bdf8;
    --station-no-bg: #06090d;
    --station-no-ink: #f5b719;
    --station-no-border: #546a85;
    --breaker-b: #f5b719;
    --bot-stroke: #8fa3bc;
    --bot-visor: #0b0f14;
    --bot-eye: #e8eef5;
    --bot-2: #e8eef5;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--sans); overflow-x: clip; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
svg { display: block; }
.defs { position: absolute; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.console :focus-visible, .foot :focus-visible { outline-color: var(--yel); }

h2 { font: 900 clamp(2.4rem, 6.4vw, 4.6rem)/0.95 var(--display); text-transform: uppercase; letter-spacing: 0.005em; max-width: 18ch; text-wrap: balance; }
h3 { font: 900 clamp(1.5rem, 2.6vw, 1.9rem)/1.05 var(--display); text-transform: uppercase; letter-spacing: 0.01em; }
.label { font: 500 0.8rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 14px; color: var(--muted); }
.label::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 10px; background: var(--red); border: 2px solid var(--ink); border-radius: 50%; }
.label--yel { color: var(--yel); }
.label--yel::before { border-color: var(--yel); }
.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }

.skip { position: absolute; left: 12px; top: -80px; z-index: 50; padding: 10px 14px; background: var(--yel); color: var(--on-accent); font: 500 0.85rem var(--mono); }
.skip:focus { top: 12px; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: clamp(12px, 2.2vw, 28px); padding: 10px clamp(16px, 3vw, 36px); background: var(--top-bg); backdrop-filter: blur(8px); border-bottom: var(--bw) solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; font: 900 1.7rem/1 var(--display); letter-spacing: 0.04em; text-decoration: none; }
.brand svg { transition: transform 0.3s cubic-bezier(0.3, 1.8, 0.5, 1); }
.brand:hover svg { transform: rotate(-14deg) translateY(-2px); }
.top__nav { display: flex; gap: 26px; }
.top__nav a { font: 500 0.82rem var(--mono); text-transform: uppercase; letter-spacing: 0.1em; text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; transition: color 0.12s, border-color 0.12s; }
.top__nav a:hover { border-color: var(--red); }

.theme-btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; background: var(--card); color: var(--ink); border: 2px solid var(--line); border-radius: 8px; box-shadow: 2px 2px 0 var(--shadow); font: 500 0.74rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer; transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s; }
.theme-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--shadow); border-color: var(--yel); }
.theme-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--shadow); }
.theme-btn__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yel); border: 1.5px solid var(--on-accent); }
html:not(.js) .theme-btn { display: none; }

/* ---------- buttons ---------- */
.btn { display: inline-block; padding: 14px 24px; background: var(--yel); color: var(--on-accent); border: var(--bw) solid var(--on-accent); border-radius: 10px; box-shadow: 5px 5px 0 var(--sh, var(--shadow)); font: 900 1.25rem/1 var(--display); letter-spacing: 0.05em; text-transform: uppercase; text-decoration: none; transition: transform 0.12s, box-shadow 0.12s, background 0.12s, color 0.12s; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--sh, var(--shadow)); }
.btn:active { transform: translate(5px, 5px); box-shadow: 0 0 0 var(--sh, var(--shadow)); }
.btn--small { padding: 9px 16px; font-size: 1.05rem; box-shadow: 3px 3px 0 var(--shadow); }
.btn--on-ink { --sh: var(--red); border-color: var(--yel); }
.btn--big { font-size: clamp(1.6rem, 6vw, 3rem); padding: 20px clamp(20px, 4vw, 40px); text-transform: none; letter-spacing: 0.02em; background: var(--cta-btn-bg); color: var(--cta-btn-ink); border-color: var(--on-accent); box-shadow: 8px 8px 0 var(--on-accent); }
.btn--big:hover { box-shadow: 11px 11px 0 var(--on-accent); background: var(--yel); color: var(--on-accent); }
.link { font: 500 0.85rem var(--mono); text-transform: uppercase; letter-spacing: 0.08em; text-underline-offset: 5px; }
.link:hover { color: var(--yel); }

/* ---------- hero: the stage ---------- */
.stage { position: relative; height: clamp(300px, min(54vh, 45vw), 560px); overflow: hidden; background-color: var(--paper); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 32px 32px; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.stage__title { display: grid; place-items: center; height: 100%; padding: 20px; text-align: center; font: 900 clamp(3.4rem, 15vw, 10rem)/0.9 var(--display); text-transform: uppercase; }
.js .stage__title { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html:not(.js) .stage canvas, html:not(.js) .stage__tag, html:not(.js) .console__panel { display: none; }
.stage__tag { position: absolute; top: 12px; left: clamp(16px, 3vw, 36px); font: 500 0.72rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); pointer-events: none; }
.stage__tag--hint { left: auto; right: clamp(16px, 3vw, 36px); text-align: right; }
.stage__tag--hint span { color: var(--red-ink); font-weight: 700; }

/* ---------- hero: the console ---------- */
.console { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; padding: 30px clamp(16px, 4vw, 64px) 44px; background: var(--well); color: var(--well-ink); border-bottom: var(--bw) solid var(--line); }
.console__lede { font-size: clamp(1.1rem, 1.7vw, 1.4rem); line-height: 1.5; max-width: 44ch; }
.console__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 22px 28px; margin-top: 26px; }
/* The panel: the big red button beside the sign, then one row of keys. */
.console__panel { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px 22px; justify-self: end; width: min(100%, 440px); }

.sign { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 11.5rem; padding: 14px 12px; text-align: center; background: var(--yel); color: var(--on-accent); border-radius: 8px; border: var(--bw) solid var(--well); outline: 2px solid var(--yel); }
.sign__clock { flex: none; min-width: 3.9ch; padding: 4px 10px 6px; background: var(--well); color: var(--yel); border-radius: 6px; font: 900 2.5rem/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; text-align: center; }
.sign__clock.is-reset { animation: flash 0.5s steps(2, jump-none) 2; }
.sign__text { font: 500 0.78rem/1.45 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }
@keyframes flash { 50% { background: var(--red); color: var(--on-accent); } }

.bigred { justify-self: center; width: 112px; height: 112px; padding: 11px; border: 0; border-radius: 50%; background: repeating-conic-gradient(var(--yel) 0 15deg, var(--hazard-dark) 15deg 30deg); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bigred span { display: grid; place-items: center; width: 100%; height: 100%; padding: 8px; border-radius: 50%; background: var(--red); color: var(--on-accent); border: var(--bw) solid var(--well); box-shadow: 0 7px 0 var(--red-shadow); transform: translateY(-7px); font: 900 1.05rem/0.95 var(--display); letter-spacing: 0.04em; text-transform: uppercase; transition: transform 0.07s, box-shadow 0.07s; }
.bigred:hover span { background: var(--red-hover); }
.bigred:active span { transform: translateY(0); box-shadow: 0 0 0 var(--red-shadow); }
.keys { grid-column: 1 / -1; display: flex; gap: 10px; }
.key { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 9px 13px; background: transparent; color: var(--well-ink); border: 2px solid var(--key-border); border-radius: 8px; font: 500 0.78rem/1.25 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.08s; }
.key:hover { background: var(--well-ink); color: var(--well); border-color: var(--well-ink); }
.key:active { transform: translateY(2px); }
.key--toggle::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--led-off); box-shadow: 0 0 0 2px var(--led-ring); }
.key--toggle[aria-pressed="true"] { border-color: var(--yel); color: var(--yel); }
.key--toggle[aria-pressed="true"]::before { background: var(--yel); box-shadow: 0 0 0 2px var(--yel), 0 0 10px 2px var(--yel); }
.key--toggle[aria-pressed="true"]:hover { background: var(--yel); color: var(--on-accent); }

@media (max-width: 860px) {
  .top__nav { display: none; }
  /* One column: the control panel sits right under the pitch paragraph, ahead of the CTA. */
  .console { grid-template-columns: 1fr; gap: 0; padding-top: 24px; }
  .console__pitch { display: contents; }
  .console__panel { order: 1; justify-self: start; margin-top: 26px; }
  .console__cta { order: 2; margin-top: 30px; }
}
/* The two stage captions need about 720px to sit side by side; below that only the hint shows. */
@media (max-width: 760px) {
  .stage__tag:not(.stage__tag--hint) { display: none; }
  .stage__tag--hint { left: clamp(16px, 3vw, 36px); text-align: left; }
}
@media (max-width: 420px) {
  .stage__tag--hint { font-size: 0.66rem; letter-spacing: 0.08em; }
  .bigred { width: 100px; height: 100px; }
  .keys { gap: 8px; }
  .key { gap: 7px; padding: 10px 8px; font-size: 0.72rem; letter-spacing: 0.02em; }
  .theme-btn__label { display: none; }
}
@media (max-width: 360px) {
  .console__panel { column-gap: 14px; }
  .sign { width: 10.5rem; }
}
