/* ════════════════════════════════════════
   style.css — global tokens, layout, sections
   VOICE   : arcade HUD meets night-city terminal; playful, still readable
   IDEA    : the portfolio behaves like a game's menu screens
   PICTURE : neon perspective grid + pixel avatar card in the hero
   COLOUR  : near-black ground, cyan lead, magenta support, yellow accent
   TYPE    : Press Start 2P (titles), VT323 (HUD), Chakra Petch (body)
   ════════════════════════════════════════ */

:root {
  color-scheme: dark;

  /* Ground */
  --bg:        #07060d;
  --bg-2:      #0c0b17;
  --panel:     #110f20;
  --panel-2:   #171530;
  --line:      #2a2650;

  /* Neon */
  --cyan:      #00f0ff;
  --magenta:   #ff2bd6;
  --yellow:    #f5e60a;
  --green:     #39ff88;

  /* Text */
  --ink:       #e8f1ff;
  --ink-2:     #a9b2d6;
  --ink-3:     #6f78a0;

  /* Type */
  --f-pixel:   'Press Start 2P', 'Courier New', monospace;
  --f-hud:     'VT323', 'Courier New', monospace;
  --f-body:    'Chakra Petch', system-ui, sans-serif;

  /* Layout */
  --max-w:     1180px;
  --pad-x:     max(5vw, 16px);
  --pad-y:     clamp(72px, 9vw, 128px);
  --hud-h:     64px;

  /* Glow */
  --glow-c:    0 0 6px rgba(0,240,255,.7), 0 0 18px rgba(0,240,255,.35);
  --glow-m:    0 0 6px rgba(255,43,214,.7), 0 0 18px rgba(255,43,214,.35);

  --ease:      cubic-bezier(.2,.8,.2,1);
}

*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16.5px/1.6 var(--f-body);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' shape-rendering='crispEdges'%3E%3Cpath fill='%2300f0ff' d='M2 2h2v2H2zM4 4h2v2H4zM6 6h2v2H6zM8 8h2v2H8zM10 10h2v2h-2zM2 4h2v10H2zM2 14h2v2H2zM4 12h2v2H4zM6 10h2v2H6zM12 10h4v2h-4z'/%3E%3C/svg%3E") 2 2, auto;
}
body.is-booting { overflow: hidden; }
a, button, [data-sfx] { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' shape-rendering='crispEdges'%3E%3Cpath fill='%23ff2bd6' d='M2 2h2v2H2zM4 4h2v2H4zM6 6h2v2H6zM8 8h2v2H8zM10 10h2v2h-2zM2 4h2v10H2zM2 14h2v2H2zM4 12h2v2H4zM6 10h2v2H6zM12 10h4v2h-4z'/%3E%3C/svg%3E") 2 2, pointer; }

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--magenta); color: #000; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--max-w); margin: 0 auto; }

/* ── CRT overlay ─────────────────────────── */
.crt {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,.035) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%);
  mix-blend-mode: normal;
}

/* ══════════════ BOOT ══════════════ */
.boot {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: #030208;
  padding: 24px;
}
.boot__inner { width: min(560px, 100%); }
.boot__log {
  font: 22px/1.25 var(--f-hud);
  color: var(--green);
  min-height: 9.5em;
  margin: 0 0 20px;
  white-space: pre-wrap;
  text-shadow: 0 0 6px rgba(57,255,136,.6);
}
.boot__bar { height: 18px; border: 2px solid var(--cyan); padding: 2px; box-shadow: var(--glow-c); }
.boot__fill {
  height: 100%; width: 0;
  background: repeating-linear-gradient(90deg, var(--cyan) 0 10px, transparent 10px 12px);
}
.boot__start {
  display: block; margin: 32px auto 8px;
  font: 14px/1 var(--f-pixel); color: var(--yellow);
  background: none; border: 0; padding: 14px 18px; min-height: 44px;
  opacity: 0; pointer-events: none;
  text-shadow: 0 0 8px rgba(245,230,10,.7);
}
.boot.is-ready .boot__start { opacity: 1; pointer-events: auto; animation: blink 1s steps(1) infinite; }
.boot__hint { text-align: center; font: 18px var(--f-hud); color: var(--ink-3); opacity: 0; }
.boot.is-ready .boot__hint { opacity: 1; }
.boot.is-done { pointer-events: none; }

/* ══════════════ HUD NAV ══════════════ */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(7,6,13,.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.hud__inner {
  max-width: var(--max-w); margin: 0 auto;
  height: var(--hud-h);
  padding: 0 var(--pad-x);
  display: flex; align-items: center; gap: 20px;
}
@media (min-width: 1300px) { .hud__inner { padding: 0; } }
.hud__logo {
  display: flex; align-items: center; gap: 10px;
  font: 12px/1 var(--f-pixel); letter-spacing: .02em; white-space: nowrap;
}
.hud__logo span:not(.hud__logo-mark) { color: var(--magenta); }
.hud__logo-mark { width: 20px; height: 20px; }
.hud nav { margin-left: auto; }
.hud__links { display: flex; align-items: center; gap: 4px; }
.hud__links a {
  display: block; padding: 8px 10px;
  font: 21px/1 var(--f-hud); color: var(--ink-2);
  transition: color .15s;
}
.hud__links a::before { content: '['; color: transparent; margin-right: 2px; transition: color .15s; }
.hud__links a::after  { content: ']'; color: transparent; margin-left: 2px;  transition: color .15s; }
.hud__links a:hover, .hud__links a.is-active { color: var(--cyan); }
.hud__links a:hover::before, .hud__links a:hover::after,
.hud__links a.is-active::before, .hud__links a.is-active::after { color: var(--magenta); }
.hud__links .hud__cta { color: var(--yellow); }

.hud__sound {
  display: flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 4px 10px;
  font: 18px/1 var(--f-hud); color: var(--ink-3);
  background: none; border: 1px solid var(--line);
}
.hud__sound[aria-pressed="true"] { color: var(--green); border-color: var(--green); }

.hud__toggle {
  display: none;
  width: 44px; height: 44px; padding: 12px 10px;
  background: none; border: 1px solid var(--line);
  flex-direction: column; justify-content: space-between;
}
.hud__toggle span { display: block; height: 2px; background: var(--cyan); }

/* XP bar = scroll progress */
.xp {
  max-width: var(--max-w); margin: 0 auto;
  padding: 0 var(--pad-x) 8px;
  display: flex; align-items: center; gap: 10px;
  font: 16px/1 var(--f-hud);
}
@media (min-width: 1300px) { .xp { padding: 0 0 8px; } }
.xp__label { color: var(--yellow); }
.xp__num { color: var(--ink-3); width: 4ch; text-align: right; }
.xp__track { flex: 1; height: 6px; background: var(--panel-2); }
.xp__fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--magenta), var(--cyan));
  box-shadow: var(--glow-c);
}

/* ══════════════ HERO ══════════════ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--hud-h) + 56px) var(--pad-x) 96px;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(ellipse 80% 60% at 70% 20%, #1c0f3a 0%, transparent 60%), var(--bg);
}
.hero__sun {
  position: absolute; z-index: -2;
  width: min(46vw, 520px); aspect-ratio: 1;
  right: 4vw; bottom: 30%;
  border-radius: 50%;
  background:
    repeating-linear-gradient(to bottom, transparent 0 58%, var(--bg) 58% 61%, transparent 61% 66%, var(--bg) 66% 70%, transparent 70% 76%, var(--bg) 76% 81%, transparent 81% 88%, var(--bg) 88% 94%, transparent 94%),
    linear-gradient(to bottom, var(--yellow), var(--magenta) 70%);
  opacity: .22;
  filter: blur(.5px);
}
.hero__grid {
  position: absolute; z-index: -1;
  left: -50%; right: -50%; bottom: -10%;
  height: 52%;
  background:
    linear-gradient(to bottom, var(--bg) 0%, transparent 35%),
    repeating-linear-gradient(90deg, rgba(255,43,214,.55) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg,  rgba(255,43,214,.55) 0 1px, transparent 1px 64px);
  transform: perspective(420px) rotateX(62deg);
  transform-origin: center top;
  animation: grid-run 3s linear infinite;
}
.hero__inner {
  width: 100%; max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
.hero__tag { font: 22px/1 var(--f-hud); color: var(--green); margin-bottom: 24px; }
.hero__name {
  font: clamp(38px, 7.4vw, 92px)/1.08 var(--f-pixel);
  display: flex; flex-direction: column; gap: .12em;
  margin-bottom: 28px;
}
.hero__name .glitch:first-child { color: var(--ink); text-shadow: 4px 4px 0 var(--magenta); }
.hero__name .glitch--alt { color: var(--cyan); text-shadow: 4px 4px 0 #3a1170; }
.hero__class {
  font: 24px/1.25 var(--f-hud); color: var(--magenta);
  margin-bottom: 14px; min-height: 1.25em;
}
.hero__tagline { font-size: 19px; color: var(--ink-2); max-width: 32em; margin-bottom: 36px; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 14px; }

.hero__card { padding: 28px; }
.hero__avatar {
  position: relative; aspect-ratio: 1;
  margin-bottom: 22px;
  background:
    linear-gradient(rgba(0,240,255,.08) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(90deg, rgba(0,240,255,.08) 1px, transparent 1px) 0 0 / 16px 16px,
    radial-gradient(circle at 50% 60%, #26135a, #0b0a18 70%);
  border: 1px solid var(--line);
  overflow: hidden;
}
.hero__status { margin-top: 18px; font: 20px/1 var(--f-hud); color: var(--green); display: flex; align-items: center; gap: 10px; }
.hero__status .dot { width: 10px; height: 10px; background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 1.2s steps(1) infinite; }

.hero__scroll {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%);
  font: 18px/1 var(--f-hud); color: var(--ink-3); padding: 10px;
}
.hero__scroll span { display: inline-block; animation: bob 1.2s steps(2) infinite; color: var(--cyan); }

/* ══════════════ SECTIONS ══════════════ */
.band { padding: var(--pad-y) var(--pad-x); position: relative; }
.band--alt {
  background:
    linear-gradient(rgba(0,240,255,.035) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(0,240,255,.035) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--bg-2);
  border-block: 1px solid var(--line);
}

.sec-head { display: flex; align-items: center; gap: 18px; margin-bottom: clamp(36px, 5vw, 56px); }
.sec-head__id { font: 22px/1 var(--f-hud); color: var(--magenta); }
.sec-head__title { font: clamp(20px, 3vw, 32px)/1.2 var(--f-pixel); color: var(--ink); text-shadow: 3px 3px 0 #3a1170; white-space: nowrap; }
.sec-head__line { flex: 1; height: 2px; background: linear-gradient(90deg, var(--cyan), transparent); box-shadow: var(--glow-c); }

/* Profile */
.profile { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.profile__side { display: grid; gap: 20px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

/* Abilities */
.abilities { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }

/* Missions */
.missions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.mission--wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }

/* Level map */
.levels { position: relative; display: grid; gap: 40px; padding-left: 96px; }
.levels__track {
  position: absolute; left: 30px; top: 10px; bottom: 10px; width: 6px;
  background: repeating-linear-gradient(to bottom, var(--line) 0 10px, transparent 10px 16px);
}
.levels__progress {
  position: absolute; inset: 0 0 auto 0; height: 0;
  background: repeating-linear-gradient(to bottom, var(--cyan) 0 10px, transparent 10px 16px);
  filter: drop-shadow(0 0 6px var(--cyan));
}
.walker { position: absolute; left: 9px; top: 0; width: 48px; height: 48px; z-index: 2; }

/* Inventory */
.inventory { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }

/* Continue */
.continue {
  text-align: center;
  background: radial-gradient(ellipse 60% 70% at 50% 40%, #2a0d45 0%, transparent 70%), var(--bg);
  overflow: hidden;
}
.continue__inner { display: flex; flex-direction: column; align-items: center; }
.continue__kicker { font: 22px/1 var(--f-hud); color: var(--green); margin-bottom: 22px; }
.continue__title { font: clamp(32px, 7vw, 80px)/1.1 var(--f-pixel); color: var(--yellow); text-shadow: 5px 5px 0 var(--magenta); }
.continue__count { font: clamp(56px, 10vw, 110px)/1 var(--f-pixel); color: var(--cyan); text-shadow: var(--glow-c); margin: 28px 0 22px; }
.continue__sub { font-size: 19px; color: var(--ink-2); margin-bottom: 34px; }
.continue__ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-bottom: 26px; }
.continue__addr { font: 21px/1.3 var(--f-hud); color: var(--ink-3); }

/* Footer */
.footer { padding: 28px var(--pad-x); border-top: 1px solid var(--line); background: #040309; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.footer__name { font: 11px/1 var(--f-pixel); color: var(--cyan); }
.footer p { font: 19px/1.2 var(--f-hud); color: var(--ink-3); }

/* ══════════════ RESPONSIVE ══════════════ */
@media (max-width: 1040px) {
  .abilities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .hud__toggle { display: flex; }
  .hud__links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(7,6,13,.97); border-bottom: 1px solid var(--line);
    padding: 8px var(--pad-x) 16px;
    display: none;
  }
  .hud__links.is-open { display: flex; }
  .hud__links a { padding: 12px 4px; font-size: 26px; }
  .hud__sound { order: 1; margin-left: auto; }
  .hud nav { order: 2; margin-left: 0; }

  .hero__inner { grid-template-columns: minmax(0, 1fr); }
  .hero__card { max-width: 420px; width: 100%; }
  .hero__sun { width: 70vw; right: -10vw; bottom: 45%; }
  .missions { grid-template-columns: minmax(0, 1fr); }
  .mission--wide { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  :root { --hud-h: 58px; }
  .hud__logo { font-size: 10px; }
  .hud__sound-label { display: none; }
  .hero { padding-top: calc(var(--hud-h) + 48px); }
  .hero__name .glitch:first-child, .hero__name .glitch--alt { text-shadow: 3px 3px 0 var(--magenta); }
  .hero__class { font-size: 21px; }
  .sec-head { gap: 12px; }
  .sec-head__title { white-space: normal; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .abilities { grid-template-columns: minmax(0, 1fr); }
  .inventory { grid-template-columns: minmax(0, 1fr); }
  .levels { padding-left: 64px; gap: 28px; }
  .levels__track { left: 18px; }
  .walker { left: 0; width: 40px; height: 40px; }
  .level__node { left: -64px; width: 54px; }
  .continue__ctas .btn { width: 100%; }
}
