/* ==========================================================================
   personal-site-cyber: one stylesheet, organised top to bottom:
   1 fonts · 2 tokens · 3 base · 4 fx layers · 5 shell (nav, footer)
   6 components (panels, buttons, 503) · 7 terminal · 8 pages · 9 overlays
   10 reduced motion
   ========================================================================== */

/* 1. FONTS: self-hosted, OFL (see /fonts/LICENSE-*.txt). No third-party requests. */
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* 2. TOKENS: two accents (c1 / c2) drive everything. Skins only swap these. */
:root {
  color-scheme: dark;
  --bg: #06070b;
  --bg-2: #0a0d14;
  --panel: rgba(10, 13, 20, 0.86);
  --panel-solid: #0a0d14;
  --line: #1b2433;
  --line-strong: #2a3850;
  --text: #d7e0ea;
  --muted: #93a3b8;      /* 7:1 on --bg */
  --c1: #00e5ff;         /* cyan: primary accent, active state, links */
  --c2: #ff3dcb;         /* magenta: alerts, glitch, gradient end */
  --on-c1: #021015;
  --glow-1: color-mix(in srgb, var(--c1) 55%, transparent);
  --glow-2: color-mix(in srgb, var(--c2) 55%, transparent);
  --grad: linear-gradient(90deg, var(--c1), var(--c2));

  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --bar-h: 56px;
  --max: 1100px;
  --gutter: 16px;
  --radius: 4px;
}
:root[data-theme="amber"] {
  --c1: #ffb000;
  --c2: #b98cff;
  --on-c1: #1a1100;
}
:root[data-theme="phosphor"] {
  --c1: #3dff8c;
  --c2: #ff5c9a;
  --on-c1: #02140a;
}

/* 3. BASE */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 700px at 80% -10%, color-mix(in srgb, var(--c2) 9%, transparent), transparent 60%),
    radial-gradient(900px 600px at -10% 20%, color-mix(in srgb, var(--c1) 7%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--mono); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: var(--c1); text-underline-offset: 3px; }
a:hover { text-shadow: 0 0 10px var(--glow-1); }
code, kbd { font-family: var(--mono); font-size: 0.92em; }
kbd {
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 0 5px;
  color: var(--text);
  background: var(--bg-2);
}
::selection { background: var(--c2); color: #000; }
:focus-visible {
  outline: 2px solid var(--c2);
  outline-offset: 2px;
  border-radius: 2px;
}
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--c1);
  color: var(--on-c1);
  font-family: var(--mono);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 10px; }

/* 4. FX LAYERS: rain canvas behind everything, CRT on top, both inert. */
.rain {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.rain.is-on { opacity: 0.3; }
/* Keep copy that sits directly on the rain legible: a soft halo in the base colour. */
.page-head, .whoami, .section-title, .trace-tail, .now-head { text-shadow: 0 0 6px var(--bg), 0 0 2px var(--bg); }
.crt {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* 5. SHELL ------------------------------------------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--bar-h);
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 7, 11, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 20px;
  border-right: 1px solid var(--line);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark .wm-dim { color: var(--muted); font-weight: 400; }
.wordmark .wm-cursor { color: var(--c1); animation: blink 1.1s steps(1) infinite; }
.wordmark:hover { text-shadow: 0 0 10px var(--glow-1); }

.primary-nav { flex: 1; display: flex; }
.tabs {
  list-style: none;
  display: flex;
  flex: 1;
  align-items: stretch;
}
.tabs li { display: flex; border-right: 1px solid var(--line); }
.tabs li.push { margin-left: auto; border-left: 1px solid var(--line); }
.tabs li:last-child { border-right: 0; }
.tab {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, text-shadow 0.15s ease, background-color 0.15s ease;
}
.tab:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--c1) 5%, transparent);
  text-shadow: 0 0 8px var(--glow-1);
}
.tab[aria-current="page"] {
  color: var(--c1);
  text-shadow: 0 0 10px var(--glow-1);
}
.tab[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: -1px;
  height: 2px;
  background: var(--grad);
  box-shadow: 0 0 8px var(--glow-1), 0 0 14px var(--glow-2);
}
.tab:focus-visible { outline-offset: -4px; }

.menu-btn {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--c1);
  font-family: var(--mono);
  font-size: 14px;
  cursor: pointer;
}
.menu-btn .bars { display: inline-block; width: 16px; height: 10px; border-block: 2px solid currentColor; position: relative; }
.menu-btn .bars::after { content: ""; position: absolute; left: 0; right: 0; top: 2px; border-top: 2px solid currentColor; }

@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .primary-nav {
    position: absolute;
    top: var(--bar-h);
    left: 0; right: 0;
    display: none;
    background: rgba(6, 7, 11, 0.97);
    border-bottom: 1px solid var(--line-strong);
  }
  .primary-nav.is-open { display: block; }
  .tabs { flex-direction: column; }
  .tabs li, .tabs li.push { border: 0; border-top: 1px solid var(--line); margin-left: 0; }
  .tabs li.push { border-top: 1px solid var(--line-strong); }
  .tab { width: 100%; min-height: 48px; padding: 0 var(--gutter); }
  .tab[aria-current="page"]::after { left: 0; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; background: linear-gradient(var(--c1), var(--c2)); }
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px var(--gutter) 72px;
  /* Keep the footer below the fold until JS renders the page, so it doesn't count as a layout shift. */
  min-height: calc(100vh - var(--bar-h));
  min-height: calc(100svh - var(--bar-h));
}
main:focus { outline: none; }
.page { display: grid; gap: 28px; }
.page h1:focus { outline: none; }
.page-head { display: grid; gap: 10px; }
.panel .term-wrap { margin: -22px; }
@media (max-width: 560px) { .panel .term-wrap { margin: -16px; } }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px var(--gutter);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}
.site-footer .inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  justify-content: space-between;
}
.site-footer .ju {
  font-family: "Yu Gothic", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 11px;
  color: var(--line-strong);
  margin-left: 6px;
  cursor: default;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}
.site-footer .ju:hover { color: var(--c2); text-shadow: 0 0 8px var(--glow-2); }

/* 6. COMPONENTS ------------------------------------------------------------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--c1);
  letter-spacing: 0.02em;
}
.eyebrow .dim { color: var(--muted); }
.page-title { font-size: clamp(1.8rem, 4.6vw, 2.8rem); font-weight: 800; }
.page-lede { color: var(--muted); max-width: 68ch; }
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--c1);
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}
.section-title::before { content: "> "; color: var(--c2); }

.panel {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 20px 60px -30px rgba(0, 0, 0, 0.9);
}
.panel::before, .panel::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid var(--c1);
  pointer-events: none;
}
.panel::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.panel::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-color: var(--c2); }
.panel-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.panel-bar .name { color: var(--text); }
.panel-bar .name::before { content: "■ "; color: var(--c1); }
.panel-body { padding: 22px; }
@media (max-width: 560px) { .panel-body { padding: 16px; } }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--c1);
  border-radius: 2px;
  background: color-mix(in srgb, var(--c1) 6%, transparent);
  color: var(--c1);
  font-family: var(--mono);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn:hover { box-shadow: 0 0 0 1px var(--c1), 0 0 18px var(--glow-1); background: color-mix(in srgb, var(--c1) 14%, transparent); text-shadow: none; }
.btn--alt { border-color: var(--c2); color: var(--c2); background: color-mix(in srgb, var(--c2) 6%, transparent); }
.btn--alt:hover { box-shadow: 0 0 0 1px var(--c2), 0 0 18px var(--glow-2); background: color-mix(in srgb, var(--c2) 14%, transparent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.tag {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.tag--c1 { border-color: color-mix(in srgb, var(--c1) 50%, transparent); color: var(--c1); }
.tag--c2 { border-color: color-mix(in srgb, var(--c2) 50%, transparent); color: var(--c2); }
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }

.ext::after { content: " ↗"; font-size: 0.85em; }

/* Under construction (503) */
.uc {
  position: relative;
  overflow: hidden;
  border: 1px dashed color-mix(in srgb, var(--c2) 70%, transparent);
  border-radius: var(--radius);
  background: var(--panel);
  font-family: var(--mono);
}
.uc-stripe {
  height: 8px;
  background: repeating-linear-gradient(-45deg, var(--c2) 0 10px, transparent 10px 20px);
  opacity: 0.75;
}
.uc-body { padding: 22px; display: grid; gap: 8px; }
.uc-req { color: var(--muted); font-size: 13px; }
.uc-status { color: var(--c2); font-weight: 700; font-size: clamp(14px, 2.4vw, 17px); }
.uc-note { color: var(--muted); font-size: 13px; }
.uc--inline .uc-body { padding: 14px 16px; }

/* 7. TERMINAL --------------------------------------------------------------- */
.term {
  display: flex;
  flex-direction: column;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  min-height: 0;
}
.term-out {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 4px;
  white-space: pre-wrap;
  word-break: break-word;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.term-out:focus-visible { outline-offset: -2px; }
.term-line { margin: 0; }
.term-echo { color: var(--muted); }
.term-echo .p { color: var(--c1); }
.term-err { color: var(--c2); }
.term-ok { color: var(--c1); }
.term-dim { color: var(--muted); }
.term-art { color: var(--c1); line-height: 1.2; text-shadow: 0 0 6px var(--glow-1); }
.term-out a { color: var(--c1); }
.term-out ul { list-style: none; }
.term-out li::before { content: "- "; color: var(--c2); }
.term-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 14px;
}
.term-prompt { color: var(--c1); white-space: nowrap; }
.term-prompt .at { color: var(--c2); }
.term-input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 4px 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  caret-color: var(--c2);
}
.term-input:focus { outline: none; }
.term-input-row:focus-within { box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--c1) 40%, transparent); }
.term-hint { padding: 0 16px 12px; font-size: 12px; color: var(--muted); }
.term--embedded { height: 380px; }
@media (max-width: 560px) { .term { font-size: 13px; } .term--embedded { height: 340px; } }

/* 8. PAGES ------------------------------------------------------------------ */

/* _hello */
.boot {
  font-family: var(--mono);
  font-size: 13.5px;
  min-height: 12.5em;
  white-space: pre-wrap;
}
.boot-line { margin: 0; }
.boot-line .ok { color: var(--c1); }
.boot-line .warn { color: var(--c2); }
.boot-skip {
  margin-top: 10px;
  border: 0;
  background: none;
  padding: 4px 0;
  color: var(--muted);
  font: 12px var(--mono);
  cursor: pointer;
  text-decoration: underline;
}
.whoami { display: grid; gap: 14px; }
.whoami .cmd { font-family: var(--mono); color: var(--muted); font-size: 14px; }
.whoami .cmd .p { color: var(--c1); }
.hero-name {
  font-size: clamp(2.6rem, 9vw, 5.6rem);
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  text-shadow: 0 0 24px color-mix(in srgb, var(--c1) 30%, transparent);
}
.hero-title { font-family: var(--mono); font-size: clamp(1rem, 2.4vw, 1.25rem); color: var(--c1); }
.hero-summary { max-width: 60ch; font-size: 1.08rem; }
.reveal { animation: rise 0.5s ease both; }

/* glitch title */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}
.glitch::before { color: var(--c1); animation: glitch-a 5.5s infinite steps(1); }
.glitch::after { color: var(--c2); animation: glitch-b 5.5s infinite steps(1); }

/* _about-me: dossier */
.dossier { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 28px; }
@media (max-width: 760px) { .dossier { grid-template-columns: 1fr; } }
.subject { display: grid; gap: 10px; align-content: start; font-family: var(--mono); font-size: 13.5px; }
.subject-id {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-width: 140px;
  border: 1px solid var(--line-strong);
  background:
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--c1) 8%, transparent) 0 1px, transparent 1px 6px),
    var(--bg-2);
  color: var(--c1);
  font-size: 2.6rem;
  font-weight: 800;
  text-shadow: 0 0 14px var(--glow-1);
}
.subject-photo {
  position: relative;
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--c1) 55%, transparent);
  box-shadow: 0 0 22px -6px var(--glow-1);
  overflow: hidden;
  background: var(--bg-2);
}
.subject-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* CRT treatment: faint scanlines plus an accent tint at the edges. */
.subject-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, color-mix(in srgb, var(--c1) 12%, transparent), transparent 45%, color-mix(in srgb, var(--c2) 14%, transparent));
}
.fields { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
.fields dt { color: var(--muted); text-transform: uppercase; font-size: 12px; padding-top: 2px; }
.fields dd { margin: 0; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c1); box-shadow: 0 0 8px var(--c1); margin-right: 6px; }
.bio { display: grid; gap: 14px; max-width: 70ch; align-content: start; }
.creds { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cred {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--c1);
  background: var(--bg-2);
  font-size: 14px;
}
.cred-code { font-family: var(--mono); font-weight: 700; color: var(--c1); white-space: nowrap; }

/* _about-me: incident timeline */
.trace { position: relative; padding-left: 46px; }
.trace-rail, .trace-fill {
  position: absolute;
  left: 15px; top: 6px;
  width: 2px;
}
.trace-rail { bottom: 6px; background: var(--line-strong); }
.trace-fill {
  height: calc(var(--progress, 0) * (100% - 12px));
  background: linear-gradient(var(--c1), var(--c2));
  box-shadow: 0 0 10px var(--glow-1);
}
.trace-list { list-style: none; display: grid; gap: 22px; }
.evt { position: relative; }
.evt-node {
  position: absolute;
  left: -38px; top: 14px;
  width: 16px; height: 16px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}
.evt.is-lit .evt-node { border-color: var(--c1); background: var(--c1); box-shadow: 0 0 12px var(--c1); }
.evt.is-lit.evt--cred .evt-node { border-color: var(--c2); background: var(--c2); box-shadow: 0 0 12px var(--c2); }
.evt-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.3s ease;
}
.js-motion .evt:not(.is-in) .evt-card { opacity: 0; transform: translateX(18px); }
.evt.is-lit .evt-card { border-color: var(--line-strong); }
.evt-head { display: flex; flex-wrap: wrap; gap: 6px 12px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.evt-id { color: var(--c2); }
.evt-kind { color: var(--c1); }
.evt-title { margin-top: 6px; font-size: 1.1rem; }
.evt-meta { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-top: 2px; }
.evt-summary { margin-top: 8px; }
.evt .tag-list { margin-top: 10px; }
.trace-tail { margin-top: 22px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.trace-tail .cur { color: var(--c1); animation: blink 1.1s steps(1) infinite; }

/* _projects: case files */
.cases { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.case {
  position: relative;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.case:hover, .case:focus-within {
  border-color: var(--c1);
  box-shadow: 0 0 22px -6px var(--glow-1);
}
.case-head { display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.case-id { color: var(--c2); }
.case-title { font-size: 1.05rem; }
.case-title a { color: var(--text); text-decoration: none; }
.case-title a::before { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.case-title a:hover { color: var(--c1); }
.case-foot { font-family: var(--mono); font-size: 12px; color: var(--c1); margin-top: 4px; }

.inventory { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.slot-list { list-style: none; display: grid; gap: 8px; font-family: var(--mono); font-size: 14px; }
.slot { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border: 1px solid var(--line); background: var(--bg-2); }
.slot .lvl { color: var(--c2); font-size: 12px; min-width: 2.2em; }
.slot .ok { margin-left: auto; color: var(--c1); font-size: 12px; }

/* _now */
.now-head { display: grid; gap: 6px; }
.now-comment { font-family: var(--mono); font-size: clamp(1.8rem, 4.6vw, 2.6rem); font-weight: 800; color: var(--muted); }
.now-comment .slash { color: var(--c2); }
.now-updated { font-family: var(--mono); font-size: 14px; color: var(--muted); }
.now-updated .v { color: var(--c1); }
.now-intro a { font-size: 0.9em; }
.now-sections { display: grid; gap: 24px; }
.now-section h2 { font-size: 16px; color: var(--c1); margin-bottom: 10px; }
.now-section h2 .gt { color: var(--c2); }
.now-section ul { list-style: none; display: grid; gap: 6px; }
.now-section li { padding-left: 1.4em; position: relative; }
.now-section li::before { content: "▹"; position: absolute; left: 0; color: var(--c1); }
/* Belt-rank pill: colour comes from content.js (beltColor). The light edge and
   glow keep a white belt visible on the dark background. */
.belt-pill {
  display: inline-block;
  width: 24px;
  height: 6px;
  margin-left: 10px;
  vertical-align: middle;
  border-radius: 3px;
  background: var(--belt, var(--muted));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.28),
    0 0 8px color-mix(in srgb, var(--belt, var(--muted)) 45%, transparent);
}

/* _more, _contact-me */
.prio-list { list-style: none; display: grid; gap: 8px; }
.prio { display: flex; gap: 12px; align-items: baseline; font-size: 15px; }
.prio .lvl { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border: 1px solid var(--line-strong); color: var(--c1); }
.prio:nth-child(n + 3) .lvl { color: var(--muted); }
details.offhours summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  list-style: none;
}
details.offhours summary::-webkit-details-marker { display: none; }
details.offhours summary::before { content: "[+] "; color: var(--c2); }
details.offhours[open] summary::before { content: "[-] "; }
details.offhours p { margin-top: 12px; max-width: 70ch; }

.channels { list-style: none; display: grid; gap: 12px; }
.channel {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  font-family: var(--mono);
}
.channel .kind { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.channel a { word-break: break-all; }
@media (max-width: 480px) { .channel { grid-template-columns: 1fr; gap: 2px; } }

/* 404 */
.scan { font-family: var(--mono); font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.scan .bad { color: var(--c2); }
.scan .hi { color: var(--c1); }

/* 9. OVERLAYS --------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(2, 3, 6, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.overlay[hidden] { display: none; }
.overlay-win {
  display: flex;
  flex-direction: column;
  width: min(880px, 100%);
  height: min(600px, calc(100vh - 32px));
  height: min(600px, calc(100dvh - 32px));
  box-shadow: 0 0 0 1px var(--line-strong), 0 0 60px -10px var(--glow-1);
  background: var(--panel-solid);
}
.overlay-win .term { flex: 1; }
.icon-btn {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font: 12px var(--mono);
  padding: 2px 10px;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--c2); color: var(--c2); }

/* Snake */
.game-win { width: min(520px, 100%); height: auto; }
.game-body { display: grid; gap: 10px; padding: 14px; justify-items: center; font-family: var(--mono); font-size: 13px; }
.game-hud { display: flex; justify-content: space-between; width: 100%; color: var(--muted); }
.game-hud .v { color: var(--c1); }
.game-canvas {
  width: min(440px, 100%);
  aspect-ratio: 1;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  image-rendering: pixelated;
  touch-action: none;
}
.game-msg { color: var(--c2); min-height: 1.5em; text-align: center; }
.dpad { display: none; grid-template-columns: repeat(3, 52px); gap: 6px; }
.dpad button { height: 46px; border: 1px solid var(--line-strong); background: var(--bg-2); color: var(--c1); font-size: 18px; }
.dpad .up { grid-column: 2; }
.dpad .left { grid-column: 1; grid-row: 2; }
.dpad .down { grid-column: 2; grid-row: 2; }
.dpad .right { grid-column: 3; grid-row: 2; }
@media (pointer: coarse) { .dpad { display: grid; } }

/* IPPON! */
.ippon {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--c2) 18%, transparent), transparent 60%);
}
.ippon span {
  font-family: var(--mono);
  font-weight: 800;
  font-size: clamp(3.5rem, 16vw, 10rem);
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 0 12px var(--c1), 0 0 36px var(--c2), 0 0 80px var(--c2);
  animation: slam 1.5s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.ippon.static span { animation: none !important; }

/* Live presence (only ever rendered when the feature flag is on) */
.presence-badge {
  position: fixed;
  right: 14px; bottom: 14px;
  z-index: 60;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  background: var(--panel-solid);
  font: 12px var(--mono);
  color: var(--muted);
}
.presence-badge .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c1); margin-right: 6px; box-shadow: 0 0 6px var(--c1); }
.peer-cursor {
  position: fixed;
  left: 0; top: 0;
  z-index: 85;
  width: 14px; height: 14px;
  pointer-events: none;
  border-left: 2px solid var(--c2);
  border-top: 2px solid var(--c2);
  filter: drop-shadow(0 0 4px var(--c2));
  transition: transform 0.12s linear;
}

/* KEYFRAMES */
@keyframes blink { 50% { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slam {
  0% { opacity: 0; transform: scale(2.2) rotate(-6deg); }
  18% { opacity: 1; transform: scale(0.94) rotate(0); }
  28% { transform: scale(1.03); }
  80% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.02); }
}
@keyframes glitch-a {
  0%, 89%, 100% { opacity: 0; transform: none; clip-path: none; }
  90% { opacity: 0.9; transform: translate(-3px, -1px); clip-path: inset(10% 0 62% 0); }
  92% { opacity: 0.9; transform: translate(3px, 1px); clip-path: inset(55% 0 20% 0); }
  94% { opacity: 0.9; transform: translate(-2px, 0); clip-path: inset(30% 0 45% 0); }
  96% { opacity: 0; }
}
@keyframes glitch-b {
  0%, 90%, 100% { opacity: 0; transform: none; clip-path: none; }
  91% { opacity: 0.85; transform: translate(3px, 1px); clip-path: inset(70% 0 5% 0); }
  93% { opacity: 0.85; transform: translate(-3px, -1px); clip-path: inset(5% 0 75% 0); }
  95% { opacity: 0.85; transform: translate(2px, 0); clip-path: inset(40% 0 35% 0); }
  97% { opacity: 0; }
}

/* 10. REDUCED MOTION (and the `fx off` terminal toggle) ---------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .crt { display: none; }
  .rain { display: none; }
  .glitch::before, .glitch::after { display: none; }
  .wordmark .wm-cursor, .trace-tail .cur { animation: none; }
}
:root.fx-off .crt,
:root.fx-off .rain,
:root.fx-off .glitch::before,
:root.fx-off .glitch::after { display: none; }
