/* ---------- tokens ---------- */
:root {
  --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --stage: #f1f1f3;
  --dev-w: 384px;
  --dev-h: 643px;
  /* Front-face proportions, mapped onto the 384×643 body. */
  --m: 29px;         /* screen window margin, top = sides */
  --win-w: 326px;    /* black glass window around the 320×240 panel */
  --win-h: 252px;
  --win-r: 5px;      /* the window's corner radius */
  --k: 1;            /* panel scale (320×240 logical) */
  --wheel-d: 232px;  /* click wheel diameter */
  --wheel-top: 352px;
  --center-d: 86px;  /* centre button */
  --s: 1.15;               /* device scale, desktop */
  --sel-grad: linear-gradient(180deg, #62a7ff 0%, #2f7ae8 50%, #1a5fd4 100%);
  --wheel-label: #a4a4a8;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: var(--font);
  background: var(--stage);
  color: #121212;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: #1a1a1c; }
a:hover { color: #2f7ae8; }

/* ---------- stage: studio white ---------- */
#stage {
  position: relative;
  /* svh, not dvh: the centred device must not drift when a phone's URL bar collapses */
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 90% at 50% 30%, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 55%, rgba(0,0,0,0.08) 100%),
    var(--stage);
}
#stage { perspective: 1400px; }
#device-wrap {
  position: relative;
  width: calc(var(--dev-w) * var(--s));
  height: calc(var(--dev-h) * var(--s));
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 180ms ease-out;
  will-change: transform;
  --arrive-from: 0.55;   /* how far back it starts (scale) */
  --arrive-ms: 560ms;
  --arrive-ease: cubic-bezier(0.16, 0.84, 0.24, 1);
  animation: device-in var(--arrive-ms) var(--arrive-ease) both;
}
/* desktop: a long approach from far behind, slow at first, then it arrives */
@media (min-width: 641px) {
  #device-wrap { --arrive-from: 0.06; --arrive-ms: 1500ms; --arrive-ease: cubic-bezier(0.5, 0, 0.15, 1); }
}
/* arrival: the device comes at you out of the background as the mist bursts.
   2D scale only: a translateZ inside the perspective context makes iOS WebKit
   paint the whole subtree offset after the animation ends. */
@keyframes device-in {
  0%   { opacity: 0; transform: scale(var(--arrive-from)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
  40%  { opacity: 1; }
  100% { opacity: 1; transform: scale(1) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
}
/* ---------- dark stage (?stage=dark): the old landing's black + breathing blue edge ---------- */
body[data-stage="dark"] { --stage: #000; }
body[data-stage="dark"] #stage {
  background: radial-gradient(90% 70% at 50% 40%, #131416 0%, #050506 60%, #000 100%);
}
body[data-stage="dark"] #stage::before, body[data-stage="dark"] #stage::after { opacity: 0.55; }
body[data-stage="dark"] #device {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22), inset 0 -1px 0 rgba(0,0,0,0.75),
    inset 1px 0 0 rgba(255,255,255,0.08), inset -1px 0 0 rgba(255,255,255,0.08),
    inset 0 0 22px rgba(0,0,0,0.25),
    0 0 60px rgba(74,108,140,0.22);   /* the edge light spilling onto the body */
}
#edge-glow { display: none; position: fixed; inset: 0; pointer-events: none; z-index: 150; }
body[data-stage="dark"] #edge-glow { display: block; animation: edge-pulse 4s ease-in-out infinite; }
@media (max-width: 640px) { #edge-glow { display: none !important; } } /* phones: the device fills the screen, no frame around it */
@keyframes edge-pulse {
  0%, 100% { box-shadow: inset 0 0 25px 5px rgba(74,108,140,0.3); border: 5px solid rgba(74,108,140,0.5); }
  50%      { box-shadow: inset 0 0 50px 15px rgba(74,108,140,0.8); border: 5px solid rgba(74,108,140,1); }
}
#brand { display: none; position: fixed; left: 22px; top: 16px; z-index: 160; width: 96px; }
body[data-stage="dark"] #brand { display: block; }
.brand-logo { position: relative; display: block; width: 96px; height: auto; animation: logo-pulse 4s ease-in-out infinite; }
.brand-halo { position: absolute; left: -11px; top: -11px; width: 118px; height: auto; pointer-events: none; animation: halo-pulse 4s ease-in-out infinite; }
body[data-stage="dark"] .np-open, body[data-stage="dark"] a { color: #2f7ae8; }
@media (max-width: 640px) {
  body[data-stage="dark"] #brand { display: none; } /* the device already carries the logo; no room above it */
}

/* ---------- living mist: two blue blobs drifting behind the device ---------- */
#stage::before, #stage::after {
  content: ''; position: absolute; pointer-events: none; z-index: 0;
  width: 70vmax; height: 70vmax; border-radius: 50%;
  background: radial-gradient(circle, rgba(130,168,204,0.32) 0%, rgba(74,108,140,0.14) 35%, rgba(74,108,140,0) 70%);
  opacity: 0.35; will-change: transform;
}
#stage::before { left: -20vmax; top: -10vmax; animation: mist-a 46s ease-in-out infinite; }
#stage::after { right: -25vmax; bottom: -20vmax; animation: mist-b 58s ease-in-out infinite; }
@keyframes mist-a { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(14vmax, 10vmax) scale(1.15); } }
@keyframes mist-b { 0%, 100% { transform: translate(0, 0) scale(1.1); } 50% { transform: translate(-12vmax, -14vmax) scale(0.95); } }
#device-wrap { z-index: 1; }
body.hidden #stage::before, body.hidden #stage::after { animation-play-state: paused; }

/* polished stainless rim: the back shell peeking out around the front face */
#device-wrap::before {
  content: ''; position: absolute; inset: calc(-3px * var(--s)); z-index: -1;
  border-radius: calc(37px * var(--s));
  background: conic-gradient(from 210deg,
    #e2e4e8 0%, #7a7d83 10%, #2e2f33 26%, #9fa2a8 44%, #2b2c30 58%, #d4d7dc 74%, #55575c 88%, #e2e4e8 100%);
  box-shadow: 0 0 0 calc(1px * var(--s)) rgba(0,0,0,0.55);
}

/* ---------- device ---------- */
#device {
  --lx: 32%; --ly: 18%;   /* where the light hits; tilt.js moves it with the pointer */
  position: absolute; left: 0; top: 0;
  width: var(--dev-w); height: var(--dev-h);
  transform: scale(var(--s)); transform-origin: top left;
  border-radius: 34px;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='1' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.55  0 0 0 0 0.55  0 0 0 0 0.58  0.16 0.16 0.16 0 0'/></filter><rect width='120' height='120' filter='url(%23n)'/></svg>"),
    linear-gradient(180deg, #3b3c40 0%, #2b2c30 48%, #202124 100%);
  background-blend-mode: overlay, normal;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22), inset 0 -1px 0 rgba(0,0,0,0.75),
    inset 1px 0 0 rgba(255,255,255,0.08), inset -1px 0 0 rgba(255,255,255,0.08),
    inset 0 0 22px rgba(0,0,0,0.25);
  user-select: none;
  touch-action: none;
}
/* the specular: its own layer above the body, below screen and wheel, so it can fade */
#device::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(75% 60% at var(--lx) var(--ly), rgba(255,255,255,0.17) 0%, rgba(255,255,255,0.06) 38%, rgba(255,255,255,0) 72%);
  transition: opacity 700ms ease-out;
}
body.landed #device::before { opacity: 0; }   /* phones: light only while flying in */
.bezel {
  position: absolute; left: var(--m); top: var(--m);
  width: var(--win-w); height: var(--win-h);
  border-radius: var(--win-r);
  background: linear-gradient(180deg, #0c0d10 0%, #060708 100%);
  box-shadow: inset 0 0 0 1px #17181b, inset 0 1px 0 rgba(255,255,255,0.05), 0 0 0 1px rgba(0,0,0,0.6), 0 1px 0 rgba(255,255,255,0.08);
}
#screen::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background:
    linear-gradient(112deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.035) 28%, rgba(255,255,255,0) 46%, rgba(0,0,0,0) 80%, rgba(0,0,0,0.05) 100%);
}
#screen, #screen-overlay {
  position: absolute; width: 320px; height: 240px;
  left: calc(var(--m) + (var(--win-w) - 320px * var(--k)) / 2);
  top: calc(var(--m) + (var(--win-h) - 240px * var(--k)) / 2);
  transform: scale(var(--k)); transform-origin: top left;
  overflow: hidden; background: #fff; border-radius: 1px;
}
#screen-overlay { background: none; pointer-events: none; z-index: 6; }
/* ---------- screen system ---------- */
.hdr {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  height: 22px; padding: 0 6px;
  background: linear-gradient(180deg, #f6f7f9 0%, #dfe3e8 60%, #cfd4da 100%);
  border-bottom: 1px solid #9aa1a8;
}
.hdr-title { font-size: 12px; font-weight: 700; color: #1d1f22; flex: none; }
/* "now playing" marquee: a short window centred between the title and the clock
   (10 px clear of both, shrinks on crowded headers), tap = back to the song */
.hdr-np { flex: 0 1 150px; min-width: 0; margin: 0 auto; }
.hdr-np, .photo-np {
  padding: 0; border: 0; background: none; cursor: pointer; overflow: hidden;
  font: inherit; font-size: 10px; font-weight: 700; color: #2f7ae8; text-align: left; white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.np-marquee { display: inline-flex; animation: np-scroll 12s linear infinite; }
.np-marquee > span { padding-right: 28px; }
@keyframes np-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.photo-np { position: absolute; left: 0; right: 0; top: 0; z-index: 2; margin: 0; height: 18px; line-height: 18px; color: #fff; background: rgba(0,0,0,0.45); }
.hdr-right { display: flex; align-items: center; gap: 6px; flex: none; }
.hdr-clock { font-size: 11px; font-weight: 700; color: #1d1f22; font-variant-numeric: tabular-nums; margin-right: 2px; }
.hdr-date { font-weight: 400; color: #4d5258; margin-right: 6px; text-transform: capitalize; }
.body { position: relative; height: 218px; background: #fff; overflow: hidden; }
.body.split { display: flex; }
.list { display: flex; flex-direction: column; width: 160px; padding-top: 2px; background: #fff; }
.list.full { width: 100%; padding-right: 12px; transition: transform 120ms ease-out; }
.pane {
  width: 160px; display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: #000; border-left: 1px solid #c9ced4;
}
.pane-logo-wrap { position: relative; width: 132px; display: block; }
.pane-logo { position: relative; width: 132px; height: auto; display: block; animation: logo-pulse 4s ease-in-out infinite; }
/* the old landing's heartbeat: same blues, same 4 s breath. The glow is a
   pre-blurred PNG whose opacity pulses (CSS filters vanish on iOS inside 3D-
   transformed ancestors, and opacity is cheaper anyway). */
.pane-halo { position: absolute; left: -15px; top: -15px; width: 162px; height: auto; display: block; pointer-events: none; animation: halo-pulse 4s ease-in-out infinite; will-change: opacity; }
@keyframes logo-pulse { 0%, 100% { opacity: 0.82; } 50% { opacity: 1; } }
@keyframes halo-pulse { 0%, 100% { opacity: 0.15; } 50% { opacity: 1; } }
.pane-art { width: 160px; height: 218px; object-fit: cover; display: block; }

.row {
  display: flex; align-items: center; justify-content: space-between;
  height: 26px; padding: 0 8px; font-size: 14px; font-weight: 700; color: #121212;
  cursor: pointer;
}
.row.selected { background: var(--sel-grad); color: #fff; }
.row-right { display: flex; align-items: center; color: #6b7076; }
.row.selected .row-right { color: #fff; }
.row.news { height: 36px; border-bottom: 1px solid #e6e9ed; }
.row.news.selected { border-bottom-color: transparent; }
.row.news .row-label { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.news-title { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-date { font-size: 10px; font-weight: 400; color: #6b7076; }
.row.selected .news-date { color: #dbe8ff; }
/* Logros: a mark, the badge and how to earn it */
.row.badge { height: 36px; justify-content: flex-start; gap: 8px; border-bottom: 1px solid #e6e9ed; }
.row.badge.selected { border-bottom-color: transparent; }
.badge-mark { width: 16px; flex: none; text-align: center; font-size: 13px; color: #a3a9b0; }
.row.badge.earned .badge-mark { color: #23923f; }
.row.badge .row-label { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.badge-name { font-size: 13px; }
.row.badge:not(.earned) .badge-name { color: #8a9096; }
.badge-hint { font-size: 10px; font-weight: 400; color: #6b7076; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.badge.selected .badge-mark, .row.badge.selected .badge-name, .row.badge.selected .badge-hint { color: #fff; }
/* shake to shuffle: the device gives a little wobble */
/* a sideways shake on the device itself: #device-wrap carries the entrance
   animation, and swapping that out would replay the fly-in */
#device.wobble { animation: wobble 480ms ease-in-out; }
@keyframes wobble { 0%, 100% { translate: 0 0; } 15% { translate: -7px 0; } 35% { translate: 6px 0; } 55% { translate: -4px 0; } 75% { translate: 2px 0; } }

.bio {
  display: flex; flex-direction: column; gap: 8px;
  padding: 8px 16px 8px 10px; font-size: 12px; line-height: 16px;
  text-wrap: pretty; transition: transform 120ms ease-out;
}
.bio p { margin: 0; }
.scrollbar {
  position: absolute; right: 2px; top: 4px; bottom: 4px; width: 7px;
  border: 1px solid #b9bfc7; border-radius: 4px; background: #eef0f3;
}
.scrollbar .thumb { position: absolute; left: 1px; right: 1px; top: 2px; height: 28px; border-radius: 3px; background: var(--sel-grad); pointer-events: none; }
/* finger-sized hit area around the 7 px bar (the bar itself stays thin) */
.bio ~ .scrollbar::before { content: ''; position: absolute; top: -6px; bottom: -6px; left: -16px; right: -6px; }

/* Book de fotos: four thumbnails across, two rows fill the body exactly
   (6 + 100 + 6 + 100 + 6 = 218); more photos scroll like a list. */
.list.full.photo-grid { flex-direction: row; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 6px; }
.cell { position: relative; width: 72.5px; height: 100px; background: #000; cursor: pointer; }
.cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cell.selected::after { content: ''; position: absolute; inset: -3px; border: 3px solid #2f7ae8; border-radius: 2px; box-shadow: 0 0 0 1px #fff, 0 1px 4px rgba(0,0,0,0.35); pointer-events: none; }
/* one photo on the whole screen, fitted, never cropped */
.photo-full { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; cursor: pointer; }
.photo-img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.photo-full.fade-in .photo-img { animation: photo-in 320ms ease-out; }
@keyframes photo-in { from { opacity: 0; } to { opacity: 1; } }
.photo-count {
  position: absolute; right: 6px; bottom: 5px; padding: 1px 6px; border-radius: 8px;
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.85); background: rgba(0,0,0,0.45);
  font-variant-numeric: tabular-nums;
}
.photo-full.slideshow .photo-count::before { content: '▶ '; font-size: 8px; }
.bio ~ .scrollbar { touch-action: none; }

/* Now Playing: 12 px frame, art + meta, times row, bars fill the rest */
.np { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.np-top { display: flex; gap: 12px; align-items: flex-start; }
.np-art { width: 96px; height: 96px; object-fit: cover; box-shadow: 0 1px 2px rgba(0,0,0,0.35); flex: none; }
.np-meta { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; min-width: 0; }
.np-title { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { font-size: 12px; color: #33363a; }
.np-open { font-size: 11px; color: #2f7ae8; text-decoration: none; }
.np-share { align-self: flex-start; padding: 0; border: 0; background: none; font: inherit; font-size: 11px; color: #2f7ae8; cursor: pointer; }
/* "Link copiado": a pill over the bottom of the screen, gone after a moment */
.toast {
  position: absolute; left: 50%; bottom: 10px; z-index: 20; transform: translate(-50%, 6px);
  padding: 4px 10px; border-radius: 10px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(20,22,26,0.85);
  opacity: 0; pointer-events: none; transition: opacity 180ms ease-out, transform 180ms ease-out; white-space: nowrap;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.np-times { display: flex; align-items: center; gap: 6px; font-size: 10px; color: #33363a; }
.np-progress { flex: 1; height: 8px; border: 1px solid #a3a9b0; border-radius: 4px; background: linear-gradient(180deg, #f4f5f7, #dfe2e6); overflow: hidden; }
.np-fill { height: 100%; background: var(--sel-grad); }
.viz-mini { display: block; width: 296px; height: 66px; image-rendering: pixelated; }

/* games */
.game { background: #fff; }
.game-canvas { display: block; width: 320px; height: 218px; }

/* stats */
.stats { padding: 8px 12px 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.stat-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; line-height: 18px; }
.stat-title { font-weight: 700; color: #121212; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-val { color: #33363a; white-space: nowrap; }
.stat-sep { height: 1px; margin: 4px 0; background: #dfe3e8; }
.stat-empty { margin-top: 10px; text-align: center; color: #6b7076; font-size: 11px; }

/* ---------- extras: quiz + secret ---------- */
.quiz { display: flex; flex-direction: column; }
.quiz-intro { align-items: center; padding: 10px 16px 0; text-align: center; }
.quiz-mark {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: #fff; background: var(--sel-grad); box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.quiz-text { margin: 8px 0 0; font-size: 12px; line-height: 15px; color: #33363a; text-wrap: pretty; }
.quiz-best { margin-top: 4px; font-size: 11px; color: #6b7076; }
.quiz-cta { width: 140px; margin-top: auto; margin-bottom: 8px; border-radius: 4px; justify-content: center; gap: 6px; }
.quiz-prompt {
  min-height: 42px; padding: 6px 10px 4px; font-size: 13px; font-weight: 700; line-height: 16px; color: #121212;
  display: flex; flex-direction: column; gap: 2px; text-wrap: pretty;
}
.quiz-listening { font-size: 10px; font-weight: 400; color: #2f7ae8; }
.is-clip .quiz-listening { animation: quiz-pulse 1s ease-in-out infinite; }
@keyframes quiz-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.quiz-list { padding-right: 0; }
.quiz-choice.correct { background: linear-gradient(180deg, #5fd07a 0%, #2fae4f 60%, #23923f 100%); color: #fff; }
.quiz-choice.wrong { background: linear-gradient(180deg, #ff7b7b 0%, #e04444 60%, #c33131 100%); color: #fff; }
.quiz-done { padding-top: 10px; }
.quiz-score { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.quiz-score-label { font-size: 11px; color: #6b7076; text-transform: uppercase; letter-spacing: 1px; }
.quiz-score-num { font-size: 34px; font-weight: 700; line-height: 1; color: #1a5fd4; }
.quiz-done .quiz-best { text-align: center; }
.quiz-done .quiz-list { margin-top: auto; padding-bottom: 6px; }
/* question status line: clock + seconds left on the left, right/answered on the right */
.quiz-status { display: flex; align-items: center; justify-content: space-between; height: 18px; padding: 4px 10px 0; font-size: 11px; font-weight: 700; color: #6b7076; }
.quiz-clock { display: flex; align-items: center; gap: 4px; color: #2f7ae8; font-variant-numeric: tabular-nums; }
.quiz-clock svg { display: block; }
.quiz-hand { transform-box: view-box; transform-origin: 50% 50%; animation: quiz-sweep 10s linear forwards; }
@keyframes quiz-sweep { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.quiz-status.hurry .quiz-clock { color: #e04444; }
.quiz-status.hurry .quiz-clock svg { animation: quiz-tick 1s ease-in-out infinite; }
@keyframes quiz-tick { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.quiz-tally { font-variant-numeric: tabular-nums; }
.quiz-right { font-size: 13px; color: #23923f; }
.quiz-of { color: #8a9096; }
.quiz-timeup { font-size: 10px; font-weight: 700; color: #e04444; }
.quiz-out { margin: 6px 14px 0; text-align: center; font-size: 11px; font-weight: 700; line-height: 14px; color: #c33131; text-wrap: pretty; }
.quiz-unlocked {
  margin: 6px 12px 0; padding: 5px 8px; border-radius: 4px; text-align: center; cursor: pointer;
  font-size: 11px; font-weight: 700; line-height: 14px; color: #fff; text-wrap: pretty;
  background: linear-gradient(180deg, #5fd07a 0%, #2fae4f 60%, #23923f 100%); box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.quiz-unlocked-text { display: block; }
.quiz-unlocked-go { display: inline-block; margin-top: 3px; padding: 1px 8px; border-radius: 8px; background: rgba(255,255,255,0.22); font-size: 10px; letter-spacing: 0.02em; }
/* it is the selected row on the winning round: a white ring like the photo grid's */
.quiz-unlocked.selected { box-shadow: 0 0 0 2px #fff, 0 0 0 3px #23923f, 0 1px 4px rgba(0,0,0,0.35); }
.quiz-unlocked.selected .quiz-unlocked-go { background: #fff; color: #23923f; }

/* a locked track: greyed out in Música until the quiz unlocks it */
.row.locked { color: #a3a9b0; }
.row.locked.selected { background: linear-gradient(180deg, #c9ced4 0%, #aeb4bb 50%, #9aa1a8 100%); color: #f4f5f7; }
.pane-art.locked, .np-art.locked { filter: grayscale(1); opacity: 0.45; }
.locked-np { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.locked-hint { margin: 0; font-size: 12px; line-height: 15px; color: #33363a; text-wrap: pretty; }
.locked-go { margin-top: auto; border-radius: 4px; }

.secret { align-items: center; text-align: center; padding: 18px 20px 0; display: flex; flex-direction: column; gap: 6px; }
.secret-glyph { font-size: 34px; line-height: 1; color: #1a5fd4; }
.secret-text { margin: 4px 0 0; font-size: 12px; line-height: 15px; color: #33363a; text-wrap: pretty; }
.secret-link { font-size: 11px; color: #2f7ae8; text-decoration: none; }
.secret.np { padding: 0; text-align: left; align-items: stretch; gap: 0; }
.secret-art { width: 88px; height: 88px; display: flex; align-items: center; justify-content: center; font-size: 40px; color: #fff; background: #111; box-shadow: 0 1px 2px rgba(0,0,0,0.35); }

/* unlock: the screen glitches for a beat, then the secret shows */
@keyframes screen-glitch {
  0%   { filter: invert(1) contrast(1.4); transform: scale(var(--k)) translateX(0); }
  15%  { filter: invert(0) contrast(1); transform: scale(var(--k)) translateX(-3px); }
  30%  { filter: invert(1) hue-rotate(90deg); transform: scale(var(--k)) translateX(3px) skewX(-4deg); }
  45%  { filter: invert(0); transform: scale(var(--k)) translateX(0); }
  60%  { filter: invert(1) contrast(2); transform: scale(var(--k)) translateX(2px); }
  75%  { filter: invert(0); transform: scale(var(--k)) translateX(-1px) skewX(2deg); }
  100% { filter: invert(0); transform: scale(var(--k)) translateX(0); }
}
#screen.glitch { animation: screen-glitch 600ms steps(1, end) 1; }
@media (prefers-reduced-motion: reduce) {
  #screen.glitch { animation: none; }
  .is-clip .quiz-listening { animation: none; }
  .photo-full.fade-in .photo-img { animation: none; }
  .quiz-hand, .quiz-status.hurry .quiz-clock svg { animation: none; }
  .np-marquee { animation: none; }
  #device.wobble { animation: none; }
}

/* ---------- wheel ---------- */
#wheel {
  position: absolute; left: calc((var(--dev-w) - var(--wheel-d)) / 2); top: var(--wheel-top);
  width: var(--wheel-d); height: var(--wheel-d); border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #27282b 0%, #1a1b1d 58%, #121315 100%);
  box-shadow:
    inset 0 2px 3px rgba(0,0,0,0.8), inset 0 -1px 1px rgba(255,255,255,0.05), inset 0 0 0 1px rgba(0,0,0,0.6),
    0 1px 0 rgba(255,255,255,0.09), 0 -1px 0 rgba(0,0,0,0.5);
  cursor: pointer;
}
.wz {
  position: absolute; border: 0; background: transparent; color: var(--wheel-label);
  font: 600 13px/1 var(--font); letter-spacing: 1.2px; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; /* the wheel itself handles pointer events; buttons are for a11y + keyboard */
}
.wz:focus-visible { outline: 2px solid #62a7ff; outline-offset: 2px; pointer-events: auto; }
.wz-menu { left: 0; right: 0; top: 12px; height: 24px; }
.wz-prev { left: 14px; top: calc(var(--wheel-d) / 2 - 12px); width: 34px; height: 24px; }
.wz-next { right: 14px; top: calc(var(--wheel-d) / 2 - 12px); width: 34px; height: 24px; }
.wz-play { left: 0; right: 0; bottom: 12px; height: 24px; }
.wz-center {
  left: calc((var(--wheel-d) - var(--center-d)) / 2); top: calc((var(--wheel-d) - var(--center-d)) / 2);
  width: var(--center-d); height: var(--center-d); border-radius: 50%;
  background: radial-gradient(circle at 50% 32%, #37383c 0%, #26272a 58%, #1c1d20 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), inset 0 -1px 2px rgba(0,0,0,0.6), 0 1px 2px rgba(0,0,0,0.85), 0 0 0 1px rgba(0,0,0,0.55);
}

/* ---------- footer links (flag) ---------- */
#footer-links {
  display: none; gap: 36px; margin-top: 40px;
  font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
}
#footer-links a { text-decoration: none; }
body[data-nav="footer"] #footer-links { display: flex; }

/* ---------- SEO / a11y block ---------- */
.visually-hidden {
  position: absolute; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- mist burst (from the countdown landing, retinted for white) ---------- */
#page-mist {
  position: fixed; inset: 0; pointer-events: none; z-index: 200;
  background: radial-gradient(ellipse at center,
    rgba(200, 225, 245, 0.85) 0%,
    rgba(130, 168, 204, 0.55) 18%,
    rgba(74, 108, 140, 0.30) 42%,
    rgba(74, 108, 140, 0.08) 65%,
    transparent 80%);
  opacity: 0; transform: scale(0.15); transform-origin: center; filter: blur(18px);
}
@keyframes mist-burst {
  0%   { opacity: 0.9; transform: scale(0.15); filter: blur(18px); }
  35%  { opacity: 0.55; transform: scale(0.9);  filter: blur(35px); }
  70%  { opacity: 0.18; transform: scale(1.7);  filter: blur(55px); }
  100% { opacity: 0;   transform: scale(2.4);  filter: blur(70px); }
}
#page-mist.active { animation: mist-burst 2.2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards; }
@media (prefers-reduced-motion: reduce) {
  #device-wrap { transition: none; transform: none; animation: none; }
  #stage::before, #stage::after { animation: none; }
  #page-mist { display: none; }
  .bio, .list, .list.full { transition: none; }
  .pane-logo, .pane-halo { animation: none; opacity: 1; }
  .pane-halo { opacity: 0.6; }
}

/* ---------- mobile A: whole device scaled ---------- */
@media (max-width: 640px) {
  body[data-mobile="a"] { --s: 0.88; }
  body[data-mobile="a"] #stage { justify-content: center; padding: 0; }
  body[data-mobile="a"] #footer-links { flex-wrap: wrap; justify-content: center; gap: 16px 24px; padding: 0 16px; margin-top: 28px; }
}
@media (max-width: 360px) {
  body[data-mobile="a"] { --s: 0.8; }
}

/* ---------- mobile B: "in the hand" ----------
   The real device, zoomed so its edges sit just outside the phone: the glass
   window spans the width, the wheel is fully visible. It flies in from small
   (whole device, rim and all) to that zoom. JS measures the fixed #stage and
   sets --held-tf (the final transform). */
@media (max-width: 640px) {
  body[data-mobile="b"] { --s: 1; }
  /* fixed to the visible area: the browser sizes it, JS only places the device inside it */
  body[data-mobile="b"] #stage { position: fixed; inset: 0; min-height: 0; justify-content: flex-start; padding: 0; perspective: none; overflow: hidden; }
  body[data-mobile="b"] #device-wrap { width: 100%; height: 100%; transform: none; animation: none; }
  body[data-mobile="b"] #device-wrap::before { display: none; }
  /* before JS releases it: whole device, half size, centred, invisible */
  body[data-mobile="b"] #device, body[data-mobile="b"] .rim {
    transform: translate(calc(50vw - 96px), calc(50svh - 160.75px)) scale(0.5); transform-origin: top left; opacity: 0;
    /* fade in fast, linger on the whole device, then travel into the hand */
    transition: transform 1500ms cubic-bezier(0.3, 0.7, 0.2, 1) 650ms, opacity 450ms ease-out;
  }
  body[data-mobile="b"] .rim { display: block; transform-origin: 3px 3px; }
  body[data-mobile="b"].held-in #device, body[data-mobile="b"].held-in .rim { transform: var(--held-tf); opacity: 1; }
  body[data-mobile="b"].held-hold #device, body[data-mobile="b"].held-hold .rim { opacity: 1; }
  body[data-mobile="b"].held-far #device, body[data-mobile="b"].held-far .rim { transition: none; }
  /* once landed, viewport corrections (toolbar shows/hides) are quick, not a second fly-in */
  body[data-mobile="b"].landed #device, body[data-mobile="b"].landed .rim { transition: transform 220ms ease-out, opacity 450ms ease-out; }
  body[data-mobile="b"] #brand { display: none; }
  body[data-mobile="b"] #footer-links { display: none; }
}
/* the stainless rim as a real element so it can share the device's transform on mobile B */
.rim {
  display: none; position: absolute; left: -3px; top: -3px; width: calc(var(--dev-w) + 6px); height: calc(var(--dev-h) + 6px);
  border-radius: 37px; pointer-events: none;
  background: conic-gradient(from 210deg,
    #e2e4e8 0%, #7a7d83 10%, #2e2f33 26%, #9fa2a8 44%, #2b2c30 58%, #d4d7dc 74%, #55575c 88%, #e2e4e8 100%);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.55);
}

/* ---------- animated net behind the device (js/backdrop.js, Vanta NET) ----------
   Fills the viewport under everything; once it is up (body.net-on) the stage
   lets it show through and the drifting CSS mist steps aside. */
#net-bg { position: fixed; inset: 0; z-index: 0; pointer-events: auto; opacity: 0; transition: opacity 1.2s ease; }
#net-bg .net-host { width: 100%; height: 100%; } /* Vanta makes its element position: relative, so it gets a sized child of the fixed layer */
body.net-on #net-bg { opacity: 1; }
body.net-on #stage, body.net-on[data-stage="dark"] #stage { background: transparent; }
body.net-on #stage::before, body.net-on #stage::after { display: none; }
#stage { z-index: 1; }
body.net-on #stage { pointer-events: none; }
body.net-on #device-wrap, body.net-on #stage a, body.net-on #stage button { pointer-events: auto; }
