/* Baikal (licensed cuts converted to woff2 in /assets/fonts) for the viewer 2 compositions. */
@font-face {
  font-family: "Baikal UltraCond";
  src: url("/assets/fonts/BaikalUltraCond-Light.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Baikal UltraCond";
  src: url("/assets/fonts/BaikalUltraCond-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Baikal UltraCond";
  src: url("/assets/fonts/BaikalUltraCond-MediumItalic.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Baikal UltraCond";
  src: url("/assets/fonts/BaikalUltraCond-LightItalic.woff2") format("woff2");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Baikal Normal";
  src: url("/assets/fonts/BaikalNormal-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Baikal Normal";
  src: url("/assets/fonts/BaikalNormal-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Baikal Normal";
  src: url("/assets/fonts/BaikalNormal-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Baikal ExtraCond";
  src: url("/assets/fonts/BaikalExtraCond-Light.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Baikal Cond";
  src: url("/assets/fonts/BaikalCond-Light.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Baikal Cond";
  src: url("/assets/fonts/BaikalCond-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Baikal Cond";
  src: url("/assets/fonts/BaikalCond-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Baikal Exp";
  src: url("/assets/fonts/BaikalExp-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Baikal Exp";
  src: url("/assets/fonts/BaikalExp-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Baikal Exp";
  src: url("/assets/fonts/BaikalExp-MediumItalic.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Baikal Exp";
  src: url("/assets/fonts/BaikalExp-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Baikal Exp";
  src: url("/assets/fonts/BaikalExp-BoldItalic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Baikal ExtraCond";
  src: url("/assets/fonts/BaikalExtraCond-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Baikal ExtraCond";
  src: url("/assets/fonts/BaikalExtraCond-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #f6f4ef;
  --ink-soft: rgba(246, 244, 239, 0.82);
  --chip-bg: rgba(10, 16, 29, 0.56);
  --line: rgba(246, 244, 239, 0.24);
  --glow: rgba(103, 241, 255, 0.44);
  --red: #ff3a2f;
  /* v6 accent: bars, quotes, headline figures, QR discs and the pulse waves (WAVE_RGB in app.js). */
  --coral: #ff5b4c;
  --coral-dark: #2a0604;
  /* Display settings from the controller (app.js overwrites them): no wall text is smaller than
     --min-font, no QR smaller than --qr-min; --strip-h is the measured height of the QR strip. */
  --min-font: 16px;
  --qr-min: 160px;
  --panel-count: 4;
  --strip-h: 30cqh;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

body {
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
}

/*
 * The wall is laid out at the resolution of its screen (--screen-w x --screen-h, set by app.js for
 * viewers 1 and 2) and scaled to fit the window, centred on black. Inside it, cqw/cqh are % of the
 * screen, not of the browser window. Viewer 3 has no fixed size and fills the window.
 */
.app {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--screen-w, 100vw);
  height: var(--screen-h, 100vh);
  overflow: hidden;
  container-type: size;
  transform: translate(-50%, -50%) scale(var(--screen-scale, 1));
  background: #070d17;
}

.bg-video,
.bg-overlay {
  position: absolute;
  inset: 0;
}

.bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bg-overlay {
  display: none;
}

/* Pulse waves (app.js draws them): over the content, under the QR strip, never catching clicks. */
.pulse-waves {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
}

.stage {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr;
  gap: 0;
  padding: 0;
}

/* Screens 1 and 3: phrase column (30%) and the CES Pulse charts or the embedded page. */
.stage[data-screen~="1"] {
  grid-template-columns: 30% minmax(0, 1fr);
}

/* Screen 2: 1, 2 or --panel-count technology columns (app.js sets --columns and the composition scale --u). */
.stage[data-screen="2"] {
  --columns: 1;
  --u: 1;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
}

.stage[data-screen="2"] .panel {
  padding: 0;
  transition: opacity 1400ms ease, filter 1400ms ease;
}

/* Columns change width with the layout; a shade per column would show the seams over the video. */
.stage[data-screen="2"] .panel::before {
  content: none;
}

.stage[data-screen="2"].is-leaving .panel {
  opacity: 0;
  filter: blur(14px);
}

.side-column {
  position: relative;
  grid-row: 1;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 3.6rem 2.4rem;
  overflow: hidden;
  color: var(--ink);
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

/* Same shading as .panel::before; z-index -1 keeps it under the text inside the column's stacking context. */
.side-column::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(24deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0));
}

/* v6 welcome block (HUMAN 2050 logo, welcome line, description) centred on top and static; the quotes loop below. */
.side-phrases {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  row-gap: 1.2rem;
  padding-block: 12cqh 2.4rem;
}

.side-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1em;
  text-align: center;
  font-size: max(var(--min-font), 1.05cqw);
}

/* Welcome to Human 2050 logo (image); same width as the old typeset title. */
.side-brand {
  margin: 0 0 0.93em;
  line-height: 0;
}

.side-brand img {
  width: 20cqw;
  max-width: 100%;
  height: auto;
}

.side-welcome {
  margin: 0;
  font-family: "Baikal Exp", "Archivo", sans-serif;
  font-weight: 500;
  font-size: 1em;
  line-height: 1.2;
  text-transform: uppercase;
}

.side-description {
  margin: 0;
  color: var(--ink-soft);
  font-family: "Baikal Exp", "Archivo", sans-serif;
  font-size: 0.92em;
  line-height: 1.3;
}

.side-phrase-loop {
  position: relative;
  align-self: stretch;
}

/*
 * Desire quotes: two coral boxes in the same spot, only one shown (data-big, app.js). On each turn, at the
 * same time and with the same easing, the shown one zooms out into its top-right corner until it is gone
 * while the other, holding the next quote, grows out of its bottom-left corner, so the incoming box's
 * top-right corner stays joined to the outgoing box's bottom-left corner. The hidden box then takes the
 * following quote. The origin follows the role; it only changes at rest (scale 1 or 0), where it doesn't show.
 */
.side-quote {
  position: absolute;
  inset-inline: 0;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  justify-items: center;
  color: var(--coral);
}

.side-quote-pair {
  display: grid;
  width: 62%;
}

.side-quote-box {
  --u: 0.7;
  --bw: 1px;
  grid-area: 1 / 1;
  position: relative;
  padding: 1.5em 1.1em;
  border: var(--bw) solid rgba(255, 91, 76, 0.75);
  font-size: max(var(--min-font), 1.15cqw);
  scale: 0;
  transform-origin: right top;
  transition: scale var(--swap-ms, 4800ms) ease-in-out;
  /* JS gives both boxes the longest quote's height (min-height); shorter quotes are centred in it. */
  display: grid;
  align-content: center;
}

.side-quote-box.is-a {
  text-align: left;
}

.side-quote-box.is-b {
  text-align: right;
}

.side-quote[data-big="a"] .side-quote-box.is-a,
.side-quote[data-big="b"] .side-quote-box.is-b {
  scale: 1;
  transform-origin: left bottom;
}

/* Corner dots only on the big box: they leave as it starts shrinking and come back once the other has grown. */
.side-quote-box .box-dot {
  opacity: 0;
  transition: opacity calc(var(--swap-ms, 4800ms) * 0.35) ease;
}

.side-quote[data-big="a"] .side-quote-box.is-a .box-dot,
.side-quote[data-big="b"] .side-quote-box.is-b .box-dot {
  opacity: 1;
  transition-delay: calc(var(--swap-ms, 4800ms) * 0.65);
}

.side-quote-text {
  margin: 0;
  font-family: "Baikal Exp", "Archivo", sans-serif;
  font-weight: 500;
  font-style: italic;
  line-height: 1.12;
  text-transform: uppercase;
}

.panel {
  position: relative;
  grid-row: 1;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: 2.1rem 1.2rem;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(24deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0));
}

/*
 * Viewer 2 technology composition. Everything is sized in --u (set by app.js per column count: 1 for
 * one column, smaller for 2 and 4) and text never drops below --min-font. The red score box and the
 * dotted description box share one corner, marked by the crosshair; the title sits above-left of it.
 */
.tech-slot {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: var(--strip-h);
  z-index: 1;
  container-type: size;
  display: grid;
  place-items: center;
  --bw: 2px;
  --pad: calc(var(--u) * 48px);
  --box-w: calc(var(--u) * 380px);
  /* Room left of the anchor for the title (and its right margin) and the description box. */
  --side-max: calc(100cqw - var(--box-w) - 2 * var(--pad) - var(--u) * 30px);
}

.tech-comp {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  max-height: 100%;
  opacity: 0;
  filter: blur(14px);
  /* Leaving: the whole composition fades out (TECH_FADE_MS in app.js). */
  transition: opacity 1400ms ease, filter 1400ms ease;
}

.tech-comp.is-visible {
  opacity: 1;
  filter: blur(0);
  transition: opacity 300ms ease, filter 300ms ease;
}

/*
 * Entering (.is-built, COMP_BUILD_MS in app.js): a wave leaves the (still hidden) crosshair (app.js); the
 * title grows out of it, blurred and red, sharpens and turns white; shortly before it is in place both
 * boxes are uncovered from the crosshair corner outwards (a mask over frame and text, nothing scales) with
 * their corner dots riding the frame's corners; once both are in, the crosshair mark appears. Without .is-built everything
 * resets instantly, which only happens while the composition is faded out.
 */
.tech-comp {
  --title-start: 300ms;
  --title-grow-ms: 1950ms;
  --box-in-ms: 1350ms;
  --score-start: 1900ms;
  --desc-start: 2125ms;
  --score-done: calc(var(--score-start) + var(--box-in-ms));
  --desc-done: calc(var(--desc-start) + var(--box-in-ms));
}

.tech-anchor {
  opacity: 0;
}

/* Corner dots: they show up at the crosshair corner as the frame starts and ride its corners as it grows. */
.tech-comp .box-dot {
  width: max(4px, var(--dot-size));
  border-radius: 50%;
  opacity: 0;
}

.tech-comp.is-built .box-dot {
  opacity: 1;
  transition: opacity 150ms ease var(--build-at);
  animation: tech-dot-in var(--box-in-ms) cubic-bezier(0.3, 0.7, 0.2, 1) var(--build-at) backwards;
}

@keyframes tech-dot-in {
  from {
    left: var(--dot-x);
    top: var(--dot-y);
  }
}

.tech-comp.is-built .tech-anchor {
  opacity: 1;
  transform: translate(-50%, -50%);
  transition:
    opacity 400ms ease var(--desc-done),
    transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1) var(--desc-done);
}

.tech-comp.is-built .tech-score-box {
  --build-at: var(--score-start);
  --in-at: var(--score-done);
}

.tech-comp.is-built .tech-desc-box {
  --build-at: var(--desc-start);
  --in-at: var(--desc-done);
}

/* --ox / --oy: the crosshair, seen from the title (set per layout below). */
.tech-name {
  transform-origin: var(--ox, 100%) var(--oy, 100%);
}

/*
 * Once built, the whole composition keeps drifting slowly up, down, left and right (up to --float-x /
 * --float-y each way, easing in and out of every turn); the title follows the same path --float-lag
 * behind, as if heavier. app.js picks --fx / --fy (±1, the direction) and --float-ms per technology so
 * the columns don't move in step. Each part drifts on its own (translate) because the title has to lag.
 */
.tech-comp {
  --float-x: calc(var(--u) * 50px);
  --float-y: calc(var(--u) * 50px);
  --float-ms: 36s;
  --float-lag: 900ms;
}

.tech-comp.is-built :is(.tech-score-box, .tech-desc-box, .tech-cross) {
  animation: tech-float var(--float-ms) ease-in-out infinite;
}

@keyframes tech-float {
  0%,
  100% {
    translate: 0 0;
  }
  12.5% {
    translate: calc(var(--fx, 1) * var(--float-x) * 0.6) calc(var(--fy, 1) * var(--float-y) * -0.8);
  }
  25% {
    translate: calc(var(--fx, 1) * var(--float-x) * -0.9) calc(var(--fy, 1) * var(--float-y) * -0.3);
  }
  37.5% {
    translate: calc(var(--fx, 1) * var(--float-x) * -0.4) calc(var(--fy, 1) * var(--float-y) * 0.9);
  }
  50% {
    translate: calc(var(--fx, 1) * var(--float-x) * 0.8) calc(var(--fy, 1) * var(--float-y) * 0.5);
  }
  62.5% {
    translate: calc(var(--fx, 1) * var(--float-x)) calc(var(--fy, 1) * var(--float-y) * -0.6);
  }
  75% {
    translate: calc(var(--fx, 1) * var(--float-x) * -0.3) calc(var(--fy, 1) * var(--float-y) * -1);
  }
  87.5% {
    translate: calc(var(--fx, 1) * var(--float-x) * -1) calc(var(--fy, 1) * var(--float-y) * 0.4);
  }
}

.tech-comp.is-built .tech-name {
  animation:
    tech-float var(--float-ms) ease-in-out var(--float-lag) infinite,
    tech-title-grow var(--title-grow-ms) cubic-bezier(0.3, 0.55, 0.25, 1) var(--title-start) backwards,
    tech-title-tone calc(var(--title-grow-ms) + 600ms) ease-in var(--title-start) backwards;
}

@keyframes tech-title-grow {
  from {
    opacity: 0;
    scale: 0.1;
  }
  15% {
    opacity: 0.8;
  }
}

@keyframes tech-title-tone {
  from {
    filter: blur(12px);
    color: var(--red);
  }
  55% {
    filter: blur(0);
    color: var(--red);
  }
}

/*
 * Each box comes in from the crosshair corner: its frame (::before, pinned to that corner) grows to full
 * size and is always seen whole, while a mask uncovers the inside in step with it. --hide-* is 100% on
 * the two sides away from the crosshair (set per layout below), so the mask starts as a point there and
 * its far edges keep up with the frame's (--show-*); on the crosshair sides it leaves some room.
 * The mask is on the box's content (.tech-box-body), so the corner dots are never clipped.
 * Once open the clip is dropped, so the score pop can swell past it.
 */
.tech-score-box,
.tech-desc-box {
  --edge: calc(var(--u) * -16px - var(--bw));
  --dot-size: calc(var(--u) * 7.2px);
}

.tech-comp.is-built .tech-box-body {
  animation: tech-unmask var(--box-in-ms) cubic-bezier(0.3, 0.7, 0.2, 1) var(--build-at) backwards;
}

.tech-comp.is-built .tech-score-box.is-scoring {
  animation:
    tech-float var(--float-ms) ease-in-out infinite,
    score-pop 1744ms linear 250ms;
}

@keyframes tech-unmask {
  from {
    clip-path: inset(
      var(--hide-t, var(--edge)) var(--hide-r, var(--edge)) var(--hide-b, var(--edge)) var(--hide-l, var(--edge))
    );
  }
  to {
    clip-path: inset(
      var(--show-t, var(--edge)) var(--show-r, var(--edge)) var(--show-b, var(--edge)) var(--show-l, var(--edge))
    );
  }
}

@keyframes tech-frame-in {
  from {
    width: 0;
    height: 0;
  }
}

/* Once in, the red box has a light sweep now and then. */
.tech-comp.is-built .tech-score-box::before {
  animation:
    tech-frame-in var(--box-in-ms) cubic-bezier(0.3, 0.7, 0.2, 1) var(--build-at) backwards,
    tech-sweep 7s ease-in-out var(--in-at) infinite;
}

.tech-comp.is-built .tech-desc-box::before {
  animation: tech-frame-in var(--box-in-ms) cubic-bezier(0.3, 0.7, 0.2, 1) var(--build-at) backwards;
}

@keyframes tech-sweep {
  0% {
    background-position: 100% 0;
  }
  35%,
  100% {
    background-position: 0 0;
  }
}

/* About as wide as the red box, in balanced lines; app.js (fitTitle) scales the reference font size
   so every title covers about the same area: longer titles take more lines in smaller type. */
.tech-name {
  max-width: min(calc(var(--u) * 442px), var(--side-max));
  text-wrap: balance;
  margin: 0;
  color: #fff;
  opacity: 0.8;
  font-family: "Baikal UltraCond", "Baikal ExtraCond", "Oswald", sans-serif;
  font-weight: 300;
  font-size: max(var(--min-font), calc(var(--u) * 113px));
  line-height: 0.92;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.tech-score-box,
.tech-desc-box {
  position: relative;
  display: flex;
  flex-direction: column;
  border: var(--bw) solid transparent;
}

/* The content, filling the box inside its border (the entry mask is on it). */
.tech-box-body {
  flex: 1;
  min-width: 0;
}

.tech-score-box {
  width: var(--box-w);
  min-height: calc(var(--u) * 340px);
  color: var(--red);
  transform-origin: var(--cx, 0%) var(--cy, 100%);
}

.tech-score-box > .tech-box-body {
  display: grid;
  padding: calc(var(--u) * 30px);
  background: rgba(0, 0, 0, 0.1);
}

.tech-desc-box {
  width: min(calc(var(--u) * 320px), var(--side-max));
  min-height: calc(var(--u) * 240px);
  color: #fff;
}

.tech-desc-box > .tech-box-body {
  display: flex;
  flex-direction: column;
  padding: calc(var(--u) * 24px);
}

/* The visible border is drawn on ::before, pinned to the crosshair corner, so it can grow from there. */
.tech-score-box::before,
.tech-desc-box::before {
  content: "";
  position: absolute;
  box-sizing: border-box;
  width: calc(100% + var(--bw) * 2);
  height: calc(100% + var(--bw) * 2);
  pointer-events: none;
}

/* Filled red while a new score counts (score-pop below). */
@property --score-fill {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(255, 58, 47, 0);
}

/* A soft coral light crosses the red box now and then (tech-sweep). */
.tech-score-box::before {
  border: var(--bw) solid var(--red);
  background: linear-gradient(100deg, transparent 38%, rgba(255, 91, 76, 0.22) 50%, transparent 62%) 100% 0 / 300%
    100% no-repeat var(--score-fill);
}

/* The dotted frame is drawn with gradients, so it grows with the frame. */
.tech-desc-box::before {
  --dots: rgba(255, 255, 255, 0.75);
  --dot-step: calc(var(--bw) * 2);
  background:
    linear-gradient(90deg, var(--dots) 50%, transparent 0) 0 0 / var(--dot-step) var(--bw) repeat-x,
    linear-gradient(90deg, var(--dots) 50%, transparent 0) 0 100% / var(--dot-step) var(--bw) repeat-x,
    linear-gradient(var(--dots) 50%, transparent 0) 0 0 / var(--bw) var(--dot-step) repeat-y,
    linear-gradient(var(--dots) 50%, transparent 0) 100% 0 / var(--bw) var(--dot-step) repeat-y;
}

.box-dot {
  position: absolute;
  width: max(5px, calc(var(--u) * 9px));
  aspect-ratio: 1;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.box-dot.is-tl,
.box-dot.is-bl {
  left: calc(var(--bw) / -2);
}

.box-dot.is-tr,
.box-dot.is-br {
  left: calc(100% + var(--bw) / 2);
}

.box-dot.is-tl,
.box-dot.is-tr {
  top: calc(var(--bw) / -2);
}

.box-dot.is-bl,
.box-dot.is-br {
  top: calc(100% + var(--bw) / 2);
}

/* The crosshair and its ring: a zero-size grid item on the corner the two boxes share (placed per layout). */
.tech-cross {
  position: relative;
  z-index: 2;
  align-self: start;
  justify-self: start;
  width: 0;
  height: 0;
  pointer-events: none;
}

.tech-anchor {
  position: absolute;
  left: 0;
  top: 0;
  width: max(14px, calc(var(--u) * 31.5px));
  height: auto;
  overflow: visible;
  transform: translate(-50%, -50%) scale(0.3);
  fill: var(--red);
}

/* Before each new sector (SCORE_BLINK_MS in app.js). */
.tech-comp.is-built .tech-anchor.is-blinking {
  animation: tech-blink 200ms steps(1, end) 3;
}

@keyframes tech-blink {
  50% {
    opacity: 0;
  }
}

/* The ring that leaves the crosshair: thick and glowing, like the radar ping in the reference. */
.tech-ring {
  position: absolute;
  left: 0;
  top: 0;
  width: max(28px, calc(var(--u) * 64px));
  aspect-ratio: 1;
  border: calc(var(--bw) * 2.5) solid var(--red);
  border-radius: 50%;
  box-shadow:
    0 0 calc(var(--u) * 18px) rgba(255, 58, 47, 0.8),
    inset 0 0 calc(var(--u) * 14px) rgba(255, 58, 47, 0.6);
  opacity: 0;
  transform: translate(-50%, -50%);
}

.tech-ring.is-pulsing {
  animation: tech-ring 1400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes tech-ring {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.3);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(3);
  }
}

/* Every sector of the technology is stacked in the box (so it keeps the size of the longest one) and
   they take turns: the figure swaps at once (app.js counts it from the previous score) while the sector
   names wipe out and in (sector-out / sector-in below). */
.tech-score-slides {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.tech-score-slide {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
}

.tech-score-slide > * {
  opacity: 0;
}

.tech-score-slide.is-active > *,
.tech-score-slide.is-leaving > .tech-score-sector {
  opacity: 1;
}

.tech-score-slide p {
  margin: 0;
}

.tech-score-sector {
  margin-bottom: auto !important;
  padding-bottom: calc(var(--u) * 24px);
  font-family: "Baikal Normal", "Archivo", sans-serif;
  font-weight: 700;
  font-size: max(var(--min-font), calc(var(--u) * 26px));
  line-height: 1.12;
  letter-spacing: 0.02em;
  text-align: right;
  text-transform: uppercase;
}

.tech-score-label {
  font-family: "Baikal UltraCond", "Oswald", sans-serif;
  font-weight: 500;
  font-size: max(var(--min-font), calc(var(--u) * 46px));
  line-height: 1;
  text-transform: uppercase;
}

.tech-score-label em {
  font-weight: 500;
  font-style: italic;
}

.tech-score-figure {
  display: flex;
  align-items: baseline;
  font-family: "Baikal UltraCond", "Oswald", sans-serif;
  font-weight: 500;
  font-size: max(var(--min-font), calc(var(--u) * 96px));
  line-height: 0.92;
  white-space: nowrap;
}

.tech-score-max {
  font-weight: 300;
  font-style: italic;
}

/*
 * New sector (app.js, within --score-step): a ring leaves the crosshair, the old sector name is wiped away
 * towards the far side, the whole box swells out of the crosshair and fills red while the score counts (the
 * red figure almost disappears into it), then shrinks back and the new name slides in from the far edge.
 */
.tech-score-slide.is-leaving .tech-score-sector {
  animation: sector-out 450ms ease-in 100ms forwards;
}

.tech-comp.is-built .tech-score-slide.is-entering .tech-score-sector {
  animation: sector-in 450ms cubic-bezier(0.2, 0.8, 0.2, 1) 1370ms backwards;
}

@keyframes sector-out {
  to {
    clip-path: inset(0 0 0 100%);
  }
}

@keyframes sector-in {
  from {
    translate: 100% 0;
    clip-path: inset(0 100% 0 0);
  }
  to {
    translate: 0 0;
    clip-path: inset(0);
  }
}

@keyframes sector-out-left {
  to {
    clip-path: inset(0 100% 0 0);
  }
}

@keyframes sector-in-left {
  from {
    translate: -100% 0;
    clip-path: inset(0 0 0 100%);
  }
  to {
    translate: 0 0;
    clip-path: inset(0);
  }
}

/* Swells while slowly speeding up (672ms), holds (400ms), shrinks back slowly braking (672ms). */
@keyframes score-pop {
  from {
    scale: 1;
    --score-fill: rgba(255, 58, 47, 0);
    animation-timing-function: cubic-bezier(0.12, 0, 0.39, 0);
  }
  38.53% {
    scale: 1.06;
    --score-fill: rgba(255, 58, 47, 0.75);
  }
  61.47% {
    scale: 1.06;
    --score-fill: rgba(255, 58, 47, 0.75);
    animation-timing-function: cubic-bezier(0.61, 1, 0.88, 1);
  }
}

.tech-description {
  max-width: 86%;
  margin: 0;
  font-family: "Baikal Normal", "Archivo", sans-serif;
  font-weight: 500;
  font-size: max(var(--min-font), calc(var(--u) * 21px));
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.8);
}

/*
 * Side by side (app.js sets data-q, each part's quadrant around the crosshair: tl, tr, bl or br): the title
 * takes a random quadrant, the red box the one beside it and the dotted box the one above or below it, so
 * the boxes are always diagonally opposite and meet at the crosshair, the centre of the 2 × 2 grid. Each
 * part is pushed against the crosshair (--cx / --cy: that corner of the part).
 */
@container (width > 700px) {
  .tech-comp > [data-q="tl"] {
    grid-area: 1 / 1;
  }

  .tech-comp > [data-q="tr"] {
    grid-area: 1 / 2;
  }

  .tech-comp > [data-q="bl"] {
    grid-area: 2 / 1;
  }

  .tech-comp > [data-q="br"] {
    grid-area: 2 / 2;
  }

  /* Onto the border centre lines, where the boxes' corner dots sit (on the red box's border). */
  .tech-cross {
    grid-area: 2 / 2;
    left: calc(var(--bw) / 2);
    top: calc(var(--bw) / 2);
  }

  .tech-comp:has(> .tech-score-box[data-q$="l"]) > .tech-cross {
    left: calc(var(--bw) / -2);
  }

  .tech-comp:has(> .tech-score-box[data-q^="t"]) > .tech-cross {
    top: calc(var(--bw) / -2);
  }

  .tech-comp > [data-q$="l"] {
    --cx: 100%;
    --dot-x: calc(100% + var(--bw) / 2);
    justify-self: end;
  }

  .tech-comp > [data-q$="r"] {
    --cx: 0%;
    --dot-x: calc(var(--bw) / -2);
    justify-self: start;
  }

  .tech-comp > [data-q^="t"] {
    --cy: 100%;
    --dot-y: calc(100% + var(--bw) / 2);
    align-self: end;
  }

  .tech-comp > [data-q^="b"] {
    --cy: 0%;
    --dot-y: calc(var(--bw) / -2);
    align-self: start;
  }

  /* The title keeps a gap to the crosshair and grows out of it. */
  .tech-name[data-q$="l"] {
    --ox: calc(100% + var(--u) * 30px);
    margin-right: calc(var(--u) * 30px);
    text-align: right;
  }

  .tech-name[data-q$="r"] {
    --ox: calc(var(--u) * -30px);
    margin-left: calc(var(--u) * 30px);
    text-align: left;
  }

  .tech-name[data-q^="t"] {
    --oy: calc(100% + var(--u) * 26px);
    margin-bottom: calc(var(--u) * 26px);
  }

  .tech-name[data-q^="b"] {
    --oy: calc(var(--u) * -26px);
    margin-top: calc(var(--u) * 26px);
  }

  /* The dotted frame overlaps the red one at the shared corner. */
  .tech-desc-box[data-q$="l"] {
    margin-right: calc(var(--bw) * -1);
  }

  .tech-desc-box[data-q$="r"] {
    margin-left: calc(var(--bw) * -1);
  }

  .tech-desc-box[data-q^="t"] {
    margin-bottom: calc(var(--bw) * -1);
  }

  .tech-desc-box[data-q^="b"] {
    margin-top: calc(var(--bw) * -1);
  }

  /* Frames pinned to the crosshair corner; masks start there. */
  :is(.tech-score-box, .tech-desc-box)[data-q$="l"] {
    --hide-l: 100%;
    --show-l: calc(var(--bw) * -1);
  }

  :is(.tech-score-box, .tech-desc-box)[data-q$="l"]::before {
    right: calc(var(--bw) * -1);
  }

  :is(.tech-score-box, .tech-desc-box)[data-q$="r"] {
    --hide-r: 100%;
    --show-r: calc(var(--bw) * -1);
  }

  :is(.tech-score-box, .tech-desc-box)[data-q$="r"]::before {
    left: calc(var(--bw) * -1);
  }

  :is(.tech-score-box, .tech-desc-box)[data-q^="t"] {
    --hide-t: 100%;
    --show-t: calc(var(--bw) * -1);
  }

  :is(.tech-score-box, .tech-desc-box)[data-q^="t"]::before {
    bottom: calc(var(--bw) * -1);
  }

  :is(.tech-score-box, .tech-desc-box)[data-q^="b"] {
    --hide-b: 100%;
    --show-b: calc(var(--bw) * -1);
  }

  :is(.tech-score-box, .tech-desc-box)[data-q^="b"]::before {
    top: calc(var(--bw) * -1);
  }

  /* Red box: score and figure in the crosshair corner, the sector name in the far one. */
  .tech-score-box[data-q$="l"] :is(.tech-score-label, .tech-score-figure) {
    align-self: flex-end;
    text-align: right;
  }

  .tech-score-box[data-q$="l"] .tech-score-sector {
    text-align: left;
  }

  .tech-score-box[data-q^="b"] .tech-score-sector {
    order: 1;
    margin: auto 0 0 !important;
    padding: calc(var(--u) * 24px) 0 0;
  }

  .tech-score-box[data-q$="l"] .tech-score-slide.is-leaving .tech-score-sector {
    animation-name: sector-out-left;
  }

  .tech-comp.is-built .tech-score-box[data-q$="l"] .tech-score-slide.is-entering .tech-score-sector {
    animation-name: sector-in-left;
  }

  /* Dotted box: the description against the crosshair. */
  .tech-desc-box[data-q$="l"] .tech-description {
    margin-left: auto;
    text-align: right;
  }

  .tech-desc-box[data-q^="t"] .tech-description {
    margin-top: auto;
  }
}

/* Narrow columns (4+ per screen): side by side would leave the title and description ~230px, so
   stack title, score box and description; the crosshair is on their shared left corner. */
@container (max-width: 700px) {
  .tech-comp {
    /* Keeps the drift inside the column's side margins. */
    --float-x: calc(var(--pad) * 0.75);
    width: calc(100cqw - 2 * var(--pad));
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  .tech-name {
    --ox: 0%;
    --oy: 100%;
    grid-area: 1 / 1;
    justify-self: start;
    max-width: min(calc(var(--u) * 442px), 100%);
    margin-bottom: calc(var(--u) * 26px);
  }

  .tech-score-box {
    --cx: 0%;
    --cy: 100%;
    --dot-x: calc(var(--bw) / -2);
    --dot-y: calc(100% + var(--bw) / 2);
    --hide-t: 100%;
    --show-t: calc(var(--bw) * -1);
    --hide-r: 100%;
    --show-r: calc(var(--bw) * -1);
    grid-area: 2 / 1;
    width: 100%;
    min-height: calc(var(--u) * 300px);
  }

  .tech-score-box::before {
    left: calc(var(--bw) * -1);
    bottom: calc(var(--bw) * -1);
  }

  .tech-desc-box {
    --dot-x: calc(var(--bw) / -2);
    --dot-y: calc(var(--bw) / -2);
    --hide-b: 100%;
    --show-b: calc(var(--bw) * -1);
    --hide-r: 100%;
    --show-r: calc(var(--bw) * -1);
    grid-area: 3 / 1;
    width: auto;
    min-height: 0;
    margin-top: calc(var(--bw) * -1);
  }

  .tech-desc-box::before {
    left: calc(var(--bw) * -1);
    top: calc(var(--bw) * -1);
  }

  /* Onto the border centre lines, where the boxes' corner dots sit (the dotted box overlaps by --bw). */
  .tech-cross {
    grid-area: 3 / 1;
    left: calc(var(--bw) / 2);
    top: calc(var(--bw) / -2);
  }

  .tech-description {
    max-width: 100%;
  }
}

/* At least 30% of the height; taller when the minimum text and QR sizes need it (app.js measures it). */
.connection-strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 30cqh;
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(var(--panel-count), minmax(0, 1fr));
  pointer-events: none;
}

/* QR discs: "red" = coral disc with a dark code, "dark" = dark disc with a coral (inverted) code. */
.app {
  --disc-bg: var(--coral);
  --disc-ink: var(--coral-dark);
}

.app[data-qr-theme="dark"] {
  --disc-bg: rgba(30, 5, 4, 0.9);
  --disc-ink: var(--coral);
}

.connection-module {
  display: grid;
  place-items: center;
  padding: 1rem 0.8rem;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  transition: opacity 600ms ease;
}

.connection-module:first-child {
  border-left: 0;
}

/* A linked slot: the disc keeps its size but shows a chain-link icon instead of the QR and code. */
.connection-linked {
  position: absolute;
  inset: 0;
  width: 26%;
  margin: auto;
  overflow: visible;
  fill: none;
  stroke: #fff;
  stroke-width: 1.5;
  opacity: 0;
  transition: opacity 500ms ease;
}

.connection-hangup,
.connection-call {
  position: absolute;
  inset: 0;
  width: 52%;
  margin: auto;
  overflow: visible;
  fill: #fff;
  opacity: 0;
  transition: opacity 500ms ease;
}

/* The avatar waiting for a visitor: dark disc, white ringing handset (the PNG's alpha is the mask). */
.connection-call {
  width: 40%;
  height: 40%;
  background: #fff;
  mask: url("/assets/img/avatar-call.png") center / contain no-repeat;
}

.connection-module.is-avatar .qr-disc {
  background: rgba(30, 5, 4, 0.9);
  color: #fff;
}

/* Half size, centred where the QR disc was. */
.connection-module:is(.is-connected, .is-talking) .qr-disc {
  background: var(--coral);
  transform: scale(0.5);
  transform-origin: 50% 50%;
}

.connection-module:is(.is-connected, .is-avatar) :is(.connection-qr, .connection-code) {
  opacity: 0;
}

.connection-module.is-connected .connection-linked,
.connection-module.is-avatar.is-talking .connection-hangup,
.connection-module.is-avatar:not(.is-talking, .is-calling) .connection-call {
  opacity: 1;
}


/*
 * The wall is 5500 x 2500 mm and the screen area fills it, so 1cqw = 55 mm and 1cqh = 25 mm whatever the
 * LED controller resolution. --qr-max-mm caps the physical size of the code on that wall, but --qr-min
 * (controller setting, screen pixels) always wins. The disc around it is the code's quiet zone.
 */
.qr-disc {
  --wall-width-mm: 5500;
  --wall-height-mm: 2500;
  --qr-max-mm: 200;
  --qr: max(
    var(--qr-min),
    min(
      9cqw,
      calc(100cqw * var(--qr-max-mm) / var(--wall-width-mm)),
      calc(100cqh * var(--qr-max-mm) / var(--wall-height-mm))
    )
  );
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--qr) * 0.07);
  width: calc(var(--qr) * 1.75);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--disc-bg);
  color: var(--disc-ink);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  /* Grows upwards when it shows the callout, so it never leaves the bottom of the screen. */
  --callout-scale: 1.45;
  transform-origin: 50% 100%;
  transition: transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.connection-qr {
  width: var(--qr);
  aspect-ratio: 1;
  margin-top: calc(var(--qr) * 0.12);
  transition: opacity 500ms ease;
}

/* Hidden but still taking its room, so the strip keeps its height while slots are in use. */
.connection-qr:not([src]),
.connection-qr.is-unavailable {
  visibility: hidden;
}

.connection-code {
  margin: 0;
  font-family: "Baikal Exp", "Archivo", sans-serif;
  font-weight: 500;
  font-size: max(var(--min-font), calc(var(--qr) * 0.1));
  line-height: 1;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  transition: opacity 500ms ease;
}

/* A free disc now and then grows and swaps its code for the link instructions (app.js adds .is-calling). */
.connection-callout {
  position: absolute;
  inset: 13%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* Drawn inside the grown disc, so the minimum applies to the size on screen. */
  font-size: max(calc(var(--min-font) / var(--callout-scale)), calc(var(--qr) * 0.075));
  line-height: 1.1;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 500ms ease;
}

.connection-callout p {
  margin: 0;
}

.callout-strong {
  font-family: "Baikal Exp", "Archivo", sans-serif;
  font-weight: 500;
}

.callout-line {
  font-family: "Baikal Cond", "Oswald", sans-serif;
  font-weight: 400;
}

/* Addresses keep their case: a typed path is case-sensitive. */
.callout-host,
.cta-host {
  font-family: "Baikal Cond", "Oswald", sans-serif;
  font-weight: 400;
  text-transform: none;
  overflow-wrap: anywhere;
}

.callout-host {
  margin: 0.15em 0 !important;
  font-size: 1.12em;
}

.connection-module.is-calling .qr-disc {
  transform: scale(var(--callout-scale));
}

.connection-module.is-calling :is(.connection-qr, .connection-code) {
  opacity: 0;
}

.connection-module.is-calling:not(.is-avatar) .connection-callout.is-phone,
.connection-module.is-calling.is-avatar .connection-callout.is-invite {
  opacity: 1;
  transition-delay: 300ms;
}

/* Call-to-action screen in the viewer 2 rotation: copy on the left, a big QR on the right that sends waves. */
.stage[data-screen="2"] .cta-screen {
  position: absolute;
  inset: 0 0 var(--strip-h);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  column-gap: 5cqw;
  padding: 0 7cqw;
}

.cta-copy {
  justify-self: end;
  text-align: right;
}

/* Same type, colour, opacity and letter spacing as the technology titles (.tech-name). */
.cta-title {
  display: flex;
  flex-direction: column;
  margin: 0;
  color: #fff;
  opacity: 0.8;
  font-family: "Baikal UltraCond", "Baikal ExtraCond", "Oswald", sans-serif;
  font-weight: 300;
  font-size: max(var(--min-font), 8.6cqh);
  line-height: 0.98;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cta-sub {
  max-width: 24em;
  margin: 1.1em 0 0 auto;
  color: var(--coral);
  font-family: "Baikal Normal", "Archivo", sans-serif;
  font-weight: 500;
  font-size: max(var(--min-font), 1.05cqw);
  line-height: 1.3;
  text-transform: uppercase;
  text-wrap: balance;
}

.cta-sub .cta-host {
  font-family: inherit;
  font-weight: inherit;
  font-size: 1.15em;
}

.cta-sub.is-lead {
  color: #fff;
}

.cta-sub + .cta-sub {
  margin-top: 0.6em;
}

.cta-disc {
  --qr: max(var(--qr-min), 24cqh);
  justify-self: start;
}

.cta-line,
.cta-sub,
.cta-disc {
  opacity: 0;
  filter: blur(10px);
  transition:
    opacity 900ms ease,
    filter 900ms ease,
    transform 1100ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cta-line {
  transform: translateX(-1.2em);
  transition-delay: calc(200ms + var(--i, 0) * 260ms);
}

.cta-sub {
  transition-delay: 1000ms;
}

.cta-disc {
  transform: scale(0.6);
  transition-delay: 300ms;
}

.cta-screen.is-visible :is(.cta-line, .cta-sub, .cta-disc) {
  opacity: 1;
  filter: blur(0);
  transform: none;
}

.panel.is-phone-linked .tech-slot {
  visibility: hidden;
}

.phone-linked-view {
  position: absolute;
  inset: 0;
  z-index: 31;
  display: none;
  overflow: hidden;
  pointer-events: none;
}

.panel.is-phone-linked .phone-linked-view {
  display: block;
}

/*
 * Column of a linked phone, sized on the column width (cqw). The sector and innovation steps are the
 * link flow (app.js LinkFlow); the other steps show a centred message card (.tech-card.is-stage).
 */
.phone-linked-view {
  container-type: size;
}

.tech-card {
  position: absolute;
  left: 5.5%;
  right: 4.5%;
  top: 6%;
  bottom: calc(var(--strip-h) + 3%);
  opacity: 0;
  filter: blur(10px);
  transition: opacity 700ms ease, filter 700ms ease;
  color: #fff;
}

.tech-card.is-visible {
  opacity: 1;
  filter: blur(0);
}

.tech-card-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.tech-card p,
.tech-card h2 {
  margin: 0;
}

/* One message per step of the linked phone (app.js stageMessage), centered in the column. */
.tech-card.is-stage .tech-card-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6em;
  padding: 14cqh 4cqw 2em;
  text-align: center;
  text-transform: uppercase;
}

.stage-title {
  max-width: 11em;
  font-family: "Baikal ExtraCond", "Oswald", sans-serif;
  font-weight: 300;
  font-size: max(var(--min-font), 8cqw);
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.stage-line {
  max-width: 24em;
  font-family: "Baikal Exp", "Archivo", sans-serif;
  font-weight: 500;
  font-size: max(var(--min-font), 2.6cqw);
  line-height: 1.35;
  letter-spacing: 0.04em;
  text-wrap: balance;
}

.tech-card.is-linked .tech-card-scroll,
.tech-card.is-farewell .tech-card-scroll {
  padding-top: 34cqh;
}

.tech-card.is-linked .stage-title {
  max-width: 8em;
  font-family: "Baikal Exp", "Archivo", sans-serif;
  font-weight: 500;
  font-size: max(var(--min-font), 3.6cqw);
  letter-spacing: 0.05em;
  color: var(--coral);
}

/* Centered on the strip disc under the column: the card ends var(--strip-h) + 3% above the bottom. */
.stage-rings {
  position: absolute;
  left: 50%;
  top: calc(100% + 3cqh + var(--strip-h) / 2);
  width: 0;
  height: 0;
  pointer-events: none;
}

.stage-ring {
  position: absolute;
  left: 0;
  top: 0;
  width: 70cqw;
  aspect-ratio: 1;
  border: max(2px, 0.5cqw) solid var(--coral);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.2);
  animation: stage-ring 3.6s ease-out calc(var(--i) * 1.2s) infinite;
}

@keyframes stage-ring {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
  15% {
    opacity: 0.7;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.6);
  }
}

/*
 * Link flow (DEMO_CONNECTED_v2): app.js places the parts in pixels (left / top / size) and they glide
 * between steps (LINK_MOVE_MS); texts wipe in and out from the left (.link-wipe.is-hidden). Titles look
 * like the technology titles (.tech-name). --fit shrinks the innovation's box and text when its analysis
 * would run into the QR strip.
 */
.link-flow {
  --bw: 2px;
  --fit: 1;
  --move: 900ms cubic-bezier(0.3, 0.7, 0.2, 1);
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 500ms ease;
}

.link-flow.is-resetting * {
  transition: none !important;
}

.link-flow.is-in {
  opacity: 1;
  transition-duration: 200ms;
}

.link-flow p,
.link-flow h2 {
  margin: 0;
}

.link-nowrap {
  white-space: nowrap;
}

.link-wipe {
  clip-path: inset(-0.3em -0.3em -0.3em -0.3em);
  transition: clip-path 450ms cubic-bezier(0.3, 0.6, 0.2, 1);
}

.link-wipe.is-hidden {
  clip-path: inset(-0.3em 100% -0.3em -0.3em);
}

/* The analysis is uncovered from its top-left corner. */
.link-text.is-hidden {
  clip-path: inset(-0.3em 100% 100% -0.3em);
}

.link-text {
  transition-duration: 900ms;
}

/* What to do on the phone: one heading fades out before the next fades in. */
.link-head {
  position: absolute;
  left: 4cqw;
  right: 4cqw;
  top: 12.6cqh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 500ms ease;
}

.link-head.is-active {
  opacity: 1;
  transition: opacity 700ms ease 500ms;
}

.link-head-title,
.link-sector,
.link-box-wait {
  font-family: "Baikal UltraCond", "Baikal ExtraCond", "Oswald", sans-serif;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.link-head,
.link-sector {
  color: rgba(255, 255, 255, 0.95);
}

.link-head-title {
  margin-bottom: 0.12em !important;
  font-size: max(var(--min-font), 11.2cqw);
}

.link-head-line {
  font-family: "Baikal Normal", "Archivo", sans-serif;
  font-weight: 700;
  font-size: max(var(--min-font), 3.4cqw);
  line-height: 1.22;
  letter-spacing: 0.05em;
}

.link-sector {
  position: absolute;
  width: max-content;
  max-width: 66cqw;
  font-size: max(var(--min-font), 9.8cqw);
  text-wrap: balance;
  transition:
    left var(--move),
    top var(--move),
    clip-path 450ms cubic-bezier(0.3, 0.6, 0.2, 1);
}

/* "???" (nothing chosen yet) breathes. */
.link-sector.is-empty {
  font-size: max(var(--min-font), 11cqw);
}

.link-sector.is-empty,
.link-box-wait {
  animation: link-breathe 2.4s ease-in-out infinite;
}

@keyframes link-breathe {
  50% {
    opacity: 0.45;
  }
}

.link-dotted,
.link-box,
.link-cross {
  position: absolute;
  transition:
    left var(--move),
    top var(--move),
    width var(--move),
    height var(--move);
}

.link-dotted {
  --dots: rgba(255, 255, 255, 0.75);
  --dot-step: calc(var(--bw) * 2);
  background:
    linear-gradient(90deg, var(--dots) 50%, transparent 0) 0 0 / var(--dot-step) var(--bw) repeat-x,
    linear-gradient(90deg, var(--dots) 50%, transparent 0) 0 100% / var(--dot-step) var(--bw) repeat-x,
    linear-gradient(var(--dots) 50%, transparent 0) 0 0 / var(--bw) var(--dot-step) repeat-y,
    linear-gradient(var(--dots) 50%, transparent 0) 100% 0 / var(--bw) var(--dot-step) repeat-y;
}

.link-flow[data-step="tech"] .link-dotted {
  opacity: 0;
  transition:
    left var(--move),
    top var(--move),
    width var(--move),
    height var(--move),
    opacity 300ms ease;
}

/* Filled red while a new score counts (link-fill). */
.link-box {
  box-sizing: border-box;
  border: var(--bw) solid rgba(255, 58, 47, 0.85);
  background: linear-gradient(var(--score-fill), var(--score-fill)), rgba(0, 0, 0, 0.1);
  color: var(--red);
}

/* Corner dots (the crosshair takes the top-left one) once the box holds an innovation. */
.link-box .box-dot {
  width: max(4px, 1.2cqw);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 400ms ease;
}

.link-flow[data-step="tech"] .link-box .box-dot {
  opacity: 1;
}

.link-box.is-scoring {
  animation: link-fill 1744ms linear 250ms;
}

@keyframes link-fill {
  from {
    --score-fill: rgba(255, 58, 47, 0);
    animation-timing-function: cubic-bezier(0.12, 0, 0.39, 0);
  }
  38.53% {
    --score-fill: rgba(255, 58, 47, 0.75);
  }
  61.47% {
    --score-fill: rgba(255, 58, 47, 0.75);
    animation-timing-function: cubic-bezier(0.61, 1, 0.88, 1);
  }
}

/* Waiting for an innovation. */
.link-box-wait {
  position: absolute;
  left: 5.7cqw;
  top: 4cqw;
  color: rgba(255, 58, 47, 0.7);
  font-size: max(var(--min-font), 9.8cqw);
  visibility: hidden;
  opacity: 0;
  transition: opacity 400ms ease, visibility 0s 400ms;
}

.link-box.is-waiting .link-box-wait {
  visibility: visible;
  opacity: 1;
  transition: opacity 600ms ease;
}

/* The innovation: its name at the top of the box, the Desire score at the bottom (app.js sizes the box on it). */
.link-box-tech {
  position: absolute;
  left: calc(var(--bw) * -1);
  top: calc(var(--bw) * -1);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: calc(4.6cqw * var(--fit)) calc(6cqw * var(--fit)) calc(4.4cqw * var(--fit));
  pointer-events: none;
}

.link-tech-name {
  max-width: 50cqw;
  font-family: "Baikal Normal", "Archivo", sans-serif;
  font-weight: 700;
  font-size: max(calc(var(--min-font) * var(--fit)), calc(2.9cqw * var(--fit)));
  line-height: 1.15;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.link-score {
  margin-top: calc(8.4cqw * var(--fit));
}

.link-score[hidden] {
  display: none;
}

.link-score-label,
.link-score-figure {
  font-family: "Baikal UltraCond", "Oswald", sans-serif;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.link-score-label {
  font-size: max(calc(var(--min-font) * var(--fit)), calc(6cqw * var(--fit)));
}

.link-score-label em {
  font-style: italic;
}

.link-score-figure {
  margin-top: 0.08em !important;
  font-size: max(calc(var(--min-font) * var(--fit)), calc(10cqw * var(--fit)));
  line-height: 0.92;
}

.link-score-max {
  font-weight: 300;
  font-style: italic;
}

.link-text {
  position: absolute;
  font-family: "Baikal Normal", "Archivo", sans-serif;
  font-weight: 400;
  font-size: max(calc(var(--min-font) * var(--fit)), calc(3.4cqw * var(--fit)));
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: #fff;
}

.link-possible {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  margin: 0;
  padding: 0 0 0 1.1em;
}

.link-possible li::marker {
  color: var(--red);
}

/* The crosshair: a zero-size point the boxes meet at, with the brand mark and its ring. */
.link-cross {
  z-index: 2;
  width: 0;
  height: 0;
}

.link-anchor {
  position: absolute;
  left: 0;
  top: 0;
  width: max(14px, 3.8cqw);
  height: auto;
  overflow: visible;
  transform: translate(-50%, -50%);
  fill: var(--red);
}

.link-anchor.is-blinking {
  animation: tech-blink 200ms steps(1, end) 3;
}

.link-ring {
  position: absolute;
  left: 0;
  top: 0;
  width: max(28px, 7.6cqw);
  aspect-ratio: 1;
  border: calc(var(--bw) * 2.5) solid var(--red);
  border-radius: 50%;
  box-shadow:
    0 0 2.2cqw rgba(255, 58, 47, 0.8),
    inset 0 0 1.7cqw rgba(255, 58, 47, 0.6);
  opacity: 0;
  transform: translate(-50%, -50%);
}

.link-ring.is-pulsing {
  animation: tech-ring 1400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/*
 * Avatar column (viewer 2, column 4 of the 4-column layout), by conversation status (data-status, app.js):
 * idle (v6 design): the agent video in a dotted box and a single invitation below;
 * talking: the video in a ringed circle, "conversation in progress" on top and the rotating questions;
 * ended: the ringed circle and "ready for the next conversation". The portrait morphs between the two.
 */
.avatar-view {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: var(--strip-h);
  z-index: 1;
  container-type: size;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4cqh 0;
  color: #fff;
  text-align: center;
  animation: avatar-in 1400ms ease both;
}

.avatar-status,
.avatar-kicker,
.avatar-question,
.avatar-note {
  transition: opacity 700ms ease, filter 700ms ease;
}

/* Status changes and rotating questions (AVATAR_QUESTION_FADE_MS in app.js). */
.avatar-view.is-changing :is(.avatar-status, .avatar-kicker, .avatar-question, .avatar-note),
.avatar-question.is-changing {
  opacity: 0;
  filter: blur(10px);
}

@keyframes avatar-in {
  from {
    opacity: 0;
    filter: blur(12px);
  }
}

.avatar-status:empty,
.avatar-kicker:empty,
.avatar-note:empty {
  display: none;
}

.avatar-status {
  margin-bottom: 6cqh;
}

.avatar-status-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  margin: 0 0 0.5em;
  font-family: "Baikal Exp", "Archivo", sans-serif;
  font-weight: 500;
  font-size: max(var(--min-font), 2.9cqw);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--coral);
}

/* "On air" dot. */
.avatar-status-title::before {
  content: "";
  width: 0.55em;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--coral);
  animation: avatar-live 1600ms ease-in-out infinite;
}

@keyframes avatar-live {
  50% {
    opacity: 0.25;
  }
}

.avatar-status-line {
  margin: 0;
  font-family: "Baikal Exp", "Archivo", sans-serif;
  font-size: max(var(--min-font), 2.6cqw);
  line-height: 1.3;
  color: var(--ink-soft);
}

.avatar-portrait {
  position: relative;
  flex: none;
  width: 47.5cqw;
  height: 47.5cqw;
  transition: width 900ms ease, height 900ms ease;
}

.avatar-view[data-status="idle"] .avatar-portrait {
  width: 40cqw;
  height: 48cqw;
}

.avatar-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: opacity 900ms ease;
}

.avatar-ring.is-outer {
  width: 155%;
  border: max(1px, 0.2cqw) solid rgba(255, 92, 72, 0.3);
}

.avatar-ring.is-middle {
  width: 100%;
  border: max(1px, 0.25cqw) solid rgba(255, 92, 72, 0.35);
}

.avatar-ring.is-inner {
  width: 86%;
  border: max(2px, 0.55cqw) solid var(--coral);
}

.avatar-video {
  position: absolute;
  inset: 0;
  width: 79.5%;
  height: 79.5%;
  margin: auto;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(60, 0, 0, 0.5);
  transition: width 900ms ease, height 900ms ease, border-radius 900ms ease;
}

.avatar-view[data-status="idle"] .avatar-video {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

/* Dotted coral frame with corner dots, as the technology boxes. */
.avatar-frame {
  --bw: 1px;
  position: absolute;
  inset: 0;
  border: var(--bw) dotted rgba(255, 92, 72, 0.85);
  color: var(--coral);
  pointer-events: none;
  transition: opacity 900ms ease;
}

.avatar-frame .box-dot {
  opacity: 1;
}

.avatar-view[data-status="idle"] .avatar-ring,
.avatar-view:not([data-status="idle"]) .avatar-frame {
  opacity: 0;
}

.avatar-kicker,
.avatar-question {
  margin: 0;
  text-transform: uppercase;
}

.avatar-kicker,
.avatar-kicker:empty + .avatar-question {
  margin-top: 3.4cqw;
}

.avatar-kicker {
  font-family: "Baikal Exp", "Archivo", sans-serif;
  font-weight: 500;
  font-size: max(var(--min-font), 2.9cqw);
  letter-spacing: 0.03em;
  color: var(--coral);
}

.avatar-question {
  max-width: 62cqw;
  margin-top: 0.15em;
  font-family: "Baikal ExtraCond", "Oswald", sans-serif;
  font-weight: 300;
  font-size: max(var(--min-font), 10cqw);
  line-height: 1.02;
  text-wrap: balance;
}

/* The idle question looks like the technology titles (.tech-name); :where() keeps it below the
   .is-changing fade-out rules. */
:where(.avatar-view[data-status="idle"]) .avatar-question {
  opacity: 0.8;
  font-family: "Baikal UltraCond", "Baikal ExtraCond", "Oswald", sans-serif;
  letter-spacing: 0.05em;
}

.avatar-note {
  max-width: 62cqw;
  margin-top: 4.5cqw;
  font-family: "Baikal Normal", "Archivo", sans-serif;
  font-weight: 500;
  text-transform: uppercase;
}

.avatar-note-title {
  margin: 0 0 0.45em;
  font-weight: 500;
  font-size: max(var(--min-font), 2.9cqw);
  letter-spacing: 0.03em;
  color: var(--coral);
}

.avatar-note-line {
  margin: 0;
  font-size: max(var(--min-font), 2.5cqw);
  line-height: 1.3;
  color: var(--ink-soft);
  text-wrap: balance;
}

/*
 * CES Pulse (viewer 1, right column). One chart at a time; it fades/blurs in, drifts with a slow
 * zoom for its whole lifetime (--pulse-zoom-ms) and fades out. Type scales with the screen height
 * so the same layout reads on the wall and on a test monitor.
 */
.side-embed {
  padding: 0;
  background: #000;
}

.side-embed-frame {
  flex: 1;
  width: 100%;
  border: 0;
}

.side-pulse {
  /* Over the red background video: data in white, with the coral accent of the v6 design. */
  --pulse-strong: #fff;
  --pulse-dim: rgba(246, 244, 239, 0.62);
  --pulse-dark: rgba(8, 8, 8, 0.88);
  /* Charts take 80% of the column (width and height), centred, with type scaled to match. */
  --pulse-u: clamp(7px, min(0.92cqw, 1.64cqh), 51px);
  font-size: var(--pulse-u);
  gap: 1.4em;
  padding: 8cqh 12% 7cqh;
}

/* The video is sharp behind the welcome column and out of focus behind the data. */
.side-pulse::before {
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

/* Fixed CES Pulse logo above the charts; the pulse waves start from its mark. */
.pulse-brand {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  justify-content: center;
  margin-bottom: 0.9em;
  font-size: max(var(--min-font), 2.4em);
}

.pulse-brand-logo {
  display: block;
  height: 1.1em;
  width: auto;
}

/* Covers the icon at the left of the logo image (44 of its 236 px). */
.pulse-brand-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: calc(1.1em * 44 / 36);
  transform: translateX(calc(-1.1em * 236 / 36 / 2));
}

.pulse-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

/* Header and chart sit together, centred in the stage; only the cloud takes all the height left. */
.pulse-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.8em;
  opacity: 0;
  filter: blur(14px);
  transform: scale(1);
  transform-origin: center;
  transition:
    opacity var(--pulse-fade-ms, 1200ms) ease,
    filter var(--pulse-fade-ms, 1200ms) ease,
    transform var(--pulse-zoom-ms, 40000ms) linear;
}

.pulse-slide.is-visible,
.pulse-slide.is-leaving {
  transform: scale(1.03);
}

.pulse-slide.is-visible {
  opacity: 1;
  filter: blur(0);
}

/* Off-screen copy of a chart that app.js lays out to count how many rows fit on a page. */
.pulse-slide.is-measuring {
  visibility: hidden;
  transition: none;
}

/* Natural row heights: plain auto rows would shrink to fit the list and under-report them. */
.pulse-slide.is-measuring .pulse-rows {
  grid-auto-rows: max-content;
}

.pulse-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35em;
  text-align: center;
}

.pulse-kicker,
.pulse-legend {
  margin: 0 0 0.6em;
  color: var(--pulse-dim);
  font-family: "Baikal Exp", "Archivo", sans-serif;
  font-size: max(var(--min-font), 0.85em);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.pulse-title {
  margin: 0;
  font-family: "Baikal ExtraCond", "Oswald", sans-serif;
  font-weight: 400;
  font-size: max(calc(var(--min-font) * 1.4), 2.7em);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.pulse-subtitle,
.pulse-total {
  margin: 0;
  font-family: "Baikal Exp", "Archivo", sans-serif;
  font-weight: 500;
  font-size: max(var(--min-font), 0.95em);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* The headline figure ("6.6B potential reach") in the accent colour. */
.pulse-total {
  color: var(--coral);
  font-size: max(var(--min-font), 1.05em);
}

.pulse-body {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
}

/* Until app.js crops it to its words, the cloud gets all the height left to lay them out in. */
.pulse-cloud-slide .pulse-body:has(.pulse-cloud:not(.is-cropped)) {
  flex-grow: 1;
}

/* Rows are subgrids of the list, so columns sized to their content still line up across rows. */
.pulse-rows {
  display: grid;
  column-gap: 1.1em;
  grid-auto-rows: minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pulse-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
  min-height: 0;
  line-height: 1.2;
  opacity: 0;
  transform: translateX(-1.2em);
  transition:
    opacity 900ms ease,
    transform 900ms ease;
  transition-delay: calc(300ms + var(--i, 0) * var(--row-stagger-ms, 90ms));
}

.pulse-slide.is-visible .pulse-row,
.pulse-slide.is-leaving .pulse-row {
  opacity: 1;
  transform: none;
}

.pulse-rank,
.pulse-value {
  font-family: "Baikal ExtraCond", "Oswald", sans-serif;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.pulse-rank {
  font-size: max(var(--min-font), 2em);
}

/* Uppercase labels wrap onto a second line rather than being cut. */
.pulse-label {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-family: "Baikal Exp", "Archivo", sans-serif;
  font-weight: 500;
  font-size: max(var(--min-font), 0.95em);
  line-height: 1.1;
  text-transform: uppercase;
}

.pulse-value {
  font-size: max(var(--min-font), 2.1em);
  text-align: right;
}

.pulse-change {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3em;
  color: var(--pulse-strong);
  font-family: "Baikal Exp", "Archivo", sans-serif;
  font-weight: 500;
  font-size: max(var(--min-font), 0.85em);
  white-space: nowrap;
}

/* Falling rows in the accent colour, figure included. */
.pulse-change.is-down,
.pulse-row:has(.pulse-change.is-down) .pulse-value {
  color: var(--coral);
}

.pulse-arrow {
  font-size: 1.15em;
  line-height: 1;
}

/*
 * Bars, ranking and sentiment, as in the v6 design: compact rows, each underlined in red, labels flush left.
 */
.pulse-bars,
.pulse-ranking,
.pulse-sentiment {
  grid-auto-rows: auto;
  align-content: center;
}

.pulse-bars .pulse-row,
.pulse-ranking .pulse-row,
.pulse-sentiment .pulse-row {
  --label-size: max(var(--min-font), 0.82em);
  align-items: center;
  padding-block: 0.3em;
  border-bottom: 2px solid rgba(255, 91, 76, 0.8);
}

.pulse-bars .pulse-label,
.pulse-ranking .pulse-label,
.pulse-sentiment .pulse-label {
  font-size: var(--label-size);
}

/*
 * The rank's figures are as tall as a two-line label (cap top to last baseline: 1.1 line + 0.705 cap
 * = 1.805 label sizes; Baikal figures are 0.705 em tall). Both cuts centre their caps in the line box.
 */
.pulse-bars .pulse-rank,
.pulse-ranking .pulse-rank {
  font-size: calc(var(--label-size) * 2.56);
}

.pulse-bars .pulse-track {
  align-self: center;
}

/* Ranked bars (reach, engagement): labels take what they need, bars keep at least 15%. */
.pulse-bars {
  grid-template-columns: auto fit-content(36%) minmax(15%, 1fr) auto auto;
}

.pulse-track {
  position: relative;
  height: 1.5em;
  background: rgba(60, 4, 2, 0.55);
}

.pulse-fill {
  position: absolute;
  inset: 0;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1600ms cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(500ms + var(--i, 0) * var(--row-stagger-ms, 90ms));
}

.pulse-slide.is-visible .pulse-fill,
.pulse-slide.is-leaving .pulse-fill {
  transform: scaleX(var(--w, 0));
}

/* Ranking table (reach growth %). */
.pulse-ranking {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}


.pulse-ranking .pulse-change {
  font-size: max(var(--min-font), 1.1em);
}

/* Sentiment: 100% stacked bars. */
.pulse-sentiment-wrap {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
}

.pulse-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em 2.2em;
  margin: 0 0 1em;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
  letter-spacing: 0.2em;
}

.pulse-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}

.pulse-swatch {
  width: 0.9em;
  height: 0.9em;
}

.pulse-sentiment {
  grid-template-columns: minmax(0, max-content) minmax(40%, 1fr);
}

.pulse-stack {
  display: flex;
  height: max(calc(var(--min-font) * 1.3), 1.35em);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1600ms cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(500ms + var(--i, 0) * var(--row-stagger-ms, 90ms));
}

.pulse-slide.is-visible .pulse-stack,
.pulse-slide.is-leaving .pulse-stack {
  clip-path: inset(0 0 0 0);
}

.pulse-segment {
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
  padding: 0 0.5em;
  overflow: hidden;
}

.pulse-segment.is-neutral {
  justify-content: flex-end;
}

.is-positive > .pulse-swatch,
.pulse-segment.is-positive {
  background: var(--coral);
}

.is-neutral > .pulse-swatch,
.pulse-segment.is-neutral {
  background: rgba(120, 104, 102, 0.85);
}

.is-negative > .pulse-swatch,
.pulse-segment.is-negative {
  background: var(--pulse-dark);
}

.is-unknown > .pulse-swatch,
.pulse-segment.is-unknown {
  background: rgba(246, 244, 239, 0.35);
}

.pulse-share {
  font-family: "Baikal Exp", "Archivo", sans-serif;
  font-size: max(var(--min-font), 0.8em);
  font-weight: 500;
  white-space: nowrap;
}

/* Top themes word cloud; JS sizes and places every word. */
.pulse-cloud {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.pulse-cloud.is-cropped {
  flex: none;
}

.pulse-word {
  position: absolute;
  left: 0;
  top: 0;
  color: rgba(255, 255, 255, 0.55);
  font-family: "Baikal ExtraCond", "Oswald", sans-serif;
  font-weight: 300;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  filter: blur(10px);
  transition:
    opacity 1100ms ease,
    filter 1100ms ease;
  transition-delay: calc(300ms + var(--i, 0) * var(--cloud-stagger-ms, 45ms));
}

.pulse-word:not(.is-placed) {
  visibility: hidden;
}

.pulse-word.is-major {
  color: #fff;
  font-weight: 400;
}

.pulse-word.is-accent {
  color: rgba(255, 255, 255, 0.8);
}

.pulse-slide.is-visible .pulse-word,
.pulse-slide.is-leaving .pulse-word {
  opacity: 1;
  filter: blur(0);
}

/* One dot per chart; the active one is a pill that fills over the rotation time. */
.pulse-progress {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pulse-progress li {
  position: relative;
  flex: 0 0 auto;
  width: 0.55em;
  height: 0.55em;
  overflow: hidden;
  border-radius: 0.275em;
  background: rgba(246, 244, 239, 0.35);
  transition: width 600ms ease;
}

.pulse-progress li::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: left center;
}

.pulse-progress li.is-done {
  background: rgba(246, 244, 239, 0.6);
}

.pulse-progress li.is-active {
  width: 2.8em;
  background: rgba(255, 91, 76, 0.3);
}

.pulse-progress li.is-active::after {
  animation: pulseProgress var(--pulse-ms, 40000ms) linear forwards;
}

@keyframes pulseProgress {
  to {
    transform: scaleX(1);
  }
}

@container (max-width: 980px) {
  .qr-disc {
    --qr: max(var(--qr-min), min(14cqw, 72px));
  }

  .stage[data-screen~="1"] {
    grid-template-columns: 1fr;
  }

  .side-pulse,
  .side-embed {
    display: none;
  }

}

[hidden] {
  display: none !important;
}

/* Login sits above the wall so the screen never shows content before the session is confirmed. */
.viewer-login {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  align-content: center;
  justify-items: stretch;
  gap: 0.9rem;
  padding: 2rem calc(50vw - min(210px, 45vw));
  background: radial-gradient(circle at 30% 20%, #13233d, #070d17 70%);
  color: var(--ink);
}

.viewer-login h1 {
  margin: 0;
  font-size: 2rem;
}

.viewer-login p {
  margin: 0;
  color: var(--ink-soft);
}

.viewer-login label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
}

.viewer-login input {
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  padding: 0.6rem 0.7rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font: inherit;
}

.viewer-login input:focus {
  outline: 2px solid var(--glow);
  outline-offset: 1px;
}

.viewer-login button {
  justify-self: start;
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  background: #67f1ff;
  color: #070d17;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.viewer-login button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.viewer-login .viewer-login-error {
  min-height: 1.2em;
  color: #ff6b6b;
}
