/* Page frame in arcade dress: the scene, HUD, floor buttons, walk buttons, speech bubble,
   level card and the start screen. Hard edges, flat shadows, pixel lettering. */
:root {
  --ink: #0b0d17;
  --bg: #e9e6d8;
  --surface: #fffdf5;
  --fg: #0b0d17;
  --muted: #4b5266;
  --chip: #ece8d8;
  --accent: #2f45cf;
  --accent-fg: #ffffff;
  --spark: #d9480f;
  --gold: #ffd23f;
  --ok: #17784a;
  --edge: 3px solid var(--fg);
  --shadow: 5px 5px 0 rgba(8, 10, 20, 0.55);
  --pixel: "Press Start 2P", "Courier New", monospace;
  --game: "Pixelify Sans", "Trebuchet MS", sans-serif;
  --talk: "VT323", "Courier New", monospace; /* speech and story: every digit reads clearly */
  --body: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d17;
    --surface: #151a2c;
    --fg: #f4f1e4;
    --muted: #a3abc2;
    --chip: #232a45;
    --accent: #8d9cff;
    --accent-fg: #0b0d17;
    --spark: #ff8a4c;
    --ok: #5cc892;
    --shadow: 5px 5px 0 rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d17;
  --surface: #151a2c;
  --fg: #f4f1e4;
  --muted: #a3abc2;
  --chip: #232a45;
  --accent: #8d9cff;
  --accent-fg: #0b0d17;
  --spark: #ff8a4c;
  --ok: #5cc892;
  --shadow: 5px 5px 0 rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { background: #05060b; color: var(--fg); font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* the pixel font joins "fi" into one glyph that reads as "A" (nofire.ai became noAre.ai) */
/* on every element and marked important, because each `font:` shorthand would switch it back on */
*, *::before, *::after { font-variant-ligatures: none !important; font-feature-settings: "liga" 0, "clig" 0 !important; }
#app { position: fixed; inset: 0; margin: 0 auto; max-width: calc(100dvh * 3.05); overflow: hidden; background: var(--ink); }
#scene { position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
#view { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
/* a faint screen texture over the picture */
#scene::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.07) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 62%, rgba(0, 0, 0, 0.22) 100%);
}

/* ---- HUD ---- */
#topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px));
  pointer-events: none;
}
.brand, .actions { pointer-events: auto; background: var(--ink); color: #f4f1e4; border: 3px solid #f4f1e4; box-shadow: var(--shadow); }
.brand { display: grid; gap: 4px; padding: 8px 12px; min-width: 0; }
.brand strong { font: 10px/1.3 var(--pixel); text-transform: uppercase; white-space: nowrap; }
.brand span { font-size: 11.5px; line-height: 1.2; color: #b9c0d6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand em { font: 8px/1.3 var(--pixel); font-style: normal; text-transform: uppercase; color: var(--gold); }
.brand em.is-done { animation: blink 1s steps(2) infinite; }
.actions { display: flex; align-items: center; gap: 2px; padding: 4px; flex: none; }
.actions a, .actions button {
  all: unset; cursor: pointer; font: 500 15px/1 var(--game); color: #f4f1e4; padding: 7px 9px; white-space: nowrap;
}
.actions a:hover, .actions button:hover { background: #262c47; }
.actions .actions__book { background: var(--gold); color: var(--ink); font-weight: 700; }
.actions .actions__book:hover { background: #ffe27a; }
.actions a:focus-visible, .actions button:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }

/* ---- floor buttons ---- */
#floors {
  position: absolute; z-index: 4; right: max(12px, env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column-reverse; gap: 4px; padding: 5px;
  background: var(--ink); border: 3px solid #f4f1e4; box-shadow: var(--shadow);
}
#floors button {
  all: unset; cursor: pointer; position: relative; width: 28px; height: 28px;
  display: grid; place-items: center; font: 9px var(--pixel); color: #b9c0d6; background: #232a45;
}
#floors button:hover { color: #ffffff; background: #333c63; }
#floors button[data-seen] { box-shadow: inset 0 -4px 0 #5cc892; }
#floors button[aria-current] { background: var(--gold); color: var(--ink); }
#floors button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
#floors button::after {
  content: attr(data-name); position: absolute; right: 40px; top: 50%; transform: translateY(-50%);
  padding: 5px 9px; background: var(--ink); color: #f4f1e4; border: 2px solid #f4f1e4;
  font: 500 14px/1.1 var(--game); white-space: nowrap; opacity: 0; pointer-events: none;
}
#floors button:hover::after, #floors button:focus-visible::after { opacity: 1; }
[data-mode="intro"] #floors, [data-mode="intro"] #pad, [data-mode="intro"] #topbar { opacity: 0; pointer-events: none; }
[data-mode="intro"] #topbar > * { pointer-events: none; }

/* ---- walk and ride buttons: two arcade buttons ---- */
#pad {
  position: absolute; z-index: 4; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
}
#pad button {
  all: unset; cursor: pointer; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
  font-size: 17px; background: #e2382d; color: #ffffff; border: 3px solid var(--ink); box-shadow: 0 6px 0 #7c1711, 0 6px 0 3px var(--ink);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
#pad #pad-fwd { background: #2f6fe0; box-shadow: 0 6px 0 #173b80, 0 6px 0 3px var(--ink); }
#pad button:active { transform: translateY(5px); box-shadow: 0 1px 0 #7c1711, 0 1px 0 3px var(--ink); }
#pad #pad-fwd:active { box-shadow: 0 1px 0 #173b80, 0 1px 0 3px var(--ink); }
#pad button:disabled { filter: grayscale(1) brightness(0.8); cursor: default; }
#pad button.is-hint { animation: nudge 0.7s steps(2) infinite; outline: 4px solid var(--gold); outline-offset: 3px; }
@keyframes nudge { 50% { transform: translateY(-6px); } }
#pad button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
#pad-hint { font: 700 12px/1 var(--mono); text-transform: uppercase; color: #f4f1e4; background: var(--ink); padding: 8px 10px; border: 2px solid #f4f1e4; white-space: nowrap; }
#pad-hint:empty { display: none; }

/* ---- speech bubble ---- */
#bubble {
  position: absolute; left: 0; top: 0; z-index: 3; max-width: min(320px, 74vw); pointer-events: none; will-change: transform;
  background: #fffdf5; color: #0b0d17; border: 3px solid #0b0d17; padding: 9px 13px; box-shadow: 4px 4px 0 rgba(8, 10, 20, 0.5);
  font: 22px/1.05 var(--talk);
}
#bubble::after {
  content: ""; position: absolute; left: var(--tail, 40px); bottom: -11px; width: 16px; height: 16px; margin-left: -8px;
  background: #fffdf5; border-right: 3px solid #0b0d17; border-bottom: 3px solid #0b0d17; transform: rotate(45deg);
}
.bubble__rest { visibility: hidden; }
/* which line this is, on a tab at the bubble's corner */
.bubble__step { position: absolute; right: -3px; top: -18px; padding: 4px 6px 3px; background: #0b0d17; color: #ffd23f; font: 8px/1 var(--pixel); }
.bubble__step:empty { display: none; }
/* a new line: the old bubble is gone for a beat, then the new one hops up into place */
#bubble.is-in { animation: bubble-in 0.46s linear; }
@keyframes bubble-in {
  0%, 38% { opacity: 0; translate: 0 12px; }
  39% { opacity: 1; translate: 0 12px; }
  70% { opacity: 1; translate: 0 -4px; }
  100% { opacity: 1; translate: 0 0; }
}

/* ---- level card shown on arrival ---- */
#stage {
  position: absolute; z-index: 3; left: 50%; top: 20%; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center;
  padding: 14px 20px; background: var(--ink); border: 3px solid var(--gold); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; text-transform: uppercase; text-align: center; white-space: nowrap;
}
#stage b { font: 22px/1 var(--pixel); color: var(--gold); }
#stage span { font: 10px/1.4 var(--pixel); color: #f4f1e4; }
#stage.is-on { animation: stage 1.7s steps(1) forwards; }
@keyframes stage { 0% { opacity: 1; } 12% { opacity: 0; } 20% { opacity: 1; } 86% { opacity: 1; } 100% { opacity: 0; } }
@keyframes blink { 50% { opacity: 0; } }

/* ---- start screen: an 8-bit title screen over the dimmed game ---- */
#intro {
  position: absolute; inset: 0; z-index: 20; display: grid; justify-items: center; align-items: safe center; padding: 40px 16px; overflow: hidden auto; scrollbar-width: none;
  /* `safe`: when the screen is too short the content starts at the top and scrolls, so the name is never cut */
  background:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 4px),
    radial-gradient(ellipse at 50% 42%, rgba(14, 20, 58, 0.86), rgba(3, 4, 10, 0.97));
  color: #f4f1e4; text-align: center; transition: opacity 0.35s steps(5), visibility 0.35s;
}
#intro.is-hidden { opacity: 0; visibility: hidden; }
/* a row of pellets along the top and bottom edges */
#intro::before, #intro::after {
  content: ""; position: absolute; left: 20px; right: 20px; height: 8px; pointer-events: none;
  background: repeating-linear-gradient(to right, #ff5fa8 0 8px, transparent 8px 28px);
}
#intro::before { top: 16px; }
#intro::after { bottom: 16px; background: repeating-linear-gradient(to right, #19e3ff 0 8px, transparent 8px 28px); }
.intro__card { width: min(820px, 100%); display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; justify-items: center; }
.attract__top { width: 100%; display: flex; justify-content: space-between; gap: 12px; font: 10px/1 var(--pixel); text-transform: uppercase; color: #ff6b5e; }
.attract__top span:nth-child(2) { color: #f4f1e4; }
.attract__top span:nth-child(3) { color: #ffd23f; }
.attract__kicker { margin-top: 10px; font: 11px/1.5 var(--pixel); text-transform: uppercase; color: #ff5fa8; }
/* neon letters with the pixel grid showing through */
.logo { display: grid; gap: 0.3em; font: clamp(22px, 6.8vw, 70px)/1 var(--pixel); text-transform: uppercase; letter-spacing: -0.03em; }
.logo span {
  color: transparent; -webkit-background-clip: text; background-clip: text;
  background-color: #19e3ff;
  background-image:
    repeating-linear-gradient(to right, transparent 0 calc(0.125em - 1px), rgba(0, 12, 30, 0.55) calc(0.125em - 1px) 0.125em),
    repeating-linear-gradient(to bottom, transparent 0 calc(0.125em - 1px), rgba(0, 12, 30, 0.55) calc(0.125em - 1px) 0.125em);
  filter: drop-shadow(0 0 14px rgba(25, 227, 255, 0.6));
}
.logo span + span { background-color: #ffd23f; filter: drop-shadow(0 0 14px rgba(255, 210, 63, 0.5)); }
.attract__title { font: clamp(12px, 2.2vw, 18px)/1 var(--pixel); text-transform: uppercase; color: #0b0d17; background: #ff5fa8; padding: 9px 14px; box-shadow: 5px 5px 0 #7a1f4d; }
.attract__role { font: clamp(11px, 1.8vw, 15px)/1.4 var(--pixel); text-transform: uppercase; color: #ff5fa8; }
.attract__story { max-width: 44ch; font: 25px/1.08 var(--talk); color: #f4f1e4; }
/* the reason to play: who took the meeting (moving right to left) and where I built it (left to right) */
.attract__proof { width: 100vw; display: grid; gap: 9px; justify-items: center; padding: 12px 0 14px; border-block: 4px solid #19e3ff; background: rgba(3, 4, 10, 0.72); }
.attract__hook { max-width: min(62ch, calc(100vw - 32px)); font: 24px/1.05 var(--talk); color: #ffd23f; text-wrap: balance; } /* even lines: no "at" alone on the last one */
/* two groups, each under its own line: who took the meeting, then where I worked */
.attract__group { width: 100%; display: grid; gap: inherit; justify-items: center; }
.attract__group--built { padding-top: 10px; border-top: 2px dashed rgba(25, 227, 255, 0.45); }
.attract__group--built .attract__hook { color: #19e3ff; }
.marquee { width: 100%; overflow: hidden; }
.marquee__run { display: flex; width: max-content; animation: marquee 120s linear infinite; }
.marquee--reverse .marquee__run { animation-direction: reverse; }
.marquee__set { display: flex; gap: 10px; padding: 0 10px 4px 0; }
.marquee__set > span[aria-hidden] { display: contents; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 7px; background: #fffdf5; color: #0b0d17; border: 2px solid #0b0d17; box-shadow: 3px 3px 0 #ff5fa8; font: 700 17px/1 var(--game); white-space: nowrap; }
/* a chip opens the company's site; the row stops while the pointer or the keyboard is on it */
a.chip { text-decoration: none; cursor: pointer; }
a.chip:hover, a.chip:focus-visible { translate: 0 -2px; background: #ffd23f; outline: 0; }
.marquee:hover .marquee__run, .marquee:focus-within .marquee__run { animation-play-state: paused; }
.chip .logo-mark { width: 20px; height: 20px; margin: 0; outline: 0; background: none; }
.chip small { font: 7px/1 var(--pixel); text-transform: uppercase; color: #a3195b; }
.chip i { font-style: normal; color: #a3195b; } /* the × between two companies on one chip */
.marquee--reverse .chip { box-shadow: 3px 3px 0 #19e3ff; }
@keyframes marquee { to { transform: translateX(-50%); } }
.start {
  all: unset; cursor: pointer; margin-top: 4px; padding: 17px 28px; background: #ffd23f; color: #0b0d17;
  font: clamp(14px, 2.6vw, 20px)/1 var(--pixel); text-transform: uppercase; border: 4px solid #0b0d17; outline: 4px solid #f4f1e4; box-shadow: 9px 9px 0 #e2382d;
}
.start span { animation: blink 1.1s steps(2) infinite; }
.start:hover span, .start:focus-visible span { animation: none; }
.start:hover { background: #ffe27a; }
.start:active { transform: translate(4px, 4px); box-shadow: 5px 5px 0 #e2382d; }
.start:focus-visible { outline-color: #19e3ff; }
.attract__keys { font: 9px/2.6 var(--pixel); text-transform: uppercase; color: #b9c0d6; }
.attract__keys kbd { font: 700 12px/1 var(--mono); color: #0b0d17; background: #f4f1e4; padding: 4px 6px; margin: 0 3px 0 10px; border-bottom: 3px solid #8b90a6; }
.attract__foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; font: 20px/1.15 var(--talk); }
.attract__foot a, .attract__foot button { all: unset; cursor: pointer; color: #b9c0d6; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.attract__foot a:hover, .attract__foot button:hover { color: #ffffff; }
.attract__foot a:focus-visible, .attract__foot button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.button {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  font: 700 16px/1 var(--game); padding: 9px 13px; background: var(--surface); color: var(--fg);
  border: 2px solid var(--fg); box-shadow: 3px 3px 0 var(--fg);
}
.button:hover { background: var(--chip); }
.button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--fg); }
.button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.button--primary, .button--primary:hover { background: var(--gold); color: var(--ink); }

/* ---- phone held upright: the scene fills the screen, the card unrolls over its upper half like a map,
   and every control sits at the bottom, under the thumb ---- */
@media (max-aspect-ratio: 4/5) {
  #scene { bottom: calc(53px + env(safe-area-inset-bottom, 0px)); }
  .brand { padding: 6px 8px; }
  .brand strong { font-size: 8px; white-space: normal; } /* the name takes two lines instead of being cut */
  .brand span, #top-email, #top-linkedin, .actions [data-plain] { display: none; }
  .actions a, .actions button { padding: 12px 7px; font-size: 14px; } /* tall enough for a thumb */
  #floors {
    /* a bar along the bottom edge, under the scene */
    z-index: 7; top: auto; bottom: 0; left: 0; right: 0; transform: none; flex-direction: row; gap: 3px;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px)); border-width: 3px 0 0; box-shadow: none;
  }
  #floors button { flex: 1; width: auto; height: 40px; font-size: 9px; }
  #bubble { max-width: calc(100vw - 24px); font-size: 20px; }
  #floors button::after { display: none; }
  #pad { left: 0; right: 0; transform: none; justify-content: space-between; padding: 0 14px; bottom: 16px; }
  #pad button { width: 56px; height: 56px; font-size: 19px; }
  #stage { display: none; } /* the unrolling card already names the level */
  #intro { padding: 44px 20px; }
  .intro__card { gap: 26px; }
  .logo { font-size: clamp(24px, 7.6vw, 40px); gap: 0.45em; }
  .attract__story { font-size: 23px; max-width: 26ch; }
  .attract__hook { font-size: 22px; }
  .intro__card { gap: 14px; }
  .start { padding: 18px 24px; font-size: 16px; }
  .attract__keys { display: none; }
  .attract__foot { flex-direction: column; align-items: center; gap: 8px; margin-top: 2px; }
}
@media (pointer: coarse) and (min-aspect-ratio: 4/5) {
  #pad { left: 0; right: 0; transform: none; justify-content: space-between; padding: 0 max(18px, env(safe-area-inset-left, 0px)); }
  #pad button { width: 58px; height: 58px; font-size: 19px; }
}
/* laptop windows that are wide but not tall: tighten the start screen so nothing is cut */
@media (max-height: 700px) and (min-aspect-ratio: 4/5) {
  #intro { padding: 32px 16px; }
  .intro__card { gap: 11px; }
  .logo { font-size: clamp(20px, 4.6vw, 48px); }
  .attract__proof { padding: 8px 0 9px; gap: 7px; }
  .attract__hook, .attract__story { font-size: 22px; }
  .start { padding: 13px 24px; }
  .attract__keys { line-height: 2; }
}
@media (max-height: 600px) and (min-aspect-ratio: 4/5) {
  #intro { padding: 28px 16px; }
  .intro__card { gap: 7px; }
  .logo { font-size: clamp(18px, 4vw, 38px); }
  .attract__proof { padding: 6px 0 7px; gap: 5px; }
  /* no room for the second line: the dashed rule and the role tags still tell the rows apart */
  .attract__group--built { padding-top: 5px; }
  .attract__group--built .attract__hook { display: none; }
  .start { padding: 11px 22px; }
}
@media (max-height: 520px) and (min-aspect-ratio: 4/5) {
  .brand span, #top-email { display: none; }
  #floors button { width: 22px; height: 22px; font-size: 7px; }
  #floors { gap: 2px; padding: 3px; }
  #intro { padding: 30px 16px; }
  .intro__card { gap: 8px; }
  .logo { font-size: clamp(18px, 4.6vw, 36px); }
  .attract__kicker { margin-top: 0; }
  .attract__role, .attract__title { display: none; }
  .attract__story { display: none; }
  .attract__proof { padding: 6px 0 8px; gap: 5px; border-block-width: 2px; }
  .attract__hook { font-size: 18px; }
  .attract__group--built { display: none; }
  .start { padding: 11px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .start span, .brand em.is-done, #pad button.is-hint, #bubble.is-in { animation: none; }
  .marquee__run { animation: none; width: auto; justify-content: center; }
  .marquee__set { flex-wrap: wrap; justify-content: center; padding: 0 16px 4px; }
  .marquee__set[aria-hidden], .marquee__set > span[aria-hidden] { display: none; }
  #stage.is-on { animation-duration: 2.4s; }
}

.icon { width: 16px; height: 16px; flex: none; margin-right: 6px; vertical-align: -3px; image-rendering: pixelated; }
.attract__foot .icon { vertical-align: -2px; }
