/*
 * ZeroSecure 2.0 website styles.
 * Layout concept (D-10): the page is a live power grid. A fixed three-phase
 * bus feeds every section and each section is a piece of electrical
 * equipment (rating plate, multimeter, breaker panel, transmission line,
 * power gauge, hazard labels, fuse box, patch panel, sockets, knife switch).
 * Deliberately dark single theme: the effects are additive light on black.
 */

@property --acc { syntax: '<color>'; inherits: true; initial-value: #b44bff; }
@property --acc-hot { syntax: '<color>'; inherits: true; initial-value: #f2e2ff; }
@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

:root {
  color-scheme: dark;
  /* Neutrals biased towards violet so they sit under all three phases. */
  --void: #06040b;
  --deep: #0e0b18;
  --plate: #151020;
  --wire: #2a2342;
  --fg: #f3efff;
  --dim: #a8a0c6;
  --faint: #756d93;
  /* Phase palette. */
  --r: #ff2b4a;
  --r-hot: #ffd6c8;
  --p: #b44bff;
  --p-hot: #f2e2ff;
  --b: #1fb6ff;
  --b-hot: #d6f5ff;
  --acc: var(--p);
  --acc-hot: var(--p-hot);
  /* Type. */
  --f-display: 'Unbounded', 'Arial Black', 'Segoe UI', system-ui, sans-serif;
  --f-ui: 'Chakra Petch', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  /* Layout. */
  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1240px;
  --nav-h: 64px;
  --chamfer: 10px;
}

[data-phase="r"] { --acc: var(--r); --acc-hot: var(--r-hot); }
[data-phase="p"] { --acc: var(--p); --acc-hot: var(--p-hot); }
[data-phase="b"] { --acc: var(--b); --acc-hot: var(--b-hot); }

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  background: var(--void);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--fg);
  font-family: var(--f-ui);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Oscilloscope graticule and phase glow behind the whole page. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 85% -8%, color-mix(in srgb, var(--acc) 15%, transparent), transparent 62%),
    radial-gradient(900px 560px at -12% 46%, color-mix(in srgb, var(--b) 8%, transparent), transparent 62%),
    radial-gradient(800px 520px at 110% 92%, color-mix(in srgb, var(--r) 7%, transparent), transparent 62%),
    linear-gradient(to bottom, transparent calc(100% - 1px), rgba(255, 255, 255, 0.032) 0) 0 0 / 100% 48px,
    linear-gradient(to right, transparent calc(100% - 1px), rgba(255, 255, 255, 0.032) 0) 0 0 / 48px 100%;
}

::selection { background: color-mix(in srgb, var(--acc) 50%, transparent); color: #fff; }

:focus-visible { outline: 2px solid var(--acc-hot); outline-offset: 3px; }

a { color: var(--acc-hot); }

img, svg, canvas { max-width: 100%; }

.sr-only {
  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: fixed;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--acc);
  color: var(--void);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/*
 * Cursors are native (drawn by the OS, so they never lag a frame behind
 * the hand) but themed per phase: a reticle by default, a ringed bolt over
 * anything clickable. 32 x 32 is the size every desktop OS accepts.
 */
html { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='7.5' fill='none' stroke='%2306040b' stroke-width='4'/%3E%3Ccircle cx='16' cy='16' r='7.5' fill='none' stroke='%23b44bff' stroke-width='2'/%3E%3Cpath d='M16 2v6M16 24v6M2 16h6M24 16h6' stroke='%2306040b' stroke-width='3.6' stroke-linecap='round'/%3E%3Cpath d='M16 2v6M16 24v6M2 16h6M24 16h6' stroke='%23f2e2ff' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='16' cy='16' r='2.2' fill='%23fff' stroke='%2306040b'/%3E%3C/svg%3E") 16 16, crosshair; }
html[data-phase="r"] { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='7.5' fill='none' stroke='%2306040b' stroke-width='4'/%3E%3Ccircle cx='16' cy='16' r='7.5' fill='none' stroke='%23ff2b4a' stroke-width='2'/%3E%3Cpath d='M16 2v6M16 24v6M2 16h6M24 16h6' stroke='%2306040b' stroke-width='3.6' stroke-linecap='round'/%3E%3Cpath d='M16 2v6M16 24v6M2 16h6M24 16h6' stroke='%23ffd6c8' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='16' cy='16' r='2.2' fill='%23fff' stroke='%2306040b'/%3E%3C/svg%3E") 16 16, crosshair; }
html[data-phase="b"] { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='7.5' fill='none' stroke='%2306040b' stroke-width='4'/%3E%3Ccircle cx='16' cy='16' r='7.5' fill='none' stroke='%231fb6ff' stroke-width='2'/%3E%3Cpath d='M16 2v6M16 24v6M2 16h6M24 16h6' stroke='%2306040b' stroke-width='3.6' stroke-linecap='round'/%3E%3Cpath d='M16 2v6M16 24v6M2 16h6M24 16h6' stroke='%23d6f5ff' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='16' cy='16' r='2.2' fill='%23fff' stroke='%2306040b'/%3E%3C/svg%3E") 16 16, crosshair; }
:is(a[href], button, summary, label, select, [role="button"], [role="radio"], .knob) { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='11' fill='%23b44bff' fill-opacity='.3' stroke='%2306040b' stroke-width='4'/%3E%3Ccircle cx='16' cy='16' r='11' fill='none' stroke='%23b44bff' stroke-width='2.2'/%3E%3Cpath d='M17.5 9.5 12 17h4l-1.5 5.5L20 15h-4z' fill='%23fff' stroke='%2306040b' stroke-width='.8' stroke-linejoin='round'/%3E%3C/svg%3E") 16 16, pointer; }
html[data-phase="r"] :is(a[href], button, summary, label, select, [role="button"], [role="radio"], .knob) { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='11' fill='%23ff2b4a' fill-opacity='.3' stroke='%2306040b' stroke-width='4'/%3E%3Ccircle cx='16' cy='16' r='11' fill='none' stroke='%23ff2b4a' stroke-width='2.2'/%3E%3Cpath d='M17.5 9.5 12 17h4l-1.5 5.5L20 15h-4z' fill='%23fff' stroke='%2306040b' stroke-width='.8' stroke-linejoin='round'/%3E%3C/svg%3E") 16 16, pointer; }
html[data-phase="b"] :is(a[href], button, summary, label, select, [role="button"], [role="radio"], .knob) { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='11' fill='%231fb6ff' fill-opacity='.3' stroke='%2306040b' stroke-width='4'/%3E%3Ccircle cx='16' cy='16' r='11' fill='none' stroke='%231fb6ff' stroke-width='2.2'/%3E%3Cpath d='M17.5 9.5 12 17h4l-1.5 5.5L20 15h-4z' fill='%23fff' stroke='%2306040b' stroke-width='.8' stroke-linejoin='round'/%3E%3C/svg%3E") 16 16, pointer; }
:is(input, textarea) { cursor: text; }
button:disabled { cursor: not-allowed; }

#fx {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}

/* Own compositing layer: the screen shake then only moves the layer
   instead of re-rasterising the page on every strike. */
#shell {
  position: relative;
  z-index: 1;
  overflow-x: clip;
  will-change: transform;
}

.wrap {
  width: min(var(--maxw), 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ------------------------------------------------------------- buttons */

.btn {
  --btn-bg: var(--deep);
  --btn-fg: var(--fg);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  background: transparent;
  color: var(--btn-fg);
  font: 700 14px/1 var(--f-ui);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer));
  transition: transform 0.18s ease, filter 0.18s ease;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    conic-gradient(from var(--spin), transparent 0 60%, var(--acc-hot) 72%, var(--acc) 80%, transparent 90%),
    color-mix(in srgb, var(--acc) 45%, transparent);
}
/* The current-chase border runs only while pointed at or focused: an
   always-on custom-property animation forces a style recalc and repaint of
   every button on every frame (measured, see DESIGN_LOG perf entry). */
.btn:hover::before,
.btn:focus-visible::before { animation: spin 1.4s linear infinite; }
.btn::after {
  content: '';
  position: absolute;
  inset: 1.5px;
  z-index: -1;
  background: var(--btn-bg);
  clip-path: polygon(calc(var(--chamfer) - 0.6px) 0, 100% 0, 100% calc(100% - var(--chamfer) + 0.6px), calc(100% - var(--chamfer) + 0.6px) 100%, 0 100%, 0 calc(var(--chamfer) - 0.6px));
  transition: background 0.2s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { --btn-bg: var(--acc); --btn-fg: var(--void); }
.btn-primary:hover { --btn-bg: var(--acc-hot); }
.btn-ghost { --btn-bg: color-mix(in srgb, var(--deep) 92%, var(--acc)); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 12px; --chamfer: 7px; }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 15px; --chamfer: 12px; }

@keyframes spin { to { --spin: 360deg; } }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--wire);
  background: var(--deep);
  color: var(--dim);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.icon-btn:hover,
.icon-btn[aria-pressed="true"] { color: var(--acc-hot); border-color: var(--acc); }
.icon-btn svg { width: 20px; height: 20px; }
#sound-btn .snd-on { display: none; }
#sound-btn[aria-pressed="true"] .snd-on { display: inline; }
#sound-btn[aria-pressed="true"] .snd-off { display: none; }

.copy {
  flex: none;
  padding: 3px 7px;
  border: 1px solid var(--wire);
  background: transparent;
  color: var(--faint);
  font: 600 10px/1.2 var(--f-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
.copy:hover { color: var(--acc-hot); border-color: var(--acc); }

/* ----------------------------------------------------------------- nav */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  padding-inline: var(--gutter);
  background: color-mix(in srgb, var(--void) 94%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--acc) 24%, transparent);
}
.nav::after {
  content: '';
  position: absolute;
  left: -28%;
  bottom: -1px;
  width: 28%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--acc-hot), transparent);
  animation: navPulse 3.4s linear infinite;
  will-change: transform;
}
@keyframes navPulse {
  from { transform: translateX(0); }
  to { transform: translateX(457%); }
}
.nav-load {
  display: none;
  align-items: baseline;
  gap: 6px;
  padding: 0 4px;
  color: var(--faint);
  font: 700 11px/1 var(--f-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}
.nav-load b { min-width: 4ch; color: var(--acc-hot); text-align: right; }
.nav-load.crit b { color: var(--r); }
@media (min-width: 1240px) { .nav-load { display: inline-flex; } }
.nav-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  pointer-events: none;
}
.nav-bar-fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--b), var(--p), var(--r));
  box-shadow: 0 0 10px var(--acc);
  transition: width 0.25s ease;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  text-decoration: none;
  flex: none;
}
.brand-mark { width: 30px; height: 30px; color: var(--acc); filter: drop-shadow(0 0 6px var(--acc)); }
.brand-word { font: 800 15px/1 var(--f-display); letter-spacing: -0.01em; }
.brand-word em { font-style: normal; color: var(--acc-hot); margin-left: 4px; }

.nav-links {
  display: flex;
  gap: 4px;
  margin-inline: auto;
}
.nav-links a {
  position: relative;
  padding: 8px 12px;
  color: var(--dim);
  font: 600 13px/1 var(--f-ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  background: var(--acc);
  box-shadow: 0 0 8px var(--acc);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--fg); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

.nav-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-links + .nav-tools { margin-left: 0; }

.phase-switch {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: var(--deep);
  border: 1px solid var(--wire);
}
.phase-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dim);
  font: 800 12px/1 var(--f-mono);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.phase-btn .led {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--acc) 45%, #000);
}
.phase-btn:hover { color: var(--acc-hot); }
.phase-btn[aria-checked="true"] {
  background: var(--acc);
  color: var(--void);
  box-shadow: 0 0 18px -2px var(--acc);
}
.phase-btn[aria-checked="true"] .led { background: #fff; box-shadow: 0 0 6px #fff; }

.menu-btn { display: none; }

@media (max-width: 1080px) {
  .menu-btn { display: inline-grid; }
  .nav-cta { display: none; }
  .nav-links {
    position: fixed;
    top: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 8px var(--gutter) 18px;
    background: color-mix(in srgb, var(--void) 96%, transparent);
    border-bottom: 1px solid var(--wire);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }
  .nav-links.open { opacity: 1; transform: none; visibility: visible; }
  .nav-links a { padding: 14px 0; font-size: 15px; border-bottom: 1px solid var(--wire); }
  .nav-links a::after { display: none; }
}
@media (max-width: 520px) {
  .brand-word { display: none; }
  .nav { gap: 10px; }
  #sound-btn { width: 36px; height: 36px; }
}

/* ------------------------------------------------- three-phase bus rail */

.bus {
  position: fixed;
  left: 20px;
  top: calc(var(--nav-h) + 28px);
  bottom: 30px;
  z-index: 40;
  width: 20px;
  display: none;
  transition: opacity 0.3s ease;
  --prog: 0%;
}
.bus.away { opacity: 0; pointer-events: none; }
@media (min-width: 1360px) { .bus { display: block; } }
.bus-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: color-mix(in srgb, var(--c) 16%, transparent);
}
.bus-rail:nth-child(1) { left: 2px; --c: var(--r); }
.bus-rail:nth-child(2) { left: 9px; --c: var(--p); }
.bus-rail:nth-child(3) { left: 16px; --c: var(--b); }
.bus-rail::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: var(--prog);
  background: var(--c);
  box-shadow: 0 0 8px var(--c);
}
.bus-head {
  position: absolute;
  left: -4px;
  top: var(--prog);
  width: 26px;
  height: 2px;
  background: #fff;
  box-shadow: 0 0 10px #fff, 0 0 26px var(--acc);
}
.bus-node {
  position: absolute;
  left: -5px;
  width: 30px;
  height: 12px;
  margin-top: -6px;
  border: 1px solid var(--wire);
  background: var(--void);
  text-decoration: none;
}
.bus-node.passed { border-color: var(--acc); box-shadow: 0 0 10px -2px var(--acc); }
.bus-node::after {
  content: attr(data-label);
  position: absolute;
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 8px;
  background: var(--deep);
  border: 1px solid var(--wire);
  color: var(--fg);
  font: 600 11px/1 var(--f-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.bus-node:hover::after,
.bus-node:focus-visible::after { opacity: 1; }

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative;
  z-index: 1;
  isolation: isolate;
  overflow: visible;
  padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + clamp(28px, 5vh, 64px));
  padding-bottom: clamp(56px, 9vh, 110px);
}
.hero-field {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}
/* Floor glow peaks above the hero's bottom edge and fades to nothing at
   it, so the hero hands over to the hazard tape without a hard seam. */
.hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 52%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(62% 80% at 50% 70%, color-mix(in srgb, var(--acc) 20%, transparent), transparent 72%);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}

/* Bolt terminals (D-13): 3D extruded bolts. Below 1280 px they sit in a
   row under the hero copy (thumb zone on phones); from 1280 px they stand
   in the hero's bottom corners. Only transform and opacity animate, so the
   motion stays on the compositor. */
.terminals {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
}
.volt {
  position: relative;
  flex: none;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: clamp(88px, 24vw, 118px);
}
.volt-btn {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 100 / 160;
  padding: 0;
  border: 0;
  background: none;
  perspective: 520px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.volt-btn:focus-visible { outline: 2px solid var(--acc-hot); outline-offset: 8px; }
.volt-glow {
  position: absolute;
  inset: -28% -46% -14%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--acc) 50%, transparent), transparent);
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.volt.charging .volt-glow,
.hero.bridged .volt-glow { opacity: 1; transform: scale(1.25); }
.volt-float {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: voltSwing 6s ease-in-out infinite;
}
.volt-r .volt-float { animation-delay: -3s; }
.volt.charging .volt-float { animation: voltSpin 0.6s linear infinite; }
.volt-tilt {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg));
  transition: transform 0.25s ease-out;
}
/* Extrusion: back face at -depth plus one side wall per outline edge
   (built in site.js), all static planes moved only by the parent's 3D
   transform, so the motion never repaints. */
.volt-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: translateZ(calc(var(--depth, 30px) * -1));
}
.volt-back path { fill: color-mix(in srgb, var(--acc) 22%, #05030a); }
.volt-sides { position: absolute; inset: 0; transform-style: preserve-3d; }
.volt-side {
  position: absolute;
  left: 0;
  top: 0;
  height: var(--depth, 30px);
  transform-origin: 0 0;
}
.volt-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: translateZ(1px);
}
.volt-meter { width: 78%; height: 4px; overflow: hidden; background: #1a1526; }
.volt-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--acc), var(--acc-hot));
  transform: scaleX(0);
  transform-origin: left;
}
.volt-label {
  min-height: 10px;
  color: var(--faint);
  font: 700 10px/1 var(--f-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.volt.charging .volt-label,
.volt.latched .volt-label { color: var(--acc-hot); }
.volt-hint {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: 0;
  padding-bottom: 24px;
  color: var(--dim);
  font: 600 11px/1.45 var(--f-mono);
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}
.vh-bar {
  width: min(240px, 100%);
  height: 3px;
  overflow: hidden;
  background: #1a1526;
  opacity: 0;
  transition: opacity 0.2s;
}
.hero.bridged .vh-bar { opacity: 1; }
.vh-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--b), var(--p), var(--r));
  transform: scaleX(0);
  transform-origin: left;
}
.hero.bridged .volt-hint { color: var(--acc-hot); }
@keyframes voltSwing {
  0%, 100% { transform: translateY(0) rotateY(-28deg) rotateX(8deg); }
  50% { transform: translateY(-8px) rotateY(28deg) rotateX(-6deg); }
}
@keyframes voltSpin {
  from { transform: rotateX(6deg) rotateY(0deg); }
  to { transform: rotateX(6deg) rotateY(360deg); }
}
@media (min-width: 1280px) {
  .terminals { position: static; margin: 0; }
  .volt {
    position: absolute;
    bottom: 34px;
    z-index: 1;
    width: clamp(100px, 8vw, 136px);
  }
  .volt-l { left: clamp(12px, 2.4vw, 48px); }
  .volt-r { right: clamp(12px, 2.4vw, 48px); }
  .volt-hint {
    position: absolute;
    left: 50%;
    bottom: 22px;
    width: min(440px, 40vw);
    padding: 0;
    transform: translateX(-50%);
  }
}

.hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--dim);
  font: 600 13px/1.2 var(--f-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.eyebrow-dot {
  width: 8px;
  height: 8px;
  flex: none;
  background: var(--acc);
  box-shadow: 0 0 10px var(--acc);
  animation: blink 1.6s steps(2, start) infinite;
}
.mains {
  margin: 0;
  color: var(--faint);
  font: 500 12px/1.2 var(--f-mono);
  letter-spacing: 0.16em;
}

.hero-title {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  margin: clamp(18px, 3.4vh, 40px) 0 0;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(40px, 9.4vw, 172px);
  line-height: 0.86;
  letter-spacing: -0.05em;
}
.ht-part { display: inline-flex; }
.ht-a { order: 1; }
.ht-b { order: 2; }
.ht-ed { order: 3; }
.ht-part .ch {
  display: inline-block;
  color: transparent;
  background: linear-gradient(180deg, #ffffff 0%, var(--acc-hot) 36%, var(--acc) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 16px color-mix(in srgb, var(--acc) 55%, transparent));
  transition: transform 0.25s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.ht-part .ch.hot {
  background: #ffffff;
  -webkit-background-clip: text;
  background-clip: text;
  transform: translateY(-0.06em) scale(1.05);
  filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 26px var(--acc));
}
.ht-part .ch.flick { animation: flick 0.32s steps(2, start) 2; }
.hero-title.glitch .ht-part { animation: glitch 0.26s steps(3, start) 1; }
.ht-ed {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08em;
  margin-left: 0.14em;
  padding-top: 0.04em;
  font-size: 0.4em;
  line-height: 0.9;
}
.ht-ed b {
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 0.035em var(--acc-hot);
  letter-spacing: -0.02em;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--acc) 70%, transparent));
}
.ht-ed i {
  font: 600 max(10px, 0.16em)/1 var(--f-mono);
  font-style: normal;
  letter-spacing: 0.2em;
  color: var(--dim);
}
@media (max-width: 700px) {
  .ht-ed { order: 2; }
  .ht-b { order: 3; flex-basis: 100%; }
}

.hero-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: clamp(14px, 2vh, 22px) 0 0;
  color: var(--dim);
  font: 600 clamp(13px, 1.25vw, 16px)/1.3 var(--f-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.hero-sub .slash { color: var(--acc); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
  margin-top: clamp(30px, 5vh, 60px);
  max-width: 1080px;
}
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
}
/* Grid items default to min-width: auto, which would let the nowrap
   terminal line widen the whole column past a phone screen. */
.hero-copy,
.hero-panel { min-width: 0; }
@media (max-width: 560px) {
  .hero-term { font-size: 12px; }
}
.hero-tagline {
  margin: 0;
  font: 700 clamp(24px, 2.8vw, 38px)/1.1 var(--f-ui);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-wrap: balance;
}
.hero-kicker {
  margin: 16px 0 0;
  color: var(--acc-hot);
  font: 500 15px/1.6 var(--f-mono);
}
.hero-kicker::before { content: '> '; color: var(--acc); }
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}
/* The hero register button is the one control whose current always runs.
   Its chase is a rotating square layer clipped by the button outline: a
   transform animation, so it runs on the compositor without repaints. */
.btn-spin {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -2;
  width: 150%;
  aspect-ratio: 1;
  background: conic-gradient(from 0deg, transparent 0 58%, var(--acc-hot) 70%, var(--acc) 80%, transparent 90%);
  transform: translate(-50%, -50%) rotate(0deg);
  animation: spinT 2.2s linear infinite;
  will-change: transform;
  pointer-events: none;
}
@keyframes spinT { to { transform: translate(-50%, -50%) rotate(360deg); } }
.hero-ctas .btn-primary { box-shadow: 0 0 34px -8px var(--acc); }
.hero-term {
  display: flex;
  gap: 0 8px;
  height: calc(1.5em + 20px);
  max-width: 100%;
  margin: 26px 0 0;
  white-space: nowrap;
  overflow: hidden;
  contain: layout paint;
  padding: 10px 12px;
  border-left: 2px solid var(--acc);
  background: linear-gradient(90deg, color-mix(in srgb, var(--acc) 10%, transparent), transparent 80%);
  color: var(--fg);
  font: 500 14px/1.5 var(--f-mono);
}
.ht-prompt { color: var(--acc-hot); flex: none; }
.ht-cmd { overflow: hidden; text-overflow: clip; }
.ht-cmd { color: var(--fg); }
.ht-caret {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: -6px;
  align-self: center;
  background: var(--acc-hot);
  box-shadow: 0 0 8px var(--acc);
  animation: blink 1s steps(2, start) infinite;
}

.plate {
  position: relative;
  padding: 18px 22px 16px;
  background:
    radial-gradient(circle at 10px 10px, #4a4260 0 2.5px, transparent 3px),
    radial-gradient(circle at calc(100% - 10px) 10px, #4a4260 0 2.5px, transparent 3px),
    radial-gradient(circle at 10px calc(100% - 10px), #4a4260 0 2.5px, transparent 3px),
    radial-gradient(circle at calc(100% - 10px) calc(100% - 10px), #4a4260 0 2.5px, transparent 3px),
    linear-gradient(160deg, #1a1529, #0e0b18);
  border: 1px solid var(--wire);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.plate-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--wire);
  color: var(--faint);
  font: 600 11px/1.2 var(--f-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.plate-head b { color: var(--acc); font-weight: 700; }
.plate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 0;
}
.plate-grid > div { min-width: 0; }
.plate-grid dt {
  color: var(--faint);
  font: 600 10.5px/1.2 var(--f-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.plate-grid dd {
  margin: 3px 0 0;
  color: var(--fg);
  font: 700 15px/1.25 var(--f-ui);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.plate-grid dd.acc { color: var(--acc-hot); }

.nixie {
  margin-top: 14px;
  padding: 16px 18px 14px;
  background: linear-gradient(180deg, #0c0914, #08060e);
  border: 1px solid var(--wire);
}
.nixie-label {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  color: var(--faint);
  font: 600 11px/1.3 var(--f-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.nixie-label b { color: var(--acc-hot); font-weight: 700; }
.nixie-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.nx-group { display: grid; justify-items: center; gap: 6px; }
.nx-tubes { display: flex; gap: 4px; }
.nx-unit {
  color: var(--faint);
  font: 600 10px/1 var(--f-mono);
  letter-spacing: 0.2em;
}
.nx-sep {
  align-self: center;
  margin-bottom: 16px;
  color: var(--acc);
  font: 300 26px/1 var(--f-display);
  animation: blink 1s steps(2, start) infinite;
}
.tube {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(30px, 3.2vw, 42px);
  height: clamp(48px, 5vw, 66px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px 16px 5px 5px;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, 0.1), transparent 55%),
    repeating-linear-gradient(60deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(-60deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 5px),
    #0a0710;
  font: 300 clamp(26px, 3vw, 40px)/1 var(--f-display);
}
.tube { contain: strict; }
.lcd, .nav-load { contain: layout paint; }
.tube-ghost { position: absolute; color: rgba(255, 255, 255, 0.05); }
.tube-digit {
  position: relative;
  color: var(--acc-hot);
  text-shadow: 0 0 4px var(--acc), 0 0 14px var(--acc), 0 0 30px var(--acc);
}
.tube.blink .tube-digit { animation: tubeBlink 0.12s steps(2, start) 1; }

/* -------------------------------------------------------- hazard tape */

/* No clipping here: the page shell already clips sideways overflow, and
   clipping this box would square off the tape's glow into hard bands. */
.tape-wrap {
  position: relative;
  z-index: 2;
  padding-block: 26px;
}
.tape {
  margin-inline: -60px;
  transform: rotate(-1.5deg);
  background: repeating-linear-gradient(-45deg, var(--acc) 0 14px, #0a0812 14px 28px);
  box-shadow: 0 0 40px -10px var(--acc);
}
.tape-band {
  margin-block: 9px;
  padding-block: 10px;
  overflow: hidden;
  background: #0a0812;
}
.tape-track {
  display: flex;
  width: max-content;
  animation: ticker 46s linear infinite;
}
.tape-track span {
  padding-inline: 18px;
  color: var(--acc-hot);
  font: 700 14px/1 var(--f-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tape-track span::after { content: '\26A1'; margin-left: 36px; color: var(--acc); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ------------------------------------------------------------ sections */

.section {
  position: relative;
  z-index: 1;
  padding-block: clamp(76px, 10vw, 140px);
}
.sec-head {
  display: grid;
  gap: 14px;
  margin-bottom: clamp(36px, 5vw, 64px);
}
.sec-head-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
}
.sec-head-row > div { display: grid; gap: 14px; min-width: 0; }
@media (max-width: 760px) {
  .sec-head-row { grid-template-columns: 1fr; }
}
.sec-tag {
  margin: 0;
  color: var(--acc);
  font: 600 13px/1.2 var(--f-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.sec-title {
  margin: 0;
  max-width: 18ch;
  font: 800 clamp(34px, 5.6vw, 80px)/0.98 var(--f-display);
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.sec-lede {
  margin: 0;
  max-width: 62ch;
  color: var(--dim);
  font-size: clamp(16px, 1.4vw, 19px);
}
.section.live .sec-title { animation: neonOn 0.9s steps(1, end) 1; }
/* Accent words carry the live current: phase gradient with a white-hot
   band that sweeps once when the section powers on. */
.sec-title em,
.hero-tagline em {
  font-style: normal;
  color: transparent;
  background: linear-gradient(100deg, var(--acc-hot) 0%, var(--acc) 42%, #ffffff 50%, var(--acc) 58%, var(--acc-hot) 100%) 0 0 / 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--acc) 55%, transparent));
}
.section.live .sec-title em { animation: emSweep 1.1s ease-out 1; }
@keyframes emSweep {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

.note {
  margin: 22px 0 0;
  max-width: 70ch;
  color: var(--faint);
  font: 500 13px/1.6 var(--f-mono);
}

/* --------------------------------------------------------------- event */

.event-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(28px, 4vw, 60px);
  align-items: start;
}
@media (max-width: 980px) { .event-grid { grid-template-columns: 1fr; } }

.facts { margin: 0; border-top: 1px solid var(--wire); }
.fact {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
  padding: 17px 0;
  border-bottom: 1px solid var(--wire);
}
.fact dt {
  padding-top: 3px;
  color: var(--acc);
  font: 600 12px/1.3 var(--f-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.fact dd { margin: 0; min-width: 0; font-size: 17px; }
.fact dd strong { font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.fact dd small { display: block; margin-top: 3px; color: var(--dim); font-size: 14px; }
.fact dd a { color: var(--acc-hot); }
@media (max-width: 620px) {
  .fact { grid-template-columns: 1fr; gap: 4px; }
}

.meter {
  position: relative;
  padding: 18px 18px 20px;
  border: 10px solid color-mix(in srgb, var(--acc) 55%, #120c1d);
  border-radius: 22px;
  background: linear-gradient(170deg, #1a1626, #0d0a15);
  box-shadow: 0 30px 80px -40px var(--acc), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.meter-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--faint);
  font: 700 11px/1 var(--f-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.meter-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acc-hot);
  box-shadow: 0 0 8px var(--acc);
  animation: blink 1.2s steps(2, start) infinite;
}
.lcd {
  position: relative;
  margin-top: 14px;
  padding: 14px 16px 12px;
  border-radius: 8px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--acc) 12%, #07060c), #07060c);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.8);
  min-height: 132px;
}
.lcd-row { position: relative; display: flex; align-items: baseline; gap: 8px; }
.lcd-pre { color: var(--acc-hot); font: 700 26px/1 var(--f-mono); opacity: 0.85; }
.lcd-num { position: relative; display: inline-block; font: 700 clamp(46px, 5.4vw, 64px)/1 var(--f-mono); letter-spacing: 0.02em; }
.lcd-ghost { color: rgba(255, 255, 255, 0.05); }
.lcd-val {
  position: absolute;
  left: 0;
  top: 0;
  color: var(--acc-hot);
  text-shadow: 0 0 8px var(--acc), 0 0 22px color-mix(in srgb, var(--acc) 60%, transparent);
  white-space: nowrap;
}
.lcd-unit { color: var(--acc-hot); font: 700 15px/1 var(--f-mono); letter-spacing: 0.12em; }
.lcd-cap {
  margin: 10px 0 0;
  color: color-mix(in srgb, var(--acc-hot) 70%, transparent);
  font: 500 12px/1.4 var(--f-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dial-area { display: grid; place-items: center; padding: 26px 0 6px; }
.dial {
  position: relative;
  width: 236px;
  height: 236px;
  max-width: 100%;
}
.dial-face {
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, color-mix(in srgb, var(--acc) 30%, transparent), transparent 40%, color-mix(in srgb, var(--acc) 15%, transparent) 70%, transparent);
  border: 1px dashed var(--wire);
}
.dial-pos {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 30px;
  margin: -15px 0 0 -22px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--faint);
  font: 800 12px/1 var(--f-mono);
  cursor: pointer;
  transform: rotate(var(--a)) translateY(-104px) rotate(calc(-1 * var(--a)));
  transition: color 0.2s, border-color 0.2s;
}
.dial-pos:hover { color: var(--fg); }
.dial-pos[aria-checked="true"] { color: var(--acc-hot); border-color: color-mix(in srgb, var(--acc) 60%, transparent); text-shadow: 0 0 8px var(--acc); }
.knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 116px;
  height: 116px;
  margin: -58px 0 0 -58px;
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.06) 0 4deg, transparent 4deg 10deg),
    radial-gradient(circle at 35% 30%, #3b3452, #16121f 70%);
  border: 2px solid #2f2845;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.08);
  transform: rotate(var(--r, -120deg));
  transition: transform 0.45s cubic-bezier(0.3, 1.5, 0.5, 1);
  touch-action: none;
}
.knob::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 6px;
  width: 6px;
  height: 40px;
  margin-left: -3px;
  border-radius: 3px;
  background: linear-gradient(var(--acc-hot), var(--acc));
  box-shadow: 0 0 12px var(--acc);
}
.meter-jacks {
  display: flex;
  justify-content: space-around;
  margin-top: 8px;
  color: var(--faint);
  font: 700 10px/1 var(--f-mono);
  letter-spacing: 0.16em;
}
.meter-jacks span { display: grid; justify-items: center; gap: 6px; }
.meter-jacks span::before {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, #000 0 4px, #2b2440 5px 8px, #191424 9px);
  border: 1px solid #3a3352;
}
.meter-jacks span:nth-child(2)::before { border-color: var(--r); }

.channels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: clamp(36px, 5vw, 64px);
}
@media (max-width: 820px) { .channels { grid-template-columns: 1fr; } }
.channel {
  position: relative;
  padding: 22px 22px 20px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--acc) 8%, var(--deep)), var(--deep) 60%);
  border: 1px solid color-mix(in srgb, var(--acc) 40%, var(--wire));
}
.channel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 14px;
}
.channel h3 {
  margin: 0;
  font: 800 22px/1.1 var(--f-display);
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.channel-fee {
  color: var(--acc-hot);
  font: 700 14px/1 var(--f-mono);
  letter-spacing: 0.1em;
}
.channel h4 {
  margin: 16px 0 6px;
  color: var(--acc);
  font: 700 11px/1.2 var(--f-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.channel ul { margin: 0; padding-left: 18px; color: var(--dim); font-size: 15px; display: grid; gap: 6px; }
.channel li::marker { color: var(--acc); }

/* -------------------------------------------------------------- matrix */

.main-breaker {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--wire);
  background: var(--deep);
  color: var(--fg);
  font: 700 12px/1.2 var(--f-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
}
.main-breaker:hover { border-color: var(--acc); }
.main-breaker small { display: block; color: var(--faint); font-weight: 600; letter-spacing: 0.12em; }
.main-breaker .lever { width: 30px; height: 50px; }

.panel-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  background:
    linear-gradient(to bottom, transparent 0 46px, rgba(255, 255, 255, 0.03) 46px 54px, transparent 54px) 0 0 / 100% 50%,
    linear-gradient(180deg, #110e1b, #0b0913);
  border: 1px solid var(--wire);
}
@media (max-width: 1140px) { .panel-board { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .panel-board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px; } }

.breaker {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 10px;
  min-width: 0;
  min-height: 252px;
  padding: 14px 14px 12px;
  border: 1px solid #2b2443;
  background: linear-gradient(180deg, #1a1626, #110e1b);
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
}
.breaker:hover { border-color: color-mix(in srgb, var(--acc) 60%, transparent); transform: translateY(-2px); }
.breaker[aria-pressed="true"] {
  border-color: var(--acc);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--acc) 40%, transparent), 0 0 30px -8px var(--acc), inset 0 0 44px -20px var(--acc);
}
.brk-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--faint);
  font: 600 11px/1 var(--f-mono);
  letter-spacing: 0.16em;
}
.brk-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2a2236;
  box-shadow: inset 0 0 2px #000;
  transition: background 0.2s, box-shadow 0.2s;
}
[aria-pressed="true"] .brk-led { background: var(--acc-hot); box-shadow: 0 0 6px var(--acc-hot), 0 0 16px var(--acc); }
.brk-icon { width: 34px; height: 34px; color: var(--acc); }
.brk-icon svg { width: 100%; height: 100%; }
.brk-name {
  font: 800 15px/1.15 var(--f-display);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  overflow-wrap: break-word;
  hyphens: auto;
}
@media (max-width: 760px) {
  .breaker { min-height: 0; }
  .brk-name { font-size: 12.5px; }
  .brk-desc { font-size: 13px; }
}
.brk-desc { color: var(--dim); font-size: 14px; line-height: 1.45; }
.brk-lever { display: flex; align-items: center; gap: 10px; }
.lever {
  position: relative;
  display: inline-block;
  flex: none;
  width: 26px;
  height: 44px;
  border: 1px solid #2b2443;
  border-radius: 4px;
  background: #0a0811;
}
.lever-knob {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  height: 45%;
  border-radius: 3px;
  background: linear-gradient(#3a3350, #221d33);
  transition: bottom 0.2s cubic-bezier(0.3, 1.6, 0.5, 1), background 0.2s, box-shadow 0.2s;
}
[aria-pressed="true"] .lever-knob {
  bottom: calc(55% - 3px);
  background: linear-gradient(var(--acc-hot), var(--acc));
  box-shadow: 0 0 12px var(--acc);
}
.lever-state {
  color: var(--faint);
  font: 700 11px/1 var(--f-mono);
  letter-spacing: 0.18em;
}
[aria-pressed="true"] .lever-state { color: var(--acc-hot); }

.matrix-warn {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 26px 0 0;
  color: var(--dim);
  font: 600 14px/1.4 var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.matrix-warn span:last-child { color: var(--acc-hot); }

/* ---------------------------------------------------- transmission line */

.line { position: relative; }
.line-svg {
  display: block;
  width: 100%;
  height: 230px;
  overflow: visible;
}
.pylon path { fill: none; stroke: #3b3354; stroke-width: 1.4; stroke-linejoin: round; transition: stroke 0.25s; }
.pylon .ins { stroke: #5d5578; stroke-width: 2.4; stroke-linecap: round; }
.pylon.lit path { stroke: var(--acc-hot); filter: drop-shadow(0 0 4px var(--acc)); }
.wire { fill: none; stroke-width: 1.5; opacity: 0.35; }
.wire-pulse {
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 0.6 7.4;
  animation: flow 1.6s linear infinite;
}
.wire[data-ph="r"], .wire-pulse[data-ph="r"] { stroke: var(--r); }
.wire[data-ph="p"], .wire-pulse[data-ph="p"] { stroke: var(--p); }
.wire[data-ph="b"], .wire-pulse[data-ph="b"] { stroke: var(--b); }
.wire-pulse[data-ph="r"] { animation-duration: 1.4s; }
.wire-pulse[data-ph="p"] { animation-duration: 1.9s; }
.wire-pulse[data-ph="b"] { animation-duration: 1.6s; }
.line:not(.on) .wire-pulse { animation-play-state: paused; }
@keyframes flow { to { stroke-dashoffset: -8; } }

.line-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.step {
  position: relative;
  min-width: 0;
  padding: 16px 14px 18px;
  border: 1px solid var(--wire);
  border-top: 2px solid var(--acc);
  background: var(--deep);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.step:hover,
.step.lit { border-color: var(--acc); box-shadow: 0 0 34px -12px var(--acc); transform: translateY(-2px); }
.step-n {
  color: var(--acc);
  font: 700 12px/1 var(--f-mono);
  letter-spacing: 0.16em;
}
.step h3 {
  margin: 10px 0 8px;
  font: 800 16px/1.15 var(--f-display);
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.step p { margin: 0; color: var(--dim); font-size: 14.5px; line-height: 1.45; }
@media (max-width: 1040px) {
  .line-svg { display: none; }
  .line-steps { grid-template-columns: 1fr; gap: 12px; padding-left: 40px; position: relative; }
  .line-steps::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 16px;
    background:
      linear-gradient(var(--r), var(--r)) 0 0 / 2px 100% no-repeat,
      linear-gradient(var(--p), var(--p)) 7px 0 / 2px 100% no-repeat,
      linear-gradient(var(--b), var(--b)) 14px 0 / 2px 100% no-repeat;
    opacity: 0.55;
  }
  .step::before {
    content: '';
    position: absolute;
    left: -40px;
    top: 18px;
    width: 26px;
    height: 10px;
    border: 1px solid var(--acc);
    background: var(--void);
    box-shadow: 0 0 10px -2px var(--acc);
  }
}

/* ------------------------------------------------------------- rewards */

.rewards-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
@media (max-width: 960px) { .rewards-grid { grid-template-columns: 1fr; } }
.gauge {
  position: relative;
  padding: 22px 22px 18px;
  border: 1px solid var(--wire);
  background:
    radial-gradient(80% 60% at 50% 100%, color-mix(in srgb, var(--acc) 16%, transparent), transparent 70%),
    linear-gradient(180deg, #120e1c, #0a0812);
}
.gauge svg { display: block; width: 100%; height: auto; }
.gauge .tick { stroke: #4b4366; stroke-width: 2; }
.gauge .tick.major { stroke: #8d84ad; stroke-width: 3; }
.gauge .num { fill: var(--dim); font: 700 13px var(--f-mono); }
.gauge .zone { fill: none; stroke: var(--r); stroke-width: 10; opacity: 0.8; }
.gauge .track { fill: none; stroke: #241e36; stroke-width: 10; }
.gauge .needle { transform-origin: 160px 170px; transform: rotate(-90deg); }
.gauge .needle path { fill: var(--acc-hot); filter: drop-shadow(0 0 6px var(--acc)); }
.gauge .zone-label { fill: var(--r); font: 800 10px var(--f-mono); letter-spacing: 0.2em; }
.gauge-read { display: flex; justify-content: center; align-items: baseline; gap: 10px; margin-top: 6px; }
.gauge-val {
  font: 900 clamp(44px, 6vw, 76px)/1 var(--f-display);
  letter-spacing: -0.04em;
  color: transparent;
  background: linear-gradient(180deg, #fff, var(--acc-hot) 40%, var(--acc));
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--acc) 60%, transparent));
}
.gauge-unit { color: var(--acc-hot); font: 800 20px/1 var(--f-display); text-transform: uppercase; }
.gauge-cap {
  margin: 8px 0 0;
  text-align: center;
  color: var(--faint);
  font: 600 12px/1.4 var(--f-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.outputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 560px) { .outputs { grid-template-columns: 1fr; } }
.output {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--wire);
  background: var(--deep);
}
.output-term {
  position: relative;
  flex: none;
  width: 30px;
  height: 30px;
  border: 2px solid var(--acc);
  border-radius: 50%;
  background: radial-gradient(circle, #241e36 0 5px, transparent 6px), #0b0912;
  box-shadow: 0 0 12px -2px var(--acc);
}
.output-term::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 2px;
  margin: -1px 0 0 -8px;
  background: var(--acc-hot);
  transform: rotate(45deg);
}
.output p { margin: 0; min-width: 0; font-size: 15.5px; line-height: 1.45; }
.output:first-child p { color: var(--acc-hot); font-weight: 700; }

/* --------------------------------------------------------------- arena */

.game { position: relative; }
.game-stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--acc) 35%, var(--wire));
  background: #07050d;
  box-shadow: 0 40px 120px -60px var(--acc);
}
.game-canvas { display: block; width: 100%; outline: none; }
.game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(circle at 50% 50%, rgba(7, 5, 13, 0.55), rgba(7, 5, 13, 0.92) 75%);
  overflow-y: auto;
}
.go-kicker {
  margin: 0;
  color: var(--acc);
  font: 700 12px/1.2 var(--f-mono);
  letter-spacing: 0.22em;
}
.go-title {
  margin: 0;
  font: 900 clamp(28px, 5.4vw, 60px)/1 var(--f-display);
  letter-spacing: -0.03em;
  color: transparent;
  background: linear-gradient(180deg, #fff, var(--acc-hot) 45%, var(--acc));
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 16px color-mix(in srgb, var(--acc) 60%, transparent));
}
.go-text { margin: 0; max-width: 56ch; color: var(--dim); font-size: 15px; }
.go-keys {
  display: grid;
  gap: 8px;
  margin: 4px 0 6px;
  padding: 0;
  list-style: none;
  color: var(--dim);
  font: 500 13px/1.4 var(--f-mono);
}
kbd {
  display: inline-block;
  min-width: 22px;
  margin-right: 4px;
  padding: 3px 6px;
  border: 1px solid var(--wire);
  border-bottom-width: 3px;
  background: var(--deep);
  color: var(--fg);
  font: 700 11px/1 var(--f-mono);
  text-align: center;
}
.go-best { margin: 0; color: var(--faint); font: 600 12px/1 var(--f-mono); letter-spacing: 0.14em; text-transform: uppercase; }
.go-stats { display: flex; gap: 28px; margin: 4px 0; }
.go-stats div { display: grid; gap: 4px; }
.go-stats dt { color: var(--faint); font: 600 11px/1 var(--f-mono); letter-spacing: 0.18em; text-transform: uppercase; }
.go-stats dd { margin: 0; color: var(--acc-hot); font: 800 28px/1 var(--f-display); }
.go-flag { display: grid; justify-items: center; gap: 8px; color: var(--dim); font-size: 14px; }
.go-flag p { margin: 0; }
.go-flag code { padding: 6px 10px; background: #1a1526; color: #fff; font: 700 14px/1.3 var(--f-mono); word-break: break-all; }
.game-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.gc-phases { display: flex; gap: 6px; flex-wrap: wrap; }
.gc-phase,
.gc-overload,
.gc-pause {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--wire);
  background: var(--deep);
  color: var(--dim);
  font: 700 12px/1 var(--f-mono);
  letter-spacing: 0.14em;
  cursor: pointer;
}
.gc-phase[data-g-phase="r"] { --c: var(--r); }
.gc-phase[data-g-phase="p"] { --c: var(--p); }
.gc-phase[data-g-phase="b"] { --c: var(--b); }
.gc-phase .led { width: 8px; height: 8px; border-radius: 50%; background: color-mix(in srgb, var(--c) 40%, #000); }
.gc-phase.on { border-color: var(--c); color: #fff; box-shadow: 0 0 18px -6px var(--c), inset 0 0 18px -10px var(--c); }
.gc-phase.on .led { background: var(--c); box-shadow: 0 0 8px var(--c); }
.gc-overload { margin-left: auto; }
.gc-overload:disabled { cursor: not-allowed; opacity: 0.7; }
.gc-overload.ready { border-color: var(--acc-hot); color: #fff; animation: critPulse 0.6s steps(2, start) infinite; }
.gc-meter { display: inline-block; width: 70px; height: 6px; background: #1a1526; overflow: hidden; }
.gc-meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--b), var(--p), var(--r)); }
.gc-pause:disabled { opacity: 0.5; cursor: default; }
@media (max-width: 560px) {
  .game-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .gc-phases { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .gc-phase, .gc-overload, .gc-pause { justify-content: center; min-height: 48px; padding: 0 8px; margin-left: 0; }
}

/* --------------------------------------------------------------- rules */

.labels { columns: 3 320px; column-gap: 16px; }
.label {
  display: inline-block;
  width: 100%;
  margin: 0 0 16px;
  break-inside: avoid;
  border: 1px solid var(--wire);
  background: var(--deep);
}
.label-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--acc);
  color: #07050d;
  font: 800 13px/1.2 var(--f-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.label-sig {
  padding: 4px 7px;
  background: #07050d;
  color: var(--acc-hot);
  font: 800 11px/1 var(--f-mono);
  letter-spacing: 0.2em;
}
.label-stripe { height: 8px; background: repeating-linear-gradient(-45deg, var(--acc) 0 8px, #07050d 8px 16px); }
.label ul { display: grid; gap: 9px; margin: 0; padding: 14px 18px 18px 34px; color: var(--dim); font-size: 15px; }
.label li::marker { color: var(--acc); }

/* ----------------------------------------------------------------- faq */

.narrow { --maxw: 980px; }
.fuses { display: grid; gap: 10px; }
.fuse { border: 1px solid var(--wire); background: var(--deep); transition: border-color 0.2s; }
.fuse[open] { border-color: color-mix(in srgb, var(--acc) 60%, var(--wire)); }
.fuse summary {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  list-style: none;
  cursor: pointer;
}
.fuse summary::-webkit-details-marker { display: none; }
.fuse-gfx { width: 78px; height: 26px; color: var(--acc); }
.fuse-gfx svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fuse-gfx .glass { fill: rgba(255, 255, 255, 0.04); stroke: rgba(255, 255, 255, 0.28); }
.fuse-gfx .cap { fill: #6d6588; }
.fuse-gfx .fil { fill: none; stroke: var(--acc-hot); stroke-width: 1.6; filter: drop-shadow(0 0 3px var(--acc)); }
.fuse-gfx .blown { fill: none; stroke: #7a7290; stroke-width: 1.6; display: none; }
.fuse[open] .fuse-gfx .fil { display: none; }
.fuse[open] .fuse-gfx .blown { display: inline; }
.fuse[open] .fuse-gfx .glass { fill: rgba(255, 255, 255, 0.1); }
.fuse-q { font: 700 17px/1.35 var(--f-ui); letter-spacing: 0.02em; text-transform: uppercase; }
.fuse-state { color: var(--faint); font: 700 11px/1 var(--f-mono); letter-spacing: 0.18em; }
.fuse[open] .fuse-state { color: var(--acc-hot); }
.fuse-a { padding: 0 18px 20px calc(78px + 36px); }
.fuse-a p { margin: 0; max-width: 64ch; color: var(--dim); }
@media (max-width: 620px) {
  .fuse summary { grid-template-columns: 54px minmax(0, 1fr); gap: 12px; }
  .fuse-gfx { width: 54px; }
  .fuse-state { display: none; }
  .fuse-a { padding-left: 18px; }
}

/* ------------------------------------------------------------- channel */

.patch {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 12px;
}
.port {
  position: relative;
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
  padding: 16px 16px 16px;
  border: 1px solid var(--wire);
  background: var(--deep);
}
.port-role {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--acc);
  font: 600 11px/1.2 var(--f-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.port-led { width: 8px; height: 8px; border-radius: 50%; background: var(--acc-hot); box-shadow: 0 0 8px var(--acc); }
.port:hover .port-led { animation: blink 0.3s steps(2, start) infinite; }
.port-name { margin: 0; font: 800 17px/1.2 var(--f-display); letter-spacing: -0.01em; text-transform: uppercase; }
.port-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  color: var(--fg);
  font: 500 14px/1.4 var(--f-mono);
}
.port-line a { min-width: 0; color: inherit; text-decoration: none; border-bottom: 1px dashed var(--wire); overflow-wrap: anywhere; }
.port-line a:hover { color: var(--acc-hot); border-color: var(--acc); }

.links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 12px;
  margin-top: 12px;
}
.status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px dashed var(--wire);
  color: var(--dim);
  font: 500 13px/1.5 var(--f-mono);
}
.status b { color: var(--acc-hot); letter-spacing: 0.16em; text-transform: uppercase; }

/* ------------------------------------------------------------ partners */

.sockets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 12px;
}
.socket {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--wire);
  background: var(--deep);
  color: var(--fg);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.socket:hover { border-color: var(--acc); box-shadow: 0 0 30px -12px var(--acc); }
.socket-face {
  position: relative;
  width: 46px;
  height: 46px;
  border: 1px solid #2f2845;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 30%, #000 0 5px, transparent 5.5px),
    radial-gradient(circle at 30% 70%, #000 0 3.5px, transparent 4px),
    radial-gradient(circle at 70% 70%, #000 0 3.5px, transparent 4px),
    linear-gradient(160deg, #2a2340, #15111f);
  transition: box-shadow 0.2s;
}
.socket:hover .socket-face {
  box-shadow: 0 0 0 1px var(--acc), 0 0 18px -4px var(--acc);
  background:
    radial-gradient(circle at 50% 30%, var(--acc-hot) 0 2px, #000 2.5px 5px, transparent 5.5px),
    radial-gradient(circle at 30% 70%, var(--acc-hot) 0 1.5px, #000 2px 3.5px, transparent 4px),
    radial-gradient(circle at 70% 70%, var(--acc-hot) 0 1.5px, #000 2px 3.5px, transparent 4px),
    linear-gradient(160deg, #2a2340, #15111f);
}
.socket-name { margin: 0; font: 800 16px/1.2 var(--f-display); letter-spacing: -0.01em; text-transform: uppercase; overflow-wrap: anywhere; }
.socket-role { margin: 4px 0 0; color: var(--acc); font: 600 11px/1.3 var(--f-mono); letter-spacing: 0.14em; text-transform: uppercase; }

.orgs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(28px, 4vw, 44px);
}
@media (max-width: 820px) { .orgs { grid-template-columns: 1fr; } }
.org {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--wire);
  background: linear-gradient(180deg, color-mix(in srgb, var(--acc) 7%, var(--deep)), var(--deep));
}
.org-mono {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 2px solid var(--acc);
  border-radius: 50%;
  color: var(--acc-hot);
  font: 800 13px/1 var(--f-display);
  box-shadow: 0 0 16px -4px var(--acc);
}
.org h3 { margin: 0; font: 800 15px/1.2 var(--f-display); text-transform: uppercase; }
.org p { margin: 3px 0 0; color: var(--dim); font-size: 14px; }

/* ------------------------------------------------------------ register */

.register .sec-head { justify-items: center; text-align: center; }
.register .sec-title { max-width: 22ch; }
.finale { display: grid; gap: 2px; }
.finale span:last-child { color: var(--acc-hot); }
.reg-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 60px);
  align-items: center;
}
@media (max-width: 940px) { .reg-grid { grid-template-columns: 1fr; } }
.switch-wrap { display: grid; justify-items: center; gap: 16px; }
.knife { display: block; width: 100%; max-width: 500px; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.knife .grip { cursor: grab; }
.knife .jaw { fill: #8a5a32; transition: fill 0.2s; }
.knife.live .jaw { fill: var(--acc-hot); filter: drop-shadow(0 0 6px var(--acc)); }
.knife .blade-body { fill: url(#copper); }
.knife .live-tag { fill: var(--faint); font: 800 11px var(--f-mono); letter-spacing: 0.24em; }
.knife.live .live-tag { fill: var(--acc-hot); }
.knife-hint { margin: 0; color: var(--faint); font: 600 12px/1.4 var(--f-mono); letter-spacing: 0.14em; text-transform: uppercase; text-align: center; }

.portal {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--wire);
  background: var(--deep);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.portal.powered { border-color: var(--acc); box-shadow: 0 0 60px -24px var(--acc); }
.portal-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--faint);
  font: 700 12px/1.2 var(--f-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.portal-status i { width: 10px; height: 10px; border-radius: 50%; background: #3a3352; }
.portal.powered .portal-status { color: var(--acc-hot); }
.portal.powered .portal-status i { background: var(--acc-hot); box-shadow: 0 0 10px var(--acc); animation: blink 1s steps(2, start) infinite; }
.portal-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 540px) { .portal-body { grid-template-columns: 1fr; } }
.qr-box { display: grid; gap: 8px; justify-items: center; }
.qr {
  display: block;
  width: 164px;
  height: 164px;
  padding: 10px;
  background: #fff;
  transition: box-shadow 0.3s;
}
.portal.powered .qr { box-shadow: 0 0 0 3px var(--acc), 0 0 40px -6px var(--acc); }
.qr-cap { color: var(--faint); font: 700 11px/1 var(--f-mono); letter-spacing: 0.2em; text-transform: uppercase; }
.portal h3 { margin: 0; color: var(--acc); font: 700 11px/1.2 var(--f-mono); letter-spacing: 0.18em; text-transform: uppercase; }
.portal ol, .portal ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--dim); font-size: 15px; }
.portal .modes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; padding: 0; list-style: none; }
.portal .modes li { padding: 6px 10px; border: 1px solid var(--wire); color: var(--fg); font: 700 12px/1 var(--f-mono); letter-spacing: 0.14em; text-transform: uppercase; }
.portal-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.portal-url { color: var(--faint); font: 500 12px/1.4 var(--f-mono); overflow-wrap: anywhere; }

/* -------------------------------------------------------------- footer */

.footer {
  position: relative;
  z-index: 1;
  padding-block: 56px 40px;
  border-top: 1px solid var(--wire);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.45));
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
}
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h2 { margin: 0; font: 900 clamp(26px, 3vw, 36px)/1 var(--f-display); letter-spacing: -0.03em; }
.footer h2 em { font-style: normal; color: var(--acc-hot); }
.footer p { margin: 10px 0 0; color: var(--dim); font-size: 15px; }
.footer h3 { margin: 0 0 10px; color: var(--acc); font: 700 11px/1.2 var(--f-mono); letter-spacing: 0.18em; text-transform: uppercase; }
.footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.footer a { color: var(--fg); text-decoration: none; border-bottom: 1px dashed var(--wire); }
.footer a:hover { color: var(--acc-hot); border-color: var(--acc); }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 20px;
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--wire);
  color: var(--faint);
  font: 500 12px/1.5 var(--f-mono);
  letter-spacing: 0.06em;
}
.footer-base button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--dim);
  font: inherit;
  text-decoration: underline dashed;
  cursor: pointer;
}

/* ----------------------------------------------------------------- hud */

.hud {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 45;
  width: 196px;
  padding: 10px 12px 9px;
  border: 1px solid var(--wire);
  background: color-mix(in srgb, var(--void) 84%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--dim);
  font: 700 10.5px/1.2 var(--f-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.hud-row { display: flex; justify-content: space-between; gap: 10px; }
.hud-row b { color: var(--acc-hot); }
.hud-bar { height: 6px; margin: 8px 0 7px; overflow: hidden; background: #1a1526; }
.hud-fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--b), var(--p), var(--r));
  box-shadow: 0 0 10px var(--acc);
  transition: width 0.25s ease;
}
.hud-hint { color: var(--faint); font-weight: 600; letter-spacing: 0.1em; }
.hud.crit { border-color: var(--r); animation: critPulse 0.5s steps(2, start) infinite; }
@media (max-width: 600px) {
  .hud { right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); width: 150px; padding: 8px 10px; }
  .hud-hint { display: none; }
}

/* -------------------------------------------------------------- toasts */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  display: grid;
  gap: 10px;
  width: min(470px, calc(100% - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 14px 16px;
  border: 1px solid var(--acc);
  background: #0d0a17;
  box-shadow: 0 0 50px -12px var(--acc);
  animation: toastIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.toast.out { animation: toastOut 0.3s ease forwards; }
.toast-title { margin: 0; color: var(--acc-hot); font: 800 14px/1.2 var(--f-display); text-transform: uppercase; }
.toast-body { margin: 6px 0 0; color: var(--dim); font-size: 14px; }
.toast-flag { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.toast-flag code { padding: 5px 8px; background: #1a1526; color: #fff; font: 700 14px/1.3 var(--f-mono); word-break: break-all; }

/* ---------------------------------------------------------------- boot */

.boot {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(ellipse at center, rgba(6, 4, 11, 0.55), rgba(6, 4, 11, 0.94));
}
.boot.out { animation: bootOut 0.45s ease forwards; }
.boot-panel {
  width: min(580px, 100%);
  padding: 20px 22px 22px;
  border: 1px solid var(--wire);
  background: #0a0812;
  box-shadow: 0 0 90px -24px var(--acc);
}
.boot-head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font: 800 13px/1.2 var(--f-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.boot-head .led { width: 9px; height: 9px; border-radius: 50%; background: var(--r); box-shadow: 0 0 8px var(--r); animation: blink 0.8s steps(2, start) infinite; }
.boot-head .ver { margin-left: auto; color: var(--faint); font: 600 11px var(--f-mono); }
.boot-log {
  min-height: 168px;
  margin: 16px 0 18px;
  color: var(--dim);
  font: 500 13px/1.75 var(--f-mono);
  white-space: pre-wrap;
}
.boot-log .ok { color: var(--acc-hot); }
.boot-log .r { color: var(--r); }
.boot-log .p { color: var(--p); }
.boot-log .b { color: var(--b); }
.boot-title {
  margin: 4px 0 6px;
  font: 900 clamp(34px, 7vw, 54px)/0.95 var(--f-display);
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.boot-sub { margin: 0 0 20px; color: var(--dim); font: 500 14px/1.5 var(--f-mono); }
.boot-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.boot-silent {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--faint);
  font: 600 12px/1.2 var(--f-mono);
  letter-spacing: 0.08em;
  text-decoration: underline dashed;
  text-underline-offset: 4px;
}
.boot-silent:hover { color: var(--fg); }
.boot-title em {
  font-style: normal;
  color: transparent;
  background: linear-gradient(100deg, var(--acc-hot), var(--acc) 60%, var(--acc-hot));
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--acc) 60%, transparent));
}

html.unpowered #shell,
html.unpowered .nav,
html.unpowered .hud { filter: grayscale(1) brightness(0.42); }
html.powering #shell { animation: powerOn 0.95s steps(1, end) 1; }

/* ---------------------------------------------------------- keyframes */

.zapped { animation: zapped 0.5s ease-out; }
@keyframes zapped {
  0% { filter: brightness(1.9) saturate(1.4); box-shadow: 0 0 0 2px var(--acc-hot), 0 0 44px var(--acc); }
  100% { filter: none; box-shadow: 0 0 0 0 transparent; }
}
@keyframes blink { 50% { opacity: 0.25; } }
@keyframes flick {
  0% { opacity: 1; }
  50% { opacity: 0.15; }
  100% { opacity: 1; }
}
@keyframes glitch {
  0% { transform: translate(0); text-shadow: none; }
  33% { transform: translate(-3px, 1px) skewX(-6deg); filter: drop-shadow(-4px 0 0 var(--r)) drop-shadow(4px 0 0 var(--b)); }
  66% { transform: translate(3px, -1px) skewX(4deg); filter: drop-shadow(4px 0 0 var(--r)) drop-shadow(-4px 0 0 var(--b)); }
  100% { transform: translate(0); }
}
@keyframes tubeBlink { 50% { opacity: 0.2; } }
@keyframes neonOn {
  0% { opacity: 0.2; }
  8% { opacity: 1; }
  14% { opacity: 0.3; }
  24% { opacity: 1; }
  30% { opacity: 0.5; }
  42% { opacity: 1; }
}
@keyframes critPulse { 50% { box-shadow: 0 0 22px -4px var(--r); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }
@keyframes bootOut { to { opacity: 0; visibility: hidden; } }
@keyframes powerOn {
  0% { filter: brightness(0.15); }
  12% { filter: brightness(1.5); }
  18% { filter: brightness(0.25); }
  34% { filter: brightness(1.2); }
  40% { filter: brightness(0.55); }
  56% { filter: brightness(1.05); }
  100% { filter: none; }
}

/*
 * Lite effects (D-15): set automatically by the frame-time governor in
 * fx.js on devices that cannot hold about 40 fps, or by the footer toggle.
 * Keeps the identity, drops the costliest continuous work.
 */
html.lite .btn-spin { animation: none; }
html.lite .ht-part .ch { filter: none; will-change: auto; }
html.lite .hero-field { display: none; }
html.lite .wire-pulse { animation-duration: 6s; }
html.lite .tape-track { animation-duration: 90s; }
html.lite .sec-title em,
html.lite .hero-tagline em { filter: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
