/* ------------------------------------------------------------------ */
/* One type system for the whole site: Geist for sentences, Geist Mono  */
/* for labels and chrome, Chakra Petch for figures and the title.               */
/* Loaded last: it also restyles the chrome that style.css set in the   */
/* older terminal faces.                                                */
/* ------------------------------------------------------------------ */

:root {
  --sans: 'Geist', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --display: var(--sans);
  --crt: var(--mono);
}

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

/* Header chips, counter and buttons: mono, small, tracked. */
.hud-id {
  gap: 2px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
}

.chip {
  padding: 0 9px;
  line-height: 24px;
}

.chip-ghost {
  line-height: 22px;
}

.btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.count {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-shadow: none;
  color: rgba(255, 255, 255, 0.7);
}

.count b {
  font-weight: 500;
  color: #fabdf9;
}

.hud-note {
  font-family: var(--mono);
  color: rgba(255, 255, 255, 0.62);
  opacity: 1;
}

.hud-note a {
  color: #fabdf9;
  text-underline-offset: 3px;
}

.hud-note a:hover,
.hud-note a:focus-visible {
  color: #fff;
}

/* The title: the same dot matrix as the figures, lit, not outlined. */
h1 {
  font-family: 'Chakra Petch', var(--mono);
  font-weight: 900;
  font-size: clamp(34px, 6vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  color: #fff;
  -webkit-text-stroke: 0;
  filter: drop-shadow(0 0 22px rgba(250, 189, 249, 0.35));
}

.lede {
  font-family: var(--sans);
  font-size: clamp(15px, 1.25vw, 18px);
  letter-spacing: 0;
  text-transform: none;
  color: rgba(255, 255, 255, 0.78);
}

.hint {
  font-family: var(--mono);
  color: rgba(255, 255, 255, 0.7);
}

.hint-touch {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .hint-wheel {
    display: none;
  }

  .hint-touch {
    display: inline;
  }
}

/* Labels the scene carries (hours, countries). */
.tick {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.tick-sel {
  font-size: 14px;
}

.tick-place {
  font-size: 10px;
  letter-spacing: 0.14em;
}

.tick-place b {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.3;
}

/* The chapter menu. */
.menu li a {
  font-family: var(--sans);
  font-weight: 300;
  letter-spacing: -0.02em;
  text-transform: none;
  color: #fff;
}

.menu li a:hover,
.menu li a:focus-visible {
  color: #fabdf9;
  text-shadow: none;
}

.m-n,
.m-c {
  font-family: var(--mono);
  color: #fabdf9;
}

.m-d {
  font-family: var(--sans);
  color: rgba(255, 255, 255, 0.6);
}

.m-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  margin: 0;
}

.m-home {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  text-underline-offset: 4px;
}

.m-home:hover,
.m-home:focus-visible {
  color: #fabdf9;
}

/* ------------------------------------------------------------------ */
/* Opening screen                                                      */
/* ------------------------------------------------------------------ */

.boot {
  gap: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.6);
}

.boot-title {
  font-family: var(--sans);
  font-size: clamp(22px, 2.6vw, 34px);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: #fff;
}

.boot-n {
  font-family: 'Chakra Petch', var(--mono);
  font-weight: 900;
  font-size: clamp(72px, 11vw, 150px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: #fabdf9;
  text-shadow: none;
}

.boot-n i {
  margin-left: 0.12em;
  font-style: normal;
  font-size: 0.4em;
  color: rgba(255, 255, 255, 0.5);
}

/* ------------------------------------------------------------------ */
/* The reading under each figure                                       */
/* ------------------------------------------------------------------ */

.read {
  position: relative;
  max-width: 34ch;
  margin: 16px 0 0;
  padding-left: 14px;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.88);
}

.read::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.3em;
  bottom: 0.3em;
  width: 2px;
  background: #ff47e8;
  box-shadow: 0 0 8px rgba(255, 71, 232, 0.8);
}

/* The lines that only repeated the figure give way to it. */
#c-2,
.panel[data-panel='3'] .note,
#c-4 {
  display: none;
}

@media (max-aspect-ratio: 1/1) {
  .read {
    margin-top: 10px;
    font-size: 14px;
  }

  .panel[data-panel='4'] .read,
  .panel[data-panel='5'] .read {
    display: none;
  }
}

/* ------------------------------------------------------------------ */
/* Chapter dots                                                        */
/* ------------------------------------------------------------------ */

.dots {
  position: fixed;
  z-index: 14;
  right: clamp(16px, 3vw, 40px);
  top: 50%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.6s ease 0.4s;
}

.ready .dots {
  opacity: 1;
}

.dots button {
  position: relative;
  width: 28px;
  height: 22px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.dots button::before {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: 10px;
  height: 1px;
  background: rgba(255, 255, 255, 0.5);
  transition: width 0.25s, background 0.25s;
}

.dots button[aria-current='true']::before {
  width: 26px;
  height: 2px;
  background: #fabdf9;
  box-shadow: 0 0 8px rgba(250, 189, 249, 0.7);
}

.dots button:hover::before,
.dots button:focus-visible::before {
  width: 20px;
  background: #fff;
}

.dots span {
  position: absolute;
  right: 36px;
  top: 50%;
  padding: 4px 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
  background: rgba(8, 3, 14, 0.85);
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.dots button:hover span,
.dots button:focus-visible span {
  opacity: 1;
}

.room-open .dots span {
  display: none;
}

@media (max-aspect-ratio: 1/1) {
  .dots {
    right: 6px;
    top: 30svh;
  }

  .dots span {
    display: none;
  }
}

/* ------------------------------------------------------------------ */
/* Focus and contrast                                                  */
/* ------------------------------------------------------------------ */

:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* A deeper shade behind the words: white text keeps its contrast over the sun and the lit towers. */
.stage::after {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.8) 30%, rgba(0, 0, 0, 0.52) 46%, rgba(0, 0, 0, 0.16) 58%, transparent 68%);
}

body[data-ch='0'] .stage::after {
  background: radial-gradient(70% 62% at 50% 52%, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.3) 70%, transparent);
}

html[data-m='d'] .stat-l {
  color: rgba(255, 255, 255, 0.78);
}

html[data-m='d'] .kicker {
  color: rgba(255, 255, 255, 0.76);
}

html[data-m='d'] .cap,
html[data-m='d'] .note {
  color: rgba(255, 255, 255, 0.68);
}

html[data-m='d'] .toggle button {
  color: rgba(255, 255, 255, 0.7);
}

html[data-m='d'] .readout span,
html[data-m='d'] .dial span,
html[data-m='d'] .tiles dt {
  color: rgba(255, 255, 255, 0.72);
}

.filter button {
  color: rgba(255, 255, 255, 0.74);
}

.file dt {
  color: rgba(255, 255, 255, 0.66);
}

.file-role,
.room-lede {
  color: rgba(255, 255, 255, 0.76);
}

@media (max-aspect-ratio: 1/1) {
  .stage::after,
  body[data-ch='0'] .stage::after {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, transparent 16%, transparent 52%, rgba(0, 0, 0, 0.82) 82%, #000 100%);
  }
}

/* ------------------------------------------------------------------ */
/* The method page: a CRT monitor, outside the film                    */
/* ------------------------------------------------------------------ */

/* The monitor takes whatever room the window gives it, in both directions; the text scrolls inside the tube. */
.crt {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  padding: clamp(10px, 3vmin, 40px);
  background: rgba(2, 1, 4, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.crt-open .crt {
  opacity: 1;
  visibility: visible;
}

/* The case: moulded plastic, a deep bezel, a strip of controls under the tube. */
.crt-case {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1180px, 100%);
  height: min(860px, 100%);
  padding: clamp(10px, 2.2vmin, 26px) clamp(10px, 2.2vmin, 26px) 0;
  background: linear-gradient(170deg, #2a252f 0%, #19161d 38%, #0e0c11 100%);
  border-radius: clamp(14px, 3vmin, 30px);
  box-shadow:
    0 40px 110px #000,
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -2px 0 rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* The tube: glass set back into the bezel, darker at the corners, bulging a little towards you. */
.crt-tube {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
  background: #050207;
  border-radius: clamp(18px, 4.5vmin, 46px) / clamp(22px, 5.5vmin, 56px);
  box-shadow:
    0 0 0 2px #050406,
    0 0 0 clamp(4px, 1vmin, 9px) #121015,
    0 1px 0 clamp(5px, 1.1vmin, 10px) rgba(255, 255, 255, 0.07);
}

.crt-screen {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(22px, 5vmin, 64px) clamp(20px, 6vmin, 84px);
  background: radial-gradient(130% 110% at 50% 45%, #2a0f35 0%, #170720 45%, #09030d 82%, #030105 100%);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 141, 242, 0.5) transparent;
}

.crt-open .crt-screen {
  animation: crt-on 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Over the picture: scan lines and the phosphor's three-colour grille, with one slow band rolling down. */
.crt-tube::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to bottom, transparent 0, rgba(255, 190, 250, 0.05) 40%, rgba(255, 190, 250, 0.1) 50%, transparent 60%) 0 0 / 100% 34% no-repeat,
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.26) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(to right, rgba(255, 0, 80, 0.05) 0 1px, rgba(0, 255, 120, 0.035) 1px 2px, rgba(40, 80, 255, 0.05) 2px 3px);
  animation: crt-roll 7s linear infinite;
}

/* Over that: the glass. Dark towards the corners, a soft window reflected in the upper left. */
.crt-tube::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(128deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.03) 16%, transparent 30%),
    radial-gradient(ellipse at 50% 50%, transparent 58%, rgba(0, 0, 0, 0.42) 100%);
  box-shadow: inset 0 0 clamp(30px, 8vmin, 90px) rgba(0, 0, 0, 0.85), inset 0 0 3px rgba(255, 190, 250, 0.3);
}

/* The strip under the tube: maker's plate, power lamp, and the one button. */
.crt-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: clamp(44px, 8vmin, 60px);
  padding: 0 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.55);
}

.crt-bar span {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.crt-bar span::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 12px;
  border-radius: 50%;
  background: #ffd3fa;
  box-shadow: 0 0 4px #ff4dea, 0 0 10px #ff2fe6, 0 0 18px rgba(255, 47, 230, 0.7);
}

.crt-bar button {
  flex: none;
  padding: 8px 12px;
  font: inherit;
  color: #fabdf9;
  background: #0b090d;
  border: 1px solid rgba(250, 189, 249, 0.45);
  cursor: pointer;
}

.crt-bar button:hover,
.crt-bar button:focus-visible {
  color: #0a0410;
  background: #fabdf9;
  outline: none;
}

/* The text: bright phosphor, large enough to read, with the glow of a lit tube and no more. */
.crt-text {
  position: relative;
  z-index: 1;
  max-width: 74ch;
  margin: 0 auto;
  font-family: var(--mono);
  font-size: clamp(14px, 1.9vmin, 17px);
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: #ffe6fd;
  text-shadow: 0 0 5px rgba(255, 120, 240, 0.55), 0 0 14px rgba(255, 47, 230, 0.25);
  animation: crt-flicker 4.3s steps(1) infinite;
}

.crt-text h2 {
  max-width: none;
  margin: 8px 0 18px;
  font-family: 'Chakra Petch', var(--mono);
  font-weight: 900;
  font-size: clamp(24px, 4.6vmin, 44px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #fff;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: currentColor;
}

.crt-text h3 {
  margin: 30px 0 8px;
  font-family: var(--mono);
  font-size: 0.8em;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ff7df0;
}

.crt-text p {
  margin: 0 0 12px;
}

.crt-line {
  color: rgba(255, 214, 251, 0.7);
}

.crt-text dl {
  margin: 0;
}

.crt-text dl div {
  display: grid;
  grid-template-columns: minmax(150px, 30%) 1fr;
  gap: 4px 20px;
  padding: 9px 0;
  border-top: 1px dashed rgba(250, 189, 249, 0.3);
}

.crt-text dt {
  color: #fff;
}

.crt-text dd {
  margin: 0;
}

.crt-cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 6px;
  vertical-align: -0.2em;
  background: #fabdf9;
  animation: blink 1s steps(2) infinite;
}

@keyframes crt-roll {
  from { background-position: 0 -60%, 0 0, 0 0; }
  to { background-position: 0 260%, 0 0, 0 0; }
}

/* The mains are not quite steady. Never enough to lose a word. */
@keyframes crt-flicker {
  0%, 100% { opacity: 1; }
  31% { opacity: 0.94; }
  32% { opacity: 1; }
  74% { opacity: 0.9; }
  75% { opacity: 1; }
}

/* Switching on: a bright line across the middle that opens into the picture. */
@keyframes crt-on {
  0% { transform: scale(1, 0.004); filter: brightness(6); opacity: 0.2; }
  35% { transform: scale(1, 0.004); filter: brightness(6); opacity: 1; }
  70% { transform: scale(1, 1.02); filter: brightness(1.8); }
  100% { transform: none; filter: none; }
}

@media (max-width: 560px) {
  .crt-text dl div {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .crt-open .crt-screen,
  .crt-tube::before,
  .crt-text,
  .crt-cursor {
    animation: none;
  }
}

/* ------------------------------------------------------------------ */
/* Sound switch, and the retention wall under the hand                 */
/* ------------------------------------------------------------------ */

.hud-tools {
  display: flex;
  gap: 6px;
}

#sound-btn[aria-pressed='true'] {
  color: #200039;
  background: #fabdf9;
}

body[data-ch='3'] .stage {
  cursor: ew-resize;
}

.wall-drag,
.wall-drag * {
  cursor: grabbing !important;
  user-select: none;
}

/* While the wall is dragged the figure is the only thing that matters: the rest steps back. */
.wall-drag .panel[data-panel='3'] .read,
.wall-drag .panel[data-panel='3'] .screen,
.wall-drag .panel[data-panel='3'] .cap {
  opacity: 0.25;
  transition: opacity 0.25s;
}

@media (max-aspect-ratio: 1/1) {
  .panel[data-panel='3'] .cap {
    display: block;
    margin-top: 10px;
    font-size: 12px;
  }

  #sound-btn {
    padding: 9px 10px;
  }
}

/* ------------------------------------------------------------------ */
/* Plain statement: no eyebrow above, no subtitle below, no shadow on   */
/* the words, no rule beside a block. A headline, a figure, its label.  */
/* ------------------------------------------------------------------ */

.panel,
.room,
html[data-m='d'] .panel,
html[data-m='c'] .panel {
  text-shadow: none;
}

h1 {
  filter: none;
}

.read {
  padding-left: 0;
}

.read::before {
  display: none;
}

html[data-m='d'] .screen {
  padding-left: 0;
  border-left: 0;
}

html[data-m='d'] .tiles div {
  padding-left: 0;
  border-left: 0;
}

.tiles {
  margin-top: 56px;
}

.menu li a:hover,
.menu li a:focus-visible {
  text-shadow: none;
}

@media (max-aspect-ratio: 1/1) {
  html[data-m='d'] .screen,
  html[data-m='d'] .tiles div {
    padding-left: 0;
  }

  .tiles {
    margin-top: 22px;
  }
}

/* No glow or shadow on any lettering outside the method monitor, which is a tube and glows by nature. */
h1,
.count,
.stat,
.tiles dd,
.readout b,
.boot-n,
.tick,
.tick-place,
.tick-sel {
  text-shadow: none;
}

html[data-m='d'] .bar .bt i,
html[data-m='d'] .pair .now .bt i {
  box-shadow: none;
}

/* Once the page is ready the opening screen must not catch clicks while it fades. */
.ready .boot {
  pointer-events: none;
}

/* Country labels lie on the globe: a dot on the spot, a small name, its figure beside it. */
.tick-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-top: -2px;
  text-transform: uppercase;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  line-height: 1;
  color: #fff;
}

.tick-place::before {
  content: '';
  flex: none;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ff2fe6;
}

.tick-place b {
  display: inline;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 400;
  line-height: 1;
  color: rgba(255, 255, 255, 0.7);
}

/* The country labels sit over the sun and over the night sky at once, so they invert what is behind
   them: dark on the sun, light on the sky. The dot on each country is drawn with the globe. */
.ticks-globe {
  mix-blend-mode: difference;
}

.tick-place::before {
  display: none;
}

.tick-place {
  margin-top: 5px;
}

.tick-place b {
  color: #fff;
}

.room-open .ticks-globe {
  opacity: 0;
}

/* Country pins: a small dark flag with the name and the figure, on a thin stem that ends on the spot.
   Solid behind the letters, so it reads over the brightest part of the wire. */
.ticks-globe {
  mix-blend-mode: normal;
}

.tick-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-top: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  color: #fff;
}

.tick-place span {
  padding: 6px 8px 5px;
  white-space: nowrap;
  background: #04060c;
  border: 1px solid rgba(191, 230, 255, 0.55);
}

.tick-place b {
  margin-left: 6px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: #9fd4ff;
}

.tick-place::before {
  display: none;
}

.tick-place::after {
  content: '';
  width: 2px;
  height: var(--stem, 18px);
  background: #04060c;
  /* A pale edge either side, so the dark stem reads over dark sky as well as over the bright wire. */
  box-shadow: 1px 0 0 rgba(191, 230, 255, 0.6), -1px 0 0 rgba(191, 230, 255, 0.6);
}

/* The hour dial: a hairline, lit in electric pink up to the chosen hour, with a small bright handle. */
.dial input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 18px; /* room to grab; the line itself is 2px */
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.dial input::-webkit-slider-runnable-track {
  height: 3px;
  /* The whole lit line is incandescent: a white-hot filament from end to end, and the pink is the
     light it throws, not its own colour. */
  background: linear-gradient(to right, #ffe9fd 0, #fff calc(var(--fill) * 0.3), #fff var(--fill), rgba(255, 255, 255, 0.05) var(--fill) 100%);
  /* Each layer glows on top of the last, so the light builds up along the whole filament. */
  filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 3px #ff7af0) drop-shadow(0 0 5px #ff2fe6) drop-shadow(0 0 9px #ff2fe6) drop-shadow(0 0 14px #ff2fe6) drop-shadow(0 0 26px rgba(255, 47, 230, 0.9));
}

.dial input::-moz-range-track {
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
}

.dial input::-moz-range-progress {
  height: 2px;
  background: linear-gradient(to right, #ffe9fd, #fff 30%);
  box-shadow: 0 0 3px #fff, 0 0 10px #ff2fe6, 0 0 22px #ff2fe6, 0 0 40px rgba(255, 47, 230, 0.7);
}

.dial input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  margin-top: -4px;
  background: #fff;
  border: 0;
  border-radius: 50%;
  /* The handle is part of the filament, only a little brighter: it must not outshine the line. */
  box-shadow: 0 0 3px 1px #fff, 0 0 9px 2px rgba(255, 71, 232, 0.7);
}

.dial input::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: #fff;
  border: 0;
  border-radius: 50%;
  /* The handle is part of the filament, only a little brighter: it must not outshine the line. */
  box-shadow: 0 0 3px 1px #fff, 0 0 9px 2px rgba(255, 71, 232, 0.7);
}

.dial input:focus-visible {
  outline: 0;
}

.dial input:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #ff47e8, 0 0 14px 2px rgba(255, 71, 232, 0.9);
}

/* ------------------------------------------------------------------ */
/* The control room sits in the scene like every other chapter: no veil */
/* over the picture and no drawn glow. It goes under the grain, the scan */
/* lines and the vignette, and the dust and smoke drift across it.       */
/* ------------------------------------------------------------------ */

.room {
  z-index: 3; /* under .fx (4): the film's grain lies over the page too */
  background: none;
}

.room::before {
  display: none;
}

/* Shade for the words on the left and, lighter, behind the files on the right; the tower's window
   and the middle of the picture stay clear. */
body[data-ch='6'] .stage::after {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.7) 24%, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0.3) 52%, rgba(0, 0, 0, 0.62) 72%, rgba(0, 0, 0, 0.72) 100%);
}

.file {
  background: rgba(10, 4, 18, 0.55);
}

@media (max-aspect-ratio: 1/1) {
  .room {
    background: none;
  }

  body[data-ch='6'] .stage::after {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.25) 30%, rgba(0, 0, 0, 0.82) 82%, #000 100%);
  }
}

/* ------------------------------------------------------------------ */
/* Hour dial, final form. The part not yet reached is a plain, hard     */
/* line with no light at all. The lit part is a white-hot filament      */
/* whose glow builds along its length: barely there where it starts,    */
/* full where it meets the handle.                                      */
/* ------------------------------------------------------------------ */

/* --t is how far along the dial the handle is (0..1), set from the script. --fill is where the
   handle's centre actually sits, which is not quite t of the width, because the handle stops half its
   own size short of each end. The lit line and its glow both end exactly there. */
.dial {
  --t: 0.5;
  --fill: calc(5.5px + (100% - 11px) * var(--t));
}

.dial-line {
  position: relative;
  display: block;
}

.dial input {
  position: relative; /* above the glow */
}

.dial input::-webkit-slider-runnable-track {
  height: 3px;
  background: linear-gradient(to right, #ffd3fa 0, #ffeafd calc(var(--fill) * 0.6), #fff var(--fill), rgba(255, 255, 255, 0.3) var(--fill) 100%);
  filter: none;
}

.dial input::-moz-range-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
}

.dial input::-moz-range-progress {
  height: 3px;
  box-shadow: none;
}

/* The light: the same line again, glowing, seen through a mask that lets more of it through the
   further along it goes. It reaches a little past the handle so the handle sits inside the glow. */
.dial-glow {
  position: absolute;
  left: 0;
  top: 50%;
  width: calc(var(--fill) + 40px);
  max-width: calc(100% + 40px);
  height: 140px;
  margin-top: -70px;
  pointer-events: none;
  /* Two masks, intersected: along the line the light builds and then dies just past the handle; across
     it, it fades out before the box's own edge, so no rectangle ever shows. */
  -webkit-mask-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.1) 0, rgba(0, 0, 0, 0.36) 35%, rgba(0, 0, 0, 0.72) 70%, #000 calc(100% - 40px), #000 calc(100% - 34px), transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 38%, #000 62%, transparent 100%);
  mask-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.1) 0, rgba(0, 0, 0, 0.36) 35%, rgba(0, 0, 0, 0.72) 70%, #000 calc(100% - 40px), #000 calc(100% - 34px), transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 38%, #000 62%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.dial-glow::before {
  content: '';
  position: absolute;
  left: 0;
  right: 40px;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  background: #fff;
  filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 3px #ff7af0) drop-shadow(0 0 5px #ff2fe6) drop-shadow(0 0 9px #ff2fe6) drop-shadow(0 0 14px #ff2fe6) drop-shadow(0 0 26px rgba(255, 47, 230, 0.9));
}

/* A tight pink halo hugging the whole lit line, at full strength from its first pixel: this is what
   keeps the filament pink rather than plain white. Only the wide glow above builds along the length. */
.dial-line::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: var(--fill);
  height: 3px;
  margin-top: -1.5px;
  background: #ff6bee;
  filter: drop-shadow(0 0 2px #ff4dea) drop-shadow(0 0 4px #ff2fe6) drop-shadow(0 0 7px rgba(255, 47, 230, 0.9));
  pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Bar charts, lit the same way as the hour dial, without a handle: the  */
/* track is a plain hard line; the value is a white-hot filament with a  */
/* tight pink halo and a wider glow that builds towards its end.         */
/* ------------------------------------------------------------------ */

html[data-m='d'] .bar .bt,
html[data-m='d'] .pair .bt {
  position: relative;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  overflow: visible;
}

html[data-m='d'] .bar .bt i,
html[data-m='d'] .pair .now .bt i {
  position: relative;
  background: linear-gradient(to right, #ffd3fa, #ffeafd 60%, #fff);
  /* the tight halo: full strength along the whole filament. A shadow, not a filter: a filter would
     also run over the wide glow below and flatten its build-up. */
  filter: none;
  box-shadow: 0 0 2px #ff4dea, 0 0 5px #ff2fe6, 0 0 9px rgba(255, 47, 230, 0.85);
}

/* the wide glow: a soft band of light around the filament, let through more and more along its length */
html[data-m='d'] .bar .bt i::after,
html[data-m='d'] .pair .now .bt i::after {
  content: '';
  position: absolute;
  left: 0;
  right: -18px;
  top: -26px;
  bottom: -26px;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    transparent 0,
    rgba(255, 47, 230, 0.1) 18%,
    rgba(255, 47, 230, 0.42) 36%,
    rgba(255, 70, 234, 0.9) 48%,
    rgba(255, 70, 234, 0.9) 52%,
    rgba(255, 47, 230, 0.42) 64%,
    rgba(255, 47, 230, 0.1) 82%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(to right, transparent 0, rgba(0, 0, 0, 0.16) 40%, rgba(0, 0, 0, 0.55) 75%, #000 calc(100% - 26px), #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, rgba(0, 0, 0, 0.16) 40%, rgba(0, 0, 0, 0.55) 75%, #000 calc(100% - 26px), #000 calc(100% - 18px), transparent 100%);
}

/* Last year's bar in a pair is the reference, not the result: lit, but cold and without a glow. */
html[data-m='d'] .pair .bt i {
  background: rgba(255, 255, 255, 0.72);
  filter: none;
}

@media (max-aspect-ratio: 1/1) {
  html[data-m='d'] .bar .bt,
  html[data-m='d'] .pair .bt {
    height: 3px;
  }

  html[data-m='d'] .bar .bt i::after,
  html[data-m='d'] .pair .now .bt i::after {
    top: -14px;
    bottom: -14px;
  }
}

/* In the control room the picture is a playing loop, not a still: the live layer (dust, and the globe
   behind the tower) sits over it instead of under. */
body.globe-live #gl {
  z-index: 1;
  mix-blend-mode: screen; /* the canvas is black there, and its light is added to the clip */
}

/* The specialists' files are solid: the globe turns behind them and must not show through. */
.file {
  background: #0d0513;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* The cover title: wide extended capitals, as on a film's title card, lit white-hot like the filaments
   with the tight pink halo of a tube. */
h1 {
  font-family: 'Michroma', 'Eurostile Extended', 'Microgramma', var(--sans);
  font-weight: 400;
  font-size: clamp(24px, 4.5vw, 70px);
  line-height: 1.16;
  letter-spacing: 0.14em;
  margin-right: -0.14em; /* the tracking after the last letter would push the title off centre */
  text-transform: uppercase;
  color: #ffe4fc;
  -webkit-text-stroke: 0.022em #ffe4fc; /* the face has one weight: this makes it heavier */
  paint-order: stroke fill;
  filter: drop-shadow(0 0 1px #ff6bee) drop-shadow(0 0 7px rgba(255, 47, 230, 0.75)) drop-shadow(0 0 22px rgba(255, 47, 230, 0.35));
}

/* The veil behind the words fades, it never snaps. The cover has none (the city is seen as rendered);
   the control room uses the same one as every other chapter, so nothing changes on the way in or out. */
.stage::after {
  transition: opacity 0.7s ease;
}

@media (min-aspect-ratio: 1/1) {
  /* One veil for every chapter: darkest at the left edge, where the words are, nearly gone by the
     middle of the frame and nothing at all at the right edge, so buildings and charts keep their light. The cover has none (its words are in the middle). */
  .stage::after,
  body[data-ch='6'] .stage::after {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.72) 18%, rgba(0, 0, 0, 0.4) 34%, rgba(0, 0, 0, 0.1) 46%, rgba(0, 0, 0, 0.03) 52%, rgba(0, 0, 0, 0) 100%);
  }

  body[data-ch='0'] .stage::after {
    opacity: 0;
  }
}

/* The header tools: the sound switch and the index, cut from the same button. */
.hud-tools {
  align-items: stretch;
}

/* A square button holding one drawn mark: the sound switch. */
.btn-icon {
  display: grid;
  place-items: center;
  width: 36px;
  padding: 0;
}

/* The sound switch: a speaker, struck through while the sound is off. */
#sound-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: square;
}

#sound-btn .wave {
  opacity: 0;
}

#sound-btn[aria-pressed='true'] .wave {
  opacity: 1;
}

#sound-btn[aria-pressed='true'] .mute {
  opacity: 0;
}


/* The cover's one sentence under the totals: who the weekend's revenue came from. */
.hero-line {
  margin: 1.4em auto 0;
  max-width: 30em;
  text-align: center;
  font: 400 clamp(15px, 1.25vw, 19px) / 1.45 var(--sans);
  color: rgba(255, 255, 255, 0.82);
}
.hero-line b {
  font-weight: 500;
  color: #fff;
}
/* Further reading in the control room. */
.room-more {
  margin: 1.2em 0 0;
  font: 400 14px/1.4 var(--sans);
}
.room-more a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-color: rgba(250, 189, 249, 0.6);
}
.room-more a:hover {
  color: #fff;
}
