/* CEALIOMAR · styles — a blue/black/white 8-bit world with DOS + Windows 3.1 chrome */

:root {
  /* one ramp, black to white: every colour on the site is one of these */
  --void: #07061a; --shade: #0b0928; --night: #0e0b33; --ink: #110d3d; --dusk: #140f4a;
  --deep: #1b1566; --indigo: #2f23b8; --blue: #4b3cf5; --peri: #8f86ff; --lilac: #c9c4ff; --white: #f5f3ff;
  --f-ui: "Silkscreen", ui-monospace, "Courier New", monospace;
  --f-dos: "VT323", ui-monospace, "Courier New", monospace;
  --f-read: "IBM Plex Mono", ui-monospace, "Courier New", monospace; /* long-form text inside windows */
  /* Silkscreen is drawn on an 8px grid: 12px and 16px land on whole screen pixels on 2× displays,
     the in-between sizes do not. Small labels are 12px everywhere. */
  --t-label: 12px;
  --hud-h: 64px;
  --scale: 4;
  --ground: 70vh;
  --sky-safe: 55vh;
  --title-top: 0px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--void); scrollbar-width: none; -webkit-text-size-adjust: 100%; height: 100%; overflow: hidden; }
html::-webkit-scrollbar { display: none; }
body {
  margin: 0; background: var(--void); color: var(--lilac);
  font: 20px/1.1 var(--f-dos);
  cursor: var(--cursor, auto);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: none;
  height: 100%; overflow: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button, a, label, .quest input { cursor: var(--cursor-hand, pointer); }
a { color: inherit; }
p, h1, h2, dl, dd, ol, ul, fieldset { margin: 0; }
::selection { background: var(--blue); color: var(--white); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }

.skip {
  position: fixed; left: 12px; top: -80px; z-index: 60;
  background: var(--white); color: var(--void); text-decoration: none;
  font: 700 12px/1 var(--f-ui); padding: 12px 14px;
}
.skip:focus { top: 12px; }
.nojs { position: fixed; inset: auto 16px 16px; z-index: 70; display: grid; gap: 10px; background: var(--white); color: var(--void); padding: 16px; font: 15px/1.5 var(--f-read); }

/* pixel frame: 4 offset shadows leave the corners notched, like a sprite border */
.pxframe, .win, .btn {
  --fc: var(--white);
  box-shadow: 0 -4px 0 0 var(--fc), 0 4px 0 0 var(--fc), -4px 0 0 0 var(--fc), 4px 0 0 0 var(--fc);
}

/* small pixel icons */
.ic { width: 1em; height: 1em; fill: currentColor; shape-rendering: crispEdges; flex: none; }
span.ic { display: inline-block; line-height: 0; }
span.ic svg { display: block; width: 100%; height: 100%; }
/* a square pixel between two labels (the pixel font has no middle dot) */
.dot { display: inline-block; width: 4px; height: 4px; margin: 0 .6em; background: currentColor; vertical-align: .2em; }

/* ================================================================ stage
   The page itself never scrolls: the stage is fixed, and walking moves the world. */
.scroller {
  position: fixed; inset: 0; overflow: hidden; overscroll-behavior: none; touch-action: none; outline: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.stage { position: sticky; top: 0; height: 100%; overflow: hidden; background: var(--void); }
#world { position: absolute; left: 0; top: 0; display: block; image-rendering: crisp-edges; image-rendering: pixelated; }
.hero-layer { position: absolute; left: 0; top: 0; z-index: 1; display: block; pointer-events: none; } /* Ali, drawn at screen resolution */
.fx {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(7, 6, 26, .2) 0 1px, transparent 1px calc(var(--scale) * 1px)),
    radial-gradient(130% 95% at 50% 42%, transparent 58%, rgba(7, 6, 26, .6) 100%);
}
/* hitting a block: the picture drops one pixel for a moment */
.stage.is-thump #world, .stage.is-thump .hero-layer { animation: thump .16s linear; }
@keyframes thump {
  0%, 55% { transform: translateY(calc(var(--scale) * 1px)); }
  56%, 100% { transform: none; }
}
/* opening the prize: one bright frame that fades in steps */
.stage.is-flash .fx { animation: flash .5s steps(5) both; }
@keyframes flash { from { background-color: rgba(245, 243, 255, .5); } to { background-color: rgba(245, 243, 255, 0); } }

/* ================================================================ title in the sky */
.title {
  position: absolute; left: 0; top: max(calc(var(--hud-h) + clamp(12px, 5vh, 64px)), var(--title-top)); z-index: 3;
  translate: -50% 0; width: max-content; max-width: 94vw; text-align: center;
  pointer-events: none; will-change: transform, opacity;
}
.title__kicker { font: 700 var(--t-label)/1 var(--f-ui); letter-spacing: .2em; color: var(--peri); margin-bottom: clamp(12px, 2.4vh, 22px); text-shadow: 2px 2px 0 var(--void); }
.title__h { display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 2.2vh, 22px); font-weight: 400; margin: 0; }
/* sized by the width of the screen, and held back by its height: a short window must still fit the whole title in the sky */
.px { --px: clamp(4px, min(.85vw, 1.1vh), 9px); display: block; }
.px--big { --px: clamp(5px, min(1.72vw, 2.1vh), 17px); }
.pxt { display: inline-flex; align-items: flex-end; }
.pxt__ch { display: block; margin-right: var(--px); }
.pxt__ch:last-child { margin-right: 0; }
.pxt__sp { width: calc(var(--px) * 2); height: 1px; }
.pxt svg { display: block; overflow: visible; }
.pxt__fg { fill: var(--white); }
.pxt__sh { fill: var(--blue); }
.pxt__ac { fill: var(--peri); }
.px--big .pxt__sh { fill: var(--indigo); }
.px--big .pxt__ac { fill: var(--blue); }
.title__sub {
  font-size: clamp(20px, min(1.9vw, 3.2vh), 26px); line-height: 1.05; color: var(--lilac);
  max-width: 30ch; margin: clamp(14px, 2.6vh, 26px) auto 0; text-shadow: 2px 2px 0 var(--void);
}
.title__hint { font: 700 var(--t-label)/1 var(--f-ui); letter-spacing: .18em; color: var(--white); margin-top: clamp(14px, 3vh, 30px); text-shadow: 2px 2px 0 var(--void); }

.title .pxt__ch, .title__kicker, .title__sub, .title__hint { opacity: 0; }
.is-started .title .pxt__ch { animation: drop .6s steps(6) both; animation-delay: calc(.35s + var(--i) * 55ms); }
.is-started .title .px--big .pxt__ch { animation-delay: calc(.95s + var(--i) * 70ms); }
.is-started .title__kicker { animation: fade .3s steps(3) .15s both; }
.is-started .title__sub { animation: fade .4s steps(4) 1.75s both; }
.is-started .title__hint { animation: fade .4s steps(4) 2.1s both; }
@keyframes drop {
  0% { opacity: 0; transform: translateY(-140%); }
  50% { opacity: 1; transform: translateY(12%); }
  75% { transform: translateY(-6%); }
  100% { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ================================================================ speech bubbles: warp pipes, the prize */
.pipe-tag, .prize-hint {
  --bg: var(--white);
  position: absolute; left: 0; top: 0; z-index: 3; translate: -50% -100%;
  font: 700 var(--t-label)/1 var(--f-ui); letter-spacing: .1em; color: var(--void); background: var(--bg);
  white-space: nowrap;
  box-shadow: 0 -3px 0 var(--bg), 0 3px 0 var(--bg), -3px 0 0 var(--bg), 3px 0 0 var(--bg), 6px 6px 0 var(--void);
}
.pipe-tag::before, .pipe-tag::after, .prize-hint::before, .prize-hint::after {
  content: ""; position: absolute; left: calc(50% + var(--arrow, 0px)); translate: -50% 0; background: var(--bg);
}
.pipe-tag::before, .prize-hint::before { top: calc(100% + 3px); width: 12px; height: 3px; }
.pipe-tag::after, .prize-hint::after { top: calc(100% + 6px); width: 6px; height: 3px; }
.pipe-tag:hover, .pipe-tag:focus-visible, .prize-hint:hover, .prize-hint:focus-visible { --bg: var(--peri); }
.pipe-tag:active, .prize-hint:active { translate: -50% calc(-100% + 2px); }

.pipe-tag { display: flex; align-items: center; gap: 6px; padding: 7px 9px 6px; text-decoration: none; visibility: hidden; }
.pipe-tag.is-visible { visibility: visible; }

.prize-hint { display: none; flex-direction: column; align-items: center; gap: 7px; padding: 9px 11px 7px; border: 0; }
.prize-hint.is-visible { display: flex; }
.prize-hint__t { font-size: 16px; color: var(--blue); }
.prize-hint:hover .prize-hint__t, .prize-hint:focus-visible .prize-hint__t { color: var(--void); } /* blue on periwinkle would be too faint */

/* ================================================================ the coach: a nudge in the soil under Ali */
.coach {
  position: absolute; left: 50%; top: calc(var(--ground) + (100% - var(--ground)) / 2); z-index: 3;
  translate: -50% -50%; display: grid; gap: 9px; justify-items: center;
  font: 700 var(--t-label)/1 var(--f-ui); letter-spacing: .16em; color: var(--white); text-shadow: 2px 2px 0 var(--void);
  white-space: nowrap; pointer-events: none;
  visibility: hidden; opacity: 0; transition: opacity .3s steps(3), visibility 0s .3s;
}
.coach.is-on { visibility: visible; opacity: 1; transition: opacity .3s steps(3); }
.coach__next { color: var(--peri); }
.coach__next:empty { display: none; }

/* ================================================================ CONTACT, in reach for the whole walk */
.pocket {
  --bg: var(--white);
  position: absolute; z-index: 4; right: max(16px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 8px; border: 0; padding: 10px 12px 9px;
  font: 700 var(--t-label)/1 var(--f-ui); letter-spacing: .12em; color: var(--void); background: var(--bg);
  box-shadow: 0 -3px 0 var(--bg), 0 3px 0 var(--bg), -3px 0 0 var(--bg), 3px 0 0 var(--bg), 6px 6px 0 var(--void);
}
.pocket[hidden], .pocket.is-away { display: none; }
.pocket--log { right: auto; left: max(16px, env(safe-area-inset-left)); } /* only with ?wheel in the address */
.pocket .ic { width: 14px; height: 11px; }
.pocket:hover, .pocket:focus-visible { --bg: var(--peri); }
.pocket:active { translate: 0 2px; }
.pocket.is-new { animation: pop .5s steps(5) both; }
@keyframes pop {
  0% { transform: translateY(24px); opacity: 0; }
  60% { transform: translateY(-6px); opacity: 1; }
  100% { transform: none; }
}

/* ================================================================ windows (Win 3.1 chrome, DOS body) */
.wins { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.win {
  position: absolute; top: calc(var(--hud-h) + 22px); right: max(28px, 5vw);
  width: min(540px, 46vw);
  max-height: calc(var(--ground) - var(--hud-h) - 44px);
  display: flex; flex-direction: column;
  background: var(--night); color: var(--lilac);
  visibility: hidden; pointer-events: none;
  -webkit-user-select: text; user-select: text;
  box-shadow:
    0 -4px 0 0 var(--white), 0 4px 0 0 var(--white), -4px 0 0 0 var(--white), 4px 0 0 0 var(--white),
    8px 4px 0 0 var(--void), 8px 12px 0 0 var(--void), 4px 8px 0 0 var(--void), 12px 8px 0 0 var(--void);
}
.win.is-open { visibility: visible; pointer-events: auto; animation: win-open .3s steps(6) both; }
.win.is-closing { visibility: visible; animation: win-close .15s steps(4) both; }
@keyframes win-open {
  from { clip-path: inset(48% 48% 48% 48%); }
  to { clip-path: inset(-24px -24px -24px -24px); }
}
@keyframes win-close {
  from { clip-path: inset(-24px -24px -24px -24px); }
  to { clip-path: inset(48% 48% 48% 48%); }
}
.win__bar {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 6px;
  background: var(--blue); color: var(--white); border-bottom: 4px solid var(--white);
  font: 700 12px/1 var(--f-ui); letter-spacing: .08em;
}
.win__sys { position: relative; width: 22px; height: 18px; flex: none; background: var(--lilac); box-shadow: inset -2px -2px 0 var(--peri), inset 2px 2px 0 var(--white); }
.win__sys::after { content: ""; position: absolute; left: 5px; right: 5px; top: 7px; height: 3px; background: var(--void); }
.win__title { flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win__x {
  position: relative; display: grid; place-items: center; width: 22px; height: 18px; flex: none; padding: 0; border: 0;
  background: var(--lilac); color: var(--void);
  box-shadow: inset -2px -2px 0 var(--peri), inset 2px 2px 0 var(--white);
}
.win__x .ic { width: 8px; height: 8px; }
.win__x::after { content: ""; position: absolute; inset: -12px; } /* a finger-sized target around a Win 3.1-sized button */
.win__x:hover { background: var(--white); }
.win__x:active { box-shadow: inset 2px 2px 0 var(--peri); }
.win__body {
  padding: 16px 18px 20px; overflow: auto; overscroll-behavior: contain; touch-action: pan-y;
  scrollbar-width: thin; scrollbar-color: var(--blue) var(--night);
}
.screen { position: relative; background: var(--void); box-shadow: 0 0 0 2px var(--indigo); margin: 2px 2px 16px; }
.screen canvas {
  display: block; margin: 0 auto; width: 100%; height: auto; aspect-ratio: 2 / 1; /* app.js gives it a pixel-exact size */
  image-rendering: crisp-edges; image-rendering: pixelated;
}
.screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(7, 6, 26, .22) 0 1px, transparent 1px 4px);
}
.win .win__kicker { font: 700 var(--t-label)/1.2 var(--f-ui); letter-spacing: .14em; color: var(--peri); margin-bottom: 8px; text-transform: uppercase; }
.win h2 { font: 700 24px/1.05 var(--f-ui); color: var(--white); margin: 0 0 10px; text-transform: uppercase; letter-spacing: .02em; }
.win p { font: 15px/1.6 var(--f-read); color: var(--lilac); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin-top: 14px; }
.tags li {
  font: 700 var(--t-label)/1 var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--white);
  background: var(--deep); padding: 5px 7px 4px;
  box-shadow: 0 -2px 0 var(--indigo), 0 2px 0 var(--indigo), -2px 0 0 var(--indigo), 2px 0 0 var(--indigo);
}
.stats { display: grid; gap: 6px; margin-top: 14px; }
.stats div { display: grid; grid-template-columns: 84px 1fr; gap: 10px; align-items: baseline; }
.stats dt { font: 700 var(--t-label)/1 var(--f-ui); letter-spacing: .12em; color: var(--peri); }
.stats dd { margin: 0; font: 500 14px/1.4 var(--f-read); color: var(--white); }
.about { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.about__text { min-width: 0; }
.about__pic { width: 128px; height: 128px; flex: none; background: var(--void); box-shadow: 0 0 0 2px var(--indigo), 0 0 0 6px var(--night); }
.about__pic canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }

/* ---------- contact window */
.win--contact { width: min(600px, 50vw); top: calc(var(--hud-h) + 10px); max-height: calc(100% - var(--hud-h) - 40px); }
.win__clear { margin: 4px 0 14px !important; }
.px--win { --px: clamp(4px, .55vw, 6px); }
.win--contact.is-open .pxt__ch { animation: drop .5s steps(5) both; animation-delay: calc(.2s + var(--i) * 40ms); }
.win__lead { margin-bottom: 4px; }
.form { display: grid; gap: 12px; margin-top: 12px; }
.form[hidden], .form__hp { display: none; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quest { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; }
.quest legend, .field label {
  font: 700 var(--t-label)/1 var(--f-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--peri); padding: 0;
}
.quest legend { margin-bottom: 10px; float: left; width: 100%; }
.quest label { position: relative; display: inline-flex; }
.quest input { position: absolute; inset: 0; opacity: 0; margin: 0; }
.quest span {
  font: 700 var(--t-label)/1 var(--f-ui); letter-spacing: .06em; text-transform: uppercase;
  padding: 7px 9px 6px; background: var(--deep); color: var(--lilac);
  box-shadow: 0 -2px 0 var(--indigo), 0 2px 0 var(--indigo), -2px 0 0 var(--indigo), 2px 0 0 var(--indigo);
}
.quest label:hover span { color: var(--white); background: var(--indigo); }
.quest label:active span { translate: 0 2px; }
.quest input:checked + span {
  background: var(--white); color: var(--void);
  box-shadow: 0 -2px 0 var(--white), 0 2px 0 var(--white), -2px 0 0 var(--white), 2px 0 0 var(--white);
}
.quest input:focus-visible + span { outline: 3px solid var(--peri); outline-offset: 4px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field input, .field textarea {
  width: 100%; border: 0; border-radius: 0; padding: 9px 11px 7px;
  background: var(--void); color: var(--white); font: 15px/1.4 var(--f-read);
  box-shadow: inset 0 0 0 2px var(--indigo); caret-color: var(--peri);
  -webkit-user-select: text; user-select: text;
}
.field textarea { resize: vertical; min-height: 70px; }
.field input::placeholder, .field textarea::placeholder { color: var(--peri); opacity: 1; }
.field input:hover, .field textarea:hover { box-shadow: inset 0 0 0 2px var(--blue); }
.field input:focus, .field textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--white); }
.field.has-error input, .field.has-error textarea { box-shadow: inset 0 0 0 2px var(--lilac); background: var(--dusk); }
.field__err:empty { display: none; }
.field__err { font: 500 12px/1.35 var(--f-read) !important; color: var(--white) !important; min-height: 0; }
.field__err:not(:empty)::before { content: "! "; font-weight: 600; color: var(--peri); }
.form__send { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
/* after pressing send: the form steps aside for what happens next */
.sent { display: grid; gap: 12px; margin-top: 14px; padding: 14px; background: var(--dusk); box-shadow: 0 0 0 2px var(--indigo); }
.sent[hidden] { display: none; }
.sent__t { display: flex; align-items: center; gap: 10px; font: 700 16px/1.1 var(--f-ui) !important; letter-spacing: .04em; text-transform: uppercase; color: var(--white) !important; outline: none; }
.sent__t .ic { width: 18px; height: 14px; }
.sent:not([hidden]) .sent__t .ic { animation: pop .5s steps(5) both; }
.sent__row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin: 4px 4px 0; }
.sent__row .btn { text-decoration: none; }
.sent__row [hidden] { display: none; }
.sent__row .linkish { margin-left: 0; font: 700 var(--t-label)/1 var(--f-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--white); }
.sent__note { font-size: 13px !important; line-height: 1.5 !important; color: var(--lilac) !important; overflow-wrap: anywhere; }
.sent__note a { color: var(--white); text-decoration: none; border-bottom: 2px solid var(--blue); }
.sent__note a:hover { color: var(--peri); border-color: var(--peri); }
.btn {
  --fc: var(--white);
  border: 0; padding: 12px 16px 10px; background: var(--blue); color: var(--white);
  font: 700 var(--t-label)/1 var(--f-ui); letter-spacing: .1em; text-transform: uppercase;
  box-shadow:
    0 -4px 0 0 var(--fc), 0 4px 0 0 var(--fc), -4px 0 0 0 var(--fc), 4px 0 0 0 var(--fc),
    inset 0 -4px 0 var(--indigo), inset 0 4px 0 var(--peri);
}
.btn:hover { background: var(--white); color: var(--void); }
.btn:disabled { background: var(--indigo); color: var(--lilac); cursor: var(--cursor, auto); }
.btn:active { translate: 0 2px; box-shadow: 0 -4px 0 0 var(--fc), 0 4px 0 0 var(--fc), -4px 0 0 0 var(--fc), 4px 0 0 0 var(--fc), inset 0 4px 0 var(--indigo); }
.win__foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  margin-top: 18px; padding-top: 14px; border-top: 2px dashed var(--deep);
  font: 700 var(--t-label)/1 var(--f-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--peri);
}
.win__foot a, .linkish {
  display: inline-flex; align-items: center; gap: 6px; color: var(--white); text-decoration: none;
  background: none; border: 0; padding: 4px 0; font: inherit; letter-spacing: inherit; text-transform: inherit;
  border-bottom: 2px solid var(--blue);
}
.win__foot a:hover, .linkish:hover { color: var(--peri); border-color: var(--peri); }
.win__foot a:active, .linkish:active { translate: 0 1px; }
.linkish { margin-left: auto; }

/* ================================================================ HUD */
.hud {
  position: fixed; left: 0; right: 0; top: 0; z-index: 5; height: var(--hud-h);
  display: flex; align-items: flex-start; gap: clamp(14px, 3vw, 44px);
  padding: 14px max(clamp(14px, 3vw, 36px), env(safe-area-inset-right)) 0 max(clamp(14px, 3vw, 36px), env(safe-area-inset-left));
  font-family: var(--f-ui); text-shadow: 2px 2px 0 var(--void); pointer-events: none;
}
.hud__cell { display: flex; flex-direction: column; gap: 5px; white-space: nowrap; }
.hud__k { font-size: var(--t-label); letter-spacing: .14em; color: var(--peri); }
.hud__v { display: inline-flex; align-items: center; gap: 4px; font-size: 16px; font-weight: 700; letter-spacing: .06em; color: var(--white); }
.hud__v .ic { width: 12px; height: 12px; }
.is-bump { animation: bump .25s steps(3); }
@keyframes bump { 50% { transform: translateY(-3px); color: var(--peri); } }
.hud__btns { margin-left: auto; display: flex; align-items: center; gap: 12px; pointer-events: auto; }
.btn-mini {
  position: relative; display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 8px 10px 7px;
  font: 700 var(--t-label)/1 var(--f-ui); letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  color: var(--white); background: var(--deep); text-shadow: none;
  box-shadow: 0 -2px 0 var(--indigo), 0 2px 0 var(--indigo), -2px 0 0 var(--indigo), 2px 0 0 var(--indigo);
}
.btn-mini .ic { width: 10px; height: 12px; }
.btn-mini--cta { background: var(--white); color: var(--void); box-shadow: 0 -2px 0 var(--white), 0 2px 0 var(--white), -2px 0 0 var(--white), 2px 0 0 var(--white); }
.btn-mini:hover, .btn-mini:focus-visible { background: var(--blue); color: var(--white); }
.btn-ic {
  position: relative; display: inline-grid; place-items: center; width: 30px; height: 26px; padding: 0; border: 0;
  color: var(--white); background: var(--deep); text-decoration: none; text-shadow: none;
  box-shadow: 0 -2px 0 var(--indigo), 0 2px 0 var(--indigo), -2px 0 0 var(--indigo), 2px 0 0 var(--indigo);
}
.btn-ic .ic { width: 14px; height: 13px; }
.btn-ic:hover, .btn-ic:focus-visible { background: var(--blue); }
.btn-mini:active, .btn-ic:active { translate: 0 2px; }
.btn-mini::after, .btn-ic::after { content: ""; position: absolute; inset: -10px -4px; } /* easier to hit with a thumb */
.btn-ic--sound .ic__wave { opacity: 0; }
.btn-ic--sound[aria-pressed="true"] { background: var(--indigo); }
.btn-ic--sound[aria-pressed="true"]:hover { background: var(--blue); }
.btn-ic--sound[aria-pressed="true"] .ic__wave { opacity: 1; }
.btn-ic--sound[aria-pressed="true"] .ic__off { opacity: 0; }

/* ---------- Ali's badge: a fixed square slot, so swapping the portrait never moves the HUD */
.logo {
  position: relative; flex: none; display: block; width: 64px; height: 64px; margin: -8px 0 0;
  pointer-events: auto; transition: translate .12s steps(2);
}
.logo:hover, .logo:focus-visible { translate: 0 -2px; }
.logo:active { translate: 0 0; }
.logo__img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; opacity: 0; will-change: transform, opacity; }
.logo__img.is-on { opacity: 1; }
/* a pixel spark on the corner when the portrait changes */
.logo__spark {
  position: absolute; right: -3px; top: -3px; width: 3px; height: 3px; background: var(--white); opacity: 0; pointer-events: none;
  box-shadow: 0 -3px 0 var(--white), 0 3px 0 var(--white), -3px 0 0 var(--white), 3px 0 0 var(--white), 0 -6px 0 var(--peri), 0 6px 0 var(--peri), -6px 0 0 var(--peri), 6px 0 0 var(--peri);
}
.logo.is-changed .logo__spark { animation: spark .42s steps(4) both; }
@keyframes spark {
  0% { opacity: 0; transform: scale(.4); }
  30% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.2) rotate(45deg); }
}

/* ================================================================ boot (blue DOS/BIOS CRT, same palette as the world) */
.boot { position: fixed; inset: 0; z-index: 40; display: grid; padding: clamp(0px, 2vw, 22px); background: var(--void); }
.boot[hidden] { display: none; }
.boot__screen {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding: clamp(16px, 3vw, 40px);
  /* the glow in the middle is the ramp's own blue, laid thinly over indigo */
  background:
    radial-gradient(120% 100% at 50% 40%, rgba(75, 60, 245, .38) 0%, rgba(75, 60, 245, 0) 55%),
    radial-gradient(120% 100% at 50% 40%, var(--indigo) 0%, var(--indigo) 55%, var(--deep) 100%);
  color: var(--white); border-radius: clamp(0px, 2vw, 26px);
  box-shadow: inset 0 0 0 3px var(--blue), inset 0 0 90px rgba(7, 6, 26, .55);
  text-shadow: 0 0 6px rgba(201, 196, 255, .35);
}
.boot__screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(7, 6, 26, .2) 0 1px, transparent 1px 3px);
}
.boot__top { display: flex; justify-content: space-between; align-items: center; font: 700 var(--t-label)/1 var(--f-ui); letter-spacing: .14em; color: var(--white); }
.boot__sound { position: relative; z-index: 1; background: none; border: 0; padding: 6px 0; color: var(--white); font: inherit; letter-spacing: inherit; text-shadow: inherit; }
.boot__sound:hover { color: var(--lilac); }
.boot__sound:active { translate: 0 1px; }
.boot__log {
  flex: 1 1 auto; min-height: 3.4em; overflow: hidden; margin: 18px 0 12px;
  font: clamp(16px, 1.5vw, 21px)/1.12 var(--f-dos); white-space: pre-wrap; color: var(--white);
}
.boot__center { flex: none; margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-bottom: clamp(6px, 3vh, 34px); }
.boot__logo { --px: clamp(3px, 1vw, 11px); margin-bottom: 6px; }
.boot__logo .pxt__fg { fill: var(--white); }
.boot__logo .pxt__sh { fill: var(--deep); }
.boot__logo .pxt__ac { fill: var(--peri); }
.boot__runner { width: min(520px, 86vw); height: auto; image-rendering: pixelated; margin-bottom: -6px; }
.boot__meter {
  width: min(520px, 86vw); height: 22px; padding: 4px; background: var(--deep);
  box-shadow: 0 -3px 0 var(--white), 0 3px 0 var(--white), -3px 0 0 var(--white), 3px 0 0 var(--white);
}
.boot__meter i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--white) 0 10px, transparent 10px 13px); }
.boot__status { width: min(520px, 86vw); display: flex; justify-content: space-between; font: 700 var(--t-label)/1 var(--f-ui); letter-spacing: .1em; color: var(--white); }
.boot__start {
  margin-top: 10px; border: 0; padding: 14px 22px 12px; background: var(--white); color: var(--void);
  font: 700 16px/1 var(--f-ui); letter-spacing: .16em; text-shadow: none; visibility: hidden;
  box-shadow: 0 -4px 0 var(--lilac), 0 4px 0 var(--lilac), -4px 0 0 var(--lilac), 4px 0 0 var(--lilac), 8px 8px 0 var(--void);
}
.boot.is-ready .boot__start { visibility: visible; animation: blink 1.1s steps(1) infinite; }
.boot__start:hover, .boot__start:focus-visible { background: var(--lilac); animation-play-state: paused; }
.boot__start:active { translate: 0 2px; }
.boot__keys { font: 700 var(--t-label)/1.7 var(--f-ui); letter-spacing: .14em; color: var(--white); text-align: center; margin-top: 2px; }
.iris { position: fixed; left: 0; top: 0; z-index: 45; pointer-events: none; image-rendering: crisp-edges; image-rendering: pixelated; }
.iris[hidden] { display: none; }

/* ================================================================ small screens */
@media (max-width: 760px) {
  :root { --hud-h: 58px; }
  .hud { gap: 12px; padding-top: 12px; }
  .hud__cell--wide { display: none; }
  .hud__v { font-size: 12px; }
  .hud__btns { gap: 10px; }
  .btn-mini { padding: 7px 8px 6px; }
  .hide-sm { display: none; }
  .logo { width: 52px; height: 52px; margin-top: -8px; }
  .win {
    left: 14px; right: 14px; width: auto; top: calc(var(--hud-h) + 8px);
    max-height: calc(var(--sky-safe) - var(--hud-h) - 8px);
  }
  .win--contact { max-height: calc(100% - var(--hud-h) - 28px); }
  .win__body { padding: 12px 14px 14px; }
  .screen { margin-bottom: 12px; }
  .win h2 { font-size: 16px; margin-bottom: 8px; }
  .win p { font-size: 14px; line-height: 1.55; }
  .about { gap: 14px; }
  .about__pic { width: 96px; height: 96px; }
  .tags { gap: 8px; margin-top: 10px; }
  .stats dd { font-size: 13px; }
  .stats div { grid-template-columns: 76px 1fr; }
  /* contact fits one phone screen: tighter rhythm, name + email side by side, smaller headline */
  .px--win { --px: 3px; }
  .win__clear { margin: 2px 0 8px !important; }
  .form { gap: 9px; margin-top: 9px; }
  .quest { gap: 8px; }
  .quest legend { margin-bottom: 7px; }
  .quest span { padding: 6px 7px 5px; }
  .field { gap: 5px; }
  .field input, .field textarea { padding: 8px 10px 7px; font-size: 14px; }
  .field textarea { min-height: 52px; }
  .btn { padding: 11px 14px 9px; }
  .win__foot { margin-top: 11px; padding-top: 9px; gap: 10px 12px; }
  .title__sub { max-width: 24ch; }
  .title__kicker { letter-spacing: .12em; }
  .pocket { padding: 9px 11px 8px; }
}
@media (max-width: 580px) { /* too narrow for the nudge and CONTACT side by side: the nudge sits above it */
  .coach { top: calc(var(--ground) + max(22px, (100% - var(--ground) - 56px) / 2)); }
}
@media (max-width: 460px) {
  .hud__cell--level { display: none; }
  .hud__btns { gap: 9px; }
  .btn-ic { width: 28px; }
}
@media (max-width: 360px) { /* small phones: the HUD links must all fit */
  .hud { gap: 8px; padding-left: 10px; padding-right: 10px; }
  .hud__btns { gap: 7px; }
  .btn-ic { width: 26px; }
  .btn-mini { padding: 7px 6px 6px; gap: 4px; }
  .logo { width: 48px; height: 48px; margin-top: -7px; }
}
@media (max-width: 335px) { /* the narrowest phones: the score makes room for the links */
  .hud__cell { display: none; }
  .win__foot { letter-spacing: .02em; gap: 10px 8px; } /* three links on one row, so the contact window still fits the screen */
}

@media (prefers-reduced-motion: reduce) {
  .title .pxt__ch, .title__kicker, .title__sub, .title__hint { opacity: 1 !important; animation: none !important; }
  .blink, .boot.is-ready .boot__start { animation: none; }
  .win.is-open, .win.is-closing, .win--contact.is-open .pxt__ch, .pocket.is-new, .is-bump, .sent:not([hidden]) .sent__t .ic { animation: none; }
  .win.is-closing { visibility: hidden; }
  .logo, .coach { transition: none; }
  .logo:hover, .logo:focus-visible { translate: none; }
  .logo.is-changed .logo__spark { animation: none; }
}
