/* kosimov.dev: nine universes, one interface.
   Purple is the through-line (frame, nav, glints, runes). Each universe re-skins the rest. */


:root {
  color-scheme: dark;
  --violet: #a66bff;
  --violet-glow: rgba(166, 107, 255, 0.4);
  --hev: #ffb000;
  --danger: #ff3b3b;
  --bg: #0c0712;
  --fg: #f3e9d2;
  --accent: #ffb000;
  --accent2: #b57bff;
  --line: rgba(255, 176, 0, 0.28);
  --muted: rgba(243, 233, 210, 0.66);
  --sans: "Trebuchet MS", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --cond: "DIN Condensed", "Bahnschrift", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", ui-sans-serif, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

html[data-u="hl2"], .uni[data-u="hl2"]      { --bg: #0c0712; --fg: #f3e9d2; --accent: #ffb000; --accent2: #b57bff; --line: rgba(255, 176, 0, 0.3); }
html[data-u="portal"], .uni[data-u="portal"]   { --bg: #070b14; --fg: #e8f2ff; --accent: #ff9a1f; --accent2: #2aa0ff; --line: rgba(42, 160, 255, 0.38); }
html[data-u="tva"], .uni[data-u="tva"]      { --bg: #100816; --fg: #f6e8d4; --accent: #ff9a1f; --accent2: #9d6bff; --line: rgba(255, 154, 31, 0.3); }
html[data-u="friday"], .uni[data-u="friday"]   { --bg: #070a1a; --fg: #def4ff; --accent: #4fd8ff; --accent2: #b57bff; --line: rgba(79, 216, 255, 0.3); }
html[data-u="slayer"], .uni[data-u="slayer"]   { --bg: #07100d; --fg: #e8fff2; --accent: #22c37a; --accent2: #9d6bff; --line: rgba(34, 195, 122, 0.32); }
html[data-u="aot"], .uni[data-u="aot"]      { --bg: #0d0b0a; --fg: #efe6cf; --accent: #d6c08a; --accent2: #8b6bd6; --line: rgba(214, 192, 138, 0.3); }
html[data-u="csm"], .uni[data-u="csm"]      { --bg: #14050b; --fg: #ffe9e0; --accent: #ff2b4d; --accent2: #a66bff; --line: rgba(255, 43, 77, 0.38); }
html[data-u="spyfam"], .uni[data-u="spyfam"]   { --bg: #170a1a; --fg: #ffeef5; --accent: #ff9cc2; --accent2: #b894ff; --line: rgba(255, 156, 194, 0.32); }
html[data-u="asm"], .uni[data-u="asm"]      { --bg: #070a1c; --fg: #eef2ff; --accent: #ff3b3b; --accent2: #6b7bff; --line: rgba(255, 59, 59, 0.34); }
html[data-u="frog"], .uni[data-u="frog"]         { --bg: #07130b; --fg: #f1ffe0; --accent: #8be04a; --accent2: #ffcf3a; --line: rgba(139, 224, 74, 0.34); }
html[data-u="hardware"], .uni[data-u="hardware"] { --bg: #06110d; --fg: #e6fff5; --accent: #34d399; --accent2: #fbbf24; --line: rgba(52, 211, 153, 0.34); }
html[data-u="security"], .uni[data-u="security"] { --bg: #05080a; --fg: #e3ffee; --accent: #39ff88; --accent2: #b57bff; --line: rgba(57, 255, 136, 0.32); }
html[data-u="ai"], .uni[data-u="ai"]             { --bg: #070914; --fg: #e8eeff; --accent: #7aa2ff; --accent2: #ff7ad9; --line: rgba(122, 162, 255, 0.34); }
html[data-u="racing"], .uni[data-u="racing"]     { --bg: #0c0809; --fg: #f4f2f2; --accent: #ff4d2e; --accent2: #ffd23a; --line: rgba(255, 77, 46, 0.36); }
html[data-u="marathon"], .uni[data-u="marathon"] { --bg: #0d0a05; --fg: #fff6e6; --accent: #c8ff3a; --accent2: #ff7a45; --line: rgba(200, 255, 58, 0.32); }
html[data-u="badapple"], .uni[data-u="badapple"] { --bg: #ffffff; --fg: #000000; --accent: #000000; --accent2: #555555; --line: rgba(0, 0, 0, 0.5); --muted: rgba(0, 0, 0, 0.7); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; max-width: 100%; overflow-x: hidden; overscroll-behavior-x: none; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
  overscroll-behavior-x: none;
  touch-action: pan-y pinch-zoom;
  transition: background-color 0.7s ease;
}

a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 3px; border-radius: 2px; }
.muted { color: var(--muted); }
p { margin: 0; }

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 200; padding: 0.5rem 0.75rem; background: var(--fg); color: var(--bg); border-radius: 4px; }
.skip:focus { top: 1rem; }

/* ---------- the background swarm (assets/scene.js) ---------- */
#scene { position: fixed; inset: 0; z-index: -2; display: block; width: 100%; height: 100%; pointer-events: none; }

/* scanlines + a soft vignette, plain alpha (no blend mode: that was costly on Safari and Firefox) */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 58%, rgba(5, 0, 12, 0.5) 100%);
}
html[data-u="badapple"] body::after { display: none; }

/* ---------- the visor frame ---------- */
.frame { position: fixed; inset: 10px; z-index: 40; pointer-events: none; }
.frame .c { position: absolute; width: 26px; height: 26px; border: 0 solid var(--violet); box-shadow: 0 0 10px var(--violet-glow); }
.frame .tl { top: 0; left: 0; border-width: 2px 0 0 2px; }
.frame .tr { top: 0; right: 0; border-width: 2px 2px 0 0; }
.frame .bl { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.frame .br { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

/* ---------- top bar (f.r.i.d.a.y.) ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 0.5rem 1.25rem; flex-wrap: wrap;
  padding: 0.7rem 1.4rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 88%, transparent), transparent);
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.04em;
}
.mark { display: inline-flex; align-items: center; gap: 0.5rem; margin-right: auto; text-decoration: none; color: var(--fg); font-size: 0.85rem; }
.mark svg { color: var(--hev); filter: drop-shadow(0 0 6px rgba(255, 176, 0, 0.5)); }
.sys { color: var(--muted); }
.sys b { color: var(--fg); font-weight: 600; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #4dff9a; box-shadow: 0 0 8px #4dff9a; margin-right: 0.35rem; }
.wide { display: none; }
@media (min-width: 62rem) { .wide { display: block; } }

.att, .lang { display: flex; gap: 0.15rem; }
.att button, .lang button {
  padding: 0.3rem 0.55rem; background: none; border: 1px solid transparent; border-radius: 3px;
  color: var(--muted); font: inherit; cursor: pointer;
}
.att button:hover, .lang button:hover { color: var(--fg); }
.att button[aria-pressed="true"], .lang button[aria-pressed="true"] { color: var(--fg); border-color: var(--violet); box-shadow: 0 0 10px var(--violet-glow); }

/* ---------- universe timeline (the multiverse tree, as navigation) ---------- */
.timeline { position: fixed; right: 1.6rem; top: 50%; transform: translateY(-50%); z-index: 45; display: none; }
@media (min-width: 62rem) { .timeline { display: block; } }
.timeline ol { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 0.95rem; }
.timeline ol::before { content: ""; position: absolute; right: 4px; top: 4px; bottom: 4px; width: 1px; background: linear-gradient(var(--violet), transparent 120%); opacity: 0.7; }
.timeline a { position: relative; display: flex; justify-content: flex-end; align-items: center; gap: 0.6rem; text-decoration: none; font-family: var(--mono); font-size: 0.68rem; color: var(--muted); }
.timeline a span { opacity: 0; transform: translateX(6px); transition: opacity 0.2s, transform 0.2s; white-space: nowrap; }
.timeline a::after { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--violet); background: var(--bg); flex: none; transition: background 0.2s, box-shadow 0.2s; }
.timeline a:hover span, .timeline a[aria-current="true"] span { opacity: 1; transform: none; color: var(--fg); }
.timeline a[aria-current="true"]::after { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px var(--accent); }

/* ---------- universes ---------- */
.uni { min-height: 100vh; display: flex; align-items: center; padding: 6.5rem 1.4rem 5.5rem; }
@media (min-width: 62rem) { .uni { padding-left: clamp(3rem, 9vw, 9rem); } }
.card {
  position: relative; width: min(100%, 35rem);
  padding: 1.6rem 1.6rem 1.7rem;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border: 1px solid var(--line);
  box-shadow: 0 0 0 1px rgba(166, 107, 255, 0.12), 0 18px 60px rgba(0, 0, 0, 0.35);
}
.card::before, .card::after { content: ""; position: absolute; width: 14px; height: 14px; border: 0 solid var(--accent); }
.card::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.card::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.tag { margin-bottom: 0.9rem; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--accent); }
.tag .idx { margin-right: 0.6rem; padding: 0.05rem 0.4rem; border: 1px solid var(--violet); color: var(--fg); border-radius: 2px; }
h2 { margin: 0 0 1rem; font-family: var(--cond); font-size: clamp(1.9rem, 4.6vw, 2.7rem); font-weight: 700; letter-spacing: 0.02em; line-height: 1.05; }
h3 { margin: 0 0 0.2rem; font-size: 1.05rem; }

/* 01 half-life 2: the biggest */
.hero .card { width: min(100%, 41rem); border-color: rgba(255, 176, 0, 0.45); }
h1 {
  margin: 0; font-family: var(--sans); font-weight: 800;
  font-size: clamp(2.8rem, 9.4vw, 6.4rem); line-height: 0.98; letter-spacing: -0.035em;
}
.glint {
  background: linear-gradient(100deg, var(--fg) 38%, #e6ccff 48%, #ffffff 50%, #e6ccff 52%, var(--fg) 62%);
  background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: glint 5.5s ease-in-out infinite;
}
html:not([data-u="hl2"]) .glint { animation: none; }
@keyframes glint { 0%, 55% { background-position: 100% 0; } 100% { background-position: -60% 0; } }

.sub { margin-top: 1rem; font-family: var(--mono); font-size: clamp(0.95rem, 2.4vw, 1.15rem); color: var(--muted); }
.sub del { text-decoration-thickness: 2px; text-decoration-color: var(--danger); }
.sub strong {
  margin-left: 0.8rem; padding: 0.15rem 0.7rem; color: #14050b; background: var(--danger); font-weight: 800;
  clip-path: polygon(0 12%, 8% 0, 22% 10%, 40% 0, 58% 10%, 76% 0, 92% 10%, 100% 0, 96% 55%, 100% 100%, 80% 90%, 62% 100%, 44% 88%, 26% 100%, 10% 90%, 0 100%, 4% 52%);
}
.lead { margin-top: 1.5rem; font-size: clamp(1.1rem, 2.3vw, 1.3rem); line-height: 1.5; }
.lead2 { margin-top: 0.7rem; color: var(--accent); font-family: var(--mono); font-size: 0.95rem; }

.console { margin-top: 1.5rem; padding: 0.9rem 1rem; background: rgba(0, 0, 0, 0.5); border: 1px solid var(--line); border-left: 3px solid var(--accent); font-family: var(--mono); font-size: 0.86rem; line-height: 1.7; }
.console .sysline { color: var(--accent); }
.console .ps { margin-right: 1ch; color: var(--muted); }
.console .err { color: #ff6b6b; }
.console .dim { color: var(--muted); }
.cursor { display: inline-block; width: 0.6ch; height: 1.05em; margin-left: 0.6ch; background: var(--accent); vertical-align: -0.15em; animation: blink 1.1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

.cta { margin-top: 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem 1.2rem; }
.btn { display: inline-block; padding: 0.65rem 1rem; background: var(--accent); color: #0b0610; font-family: var(--mono); font-size: 0.92rem; font-weight: 700; text-decoration: none; border-radius: 3px; box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent); }
.btn:hover { color: #0b0610; filter: brightness(1.1); }
.btn.red { background: var(--danger); box-shadow: 0 0 18px rgba(255, 59, 59, 0.5); clip-path: polygon(0 0, 100% 0, 100% 70%, 96% 100%, 4% 100%, 0 70%); }
.link { font-family: var(--mono); font-size: 0.92rem; }
.ghost { padding: 0.6rem 0.9rem; background: none; color: var(--fg); border: 1px solid var(--violet); border-radius: 3px; font-family: var(--mono); font-size: 0.86rem; cursor: pointer; }
.ghost:hover { box-shadow: 0 0 14px var(--violet-glow); color: var(--accent); }
.note { margin-top: 0.8rem; color: var(--muted); font-size: 0.9rem; }
.verify { min-height: 1.5em; margin-top: 0.5rem; font-family: var(--mono); font-size: 0.86rem; color: var(--accent); }

/* 02 tva */
.log { list-style: none; margin: 1.1rem 0 0; padding: 0 0 0 1.1rem; display: grid; gap: 0.9rem; border-left: 1px solid var(--violet); }
.log li { position: relative; display: grid; grid-template-columns: 3.4rem 1fr auto; gap: 0.5rem; align-items: baseline; }
.log li::before { content: ""; position: absolute; left: -1.1rem; top: 0.65rem; width: 0.8rem; height: 1px; background: var(--violet); }
.log .ver { font-family: var(--mono); font-size: 0.85rem; color: var(--accent); }
.log .pruned > span:nth-child(2) { text-decoration: line-through; text-decoration-color: var(--danger); color: var(--muted); }
.stamp { padding: 0 0.4rem; border: 1px solid var(--danger); color: var(--danger); font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; transform: rotate(-4deg); }

/* 03 f.r.i.d.a.y. + arch */
.diag { margin: 0 0 1rem; display: grid; gap: 0.35rem; font-family: var(--mono); font-size: 0.85rem; }
.diag div { display: flex; gap: 0.5rem; align-items: baseline; }
.diag dt { color: var(--muted); }
.diag dt::after { content: ""; display: inline-block; width: 1.5rem; }
.diag dd { margin: 0; margin-left: auto; color: var(--accent); }
.neofetch { margin: 0 0 1rem; padding: 0.9rem 1rem; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; background: rgba(0, 0, 0, 0.5); border: 1px solid var(--line); font-family: var(--mono); font-size: 0.78rem; line-height: 1.45; color: var(--fg); }
.neofetch .logo { color: var(--accent); }
.neofetch b { color: var(--accent); font-weight: 600; }

/* 04 demon slayer */
.checker { height: 12px; margin-bottom: 1.1rem; background: conic-gradient(#0a0a0a 25%, #1f9f66 0 50%, #0a0a0a 0 75%, #1f9f66 0) 0 0 / 16px 16px; }
.forms { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; counter-reset: form; }
.forms li { display: grid; grid-template-columns: 6rem 1fr; align-items: baseline; }
.forms li::before { counter-increment: form; content: "form " counter(form); font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; color: var(--accent); text-transform: uppercase; }

/* 05 attack on titan */
[data-u="aot"] h2, [data-u="aot"] h3 { font-family: Georgia, "Times New Roman", serif; letter-spacing: 0.01em; }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.items p { margin: 0; color: var(--muted); }
.chip { margin-left: 0.4rem; padding: 0.05rem 0.4rem; border: 1px solid var(--line); border-radius: 3px; font-family: var(--mono); font-size: 0.7rem; font-weight: 400; color: var(--muted); }
.vow { margin-top: 1.4rem; font-family: var(--cond); font-size: 1.3rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }

/* 06 chainsaw man */
[data-u="csm"] .card { background-image: radial-gradient(rgba(255, 43, 77, 0.22) 1.1px, transparent 1.5px); background-size: 9px 9px; background-color: color-mix(in srgb, var(--bg) 82%, transparent); }
.sign { margin-top: 1.1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; font-family: var(--mono); }
.teeth { margin-top: 1.4rem; height: 14px; background: linear-gradient(135deg, var(--danger) 25%, transparent 25%) -7px 0 / 14px 14px, linear-gradient(225deg, var(--danger) 25%, transparent 25%) -7px 0 / 14px 14px; }

/* 07 spy x family */
.dossier { margin: 0 0 1.2rem; display: grid; gap: 0.35rem; font-family: var(--mono); font-size: 0.88rem; }
.dossier div { display: flex; gap: 0.6rem; }
.dossier dt { width: 7rem; color: var(--muted); text-transform: uppercase; font-size: 0.74rem; letter-spacing: 0.08em; padding-top: 0.1rem; }
.dossier dd { margin: 0; }
.redact { padding: 0 0.5rem; background: var(--fg); color: transparent; user-select: none; }
.thoughts { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.35rem; font-family: var(--mono); font-size: 0.9rem; }
.thoughts li { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }
.thoughts q { quotes: "“" "”"; color: var(--fg); }
.thoughts b { color: var(--accent); }
.thoughts i { color: var(--muted); font-size: 0.8rem; }
.vs { display: inline-flex; gap: 0.5rem; margin-left: 0.5rem; color: var(--muted); }
.fine { margin-top: 1rem; color: var(--muted); font-size: 0.8rem; }
[data-u="spyfam"] .card::after { content: "top secret"; position: absolute; right: 0.9rem; top: -0.85rem; bottom: auto; left: auto; width: auto; height: auto; background: var(--bg); padding: 0.1rem 0.5rem; border: 2px solid var(--danger); color: var(--danger); font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; transform: rotate(6deg); background: none; }

/* 08 the amazing spider-man */
[data-u="asm"] .card { background-image: repeating-conic-gradient(from 180deg at 100% 0, rgba(255, 255, 255, 0.07) 0 1deg, transparent 1deg 12deg), repeating-radial-gradient(circle at 100% 0, transparent 0 16px, rgba(255, 255, 255, 0.07) 16px 17px); background-color: color-mix(in srgb, var(--bg) 78%, transparent); }
.quote { margin-bottom: 0.8rem; font-family: var(--cond); font-size: clamp(1.4rem, 3.4vw, 1.9rem); line-height: 1.2; }
h1.sense:hover, .sense-ping { animation: tingle 0.3s linear 3; }
@keyframes tingle { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }

/* 09 bad apple */
html[data-u="badapple"] .card { background: rgba(255, 255, 255, 0.9); border-color: #000; box-shadow: 8px 8px 0 #000; }
html[data-u="badapple"] .card::before, html[data-u="badapple"] .card::after { border-color: #000; }
html[data-u="badapple"] .topbar, html[data-u="badapple"] .timeline a, html[data-u="badapple"] .sys { color: #000; }
html[data-u="badapple"] .tag .idx { color: #000; border-color: #000; }
html.shadow { filter: grayscale(1) contrast(1.25); }

/* ---------- hev suit hud (half-life 2) ---------- */
.hev { position: fixed; left: 1.4rem; right: 1.4rem; bottom: 1.3rem; z-index: 55; display: flex; align-items: flex-end; gap: 0.7rem; pointer-events: none; }
.gauge { display: flex; align-items: flex-end; gap: 0.55rem; padding: 0.3rem 0.7rem 0.25rem; border-radius: 6px; background: rgba(0, 0, 0, 0.5); color: var(--hev); font-family: var(--sans); }
.gauge .lab { font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; padding-bottom: 0.45rem; }
.gauge b { font-size: clamp(1.5rem, 4.2vw, 2.3rem); line-height: 1; font-weight: 400; font-variant-numeric: tabular-nums; min-width: 2.2ch; text-align: right; text-shadow: 0 0 10px rgba(255, 176, 0, 0.45); }
.gauge.right { margin-left: auto; }
.gauge.dop { color: #ff7ad9; }
.bar { display: block; width: 6rem; height: 0.7rem; margin-bottom: 0.4rem; background: rgba(255, 255, 255, 0.12); border-radius: 3px; overflow: hidden; min-width: 0; text-shadow: none; }
.bar i { display: block; height: 100%; width: var(--dop, 10%); background: linear-gradient(90deg, #a66bff, #ff7ad9); transition: width 0.3s; }
html.low .gauge:not(.dop) { color: var(--danger); }
html.low .gauge:not(.dop) b { text-shadow: 0 0 10px rgba(255, 59, 59, 0.6); animation: lowpulse 0.8s ease-in-out infinite; }
@keyframes lowpulse { 50% { opacity: 0.45; } }
html.empty #hev-ammo { color: var(--danger); }
@media (max-width: 40rem) { .gauge.dop { display: none; } .gauge b { min-width: 2ch; font-size: clamp(1.2rem, 6.4vw, 1.9rem); } .gauge { padding: 0.25rem 0.5rem 0.2rem; } .gauge .lab { letter-spacing: 0.06em; } .hev { left: 1rem; right: 1rem; gap: 0.35rem; } }

/* ---------- boot overlay, fx, toast ---------- */
.boot { position: fixed; inset: 0; z-index: 300; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #05020a; color: #ffb000; text-align: center; transition: opacity 0.7s ease; }
.boot.gone { opacity: 0; pointer-events: none; }
.boot svg { width: min(34vw, 9rem); height: auto; filter: drop-shadow(0 0 18px rgba(255, 176, 0, 0.55)); }
.boot p { margin-top: 1.2rem; font-family: var(--mono); font-size: 0.9rem; letter-spacing: 0.08em; }
.boot .l2 { color: #a66bff; }

.toast { position: fixed; left: 50%; bottom: 5.2rem; z-index: 80; transform: translate(-50%, 12px); width: max-content; max-width: min(90vw, 28rem); text-align: center; padding: 0.5rem 0.9rem; background: rgba(0, 0, 0, 0.75); border: 1px solid var(--violet); border-radius: 4px; font-family: var(--mono); font-size: 0.82rem; color: var(--fg); opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.fx-wire { position: absolute; z-index: 70; height: 2px; transform-origin: 0 50%; pointer-events: none; background: linear-gradient(90deg, #ffffff, var(--accent)); box-shadow: 0 0 10px var(--accent); animation: wire 0.45s ease-out forwards; }
@keyframes wire { 0% { transform: rotate(var(--a)) scaleX(0); opacity: 1; } 55% { transform: rotate(var(--a)) scaleX(1); opacity: 1; } 100% { transform: rotate(var(--a)) scaleX(1); opacity: 0; } }
.fx-slash { position: absolute; z-index: 71; width: 260px; height: 3px; margin: -1px 0 0 -130px; pointer-events: none; background: #fff; box-shadow: 0 0 14px var(--accent), 0 0 30px var(--accent2); transform: rotate(var(--a)) scaleX(0); animation: slash 0.38s ease-out forwards; }
@keyframes slash { 0% { transform: rotate(var(--a)) scaleX(0); opacity: 1; } 40% { transform: rotate(var(--a)) scaleX(1); opacity: 1; } 100% { transform: rotate(var(--a)) scaleX(1.1); opacity: 0; } }

#fx { position: fixed; inset: 0; z-index: 70; overflow: hidden; pointer-events: none; }
.fx-portal { position: absolute; z-index: 72; width: 44px; height: 80px; margin: -40px 0 0 -22px; border: 4px solid currentColor; border-radius: 50%; box-shadow: 0 0 18px currentColor, inset 0 0 14px currentColor; pointer-events: none; transform: rotate(var(--a)) scale(0.2); animation: portal 0.8s ease-out forwards; }
.fx-portal.orange { color: #ff8a00; }
.fx-portal.blue { color: #2aa0ff; }
@keyframes portal { 0% { transform: rotate(var(--a)) scale(0.2); opacity: 0; } 25% { transform: rotate(var(--a)) scale(1); opacity: 1; } 100% { transform: rotate(var(--a)) scale(1.35); opacity: 0; } }

/* 02 portal */
[data-u="portal"] .card { background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px); background-size: 26px 26px; background-color: color-mix(in srgb, var(--bg) 86%, transparent); }
.pair { display: flex; align-items: center; gap: 1rem; margin: 0 0 1rem; }
.pair i { display: block; width: 26px; height: 46px; border: 4px solid currentColor; border-radius: 50%; box-shadow: 0 0 14px currentColor, inset 0 0 8px currentColor; }
.pair .o { color: #ff8a00; }
.pair .b { color: #2aa0ff; }
.pair span { flex: 1; height: 2px; background: linear-gradient(90deg, #ff8a00, #2aa0ff); opacity: 0.7; }
.cake { margin: 0 0 0.8rem; font-family: var(--cond); font-size: clamp(1.5rem, 4vw, 2.1rem); letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }
.gun { margin-top: 0.9rem; color: var(--muted); font-size: 0.9rem; }

/* 11 hardware, 12 security, 13 ai, 14 racing, 16 marathon */
[data-u="hardware"] .card { background-image: linear-gradient(90deg, rgba(52, 211, 153, 0.08) 1px, transparent 1px), linear-gradient(rgba(52, 211, 153, 0.08) 1px, transparent 1px); background-size: 20px 20px; background-color: color-mix(in srgb, var(--bg) 86%, transparent); }
[data-u="marathon"] .card { background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 44px); background-color: color-mix(in srgb, var(--bg) 86%, transparent); }
.bullets { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.bullets li { position: relative; padding-left: 1.4rem; }
.bullets li::before { content: ">"; position: absolute; left: 0; top: 0; font-family: var(--mono); color: var(--accent); }
.gauge.km b { min-width: 3.4ch; }
@media (max-width: 40rem) { .gauge.km { display: none; } }
.fx-ding { position: absolute; z-index: 73; margin: -12px 0 0 -20px; font-family: var(--mono); font-weight: 800; font-size: 1.1rem; color: var(--accent); text-shadow: 0 0 12px var(--accent); pointer-events: none; animation: ding 0.9s ease-out forwards; }
@keyframes ding { 0% { transform: translateY(0) scale(0.6); opacity: 0; } 20% { opacity: 1; transform: translateY(-6px) scale(1.2); } 100% { transform: translateY(-46px) scale(1); opacity: 0; } }

/* ---------- footer ---------- */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; padding: 2rem 1.4rem 6.5rem; border-top: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: 0.78rem; }
@media (min-width: 62rem) { .foot { padding-left: clamp(3rem, 9vw, 9rem); } }

/* ---------- attention modes (adhd): squirrel is the default chaos, hyperfocus is the quiet ---------- */
html.hyperfocus #scene { opacity: 0.1; }
html.hyperfocus .frame, html.hyperfocus .timeline, html.hyperfocus .gauge.dop, html.hyperfocus .sys, html.hyperfocus body::after { display: none; }
html.hyperfocus .card { background: var(--bg); box-shadow: none; }
html.hyperfocus *, html.hyperfocus *::before, html.hyperfocus *::after { animation: none !important; transition: none !important; }
html.hyperfocus .glint { color: var(--fg); background: none; }

/* ---------- 404 ---------- */
.lost { width: min(100% - 2.8rem, 40rem); margin: 0 auto; padding: 9rem 0 5rem; }
.lost .card { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .glint { color: var(--fg); background: none; }
}
