/* ==========================================================================
   bladon.ca — "The Desk"
   Day/night colours are tokens on :root, switched by data-mood on <html>.
   The desk scene scales as one illustration: .scene is a size container and
   desk props are sized in em, where 1em = 1% of the scene width (1cqi).
   ========================================================================== */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Day */
  --wall-top: #f6f3ee;
  --wall-bottom: #ebe5dc;
  --wall-light: rgba(255, 250, 238, .9);
  --ink: #1d1d1f;
  --ink-dim: #5f5f66;
  --sign-ink: #1d1d1f;
  --sign-shadow: 2px 4px 4px rgba(60, 40, 20, .22);
  --ink-faint: #8e8e94;

  --wood-back: #c99d71;
  --wood-front: #dcb489;
  --wood-edge: #a77b52;
  --wood-edge-dark: #8a6240;
  --grain: rgba(120, 78, 40, .07);
  --floor: #ddd5c9;

  --bezel: #1b1b1d;
  --bezel-hi: #3a3a3e;
  --stand-a: #d9dadd;
  --stand-b: #a9abb0;

  --screen-work: linear-gradient(155deg, #eef2f8 0%, #d6dfec 100%);
  --screen-fun: linear-gradient(155deg, #fff0e3 0%, #f3e3f3 55%, #e3e2fa 100%);
  --screen-ink: #1d1d1f;
  --menubar: rgba(255, 255, 255, .55);
  --trace-1: #1f9d55;
  --trace-2: #e07a10;
  --trace-3: #3566d8;
  --chart-bg: rgba(255, 255, 255, .6);
  --chart-edge: rgba(20, 40, 80, .12);
  --chart-grid: rgba(20, 40, 80, .1);
  --app-hover: rgba(255, 255, 255, .55);
  --bias-work: rgba(110, 155, 255, .32);
  --bias-fun: rgba(225, 135, 255, .3);

  --tower: #151518;
  --tower-hi: #2c2d32;
  --power-ring: #5aa8ff;
  --power-glow: rgba(90, 168, 255, .45);
  --strip-opacity: .75;

  --kb-top: #232428;
  --kb-deck: #1a1b1e;
  --kb-front: #0e0f11;
  --mouse: #ecedf0;
  --mouse-hi: #ffffff;

  --mug: #f4f1ea;
  --mug-shade: #d8d3c8;
  --mug-ink: #6b3f22;
  --paper: #fbf8f1;
  --paper-rule: rgba(70, 110, 170, .28);
  --pen-ink: #26408a;
  --nb-cover: #3a2a22;
  --pen-body: #1f2024;
  --steam: rgba(120, 110, 100, .16);

  --beam-opacity: 0;

  --modal-bg: #ffffff;
  --modal-chip: #f2f1ed;
  --modal-line: #e7e5df;
  --scrim: rgba(20, 18, 14, .45);
  --ok: #1e9a52;
  --pending: #2c6fdc;
  --dl-track: #ebe8e1;
  --dl-foot: #faf9f6;

  --switch-plate: #f8f6f2;
  --switch-edge: #d6d1c7;
  --switch-rocker: #ffffff;

  --shadow: rgba(60, 40, 20, .22);
  --focus: #2c6fdc;

  color-scheme: light;
}

:root[data-mood="night"] {
  --wall-top: #0e1016;
  --wall-bottom: #161922;
  --wall-light: rgba(255, 200, 130, .10);
  --ink: #f2f2f5;
  --sign-ink: rgba(48, 40, 34, .9); /* warm, mostly solid letter faces */
  --sign-shadow: 0 0 1px rgba(255, 240, 214, 1), 0 0 5px rgba(255, 228, 188, .95), 0 0 16px rgba(255, 210, 156, .9), 0 0 38px rgba(255, 194, 126, .75), 0 0 80px rgba(255, 182, 112, .5), 0 0 130px rgba(255, 176, 104, .3);
  --ink-dim: #b0b2bc;
  --ink-faint: #7a7d8a;

  --wood-back: #3e2d1f;
  --wood-front: #57402c;
  --wood-edge: #2f2217;
  --wood-edge-dark: #22180f;
  --grain: rgba(0, 0, 0, .14);
  --floor: #0b0c10;

  --bezel: #0d0d0f;
  --bezel-hi: #2a2a2e;
  --stand-a: #5a5c62;
  --stand-b: #2f3035;

  --screen-work: linear-gradient(155deg, #1d2638 0%, #101624 100%);
  --screen-fun: linear-gradient(155deg, #33213a 0%, #251c3c 55%, #1b1f3d 100%);
  --screen-ink: #f5f5f7;
  --menubar: rgba(0, 0, 0, .35);
  --trace-1: #4fe08a;
  --trace-2: #ffad4a;
  --trace-3: #7fa6ff;
  --chart-bg: rgba(0, 0, 0, .28);
  --chart-edge: rgba(255, 255, 255, .08);
  --chart-grid: rgba(255, 255, 255, .07);
  --app-hover: rgba(255, 255, 255, .1);
  --bias-work: rgba(80, 135, 255, .85);
  --bias-fun: rgba(205, 100, 255, .8);

  --tower: #0c0c0e;
  --tower-hi: #232428;
  --power-ring: #6fb4ff;
  --power-glow: rgba(90, 168, 255, .8);
  --strip-opacity: 1;

  --kb-top: #1b1c1f;
  --kb-deck: #141517;
  --kb-front: #08090a;
  --mouse: #8e9097;
  --mouse-hi: #b4b6bc;

  --mug: #cfc9bd;
  --mug-shade: #8f897d;
  --mug-ink: #4e2e19;
  --paper: #b9b4a9;
  --paper-rule: rgba(60, 80, 120, .35);
  --pen-ink: #2a3d74;
  --nb-cover: #20160f;
  --pen-body: #111214;
  --steam: rgba(255, 236, 210, .22);

  --beam-opacity: 1;

  --modal-bg: #20222a;
  --modal-chip: #2d3039;
  --modal-line: #353844;
  --scrim: rgba(0, 0, 0, .6);
  --ok: #4fd283;
  --pending: #6fa8ff;
  --dl-track: #363945;
  --dl-foot: #1b1d24;

  --switch-plate: #2a2b31;
  --switch-edge: #3c3d45;
  --switch-rocker: #383a41;

  --shadow: rgba(0, 0, 0, .55);
  --focus: #7fb0ff;

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
html:has(.modal[open]) { overflow: hidden; }
body {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto auto 1fr; /* content sits at the top; the floor fills the rest */
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--wall-bottom);
  background-image:
    radial-gradient(120% 70% at 85% -10%, var(--wall-light), transparent 60%),
    linear-gradient(to bottom, var(--wall-top), var(--wall-bottom));
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  transition: color .6s ease;
}
img, svg { display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 8px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  padding: 8px 14px; border-radius: 8px; background: var(--ink); color: var(--wall-top);
  text-decoration: none; font-size: 14px;
}
.skip:focus { top: 12px; }

/* ---------- Wall / header ---------- */
.wall {
  text-align: center;
  padding: clamp(22px, 4.5vh, 48px) 16px clamp(30px, 5vh, 52px); /* room for the sign's glow above the monitors */
}
/* The name is a halo-lit sign: solid letters standing off the wall, lit from
   behind. By day they cast a soft shadow; at night the letters go dark and a
   warm glow spills onto the wall around them. */
.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 3.9vw, 52px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--sign-ink);
  text-shadow: var(--sign-shadow);
}

/* ---------- Scene ---------- */
.scene {
  container: scene / inline-size;
  position: relative;
  justify-self: center;
  width: min(100% - 32px, 1600px, max(640px, (100svh - 170px) * 2.3));
}

.monitors {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 2cqi;
  margin-bottom: -.8cqi; /* feet rest on the desk top */
}
.monitor {
  width: 39cqi;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bezel {
  position: relative;
  width: 100%;
  padding: .75cqi;
  border-radius: 1.3cqi;
  background: linear-gradient(to bottom, var(--bezel-hi), var(--bezel) 8%);
  box-shadow: 0 1.6cqi 3cqi -1cqi var(--shadow), 0 0 0 1px rgba(0, 0, 0, .25);
}
/* Bias light: a coloured LED glow on the wall behind each monitor */
.monitor--work { --bias: var(--bias-work); }
.monitor--fun  { --bias: var(--bias-fun); }
.bezel::before {
  content: "";
  position: absolute;
  inset: -1.4cqi -3cqi -2.4cqi; /* less spill upward, so it stays clear of the name sign */
  z-index: -1;
  border-radius: 5cqi;
  background: var(--bias);
  filter: blur(clamp(18px, 3.4cqi, 60px));
  pointer-events: none;
  transition: background-color .8s ease;
}

.screen {
  container: screen / inline-size;
  position: relative;
  aspect-ratio: 16 / 10;
  max-width: 100%;
  border-radius: .6cqi;
  overflow: hidden;
  color: var(--screen-ink);
  display: grid;
  grid-template-rows: auto 1fr;
}
.screen--work { background: var(--screen-work); }
.screen--fun  { background: var(--screen-fun); }

.stand { display: flex; flex-direction: column; align-items: center; }
.neck {
  width: 4cqi;
  height: 5.6cqi;
  background: linear-gradient(to right, var(--stand-b), var(--stand-a) 45%, var(--stand-b));
  clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%);
}
.foot {
  width: 12cqi;
  height: 1cqi;
  border-radius: 1cqi 1cqi .4cqi .4cqi;
  background: linear-gradient(to bottom, var(--stand-a), var(--stand-b));
  box-shadow: 0 .6cqi 1cqi -.2cqi var(--shadow);
}

/* ---------- Screen contents (cqi = % of screen width here) ---------- */
.menubar {
  display: flex;
  align-items: center;
  gap: 1.6cqi;
  height: clamp(20px, 5.4cqi, 34px);
  padding: 0 2.6cqi;
  background: var(--menubar);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: clamp(10px, 2.6cqi, 15px);
}
.menubar-logo {
  width: clamp(7px, 2cqi, 12px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: currentColor;
  opacity: .85;
}
.menubar-name { margin: 0; font-size: inherit; font-weight: 650; letter-spacing: .01em; }

.screen-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5cqi;
  padding-bottom: 3cqi;
}

.apps {
  list-style: none;
  margin: 0;
  padding: 0 2cqi;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5cqi;
}
.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2cqi;
  width: 31cqi;
  padding: 3cqi 1cqi 2.6cqi;
  border-radius: 4cqi;
  text-decoration: none;
  text-align: center;
  transition: background-color .2s ease;
}
.app:hover { background: var(--app-hover); }
.app-icon {
  width: 24cqi;
  height: auto;
  aspect-ratio: 1;
  border-radius: 22.5%;
  box-shadow: 0 1cqi 2.4cqi -0.8cqi rgba(0, 0, 0, .4);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1.2);
}
.app:hover .app-icon,
.app:focus-visible .app-icon { transform: translateY(-.8cqi) scale(1.05); }
.app:active .app-icon { transform: scale(.96); }
.app-label {
  font-size: max(11px, 4.3cqi);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

/* ---------- Work screen: icons on the left, live strip charts on the right ---------- */
.screen-body--work {
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  gap: 2cqi;
  padding: 3cqi 4cqi 4cqi 2cqi;
}
.screen-body--work .apps { flex: none; padding: 0; gap: 0; justify-content: flex-start; }
.screen-body--work .app { width: 27cqi; }
.wlogs { /* right side: charts on top, terminal below, half each */
  flex: 1;
  max-width: 38cqi;
  display: flex;
  flex-direction: column;
  gap: 1.4cqi;
  min-height: 0;
}
.wlogs-charts {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: 1.4cqi;
}
.term {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 1.2cqi;
  background: #0a0c0b;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), 0 .5cqi 1.2cqi -0.4cqi rgba(0, 0, 0, .35);
  overflow: hidden;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: .6cqi;
  padding: .7cqi 1cqi;
  background: #1c1e1d;
  color: #8b908d;
  font: 600 max(7px, 1.8cqi)/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
}
.term-bar i { flex: none; width: max(4px, 1.1cqi); aspect-ratio: 1; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-title { flex: none; width: 40%; height: max(2px, .6cqi); margin: 0 auto; border-radius: 1cqi; background: #3a3e3c; } /* a title shape, no text */
.term-out {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* new lines arrive at the bottom and push the rest up */
  padding: .8cqi 1.2cqi 1cqi;
  overflow: hidden;
  color: #2bc45f;
  font: 500 max(6.5px, 1.75cqi)/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  white-space: nowrap;
}
.term-out > div { flex: none; overflow: hidden; text-overflow: clip; } /* lines keep their height; old ones scroll off the top */
.term-out .dim { color: #1a7a3c; }
.term-out .hot { color: #5fdc8a; }
.term-out .w { /* one "word": a short glowing bar */
  display: inline-block;
  height: .42em;
  margin-right: .45em;
  vertical-align: middle;
  border-radius: .21em;
  background: currentColor;
  box-shadow: 0 0 .35em rgba(43, 196, 95, .22);
}
.term-out .tab { display: inline-block; width: 1.6em; }
.term-cursor {
  display: inline-block;
  width: .6em; height: 1.05em;
  vertical-align: text-bottom;
  background: #2bc45f;
  animation: term-blink 1s steps(1, end) infinite;
}
@keyframes term-blink { 50% { opacity: 0; } }
.wlog {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 1.2cqi;
  background: var(--chart-bg);
  box-shadow: inset 0 0 0 1px var(--chart-edge);
  overflow: hidden;
}
.wlog-label {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  padding: .9cqi 1.1cqi;
  border-bottom: 1px solid var(--chart-edge);
  color: var(--trace);
  font: 700 max(8px, 2.3cqi)/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: .04em;
  white-space: nowrap;
}
.wlog-label b { font-weight: 600; color: var(--screen-ink); opacity: .65; font-variant-numeric: tabular-nums; }
@container (max-width: 46px) { .wlog-label b { display: none; } } /* too narrow for a readout */
.wlog-plot { position: relative; flex: 1; min-height: 0; } /* the layout sizes the chart, not the canvas */
.wlog-plot canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

.app-icon--linkedin {
  display: grid;
  place-items: center;
  background: #0a66c2;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12.5cqi;
  letter-spacing: -0.04em;
  line-height: 1;
  padding-top: .1em;
}
.app-icon--patents {
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #fdfaf1, #efe7d4);
}
.app-icon--patents svg { width: 82%; height: 82%; }

/* ---------- Desk ---------- */
.desk {
  position: relative;
  height: 11.6cqi;
}
.desk-top, .desk-edge {
  position: absolute;
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
}
.desk-top {
  top: 0;
  bottom: 1.6cqi;
  background:
    repeating-linear-gradient(88deg, transparent 0 34px, var(--grain) 34px 36px, transparent 36px 81px, var(--grain) 81px 82px),
    linear-gradient(to bottom, var(--wood-back), var(--wood-front));
}
.desk-edge {
  bottom: 0;
  height: 1.6cqi;
  min-height: 10px;
  background: linear-gradient(to bottom, var(--wood-edge), var(--wood-edge-dark));
  box-shadow: 0 1.4cqi 2.4cqi -0.6cqi var(--shadow);
}

/* Props: each sits with its base at --y (in % of scene width) below the desk's back edge. */
.props {
  position: absolute;
  inset: 0;
  font-size: 1cqi;
}
.props > * {
  position: absolute;
  top: calc(var(--y) * 1em);
  translate: 0 -100%;
}

/* ---------- Tower PC (back left edge) ---------- */
.tower { --y: 2.8; left: .4em; width: 8em; z-index: 1; }
.tower-top {
  display: block;
  height: 1em;
  margin: 0 .35em 0 .2em;
  border-radius: .45em .45em 0 0;
  background: linear-gradient(to bottom, var(--tower-hi), var(--tower));
}
.tower-front {
  position: relative;
  display: block;
  height: 21em;
  border-radius: .2em .2em .35em .35em;
  background: linear-gradient(to right, var(--tower-hi), var(--tower) 12%, var(--tower) 86%, #000);
  box-shadow: 0 1em 1.6em -.5em var(--shadow), inset 0 .1em 0 rgba(255, 255, 255, .07);
  overflow: hidden;
}
.tower-power {
  position: absolute;
  top: 1.6em; left: 50%;
  width: 1.5em; height: 1.5em;
  margin-left: -.75em;
  border-radius: 50%;
  background: radial-gradient(circle, #1c1d21 55%, #2c2d33 60%);
  box-shadow: 0 0 0 .15em var(--power-ring), 0 0 .9em .2em var(--power-glow);
}
.tower-leds {
  position: absolute;
  top: 3.9em; left: 50%;
  translate: -50% 0;
  display: flex;
  gap: .6em;
}
.tower-vent {
  position: absolute;
  left: 1.5em; right: 1.5em; top: 6em; bottom: 2.4em;
  border-radius: .3em;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .055) 0 .22em, transparent .22em .62em);
}
.tower-strip { /* RGB accent strip down the front edge */
  position: absolute;
  left: .5em; top: 2em; bottom: 2em;
  width: .2em;
  border-radius: .1em;
  background: linear-gradient(to bottom, #5aa8ff, #a46bff, #ff6bb5, #5aa8ff);
  background-size: 100% 300%;
  box-shadow: 0 0 .7em .1em rgba(150, 120, 255, .55);
  opacity: var(--strip-opacity);
  animation: strip 6s linear infinite;
}
@keyframes strip { to { background-position: 0 300%; } }

/* Blinking status lights (tower and phone base unit) */
.blink {
  display: block;
  width: .42em; height: .42em;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 .5em .1em var(--c);
}
.blink--hdd { --c: #ffb43a; animation: hdd 2.3s steps(1, end) infinite; }
.blink--net { --c: #3fe07a; animation: net .9s steps(1, end) infinite; }
.blink--sys { --c: #5aa8ff; animation: sys 3s ease-in-out infinite; }
@keyframes hdd {
  0% { opacity: 1; } 6% { opacity: .12; } 11% { opacity: 1; } 27% { opacity: .12; } 31% { opacity: 1; }
  58% { opacity: .12; } 62% { opacity: 1; } 66% { opacity: .12; } 71% { opacity: 1; } 100% { opacity: 1; }
}
@keyframes net { 0% { opacity: 1; } 50% { opacity: .15; } }
@keyframes sys { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* ---------- Coffee mug (front left, in front of the computer) ---------- */
.mug { --y: 6.8; left: 6.48em; width: 6.4em; /* 30% of the mug overlaps the tower */ height: 6.4em; z-index: 3; }
.mug-label {
  position: absolute;
  left: 0; right: 0; top: 34%;
  display: grid;
  justify-items: center;
  gap: .12em;
  color: var(--mug-ink);
  line-height: 1;
  pointer-events: none;
}
.mug-label b {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  font-size: .76em;
  letter-spacing: -0.01em;
}
.mug-label small {
  padding-top: .18em;
  border-top: .07em solid currentColor;
  font-size: .46em;
  font-weight: 700;
  letter-spacing: .32em;
  text-transform: uppercase;
  padding-left: .32em; /* balance the trailing letter-spacing */
}
.mug-body {
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 100%;
  border-radius: .5em .5em 1.1em 1.1em;
  background: linear-gradient(to right, var(--mug-shade), var(--mug) 35%, var(--mug) 60%, var(--mug-shade));
  box-shadow: 0 .8em 1em -.3em var(--shadow);
}
.mug-body::before { /* handle */
  content: "";
  position: absolute;
  right: -2.3em; top: 1.4em;
  width: 3em; height: 3.6em;
  border: .75em solid var(--mug-shade);
  border-left: 0;
  border-radius: 0 1.2em 1.2em 0;
}
.mug-body::after { /* coffee */
  content: "";
  position: absolute; left: 6%; right: 6%; top: -.3em;
  height: .7em; border-radius: 50%;
  background: #4a2e1c;
  box-shadow: 0 0 0 .15em var(--mug);
}
.steam {
  position: absolute;
  bottom: 105%;
  width: .45em;
  height: 3em;
  border-radius: 1em;
  background: linear-gradient(to top, var(--steam), transparent);
  opacity: 0;
  animation: steam 4.5s ease-in-out infinite;
}
.steam:nth-child(1) { left: 22%; animation-delay: 0s; }
.steam:nth-child(2) { left: 46%; animation-delay: 1.4s; }
.steam:nth-child(3) { left: 70%; animation-delay: 2.8s; }
@keyframes steam {
  0% { opacity: 0; transform: translateY(0) scaleY(.6) skewX(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-2em) scaleY(1.2) skewX(12deg); }
}

/* ---------- Keyboard and mouse (front centre; mouse on the left) ---------- */
.keyboard { --y: 7.9; left: 50%; width: 31em; translate: -50% -100%; z-index: 3; }
.keyboard svg { width: 100%; height: auto; filter: drop-shadow(0 .5em .5em var(--shadow)); }
.kb-top { fill: var(--kb-top); }
.kb-deck { fill: var(--kb-deck); }
.kb-front { fill: var(--kb-front); }
.kb-shine { fill: rgba(255, 255, 255, .09); }
.mouse {
  --y: 7.5;
  left: 29.6em;
  width: 3.2em;
  height: 1.7em;
  z-index: 3;
  border-radius: 50% 50% 46% 46% / 64% 64% 36% 36%;
  background: radial-gradient(ellipse 70% 80% at 50% 25%, var(--mouse-hi), var(--mouse) 75%);
  box-shadow: 0 .4em .5em -.15em var(--shadow), inset 0 -.12em 0 rgba(0, 0, 0, .08);
}

/* ---------- Open notebook and pen (front right) ---------- */
.notebook { --y: 8.3; right: 1.4em; width: 21em; z-index: 3; }
.notebook svg { width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 .3em .35em var(--shadow)); }
.nb-cover { fill: var(--nb-cover); stroke: var(--nb-cover); stroke-width: 3; stroke-linejoin: round; }
.nb-page { fill: var(--paper); transition: fill .6s ease; }
.nb-rule { fill: none; stroke: var(--paper-rule); stroke-width: .6; }
.nb-ink { fill: none; stroke: var(--pen-ink); stroke-width: .9; stroke-linecap: round; stroke-linejoin: round; }
.nb-tick { stroke-width: 1.15; }
.nb-ribbon { fill: #b3302c; }
.pen-body { fill: var(--pen-body); }
.pen-metal { fill: #c9cbd0; }

/* ---------- Wall light switch (desktop day/night toggle) ---------- */
.light-switch {
  position: absolute;
  z-index: 2;
  top: 3cqi;
  right: 3.4cqi;
  display: grid;
  place-items: center;
  width: max(26px, 2.5cqi);
  aspect-ratio: 2 / 3;
  border-radius: max(4px, .4cqi);
  background: var(--switch-plate);
  box-shadow: 0 0 0 1px var(--switch-edge), 0 .4cqi .9cqi -.2cqi var(--shadow);
}
.light-rocker {
  width: 40%;
  height: 56%;
  border-radius: 3px;
  background: linear-gradient(to bottom, var(--switch-rocker), var(--switch-edge));
  box-shadow: inset 0 0 0 1px var(--switch-edge), 0 1px 2px rgba(0, 0, 0, .2);
  transform: perspective(40px) rotateX(18deg);
  transition: transform .15s ease;
}
:root[data-mood="night"] .light-rocker { transform: perspective(40px) rotateX(-18deg); }
.light-switch::after { /* glow-in-the-dark locator dot */
  content: "";
  position: absolute;
  bottom: 9%;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #ffb43a;
  box-shadow: 0 0 4px 1px #ffb43a;
  opacity: var(--beam-opacity);
}

/* ---------- Phone-only pieces ---------- */
.kvm, .base-unit { display: none; }

/* ---------- Floor / footer ---------- */
.floor {
  background: var(--floor);
  color: var(--ink-faint);
  text-align: center;
  font-size: 12px;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  transition: background-color .6s ease;
}
.floor p { margin: 0; }

/* Joke hit counter, in the style of a 1990s web counter */
.visitors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--ink-dim);
}
.visitors-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.odometer {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  padding: 3px;
  border-radius: 5px;
  background: #0d0d0f;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .25);
}
.odometer b {
  display: inline-block;
  width: 1.05em;
  padding: 4px 0;
  border-radius: 2px;
  background: linear-gradient(to bottom, #262629 0 49%, #0a0a0b 51% 100%);
  color: #d6d8dd;
  font: 700 15px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  text-align: center;
  text-shadow: 0 0 4px rgba(255, 255, 255, .18);
}
.odometer i { /* thousands separator */
  color: #d6d8dd;
  font: 700 13px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-style: normal;
  opacity: .7;
  padding-bottom: 3px;
}
.visitors-joke { font-style: italic; }

/* ---------- Screen-switch flicker ---------- */
.screen.is-switching { animation: flicker .34s ease-out; }
@keyframes flicker {
  0%   { filter: brightness(2.2) saturate(0); transform: scaleY(.04); }
  35%  { filter: brightness(1.6) saturate(.4); transform: scaleY(1.02); }
  60%  { filter: brightness(.85); transform: scaleY(1); }
  100% { filter: none; }
}

/* ==========================================================================
   Project modals
   ========================================================================== */
.modal {
  width: min(520px, 100% - 32px);
  max-width: none;
  max-height: calc(100svh - 32px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}
.modal::backdrop {
  background: var(--scrim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal[open] { animation: modal-in .28s cubic-bezier(.2, .8, .2, 1); }
.modal[open]::backdrop { animation: fade-in .28s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes fade-in { from { opacity: 0; } }

.modal-card {
  position: relative;
  display: grid;
  gap: 14px;
  max-height: calc(100svh - 32px);
  overflow-y: auto;
  padding: 28px;
  border-radius: 22px;
  background: var(--modal-bg);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5), 0 0 0 1px var(--modal-line);
}
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--modal-chip);
  color: var(--ink-dim);
  font-size: 22px;
  line-height: 1;
}
.modal-close:hover { color: var(--ink); }
.modal-head { display: flex; align-items: center; gap: 16px; padding-right: 36px; }
.modal-icon {
  flex: none;
  width: 68px; height: 68px;
  border-radius: 22.5%;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .4);
}
.modal-icon.app-icon--linkedin { font-size: 36px; }
.modal-icon.app-icon--patents svg { width: 82%; height: 82%; }
.modal-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.modal-title {
  margin: 3px 0 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.modal-lede {
  margin: 4px 0 0;
  font-size: 19px;
  font-weight: 550;
  line-height: 1.3;
  text-wrap: balance;
}
.modal-body {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-dim);
}
.modal-facts {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.modal-facts li {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--modal-chip);
  color: var(--ink-dim);
  font-size: 13px;
}
.modal-cta {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--modal-bg);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: transform .15s ease;
}
.modal-cta:hover { transform: translateY(-1px); }

/* ---------- LinkedIn: profile card ---------- */
.profile-banner {
  margin: -42px -28px 0; /* card padding + the grid gap after the close button's form */
  height: 92px;
  background: linear-gradient(120deg, #0a66c2, #3b8fe0 55%, #8cc4f5);
}
.profile-photo {
  position: relative;
  display: grid;
  place-items: center;
  width: 112px; height: 112px;
  margin-top: -72px;
  border: 4px solid var(--modal-bg);
  border-radius: 50%;
  background: linear-gradient(160deg, #dfe7f2, #b6c6db);
  box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .45);
}
.profile-photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 30%; /* keep the face centred in the circle */
}
.profile-initials {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #3d5370;
}
.profile-badge {
  position: absolute;
  right: -2px; bottom: 2px;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border: 3px solid var(--modal-bg);
  border-radius: 8px;
  background: #0a66c2;
  color: #fff;
  font: 700 16px/1 var(--font-display);
  letter-spacing: -0.04em;
}
.profile-text { display: grid; gap: 2px; }
.profile-text .modal-title { margin-top: 2px; }
.profile-role { margin: 6px 0 0; font-size: 17px; font-weight: 600; line-height: 1.3; }

/* ---------- Patents: styled like a download window ---------- */
.dl-panel {
  border: 1px solid var(--modal-line);
  border-radius: 14px;
  overflow: hidden;
}
.dl-list { list-style: none; margin: 0; padding: 0; }
.dl-list li + li { border-top: 1px solid var(--modal-line); }
.dl-item {
  --c: var(--ok);
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
  transition: background-color .15s ease;
}
.dl-item--pending { --c: var(--pending); }
.dl-item:hover { background: var(--modal-chip); }
.dl-item:focus-visible { outline-offset: -2px; border-radius: 0; }
.dl-icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 10px;
  background: linear-gradient(160deg, #fdfaf1, #efe7d4);
  box-shadow: 0 3px 8px -4px rgba(0, 0, 0, .35);
}
.dl-icon svg { width: 82%; height: 82%; }
.dl-main { display: grid; gap: 7px; min-width: 0; }
.dl-title { font-weight: 600; font-size: 15px; line-height: 1.3; }
.dl-item:hover .dl-title { text-decoration: underline; }
.dl-bar {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--dl-track);
  overflow: hidden;
}
.dl-fill {
  display: block;
  width: var(--p);
  height: 100%;
  border-radius: inherit;
  background-color: var(--c);
}
.modal[open] .dl-fill { animation: dl-fill 1.6s cubic-bezier(.3, .7, .2, 1) .15s both; }
@keyframes dl-fill { from { width: 0; } }
/* Pending keeps moving stripes, like a download still in progress */
.dl-item--pending .dl-fill {
  background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .3) 0 6px, transparent 6px 12px);
  background-size: 16.97px 16.97px;
}
.modal[open] .dl-item--pending .dl-fill {
  animation: dl-fill 1.6s cubic-bezier(.3, .7, .2, 1) .15s both, dl-stripes .9s linear infinite;
}
@keyframes dl-stripes { to { background-position: 16.97px 0; } }
.dl-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 12px;
  font-size: 13px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.dl-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--c);
  font-weight: 600;
}
.dl-status::before { /* check mark for granted */
  content: "";
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--c) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.2 6.2 5.1 8 8.8 4.2' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.dl-item--pending .dl-status::before { /* spinner for pending */
  box-sizing: border-box;
  background: none;
  border: 2px solid var(--dl-track);
  border-top-color: var(--c);
  animation: dl-spin .9s linear infinite;
}
@keyframes dl-spin { to { rotate: 360deg; } }
.dl-go {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--modal-chip);
  color: var(--ink-dim);
}
.dl-go svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.dl-item:hover .dl-go { color: var(--ink); }
.dl-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 9px 16px;
  border-top: 1px solid var(--modal-line);
  background: var(--dl-foot);
  color: var(--ink-faint);
  font-size: 12.5px;
}

/* ==========================================================================
   Narrow screens: one monitor, KVM on top, a smaller desk
   ========================================================================== */
@media (max-width: 719px) {
  .wall { padding-top: clamp(24px, 5vh, 44px); }

  .scene { width: calc(100% - 32px); }

  .monitors { margin-bottom: -3px; }
  .monitor { width: 100%; }
  :root[data-active="fun"] .monitor--work,
  :root[data-active="work"] .monitor--fun { display: none; }

  .bezel { padding: 7px; border-radius: 14px; }
  .screen { aspect-ratio: 4 / 3; border-radius: 7px; }
  .neck { width: 34px; height: 30px; }
  .foot { width: 120px; height: 8px; border-radius: 8px 8px 3px 3px; }

  .menubar { height: clamp(24px, 8cqi, 30px); font-size: clamp(11px, 3.6cqi, 13px); }
  .apps { gap: 1.5cqi; padding: 0 2cqi 2cqi; }
  .app { width: 31cqi; padding: 3cqi 1cqi; }
  .app-icon { width: 22cqi; }
  .app-icon--linkedin { font-size: 11.5cqi; }
  .app-label { font-size: max(12px, 4.3cqi); }

  .bezel::before { inset: -18px -12px -10px; }

  /* The monitor sits on a black desktop case, which sits on the desk */
  .base-unit {
    display: block;
    position: relative;
    z-index: 1;
    width: 80%;
    margin: 0 auto -18px;
    font-size: 12px;
  }
  .base-top {
    display: block;
    height: 7px;
    margin: 0 5px;
    border-radius: 5px 5px 0 0;
    background: linear-gradient(to bottom, var(--tower-hi), var(--tower));
  }
  .base-front {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 42px;
    padding: 0 14px;
    border-radius: 3px 3px 7px 7px;
    background: linear-gradient(to bottom, var(--tower), #050506);
    box-shadow: 0 12px 16px -8px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .07);
  }
  .base-bay {
    width: 42%;
    height: 4px;
    border-radius: 2px;
    background: #000;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .08);
  }
  .base-leds { display: flex; gap: 8px; margin-left: auto; }
  .base-power {
    width: 15px; height: 15px;
    border-radius: 50%;
    background: radial-gradient(circle, #1c1d21 55%, #2c2d33 60%);
    box-shadow: 0 0 0 2px var(--power-ring), 0 0 8px 2px var(--power-glow);
  }

  /* Room light switch on the wall, to the right of the KVM */
  .light-switch { top: 14px; right: 2px; width: 28px; }

  /* Desk: mug and notebook side by side; tower, keyboard and mouse hidden */
  .desk { height: auto; padding: 36px 0 26px; }
  .desk-top { bottom: 12px; }
  .desk-edge { height: 12px; }
  .props {
    position: relative;
    inset: auto;
    display: grid;
    grid-template-columns: auto auto; /* mug and notebook side by side */
    justify-content: center;
    align-items: end;
    column-gap: 10px;
    align-items: end;
    column-gap: 12px;
  }
  .props > * { position: relative; top: auto; left: auto; right: auto; translate: none; }
  .tower, .keyboard, .mouse { display: none; }

  /* Both scale with the screen so they share one row, keeping their proportions;
     they stop growing at their full size. (100vw - 42px) is the row's width. */
  .mug { font-size: min(17px, calc((100vw - 42px) * .0377)); margin-right: 2.1em; } /* margin leaves room for the handle */
  .notebook { font-size: min(14.4px, calc((100vw - 42px) * .0319)); }

  /* The KVM switch, resting on top of the monitor */
  .kvm {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 14px;
    width: max-content;
    margin: 0 auto -2px;
    padding: 8px 14px 8px 12px;
    border-radius: 10px 10px 3px 3px;
    background: linear-gradient(to bottom, #4a4b51, #2a2b30 55%, #232428);
    box-shadow: 0 6px 10px -6px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.12);
    color: #d7d8de;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .kvm-brand {
    display: grid;
    padding-right: 12px;
    border-right: 1px solid rgba(255,255,255,.1);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .14em;
    line-height: 1.15;
    color: #c1c3ca;
  }
  .kvm-brand small { font-size: 8px; font-weight: 600; letter-spacing: .12em; color: #8a8c95; text-transform: uppercase; }
  .kvm-port {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #b8bac2;
    user-select: none;
  }
  .led {
    width: 7px; height: 7px; border-radius: 50%;
    background: #3a3b40;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.5);
    transition: background-color .2s, box-shadow .2s;
  }
  :root[data-active="work"] .kvm-port--work .led,
  :root[data-active="fun"] .kvm-port--fun .led {
    background: #4be27a;
    box-shadow: 0 0 8px 1px #4be27a;
  }
  :root[data-active="work"] .kvm-port--work,
  :root[data-active="fun"] .kvm-port--fun { color: #fff; }

  .kvm-dial {
    position: relative;
    display: grid;
    place-items: center;
    width: 50px; height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, #2a2b30, #111215 70%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,.7), 0 1px 0 rgba(255,255,255,.08);
  }
  .kvm-dial::before, .kvm-dial::after { /* position marks */
    content: "";
    position: absolute;
    top: -4px;
    width: 2px; height: 5px;
    border-radius: 1px;
    background: #8a8c95;
  }
  .kvm-dial::before { left: 8px; rotate: -45deg; }
  .kvm-dial::after { right: 8px; rotate: 45deg; }
  .kvm-knob {
    position: relative;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: repeating-conic-gradient(#d4d5da 0 5deg, #8d8f96 5deg 10deg);
    box-shadow: 0 3px 5px rgba(0,0,0,.6);
    rotate: -45deg;
    transition: rotate .4s cubic-bezier(.3, 1.5, .5, 1);
  }
  .kvm-knob::before { /* cap */
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 30%, #f4f4f6, #b3b5bb 75%);
    box-shadow: inset 0 -2px 3px rgba(0,0,0,.15);
  }
  .kvm-pointer {
    position: absolute;
    left: 50%; top: 5px;
    width: 3px; height: 12px;
    margin-left: -1.5px;
    border-radius: 2px;
    background: #e8553a;
  }
  :root[data-active="fun"] .kvm-knob { rotate: 45deg; }
  .kvm:active .kvm-knob { filter: brightness(.94); }
}

/* Very small phones */
@media (max-width: 360px) {
  .props { column-gap: 8px; }
  .kvm { gap: 10px; padding-inline: 10px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
  .screen.is-switching, .modal[open], .modal[open]::backdrop, .steam, .tower-strip, .dl-fill, .term-cursor { animation: none !important; }
  .dl-status::before { animation-duration: 3s !important; }
  .blink { animation-duration: 6s !important; }
  .steam { opacity: 0; }
}

/* ---------- Wide modal: text left, picture right (Younger Then) ---------- */
.modal--wide { width: min(900px, 100% - 32px); }
.modal-card--split {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 30px;
  align-items: stretch;
}
.modal-card--split > form { display: contents; } /* keep the close button out of the grid */
.modal-col { display: grid; gap: 14px; align-content: start; }
.modal-figure {
  margin: -28px -28px -28px 0;
  min-height: 100%;
}
.modal-figure > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
}
.modal-card--split .modal-close {
  z-index: 1;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
/* Tall phone-format picture: a slimmer picture column */
.modal-card--portrait { grid-template-columns: minmax(0, 1fr) 272px; }
.modal-card--portrait .modal-col { align-content: center; }
.modal-card--portrait .modal-figure > img { object-position: 50% 40%; }
@media (max-width: 760px) {
  .modal--wide { width: min(520px, 100% - 32px); }
  .modal-card--split { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  /* Phones: the picture sits on top at its own shape, so none of it is cropped */
  .modal-figure { order: -1; margin: -28px -28px 6px; min-height: 0; display: flex; justify-content: center; background: #121214; }
  .modal-figure > img { width: auto; max-width: 100%; height: auto; max-height: min(62svh, 480px); object-fit: contain; }
  .modal-figure > img { object-position: 50% 22%; } /* show more of the projected picture */
  .modal-card--portrait { grid-template-columns: minmax(0, 1fr); }
  .modal-card--portrait .modal-col { align-content: start; }
  .modal-card--portrait .modal-figure > img { object-position: 50% 30%; }
}

/* ---------- Quiz Aloud: live demo (ported from quizaloud website) ---------- */
.modal-card--demo { grid-template-columns: minmax(0, 1fr) 300px; }
.modal-card--demo .modal-col { align-content: center; }
.qa-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 196, 20, .5), transparent 58%),
    linear-gradient(160deg, #fff3cc, #ffd7ae 45%, #c8defc);
}
.qa-phone {
  --ink: #14245a; --blue: #2c6fdc; --good: #2fb85a; --oops: #f08a1c; --reveal: #2c6fdc; --c-green: 47, 184, 90;
  --rounded: ui-rounded, "SF Pro Rounded", "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: relative;
  flex: none;
  width: 300px;
  padding: 11px;
  border-radius: 48px;
  background: var(--ink);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 34px 64px -26px rgba(20, 36, 90, .6);
  transform: rotate(-2.5deg);
  zoom: .8;
  font-weight: 500;
  line-height: 1.6;
}
.qa-screen {
  position: relative; aspect-ratio: 9 / 19.5; border-radius: 38px; overflow: hidden;
  background: #fff; display: flex; flex-direction: column; align-items: center;
  font-family: var(--rounded); color: #1d1d1f; text-align: center;
}
.qa-screen::before { content: ""; position: absolute; inset: 0; background: rgba(var(--qt, var(--c-green)), .09); transition: background .4s ease; }
.qa-screen > * { position: relative; }
.qa-island { width: 92px; height: 26px; background: #000; border-radius: 99px; margin-top: 10px; flex: none; }
.qa-bar { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 12px 18px 0; font-size: .78rem; font-weight: 700; color: var(--blue); }
.qa-bar span { white-space: nowrap; }
.qa-bar .qa-pill { color: #1d1d1f; font-weight: 800; font-size: .8rem; }
.qa-bar span:last-child { width: 52px; }
.qa-cat { margin-top: 10px; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: rgb(var(--qt, var(--c-green))); }
.qa-q { position: relative; flex: 1; width: 100%; display: flex; align-items: center; justify-content: center; padding: 0 18px; }
.qa-card { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; transition: opacity .3s ease; }
.qa-card[hidden] { display: none; }
.qa-card.is-hidden { opacity: 0 !important; }
.qa-img { display: block; width: 100%; max-height: 190px; object-fit: contain; border-radius: 14px; transition: opacity .3s ease; }
.qa-img[hidden] { display: none; }
.qa-text { font-weight: 900; font-size: 1.35rem; line-height: 1.15; }
.qa-text.big { font-size: 3.4rem; letter-spacing: -.02em; }
.qa-feedback { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; pointer-events: none; padding: 0 10px; }
.qa-answer { font-size: 3.2rem; font-weight: 900; line-height: 1.05; display: none; }
.qa-answer.show { display: block; animation: qa-rise .3s ease; }
@keyframes qa-rise { from { opacity: 0; transform: translateY(8px); } }
.qa-listen { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0 16px 6px; flex: none; }
.qa-character { display: block; aspect-ratio: 1500 / 990; max-width: none; height: 136px; }
.qa-screen.mode-table .qa-character { height: 100px; }
.qa-screen.mode-table .qa-cat { margin-bottom: 4px; }
.qa-heard { font-weight: 700; font-size: 1.05rem; min-height: 2.2em; color: #1d1d1f; line-height: 1.2; display: flex; align-items: center; }
.qa-banner {
  transform: scale(.4); opacity: 0; display: none;
  color: #fff; font-weight: 900; font-size: 1.45rem; padding: 12px 24px; border-radius: 18px; white-space: nowrap;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, .35); transition: transform .35s cubic-bezier(.3, 1.7, .5, 1), opacity .2s ease;
}
.qa-banner.on { display: block; }
.qa-banner.show { transform: scale(1); opacity: 1; }
.qa-banner.good { background: var(--good); }
.qa-banner.oops { background: var(--oops); }
.qa-banner.reveal { background: var(--reveal); font-size: 1.1rem; white-space: normal; max-width: 92%; text-align: center; }
.qa-home { width: 120px; height: 5px; background: #1d1d1f; border-radius: 99px; margin: 0 0 9px; flex: none; opacity: .85; }
.qa-confetti { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.qa-confetti i {
  position: absolute; top: 46%; left: 50%; width: 8px; height: 12px; border-radius: 2px; opacity: 0;
  animation: qa-pop 1s cubic-bezier(.2, .7, .3, 1) forwards;
}
@keyframes qa-pop {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(0); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--rot)); }
}
.qa-tt { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qa-tt[hidden] { display: none; }
.qa-grid { --t: var(--qt); display: grid; width: 100%; max-width: 236px; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.qa-grid b {
  aspect-ratio: 1; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font: 800 1rem/1 var(--rounded); font-variant-numeric: tabular-nums;
  background: rgba(20, 36, 90, .1); color: var(--ink); transition: background .25s ease, color .25s ease, transform .3s cubic-bezier(.3, 1.7, .5, 1);
}
.qa-grid b.head { background: rgba(var(--t), .18); color: rgb(var(--t)); font-weight: 900; }
.qa-grid b.head.lit { background: rgb(var(--t)); color: #fff; }
.qa-grid b.blank { background: rgba(20, 36, 90, .04); }
.qa-grid b.ask { background: rgba(var(--t), .3); box-shadow: inset 0 0 0 2.5px rgb(var(--t)); color: rgb(var(--t)); font-weight: 900; }
.qa-grid b.good { background: var(--good); color: #fff; transform: scale(1.15); position: relative; z-index: 1; }
.qa-grid b.reveal { background: var(--reveal); color: #fff; }
.qa-eq { position: relative; font: 900 2rem/1.2 var(--rounded); font-variant-numeric: tabular-nums; transition: color .2s ease; }
.qa-eq.good { color: var(--good); }
.qa-eq-feedback { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; pointer-events: none; }

@media (max-width: 760px) { /* after the demo's base styles, so these win */
  .modal-card--demo { grid-template-columns: minmax(0, 1fr); }
  .modal-card--demo .modal-col { align-content: start; }
  .qa-stage { aspect-ratio: auto; padding: 20px 16px; }
  .qa-phone { zoom: .66; }
}

/* ---------- Modals on small phones: tighter spacing ---------- */
@media (max-width: 480px) {
  .modal-card { padding: 22px; }
  .profile-banner { margin: -36px -22px 0; }
  .modal-figure { margin: -22px -22px 6px; }
  .dl-item { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .dl-go { display: none; } /* the whole row is the link */
  .dl-title { font-size: 14.5px; }
  .dl-icon { width: 36px; height: 36px; border-radius: 8px; }
  .dl-foot { padding-inline: 12px; }
}
