/* ==========================================================================
   DASIROX — styles
   ========================================================================== */

:root {
  --bg: #050806;
  --bg-2: #09100c;
  --fg: #d8ffe7;
  --acc: #3cff8f;
  --acc-rgb: 60, 255, 143;
  --dim: #5f7e6b;
  --line: rgba(var(--acc-rgb), .16);
  --line-2: rgba(var(--acc-rgb), .32);
  --warn: #ff3b5c;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --retro: "VT323", var(--mono);
  --gutter: clamp(16px, 4vw, 56px);
  --hud-h: 52px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
[data-theme="amber"] { --bg:#0a0703; --bg-2:#120d05; --fg:#fff1d6; --acc:#ffb000; --acc-rgb:255,176,0;  --dim:#8c7752; }
[data-theme="red"]   { --bg:#0a0405; --bg-2:#130709; --fg:#ffe3e6; --acc:#ff3b4e; --acc-rgb:255,59,78;  --dim:#8f5d63; }
[data-theme="ice"]   { --bg:#03080a; --bg-2:#071116; --fg:#e3fdff; --acc:#7df9ff; --acc-rgb:125,249,255; --dim:#5c8085; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 15px/1.6 var(--mono);
  font-feature-settings: "calt" 1, "zero" 1;
  overflow-x: clip;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
::selection { background: var(--acc); color: var(--bg); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
kbd {
  display: inline-block; min-width: 1.6em; padding: 0 .35em; margin: 0 .1em;
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 3px;
  font: 500 .82em/1.5 var(--mono); text-align: center; color: var(--acc);
  background: rgba(var(--acc-rgb), .05);
}
.dim { color: var(--dim); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 8px; top: -60px; z-index: 200; background: var(--acc); color: var(--bg); padding: 8px 12px; }
.skip:focus { top: 8px; }
:focus-visible { outline: 1px dashed var(--acc); outline-offset: 3px; }

/* ---------- boot ---------- */
.boot {
  position: fixed; inset: 0; z-index: 300; background: #000;
  padding: var(--gutter); overflow: hidden;
  transition: opacity .45s var(--ease), transform .45s var(--ease), filter .45s;
}
.boot pre { margin: 0; font: 400 clamp(16px, 2.2vw, 22px)/1.3 var(--retro); color: var(--acc); white-space: pre-wrap; text-shadow: 0 0 8px rgba(var(--acc-rgb), .6); }
.boot .ok { color: var(--fg); }
.boot .hl { background: var(--acc); color: #000; }
.boot.out { opacity: 0; transform: scaleY(.004); filter: brightness(3); }

/* ---------- global fx ---------- */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 90; }
.fx-scan {
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.22) 3px, rgba(0,0,0,0) 4px);
  mix-blend-mode: multiply; opacity: .55;
}
.fx-vignette { background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%); }
.rain { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; opacity: 0; transition: opacity .6s; }
.rain.on { opacity: .35; }

/* ---------- cursor ---------- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 250; pointer-events: none;
  width: 12px; height: 20px; background: var(--acc); mix-blend-mode: difference;
  transform: translate3d(-100px, -100px, 0); transition: width .2s var(--ease), height .2s var(--ease), opacity .2s;
  display: none;
}
.has-cursor .cursor { display: block; }
.has-cursor, .has-cursor a, .has-cursor button { cursor: none; }
.has-cursor input, .has-cursor textarea { cursor: text; }
.cursor.hover { width: 28px; height: 28px; }
.cursor-label {
  position: absolute; left: 34px; top: 4px; white-space: nowrap;
  font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--acc); mix-blend-mode: normal; opacity: 0; transition: opacity .2s;
}
.cursor.hover .cursor-label { opacity: 1; }
.cursor.typing { opacity: 0; }

/* ---------- hud ---------- */
.hud {
  position: fixed; inset: 0 0 auto 0; z-index: 80; height: var(--hud-h);
  display: flex; align-items: center; gap: 24px; padding: 0 var(--gutter);
  font-size: 12.5px; border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(0,0,0,.85), rgba(0,0,0,.55));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.hud-logo { font-weight: 800; font-size: 16px; color: var(--acc); letter-spacing: -.02em; }
.hud-logo b { animation: blink 1s steps(1) infinite; }
.hud-prompt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--dim); }
.hud-prompt .u { color: var(--acc); }
.hud-prompt .p { color: var(--fg); }
#hud-cmd { color: var(--fg); }
.caret { display: inline-block; width: .6em; height: 1.1em; vertical-align: -.2em; margin-left: 2px; background: var(--acc); animation: blink 1s steps(1) infinite; }
.hud-meta { display: flex; align-items: center; gap: 18px; color: var(--dim); font-variant-numeric: tabular-nums; }
.btn-ghost { color: var(--acc); }
.btn-ghost:hover { color: var(--fg); }
@keyframes blink { 50% { opacity: 0; } }
.blink { color: var(--acc); animation: blink 1.2s steps(1) infinite; }

/* ---------- rail ---------- */
.rail {
  position: fixed; left: calc(var(--gutter) * .5 - 6px); top: 50%; z-index: 70; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 6px;
}
.rail a { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--dim); padding: 2px 4px; }
.rail span {
  width: 18px; height: 18px; display: grid; place-items: center;
  border: 1px solid var(--line-2); background: var(--bg); font-size: 10px; transition: all .25s var(--ease);
}
.rail em { font-style: normal; opacity: 0; transform: translateX(-6px); transition: all .25s var(--ease); letter-spacing: .06em; }
.rail a:hover em { opacity: 1; transform: none; }
.rail a.active { color: var(--acc); }
.rail a.active span { background: var(--acc); color: var(--bg); border-color: var(--acc); box-shadow: 0 0 14px rgba(var(--acc-rgb), .6); }

.progress { position: fixed; left: 0; right: 0; top: var(--hud-h); height: 2px; z-index: 80; }
.progress span { display: block; height: 100%; width: 100%; background: var(--acc); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 10px var(--acc); }

/* ---------- sections ---------- */
main { position: relative; z-index: 2; }
.sec { position: relative; padding: calc(var(--hud-h) + 64px) var(--gutter) 96px calc(var(--gutter) + 48px); }
.sec-head {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 20px;
  padding-bottom: 18px; margin-bottom: 36px; border-bottom: 1px dashed var(--line-2);
}
.sec-head .idx { font: 400 28px/1 var(--retro); color: var(--acc); }
.sec-head h2 { margin: 0; font-weight: 700; font-size: clamp(22px, 3.4vw, 40px); letter-spacing: -.03em; line-height: 1.1; }
.sec-head h2::before { content: "$ "; color: var(--dim); font-weight: 400; }
.sec-meta { margin-left: auto; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }

/* pinned (scroll-driven) sections */
.pin { padding: 0; }
.pin-inner {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--hud-h) + 24px) var(--gutter) 40px calc(var(--gutter) + 48px);
}
.pin-decrypt { height: 260vh; }
.pin-scan { height: 340vh; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden;
  display: flex; align-items: center;
  padding: calc(var(--hud-h) + 32px) var(--gutter) 80px calc(var(--gutter) + 48px);
}
.field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 30% 55%, rgba(0,0,0,.82), rgba(0,0,0,.25) 70%, transparent);
}
.hero-inner { position: relative; z-index: 1; width: 100%; }
.hero-pre { margin: 0 0 12px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.hero-title {
  margin: 0; font-weight: 800; letter-spacing: -.065em; line-height: .82;
  font-size: clamp(64px, 17.5vw, 300px); color: var(--fg);
  text-shadow: 0 0 40px rgba(var(--acc-rgb), .25);
}
.hero-title .ch { display: inline-block; transition: color .2s; }
.hero-title .ch:hover, .hero-title .ch.hot { color: var(--acc); }
.hero-title .ch:last-child { color: var(--acc); }

.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none;
  opacity: 0; mix-blend-mode: screen;
}
.glitch::before { color: #ff2a6d; }
.glitch::after { color: #05d9e8; }
.glitch.go::before { opacity: .85; animation: gl1 .32s steps(2) both; }
.glitch.go::after  { opacity: .85; animation: gl2 .32s steps(2) both; }
@keyframes gl1 {
  0% { transform: translate(-6px, 2px); clip-path: inset(10% 0 60% 0); }
  50% { transform: translate(5px, -3px); clip-path: inset(55% 0 20% 0); }
  100% { transform: translate(-3px, 0); clip-path: inset(30% 0 45% 0); opacity: 0; }
}
@keyframes gl2 {
  0% { transform: translate(6px, -2px); clip-path: inset(65% 0 5% 0); }
  50% { transform: translate(-5px, 3px); clip-path: inset(5% 0 75% 0); }
  100% { transform: translate(3px, 0); clip-path: inset(40% 0 35% 0); opacity: 0; }
}

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px 64px; margin-top: 44px; align-items: end; }
.hero-term {
  margin: 0; min-height: 9.6em; font: 400 clamp(13px, 1.25vw, 16px)/1.6 var(--mono); white-space: pre-wrap;
  color: var(--fg);
}
.hero-term .pr { color: var(--acc); }
.hero-term .mut { color: var(--dim); }
.hero-term .bar { color: var(--acc); letter-spacing: -.05em; }
.hero-hints { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; color: var(--dim); justify-self: end; }
.scroll-cue {
  position: absolute; z-index: 1; right: var(--gutter); bottom: 28px;
  display: flex; align-items: center; gap: 12px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim);
}
.scroll-cue i { width: 1px; height: 48px; background: linear-gradient(var(--acc), transparent); animation: cue 1.6s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- manifesto ---------- */
.decrypt {
  margin: 0; max-width: 36ch;
  font-weight: 700; letter-spacing: -.035em; line-height: 1.14;
  font-size: clamp(20px, min(3.3vw, 5.4vh), 50px);
}
.decrypt span { transition: color .25s; }
.decrypt .x { color: rgba(var(--acc-rgb), .28); font-weight: 400; }
.decrypt .fresh { color: var(--acc); }

/* ---------- windows ---------- */
.win {
  border: 1px solid var(--line-2); background: rgba(0,0,0,.6);
  box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 30px 80px -30px rgba(var(--acc-rgb), .25);
}
.win-bar {
  display: flex; align-items: center; gap: 7px; padding: 9px 14px; font-size: 11.5px; color: var(--dim);
  border-bottom: 1px solid var(--line); background: rgba(var(--acc-rgb), .04);
}
.win-bar i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--line-2); }
.win-bar span { margin-left: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-body { padding: 18px 20px 22px; }

/* ---------- scan ---------- */
.scan { font-size: clamp(12px, 1.05vw, 14.5px); }
.scan-l { margin: 0 0 2px; }
.scan-table { margin: 16px 0; }
.scan-row {
  display: grid; grid-template-columns: 9ch 7ch 12ch minmax(0, 1fr); gap: 16px;
  padding: 9px 0; border-top: 1px solid var(--line);
  opacity: 0; transform: translateX(-12px); transition: opacity .35s var(--ease), transform .35s var(--ease), background .3s;
}
.scan-row.on { opacity: 1; transform: none; }
.scan-row.cur { background: linear-gradient(90deg, rgba(var(--acc-rgb), .1), transparent 70%); }
.scan-hd { opacity: 1; transform: none; color: var(--dim); border-top: 0; }
.scan-hd > span { font-size: .85em; letter-spacing: .08em; }
.scan-row > :first-child { color: var(--acc); }
.scan-row b { color: var(--fg); font-weight: 700; }
.scan-row > :last-child { color: var(--dim); }
.ok { color: var(--acc); }
.scan-done { opacity: 0; transition: opacity .4s; }
.scan-done.on { opacity: 1; color: var(--acc); }
.scan-bar { margin-top: 18px; height: 2px; background: var(--line); }
.scan-bar span { display: block; height: 100%; background: var(--acc); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- certs ---------- */
.ls-total { margin: -18px 0 22px; font-size: 13px; }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; perspective: 1000px; }
.cert {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
  position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 300px; padding: 20px;
  border: 1px solid var(--line-2); background: var(--bg-2);
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d;
  transition: transform .5s var(--ease), border-color .3s, box-shadow .3s;
  overflow: hidden; isolation: isolate;
}
.cert::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s;
  background: radial-gradient(320px circle at var(--mx) var(--my), rgba(var(--acc-rgb), .16), transparent 60%);
}
.cert:hover, .cert.is-active { border-color: var(--acc); box-shadow: 0 20px 60px -20px rgba(var(--acc-rgb), .45); transition: transform .08s linear, border-color .3s, box-shadow .3s; }
.cert:hover::before, .cert.is-active::before { opacity: 1; }
.cert-perm { font-size: 11.5px; color: var(--dim); }
.cert-code { font-weight: 800; font-size: clamp(44px, 5vw, 64px); letter-spacing: -.06em; line-height: 1; color: var(--acc); margin-top: auto; }
.cert-name { font-weight: 600; font-size: 15px; line-height: 1.35; }
.cert-tags { font-size: 12px; color: var(--dim); }
.cert-foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 11px; color: var(--dim); }
.cert[href] .cert-foot span:last-child::after { content: " ↗"; color: var(--acc); }
.cert-badge {
  position: absolute; top: 16px; right: 16px; width: 86px; height: auto;
  filter: grayscale(1) brightness(1.6) contrast(.9) drop-shadow(0 0 0 transparent);
  opacity: .7; mix-blend-mode: screen;
  transform: translateZ(40px) rotate(-6deg);
  transition: filter .45s var(--ease), opacity .45s var(--ease), transform .6s var(--ease);
}
.cert-badge::selection { background: transparent; }
.cert:hover .cert-badge, .cert.is-active .cert-badge {
  filter: grayscale(0) brightness(1) contrast(1) drop-shadow(0 10px 24px rgba(255, 60, 120, .5));
  opacity: 1; mix-blend-mode: normal;
  transform: translateZ(60px) rotate(0) scale(1.12);
}
.cert-badge-round { width: 92px; filter: grayscale(1) brightness(.8) contrast(1.1); opacity: .45; transform: translateZ(40px) rotate(-10deg); }
.cert:hover .cert-badge-round, .cert.is-active .cert-badge-round { filter: grayscale(0) brightness(1) contrast(1) drop-shadow(0 10px 24px rgba(230, 30, 50, .45)); transform: translateZ(60px) rotate(0) scale(1.1); }
.cert-alt { background: repeating-linear-gradient(-45deg, var(--bg-2) 0 10px, rgba(var(--acc-rgb), .03) 10px 20px); }

/* ---------- killchain (horizontal) ---------- */
.hscroll { padding: 0; }
.hscroll-inner {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--hud-h) + 24px) 0 40px calc(var(--gutter) + 48px);
}
.hscroll-inner .sec-head { margin-right: var(--gutter); }
.track { display: flex; gap: 20px; will-change: transform; padding-right: var(--gutter); }
.stage {
  flex: 0 0 clamp(280px, 34vw, 460px); min-height: 52vh; padding: 26px;
  display: flex; flex-direction: column; gap: 14px;
  border: 1px solid var(--line-2); background: var(--bg-2);
  transition: border-color .3s, background .3s;
}
.stage.on { border-color: var(--acc); background: rgba(var(--acc-rgb), .06); }
.stage-n { font: 400 64px/1 var(--retro); color: var(--acc); }
.stage h3 { margin: 0; font-weight: 800; font-size: clamp(36px, 4.6vw, 64px); letter-spacing: -.05em; line-height: 1; }
.stage p { margin: 0; color: var(--dim); max-width: 38ch; }
.stage.on p { color: var(--fg); }
.stage code { margin-top: auto; font-size: 12.5px; color: var(--acc); }

/* ---------- contact ---------- */
.contact { padding-bottom: 120px; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 48px; align-items: start; }
.contact-lead { margin: 0 0 18px; color: var(--dim); font-size: 15px; }
.mail {
  display: inline-block; font-weight: 800; letter-spacing: -.05em; line-height: 1;
  font-size: clamp(24px, 3.2vw, 54px); overflow-wrap: anywhere;
  background: linear-gradient(var(--acc), var(--acc)) 0 100% / 0 3px no-repeat; padding-bottom: 6px;
  transition: background-size .4s var(--ease);
}
.mail span { color: var(--acc); }
.mail:hover { background-size: 100% 3px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 22px; margin: 36px 0 0; font-size: 13px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv a { color: var(--acc); }
.kv a:hover { text-decoration: underline; }
.fpr { color: var(--fg); letter-spacing: .04em; }
.lbl { display: block; color: var(--acc); font-size: 12px; margin: 0 0 6px; }
.field-in {
  width: 100%; margin-bottom: 16px; padding: 10px 12px;
  font: 400 14px/1.55 var(--mono); color: var(--fg);
  background: rgba(var(--acc-rgb), .03); border: 1px solid var(--line); border-radius: 0; resize: vertical;
  caret-color: var(--acc);
}
.field-in:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px rgba(var(--acc-rgb), .12); }
.field-in::placeholder { color: var(--dim); opacity: .8; }
.composer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.btn {
  padding: 9px 14px; font-weight: 700; font-size: 13px; color: var(--bg); background: var(--acc);
  border: 1px solid var(--acc); transition: transform .15s, box-shadow .2s;
}
.btn:hover { box-shadow: 0 0 22px rgba(var(--acc-rgb), .55); }
.btn:active { transform: translateY(1px); }
.btn.btn-ghost { background: transparent; color: var(--acc); }
.btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.kbd-hint { margin-left: auto; font-size: 11px; color: var(--dim); }
.armor {
  margin: 18px 0 0; max-height: 220px; overflow: auto; font-size: 11.5px; line-height: 1.45;
  color: var(--acc); white-space: pre-wrap; word-break: break-all;
}
.armor:empty { display: none; }
.armor .mut { color: var(--dim); }

/* ---------- footer ---------- */
.foot { position: relative; z-index: 2; padding: 40px var(--gutter) 32px calc(var(--gutter) + 48px); border-top: 1px solid var(--line); }
.foot-ascii { margin: 0 0 24px; color: var(--acc); font-size: clamp(7px, 1.4vw, 14px); line-height: 1.15; opacity: .9; overflow: hidden; }
.foot-row { display: flex; flex-wrap: wrap; gap: 10px 32px; font-size: 12px; color: var(--dim); }
.foot-row b { color: var(--fg); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- terminal ---------- */
.term {
  position: fixed; left: 0; right: 0; top: 0; z-index: 150; height: min(62vh, 560px);
  display: flex; flex-direction: column;
  background: rgba(2, 4, 3, .94); border-bottom: 1px solid var(--acc);
  box-shadow: 0 30px 120px rgba(0,0,0,.8), 0 1px 30px rgba(var(--acc-rgb), .2);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transform: translateY(-104%); transition: transform .38s var(--ease);
  font-size: 14px;
}
.term.open { transform: none; }
.term-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px var(--gutter); font-size: 12px; color: var(--dim); border-bottom: 1px solid var(--line); }
.dots { display: flex; gap: 6px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.dots i:first-child { background: var(--warn); }
.term-out { flex: 1; overflow-y: auto; padding: 14px var(--gutter) 6px; white-space: pre-wrap; word-break: break-word; overscroll-behavior: contain; }
.term-out > div { margin: 0 0 2px; }
.term-out .cmd { color: var(--fg); }
.term-out .cmd .u { color: var(--acc); }
.term-out .err { color: var(--warn); }
.term-out .acc { color: var(--acc); }
.term-out .mut { color: var(--dim); }
.term-out a { color: var(--acc); text-decoration: underline; text-underline-offset: 3px; }
.term-out table { border-collapse: collapse; }
.term-out td { padding: 0 24px 0 0; vertical-align: top; }
.term-in { display: flex; align-items: center; gap: 10px; padding: 10px var(--gutter) 14px; }
.prompt { white-space: nowrap; color: var(--dim); }
.prompt .u { color: var(--acc); }
.prompt .p { color: var(--fg); }
#term-input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--fg); font: inherit; caret-color: var(--acc); }

/* ---------- keys overlay ---------- */
.keys {
  position: fixed; inset: 0; z-index: 160; display: grid; place-items: center; padding: var(--gutter);
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.keys.open { opacity: 1; pointer-events: auto; }
.keys-box { width: min(560px, 100%); background: var(--bg); transform: translateY(12px); transition: transform .3s var(--ease); }
.keys.open .keys-box { transform: none; }
.keys h3 { margin: 0 0 16px; font-size: 13px; letter-spacing: .2em; color: var(--acc); }
.keys dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 24px; margin: 0 0 18px; font-size: 13px; }
.keys dd { margin: 0; color: var(--dim); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 170; transform: translate(-50%, 20px);
  padding: 10px 16px; font-size: 13px; background: var(--acc); color: var(--bg); font-weight: 700;
  opacity: 0; pointer-events: none; transition: all .3s var(--ease); max-width: calc(100vw - 32px);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- glitch-all (rm -rf) ---------- */
.shake { animation: shake .5s steps(6) both; }
@keyframes shake {
  20% { transform: translate(-4px, 2px) skewX(4deg); filter: hue-rotate(90deg); }
  40% { transform: translate(5px, -3px); filter: invert(1); }
  60% { transform: translate(-3px, 4px) skewX(-6deg); }
  80% { transform: translate(2px, -1px); filter: hue-rotate(-90deg); }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-hints { justify-self: start; }
  .contact-grid { grid-template-columns: 1fr; }
  .scan-row { grid-template-columns: 8ch minmax(0, 1fr); gap: 4px 12px; }
  .scan-row > :nth-child(2), .scan-hd > :nth-child(2) { display: none; }
  .scan-row > :last-child { grid-column: 1 / -1; }
  .scan-hd > :last-child { display: none; }
}
@media (max-width: 700px) {
  :root { --hud-h: 46px; }
  body { font-size: 14px; }
  .hide-sm { display: none; }
  .hud { gap: 12px; font-size: 11.5px; }
  .rail { display: none; }
  .sec, .hero, .pin-inner, .foot { padding-left: var(--gutter); }
  .hscroll-inner { padding-left: var(--gutter); }
  .hero-hints { display: none; }
  .hero-title { font-size: 21vw; }
  .stage { flex-basis: 78vw; min-height: 46vh; }
  .kbd-hint { display: none; }
  .pin-scan { height: auto; }
  .pin-scan .pin-inner { position: relative; height: auto; overflow: visible; padding-top: calc(var(--hud-h) + 48px); padding-bottom: 80px; }
  .win-body { padding: 14px; }
  .term { height: 100vh; height: 100dvh; font-size: 13px; }
  #term-input, .field-in { font-size: 16px; } /* evita el zoom automático de iOS al enfocar */
  .hero::after { background: radial-gradient(ellipse 130% 55% at 30% 62%, rgba(0,0,0,.72), rgba(0,0,0,.15) 75%, transparent); }
}
@media (hover: none) {
  .hero-hints, .kbd-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .scan-row, .scan-done { opacity: 1; transform: none; }
}

/* ---------- 404 ---------- */
.panic-noise { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.panic-main {
  position: relative; z-index: 2; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  padding: var(--gutter); max-width: 1100px;
}
.panic-log { margin: 0; font-size: clamp(11px, 1.3vw, 13.5px); line-height: 1.5; color: var(--dim); white-space: pre-wrap; overflow-wrap: anywhere; min-height: 11lh; }
.panic-log b { color: var(--fg); font-weight: 500; }
.panic-log .acc { color: var(--acc); }
.panic-log .err { color: var(--acc); font-weight: 700; text-shadow: 0 0 12px rgba(var(--acc-rgb), .8); }
.panic-title {
  margin: 8px 0 0; font-weight: 800; line-height: .8; letter-spacing: -.08em;
  font-size: clamp(120px, 30vw, 380px); color: var(--acc);
  text-shadow: 0 0 60px rgba(var(--acc-rgb), .45);
}
.panic-body { transition: opacity .5s var(--ease), transform .5s var(--ease); }
.panic-body.pending { opacity: 0; transform: translateY(12px); }
.panic-body p { margin: 0 0 8px; }
.panic-req { font-size: clamp(15px, 1.8vw, 20px); overflow-wrap: anywhere; }
.panic-req b { color: var(--fg); }
.panic-req .err { color: var(--acc); font-weight: 700; }
.panic-hint a { color: var(--acc); text-decoration: underline; text-underline-offset: 3px; }
.panic-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 14px; }
.panic-actions kbd { color: inherit; border-color: currentColor; background: transparent; }
.panic-count { font-size: 12px; font-variant-numeric: tabular-nums; }
