/* ==========================================================================
   SUPER TIM'S WORLD — page chrome. The game itself is a <canvas>; everything
   here is the frame around it: top bar, info bar, touch controls and the
   SNES-style windows used for project cards, Quick View and menus.
   ========================================================================== */
@font-face {
  font-family: 'Press Start 2P';
  src: url('../fonts/PressStart2P.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --bg: #0a0f2c; --bg2: #0f1747; --panel: #141d5a; --panel2: #1b2670; --line: #2e3da6; --line2: #4757d6;
  --ink: #f4f6ff; --dim: #bcc5f6; --mute: #9aa6ec;
  --gold: #ffd93d; --gold2: #ffb92e; --red: #e8413c; --green: #4be08f; --cyan: #7fe9ff; --pink: #ff7ac8;
  --purple: #a06bff; --blue: #4da3ff; --orange: #ff8a4c;
  --font-px: 'Press Start 2P', ui-monospace, 'Courier New', monospace;
  --font-ui: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --topbar: 56px;
  --screen-w: 100%;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { height: 100%; overscroll-behavior: none; }
body {
  margin: 0; color: var(--ink); font-family: var(--font-ui); line-height: 1.5;
  background:
    radial-gradient(900px 500px at 15% -10%, #1a2a8a55, transparent 60%),
    radial-gradient(800px 500px at 100% 0%, #5a1f8a40, transparent 55%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.022) 0 1px, transparent 1px 8px),
    var(--bg);
  overflow: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
button, a, .tb { touch-action: manipulation; }
a { color: var(--cyan); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0; }
.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 300; background: var(--gold); color: #1b1626;
  padding: 10px 16px; border-radius: 8px; font-weight: 700; text-decoration: none;
}
.skip-link:focus { left: 8px; }

/* ------------------------------------------------------------- layout */
#app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }

#topbar {
  flex: none; height: var(--topbar); display: flex; align-items: center; gap: 14px; padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(10,16,52,.96), rgba(8,12,40,.92));
  border-bottom: 3px solid var(--line); position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; background: none; border: 0; padding: 0; text-align: left; }
.brand canvas { width: 32px; height: 32px; image-rendering: pixelated; flex: none; border-radius: 6px; background: #7fc7ff; border: 2px solid #fff; }
.brand-text { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.brand-text b { font-family: var(--font-px); font-size: 11px; letter-spacing: .5px; white-space: nowrap; }
.brand-text small { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-ui); font-weight: 700; font-size: 14px; line-height: 1;
  padding: 10px 14px; border-radius: 9px; text-decoration: none; white-space: nowrap;
  color: var(--ink); background: var(--panel2); border: 2px solid var(--line2);
  box-shadow: 0 3px 0 #0a1040; transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.btn:hover { background: #24329a; border-color: #7585ff; transform: translateY(-1px); box-shadow: 0 4px 0 #0a1040; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #0a1040; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: linear-gradient(180deg, #ffe45e, #ffb92e); border-color: #fff3a8; color: #2a1a00; box-shadow: 0 3px 0 #9a5a00; }
.btn.primary:hover { background: linear-gradient(180deg, #fff08a, #ffc84a); box-shadow: 0 4px 0 #9a5a00; }
.btn.primary:active { box-shadow: 0 1px 0 #9a5a00; }
.btn.ghost { background: transparent; box-shadow: none; border-color: var(--line); color: var(--dim); }
.btn.ghost:hover { color: var(--ink); border-color: var(--line2); background: rgba(255,255,255,.05); transform: none; }
.btn.big { padding: 14px 18px; font-size: 15px; }
.btn.icon { padding: 10px; }
.btn .k { font-family: var(--font-ui); font-weight: 800; font-size: 11px; padding: 3px 6px; border-radius: 5px; background: rgba(0,0,0,.28); color: inherit; letter-spacing: .04em; }
.btn.primary .k { background: rgba(0,0,0,.18); }
.btn[aria-pressed="false"] .on, .btn[aria-pressed="true"] .off { display: none; }

#stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
#screen-wrap { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
#screen {
  position: relative; flex: none; background: #000; border-radius: 4px;
  box-shadow: 0 0 0 4px #04061a, 0 0 0 7px var(--line2), 0 0 0 10px #04061a, 0 0 60px rgba(70,90,255,.28), 0 24px 60px rgba(0,0,0,.6);
}
#game { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; image-rendering: pixelated; touch-action: none; border-radius: 4px; cursor: default; }
#game:focus-visible { outline: none; }
#screen:has(#game:focus-visible) { box-shadow: 0 0 0 4px #04061a, 0 0 0 7px var(--gold), 0 0 0 10px #04061a, 0 0 60px rgba(255,217,61,.25), 0 24px 60px rgba(0,0,0,.6); }
#boot {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #0a0f2c;
  font-family: var(--font-px); font-size: 12px; color: var(--gold); transition: opacity .3s ease, visibility 0s linear .3s; z-index: 5;
}
#boot.hide { opacity: 0; visibility: hidden; pointer-events: none; }

/* ------------------------------------------------------------ info bar */
#infobar {
  flex: none; width: var(--screen-w); max-width: 100%;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'main actions' 'hints hints'; gap: 6px 16px; align-items: center;
  padding: 10px 14px 8px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(27,38,112,.9), rgba(17,25,80,.9)); border: 2px solid var(--line2);
  box-shadow: 0 0 0 3px #04061a;
}
.ib-main { grid-area: main; min-width: 0; }
.ib-kicker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: var(--font-ui); font-weight: 800; font-size: 12px; text-transform: uppercase; color: var(--gold); letter-spacing: .07em; }
.ib-title { font-family: var(--font-px); font-size: 13px; margin-top: 7px; line-height: 1.4; color: var(--ink); }
.ib-desc { color: var(--dim); font-size: 14px; margin-top: 3px; }
.ib-actions { grid-area: actions; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ib-hints { grid-area: hints; font-size: 12px; color: var(--mute); display: flex; gap: 14px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.08); padding-top: 6px; }
.ib-hints kbd, kbd.key {
  font-family: var(--font-ui); font-weight: 700; font-size: 11px; padding: 2px 6px; border-radius: 4px; background: #0b1250; border: 1px solid var(--line2); color: var(--ink); margin: 0 2px;
}

kbd.arrow { font-family: var(--font-ui); font-size: 12px; padding: 1px 6px; line-height: 1.3; font-weight: 700; }
.chip {
  font-family: var(--font-ui); font-weight: 800; font-size: 11px; text-transform: uppercase; line-height: 1; padding: 4px 7px; border-radius: 5px; border: 2px solid currentColor; letter-spacing: .06em; white-space: nowrap;
}
.chip.ok { color: var(--green); }
.chip.gold { color: var(--gold); }
.chip.vr { color: var(--purple); } .chip.web { color: var(--blue); } .chip.sim { color: var(--orange); }
.chip.ar { color: var(--green); } .chip.career { color: var(--gold); } .chip.contact { color: var(--pink); } .chip.home { color: var(--gold); }

/* --------------------------------------------------------- touch pad */
#touch { display: none; width: 100%; user-select: none; -webkit-user-select: none; touch-action: none; }
body.touch #touch { display: flex; }
#touch .dpad { display: grid; grid-template-columns: repeat(3, 58px); grid-template-rows: repeat(3, 58px); gap: 4px; }
#touch .tb {
  background: rgba(30,44,150,.72); border: 2px solid rgba(255,255,255,.55); color: #fff; border-radius: 14px; font-family: var(--font-ui); font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center; touch-action: none; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
#touch .tb:active, #touch .tb.on { background: rgba(255,217,61,.85); color: #1b1626; border-color: #fff; }
#touch .tb svg { width: 26px; height: 26px; pointer-events: none; }
#touch .tb.up { grid-column: 2; grid-row: 1; } #touch .tb.left { grid-column: 1; grid-row: 2; }
#touch .tb.right { grid-column: 3; grid-row: 2; } #touch .tb.down { grid-column: 2; grid-row: 3; }
#touch .btns { display: flex; align-items: flex-end; gap: 12px; margin-left: auto; }
#touch .tb.act { width: 72px; height: 72px; border-radius: 50%; font-size: 15px; }
#touch .tb.small { width: 52px; height: 52px; border-radius: 50%; font-size: 12px; }
#touch [data-modes] { display: none; }
#touch[data-mode="level"] [data-modes~="level"], #touch[data-mode="overworld"] [data-modes~="overworld"], #touch[data-mode="title"] [data-modes~="title"] { display: flex; }
#touch[data-mode="level"] .dpad .up { visibility: hidden; }   /* A already jumps; Down stays for the contact doors */

/* touch: the key hints mean nothing there, the on-screen buttons are labelled */
body.touch .ib-hints { display: none; }

/* portrait phones: controls sit under the screen, the info bar stacks (title row, then buttons) */
@media (orientation: portrait) {
  body.touch #touch { padding: 6px 6px 10px; align-items: flex-end; }
  body.touch #stage { padding: 8px 8px 4px; gap: 8px; }
  body.touch #infobar { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'main' 'actions'; padding: 8px 10px; gap: 6px; }
  body.touch #infobar .ib-desc { display: none; }
  body.touch .ib-title { font-size: 11px; margin-top: 5px; }
  body.touch .ib-actions { justify-content: stretch; }
  body.touch .ib-actions .btn { flex: 1 1 auto; padding: 9px 11px; font-size: 13px; }
  body.touch .ib-actions .btn .k, body.touch .ib-actions .btn .ic, body.touch .ib-actions .btn .long { display: none; }
  #touch .dpad { grid-template-columns: repeat(3, 50px); grid-template-rows: repeat(3, 50px); gap: 3px; }
  #touch .tb.act { width: 64px; height: 64px; }
}
/* short landscape windows (phones, small browser windows) */
@media (orientation: landscape) and (max-height: 560px) {
  :root { --topbar: 44px; }
  .brand-text small { display: none; }
  #stage { padding: 6px max(8px, env(safe-area-inset-right)) 6px max(8px, env(safe-area-inset-left)); gap: 6px; }
  /* touch: controls float over the game and the info bar steps aside */
  body.touch #touch { position: fixed; left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); bottom: max(6px, env(safe-area-inset-bottom)); z-index: 30; pointer-events: none; align-items: flex-end; width: auto; }
  body.touch #touch > * { pointer-events: auto; }
  body.touch #infobar { display: none; }
  #touch .dpad { grid-template-columns: repeat(3, 50px); grid-template-rows: repeat(3, 50px); opacity: .85; }
  #touch .tb.act { width: 64px; height: 64px; opacity: .88; }
  #touch .tb.small { width: 46px; height: 46px; opacity: .85; }
  /* mouse: keep a slim one-row info bar */
  body:not(.touch) #infobar { width: min(100%, 760px); grid-template-columns: 1fr auto; grid-template-areas: 'main actions'; padding: 6px 10px; }
  body:not(.touch) .ib-hints, body:not(.touch) .ib-desc, body:not(.touch) .ib-kicker { display: none; }
  body:not(.touch) .ib-title { margin-top: 0; font-size: 11px; }
}

/* ------------------------------------------------------------ toasts */
#toasts { position: fixed; top: calc(var(--topbar) + 12px); right: 12px; z-index: 150; display: flex; flex-direction: column; gap: 10px; width: min(340px, calc(100vw - 24px)); pointer-events: none; }
.toast {
  pointer-events: none; padding: 12px 14px; border-radius: var(--radius); background: linear-gradient(180deg, #1c2878, #111a54);
  border: 3px solid #fff; box-shadow: 0 0 0 3px #04061a, 0 12px 30px rgba(0,0,0,.5); animation: toast-in .35s cubic-bezier(.2,.9,.3,1.2) both;
}
.toast b { display: block; font-family: var(--font-ui); font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin-bottom: 5px; line-height: 1.3; }
.toast span { font-size: 14px; color: var(--ink); }
.toast.out { animation: toast-out .35s ease both; }
@keyframes toast-in { from { transform: translateX(40px) scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { to { transform: translateX(40px); opacity: 0; } }

/* ------------------------------------------------------------- modals */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3,5,24,.8); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: fade-in .2s ease both; }
.card {
  position: relative; width: min(880px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto;
  background: linear-gradient(180deg, #1c277c 0%, #121b58 100%); border: 4px solid #fff; border-radius: 12px;
  box-shadow: 0 0 0 4px #04061a, 0 28px 70px rgba(0,0,0,.7); padding: 20px 24px 24px; animation: card-in .26s cubic-bezier(.2,.9,.3,1.1) both;
  scrollbar-width: thin; scrollbar-color: var(--line2) transparent; overscroll-behavior: contain;
}
@keyframes card-in { from { transform: translateY(18px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; padding-right: 44px; }
.card-head .crumb, .qv-head .crumb { font-family: var(--font-ui); font-weight: 800; font-size: 12px; text-transform: uppercase; color: var(--gold); letter-spacing: .07em; }
.modal-close {
  position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px;
  background: var(--panel2); border: 2px solid var(--line2); box-shadow: 0 3px 0 #0a1040; z-index: 2;
}
.modal-close:hover { border-color: var(--red); background: #3a2a8a; }
.modal-close svg { width: 16px; height: 16px; }
.card h2.card-title { font-family: var(--font-px); font-size: clamp(16px, 3.2vw, 24px); line-height: 1.35; text-shadow: 0 3px 0 #0a1040; }
.card .pill { display: inline-block; margin-top: 10px; font-family: var(--font-ui); font-weight: 800; font-size: 12px; letter-spacing: .06em; padding: 5px 10px; border-radius: 6px; background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.28); color: var(--cyan); }
.card .card-desc { color: var(--dim); font-size: 16px; margin-top: 12px; max-width: 70ch; }
.card .meta { color: var(--ink); font-size: 15px; margin-top: 6px; }

.video { position: relative; margin-top: 16px; border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; border: 3px solid #04061a; box-shadow: 0 0 0 2px var(--line2); }
.video img, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.video-poster { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: #000; }
.video-poster img { opacity: .9; transition: transform .35s ease, opacity .2s ease; }
.video-poster:hover img { transform: scale(1.03); opacity: 1; }
.video-poster .play {
  position: absolute; left: 50%; top: 50%; width: 78px; height: 78px; margin: -39px 0 0 -39px; border-radius: 50%;
  background: linear-gradient(180deg, #ffe45e, #ffb92e); border: 4px solid #fff; box-shadow: 0 6px 0 #9a5a00, 0 12px 30px rgba(0,0,0,.5); display: grid; place-items: center; transition: transform .15s ease;
}
.video-poster:hover .play { transform: scale(1.08); }
.video-poster .play svg { width: 30px; height: 30px; margin-left: 4px; fill: #2a1a00; }
.video-poster .lbl { position: absolute; left: 12px; bottom: 10px; font-family: var(--font-ui); font-weight: 800; font-size: 12px; letter-spacing: .08em; padding: 5px 9px; background: rgba(0,0,0,.78); border-radius: 5px; color: #fff; }
.video-fallback { margin-top: 8px; font-size: 13px; color: var(--mute); }

.card-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.card-actions .spacer { flex: 1; }

.profile-grid { display: grid; grid-template-columns: 230px 1fr; gap: 24px; margin-top: 4px; }
.portrait img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; border: 4px solid #fff; box-shadow: 0 0 0 3px #04061a, 0 12px 30px rgba(0,0,0,.45); }
.stat-tiles { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 14px; }
.stat-tile { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 12px; background: rgba(0,0,0,.25); border: 2px solid var(--line); border-radius: 9px; }
.stat-tile span { font-family: var(--font-ui); font-weight: 800; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.stat-tile b { font-size: 15px; color: var(--cyan); }
.bio h2 { font-family: var(--font-px); font-size: clamp(15px, 2.6vw, 21px); line-height: 1.4; }
.bio .sub { color: var(--gold); font-weight: 700; margin-top: 6px; }
.bio p { color: var(--dim); font-size: 15.5px; margin-top: 12px; max-width: 62ch; }
.bio h3, .section-h { font-family: var(--font-ui); font-weight: 800; font-size: 13px; text-transform: uppercase; color: var(--gold); margin-top: 20px; letter-spacing: .1em; }
.skill-list { display: flex; flex-wrap: wrap; gap: 9px; list-style: none; padding: 0; margin: 12px 0 0; }
.skill-list li { display: flex; align-items: center; gap: 9px; padding: 6px 12px 6px 7px; border-radius: 999px; background: rgba(0,0,0,.28); border: 2px solid var(--line2); font-size: 14px; font-weight: 600; }
.skill-bars { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 22px; }
.skill-bars .nm { display: block; font-size: 14px; font-weight: 700; }
.skill-bars .bar { display: flex; gap: 4px; margin-top: 6px; }
.skill-bars .bar i { flex: 1; height: 8px; border-radius: 2px; background: rgba(255,255,255,.18); }
.skill-bars .bar i.on { background: linear-gradient(180deg, #ffe45e, #ffb92e); box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.edu-list { margin-top: 12px; display: grid; gap: 10px; }
.edu { padding: 12px 14px; border-radius: 10px; background: rgba(0,0,0,.24); border: 2px solid var(--line); }
.edu b { display: block; font-size: 16px; }
.edu .fld { display: block; margin-top: 3px; color: var(--ink); font-size: 15px; }
.edu .sch { display: block; margin-top: 4px; color: var(--cyan); font-weight: 700; font-size: 14px; }
.skill-list img { width: 26px; height: 26px; image-rendering: pixelated; }

.role { font-size: 18px; font-weight: 700; margin-top: 8px; }
.dates { color: var(--cyan); font-weight: 700; margin-top: 3px; }
.timeline { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.timeline li { padding: 10px 10px 9px; border-radius: 9px; background: rgba(0,0,0,.22); border: 2px solid var(--line); font-size: 13px; position: relative; }
.timeline li b { display: block; font-size: 14px; }
.timeline li span { color: var(--mute); font-size: 12px; }
.timeline li.cur { border-color: var(--gold); background: rgba(255,217,61,.1); }
.timeline li button { all: unset; cursor: pointer; display: block; width: 100%; }
.timeline li:hover { border-color: var(--line2); }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.contact-btn { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; text-decoration: none; color: var(--ink); background: rgba(0,0,0,.26); border: 3px solid var(--line2); transition: transform .12s ease, border-color .12s ease, background .12s ease; min-width: 0; }
.contact-btn:hover, .contact-btn.focus { transform: translateY(-2px); border-color: var(--gold); background: rgba(255,217,61,.1); }
.contact-btn .ico { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--panel2); border: 2px solid var(--line2); }
.contact-btn .ico svg { width: 22px; height: 22px; }
.contact-btn b { display: block; font-family: var(--font-ui); font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.contact-btn span { display: block; font-size: 15px; overflow-wrap: anywhere; }

/* quick view */
.modal-quick .card { width: min(1120px, 100%); }
.qv-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; padding-right: 44px; }
.qv-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.qv-section { margin-top: 26px; }
.qv-section > h3 { font-family: var(--font-px); font-size: 16px; line-height: 1.4; color: var(--ink); margin-bottom: 4px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.filters .btn { padding: 8px 12px; font-size: 13px; }
.filters .btn[aria-pressed="true"] { background: var(--gold); color: #2a1a00; border-color: #fff3a8; }
.qv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.qv-card { text-align: left; padding: 0; overflow: hidden; border-radius: 12px; background: rgba(0,0,0,.28); border: 3px solid var(--line); display: flex; flex-direction: column; transition: transform .15s ease, border-color .15s ease; }
.qv-card:hover, .qv-card:focus-visible { transform: translateY(-3px); border-color: var(--gold); }
.qv-card .th { position: relative; aspect-ratio: 16 / 9; background: #000; }
.qv-card .th img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.qv-card .th .code { position: absolute; left: 8px; top: 8px; font-family: var(--font-ui); font-weight: 800; font-size: 11px; letter-spacing: .06em; padding: 4px 7px; border-radius: 5px; background: rgba(8,12,40,.88); color: var(--gold); }
.qv-card .th .vis { position: absolute; right: 8px; top: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--green); display: grid; place-items: center; }
.qv-card .th .vis svg { width: 12px; height: 12px; }
.qv-card .bd { padding: 11px 13px 13px; }
.qv-card .bd .ty { font-size: 12px; font-weight: 700; }
.qv-card .bd b { display: block; font-family: var(--font-ui); font-weight: 800; font-size: 15px; margin: 5px 0 4px; line-height: 1.3; }
.qv-card .bd span.ds { color: var(--dim); font-size: 13.5px; }
.qv-career { display: grid; gap: 12px; margin-top: 12px; }
.qv-job { padding: 14px 16px; border-radius: 12px; background: rgba(0,0,0,.24); border: 3px solid var(--line); }
.qv-job.active { border-color: var(--gold); }
.qv-job .top { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: baseline; }
.qv-job .top b { font-size: 17px; }
.qv-job .top .co { color: var(--cyan); font-weight: 700; }
.qv-job .top .dt { margin-left: auto; color: var(--dim); font-weight: 700; font-size: 14px; }
.qv-job p { color: var(--dim); font-size: 15px; margin-top: 6px; }

/* menus */
.menu-list { display: grid; gap: 10px; margin-top: 16px; }
.menu-list .btn { justify-content: flex-start; padding: 14px 16px; font-size: 15px; }
.menu-list .btn.danger:hover { border-color: var(--red); }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin-top: 14px; }
.help-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.1); font-size: 15px; }
.help-row .keys { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.help-tips { margin: 16px 0 0; padding-left: 20px; color: var(--dim); font-size: 15px; }
.help-tips li { margin: 6px 0; }

/* --------------------------------------------------------- responsive */
@media (max-width: 900px) {
  /* only the main call to action keeps its label, so the name stays readable on tablets */
  .top-actions .btn:not(.primary) .t { display: none; }
  .top-actions .btn:not(.primary) { padding: 10px; }
  .brand-text small { display: none; }
}
@media (max-width: 860px) {
  .profile-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 220px; }
  .timeline { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .help-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  #infobar { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'main' 'actions' 'hints'; }
  .ib-actions { justify-content: flex-start; }
  .card { padding: 16px 16px 18px; }
  .card-actions .btn { flex: 1 1 auto; }
}
@media (max-width: 560px) {
  #toasts { left: 12px; right: 12px; width: auto; top: calc(var(--topbar) + 8px); gap: 8px; }
  .toast { padding: 9px 12px; }
  .toast b { font-size: 11px; margin-bottom: 4px; }
  .toast span { font-size: 13px; }
}
@media (max-width: 520px) {
  .top-actions .btn .t { display: none; }
  .top-actions .btn { padding: 10px; }
  .chip { white-space: normal; line-height: 1.3; }
}
@media (max-width: 440px) {
  .brand-text b { font-family: var(--font-ui); font-weight: 800; font-size: 13px; letter-spacing: .06em; }
  .top-actions { gap: 6px; margin-left: auto; }
  #btn-resume, #btn-linkedin { display: none; }
}
@media (max-width: 360px) {
  #topbar { gap: 8px; padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .brand { gap: 8px; }
  .brand-text b { font-size: 12px; letter-spacing: .04em; }
  /* 320px phones: dpad + MAP / i / A must still fit side by side */
  #touch .dpad { grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); gap: 3px; }
  #touch .tb.act { width: 54px; height: 54px; }
  #touch .tb.small { width: 40px; height: 40px; }
  #touch .btns { gap: 8px; }
}
@media (max-width: 400px) {
  #btn-sound { display: none; }          /* sound lives in the menu on very small phones */
  .brand-text { min-width: 0; }
  .brand-text b { overflow: hidden; text-overflow: ellipsis; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
