/* The Apex channel: the site is a little TV set. The picture uses the
   browser's own paper, ink and companion colours; the set around it is
   soft plastic. Fonts (all OFL, in ../fonts): Inter for everything, Nunito
   for what the companions say, VT323 for the set's own displays. */

@font-face {
  font-family: 'Nunito';
  font-weight: 500 900;
  font-display: swap;
  src: url('../fonts/nunito-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin-wght.woff2') format('woff2');
}

@font-face {
  font-family: 'VT323';
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/vt323-latin.woff2') format('woff2');
}

:root {
  color-scheme: light dark;

  --plastic: light-dark(#ebe5da, #2b2826);
  --plastic-hi: light-dark(#f8f4ed, #3a3633);
  --plastic-lo: light-dark(#d7cebf, #1d1b1a);
  --plastic-ink: light-dark(#9a8f7f, #8a8279);

  --paper: light-dark(#fdfcfa, #222120);
  --paper-2: light-dark(#f8f7f4, #262523);
  --ground: light-dark(#eeece8, #302d2a);
  --raised: light-dark(#ffffff, #2f2d2b);
  --ink: light-dark(#1c1a17, #f1efec);
  --ink-2: light-dark(#66615a, #aaa49d);
  --ink-3: light-dark(#8d877f, #7f7972);
  --line: light-dark(#e3dfd9, #3a3734);
  --violet: light-dark(#6a4bff, #8c72ff);
  --violet-key: #7657ff;
  --violet-lo: #4529c4;
  --pink: #ff7eb6;
  --ok: light-dark(#1e9467, #3fcf8e);

  --round: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  --brand: 'Inter', system-ui, sans-serif;
  --pixel: 'VT323', ui-monospace, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-floor: linear(0, 0.072, 0.238, 0.438, 0.632, 0.797, 0.922, 1.008, 1.058, 1.08, 1.083, 1.073, 1.058, 1.041, 1.026, 1.013, 1.004, 0.998, 0.994, 0.993, 0.993, 0.994, 0.996, 0.997, 1);
  --tint: #8f74f8;
}

/* Anything with a companion colour gets its readable ink and a wash. */
:root,
[style*='--tint'] {
  --tint-ink: light-dark(color-mix(in srgb, var(--tint) 45%, #1c1a17), color-mix(in srgb, var(--tint) 76%, #f1efec));
  --tint-wash: light-dark(color-mix(in srgb, var(--tint) 24%, transparent), color-mix(in srgb, var(--tint) 14%, transparent));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* The set fills the first screen; the page (page.css) scrolls on under it. */
html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

html {
  /* (Browsers without overflow: clip, Safari before 16: hidden, on the root only, so sticky still works.) */
  overflow-x: hidden;
  overflow-x: clip;
  background: #fffcfa;
}

body {
  /* The dark room the set sinks into; the page and the foot bring their own paper. */
  background: #0d0c0b;
  color: var(--ink);
  /* One typeface for the whole site, the set included. The rounded one is
     kept for what the companions say (the speech bubbles, below). */
  font-family: var(--brand);
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
p {
  margin: 0;
  text-wrap: balance;
}

.tv :where(h1, h2) {
  font-weight: 620;
  letter-spacing: -0.035em;
}

/* A companion's own voice: the rounded face, only in what it says. */
.tv .bubble,
.tv .say {
  font-family: var(--round);
  font-weight: 800;
  letter-spacing: 0;
}

.tv .say__keys b,
.tv .say__keys i {
  font-family: var(--brand);
  font-weight: 600;
  letter-spacing: -0.011em;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  -webkit-user-drag: none;
  user-select: none;
}

button {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
}

.i {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The faint pool of light in the room where the set ends up. A fixed layer
   of its own rather than a fixed background: that one makes the browser
   repaint the whole page on every frame of a scroll (and iOS ignores it).
   As tall as the screen gets with the toolbars gone, so it never comes up short. */
body:not(.doc)::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  height: 100lvh;
  background: radial-gradient(48% 42% at 50% 44%, #221f26, #0d0c0b 72%);
  pointer-events: none;
}

/* ---- the set ---- */

.tv {
  /* The set is the dark thing on a light page, whatever the system prefers.
     Its text colour is set here too, so it is read in the dark scheme and
     not inherited, already resolved, from the light page around it. */
  color-scheme: dark;
  color: var(--ink);
  /* Scrolling down happens in two acts, set by tv.js:
     --away (0 to 1) while the first part of the scroll passes: the set sinks
     far back into the dark and nothing else moves (.tv__depth holds that
     stretch of the page open);
     --cover (0 to 1) after it: the page rises over the set, which settles a
     little further and dims. */
  position: sticky;
  top: 0;
  z-index: 0;
  transform-origin: 50% 40%;
  transform: perspective(1400px)
    translate3d(0, calc(var(--away, 0) * -2vh + var(--cover, 0) * -4vh), calc(var(--away, 0) * -1100px + var(--cover, 0) * -240px))
    rotateX(calc(var(--away, 0) * 9deg));
  border-radius: calc(var(--away, 0) * 44px);
  will-change: transform;
  isolation: isolate;
  /* Its rounded corners as it recedes clip everything in it (the grain too). */
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto auto;
  /* The whole first screen: the page waits underneath until it is asked for.
     The small viewport (svh), not the dynamic one: on phones dvh changes as the
     toolbars come and go, which would resize the set and jolt everything under
     it in the middle of a scroll. */
  height: 100vh;
  height: 100svh;
  min-height: 320px;
  padding: clamp(8px, 1.3vw, 18px) clamp(8px, 1.3vw, 18px) 0;
  background: radial-gradient(130% 90% at 50% 0%, var(--plastic-hi), var(--plastic) 55%, var(--plastic-lo));
}

/* The room's light going down on the set as it recedes. */
.tv::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 50;
  border-radius: inherit;
  background: #0d0c0b;
  opacity: calc(var(--away, 0) * 0.35 + var(--cover, 0) * 0.45);
  pointer-events: none;
}

/* The hand with the remote: it comes up from the bottom right as the set
   recedes (--hand, 0 to 1), presses the power button when the set is far
   enough away (data-press, replayed by tv.js: the press frame shows for a
   moment), and goes down again as the page rises (--cover). Two frames
   rendered like the companions, at twice the size shown. It sits between
   the set and the page. */
.remote {
  position: fixed;
  --w: clamp(130px, 15vw, 220px);
  right: max(5vw, 12px);
  /* The sleeve runs on below the screen: the remote, mitten and cuff show (the image is 2.1 times as tall as wide). */
  bottom: calc(var(--w) * -0.78);
  z-index: 1;
  width: var(--w);
  aspect-ratio: 440 / 928;
  pointer-events: none;
  transform: translate3d(calc((1 - var(--hand, 0)) * 22vw), calc((1 - var(--hand, 0)) * 75vh + var(--cover, 0) * 70vh), 0);
  filter: drop-shadow(0 18px 26px rgba(10, 6, 30, 0.5));
  will-change: transform;
}

.remote img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.remote__press {
  opacity: 0;
}

.remote[data-press] .remote__press {
  animation: remote-press 460ms steps(1) both;
}

.remote[data-press] .remote__rest {
  animation: remote-rest 460ms steps(1) both;
}

@keyframes remote-press {
  0% {
    opacity: 0;
  }
  12%,
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes remote-rest {
  0% {
    opacity: 1;
  }
  12%,
  80% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* The stretch of scroll in which the set recedes and the page stays hidden. */
.tv__depth {
  height: 75vh;
  height: 75svh;
  pointer-events: none;
}

/* Once the page covers the set completely, the set and the hand are not drawn
   at all (tv.js sets data-covered), so a scroll down the page only moves the page. */
.tv[data-covered],
.remote[data-covered] {
  visibility: hidden;
}

/* The way down, stamped into the plastic under the controls. It fades as
   soon as the set starts to recede. */
.tv__more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  justify-self: center;
  padding: 2px 18px 10px;
  color: var(--plastic-ink);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  opacity: calc(1 - var(--away, 0) * 5);
  transition: color 0.2s;
}

.tv__more:hover {
  color: var(--ink);
}

.tv__more .i {
  width: 18px;
  height: 18px;
  animation: more-bob 1.8s ease-in-out infinite;
}

@keyframes more-bob {
  50% {
    transform: translateY(4px);
  }
}

.tv__more-short {
  display: none;
}

@media (max-width: 560px) {
  .tv__more-long {
    display: none;
  }

  .tv__more-short {
    display: inline;
  }
}

/* A little grain in the plastic. */
.tv::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  opacity: light-dark(0.35, 0.5);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .4 0 0 0 .12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* The tube's dark rim, set into the plastic. */
.tv__glass {
  min-height: 0;
  padding: clamp(5px, 0.6vw, 9px);
  border-radius: clamp(26px, 3.2vw, 46px);
  background: linear-gradient(180deg, #100f0e, #1f1c1a);
  box-shadow:
    0 0 0 1px light-dark(#c8bead, #121110),
    0 2px 0 1px var(--plastic-hi),
    inset 0 1px 1px rgba(255, 255, 255, 0.07),
    inset 0 -3px 8px rgba(0, 0, 0, 0.6);
}

.tv__screen {
  position: relative;
  isolation: isolate;
  height: 100%;
  overflow: hidden;
  border-radius: clamp(20px, 2.6vw, 38px);
  background: #0b0a09;
  container-type: size;
  container-name: screen;
}

.tv__picture {
  position: absolute;
  inset: 0;
  background: var(--paper);
}

/* Power on: a bright line, then the picture. */
.tv[data-power='off'] .tv__picture {
  clip-path: inset(50% 50% 50% 50%);
}

.tv[data-power='on'] .tv__picture {
  animation: power-on 1000ms var(--ease-out) both;
}

/* The picture is light or dark, like the browser: light unless someone
   picks dark with the key on the set (data-picture, from tv.js). The set
   around it stays dark either way. */
.tv__screen {
  color-scheme: light;
  color: var(--ink);
}

.tv[data-picture='light'] .tv__screen {
  color-scheme: light;
}

.tv[data-picture='dark'] .tv__screen {
  color-scheme: dark;
}

/* Switched off with the remote: the picture collapses to a bright line,
   then a dot, then the dot fades, the way a tube goes off. */
.tv[data-remote][data-power='off'] .tv__picture {
  animation: power-off 620ms var(--ease-standard) both;
}

@keyframes power-off {
  0% {
    clip-path: inset(0);
    filter: none;
  }
  38% {
    clip-path: inset(49.5% 0 49.5% 0);
    filter: brightness(4) saturate(0);
  }
  72% {
    clip-path: inset(49.5% 49.6% 49.5% 49.6%);
    filter: brightness(6) saturate(0);
  }
  100% {
    clip-path: inset(50%);
    filter: brightness(6) saturate(0);
  }
}

.tv[data-remote][data-power='off'] .tv__screen::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 30;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 28%, rgba(205, 195, 255, 0.6) 48%, transparent 72%);
  animation: afterglow 1300ms ease-out both;
  pointer-events: none;
}

@keyframes afterglow {
  0%,
  50% {
    opacity: 0;
    transform: scale(2.6);
  }
  58% {
    opacity: 1;
    transform: scale(1.6);
  }
  100% {
    opacity: 0;
    transform: scale(0.3);
  }
}

@keyframes power-on {
  0% {
    clip-path: inset(49.6% 50% 49.6% 50%);
    filter: brightness(4) saturate(0);
  }
  28% {
    clip-path: inset(49.6% 0 49.6% 0);
    filter: brightness(4) saturate(0);
  }
  62% {
    clip-path: inset(0 0 0 0);
    filter: brightness(1.7) saturate(0.6);
  }
  100% {
    clip-path: inset(0 0 0 0);
    filter: none;
  }
}

/* The glass: sheen, vignette, scanlines and a slow rolling bar. */
.crt {
  position: absolute;
  inset: 0;
  z-index: 30;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(162deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 26%),
    radial-gradient(140% 125% at 50% 45%, transparent 58%, light-dark(rgba(30, 16, 60, 0.2), rgba(0, 0, 0, 0.45)) 100%),
    repeating-linear-gradient(0deg, light-dark(rgba(20, 10, 40, 0.035), rgba(0, 0, 0, 0.16)) 0 1px, transparent 1px 3px);
  box-shadow:
    inset 0 0 60px light-dark(rgba(20, 10, 40, 0.12), rgba(0, 0, 0, 0.4)),
    inset 0 0 2px rgba(0, 0, 0, 0.5);
}

.crt::after {
  content: '';
  position: absolute;
  inset: -30% 0 auto;
  height: 22%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: roll 9s linear infinite;
}

@keyframes roll {
  to {
    transform: translateY(620%);
  }
}

.static {
  position: absolute;
  inset: 0;
  z-index: 25;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms;
}

.static[data-on] {
  opacity: 1;
  transition: none;
}

/* The on-screen display, as a set shows the channel. */
.osd {
  position: absolute;
  top: clamp(14px, 4cqh, 36px);
  left: clamp(16px, 3.4cqw, 44px);
  z-index: 31;
  display: flex;
  flex-direction: column;
  color: #fff;
  font-family: var(--pixel);
  line-height: 0.82;
  text-shadow:
    0 0 10px rgba(150, 120, 255, 0.9),
    2px 2px 0 rgba(20, 10, 50, 0.6),
    -1px -1px 0 rgba(20, 10, 50, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms;
}

.osd[data-on] {
  opacity: 1;
  transition: none;
}

.osd b {
  font-size: clamp(38px, 8cqh, 76px);
  font-weight: 400;
}

.osd span {
  font-size: clamp(20px, 3.6cqh, 34px);
  letter-spacing: 0.05em;
}

/* ---- the panel under the screen ---- */

.panel {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.2vw, 16px);
  height: clamp(66px, 9.5vh, 86px);
  padding: 0 clamp(6px, 1.4vw, 22px);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--plastic-ink);
  font-family: var(--brand);
  font-size: 22px;
  font-weight: 550;
  letter-spacing: -0.035em;
  text-decoration: none;
  text-shadow:
    0 1px 0 var(--plastic-hi),
    0 -1px 0 light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5));
}

/* The logo, the word with its sprout, pressed into the plastic. */
.badge__logo {
  width: auto;
  height: 34px;
  margin-top: -6px;
  filter: drop-shadow(0 1px 0 var(--plastic-hi));
}

.led {
  flex: none;
  width: 8px;
  height: 8px;
  margin-left: 4px;
  border-radius: 50%;
  background: #6b2a22;
  box-shadow: inset 0 -1px 1px rgba(0, 0, 0, 0.4);
  transition: background 300ms, box-shadow 300ms;
}

.tv[data-power='on'] .led {
  background: #49e08e;
  box-shadow:
    0 0 8px #49e08e,
    inset 0 -1px 1px rgba(0, 0, 0, 0.25);
}

/* Off with the remote: standby, a red light. */
.tv[data-remote][data-power='off'] .led {
  background: #ff4d4f;
  box-shadow:
    0 0 8px #ff4d4f,
    inset 0 -1px 1px rgba(0, 0, 0, 0.25);
}

.grille {
  flex: 1;
  min-width: 24px;
  height: 30px;
  background: radial-gradient(circle, var(--plastic-lo) 1.6px, transparent 2.1px) 0 0 / 9px 9px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}

.tuner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lcd {
  display: flex;
  align-items: center;
  gap: 12px;
  width: clamp(150px, 20vw, 250px);
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #1f1b33, #141126);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.7),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 1px 0 var(--plastic-hi);
  color: #b4a3ff;
  font-family: var(--pixel);
  font-size: 27px;
  line-height: 1;
  text-shadow: 0 0 7px rgba(150, 120, 255, 0.85);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
}

.lcd__num {
  color: #e2d9ff;
}

.lcd__name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.presets {
  display: flex;
  gap: 6px;
  /* Room for the five keys tv.js puts in, so the panel doesn't shift when they arrive. */
  min-width: calc(5 * 30px + 4 * 6px);
  min-height: 30px;
}

.preset {
  position: relative;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--plastic-hi), var(--plastic));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 2px 0 var(--plastic-lo),
    0 3px 6px rgba(40, 30, 20, 0.15);
  color: var(--plastic-ink);
  font-family: var(--pixel);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.preset:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 var(--plastic-lo);
}

.preset::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -7px;
  width: 4px;
  height: 4px;
  translate: -50% 0;
  border-radius: 50%;
  background: transparent;
}

.preset[aria-current='true'] {
  color: var(--violet);
}

.preset[aria-current='true']::after {
  background: #49e08e;
  box-shadow: 0 0 6px #49e08e;
}

/* Off with the remote, the set's displays go dark with the picture. */
.lcd,
.preset::after {
  transition:
    opacity 400ms,
    filter 400ms;
}

.tv[data-remote][data-power='off'] .lcd {
  opacity: 0.3;
  filter: saturate(0);
}

.tv[data-remote][data-power='off'] .preset::after {
  opacity: 0;
}

/* Keys: soft plastic buttons that press in. */
.key {
  --key: light-dark(#fbf8f3, #423e3a);
  --key-lo: light-dark(#d2c8b8, #191716);
  --key-ink: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--key) 100%, white), color-mix(in srgb, var(--key) 90%, black));
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.55),
    0 4px 0 var(--key-lo),
    0 6px 12px rgba(40, 30, 20, 0.18);
  color: var(--key-ink);
  font: 600 16px/1 var(--brand);
  letter-spacing: -0.015em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 80ms,
    box-shadow 80ms,
    filter 120ms;
}

.key:hover {
  filter: brightness(1.04);
}

.key:active,
.key[data-pressed] {
  transform: translateY(3px);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.4),
    0 1px 0 var(--key-lo),
    0 2px 4px rgba(40, 30, 20, 0.18);
}

.key--round {
  width: 46px;
  padding: 0;
}

.key--go {
  --key: var(--violet-key);
  --key-lo: var(--violet-lo);
  --key-ink: #fff;
}

.key--big {
  height: 56px;
  padding: 0 28px;
  font-size: 19px;
}

.key--big .i {
  width: 22px;
  height: 22px;
}

.key--huge {
  height: 68px;
  padding: 0 36px;
  font-size: 23px;
}

.key--huge .i {
  width: 26px;
  height: 26px;
}

[data-picture-toggle] .i--moon,
[data-picture-toggle][aria-pressed='true'] .i--sun {
  display: none;
}

[data-picture-toggle][aria-pressed='true'] .i--moon {
  display: block;
}

[data-sound] .i--on,
[data-sound][aria-pressed='true'] .i--off {
  display: none;
}

[data-sound][aria-pressed='true'] .i--on {
  display: block;
}

/* ---- channels ---- */

.channel {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.channel[hidden] {
  display: none;
}

.channel h2 {
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.02;
}

/* ---- CH 1: the square ---- */

.ch-square {
  background: var(--paper);
  /* A finger on the floor scrolls the page; on a companion it picks it up. */
  touch-action: pan-y;
}

.sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, light-dark(#e6dfff, #1d1a2c) 0%, light-dark(#f3effb, #24212f) 30%, var(--paper) 52%);
  transition: background 1200ms var(--ease-standard);
}

.cloud {
  position: absolute;
  top: 9%;
  left: -30%;
  width: 34cqw;
  height: 11cqh;
  border-radius: 50%;
  background: radial-gradient(closest-side, light-dark(rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.05)), transparent);
  animation: drift 110s linear infinite;
}

.cloud:nth-child(2) {
  top: 22%;
  width: 26cqw;
  animation-duration: 140s;
  animation-delay: -60s;
}

.cloud:nth-child(3) {
  top: 4%;
  width: 22cqw;
  animation-duration: 95s;
  animation-delay: -30s;
}

@keyframes drift {
  to {
    transform: translateX(170cqw);
  }
}

.stars {
  position: absolute;
  inset: 0 0 50%;
  opacity: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 20%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 28% 34%, #fff, transparent),
    radial-gradient(2px 2px at 44% 12%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 63% 28%, #fff, transparent),
    radial-gradient(2px 2px at 78% 16%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 90% 36%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 6% 42%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 55% 44%, #fff, transparent),
    radial-gradient(2px 2px at 35% 6%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 84% 46%, #fff, transparent);
  transition: opacity 1200ms;
}

.ch-square[data-night] .sky {
  background: linear-gradient(180deg, #120f2e 0%, #1d1840 34%, #2b2350 54%);
}

.ch-square[data-night] .stars {
  opacity: 0.9;
  animation: twinkle 3s ease-in-out infinite alternate;
}

.ch-square[data-night] .cloud {
  opacity: 0.08;
}

@keyframes twinkle {
  to {
    opacity: 0.5;
  }
}

.ch-square[data-night] .square__floor {
  filter: saturate(0.9);
}

.ch-square[data-night] .sprite {
  filter: brightness(0.78) saturate(0.85);
}

.ch-square[data-night] .square__title h1,
.ch-square[data-night] .square__title p {
  color: #f1efec;
}

.square__floor {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  transition: filter 1200ms;
}

.square__title {
  position: absolute;
  top: clamp(16px, 6cqh, 64px);
  left: 50%;
  z-index: 3;
  translate: -50% 0;
  width: max-content;
  max-width: 90%;
  text-align: center;
  pointer-events: none;
}

.square__title h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.16em;
  font-family: var(--brand);
  font-size: clamp(42px, 10cqh, 104px);
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.05em;
  transition: color 1200ms;
}


/* The logo itself: the word in the title's colour (so it turns with the lights), the sprout violet. */
.square__logo {
  width: auto;
  height: 1.5em;
}

.square__title p {
  margin-top: 0.2em;
  color: var(--ink-2);
  font-size: clamp(17px, 2.8cqh, 26px);
  font-weight: 550;
  transition: color 1200ms;
}

.square__crowd {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.actor {
  --h: 120px;
  --inv: 1;
  position: absolute;
  left: 0;
  top: 0;
  width: var(--h);
  height: var(--h);
  margin: calc(var(--h) * -1) 0 0 calc(var(--h) * -0.5);
  padding: 0;
  border: 0;
  background: none;
  transform-origin: 50% 100%;
  cursor: grab;
  touch-action: none;
  will-change: transform;
}

.actor:active {
  cursor: grabbing;
}

.actor:focus-visible {
  outline: none;
}

.actor:focus-visible .actor__ring {
  opacity: 1;
}

.actor__shadow {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 46%;
  height: 12%;
  translate: -50% 50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, light-dark(rgba(50, 30, 80, 0.3), rgba(0, 0, 0, 0.55)), transparent);
}

.actor__ring {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 62%;
  height: 16%;
  translate: -50% 50%;
  border: 3px solid color-mix(in srgb, var(--tint) 80%, white);
  border-radius: 50%;
  box-shadow: 0 0 12px color-mix(in srgb, var(--tint) 70%, transparent);
  opacity: 0;
  transition: opacity 200ms;
}

.actor[data-selected] .actor__ring {
  opacity: 1;
  animation: ring-breathe 1.8s ease-in-out infinite alternate;
}

@keyframes ring-breathe {
  to {
    scale: 1.12;
  }
}

.actor__body {
  position: absolute;
  inset: 0;
  transform-origin: 50% 100%;
}

/* One frame of the companion's sheet (or its still until the sheet is in),
   moved down so its feet stand on the actor's spot. */
.sprite {
  position: absolute;
  inset: 0;
  translate: 0 calc((1 - var(--feet, 0.9)) * 100%);
  background: center / contain no-repeat;
  pointer-events: none;
}

.sprite[data-sheet] {
  background-size: var(--sheet-size, 800% 500%);
  background-position: 0 25%;
}

.actor__tag {
  position: absolute;
  left: 50%;
  top: 100%;
  padding: 3px 10px 4px;
  translate: -50% 6px;
  scale: var(--inv);
  transform-origin: 50% 0;
  border-radius: 999px;
  background: var(--raised);
  box-shadow: 0 2px 8px rgba(40, 30, 80, 0.18);
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms;
}

.actor:hover .actor__tag,
.actor:focus-visible .actor__tag,
.actor[data-selected] .actor__tag {
  opacity: 1;
}

/* Bubbles: a glyph, a friend's face, a site, or a few words. */
.bubble {
  position: absolute;
  left: 50%;
  bottom: 82%;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 4px;
  translate: -50% 0;
  scale: var(--inv);
  transform-origin: 50% 100%;
  border-radius: 21px;
  background: var(--raised);
  box-shadow:
    0 0 0 1px light-dark(rgba(46, 36, 24, 0.06), rgba(255, 255, 255, 0.06)),
    0 6px 16px light-dark(rgba(60, 40, 120, 0.18), rgba(0, 0, 0, 0.5));
  color: var(--tint-ink);
  pointer-events: none;
  animation: bubble-pop 320ms var(--ease-floor) both;
}

.bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 10px;
  height: 10px;
  translate: -50% 0;
  rotate: 45deg;
  border-radius: 0 0 3px 0;
  background: inherit;
}

.bubble .i {
  width: 22px;
  height: 22px;
}

.bubble--heart {
  color: #ff5a8a;
}

.bubble--heart .i,
.bubble--sun .i,
.bubble--zap .i {
  fill: currentColor;
}

.bubble--sun {
  color: #f2a516;
}

.bubble--zap {
  color: #f2b31c;
}

.bubble--moon {
  color: #6f62d8;
}

.bubble--face img {
  width: 36px;
  height: 36px;
}

.bubble--site b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--c);
  color: #fff;
  font-size: 15px;
  font-weight: 650;
}

.bubble--text {
  height: auto;
  min-height: 42px;
  width: max-content;
  max-width: 250px;
  padding: 9px 15px 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 550;
  line-height: 1.25;
  text-align: center;
}

@keyframes bubble-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.5);
  }
}

/* The arrival ring when someone drops in. */
.drop-ring {
  position: absolute;
  z-index: 1;
  width: 120px;
  height: 40px;
  margin: -20px 0 0 -60px;
  border: 3px solid var(--tint);
  border-radius: 50%;
  pointer-events: none;
  animation: drop-ring 900ms var(--ease-out) both;
}

@keyframes drop-ring {
  from {
    opacity: 1;
    transform: scale(0.3);
  }
  to {
    opacity: 0;
    transform: scale(1.8);
  }
}

/* Tools: big round buttons at the side of the picture. */
.tools {
  position: absolute;
  left: clamp(12px, 2.6cqw, 34px);
  top: 50%;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 14px;
  translate: 0 -50%;
}

.tool {
  position: relative;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 28%, light-dark(#ffffff, #4a4552), light-dark(#ece7f6, #34303c));
  box-shadow:
    inset 0 -3px 0 light-dark(rgba(90, 70, 160, 0.1), rgba(0, 0, 0, 0.3)),
    0 0 0 3px light-dark(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.06)),
    0 8px 18px light-dark(rgba(70, 50, 150, 0.2), rgba(0, 0, 0, 0.5));
  color: var(--violet);
  cursor: pointer;
  transition:
    transform 160ms var(--ease-out),
    background 200ms;
}

.tool:hover {
  transform: scale(1.07);
}

.tool:active {
  transform: scale(0.95);
}

.tool .i {
  width: 27px;
  height: 27px;
}

.tool[aria-pressed='true'] {
  background: radial-gradient(circle at 50% 28%, #8f74ff, #5e40ee);
  color: #fff;
}

.tool span {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  padding: 7px 13px;
  translate: -6px -50%;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
  font-weight: 550;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 140ms,
    translate 160ms var(--ease-out);
}

.tool:hover span,
.tool:focus-visible span {
  opacity: 1;
  translate: 0 -50%;
}

.square__hint {
  position: absolute;
  right: clamp(12px, 2.6cqw, 34px);
  bottom: clamp(12px, 3.2cqh, 30px);
  z-index: 5;
  padding: 7px 15px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--raised) 82%, transparent);
  box-shadow: 0 4px 12px rgba(60, 40, 120, 0.12);
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 550;
  pointer-events: none;
}

/* The profile, as a lower third. */
.lower-third {
  position: absolute;
  left: clamp(12px, 2.6cqw, 34px);
  bottom: clamp(12px, 3.2cqh, 30px);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(600px, 100% - 24px);
  padding: 10px 12px 10px 10px;
  border-radius: 28px;
  background: var(--raised);
  box-shadow:
    0 0 0 1px light-dark(rgba(46, 36, 24, 0.06), rgba(255, 255, 255, 0.06)),
    0 14px 36px light-dark(rgba(60, 40, 120, 0.22), rgba(0, 0, 0, 0.55));
}

.lower-third[data-in] {
  animation: lt-in 460ms var(--ease-floor) both;
}

.lower-third[hidden] {
  display: none;
}

@keyframes lt-in {
  from {
    opacity: 0;
    transform: translateX(-30px) scale(0.96);
  }
}

.lt__face {
  display: grid;
  place-items: center;
  flex: none;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--tint) 30%, white), color-mix(in srgb, var(--tint) 75%, white));
}

.lt__face img {
  width: 92%;
  height: 92%;
}

.lt__text {
  min-width: 0;
}

.lt__name {
  font-size: 26px;
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.lt__tagline {
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 550;
}

.lt__good {
  margin-top: 2px;
  color: var(--tint-ink);
  font-size: 14px;
  font-weight: 550;
}

.lt__go {
  flex: none;
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tint) 30%, var(--raised));
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--tint) 45%, transparent);
  color: var(--tint-ink);
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.lt__go:active {
  transform: translateY(2px);
  box-shadow: none;
}

.lt__close {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink-3);
  cursor: pointer;
}

.lt__close .i {
  width: 18px;
  height: 18px;
}

/* ---- CH 2: in your tabs ---- */

.ch-tabs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  /* The words, then the show they describe. */
  grid-template-rows: auto minmax(0, 1fr);
  background:
    radial-gradient(60% 60% at 70% 55%, var(--tint-wash), transparent 80%),
    linear-gradient(180deg, light-dark(#f1ecff, #221f2e), var(--paper) 60%);
}

.show {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3cqw;
  min-height: 0;
  padding: 2.5cqh 5cqw 5cqh;
}

.show__window {
  display: flex;
  flex-direction: column;
  width: min(60cqw, 92cqh, 780px);
  aspect-ratio: 16 / 10;
  border-radius: 18px;
  background: var(--ground);
  box-shadow:
    0 0 0 1px light-dark(rgba(46, 36, 24, 0.08), rgba(255, 255, 255, 0.06)),
    0 24px 60px light-dark(rgba(60, 40, 120, 0.2), rgba(0, 0, 0, 0.55));
  overflow: hidden;
}

.win__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
}

.win__bar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 16%, transparent);
}

.win__tab {
  margin-left: 12px;
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--raised);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-size: 13px;
  font-weight: 550;
}

/* The page loading, a line across the top. */
.win__load {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  width: 0;
  height: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--tint);
}

.win__load[data-on] {
  animation: load 700ms var(--ease-out) both;
}

@keyframes load {
  0% {
    width: 0;
    opacity: 1;
  }
  75% {
    width: 100%;
    opacity: 1;
  }
  100% {
    width: 100%;
    opacity: 0;
  }
}

/* Sparkles when the table's booked. */
.burst {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 2;
  pointer-events: none;
}

.burst i {
  position: absolute;
  left: 0;
  top: 0;
  color: var(--tint);
  opacity: 0;
}

.burst i:nth-child(3n + 1) {
  color: #f2b31c;
}

.burst i:nth-child(3n + 2) {
  color: var(--pink);
}

.burst .i {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.burst[data-on] i {
  animation: spark 900ms var(--ease-out) both;
}

@keyframes spark {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--a)) translateX(16px) scale(0.3);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--a)) translateX(calc(var(--r) * min(16cqh, 150px))) scale(1);
  }
}

.win__body {
  position: relative;
  flex: 1;
  overflow: hidden;
  border-top-left-radius: 10px;
  background: var(--paper);
}

.act {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 400ms,
    transform 500ms var(--ease-out);
}

.show[data-act='ask'] .act--ask,
.show[data-act='form'] .act--form {
  opacity: 1;
  transform: none;
}

.act--ask {
  gap: 4px;
  background: radial-gradient(50% 50% at 50% 50%, var(--tint-wash), transparent 80%);
}

.act__perch {
  position: relative;
  width: 26%;
  aspect-ratio: 1;
}

@keyframes bob {
  to {
    transform: translateY(-5px);
  }
}

.ask {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: 78%;
  min-height: 24%;
  padding: 14px 12px 12px 18px;
  border-radius: 18px;
  background: var(--raised);
  box-shadow:
    0 0 0 1px var(--line),
    0 6px 18px rgba(26, 20, 60, 0.07);
}

.ask__text {
  flex: 1;
  align-self: flex-start;
  font-size: clamp(14px, 1.6cqw, 19px);
  font-weight: 450;
}

.ask__hint {
  color: var(--ink-3);
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin: 0 1px -0.18em;
  background: var(--tint-ink);
  animation: caret 1s steps(1) infinite;
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

.ask__send {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--tint) 62%, #1c1a17);
  color: #fff;
  transition: transform 160ms var(--ease-out);
}

.ask__send .i {
  width: 18px;
  height: 18px;
}

.show[data-sent] .ask__send {
  transform: scale(0.85);
}

.act--form {
  align-items: stretch;
  justify-content: flex-start;
  padding: 6% 9%;
}

.form__name {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(18px, 2.4cqw, 30px);
  font-style: italic;
  font-weight: 450;
}

.form__sub {
  color: var(--ink-3);
  font-size: clamp(12px, 1.3cqw, 15px);
  font-weight: 450;
}

.form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4% 4%;
  margin-top: 5%;
}

.fld {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fld span {
  color: var(--ink-3);
  font-size: clamp(11px, 1.1cqw, 13px);
  font-weight: 550;
}

.fld b {
  height: clamp(28px, 3.6cqw, 40px);
  padding: 0 12px;
  border-radius: 10px;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: transparent;
  font-size: clamp(13px, 1.4cqw, 17px);
  line-height: clamp(28px, 3.6cqw, 40px);
  transition:
    color 200ms,
    box-shadow 200ms;
}

.fld[data-filled] b {
  color: var(--ink);
}

.fld[data-active] b {
  box-shadow:
    inset 0 0 0 2px var(--tint),
    0 0 0 4px color-mix(in srgb, var(--tint) 25%, transparent);
}

.form__book {
  align-self: flex-start;
  margin-top: 6%;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: clamp(13px, 1.4cqw, 16px);
  font-weight: 550;
  transition: background 300ms;
}

.show[data-booked] .form__book {
  background: var(--ok);
}

.form__done {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4%;
  color: var(--ok);
  font-size: clamp(14px, 1.6cqw, 19px);
  font-weight: 650;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 300ms,
    transform 400ms var(--ease-out);
}

.show[data-booked] .form__done {
  opacity: 1;
  transform: none;
}

/* The companion's own pointer while it works, in its colour. */
.ghost {
  position: absolute;
  left: 50%;
  top: 110%;
  z-index: 2;
  width: 26px;
  height: 26px;
  fill: var(--tint);
  stroke: #fff;
  stroke-width: 2;
  stroke-linejoin: round;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.25));
  transition:
    left 600ms var(--ease-out),
    top 600ms var(--ease-out);
}

.show__star {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(25cqw, 46cqh, 320px);
}

.show__star::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: 70%;
  height: 12%;
  translate: -50% 50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--tint) 45%, transparent), transparent);
}

.show__fig {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}



.say {
  position: absolute;
  bottom: 96%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: min(320px, 34cqw);
  padding: 12px 18px 14px;
  translate: -50% 0;
  border-radius: 22px;
  background: var(--raised);
  box-shadow: 0 10px 26px light-dark(rgba(60, 40, 120, 0.2), rgba(0, 0, 0, 0.5));
  font-size: clamp(15px, 1.7cqw, 20px);
  font-weight: 550;
  line-height: 1.25;
  text-align: center;
}

.say::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 12px;
  height: 12px;
  translate: -50% 0;
  rotate: 45deg;
  background: inherit;
}

.say[data-pop] {
  animation: bubble-pop 320ms var(--ease-floor) both;
}

.say__keys {
  display: none;
  gap: 8px;
}

.say[data-ask] .say__keys {
  display: flex;
}

.say__keys b,
.say__keys i {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 15px;
  font-style: normal;
  font-weight: 650;
}

.say__keys b {
  background: var(--violet-key);
  box-shadow: 0 3px 0 var(--violet-lo);
  color: #fff;
  transition:
    transform 80ms,
    box-shadow 80ms;
}

.say[data-press] .say__keys b {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--violet-lo);
}

.say__keys i {
  background: var(--paper-2);
  color: var(--ink-2);
}

.caption {
  order: -1;
  padding: 6cqh 6cqw 0;
  text-align: center;
}

.caption h2 {
  font-size: clamp(26px, 5.4cqh, 50px);
}

.caption p {
  max-width: 52ch;
  margin: 0.4em auto 0;
  color: var(--ink-2);
  font-size: clamp(15px, 2.5cqh, 21px);
  font-weight: 550;
}

/* The examples: one request, carried out across several signed-in sites.
   Products' marks (logos.js) sit on white tiles so both themes read alike. */

.mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.3em;
  height: 2.3em;
  border-radius: 28%;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(40, 30, 20, 0.08),
    0 2px 5px rgba(40, 30, 20, 0.1);
}

.logo {
  width: 62%;
  height: 62%;
}

/* A product with no mark here is written out. */
.mark:has(.logo-word) {
  width: auto;
  padding: 0 0.6em;
  border-radius: 0.7em;
}

.logo-word {
  color: #1c1a17;
  font-size: 0.82em;
  font-weight: 650;
  letter-spacing: -0.01em;
}

/* The sites' tabs, opening next to the first one as the companion gets to them. */
.win__sites {
  display: flex;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}

.site {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 26px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  animation: site-in 360ms var(--ease-floor) both;
}

.site .logo {
  width: 16px;
  height: 16px;
}

/* Signed in. */
.site i {
  position: absolute;
  right: -2px;
  top: -2px;
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--ground);
  border-radius: 50%;
  background: var(--ok);
}

@keyframes site-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.6);
  }
}

.show[data-act='jobs'] .act--jobs {
  opacity: 1;
  transform: none;
}

.act--jobs {
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  gap: 4%;
  padding: 4.5% 5%;
  font-size: clamp(11px, 1.34cqw, 16px);
}

.jobs {
  display: flex;
  flex: 1.15;
  flex-direction: column;
  justify-content: center;
  gap: 4.5%;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.job {
  display: flex;
  align-items: center;
  gap: 0.75em;
  padding: 0.55em 0.7em;
  border-radius: 0.9em;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--line);
  opacity: 0.45;
  transition:
    opacity 300ms,
    box-shadow 200ms,
    background 300ms;
}

.job[data-on] {
  opacity: 1;
  box-shadow:
    inset 0 0 0 2px var(--tint),
    0 0 0 4px color-mix(in srgb, var(--tint) 22%, transparent);
}

.job[data-done] {
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line);
}

.job__marks {
  display: flex;
  flex: none;
  gap: 0.3em;
}

.job__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.job__text b {
  font-weight: 650;
}

.job__text span {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 0.86em;
  font-weight: 450;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 300ms;
}

.job[data-done] .job__text span {
  opacity: 1;
}

/* Working, then done. */
.job__state {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.5em;
  height: 1.5em;
  border: 2px solid transparent;
  border-radius: 50%;
}

.job[data-on]:not([data-done]) .job__state {
  border-color: color-mix(in srgb, var(--tint) 30%, transparent);
  border-top-color: var(--tint);
  animation: job-spin 700ms linear infinite;
}

.job__state svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--ok);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  scale: 0.4;
  transition:
    opacity 200ms,
    scale 320ms var(--ease-floor);
}

.job[data-done] .job__state svg {
  opacity: 1;
  scale: 1;
}

@keyframes job-spin {
  to {
    rotate: 1turn;
  }
}

/* What you get at the end. */
.result {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-self: center;
  min-width: 0;
  border-radius: 1em;
  background: var(--raised);
  box-shadow:
    0 0 0 1px var(--line),
    0 10px 26px -10px color-mix(in srgb, var(--tint) 60%, transparent);
  overflow: hidden;
  opacity: 0.35;
  filter: saturate(0.2);
  transition:
    opacity 400ms,
    filter 400ms,
    transform 500ms var(--ease-floor);
}

.show[data-done] .result {
  opacity: 1;
  filter: none;
  transform: scale(1.03);
}

.result__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.3em 0.6em;
  padding: 0.7em 0.9em;
  background: var(--tint-wash);
}

.result__title {
  font-weight: 650;
}

.result__tag {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 0.4em;
  padding: 0.2em 0.65em;
  border-radius: 999px;
  background: var(--raised);
  color: var(--ok);
  font-size: 0.82em;
  font-weight: 650;
  opacity: 0;
  transition: opacity 300ms 200ms;
}

.show[data-done] .result__tag {
  opacity: 1;
}

.result__tag i {
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: var(--ok);
}

.result__rows {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0.3em 0.9em 0.5em;
}

.result__rows div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8em;
  padding: 0.48em 0;
  border-top: 1px solid var(--line);
}

.result__rows div:first-child {
  border-top: 0;
}

.result__rows dt {
  flex: none;
  color: var(--ink-2);
  font-size: 0.86em;
  font-weight: 450;
}

.result__rows dd {
  overflow: hidden;
  margin: 0;
  font-weight: 650;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The rows are blank until it's done. */
.result__rows dd {
  color: transparent;
  background: linear-gradient(var(--line), var(--line)) right center / 60% 0.5em no-repeat;
  transition: color 300ms;
}

.show[data-done] .result__rows dd {
  color: var(--ink);
  background: none;
}

/* ---- CH 3: the booth ---- */

.ch-make {
  background:
    radial-gradient(46% 70% at 30% 46%, var(--tint-wash), transparent 80%),
    linear-gradient(180deg, light-dark(#f4efe8, #24211f), var(--paper) 70%);
  transition: background 600ms;
}

.booth {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: 2cqw;
  padding: 6cqh 6cqw 4cqh 3cqw;
}

.booth__stage {
  position: relative;
  height: 100%;
}

.booth__spot {
  position: absolute;
  left: 50%;
  top: -12%;
  width: 70%;
  height: 92%;
  translate: -50% 0;
  background: linear-gradient(180deg, light-dark(rgba(255, 255, 255, 0.95), rgba(255, 250, 230, 0.12)), transparent 90%);
  clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%);
  filter: blur(6px);
}

.booth__floor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.booth__figure {
  aspect-ratio: 1;
  cursor: pointer;
  position: absolute;
  left: 50%;
  bottom: 16%;
  width: min(48cqh, 32cqw);
  translate: -50% 0;
  transform-origin: 50% 92%;
}

.booth__figure[data-pop] {
  animation: pop 640ms var(--ease-floor) both;
}

@keyframes pop {
  0% {
    transform: translateY(-30%) scale(0.5);
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
}

.booth__ring {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: 34%;
  height: 9%;
  translate: -50% 50%;
  border: 3px solid var(--tint);
  border-radius: 50%;
  opacity: 0;
}

.booth__ring[data-on] {
  animation: drop-ring 900ms var(--ease-out) both;
}

.booth__name {
  position: absolute;
  left: 50%;
  bottom: 3%;
  padding: 8px 22px 10px;
  translate: -50% 0;
  border-radius: 999px;
  background: var(--raised);
  box-shadow: 0 6px 18px rgba(60, 40, 120, 0.16);
  font-size: clamp(20px, 4cqh, 32px);
  font-weight: 650;
  white-space: nowrap;
}

.booth__name::before {
  content: '';
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.35em;
  border-radius: 50%;
  background: var(--tint);
  vertical-align: 0.05em;
}

.booth__side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2.4cqh;
}

.booth__side h2 {
  font-size: clamp(34px, 8cqh, 72px);
}

.booth__side > p {
  max-width: 24ch;
  color: var(--ink-2);
  font-size: clamp(17px, 3cqh, 24px);
  font-weight: 550;
}

.booth__keys {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  margin-top: 1cqh;
}

.six {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2cqh;
}

.six button {
  display: grid;
  place-items: center;
  width: clamp(48px, 8cqh, 64px);
  height: clamp(48px, 8cqh, 64px);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--tint) 30%, white), color-mix(in srgb, var(--tint) 70%, white));
  box-shadow:
    0 3px 0 color-mix(in srgb, var(--tint) 60%, #2a2440),
    0 6px 12px rgba(40, 30, 80, 0.16);
  cursor: pointer;
  transition: transform 160ms var(--ease-out);
}

.six button:hover {
  transform: translateY(-3px);
}

.six button[aria-pressed='true'] {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
}

.six img {
  width: 90%;
}

/* The look ring (assets/js/ring.js), as in the browser's companion card:
   eight bubbles on a ring around the live figure, and the option card the
   open one shows where the side text was. */

.booth__stage {
  --fig: min(48cqh, 32cqw);
}

/* The figure drawn live by the booth's engine, over its sheet. */
.booth__live {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  /* The live view frames a little looser than the sheets; this evens it out. */
  scale: 1.035;
  transform-origin: 50% 92%;
  pointer-events: none;
}

.booth__figure[data-live] > span {
  visibility: hidden;
}

.lr-ring {
  position: absolute;
  left: 50%;
  bottom: calc(16% + var(--fig) * 0.5);
  width: 0;
  height: 0;
}

.lr-bubble {
  --size: clamp(44px, 7.4cqh, 58px);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--raised);
  color: var(--ink);
  box-shadow:
    0 0 0 1px light-dark(#ece9e4, #45413d),
    0 8px 18px -8px color-mix(in srgb, var(--tint) 70%, transparent),
    0 2px 5px rgba(0, 0, 0, 0.08);
  /* The browser's ring, laid out for a 300 px figure, scaled to this one. */
  translate: calc(var(--dx) / 300 * var(--fig) - 50%) calc(var(--dy) / 300 * var(--fig) - 50%);
  cursor: pointer;
  animation: bubble-in 380ms var(--ease-floor) calc(80ms + var(--i, 0) * 40ms) both;
  transition:
    box-shadow 140ms var(--ease-out),
    scale 160ms var(--ease-out);
}

.lr-bubble:hover {
  scale: 1.08;
}

.lr-bubble--selected,
.lr-bubble--selected:hover {
  box-shadow:
    0 0 0 3px var(--ink),
    0 8px 18px -8px color-mix(in srgb, var(--tint) 70%, transparent);
}

.lr-bubble__art {
  width: 58%;
  height: 58%;
  color: #2a2633;
  pointer-events: none;
}

/* Eyes, mouth and brows show the look's own choice: its layer of the
   512 by 256 face canvas, zoomed in, on the skin colour (as in the browser). */
.lr-swatch {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--swatch-skin);
  background-repeat: no-repeat;
  pointer-events: none;
}

.lr-swatch--eyes {
  background-size: 140% auto;
  background-position: 50% 42%;
}

.lr-swatch--brows {
  background-size: 140% auto;
  background-position: 50% 14%;
}

.lr-swatch--mouth {
  background-size: 200% auto;
  background-position: 50% 88%;
}

.lr-bubble__art--face {
  width: 74%;
  height: 74%;
  overflow: hidden;
  border-radius: 50%;
}

/* The label: a small chip above the bubble on hover or focus. */
.lr-bubble__chip {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 550;
  line-height: 15px;
  white-space: nowrap;
  opacity: 0;
  translate: -50% 3px;
  transition:
    opacity 120ms var(--ease-out),
    translate 120ms var(--ease-out);
  pointer-events: none;
}

.lr-bubble:hover .lr-bubble__chip,
.lr-bubble:focus-visible .lr-bubble__chip {
  opacity: 1;
  translate: -50% 0;
}

@keyframes bubble-in {
  from {
    opacity: 0;
    scale: 0.6;
  }
}

/* ---- the option card ---- */

.booth__side,
.booth__panel {
  grid-column: 2;
  grid-row: 1;
}

.booth__side {
  transition: opacity 160ms;
}

.booth[data-editing] .booth__side {
  opacity: 0;
  visibility: hidden;
}

.booth__panel {
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: center;
  width: min(100%, 356px);
  max-height: 100%;
  animation: card-in 220ms var(--ease-out) both;
}

.booth__panel[hidden] {
  display: none;
}

@keyframes card-in {
  from {
    opacity: 0;
    translate: 0 8px;
  }
}

.lr-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px;
  border: 1px solid light-dark(#ece9e4, #3a3734);
  border-radius: 22px;
  background: var(--raised);
  box-shadow:
    0 14px 34px -12px color-mix(in srgb, var(--tint) 55%, transparent),
    0 2px 6px rgba(0, 0, 0, 0.06);
}

.lr-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.lr-card__head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
}

.lr-card__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ground);
  color: var(--ink-2);
  cursor: pointer;
}

.lr-card__close:hover {
  color: var(--ink);
}

.lr-card__close .i {
  width: 16px;
  height: 16px;
  stroke-width: 2.8;
}

.lr-card__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  /* Room for the current tile's ring at the edges. */
  margin: -5px;
  padding: 5px;
}

.lr-card__section h4 {
  margin: 0 0 8px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 550;
}

.lr-card__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 48px);
  gap: 8px;
}

.lr-tile {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ground);
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
  transition: scale 140ms var(--ease-out);
}

.lr-tile:hover:not(:disabled) {
  scale: 1.08;
}

.lr-tile:disabled {
  opacity: 0.35;
  cursor: default;
}

.lr-tile:focus-visible,
.lr-tile--custom:focus-within {
  outline: 3px solid var(--violet);
  outline-offset: 2px;
}

/* The current tile: a thick ink ring and a check badge. */
.lr-tile--current,
.lr-tile--current:hover:not(:disabled) {
  box-shadow: 0 0 0 3px var(--ink);
}

.lr-tile__check {
  position: absolute;
  right: -3px;
  bottom: -3px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--raised);
  box-shadow: 0 0 0 2px var(--raised);
}

.lr-tile__check svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lr-tile__none {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.lr-tile__still {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
}

.lr-tile__still:not([src]) {
  visibility: hidden;
}

.lr-tile--swatch {
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12);
}

.lr-tile--palette {
  background: var(--palette);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12);
}

.lr-tile--custom {
  background: var(--swatch, conic-gradient(#f66, #fc5, #6d8, #5bf, #a7f, #f66));
}

.lr-tile--custom input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  opacity: 0;
  cursor: pointer;
}

.lr-tile--custom > svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.35));
  pointer-events: none;
}

.lr-card__tints {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.lr-card__tints button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
}

.lr-card__tints i {
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.14);
}

.lr-card__tints button:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.lr-card__tints button[aria-pressed='true'] {
  background: color-mix(in srgb, var(--ink) 10%, transparent);
  color: var(--ink);
}

/* Fine-tuning, in its own small card under the options. */
.lr-card--sliders {
  flex: none;
  gap: 8px;
  padding: 12px 16px;
}

.lr-slide {
  display: grid;
  grid-template-columns: 9.5em 1fr;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 550;
}

.lr-slide input {
  width: 100%;
  margin: 0;
  accent-color: var(--ink);
}

/* ---- CH 4: shared ---- */

.ch-shared {
  background:
    radial-gradient(50% 40% at 80% 18%, light-dark(rgba(255, 126, 182, 0.14), rgba(255, 126, 182, 0.08)), transparent),
    linear-gradient(180deg, light-dark(#efeaff, #221f2e), var(--paper) 62%);
}

/* The words come first: one centred column, the pack as its emblem, and
   nothing else in the top half. The parade walks below it, smaller and later. */
.shared__head {
  position: absolute;
  top: clamp(14px, 6cqh, 64px);
  left: 50%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6cqh;
  width: min(760px, 88cqw);
  translate: -50% 0;
  text-align: center;
}

.shared__head > * {
  animation: shared-in 0.5s var(--ease-out) both;
}

.shared__head > :nth-child(2) {
  animation-delay: 0.06s;
}

.shared__head > :nth-child(3) {
  animation-delay: 0.12s;
}

.shared__head > :nth-child(4) {
  animation-delay: 0.18s;
}

.shared__head > :nth-child(5) {
  animation-delay: 0.24s;
}

@keyframes shared-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.shared__head h2 {
  font-size: clamp(38px, 10cqh, 92px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.shared__head > p:not(.shared__safe) {
  max-width: 34ch;
  color: var(--ink);
  font-size: clamp(17px, 3.1cqh, 26px);
  font-weight: 550;
  opacity: 0.78;
}

.shared__keys {
  margin-top: 0.6cqh;
}

.shared__safe {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 550;
  text-align: left;
}

.shared__safe .i {
  color: var(--ok);
}

/* The real .apexpack file art, small, leading into the headline. */
.shared__pack {
  width: min(15cqh, 22cqw);
  margin-bottom: -0.6cqh;
  filter: drop-shadow(0 10px 18px rgba(80, 50, 180, 0.2));
  rotate: -4deg;
}

.parade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36cqh;
  /* It arrives after the words have been seen. */
  animation: parade-in 0.9s ease-out 0.7s both;
}

@keyframes parade-in {
  from {
    opacity: 0;
  }
}

/* The street they walk along: a strip of the floor field. */
.parade::before {
  content: '';
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 4%;
  height: 46%;
  border-radius: 50%;
  background:
    radial-gradient(circle, light-dark(rgba(106, 75, 255, 0.28), rgba(180, 160, 255, 0.16)) 1.5px, transparent 2px) 0 0 / 22px 12px,
    radial-gradient(closest-side, light-dark(rgba(143, 116, 248, 0.16), rgba(143, 116, 248, 0.1)), transparent);
  -webkit-mask-image: radial-gradient(closest-side, #000 50%, transparent);
  mask-image: radial-gradient(closest-side, #000 50%, transparent);
}

.walker {
  --h: min(18cqh, 140px);
  position: absolute;
  left: 0;
  bottom: var(--y);
  z-index: var(--z);
  width: var(--h);
  height: var(--h);
  animation: walk var(--dur) linear var(--delay) infinite;
}

@keyframes walk-narrow {
  from {
    transform: translateX(-70cqw);
  }
  to {
    transform: translateX(170cqw);
  }
}

@keyframes walk {
  from {
    transform: translateX(-28cqw);
  }
  to {
    transform: translateX(118cqw);
  }
}

/* The walk row of the companion's sheet, stepped by CSS: no script per frame. */
.walker__body {
  position: absolute;
  inset: 0;
  translate: 0 calc((1 - var(--feet, 0.9)) * 100%);
  background: 0 0 / 800% 500% no-repeat;
  animation: sprite-walk 0.84s steps(8) infinite;
}

@keyframes sprite-walk {
  to {
    background-position-x: 114.2857%;
  }
}

.walker {
  cursor: pointer;
}

.walker--back {
  animation-name: walk-back;
}

.walker--back .walker__body {
  transform: scaleX(-1);
}

@keyframes walk-back {
  from {
    transform: translateX(118cqw);
  }
  to {
    transform: translateX(-28cqw);
  }
}

@keyframes walk-back-narrow {
  from {
    transform: translateX(170cqw);
  }
  to {
    transform: translateX(-70cqw);
  }
}

.walker[data-wave] {
  animation-play-state: paused;
}

.walker[data-wave] .walker__body {
  transform: none;
  background-position-y: 75%;
  animation: sprite-wave 0.5s steps(5) infinite;
}

.walker[data-wave] .sign {
  scale: 1.08;
}

@keyframes sprite-wave {
  from {
    background-position-x: 14.2857%;
  }
  to {
    background-position-x: 85.7143%;
  }
}

.walker::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 44%;
  height: 11%;
  translate: -50% 50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, light-dark(rgba(50, 30, 80, 0.26), rgba(0, 0, 0, 0.5)), transparent);
}

/* The pack each one carries, on a little stick. */
.sign {
  position: absolute;
  left: 50%;
  bottom: 88%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 5px;
  translate: -50% 0;
  border-radius: 12px;
  background: var(--raised);
  box-shadow: 0 4px 12px light-dark(rgba(60, 40, 120, 0.12), rgba(0, 0, 0, 0.4));
  white-space: nowrap;
  animation: sway 0.84s ease-in-out infinite alternate;
  transform-origin: 50% 160%;
}

@keyframes sway {
  from {
    rotate: -1.5deg;
  }
  to {
    rotate: 1.5deg;
  }
}

.sign::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  width: 4px;
  height: 16px;
  translate: -50% 0;
  border-radius: 2px;
  background: light-dark(#c9b79e, #6a5e50);
}

.sign__icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--tint) 30%, var(--raised));
  color: var(--tint-ink);
}

.sign__icon .i {
  width: 15px;
  height: 15px;
}

.sign__icon img {
  width: 24px;
  height: 24px;
}

.sign__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.sign__text small {
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 550;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sign__text b {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 550;
}

/* ---- CH 5: get ---- */

.ch-get {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5cqh;
  padding: 6cqh 4cqw 4cqh;
  background:
    radial-gradient(60% 40% at 50% 100%, light-dark(rgba(255, 126, 182, 0.16), rgba(255, 126, 182, 0.08)), transparent),
    linear-gradient(180deg, light-dark(#e9e2ff, #1f1c2b), light-dark(#f8f2fa, #24212c) 50%, var(--paper));
  text-align: center;
}

.ch-get h2 {
  position: relative;
  z-index: 2;
  font-size: clamp(40px, 10cqh, 96px);
}

.get__floor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.get__cast {
  position: relative;
  z-index: 2;
  /* After the download: the action is what the headline leads to. */
  order: 2;
  display: flex;
  justify-content: center;
  margin-top: 1cqh;
}

.get__fig {
  position: relative;
  width: min(20cqh, 13cqw);
  aspect-ratio: 1;
  margin-inline: min(-2.4cqh, -1.5cqw);
  pointer-events: auto;
}

.get__fig:nth-child(3) {
  width: min(25cqh, 16cqw);
  z-index: 2;
}

.get__cta {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  order: 1;
  margin-top: 1cqh;
}

.get__beta {
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--tint-wash);
  color: var(--tint-ink);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.get__form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.get__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.get__row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.get__email {
  width: min(320px, 60cqw);
  height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  background: var(--raised);
  color: var(--ink);
  font: 500 18px var(--brand);
  box-shadow:
    inset 0 2px 4px rgba(40, 30, 20, 0.12),
    0 0 0 1.5px var(--line);
}

.get__email::placeholder {
  color: var(--ink-3);
}

.get__email:focus-visible {
  outline: none;
  box-shadow:
    inset 0 2px 4px rgba(40, 30, 20, 0.12),
    0 0 0 3px var(--violet);
}

.get__os {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 550;
}

.get__os label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.get__os input {
  accent-color: var(--violet);
}

.get__msg {
  min-height: 1.4em;
  color: var(--ink);
  font-size: 15px;
  font-weight: 550;
}

.get__msg:empty {
  display: none;
}

.get__other {
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 450;
}

.get__other a {
  color: var(--ink-2);
  text-underline-offset: 3px;
}

.get__note {
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 450;
}

.get__foot {
  position: absolute;
  bottom: clamp(10px, 2.4cqh, 22px);
  left: 0;
  right: 0;
  z-index: 2;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 450;
}

/* ---- smaller screens ---- */

@container screen (max-width: 760px) {
  .show__window {
    aspect-ratio: 4 / 3.4;
  }

  .act--form {
    padding: 5% 7%;
  }

  .act--jobs {
    font-size: 12.5px;
  }

  .result {
    position: absolute;
    inset: 6% 7%;
    align-self: auto;
    justify-content: center;
    visibility: hidden;
  }

  .show[data-done] .result {
    visibility: visible;
    transform: none;
  }

  .show[data-done] .jobs {
    visibility: hidden;
  }

  /* Phone: the window keeps its shape; the words make room for it. */
  .show__window {
    flex: none;
  }

  .caption {
    padding: 9cqh 5cqw 0;
  }

  .caption h2 {
    font-size: clamp(20px, 3.5cqh, 28px);
  }

  .caption p {
    display: none;
  }

  .booth {
    grid-template-rows: 46cqh auto;
    align-content: start;
    gap: 1cqh;
    padding: 7cqh 5cqw 3cqh;
  }

  .booth__figure {
    width: min(40cqh, 62cqw);
    bottom: 18%;
  }

  .booth__stage {
    --fig: min(40cqh, 62cqw);
  }

  .lr-ring {
    bottom: calc(18% + var(--fig) * 0.5);
  }

  .lr-bubble {
    --size: 42px;
  }

  .booth__side,
  .booth__panel {
    grid-column: 1;
    grid-row: 2;
  }

  .booth__panel {
    align-self: start;
    justify-self: center;
    width: min(100%, 420px);
  }

  .booth__name {
    font-size: 20px;
    padding: 6px 16px 7px;
  }

  .booth__side {
    gap: 1.6cqh;
  }

  .booth__side h2 {
    font-size: clamp(28px, 5.4cqh, 44px);
  }

  .booth__side > p {
    font-size: 16px;
  }

  .booth__keys {
    justify-content: center;
    margin-top: 0;
  }

  .booth__keys .key--big {
    height: 48px;
    padding: 0 20px;
    font-size: 16px;
  }

  .six {
    justify-content: center;
    gap: 8px;
    margin-top: 0.5cqh;
  }

  .six button {
    width: 44px;
    height: 44px;
  }

  .shared__head > p:not(.shared__safe) {
    font-size: 16px;
  }

  .shared__safe {
    font-size: 13px;
  }

  .walker {
    animation-name: walk-narrow;
  }

  .walker--back {
    animation-name: walk-back-narrow;
  }

  .sign {
    gap: 6px;
    padding: 5px 9px 5px 5px;
    border-radius: 11px;
  }

  .sign__icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
  }

  .sign__text small {
    font-size: 10px;
  }

  .sign__text b {
    font-size: 13px;
  }

  .ch-get h2 {
    font-size: clamp(36px, 13cqw, 64px);
  }

  .get__fig {
    width: 22cqw;
    margin-inline: -4cqw;
  }

  .get__fig:nth-child(3) {
    width: 28cqw;
  }

  .get__cta .key--huge {
    height: 58px;
    padding: 0 22px;
    font-size: 18px;
  }

  .get__row {
    flex-direction: column;
  }

  .get__email {
    width: min(320px, 84cqw);
  }

  .tools {
    top: auto;
    bottom: 12px;
    flex-direction: row;
    gap: 10px;
    translate: none;
  }

  .tool {
    width: 50px;
    height: 50px;
  }

  .tool .i {
    width: 23px;
    height: 23px;
  }

  .tool span {
    left: 50%;
    top: auto;
    bottom: calc(100% + 10px);
    translate: -50% 4px;
  }

  .tool:hover span,
  .tool:focus-visible span {
    translate: -50% 0;
  }

  .square__hint {
    display: none;
  }

  .lower-third {
    bottom: 74px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .lt__face {
    width: 60px;
    height: 60px;
  }

  .lt__name {
    font-size: 22px;
  }

  .lt__go {
    order: 4;
    width: 100%;
  }

  .lt__close {
    position: absolute;
    top: 8px;
    right: 8px;
  }

  .show {
    flex-direction: column;
    gap: 1.4cqh;
    padding-top: 2cqh;
  }

  .show__window {
    width: 92cqw;
  }

  .show__star {
    order: -1;
    width: min(20cqh, 34cqw);
    margin-top: 5cqh;
  }

  .say {
    max-width: 70cqw;
  }

  .booth {
    grid-template-columns: 1fr;
  }

  .booth__side {
    align-items: center;
    text-align: center;
  }

  .shared__head {
    top: 9cqh;
    gap: 2cqh;
  }

  .shared__head h2 {
    font-size: clamp(36px, 7cqh, 58px);
  }

  .shared__pack {
    display: block;
    width: 15cqh;
  }

  .parade {
    height: 30cqh;
  }
}

/* Laptops and tablets on their side: the grilles make way for a display wide
   enough for every channel's name ("02 IN YOUR TABS"). */
@media (max-width: 1100px) {
  .grille {
    display: none;
  }

  .lcd {
    width: clamp(210px, 22vw, 250px);
  }
}

@media (max-width: 860px) {
  .grille,
  .presets {
    display: none;
  }

  .tuner {
    flex: 1;
    justify-content: center;
    min-width: 0;
  }

  /* Without the preset keys there is room: the display takes it, up to a
     size that holds every channel's name, and gives it back on a narrow screen. */
  .lcd {
    flex: 0 1 260px;
    width: auto;
    min-width: 0;
  }
}

/* From a large phone up to a small tablet: the badge and the download key
   keep only their marks, so the display keeps its whole name. */
@media (max-width: 680px) {
  .badge span {
    display: none;
  }

  .panel .key--go span {
    display: none;
  }

  .panel .key--go {
    width: 46px;
    padding: 0;
  }
}

@media (max-width: 560px) {

  .lcd {
    width: auto;
    flex: 1;
    font-size: 24px;
    gap: 8px;
  }

  .tuner {
    min-width: 0;
  }

  [data-sound],
  [data-picture-toggle] {
    display: none;
  }
}

/* A low picture (a phone on its side, about 280 px of screen): each channel
   keeps its title and what it is for, and lets the extra lines go. */
@container screen (max-height: 340px) {
  /* CH 2: the show and its title; the line under it goes. */
  .caption {
    padding-top: 4cqh;
  }

  .caption p {
    display: none;
  }

  /* CH 3: the title, the two keys and the six, closer together. */
  .booth {
    padding-block: 5cqh 4cqh;
  }

  .booth__side {
    gap: 3cqh;
  }

  .booth__side h2 {
    font-size: 30px;
  }

  .booth__side > p {
    display: none;
  }

  .six {
    flex-wrap: nowrap;
    gap: 6px;
    margin-top: 0;
  }

  .six button {
    width: 40px;
    height: 40px;
  }

  /* CH 4: the title, the key and the parade. */
  .shared__pack,
  .shared__head > p {
    display: none;
  }

  .shared__head h2 {
    font-size: 36px;
  }

  .parade {
    height: 34cqh;
  }

  /* CH 5: the title and the download; the note, the six and the foot go. */
  .ch-get {
    gap: 2cqh;
    padding-block: 4cqh;
  }

  .ch-get h2 {
    font-size: 32px;
  }

  .get__beta,
  .get__note,
  .get__cast,
  .get__foot {
    display: none;
  }
}

/* Scrolled out of view, the set stops moving (tv.js stops its loops too). */
.tv[data-away] *,
.tv[data-away] *::before,
.tv[data-away] *::after {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .tv {
    transform: none;
    border-radius: 0;
  }

  /* Without the receding, there is nothing to hold the page back for, and no hand. */
  .tv__depth,
  .remote {
    display: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .walker {
    animation: none !important;
  }
}

/* The bounce, for browsers without linear() easing (Safari before 17.2). */
@supports not (transition-timing-function: linear(0, 1)) {
  :root {
    --ease-floor: cubic-bezier(0.34, 1.45, 0.64, 1);
  }
}

/* Phones (430 px and under, which is nearly all of them): the strip keeps its
   keys in view, and the display holds the longest name ("02 IN YOUR TABS"). */
@media (max-width: 430px) {
  .panel {
    gap: 6px;
    padding-inline: 4px;
  }

  .tuner {
    flex: 1 1 auto;
    gap: 6px;
  }

  .lcd {
    flex: 1 1 auto;
    min-width: 0;
    gap: 6px;
    padding: 0 10px;
    font-size: 20px;
    letter-spacing: -0.01em;
  }

  .panel .key--round,
  .panel .key--go {
    width: 40px;
    height: 40px;
  }
}

/* The smallest phones (under 340 px): one more step down for the display, and
   only the name (the number shows in the corner of the picture). */
@media (max-width: 340px) {
  .lcd {
    padding: 0 8px;
    font-size: 18px;
  }

  .lcd__num {
    display: none;
  }
}

/* On a phone the channel's title fills the top of the picture, so the
   on-screen display shows only the number, small, in the corner (the display
   under the screen names the channel). */
@media (max-width: 560px) {
  .osd {
    top: 10px;
    left: 12px;
  }

  .osd b {
    font-size: 28px;
  }

  .osd span {
    display: none;
  }
}

/* A phone on its side: less height for the strip and the cue. */
@media (max-height: 460px) and (orientation: landscape) {
  .panel {
    height: 54px;
  }

  /* The square's four keys fit the low picture. */
  .tools {
    gap: 8px;
  }

  .tool {
    width: 42px;
    height: 42px;
  }

  .tool .i {
    width: 20px;
    height: 20px;
  }

  .tv__more {
    padding-bottom: 4px;
  }
}
