/* Hologram HUD. Film-interface language: hairlines, tiny mono readouts, condensed type,
   cyan with amber accents, nothing rounded. */
:root {
  --bg: #02080c;
  --cyan: #5fe3ff;
  --cyan-2: rgba(95, 227, 255, .55);
  --cyan-3: rgba(95, 227, 255, .22);
  --amber: #ffb040;
  --text: #d9f5ff;
  --muted: rgba(190, 232, 248, .55);
  --hud: "Michroma", "Eurostile", sans-serif;
  --mono: var(--hud);
  /* Michroma: a free Microgramma-style face, the wide squared lettering of classic sci-fi and
     film HUD labels. Barlow light for Jarvis's sentences, so they stay easy to read. */
  --cond: "Michroma", "Eurostile", sans-serif;
  --body: "Barlow", "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(.2, .75, .15, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* my display rules must never beat the hidden attribute */
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden; background: var(--bg); color: var(--text);
  font: 300 18px/1.45 var(--body); -webkit-font-smoothing: antialiased;
}
.micro { margin: 0; font: 400 13px var(--hud); letter-spacing: .06em; color: var(--cyan-2); }
.small { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

/* atmosphere: vignette + faint scanlines + a slow horizontal sweep */
.atmos { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 60% 70% at 27% 50%, rgba(40, 140, 170, .10), transparent 70%),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .65) 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 3px); }
.atmos::after { content: ""; position: absolute; left: 0; right: 0; height: 18vh; top: -18vh;
  background: linear-gradient(transparent, rgba(95, 227, 255, .035), transparent);
  animation: sweep 9s linear infinite; }
@keyframes sweep { to { transform: translateY(136vh); } }

/* HUD corners: bracketed readouts at the screen edges, not full-width bars */
.hud-edge { position: fixed; left: 0; right: 0; z-index: 3; pointer-events: none; transition: opacity .8s var(--ease); }
.hud-edge.top { top: 0; } .hud-edge.bottom { bottom: 0; }
[data-phase="boot"] .hud-edge { opacity: 0; }
.corner { position: absolute; display: flex; flex-direction: column; gap: 3px; font-family: var(--hud); }
.corner::before { content: ""; position: absolute; width: 74px; height: 30px; border: 0 solid rgba(95, 227, 255, .45); }
.corner::after { content: ""; position: absolute; width: 5px; height: 5px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.corner.tl { top: 30px; left: 3.4vw; }
.corner.tl::before { top: -12px; left: -16px; border-top-width: 1px; border-left-width: 1px; }
.corner.tl::after { top: -14px; left: -18px; }
.corner.tr { top: 26px; right: 3.4vw; align-items: flex-end; }
.corner.tr::before { top: -8px; right: -16px; border-top-width: 1px; border-right-width: 1px; }
.corner.tr::after { top: -10px; right: -18px; }
.corner.bl { bottom: 30px; left: 3.4vw; }
.corner.bl::before { bottom: -12px; left: -16px; border-bottom-width: 1px; border-left-width: 1px; }
.corner.bl::after { bottom: -14px; left: -18px; }
.corner.br { bottom: 26px; right: 3.4vw; }
.corner.br::before { bottom: -8px; right: -16px; border-bottom-width: 1px; border-right-width: 1px; }
.corner.br::after { bottom: -10px; right: -18px; }

.brand { font: 400 16px var(--hud); letter-spacing: .28em; color: #fff; }
.tagline { font: 400 14px var(--body); color: var(--muted); }
.clock { font: 400 26px/1 var(--hud); color: #fff; font-variant-numeric: tabular-nums; }
.clock small { font-size: 13px; color: var(--cyan); margin-left: 6px; vertical-align: top; }
.date { font: 400 14px var(--body); color: var(--muted); }

.talk-hint { display: flex; align-items: center; gap: 12px; font: 400 17px var(--body); color: var(--text); }
.vu { display: flex; align-items: flex-end; gap: 2px; height: 16px; }
.vu i { width: 3px; height: 30%; background: var(--cyan-2); transition: height .08s; }
[data-mode="listening"] .talk-hint { color: var(--amber); }
[data-mode="listening"] .vu i { background: var(--amber); }

.gauges { flex-direction: row; gap: 0; }
.g { display: flex; flex-direction: column; align-items: flex-end; padding: 0 18px; border-left: 1px solid rgba(95, 227, 255, .16); }
.g:first-child { border-left: 0; }
.g:last-child { padding-right: 0; }
.g .v { font: 400 18px/1.25 var(--hud); color: #fff; font-variant-numeric: tabular-nums; }
.g .l { font: 400 13px var(--body); color: var(--muted); }
/* the audio gauge is a button: click to turn Jarvis's voice on this laptop on or off */
.g-btn { all: unset; display: flex; flex-direction: column; align-items: flex-end; padding: 6px 0 4px 18px; margin: -6px 0 -4px;
  border-left: 1px solid rgba(95, 227, 255, .16); pointer-events: auto; cursor: pointer; }
.g-btn .l::after { content: " \25B8"; color: var(--cyan-2); }
.g-btn:hover .v, .g-btn:focus-visible .v { text-shadow: 0 0 10px var(--cyan); }
.g-btn:focus-visible { outline: 1px solid var(--cyan-2); outline-offset: 4px; }
.g .v.on { color: var(--cyan); } .g .v.warn { color: var(--amber); }

/* the core: centred during the intro, then it moves to the side */
.reactor-wrap { position: fixed; z-index: 1; left: 50%; top: 50%; width: min(86vh, 70vw); aspect-ratio: 1;
  transform: translate(-50%, -50%); transition: left 1.4s var(--ease), width 1.4s var(--ease); }
.reactor-wrap canvas { width: 100%; height: 100%; display: block; }
[data-phase="ready"] .reactor-wrap { left: 28%; width: min(78vh, 50vw); }

/* intro */
.intro { position: fixed; inset: 0; z-index: 2; display: grid; place-content: center; text-align: center; pointer-events: none;
  transition: opacity .7s var(--ease); }
[data-phase="ready"] .intro { opacity: 0; }
.title { margin: 0; font: 400 clamp(34px, 5.4vw, 72px) var(--cond); letter-spacing: .42em; padding-left: .42em; color: #fff;
  text-shadow: 0 0 24px rgba(95, 227, 255, .55); }
.title span { display: inline-block; opacity: 0; transform: translateY(.25em); filter: blur(6px);
  animation: letter .7s var(--ease) forwards; }
@keyframes letter { to { opacity: 1; transform: none; filter: none; } }
.expand { margin: 10px 0 28px; font: 400 20px var(--hud); letter-spacing: .3em; color: var(--cyan-2);
  opacity: 0; animation: fade .8s 1.2s forwards; }
.intro .expand, .checks, .intro-greet { text-shadow: 0 0 6px #000, 0 0 14px #000; }
.checks { list-style: none; margin: 0 auto; padding: 0; width: min(440px, 80vw); text-align: left;
  font: 400 15px var(--body); letter-spacing: .04em; color: var(--muted); }
.checks li { display: flex; align-items: baseline; gap: 10px; padding: 3px 0; opacity: 0; animation: fade .35s forwards; }
.checks li .leader { flex: 1; border-bottom: 1px dotted rgba(95, 227, 255, .22); transform: translateY(-4px); }
.checks li .ok, .checks li .warn { font: 400 15px var(--body); }
.checks li .ok { color: var(--cyan); } .checks li .warn { color: var(--amber); }
.intro-greet { min-height: 1.5em; margin: 26px 0 0; font: 300 24px var(--body); color: #fff; opacity: 0; transition: opacity .8s; }
.intro-greet.on { opacity: 1; }
.skip { position: fixed; bottom: 28px; left: 0; right: 0; font: 400 14px var(--body); color: rgba(190, 232, 248, .35); }
/* Engage: the intro waits here until sir clicks (that click also unlocks audio) */
.engage { pointer-events: auto; justify-self: center; margin-top: 30px; padding: 14px 46px; cursor: pointer; position: relative;
  font: 400 13px var(--hud); letter-spacing: .4em; padding-left: calc(46px + .4em); color: #fff; background: rgba(95, 227, 255, .08);
  border: 1px solid var(--cyan-2); clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  animation: fade .6s forwards, breathe 2.4s 0.6s ease-in-out infinite; opacity: 0; }
.engage:hover, .engage:focus-visible { background: rgba(95, 227, 255, .2); outline: none; }
@keyframes breathe { 50% { box-shadow: 0 0 26px rgba(95, 227, 255, .35); background: rgba(95, 227, 255, .14); } }
@keyframes fade { to { opacity: 1; } }

/* the stage: everything Jarvis says */
/* top/bottom keep the answer clear of the HUD corners: overflow clips here, never under the gauges */
.stage { position: fixed; z-index: 2; left: 53%; right: 5vw; top: 108px; bottom: 112px; display: flex; flex-direction: column;
  justify-content: safe center; gap: 16px; padding: 0; overflow: hidden; opacity: 1; transition: opacity 1s .5s var(--ease); }
[data-phase="boot"] .stage { opacity: 0; transition: none; }
.status { display: flex; align-items: center; gap: 12px; margin: 0; font: 400 14px var(--hud); letter-spacing: .06em; color: var(--cyan-2); }
.status .dot { width: 7px; height: 7px; background: var(--cyan-2); box-shadow: 0 0 10px var(--cyan); }
[data-mode="armed"] .status, [data-mode="listening"] .status { color: var(--amber); }
[data-mode="armed"] .status .dot, [data-mode="listening"] .status .dot { background: var(--amber); box-shadow: 0 0 14px var(--amber); animation: blink .9s steps(2) infinite; }
[data-mode="thinking"] .status .dot { animation: blink .4s steps(2) infinite; }
@keyframes blink { 50% { opacity: .15; } }

.greeting { margin: 0; font: 300 clamp(28px, 3.8vw, 60px)/1.1 var(--body); color: #fff; }
.hint { margin: 12px 0 0; color: var(--muted); font-size: 17px; }
.hint em { color: var(--text); font-style: normal; }
.link { display: flex; gap: 22px; align-items: center; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--cyan-3); }
.qr { width: 132px; height: 132px; background: #fff; padding: 0; image-rendering: pixelated; outline: 1px solid var(--cyan-2); outline-offset: 6px; }

.talk { display: grid; gap: 6px; }
.query { margin: 0 0 12px; font: 300 clamp(18px, min(1.6vw, 2.6vh), 26px)/1.35 var(--body); color: var(--muted); }
.jarvis-label { color: var(--cyan); }
.reply { margin: 0; font: 300 clamp(22px, min(2.2vw, 3.6vh), 36px)/1.28 var(--body); color: #fff; min-height: 1.3em; }
.reply .w { opacity: 0; filter: blur(4px); transition: opacity .35s, filter .35s; }
.reply .w.on { opacity: 1; filter: none; }
[data-mode="thinking"] .query { color: var(--text); }
.typing::after { content: ""; display: inline-block; width: .55em; height: 2px; margin-left: 2px; background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan); animation: blink .8s steps(2) infinite; }

/* evidence photo in a HUD frame */
/* photo on the left, other matches / route steps in a column beside it, so the whole answer fits */
.evidence { margin: 4px 0 0; animation: rise .8s var(--ease); display: grid; grid-template-columns: auto auto;
  justify-content: start; column-gap: 16px; align-items: start; }
.evidence .frame, .evidence figcaption { grid-column: 1; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
/* sized by the screen height too, so question + answer + photo always fit */
.frame { position: relative; width: min(100%, 520px, 40vh); aspect-ratio: 16 / 10; background: #000; overflow: hidden; }
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.85) contrast(1.05); }
.frame::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(95, 227, 255, .05) 0 1px, transparent 1px 3px), linear-gradient(rgba(10, 40, 50, .15), rgba(10, 40, 50, .15)); }
.c { position: absolute; width: 18px; height: 18px; border: 2px solid var(--amber); z-index: 1; }
.c.tl { top: 8px; left: 8px; border-right: 0; border-bottom: 0; } .c.tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.c.bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; } .c.br { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.tag { position: absolute; z-index: 1; top: 14px; left: 34px; font: 400 13px/1.6 var(--hud); letter-spacing: .04em; color: #111; background: var(--amber); padding: 2px 10px; }
.reticle { position: absolute; z-index: 1; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; border: 1px solid rgba(255, 176, 64, .7); border-radius: 50%; }
.reticle::before, .reticle::after { content: ""; position: absolute; background: rgba(255, 176, 64, .7); }
.reticle::before { left: 50%; top: -10px; bottom: -10px; width: 1px; } .reticle::after { top: 50%; left: -10px; right: -10px; height: 1px; }
.evidence figcaption { margin-top: 8px; font: 400 15px var(--body); color: var(--muted); }
.cands, .route { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0;
  list-style: none; max-height: calc(min(520px, 40vh) / 1.6 + 30px); overflow-y: auto; }
.cands:empty, .route:empty { display: none; }
.cands, .route { scrollbar-width: thin; scrollbar-color: var(--cyan-3) transparent; }
.cands button, .route li { all: unset; cursor: pointer; display: grid; grid-template-columns: 84px 1fr; gap: 10px; align-items: center;
  width: 230px; font: 400 13px/1.25 var(--body); color: var(--muted); }
.cands img, .route img { display: block; width: 84px; height: 52px; object-fit: cover; outline: 1px solid var(--cyan-3); }
.cands button[aria-pressed="true"] img { outline: 2px solid var(--amber); }

/* type-to-Jarvis line */
.cmd { position: fixed; z-index: 4; left: 53%; right: 5vw; bottom: 64px; display: flex; gap: 12px; align-items: center;
  border-bottom: 1px solid var(--cyan-2); padding: 8px 0; font: 300 22px var(--body); color: var(--cyan); }
.cmd input { flex: 1; background: none; border: 0; outline: 0; color: #fff; font: inherit; }
.cmd input::placeholder { color: rgba(190, 232, 248, .3); }

.qr-overlay { position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; background: rgba(0, 4, 8, .92); }
.qr-overlay[hidden] { display: none; }
.qr-card { display: grid; justify-items: center; gap: 18px; text-align: center; }
.qr.big { width: min(56vh, 420px); height: min(56vh, 420px); }

.toast { position: fixed; z-index: 10; left: 50%; bottom: 64px; transform: translateX(-50%); padding: 8px 18px;
  font: 400 14px var(--body); color: #111; background: var(--cyan); }

@media (prefers-reduced-motion: reduce) {
  .atmos::after { animation: none; } .reactor-wrap { transition: none; }
}

/* ---------- the walkthrough ---------- */
.guide-open { all: unset; cursor: pointer; margin-top: 26px; align-self: flex-start; display: inline-block; padding: 11px 26px 11px calc(26px + .3em);
  font: 400 13px var(--hud); letter-spacing: .12em; color: #fff; border: 1px solid var(--cyan-2); background: rgba(95, 227, 255, .07);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.guide-open:hover, .guide-open:focus-visible { background: rgba(95, 227, 255, .18); }
.guide { display: grid; gap: 18px; animation: rise .6s var(--ease); }
.guide-count { margin-left: 10px; color: var(--muted); letter-spacing: .1em; }
.guide-rail { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.guide-rail li { flex: 1; height: 3px; background: rgba(95, 227, 255, .16); position: relative; cursor: pointer; }
.guide-rail li.done { background: var(--cyan-2); }
.guide-rail li.current { background: var(--amber); box-shadow: 0 0 10px rgba(255, 176, 64, .6); }
.guide-step { display: grid; gap: 10px; min-height: 0; }
.guide-title { margin: 0; font: 300 clamp(30px, min(3vw, 5vh), 48px)/1.1 var(--body); color: #fff; }
.guide-body { margin: 0; max-width: 34em; font: 300 clamp(17px, min(1.4vw, 2.4vh), 21px)/1.45 var(--body); color: var(--text); }
.guide-say { margin: 4px 0 0; padding: 10px 14px; border-left: 2px solid var(--amber); background: rgba(255, 176, 64, .06);
  font: 400 clamp(17px, min(1.4vw, 2.4vh), 21px)/1.35 var(--body); color: #fff; max-width: 30em; }
.guide-step .qr { width: min(150px, 18vh); height: min(150px, 18vh); margin-top: 6px; }
.guide-nav { display: flex; gap: 10px; }
.guide-nav button { all: unset; cursor: pointer; padding: 8px 16px; font: 400 13px var(--hud); letter-spacing: .08em; color: var(--text);
  border: 1px solid rgba(95, 227, 255, .3); }
.guide-nav button:hover, .guide-nav button:focus-visible { border-color: var(--cyan); color: #fff; }
.guide-nav button.ghost { border-color: transparent; color: var(--muted); }
.guide-nav button:disabled { opacity: .3; cursor: default; }

/* Commands: the key list */
.idle-actions { display: flex; gap: 12px; margin-top: 26px; }
.idle-actions .guide-open { margin-top: 0; }
.guide-open.subtle { border-color: rgba(95, 227, 255, .3); background: transparent; color: var(--text); }
.keys-overlay { position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; background: rgba(0, 4, 8, .82); animation: fade .25s forwards; }
.keys-card { min-width: min(520px, 90vw); padding: 28px 34px; display: grid; gap: 18px; background: #06141c; border: 1px solid rgba(95, 227, 255, .3);
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px); }
.keys-list { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 12px 22px; align-items: center; }
.keys-list dt { justify-self: start; min-width: 2.6em; text-align: center; padding: 5px 9px; font: 400 13px var(--hud); letter-spacing: .04em; color: #fff;
  border: 1px solid var(--cyan-2); background: rgba(95, 227, 255, .07); }
.keys-list dd { margin: 0; font: 300 17px var(--body); color: var(--text); }
