:root {
  --bg: #140a24;
  --ink: #f4ecff;
  --muted: #b9a8d8;
  --pink: #ff3d9a;
  --cyan: #2ef2ff;
  --yellow: #ffd23f;
  --panel: #1e1236;
  --line: rgba(255, 255, 255, 0.14);
  --pixel: 'Press Start 2P', ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--ink); font: 16px/1.5 'Space Grotesk', system-ui, sans-serif; -webkit-font-smoothing: antialiased; touch-action: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--cyan); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.pixel { font-family: var(--pixel); letter-spacing: 0.02em; }

#screen { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; image-rendering: pixelated; image-rendering: crisp-edges; background: #000; cursor: crosshair; }

/* HUD */
#hud { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: stretch; gap: 8px; padding: 8px max(8px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(10, 4, 20, 0.85) 40%); pointer-events: none; font-family: var(--pixel); }
.hud-box { background: rgba(30, 18, 54, 0.85); border: 2px solid #5b3c8f; padding: 6px 10px; display: flex; flex-direction: column; align-items: center; min-width: 84px; box-shadow: inset 0 0 0 2px #0b0616; }
.hud-box small { font-size: 8px; color: var(--muted); }
.hud-box b { font-size: 18px; color: var(--yellow); text-shadow: 2px 2px 0 #7a2b00; }
.hud-prompt { flex: 1; display: grid; place-items: center; font-size: 11px; color: var(--cyan); text-shadow: 2px 2px 0 #000; text-align: center; }
.hud-btn { pointer-events: auto; background: rgba(30, 18, 54, 0.85); border: 2px solid #5b3c8f; font-family: var(--pixel); font-size: 10px; padding: 0 12px; }
.hud-btn:hover { border-color: var(--pink); }

#banner { position: fixed; top: 16%; left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); text-align: center; font-family: var(--pixel); font-size: 12px; line-height: 1.8; padding: 16px; background: rgba(20, 10, 36, 0.92); border: 3px solid var(--pink); box-shadow: 6px 6px 0 #000; z-index: 5; }
#banner button { margin-top: 10px; }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: rgba(8, 3, 18, 0.72); backdrop-filter: blur(3px); overflow-y: auto; }
#start { background: radial-gradient(circle at 50% 30%, rgba(255, 61, 154, 0.25), transparent 60%), rgba(8, 3, 18, 0.82); }
.start-card { text-align: center; max-width: 620px; }
.kicker { color: var(--cyan); font-size: 11px; margin: 0 0 10px; }
h1.pixel { font-size: clamp(26px, 7vw, 52px); line-height: 1.25; margin: 0 0 18px; color: var(--yellow); text-shadow: 4px 4px 0 var(--pink), 8px 8px 0 #000; }
.lead { color: var(--muted); margin: 0 auto 18px; max-width: 52ch; }
.lead b { color: var(--ink); }
.keys { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; font-size: 14px; color: var(--muted); }
kbd { font-family: var(--pixel); font-size: 9px; background: #2a1a48; border: 2px solid #5b3c8f; border-bottom-width: 4px; padding: 3px 6px; color: var(--ink); }
.big { font-size: 18px; padding: 16px 34px; background: var(--pink); color: #fff; border: 0; box-shadow: 6px 6px 0 #000, inset -4px -4px 0 rgba(0, 0, 0, 0.25); }
.big:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 #000, inset -4px -4px 0 rgba(0, 0, 0, 0.25); }
.big:disabled { opacity: 0.6; }
.link { display: block; margin: 18px auto 0; background: none; border: 0; color: var(--cyan); text-decoration: underline; }
.loading { font-size: 9px; color: var(--muted); margin-top: 16px; }

.panel { position: relative; width: min(520px, 100%); background: var(--panel); border: 3px solid #5b3c8f; box-shadow: 8px 8px 0 #000; padding: 24px; }
.panel.wide { width: min(820px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.panel h2 { font-family: var(--pixel); font-size: 16px; line-height: 1.5; margin: 0 0 12px; color: var(--yellow); word-break: break-word; }
.panel h3 { font-family: var(--pixel); font-size: 11px; color: var(--cyan); margin: 26px 0 12px; }
.close { position: absolute; top: 10px; right: 10px; background: #2a1a48; border: 2px solid #5b3c8f; width: 34px; height: 34px; }
.meta { color: var(--muted); font-size: 14px; }
.meta .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn { display: inline-block; font-family: var(--pixel); font-size: 10px; padding: 12px 14px; background: #2a1a48; border: 2px solid #5b3c8f; color: var(--ink); text-decoration: none; box-shadow: 4px 4px 0 #000; }
.btn.primary { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn:hover { transform: translate(-1px, -1px); }

/* resume */
.r-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding-right: 40px; }
.r-avatar { width: 72px; height: 72px; display: grid; place-items: center; font-family: var(--pixel); font-size: 22px; background: var(--pink); color: #fff; box-shadow: 4px 4px 0 #000; flex: none; }
.r-head h2 { margin: 0 0 6px; font-size: 18px; }
.r-head p { margin: 0; color: var(--muted); }
.r-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.skill { background: #2a1a48; border: 2px solid #3d2766; padding: 10px 12px; }
.skill b { display: block; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; padding: 2px 8px; background: #140a24; border: 1px solid var(--line); }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.timeline li { border-left: 4px solid var(--pink); padding: 4px 0 4px 14px; }
.timeline .when { font-family: var(--pixel); font-size: 9px; color: var(--yellow); }
.timeline p { margin: 4px 0 0; color: var(--muted); }
.repo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.repo { display: block; background: #2a1a48; border: 2px solid #3d2766; padding: 10px 12px; text-decoration: none; color: var(--ink); }
.repo:hover { border-color: var(--cyan); }
.repo small { display: block; color: var(--muted); }
.lang-bar { height: 10px; background: #140a24; border: 1px solid var(--line); margin-top: 6px; }
.lang-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--pink)); }

/* touch controls */
#touch { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
#stick { position: absolute; left: 24px; bottom: 100px; width: 120px; height: 120px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.25); background: rgba(20, 10, 36, 0.35); pointer-events: auto; }
#stick i { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgba(255, 61, 154, 0.7); }
#t-fire, #t-use { position: absolute; pointer-events: auto; font-family: var(--pixel); border: 3px solid #000; box-shadow: 4px 4px 0 #000; }
#t-fire { right: 24px; bottom: 110px; width: 88px; height: 88px; border-radius: 50%; background: var(--pink); color: #fff; font-size: 12px; }
#t-use { right: 126px; bottom: 100px; width: 56px; height: 56px; border-radius: 50%; background: var(--cyan); color: #000; font-size: 14px; }

@media (max-width: 640px) {
  .hud-box { min-width: 0; padding: 4px 6px; }
  .hud-box b { font-size: 13px; }
  .hud-box small { font-size: 6px; }
  .hud-prompt { font-size: 8px; }
  .hud-btn span { display: none; }
  .panel { padding: 18px; }
}
