/* MIRTY.SPACE — black void, white signal, red for danger. */
@font-face { font-family: "Silkscreen"; src: url("fonts/Silkscreen-Regular.woff2") format("woff2"), url("fonts/Silkscreen-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Cinzel"; src: url("fonts/Cinzel-Variable.woff2") format("woff2"), url("fonts/Cinzel-Variable.ttf") format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "VT323"; src: url("fonts/VT323-Regular.woff2") format("woff2"), url("fonts/VT323-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("fonts/CormorantGaramond-Variable.woff2") format("woff2"), url("fonts/CormorantGaramond-Variable.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }

:root {
  --bg: #000;
  --fg: #fcfcfc;
  --dim: #8a8a8a;
  --faint: #2a2a2a;
  --line: rgba(252, 252, 252, .14);
  --red: #e00000;
  --red-glow: rgba(224, 0, 0, .55);
  --pixel: "Silkscreen", ui-monospace, monospace;
  --mono: "VT323", ui-monospace, monospace;
  --serif: "Cinzel", "Times New Roman", serif;
  --gutter: clamp(16px, 4vw, 56px);
  --hud-h: 52px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--mono); font-size: 20px; line-height: 1.35;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
body.is-booting { overflow: hidden; }
/* Custom crosshair as a native cursor image: the OS draws it, so it tracks the mouse with zero lag.
   Only for fine pointers; touch devices never see it. */
@media (pointer: fine) {
  html, body { cursor: url("assets/cursor.png") 12 12, crosshair; cursor: -webkit-image-set(url("assets/cursor.png") 1x, url("assets/cursor@2x.png") 2x) 12 12, crosshair; cursor: image-set(url("assets/cursor.png") 1x, url("assets/cursor@2x.png") 2x) 12 12, crosshair; }
  a, button, summary, label, select, [role="button"], [data-open-protocol], .inv-item:not(.inv-soon), .world-map path, #logoStage, .modes button {
    cursor: url("assets/cursor-hot.png") 12 12, pointer; cursor: -webkit-image-set(url("assets/cursor-hot.png") 1x, url("assets/cursor-hot@2x.png") 2x) 12 12, pointer; cursor: image-set(url("assets/cursor-hot.png") 1x, url("assets/cursor-hot@2x.png") 2x) 12 12, pointer;
  }
  input[type="text"], input[type="email"], #termIn, textarea { cursor: text; }
}
::selection { background: var(--red); color: var(--fg); }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 1px solid var(--red); outline-offset: 3px; }
.red { color: var(--red); }
.fine { font-family: var(--pixel); font-size: 10px; letter-spacing: .08em; color: var(--dim); text-transform: uppercase; }
.center { text-align: center; }

/* ---------- global layers ---------- */
#field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; image-rendering: pixelated; }
.crt {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.22) 2px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.65) 100%);
  /* plain alpha: same darkening as the old multiply blend, without a full-screen blend layer */
}
#flash { position: fixed; inset: 0; z-index: 95; pointer-events: none; background: var(--fg); opacity: 0; visibility: hidden; }
#flash.on { opacity: 1; visibility: visible; mix-blend-mode: difference; } /* blend layer exists only during a flash */
#flash.red { background: var(--red); mix-blend-mode: normal; opacity: .0; }
#flash.red.on { opacity: .35; }
body.inverted { filter: invert(1); }


/* ---------- boot ---------- */
#boot {
  position: fixed; inset: 0; z-index: 80; background: var(--bg);
  display: grid; place-items: center; padding: var(--gutter);
}
#boot.out { animation: bootOut .7s steps(7) forwards; }
@keyframes bootOut {
  0% { clip-path: inset(0 0 0 0); }
  40% { clip-path: inset(48% 0 48% 0); filter: brightness(3); }
  100% { clip-path: inset(50% 0 50% 0); visibility: hidden; }
}
.boot-inner { width: min(680px, 100%); }
#bootlog { margin: 0 0 20px; min-height: 15.5em; font-family: var(--mono); font-size: clamp(16px, 2.4vw, 21px); white-space: pre-wrap; color: var(--fg); }
#bootlog .ok { color: var(--fg); }
#bootlog .dim { color: var(--dim); }
#bootlog .err { color: var(--red); }
#bootlog .br { color: #1d1d1d; } /* not yet decrypted */
.boot-bar { height: 10px; border: 1px solid var(--fg); padding: 2px; margin-bottom: 28px; }
.boot-bar span { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--fg) 0 8px, transparent 8px 10px); }
.boot-hint { font-family: var(--pixel); font-size: 10px; letter-spacing: .12em; color: var(--dim); margin-top: 14px; animation: blink 1s steps(1) infinite; }
.boot-skip { position: absolute; right: var(--gutter); bottom: var(--gutter); font-family: var(--pixel); font-size: 10px; color: var(--dim); letter-spacing: .1em; }
.boot-skip:hover { color: var(--fg); }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--pixel); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  padding: 12px 18px; border: 1px solid var(--fg); color: var(--fg); position: relative;
  box-shadow: 4px 4px 0 var(--faint); transition: transform .08s steps(2), box-shadow .08s steps(2);
}
.btn:hover { background: var(--fg); color: var(--bg); box-shadow: 4px 4px 0 var(--red); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--red); }
.btn-big { font-size: 14px; padding: 16px 26px; }

/* ---------- HUD ---------- */
.hud {
  position: fixed; left: 0; right: 0; top: 0; z-index: 60; height: var(--hud-h);
  display: flex; align-items: center; gap: 20px; padding: 0 var(--gutter);
  font-family: var(--pixel); font-size: 10px; letter-spacing: .1em;
  background: linear-gradient(to bottom, rgba(0,0,0,.92), rgba(0,0,0,0));
  transform: translateY(-100%); transition: transform .5s steps(6);
}
body.entered .hud { transform: none; }
.hud-brand { display: flex; align-items: center; gap: 10px; }
.hud-brand img { image-rendering: pixelated; }
.hud-nav { display: flex; gap: 4px; margin: 0 auto; }
.hud-nav a { display: flex; gap: 6px; padding: 6px 9px; color: var(--dim); border: 1px solid transparent; }
.hud-nav a b { font-weight: 400; color: var(--faint); }
.hud-nav a:hover, .hud-nav a.active { color: var(--fg); border-color: var(--line); }
.hud-nav a.active b { color: var(--red); }
.hud-right { display: flex; gap: 14px; align-items: center; }
.hud-clock { color: var(--dim); font-variant-numeric: tabular-nums; }
.hud-shop { white-space: nowrap; font-family: var(--pixel); font-size: 10px; letter-spacing: .1em; color: var(--bg); background: var(--fg); padding: 6px 9px; box-shadow: 3px 3px 0 var(--red); }
.hud-shop:hover { background: var(--red); color: var(--fg); box-shadow: 3px 3px 0 var(--fg); }
.hud-sfx { font-family: var(--pixel); font-size: 10px; letter-spacing: .1em; color: var(--dim); }
.hud-sfx:hover { color: var(--fg); }

/* ---------- sections ---------- */
main { position: relative; z-index: 1; }
.screen { position: relative; padding: clamp(84px, 11vh, 120px) var(--gutter) clamp(28px, 5vh, 56px); scroll-margin-top: 0; }
.sec-head { display: flex; align-items: baseline; gap: 18px; margin: 0 auto 28px; max-width: 1200px; border-bottom: 1px solid var(--line); padding-bottom: 14px; flex-wrap: wrap; }
.sec-head .idx { font-family: var(--pixel); font-size: 11px; color: var(--red); }
.sec-head h2 { font-family: var(--serif); font-weight: 700; font-size: clamp(32px, 5.2vw, 72px); line-height: .95; margin: 0; letter-spacing: .04em; }
.sec-head .path { margin-left: auto; font-family: var(--mono); color: var(--dim); font-size: 18px; }
.panel { border: 1px solid var(--line); background: rgba(0,0,0,.78); position: relative; }
.panel::before, .panel::after { content: ""; position: absolute; width: 8px; height: 8px; border: 1px solid var(--fg); pointer-events: none; }
.panel::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
.panel::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }

/* reveal on scroll */
.screen > *:not(.corner) { transition: opacity .6s steps(6), transform .6s steps(6); }
.js .screen:not(.in) > .sec-head, .js .screen:not(.in) > .panel { opacity: 0; transform: translateY(24px); }

/* glitch text */
.glitchable { position: relative; display: inline-block; }
.glitchable.glitching::before, .glitchable.glitching::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none;
}
.glitchable.glitching::before { color: var(--red); transform: translate(-4px, 0); clip-path: inset(10% 0 55% 0); mix-blend-mode: screen; }
.glitchable.glitching::after { color: var(--fg); transform: translate(5px, 0); clip-path: inset(60% 0 8% 0); }
.glitchable.glitching { animation: jitter .25s steps(2) 2; }
@keyframes jitter { 0% { transform: translate(0); } 50% { transform: translate(2px, -1px) skewX(-6deg); } 100% { transform: translate(-1px, 1px); } }
@keyframes blink { 50% { opacity: 0; } }
.blink { animation: blink 1s steps(1) infinite; }

/* ---------- 01 CORE ---------- */
.hero { min-height: 100vh; min-height: 100svh; padding-top: calc(var(--hud-h) + 24px); padding-bottom: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; overflow: hidden; }
.corner { position: absolute; font-family: var(--pixel); font-size: 9px; letter-spacing: .1em; color: var(--dim); line-height: 1.8; }
.corner.tl { left: var(--gutter); top: calc(var(--hud-h) + 16px); text-align: left; }
.corner.tr { right: var(--gutter); top: calc(var(--hud-h) + 16px); text-align: right; }
.corner.bl { left: var(--gutter); bottom: 28px; text-align: left; }
.corner.br { right: var(--gutter); bottom: 28px; text-align: right; }
.corner span { color: var(--fg); }
.corner .red { color: var(--red); animation: blink 1.2s steps(1) infinite; }

.logo-stage {
  --size: min(62vmin, 560px);
  position: relative; width: var(--size); height: var(--size);
  perspective: 900px; margin-top: -2vh;
}
.logo3d, #logoCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.logo3d { transform-style: preserve-3d; will-change: transform; }
.logo3d .layer { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
#logoCanvas { image-rendering: pixelated; opacity: 0; pointer-events: none; }
.rays {
  will-change: transform; /* rotate the masked rays as one cached layer */
  position: absolute; inset: -40%; opacity: 0; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(252,252,252,.10) 0deg 2deg, transparent 2deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 0 12%, transparent 58%); mask: radial-gradient(circle, #000 0 12%, transparent 58%);
  transition: opacity .6s;
}

/* modes */
.logo-stage[data-mode="rotate"] .logo3d { animation: spin3d 7s cubic-bezier(.65,0,.35,1) infinite; }
@keyframes spin3d {
  0% { transform: rotateX(8deg) rotateY(0deg); }
  50% { transform: rotateX(-8deg) rotateY(180deg) scale(.94); }
  100% { transform: rotateX(8deg) rotateY(360deg); }
}
.logo-stage[data-mode="pixel"] .logo3d,
.logo-stage[data-mode="glitch"] .logo3d { opacity: 0; }
.logo-stage[data-mode="pixel"] #logoCanvas,
.logo-stage[data-mode="glitch"] #logoCanvas { opacity: 1; }
.logo-stage[data-mode="glow"] .rays { opacity: 1; animation: rays 24s linear infinite; }
.logo-stage[data-mode="glow"] .logo3d { animation: breathe 3.2s ease-in-out infinite; }
.logo-stage[data-mode="glow"] .layer.glow { animation: glowPulse 3.2s ease-in-out infinite; }
.logo-stage[data-mode="glow"] .layer.glow { opacity: 1; }
.layer.glow { filter: blur(18px) brightness(1.6); opacity: 0; transition: opacity .6s; }
.layer.glow2 { filter: blur(60px) brightness(2); }
@keyframes rays { to { transform: rotate(360deg); } }
/* transform + opacity only: the blurred glow layers are rasterized once and just scaled/faded on the GPU */
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes glowPulse { 0%,100% { opacity: .75; } 50% { opacity: 1; } }

.wordmark {
  font-family: var(--serif); font-weight: 800; letter-spacing: .32em; margin: 0 0 0 .32em;
  font-size: clamp(44px, 10vw, 124px); line-height: 1;
}
.tagline { margin: 6px 0 0; font-family: var(--pixel); font-size: clamp(8px, 1.2vw, 11px); letter-spacing: .22em; color: var(--dim); }
.modes { display: flex; gap: 0; margin-top: 26px; border: 1px solid var(--line); flex-wrap: wrap; justify-content: center; }
.modes button { font-family: var(--pixel); font-size: 10px; letter-spacing: .1em; padding: 9px 14px; color: var(--dim); border-right: 1px solid var(--line); }
.modes button:last-child { border-right: 0; }
.modes button:hover { color: var(--fg); }
.modes button.on { background: var(--fg); color: var(--bg); }
.descend { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); font-family: var(--pixel); font-size: 9px; letter-spacing: .16em; color: var(--dim); }
.descend span { display: inline-block; animation: bob 1.2s steps(2) infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }

/* ---------- IDENTITY_PROTOCOL.EXE launchers (the app itself loads on demand: protocol.css/js) ---------- */
.ip-launch {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--pixel); font-size: 10px; letter-spacing: .12em; color: var(--dim);
  padding: 8px 12px; border: 1px dashed var(--line); background: rgba(0,0,0,.6);
  transition: color .15s, border-color .15s, box-shadow .2s;
}
.ip-launch::before { content: ""; width: 8px; height: 8px; background: var(--red); animation: blink 1.4s steps(1) infinite; }
.ip-launch:hover, .ip-launch:focus-visible { color: var(--fg); border-color: var(--fg); border-style: solid; box-shadow: 0 0 16px rgba(252,252,252,.18); }
.hero .ip-launch { margin-top: 14px; }
.ip-launch-row { max-width: 1200px; margin: 0 auto 18px; display: flex; justify-content: flex-end; }

/* ---------- 02 AUDIO · 404 EP ---------- */
.player { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1.15fr 1fr; }
.deck { padding: clamp(18px, 3vw, 36px); display: flex; flex-direction: column; gap: 20px; }
.tag { font-family: var(--pixel); font-size: 9px; letter-spacing: .14em; color: var(--red); }
.now h3 { font-family: var(--serif); font-size: clamp(34px, 5vw, 60px); margin: 6px 0 0; line-height: 1; }
.now p { margin: 4px 0 0; color: var(--dim); }
.ep-screen { position: relative; border-right: 1px solid var(--line); min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 28px;
  background: radial-gradient(circle, rgba(252,252,252,.05) 1px, transparent 1.5px) 0 0 / 12px 12px; }
.ep-404 { font-family: var(--pixel); font-size: clamp(72px, 12vw, 150px); line-height: 1; letter-spacing: .06em; color: var(--fg); text-shadow: 4px 0 0 rgba(224,0,0,.55); }
.ep-load { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; width: min(260px, 70%); }
.ep-load i { height: 8px; background: var(--faint); animation: epCell 2.4s steps(1) infinite; }
.ep-load i:nth-child(1) { animation-delay: 0.2s; }
.ep-load i:nth-child(2) { animation-delay: 0.4s; }
.ep-load i:nth-child(3) { animation-delay: 0.6s; }
.ep-load i:nth-child(4) { animation-delay: 0.8s; }
.ep-load i:nth-child(5) { animation-delay: 1.0s; }
.ep-load i:nth-child(6) { animation-delay: 1.2s; }
.ep-load i:nth-child(7) { animation-delay: 1.4s; }
.ep-load i:nth-child(8) { animation-delay: 1.6s; }
.ep-load i:nth-child(9) { animation-delay: 1.8s; }
.ep-load i:nth-child(10) { animation-delay: 2.0s; }
.ep-load i:nth-child(11) { animation-delay: 2.2s; }
.ep-load i:nth-child(12) { animation-delay: 2.4s; }
@keyframes epCell { 0%, 49% { background: var(--fg); } 50%, 100% { background: var(--faint); } }
.ep-label { font-family: var(--pixel); font-size: 9px; letter-spacing: .16em; color: var(--dim); display: flex; gap: 6px; align-items: center; }
.ep-caret { width: 7px; height: 10px; background: var(--red); animation: blink 1s steps(1) infinite; }
.ep .now h3 { letter-spacing: .04em; }
.ep .now p { font-family: var(--pixel); font-size: 10px; letter-spacing: .14em; margin-top: 10px; }
.ep .now .ep-year { color: var(--fg); margin-top: 6px; }
.ep-meta { margin: 0; font-family: var(--mono); font-size: 19px; line-height: 1.45; color: var(--dim); border: 1px solid var(--line); padding: 12px 14px; white-space: pre; overflow-x: auto; }
.ep-meta b { font-weight: 400; color: var(--fg); }
.ep-meta b.red { color: var(--red); }
.tracks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.track { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); align-items: baseline; }
.track .n { font-family: var(--pixel); font-size: 10px; color: var(--dim); }
.track .s { font-family: var(--pixel); font-size: 9px; letter-spacing: .08em; }
.track.locked { color: var(--dim); }
.track.locked .s { color: var(--red); opacity: .8; }
.track.locked .s::before { content: "■ "; font-size: 7px; vertical-align: 1px; }

/* ---------- 03 VISUALS · compact ---------- */
.screen.compact { padding-top: 20px; padding-bottom: 20px; }
.vis-module { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 8px 28px; padding: 22px clamp(16px, 3vw, 32px); }
.vis-module .idx { font-family: var(--pixel); font-size: 10px; letter-spacing: .12em; color: var(--red); }
.vis-title { margin: 0; font-family: var(--serif); font-weight: 700; letter-spacing: .08em; font-size: clamp(22px, 3vw, 34px); line-height: 1; }
.vis-soon { font-family: var(--pixel); font-size: 9px; letter-spacing: .14em; border: 1px solid var(--fg); padding: 6px 9px; justify-self: start; }
.vis-status { font-family: var(--pixel); font-size: 9px; letter-spacing: .12em; color: var(--dim); white-space: nowrap; }
.vis-dots::after { content: "..."; display: inline-block; width: 3ch; text-align: left; animation: visDots 1.6s steps(4) infinite; overflow: hidden; vertical-align: bottom; }
@keyframes visDots { 0% { width: 0; } 100% { width: 3ch; } }
.vis-bar { grid-column: 1 / -1; height: 2px; background: var(--faint); overflow: hidden; }
.vis-bar i { display: block; height: 100%; width: 22%; background: var(--fg); animation: visBar 2.8s cubic-bezier(.6,0,.4,1) infinite; }
@keyframes visBar { from { transform: translateX(-100%); } to { transform: translateX(460%); } }
.js .screen:not(.in) > .vis-module { opacity: 0; }

/* ---------- 04 TERMINAL ---------- */
.term { max-width: 1000px; margin: 0 auto; height: min(62vh, 560px); display: flex; flex-direction: column; }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-family: var(--pixel); font-size: 9px; color: var(--dim); letter-spacing: .1em; }
.term-bar i { width: 9px; height: 9px; border: 1px solid var(--dim); }
.term-bar i:first-child { background: var(--red); border-color: var(--red); }
.term-bar span { margin-left: auto; }
.term-out { flex: 1; overflow-y: auto; padding: 14px 18px 4px; white-space: pre-wrap; word-break: break-word; scrollbar-width: thin; scrollbar-color: var(--faint) transparent; }
.term-out .dim { color: var(--dim); }
.term-out .err { color: var(--red); }
.term-out .cmd { color: var(--fg); }
.term-out .cmd::before { content: "guest@mirty:~$ "; color: var(--dim); }
.term-line { display: flex; gap: 10px; padding: 8px 18px 16px; align-items: baseline; }
.prompt { color: var(--dim); white-space: nowrap; }
#termIn { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--fg); font: inherit; caret-color: var(--red); }

/* ---------- 05 ARCADE ---------- */
.cabinet { max-width: 760px; margin: 0 auto; padding: 14px; }
.cab-top { display: flex; justify-content: space-between; font-family: var(--pixel); font-size: 10px; letter-spacing: .1em; color: var(--dim); padding: 0 2px 12px; }
.cab-top b { color: var(--fg); font-weight: 400; }
.cab-top span:first-child { color: var(--fg); }
.cab-screen { position: relative; aspect-ratio: 4 / 3; background: #000; border: 1px solid var(--line); touch-action: none; }
#game { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.cab-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: rgba(0,0,0,.72); text-align: center; padding: 16px; }
.cab-overlay[hidden] { display: none; }
.cab-overlay p:first-child { font-family: var(--pixel); font-size: clamp(14px, 3vw, 22px); margin: 0; letter-spacing: .1em; }

/* ---------- 06 STORE ---------- */
.shop { max-width: 1200px; margin: 16px auto 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(14px, 3vw, 32px); padding: clamp(14px, 4vw, 48px); transition: background .1s steps(2); }
.shop-icon img { image-rendering: pixelated; width: clamp(36px, 4vw, 52px); height: auto; }
.shop:hover .shop-icon img { animation: shopSpin .5s steps(4) infinite; }
@keyframes shopSpin { 50% { transform: scaleX(.15); } }
.shop h3 { font-family: var(--serif); font-size: clamp(24px, 3vw, 34px); line-height: 1; margin: 6px 0 4px; letter-spacing: .1em; }
.shop p { margin: 0; color: var(--dim); }
.shop:hover { border-color: var(--fg); }
.shop:hover .shop-cta { background: var(--fg); color: var(--bg); box-shadow: 4px 4px 0 var(--red); }
.js .screen:not(.in) > .shop { opacity: 0; transform: translateY(24px); }

/* ---------- 07 MIRTY.IDENTITY ---------- */
.sec-head h2.long { font-size: clamp(28px, 6.6vw, 92px); overflow-wrap: anywhere; }
.ident { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.ident-side { padding: clamp(14px, 2vw, 22px); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.ident-photo { margin: 0; }
.ident-photo picture, .ident-photo img { display: block; width: 100%; height: auto; }
.ident-photo picture { position: relative; overflow: hidden; }
.ident-photo picture::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0,0,0,.18) 2px 3px); pointer-events: none; }
.ident-photo figcaption { display: grid; gap: 6px; padding-top: 10px; }
.ident-photo .cap-id { font-family: var(--pixel); font-size: 9px; letter-spacing: .1em; color: var(--dim); }
.ident-photo .cap-desc { font-family: var(--mono); font-size: 17px; line-height: 1.3; color: var(--dim); }
.ident-body { padding: clamp(18px, 3vw, 40px); display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.ident-meta { margin: 0; padding: 14px 16px; border: 1px solid var(--line); font-family: var(--mono); font-size: 19px; line-height: 1.45; color: var(--dim); white-space: pre-wrap; }
.ident-meta b { color: var(--fg); font-weight: 400; }
.ident-meta b.ok { color: var(--red); }
.ident-name { font-family: var(--serif); font-weight: 800; letter-spacing: .2em; font-size: clamp(36px, 5vw, 64px); line-height: 1; margin: 6px 0 0; }
.ident-role { margin: 0; font-family: var(--pixel); font-size: 10px; letter-spacing: .12em; color: var(--dim); text-transform: uppercase; line-height: 1.8; }
.ident-bio p { margin: 0 0 14px; font-family: "Cormorant Garamond", Georgia, serif; font-weight: 400; font-size: clamp(19px, 1.6vw, 22px); line-height: 1.6; color: #dcdcdc; max-width: 62ch; }
.ident-bio p:first-child::first-letter { font-family: var(--serif); font-size: 1.7em; font-weight: 700; color: var(--fg); }
.ident-facts { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.ident-facts > div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.ident-facts dt { font-family: var(--pixel); font-size: 9px; letter-spacing: .12em; color: var(--dim); }
.ident-facts dd { margin: 0; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { border: 1px solid var(--line); padding: 1px 8px; font-size: 17px; }
.ident-sub { margin: 8px 0 0; font-family: var(--pixel); font-weight: 400; font-size: 10px; letter-spacing: .14em; color: var(--red); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 1px solid var(--line); display: grid; gap: 14px; }
.timeline li { position: relative; display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: baseline; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: .45em; width: 9px; height: 9px; background: var(--bg); border: 1px solid var(--fg); }
.timeline li.now::before { background: var(--red); border-color: var(--red); }
.timeline time { font-family: var(--pixel); font-size: 10px; letter-spacing: .08em; color: var(--fg); }
.timeline b { display: block; font-family: var(--pixel); font-size: 9px; letter-spacing: .12em; font-weight: 400; color: var(--fg); margin-bottom: 2px; }
.timeline span { color: #c9c9c9; }
/* timeline steps in one by one when the section is revealed (reduced motion: the global rule zeroes this) */
.js #identity:not(.in) .timeline li { opacity: 0; transform: translateX(-8px); }
.timeline li { transition: opacity .4s steps(4), transform .4s steps(4); }
.timeline li:nth-child(2) { transition-delay: .12s; }
.timeline li:nth-child(3) { transition-delay: .24s; }
.timeline li:nth-child(4) { transition-delay: .36s; }
.timeline li:nth-child(5) { transition-delay: .48s; }

/* shared social icon row (identity + footer) */
.social-row { display: flex; flex-wrap: wrap; gap: 8px; }
.soc { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--dim); transition: color .15s, border-color .15s, box-shadow .2s; }
.soc svg { width: 20px; height: 20px; }
.soc:hover, .soc:focus-visible { color: var(--fg); border-color: var(--fg); box-shadow: 0 0 14px rgba(252,252,252,.28); }

/* ---------- 08 MIRTY.NETWORK ---------- */
.netgrid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.net { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 12px 12px; min-height: 0; transition: background .12s steps(2), box-shadow .25s, border-color .2s; }
.net-icon { grid-row: 1 / 3; width: 20px; height: 20px; color: var(--fg); }
.net-name { font-family: var(--pixel); font-weight: 400; font-size: 9px; letter-spacing: .1em; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net-handle { grid-column: 2; font-family: var(--mono); color: var(--dim); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net-go { display: none; }
.net:hover, .net:focus-visible { border-color: var(--fg); box-shadow: 0 0 22px rgba(252,252,252,.16), inset 0 0 18px rgba(252,252,252,.05); }
.net:hover .net-icon { animation: jitter .25s steps(2) 1; }
.net:hover .net-go, .net:focus-visible .net-go { color: var(--fg); }
.js .screen:not(.in) > .netgrid { opacity: 0; transform: translateY(24px); }
.foot-row { justify-content: center; margin-bottom: 18px; }

.foot { max-width: 1200px; margin: 40px auto 0; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-family: var(--pixel); font-size: 10px; letter-spacing: .12em; }
.foot img { image-rendering: pixelated; margin-bottom: 8px; }
.foot p { margin: 0; }

/* ---------- 10 MIRTY.SYSTEM / PERFORMANCE ---------- */
.perf { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.perf p, .perf-cards p, .perf-log p { margin: 0; }
.perf-main, .perf-goal { padding: clamp(20px, 3.4vw, 40px); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.perf-main { border-right: 1px solid var(--line); }
.perf-k { font-family: var(--pixel); font-size: 9px; letter-spacing: .14em; color: var(--dim); }
.perf-big { font-family: var(--serif); font-weight: 800; font-size: clamp(54px, 9vw, 120px); line-height: .95; letter-spacing: .01em; font-variant-numeric: tabular-nums; margin: 6px 0 4px !important; }
.perf-tag { font-family: var(--pixel); font-size: 10px; letter-spacing: .14em; color: var(--fg); display: flex; align-items: center; gap: 8px; }
.perf-target { font-family: var(--serif); font-weight: 700; font-size: clamp(30px, 4.4vw, 54px); line-height: 1; letter-spacing: .02em; margin-top: 4px !important; }
.perf-dot { width: 7px; height: 7px; background: var(--red); }
.perf-bar { position: relative; height: 12px; border: 1px solid var(--line); margin-top: 18px; padding: 2px;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(252,252,252,.12) calc(10% - 1px) 10%); }
.perf-bar i { display: block; height: 100%; width: 1.43%; min-width: 2px; background: var(--fg); transform-origin: left; transition: transform 1.2s cubic-bezier(.2,.8,.2,1); }
.js .perf:not(.perf-on) .perf-bar i { transform: scaleX(0); }
.perf-bar-meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-family: var(--pixel); font-size: 9px; letter-spacing: .12em; color: var(--dim); }
.perf-bar-meta span:first-child { color: var(--fg); }
.perf-cards { max-width: 1200px; margin: 12px auto 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.perf-card { padding: clamp(16px, 2.4vw, 26px); display: flex; flex-direction: column; gap: 10px; }
.perf-val { font-family: var(--serif); font-weight: 700; font-size: clamp(30px, 4vw, 48px); line-height: 1; letter-spacing: .02em; }
.perf-log { max-width: 1200px; margin: 12px auto 0; padding: clamp(16px, 2.4vw, 24px); }
.perf-log pre { margin: 10px 0 0; font-family: var(--mono); font-size: 19px; line-height: 1.5; color: var(--dim); white-space: pre-wrap; }
.perf-sources { max-width: 1200px; margin: 12px auto 0; padding: 14px clamp(16px, 2.4vw, 24px); display: flex; align-items: center; gap: 10px 24px; flex-wrap: wrap; }
.perf-sources ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.perf-sources a { display: inline-flex; align-items: center; gap: 8px; font-family: var(--pixel); font-size: 9px; letter-spacing: .1em; color: var(--dim); border: 1px solid var(--line); padding: 8px 10px; min-height: 36px; transition: color .15s, border-color .15s; }
.perf-sources a span { font-family: var(--mono); font-size: 15px; color: var(--red); }
.perf-sources a:hover, .perf-sources a:focus-visible { color: var(--fg); border-color: var(--fg); }
.js .screen:not(.in) > .perf-sources { opacity: 0; transform: translateY(24px); }
.perf-note { max-width: 1200px; margin: 14px auto 0; font-family: var(--mono); font-size: 15px; color: #6c6c6c; line-height: 1.4; }
.js .screen:not(.in) > .perf-cards, .js .screen:not(.in) > .perf-log { opacity: 0; transform: translateY(24px); }
.site-foot { margin-top: 0; padding: 24px var(--gutter) 48px; border-top: 1px solid var(--line); max-width: none; }
@media (max-width: 760px) {
  .perf { grid-template-columns: 1fr; }
  .perf-main { border-right: 0; border-bottom: 1px solid var(--line); }
  .perf-cards { grid-template-columns: 1fr 1fr; }
  .perf-cards .perf-card:last-child { grid-column: 1 / -1; }
  .perf-log pre { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .perf-bar i { transition: none; }
}

/* ---------- error popups ---------- */
#errors { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.err-win {
  position: absolute; width: min(300px, calc(100vw - 32px)); pointer-events: auto;
  background: var(--bg); border: 1px solid var(--fg); box-shadow: 6px 6px 0 var(--red);
  font-family: var(--mono); animation: popIn .25s steps(4);
}
@keyframes popIn { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.err-win header { display: flex; justify-content: space-between; background: var(--fg); color: var(--bg); font-family: var(--pixel); font-size: 9px; letter-spacing: .1em; padding: 5px 8px; }
.err-win p { margin: 0; padding: 12px 12px 4px; }
.err-win .code { color: var(--red); font-family: var(--pixel); font-size: 9px; padding-top: 0; }
.err-win footer { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 12px 12px; }
.err-win footer button { font-family: var(--pixel); font-size: 9px; border: 1px solid var(--fg); padding: 5px 10px; }
.err-win footer button:hover { background: var(--fg); color: var(--bg); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hud-nav a span { display: none; }
  .hud-nav a b { color: var(--dim); }
  .player { grid-template-columns: 1fr; }
  .ident { grid-template-columns: 1fr; }
  .ident-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .netgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ep-screen { border-right: 0; border-bottom: 1px solid var(--line); min-height: 220px; }
  .vis-module { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 18px; }
  .hud { gap: 10px; }
  .hud-brand span, .hud-clock { display: none; }
  .hud-nav { gap: 0; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; margin: 0; }
  .hud-nav::-webkit-scrollbar { display: none; }
  .hud-right { flex: none; gap: 10px; }
  .hud-nav a { padding: 6px 6px; }
  .corner.tl, .corner.tr { display: none; }
  .netgrid { grid-template-columns: 1fr 1fr; }
  .net { padding: 12px 10px; min-height: 52px; }
  .ident-facts > div { grid-template-columns: 1fr; gap: 4px; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .sec-head .path { margin-left: 0; width: 100%; font-size: 16px; }
  .shop { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .track { grid-template-columns: 36px 1fr auto; }
  .ep-meta { font-size: 17px; }
}

/* pause every CSS animation in sections that are fully off screen (main.js toggles .vis) */
.js .screen:not(.vis) *, .js .screen:not(.vis) *::before, .js .screen:not(.vis) *::after { animation-play-state: paused !important; }

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