/* ============================================================
   gade.system — homepage v2 · terminal direction
   Interactive CLI that IS the homepage. HUD chrome preserved.
   ============================================================ */

:root {
  --red-rgb: 220, 20, 28;
  --red: rgb(var(--red-rgb));
  --red-dim: rgba(var(--red-rgb), 0.5);
  --red-bg: rgba(var(--red-rgb), 0.12);
  --red-edge: rgba(var(--red-rgb), 0.45);
  --bg: #060606;
  --ink: #ddd;
  --dim: #666;
  --line: #1c1c1c;
  --green: #4caf50;
  --amber: #e9a000;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }

/* ---------- HUD chrome (matches existing site) ---------- */
.frame {
  position: fixed;
  top: 16px; right: 16px; bottom: 16px; left: 16px;
  border: 1px solid var(--red-edge);
  pointer-events: none;
  z-index: 6;
}
.frame > i {
  position: absolute;
  width: 22px; height: 22px;
  border: 2px solid var(--red);
}
.frame > i:nth-child(1) { top: -2px; left: -2px; border-right: none; border-bottom: none;
  animation: bracket 5.2s ease-in-out infinite; }
.frame > i:nth-child(2) { top: -2px; right: -2px; border-left: none; border-bottom: none;
  animation: bracket 5.2s ease-in-out -1.3s infinite; }
.frame > i:nth-child(3) { bottom: -2px; left: -2px; border-right: none; border-top: none;
  animation: bracket 5.2s ease-in-out -2.6s infinite; }
.frame > i:nth-child(4) { bottom: -2px; right: -2px; border-left: none; border-top: none;
  animation: bracket 5.2s ease-in-out -3.9s infinite; }
@keyframes bracket {
  0%, 100% { box-shadow: 0 0 0 rgba(var(--red-rgb), 0); }
  50%      { box-shadow: 0 0 14px rgba(var(--red-rgb), 0.6); }
}

/* ---------- TOP RAIL (replaces chevron strip) ----------
   Refined calibrated-edge: tick marks like a film-strip frame
   counter, plus a single slow-scanning ▼ indicator. Stationary
   except for the scanner — no full-strip drift.                  */
.tick-rail {
  position: fixed;
  top: 16px; left: 16px; right: 16px;
  height: 22px;
  pointer-events: none;
  z-index: 7;
  background: var(--bg);
  overflow: hidden;
}
.tick-rail::before {
  /* fine ticks every 12px — bottom 4px tall */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background-image: repeating-linear-gradient(
    to right,
    rgba(var(--red-rgb), 0.22) 0 1px,
    transparent 1px 12px);
}
.tick-rail::after {
  /* major ticks every 96px — bottom 10px tall, brighter */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 10px;
  background-image: repeating-linear-gradient(
    to right,
    rgba(var(--red-rgb), 0.55) 0 1px,
    transparent 1px 96px);
}
.rail-tag {
  position: absolute;
  top: 3px;
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(var(--red-rgb), 0.9);
  display: flex; align-items: center; gap: 6px;
  background: var(--bg);
  padding: 0 8px;
  height: 14px;
  white-space: nowrap;
}
.rail-tag.left  { left: 22px; }
.rail-tag.right { right: 22px; }
.rail-tag .dot {
  width: 4px; height: 4px;
  background: var(--red);
  box-shadow: 0 0 4px var(--red);
  animation: blip 1.5s ease-in-out infinite;
}
.rail-scan {
  position: absolute;
  top: 0; bottom: 0;
  width: 30px;
  pointer-events: none;
  animation: railScan 22s ease-in-out infinite;
}
.rail-scan::before {
  /* thin vertical line */
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 1px;
  background: rgba(var(--red-rgb), 0.85);
  box-shadow: 0 0 8px rgba(var(--red-rgb), 0.65);
}
.rail-scan::after {
  /* tip marker */
  content: "▼";
  position: absolute;
  top: -3px; left: 50%;
  transform: translateX(-50%);
  color: var(--red);
  font-size: 9px;
  text-shadow: 0 0 4px rgba(var(--red-rgb), 0.6);
}
@keyframes railScan {
  0%   { left: 0; }
  50%  { left: calc(100% - 30px); }
  100% { left: 0; }
}

.toplabel {
  position: fixed;
  top: 18px; left: 50%; transform: translateX(-50%);
  background: var(--bg);
  padding: 0 14px; height: 14px;
  display: flex; align-items: center;
  font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--red);
  z-index: 8;
  white-space: nowrap;
}

.scanlines {
  position: fixed; top: 17px; right: 17px; bottom: 17px; left: 17px;
  pointer-events: none; z-index: 3;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.018) 0 1px,
    transparent 1px 3px);
}
.scan-sweep {
  position: fixed; top: 17px; right: 17px; bottom: 17px; left: 17px;
  pointer-events: none; z-index: 4;
  overflow: hidden;
}
.scan-sweep::before {
  content: "";
  position: absolute; left: 0; right: 0; top: -8%;
  height: 8%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(var(--red-rgb), 0.04) 40%,
    rgba(var(--red-rgb), 0.10) 50%,
    rgba(var(--red-rgb), 0.04) 60%,
    transparent 100%);
  animation: sweep 7s linear infinite;
}
@keyframes sweep { to { transform: translateY(1500%); } }

.footstrip {
  position: fixed;
  left: 36px; right: 36px; bottom: 22px;
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--dim);
  z-index: 8;
  flex-wrap: wrap;
}
.footstrip .live { color: var(--red); }
.footstrip .live::before { content: "● "; animation: blink 1.4s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

/* ---------- Layout ---------- */
.app {
  position: fixed;
  inset: 50px 36px 56px 36px;
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 18px;
  z-index: 2;
  min-height: 0;
}

/* ---------- Right rail: NAV + ALSO.AS ---------- */
.rail { display: flex; flex-direction: column; gap: 12px; min-height: 0; }

.widget {
  background: rgba(10,10,10,0.95);
  border: 1px solid var(--red-dim);
  backdrop-filter: blur(6px);
  font-size: 11px;
}
.widget .head {
  padding: 6px 10px;
  background: var(--red-bg);
  color: var(--red);
  font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase;
  border-bottom: 1px solid var(--red-dim);
  display: flex; justify-content: space-between; align-items: center;
}
.widget .head .blip {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px rgba(var(--red-rgb), 0.8);
  animation: blip 1.5s ease-in-out infinite;
}
@keyframes blip {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.1); }
}

.nav-list { display: flex; flex-direction: column; }
.nav-list a {
  padding: 9px 12px;
  border-bottom: 1px solid #161616;
  display: flex; justify-content: space-between; align-items: center;
  color: #999;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, padding 180ms ease;
  position: relative;
}
.nav-list a:last-child { border-bottom: none; }
.nav-list a:hover { color: #fff; padding-left: 18px; }
.nav-list a:hover .key { color: var(--red); }
.nav-list a.active {
  color: #fff;
  background: var(--red-bg);
}
.nav-list a.active::before {
  content: "▸";
  position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
  color: var(--red);
  animation: tick 1.2s steps(2) infinite;
}
@keyframes tick { 50% { opacity: 0; } }
.nav-list a .key { color: #555; font-size: 10px; transition: color 180ms ease; }

.alias-body {
  padding: 9px 12px;
  display: flex; justify-content: space-between; align-items: center;
  color: #fff;
  letter-spacing: 0.18em; text-transform: lowercase;
  cursor: pointer;
  transition: background 180ms ease, padding 180ms ease;
}
.alias-body:hover { background: var(--red-bg); padding-left: 16px; }
.alias-body .key { color: var(--red); font-size: 12px; }

/* Mini cards in rail */
.mini-card { padding: 9px 12px; border-bottom: 1px solid #161616; }
.mini-card:last-child { border-bottom: none; }
.mini-card .k { color: var(--dim); font-size: 9px; letter-spacing: 0.28em; text-transform: uppercase; }
.mini-card .v { color: #fff; font-size: 11px; margin-top: 3px; line-height: 1.4; }
.mini-card .v.red { color: var(--red); }
.mini-card .v.green { color: var(--green); }

/* ---------- Terminal ---------- */
.term {
  position: relative;
  border: 1px solid var(--red-dim);
  background: rgba(6,6,6,0.85);
  min-height: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.term::before {
  /* faint inner glow */
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(
    ellipse at 50% 30%,
    rgba(var(--red-rgb), 0.08) 0%,
    rgba(0,0,0,0) 60%);
  pointer-events: none;
}
.term-head {
  display: flex; align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid var(--red-dim);
  background: var(--red-bg);
  color: var(--red);
  font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase;
  gap: 12px;
  position: relative; z-index: 1;
}
.term-head .lights { display: flex; gap: 4px; }
.term-head .lights i {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(var(--red-rgb), 0.4);
  border: 1px solid var(--red-dim);
}
.term-head .lights i:nth-child(2) { background: rgba(var(--red-rgb), 0.7); }
.term-head .lights i:nth-child(3) { background: var(--red); box-shadow: 0 0 6px var(--red); }
.term-head .title { flex: 1; }
.term-head .stats { color: #aaa; font-size: 9px; letter-spacing: 0.24em; }
.term-head .stats span { margin-left: 12px; }
.term-head .stats .ok { color: var(--green); }
.term-head .stats .live { color: var(--red); }

.term-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 22px 14px 22px;
  font-size: 13px;
  position: relative; z-index: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--red-dim) transparent;
}
.term-body::-webkit-scrollbar { width: 6px; }
.term-body::-webkit-scrollbar-thumb { background: var(--red-dim); }

.term-foot {
  padding: 8px 22px 12px;
  border-top: 1px solid var(--red-dim);
  display: flex; align-items: center; gap: 10px;
  position: relative; z-index: 1;
  background: rgba(0,0,0,0.6);
}

/* Prompt line */
.prompt {
  flex: 1;
  display: flex; align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #ddd;
  font-family: inherit;
}
.prompt .op { color: var(--red); }
.prompt .sep { color: #555; }
.prompt input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font: inherit;
  color: inherit;
  letter-spacing: 0.02em;
  caret-color: transparent; /* custom caret below */
}
.caret {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
  animation: caretBlink 1s steps(2) infinite;
  vertical-align: middle;
  margin-left: -2px;
}
@keyframes caretBlink { 50% { opacity: 0; } }

.hints {
  padding: 4px 22px 10px;
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; gap: 6px;
  border-top: 1px solid var(--line);
}
.hint {
  padding: 3px 8px;
  border: 1px solid var(--red-dim);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--red);
  cursor: pointer;
  transition: all 160ms ease;
  user-select: none;
}
.hint:hover { background: var(--red-bg); color: #fff; }
.hint .k { color: #555; margin-left: 4px; font-size: 9px; }
.hint:hover .k { color: var(--red); }

/* ---------- ASCII banner ---------- */
.banner {
  margin: 6px 0 18px;
  color: var(--red);
  text-shadow: 0 0 10px rgba(var(--red-rgb), 0.45);
  position: relative;
}

/* ---------- In-terminal boot (replaces fullscreen overlay) ----------
   Styled to match the ASCII logo: red, monospace, same glow.        */
.boot-inline {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--red);
  text-shadow: 0 0 10px rgba(var(--red-rgb), 0.45);
  letter-spacing: 0.04em;
  padding: 4px 0 8px;
  animation: bootEntry 200ms ease-out both;
}
.boot-inline .boot-line {
  animation: bootLineIn 140ms ease-out both;
}
.boot-inline .ok,
.boot-inline .red { color: var(--red); }
@keyframes bootEntry { from { opacity: 0; } to { opacity: 1; } }
@keyframes bootLineIn {
  from { opacity: 0; transform: translateX(-2px); }
  to   { opacity: 1; transform: translateX(0); }
}
.banner pre {
  margin: 0;
  font-size: clamp(7px, 0.88vw, 11px);
  line-height: 1.05;
  letter-spacing: 0;
  white-space: pre;
  overflow: hidden;
}
.banner .banner-line {
  display: inline;
  animation: bannerLineReveal 320ms cubic-bezier(.2,.8,.2,1) both;
}
@keyframes bannerLineReveal {
  0%   { opacity: 0; filter: blur(2px); }
  40%  { opacity: 0.6; filter: blur(1px); color: #fff; }
  100% { opacity: 1; filter: blur(0); }
}
.banner .meta {
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  margin-top: 8px;
  padding-left: 4px;
  display: flex; gap: 22px;
}
.banner .meta span::before {
  content: "▸ ";
  color: var(--red);
}

/* Logo banner alt */
.banner.logo-style {
  display: flex; flex-direction: column;
  align-items: flex-start;
  margin: 6px 0 22px;
}
.banner.logo-style img {
  width: clamp(220px, 50%, 420px);
  filter: drop-shadow(0 0 14px rgba(var(--red-rgb), 0.45));
  animation: logoPulse 9s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { opacity: 0.8; }
  50%      { opacity: 1; filter: drop-shadow(0 0 22px rgba(var(--red-rgb), 0.6)); }
}

/* ---------- Output blocks ---------- */
.entry { margin-bottom: 16px; animation: entryIn 220ms ease-out; }
@keyframes entryIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.entry .cmd-line {
  display: flex; align-items: baseline; gap: 6px;
  color: #ddd;
  margin-bottom: 6px;
}
.entry .cmd-line .op { color: var(--red); }
.entry .cmd-line .sep { color: #555; }
.entry .cmd-line .cmd { color: #fff; letter-spacing: 0.04em; }
.entry .cmd-line .ts { margin-left: auto; color: #444; font-size: 10px; letter-spacing: 0.16em; }

.entry .out {
  padding: 4px 0 4px 14px;
  border-left: 1px solid var(--red-dim);
  color: #bbb;
  line-height: 1.65;
}
.entry .out .key { color: var(--red); display: inline-block; min-width: 96px; letter-spacing: 0.18em; text-transform: uppercase; font-size: 11px; }
.entry .out .val { color: #fff; }
.entry .out .dim { color: var(--dim); }
.entry .out .ok { color: var(--green); }
.entry .out .err { color: var(--red); }
.entry .out .row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  padding: 1px 0;
}

/* /listen player block — ASCII */
.ascii-player {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  white-space: pre;
  font-size: 12px;
  line-height: 1.35;
  margin: 8px 0 0 0;
  padding: 6px 0 0 0;
  color: var(--red);
  text-shadow: 0 0 4px rgba(var(--red-rgb), 0.35);
  overflow-x: auto;
  max-width: 600px;
}
.ascii-player .b   { color: rgba(var(--red-rgb), 0.85); }   /* box borders */
.ascii-player .dim { color: rgba(var(--red-rgb), 0.75); }   /* labels, times */
.ascii-player .t {
  color: #fff;
  text-shadow: 0 0 6px rgba(var(--red-rgb), 0.6);
}
.ascii-player .bar-line { color: var(--red); text-shadow: 0 0 6px rgba(var(--red-rgb), 0.5); }
.ascii-player .ctrl { color: #aaa; }
.ascii-player .state {
  color: #fff;
  text-shadow: 0 0 6px rgba(var(--red-rgb), 0.6);
}
.ascii-player .ascii-btn {
  cursor: pointer;
  color: #fff;
  text-shadow: 0 0 6px rgba(var(--red-rgb), 0.6);
  transition: color 160ms, text-shadow 160ms;
  user-select: none;
}
.ascii-player .ascii-btn:hover {
  color: var(--red);
  text-shadow: 0 0 10px rgba(var(--red-rgb), 0.9);
}
.ascii-player .ascii-link {
  color: var(--red);
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px dotted rgba(var(--red-rgb), 0.5);
  transition: color 160ms, border-color 160ms;
}
.ascii-player .ascii-link:hover {
  color: #fff;
  border-bottom-color: #fff;
}

/* /listen player block (legacy — kept for safety) */
.player {
  border: 1px solid var(--red-dim);
  padding: 10px 14px;
  background: rgba(var(--red-rgb), 0.05);
  margin-top: 4px;
  max-width: 540px;
}
.player .head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px;
}
.player .title { color: #fff; font-size: 15px; letter-spacing: 0.04em; }
.player .id { color: var(--red); font-size: 10px; letter-spacing: 0.3em; }
.player .bar {
  height: 4px; background: var(--line);
  position: relative;
}
.player .bar i {
  position: absolute; left: 0; top: 0; bottom: 0; width: 34%;
  background: var(--red);
  box-shadow: 0 0 8px rgba(var(--red-rgb), 0.6);
}
.player .times {
  display: flex; justify-content: space-between;
  margin-top: 6px;
  font-size: 10px; color: var(--dim); letter-spacing: 0.2em;
}
.player .controls {
  margin-top: 10px;
  display: flex; gap: 14px; align-items: center;
  font-size: 13px; color: #aaa; letter-spacing: 0.16em;
}
.player .controls .play { color: var(--red); font-size: 16px; cursor: pointer; }
.player .controls .extra {
  margin-left: auto;
  display: flex; gap: 12px;
  font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase;
  color: #888;
}
.player .controls .extra a { cursor: pointer; transition: color 180ms; }
.player .controls .extra a:hover { color: var(--red); }

/* /follow links block */
.channels { display: flex; flex-direction: column; gap: 1px; }
.channel {
  display: grid;
  grid-template-columns: 28px 130px 1fr 20px;
  gap: 10px;
  align-items: baseline;
  padding: 6px 8px;
  cursor: pointer;
  transition: background 160ms ease, padding 160ms ease;
}
.channel:hover { background: rgba(var(--red-rgb), 0.06); padding-left: 14px; }
.channel .num { color: var(--red); font-size: 10px; letter-spacing: 0.22em; }
.channel .name { color: #fff; letter-spacing: 0.12em; text-transform: lowercase; }
.channel .handle { color: var(--dim); font-size: 11px; }
.channel .arrow { color: var(--red); text-align: right; }

/* /archive */
.archive { display: flex; flex-direction: column; }
.arc-row {
  display: grid;
  grid-template-columns: 40px 90px 1.6fr 120px 100px 24px;
  gap: 12px;
  align-items: baseline;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 180ms ease, padding 180ms ease;
}
.arc-row:hover { background: rgba(var(--red-rgb), 0.06); padding-left: 12px; }
.arc-row:hover .title a { color: var(--red); }
.arc-row .id { color: var(--red); font-size: 11px; letter-spacing: 0.22em; }
.arc-row .date { color: var(--dim); font-size: 10px; letter-spacing: 0.12em; }
.arc-row .title { color: #fff; font-size: 13px; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arc-row .cat { color: var(--dim); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; }
.arc-row .fmt { color: var(--dim); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.arc-row .live { color: var(--red); font-size: 9px; letter-spacing: 0.18em; }
.arc-row .live::before { content: "● "; }

/* /status block */
.status-block .row .val.broadcast {
  color: var(--red);
}
.status-block .row .val.broadcast::after {
  content: " ●";
  animation: blink 1.4s steps(2) infinite;
}

/* boot sequence */
/* boot sequence */
.boot-inline-container {
  position: absolute;
  inset: 0;
  background: #060606;
  z-index: 10;
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--red);
  text-shadow: 0 0 8px rgba(var(--red-rgb), 0.4);
  overflow: hidden;
}
.boot-inline-container.ascii-mode {
  padding: 0;
  justify-content: flex-start;
  align-items: flex-start;
}
.boot-inline-container.done {
  opacity: 0;
  filter: blur(10px);
  transition: opacity 600ms ease, filter 600ms ease;
  pointer-events: none;
}

.glitch-active {
  animation: glitchFlicker 0.12s steps(2, end) infinite;
  color: #fff !important;
  text-shadow: 2px 0 10px var(--red), -2px 0 10px #0ff !important;
}

@keyframes glitchFlicker {
  0% { transform: translate(1px, 0); opacity: 0.9; }
  50% { transform: translate(-1px, 1px); opacity: 1; }
  100% { transform: translate(0, -1px); opacity: 0.85; }
}


.boot-line {
  line-height: 1.6;
  opacity: 0;
  animation: bootLineIn 150ms ease-out forwards;
}
@keyframes bootLineIn {
  from { opacity: 0; transform: translateX(-4px); }
  to { opacity: 1; transform: translateX(0); }
}

.ascii-full-inline {
  margin: 0;
  font-size: clamp(3px, 1.1vw, 10px);
  line-height: 1.05;
  letter-spacing: 0;
  white-space: pre;
  color: var(--red);
  text-shadow: 0 0 10px rgba(var(--red-rgb), 0.45);
  display: block;
}


/* ---------- glitch overlay char ---------- */
.glitch-char {
  position: fixed;
  z-index: 50;
  color: var(--red);
  text-shadow:
    0 0 4px rgba(var(--red-rgb), 0.7),
    0 0 10px rgba(var(--red-rgb), 0.35);
  pointer-events: none;
  display: inline-flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 0;
  margin: 0;
  white-space: pre;
  font-variant-ligatures: none;
  animation: glitchPop 320ms steps(5, end) forwards;
  will-change: transform, opacity;
}
@keyframes glitchPop {
  0%   { transform: translate(0, 0); opacity: 1; }
  20%  { transform: translate(-1px, 1px); opacity: 0.95; }
  45%  { transform: translate(2px, -1px); opacity: 1; }
  70%  { transform: translate(-1px, 0); opacity: 0.85; }
  90%  { transform: translate(0, 0); opacity: 0.4; }
  100% { opacity: 0; }
}

/* tweak palette swatches */
.swatch-row { display: flex; gap: 6px; }
.swatch {
  width: 24px; height: 24px;
  border: 1px solid #333;
  cursor: pointer;
  position: relative;
}
.swatch.active { border-color: #fff; box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--red); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    inset: 50px 20px 160px 20px;
  }
  .rail { display: none; }
  .term-body { padding: 12px 14px; font-size: 12px; }
  .banner pre { font-size: 8px; }
  .arc-row { grid-template-columns: 36px 85px 1fr 24px; }
  .arc-row .cat, .arc-row .fmt { display: none; }
  .channel { grid-template-columns: 24px 100px 1fr 20px; }
  .footstrip { font-size: 9px; }
  .footstrip > *:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
