/* Layout: cinematic scroll story. Every chapter is a sticky stage whose scroll progress drives a 3D scene. Single dark look by design. */
:root {
  color-scheme: dark;
  --space: #07060a;
  --night: #120c0a;
  --ember: #c2410c;
  --copper: #e07a45;
  --core: #ffe2c2;
  --atmo: #7fa6c9;
  --ink: #f4ece4;
  --ink-2: color-mix(in oklch, var(--ink) 66%, var(--space));
  --ink-3: color-mix(in oklch, var(--ink) 40%, var(--space));
  --line: color-mix(in oklch, var(--ink) 12%, transparent);
  --ok: #4ade80;
  --wait: #fbbf24;
  /* app chrome colours, taken from the approved W1 design */
  --app-bar: #1e293b;
  --app-ink: #1e293b;
  --app-ink-2: #64748b;
  --app-line: #e2e8f0;
  --app-orange: #f59e42;

  --f-display: "Jost", "Futura", "Avenir Next", "Century Gothic", sans-serif;
  --f-body: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --f-app: "Inter", "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));

  --glow-exp: 1;
  --glow-sat: 1;
  --glow-hue: 0deg;
  --grain: 0.09;
}
html {
  background: var(--space);
}
body {
  background: var(--space);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
::selection {
  background: var(--ember);
  color: var(--core);
}
img {
  display: block;
}
h1,
h2,
h3 {
  font-weight: 300;
  margin: 0;
  text-wrap: balance;
}
p {
  margin: 0;
  text-wrap: pretty;
}
:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
}

body::after {
  content: "";
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 50;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 .95  0 0 0 0 .9  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-3%, 2%);
  }
  40% {
    transform: translate(2%, -3%);
  }
  60% {
    transform: translate(-2%, -1%);
  }
  80% {
    transform: translate(3%, 3%);
  }
  100% {
    transform: translate(0, 0);
  }
}

.wrap {
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
.eyebrow {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--copper);
}
.stage {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  padding-top: calc(env(safe-area-inset-top, 0px) + 22px);
  padding-left: calc(var(--gutter-l) + 12px);
  padding-right: calc(var(--gutter-r) + 12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img.mark {
  width: 26px;
  height: 26px;
}
.brand img.word {
  height: 13px;
  width: auto;
  opacity: 0.92;
}
.nav .ver {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ink-2);
}
.nav-r {
  display: flex;
  align-items: center;
  gap: 18px;
}
/* language picker: two mono labels, the current one lit */
.lang {
  display: flex;
  align-items: center;
  pointer-events: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  background: color-mix(in oklch, var(--space) 55%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lang a {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  line-height: 1;
  padding: 7px 10px 7px 11px;
  border-radius: 999px;
  color: var(--ink-3);
  text-decoration: none;
  transition:
    color 0.2s,
    background-color 0.2s;
}
.lang a:hover {
  color: var(--ink);
}
.lang a[aria-current="page"] {
  color: var(--core);
  background: color-mix(in oklch, var(--copper) 26%, transparent);
}
@media (max-width: 420px) {
  .nav .ver {
    display: none;
  }
}
@media (pointer: coarse) {
  .lang a {
    padding: 12px 13px 12px 14px;
  }
}

/* ---------- device (3D phone with real thickness) ---------- */
.device {
  --w: 300px;
  --r: calc(var(--w) * 0.145);
  --t: calc(var(--w) * 0.02);
  position: relative;
  width: var(--w);
  aspect-ratio: 390 / 844;
  transform-style: preserve-3d;
}
.device > .d-front,
.device > .d-back,
.device > .d-slab i {
  position: absolute;
  inset: 0;
  border-radius: var(--r);
}
.device > .d-slab {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.device > .d-slab i {
  background: linear-gradient(
    90deg,
    #3a3029,
    #17120f 30%,
    #241f22 70%,
    #4a4b55
  );
}
.device > .d-slab i:nth-child(1) {
  transform: translateZ(calc(var(--t) * 0.8));
}
.device > .d-slab i:nth-child(2) {
  transform: translateZ(calc(var(--t) * 0.6));
}
.device > .d-slab i:nth-child(3) {
  transform: translateZ(calc(var(--t) * 0.4));
}
.device > .d-slab i:nth-child(4) {
  transform: translateZ(calc(var(--t) * 0.2));
}
.device > .d-slab i:nth-child(5) {
  transform: translateZ(0);
}
.device > .d-slab i:nth-child(6) {
  transform: translateZ(calc(var(--t) * -0.2));
}
.device > .d-slab i:nth-child(7) {
  transform: translateZ(calc(var(--t) * -0.4));
}
.device > .d-slab i:nth-child(8) {
  transform: translateZ(calc(var(--t) * -0.6));
}
.device > .d-slab i:nth-child(9) {
  transform: translateZ(calc(var(--t) * -0.8));
}
.device > .d-front {
  transform: translateZ(var(--t));
  backface-visibility: hidden;
  background: linear-gradient(145deg, #2c2623, #0b0a0a 45%, #1a1a1f);
  padding: calc(var(--w) * 0.03);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--ink) 14%, transparent);
}
.device > .d-back {
  transform: rotateY(180deg) translateZ(var(--t));
  backface-visibility: hidden;
  background:
    radial-gradient(
      60% 40% at 50% 38%,
      color-mix(in oklch, var(--copper) 26%, transparent),
      transparent 70%
    ),
    linear-gradient(160deg, #2b211b, #120d0b 55%, #201a1a);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px
    color-mix(in oklch, var(--copper) 30%, transparent);
}
.device > .d-back img {
  width: 34%;
  filter: drop-shadow(0 0 calc(var(--w) * 0.06) var(--copper))
    drop-shadow(0 0 calc(var(--w) * 0.16) var(--ember));
}
.d-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--r) - var(--w) * 0.03);
  overflow: hidden;
  background: #fff;
  container-type: inline-size;
}
.d-screen > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  height: 340vh;
}
/* flat on purpose: layers paint in DOM order, each 3D child gets this perspective */
.hero-inner {
  position: absolute;
  inset: 0;
  perspective: 1100px;
}
.world {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--ww, 120vw);
  aspect-ratio: 16 / 9;
  background: url("assets/hero.jpg") center / 100% 100% no-repeat;
  transform-origin: 50% 45.5%;
  filter: brightness(calc(var(--glow-exp) * var(--wb, 1)))
    saturate(var(--glow-sat)) hue-rotate(var(--glow-hue));
  will-change: transform;
}
.world.fg {
  -webkit-mask-image:
    radial-gradient(
      ellipse 80% 29.6% at 50% 75.6%,
      #000 99.4%,
      transparent 100%
    ),
    linear-gradient(to bottom, transparent 75.6%, #000 75.6%);
  mask-image:
    radial-gradient(
      ellipse 80% 29.6% at 50% 75.6%,
      #000 99.4%,
      transparent 100%
    ),
    linear-gradient(to bottom, transparent 75.6%, #000 75.6%);
}
.hero-in .hero-inner {
  animation: dawn 2.4s var(--ease) backwards;
}
@keyframes dawn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
#stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.sun-glow {
  position: absolute;
  left: 50%;
  top: 0;
  width: 90vmax;
  height: 90vmax;
  margin: -45vmax 0 0 -45vmax;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    color-mix(in oklch, var(--core) 70%, transparent),
    color-mix(in oklch, var(--copper) 40%, transparent) 18%,
    color-mix(in oklch, var(--ember) 14%, transparent) 42%,
    transparent 70%
  );
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  filter: hue-rotate(var(--glow-hue)) saturate(var(--glow-sat));
}
.bloom {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle farthest-corner at 50% 64%,
    #fff8ef 0%,
    var(--core) 14%,
    color-mix(in oklch, var(--copper) 85%, #fff) 34%,
    var(--ember) 62%,
    color-mix(in oklch, var(--ember) 40%, var(--night)) 100%
  );
}
.hero-device {
  position: absolute;
  left: 50%;
  top: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    var(--space) 0%,
    transparent 22%,
    transparent 78%,
    var(--space) 100%
  );
}
.hero-copy {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
  transform-style: preserve-3d;
  pointer-events: none;
}
.hero-copy .eyebrow {
  color: var(--ink-2);
}
.hero-num {
  font-family: var(--f-display);
  font-weight: 200;
  font-size: clamp(120px, 24vw, 340px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: transparent;
  background: linear-gradient(
    180deg,
    #fff6ec 0%,
    var(--core) 46%,
    var(--copper) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(
    0 0 40px color-mix(in oklch, var(--ember) 45%, transparent)
  );
}
.hero-num .dot {
  -webkit-text-fill-color: var(--core);
  text-shadow:
    0 0 24px var(--copper),
    0 0 60px var(--ember);
}
.hero-sub {
  font-size: clamp(18px, 2vw, 22px);
  color: var(--ink-2);
}
.hero-in .hero-copy > * {
  animation: rise 1.6s var(--ease) backwards;
}
.hero-in .hero-copy > :nth-child(1) {
  animation-delay: 0.9s;
}
.hero-in .hero-copy > :nth-child(2) {
  animation-delay: 0.4s;
}
.hero-in .hero-copy > :nth-child(3) {
  animation-delay: 1.2s;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.hero-end {
  position: absolute;
  left: 0;
  right: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
}
.hero-end .big {
  font-family: var(--f-display);
  font-weight: 200;
  font-size: clamp(40px, 6vw, 84px);
  line-height: 1;
  letter-spacing: -0.01em;
}
.hero-end p {
  color: var(--ink-2);
}
.scroll-cue {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-3);
  display: grid;
  justify-items: center;
  gap: 10px;
}
.scroll-cue i {
  width: 1px;
  height: 40px;
  background: linear-gradient(var(--ink-3), transparent);
  animation: cue 2.4s var(--ease) infinite;
  transform-origin: top;
}
@keyframes cue {
  0% {
    transform: scaleY(0);
  }
  50% {
    transform: scaleY(1);
  }
  100% {
    transform: scaleY(1);
    opacity: 0;
  }
}

/* ---------- moon ---------- */
.moon {
  position: relative;
  min-height: 120vh;
  display: grid;
  align-items: center;
  overflow: hidden;
}
.moon-img {
  position: absolute;
  inset: -4%;
  background: url("assets/moon.jpg") 70% 50% / cover no-repeat;
  transform: translate3d(calc(var(--mp, 0) * -5%), calc(var(--mp, 0) * 3%), 0)
    scale(calc(1.04 + var(--mp, 0) * 0.08));
  filter: saturate(var(--glow-sat));
}
.moon::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      90deg,
      var(--space) 0%,
      color-mix(in oklch, var(--space) 80%, transparent) 38%,
      transparent 70%
    ),
    linear-gradient(
      to bottom,
      var(--space),
      transparent 22%,
      transparent 78%,
      var(--space)
    );
}
.moon-copy {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  gap: 28px;
  padding-block: 18vh;
}
.moon-copy .story {
  max-width: 30ch;
  font-size: clamp(18px, 1.6vw, 21px);
  color: var(--ink-2);
  display: grid;
  gap: 18px;
}
.moon-copy h2 {
  font-family: var(--f-display);
  font-weight: 200;
  font-size: clamp(44px, 6.4vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  max-width: 11ch;
}
.moon-copy h2 em {
  font-style: normal;
  color: var(--copper);
}
.telemetry {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}
.telemetry b {
  font-weight: 500;
  color: var(--atmo);
}

/* ---------- exploded view ---------- */
.explode {
  position: relative;
  height: 700vh;
}
.explode .stage {
  display: grid;
  align-items: center;
}
.ex-grid {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 32px;
  align-items: center;
}
.ex-col {
  display: grid;
  gap: 40px;
  align-content: center;
}
.ex-scene {
  position: relative;
  height: 100%;
  perspective: 2200px;
  display: grid;
  place-items: center;
}
.ex-rig {
  --lw: 220px;
  position: relative;
  width: var(--lw);
  aspect-ratio: 390 / 844;
  transform-style: preserve-3d;
  will-change: transform;
  translate: -42% 6%;
}
.layer {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--lw) * 0.13);
  transform-style: preserve-3d;
  will-change: transform;
}
.layer .anchor {
  position: absolute;
  right: 0;
  top: 16%;
  width: 1px;
  height: 1px;
}
.layer .tag {
  position: absolute;
  left: 8%;
  top: 5%;
  font-family: var(--f-mono);
  font-size: calc(var(--lw) * 0.036);
  letter-spacing: 0.16em;
  color: var(--ink-3);
}

/* L0: radio module + ground station */
.l-net {
  background: linear-gradient(160deg, #15171c, #0a0a0c);
  box-shadow:
    inset 0 0 0 1px color-mix(in oklch, var(--atmo) 26%, transparent),
    0 30px 60px -10px #000;
}
.modem {
  position: absolute;
  left: 58%;
  top: 81.5%;
  width: 0;
  height: 0;
}
.modem .wave {
  position: absolute;
  left: calc(var(--lw) * -0.3);
  top: calc(var(--lw) * -0.3);
  width: calc(var(--lw) * 0.6);
  height: calc(var(--lw) * 0.6);
  border-radius: 50%;
  border: 1.5px solid var(--atmo);
  opacity: 0;
}
.online .modem .wave {
  animation: wave 2.4s var(--ease) infinite;
}
.online .modem .wave:nth-child(2) {
  animation-delay: 0.8s;
}
.online .modem .wave:nth-child(3) {
  animation-delay: 1.6s;
}
@keyframes wave {
  from {
    transform: scale(0.15);
    opacity: 0.9;
  }
  to {
    transform: scale(1.4);
    opacity: 0;
  }
}
.modem-chip {
  position: absolute;
  left: calc(var(--lw) * -0.1);
  top: calc(var(--lw) * -0.1);
  width: calc(var(--lw) * 0.2);
  height: calc(var(--lw) * 0.2);
  border-radius: 14%;
  background: linear-gradient(145deg, #2a3442, #121820);
  box-shadow:
    inset 0 0 0 1px color-mix(in oklch, var(--atmo) 50%, transparent),
    0 0 0 calc(var(--lw) * 0.012) #0a0a0c,
    0 0 0 calc(var(--lw) * 0.024)
      color-mix(in oklch, var(--atmo) 22%, transparent);
  display: grid;
  place-items: center;
  transition: box-shadow 0.4s;
}
.online .modem-chip {
  box-shadow:
    inset 0 0 0 1px var(--atmo),
    0 0 0 calc(var(--lw) * 0.012) #0a0a0c,
    0 0 0 calc(var(--lw) * 0.024)
      color-mix(in oklch, var(--atmo) 40%, transparent),
    0 0 30px color-mix(in oklch, var(--atmo) 60%, transparent);
}
.modem-chip .bars {
  display: flex;
  align-items: flex-end;
  gap: 8%;
  width: 52%;
  height: 44%;
}
.modem-chip .bars i {
  flex: 1;
  border-radius: 1px;
  background: var(--ink-3);
  opacity: 0.25;
  transition:
    opacity 0.3s,
    background 0.3s;
}
.modem-chip .bars i:nth-child(1) {
  height: 30%;
}
.modem-chip .bars i:nth-child(2) {
  height: 55%;
}
.modem-chip .bars i:nth-child(3) {
  height: 80%;
}
.modem-chip .bars i:nth-child(4) {
  height: 100%;
}
.modem-chip .bars i.on {
  opacity: 1;
  background: var(--atmo);
}
.net-state {
  position: absolute;
  left: 58%;
  top: 62%;
  translate: -50% 0;
  font-family: var(--f-mono);
  font-size: calc(var(--lw) * 0.042);
  letter-spacing: 0.14em;
  color: var(--ink-3);
  white-space: nowrap;
}
.offline-now .net-state {
  color: #f87171;
}
.beam {
  position: absolute;
  left: 58%;
  top: 81.5%;
  width: 112%;
  height: 2px;
  margin-top: -1px;
  background: repeating-linear-gradient(
    90deg,
    color-mix(in oklch, var(--ink) 18%, transparent) 0 6px,
    transparent 6px 12px
  );
  transform-origin: 0 50%;
}
.online .beam {
  background: repeating-linear-gradient(
    90deg,
    color-mix(in oklch, var(--atmo) 80%, transparent) 0 10px,
    transparent 10px 16px
  );
  background-position: var(--beam-x, 0) 0;
  box-shadow: 0 0 12px color-mix(in oklch, var(--atmo) 50%, transparent);
}
.station {
  position: absolute;
  left: 170%;
  top: 81.5%;
  width: 0;
  height: 0;
}
.station .pad {
  position: absolute;
  left: calc(var(--lw) * -0.16);
  top: calc(var(--lw) * -0.16);
  width: calc(var(--lw) * 0.32);
  height: calc(var(--lw) * 0.32);
  border-radius: 50%;
  background: radial-gradient(closest-side, #241812, #0d0a09);
  box-shadow:
    inset 0 0 0 1px color-mix(in oklch, var(--copper) 50%, transparent),
    0 0 calc(var(--hit, 0) * 70px)
      color-mix(in oklch, var(--copper) 80%, transparent);
  display: grid;
  place-items: center;
}
.station .pad img {
  width: 46%;
  filter: drop-shadow(0 0 10px var(--ember));
}
.station .anchor {
  position: absolute;
  left: calc(var(--lw) * 0.16);
  top: 0;
  width: 1px;
  height: 1px;
}

/* L1: sync engine + memory */
.l-store {
  background:
    repeating-linear-gradient(
      90deg,
      color-mix(in oklch, var(--copper) 10%, transparent) 0 1px,
      transparent 1px 12px
    ),
    repeating-linear-gradient(
      0deg,
      color-mix(in oklch, var(--copper) 10%, transparent) 0 1px,
      transparent 1px 12px
    ),
    linear-gradient(160deg, #22140e, #0e0907);
  box-shadow: inset 0 0 0 1px
    color-mix(in oklch, var(--copper) 40%, transparent);
}
.cells {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 13%;
  height: 40%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: calc(var(--lw) * 0.025);
}
.cells i {
  border-radius: calc(var(--lw) * 0.015);
  background: color-mix(in oklch, var(--copper) 12%, #120b08);
  box-shadow: inset 0 0 0 1px
    color-mix(in oklch, var(--copper) 24%, transparent);
  transition:
    background 0.35s,
    box-shadow 0.35s;
}
.cells i.data {
  background: color-mix(in oklch, var(--copper) 26%, #120b08);
}
.cells i.wait {
  background: var(--wait);
  box-shadow: 0 0 14px var(--wait);
}
.cells i.sent {
  background: var(--ok);
  box-shadow: 0 0 10px color-mix(in oklch, var(--ok) 70%, transparent);
}
.cpu {
  position: absolute;
  left: 58%;
  top: 81.5%;
  width: 0;
  height: 0;
}
.cpu .die {
  position: absolute;
  left: calc(var(--lw) * -0.14);
  top: calc(var(--lw) * -0.14);
  width: calc(var(--lw) * 0.28);
  height: calc(var(--lw) * 0.28);
  border-radius: 10%;
  background: linear-gradient(145deg, #3b2418, #170d08);
  box-shadow:
    inset 0 0 0 1px color-mix(in oklch, var(--copper) 70%, transparent),
    0 0 calc(var(--busy, 0) * 40px)
      color-mix(in oklch, var(--copper) 90%, transparent);
  display: grid;
  place-items: center;
  font-family: var(--f-mono);
  font-size: calc(var(--lw) * 0.042);
  letter-spacing: 0.12em;
  color: var(--copper);
}
.cpu .pins {
  position: absolute;
  left: calc(var(--lw) * -0.18);
  top: calc(var(--lw) * -0.18);
  width: calc(var(--lw) * 0.36);
  height: calc(var(--lw) * 0.36);
  background:
    repeating-linear-gradient(
        90deg,
        color-mix(in oklch, var(--copper) 60%, transparent) 0 2px,
        transparent 2px 9px
      )
      top / 100% 12% no-repeat,
    repeating-linear-gradient(
        90deg,
        color-mix(in oklch, var(--copper) 60%, transparent) 0 2px,
        transparent 2px 9px
      )
      bottom / 100% 12% no-repeat,
    repeating-linear-gradient(
        0deg,
        color-mix(in oklch, var(--copper) 60%, transparent) 0 2px,
        transparent 2px 9px
      )
      left / 12% 100% no-repeat,
    repeating-linear-gradient(
        0deg,
        color-mix(in oklch, var(--copper) 60%, transparent) 0 2px,
        transparent 2px 9px
      )
      right / 12% 100% no-repeat;
  opacity: 0.8;
}

/* L2: outbox */
.l-queue {
  background: color-mix(in oklch, #fff 7%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--ink) 22%, transparent);
  padding: 15% 8%;
  display: grid;
  align-content: start;
  gap: calc(var(--lw) * 0.04);
}
.qrow {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  padding: calc(var(--lw) * 0.04);
  border-radius: calc(var(--lw) * 0.04);
  background: color-mix(in oklch, var(--space) 70%, transparent);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: calc(var(--lw) * 0.046);
  line-height: 1.3;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.4s var(--ease),
    transform 0.5s var(--ease);
}
.qrow.on {
  opacity: 1;
  transform: none;
}
.qrow .dot {
  width: calc(var(--lw) * 0.03);
  height: calc(var(--lw) * 0.03);
  border-radius: 50%;
  background: var(--wait);
  box-shadow: 0 0 10px var(--wait);
  grid-row: span 2;
}
.qrow .meta {
  font-family: var(--f-mono);
  font-size: calc(var(--lw) * 0.036);
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.qrow .meta em {
  font-style: normal;
  color: var(--wait);
}
.qrow.sent .dot {
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
}
.qrow.sent .meta em {
  color: var(--ok);
}

/* L3: the screen */
.l-ui {
  background: linear-gradient(145deg, #2c2623, #0b0a0a 45%, #1a1a1f);
  padding: calc(var(--lw) * 0.03);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--ink) 14%, transparent);
}
.tap {
  position: absolute;
  left: 58%;
  top: 81.5%;
  width: calc(var(--lw) * 0.3);
  height: calc(var(--lw) * 0.3);
  margin: calc(var(--lw) * -0.15) 0 0 calc(var(--lw) * -0.15);
  border-radius: 50%;
  border: 2px solid var(--copper);
  opacity: 0;
  pointer-events: none;
}
.tap.go {
  animation: tap 0.7s var(--ease);
}
@keyframes tap {
  from {
    transform: scale(0.2);
    opacity: 1;
  }
  to {
    transform: scale(1.2);
    opacity: 0;
  }
}
.ui-flash {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 2px var(--atmo),
    0 0 50px color-mix(in oklch, var(--atmo) 50%, transparent);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
.ui-flash.on {
  opacity: 1;
}
.app-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 85.9%;
  height: 4.4%;
  background: var(--app-bar);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 2.4cqw;
  padding: 0 5cqw;
  font-family: var(--f-app);
  font-weight: 600;
  font-size: 3.9cqw;
  transition:
    transform 0.5s var(--ease),
    background 0.4s;
}
.app-bar .ab-dot {
  width: 2.6cqw;
  height: 2.6cqw;
  border-radius: 50%;
  background: var(--wait);
  flex: none;
}
.app-bar.sending .ab-dot {
  background: var(--atmo);
  animation: blink 1s ease-in-out infinite;
}
.app-bar.gone {
  transform: translateY(100%);
}
@keyframes blink {
  50% {
    opacity: 0.3;
  }
}

/* the data bus through all layers, two crossed planes for volume */
.bus {
  position: absolute;
  left: 58%;
  top: 81.5%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
}
.bus i {
  position: absolute;
  left: -2px;
  top: 0;
  width: 4px;
  height: var(--len, 0px);
  transform-origin: 50% 0;
  background:
    repeating-linear-gradient(
      180deg,
      color-mix(
          in oklch,
          var(--copper) calc(var(--bus-on, 0) * 90%),
          transparent
        )
        0 8px,
      transparent 8px 16px
    ),
    color-mix(in oklch, var(--ink) 12%, transparent);
  background-position: 0 var(--bus-y, 0);
  box-shadow: 0 0 calc(var(--bus-on, 0) * 14px)
    color-mix(in oklch, var(--copper) 70%, transparent);
}
.bus.up i {
  background:
    repeating-linear-gradient(
      180deg,
      color-mix(in oklch, var(--atmo) calc(var(--bus-on, 0) * 90%), transparent)
        0 8px,
      transparent 8px 16px
    ),
    color-mix(in oklch, var(--ink) 12%, transparent);
  background-position: 0 var(--bus-y, 0);
  box-shadow: 0 0 calc(var(--bus-on, 0) * 14px)
    color-mix(in oklch, var(--atmo) 70%, transparent);
}
.bus i:nth-child(1) {
  transform: rotateX(-90deg);
}
.bus i:nth-child(2) {
  transform: rotateZ(90deg) rotateX(-90deg);
}

.token {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--core);
  box-shadow:
    0 0 12px var(--copper),
    0 0 30px var(--ember);
  opacity: 0;
  will-change: transform, opacity;
}
.token.up {
  background: #eaf4ff;
  box-shadow:
    0 0 12px var(--atmo),
    0 0 30px var(--atmo);
}

.callouts {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.callout {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
  opacity: 0;
  transition:
    opacity 0.5s var(--ease),
    color 0.3s;
}
.callout::before {
  content: "";
  width: var(--len, 44px);
  height: 1px;
  background: linear-gradient(
    90deg,
    color-mix(in oklch, var(--copper) 70%, transparent),
    var(--ink-3)
  );
}
.callout::after {
  content: "";
  position: absolute;
  left: -3px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--copper);
  box-shadow: 0 0 8px var(--copper);
}
.callout b {
  font-weight: 500;
  color: var(--ink);
}
.callout.on {
  opacity: 1;
}
.callout.hot b {
  color: var(--copper);
}

.ex-text {
  position: relative;
  min-height: 300px;
}
.ex-step {
  position: absolute;
  inset: 0 0 auto 0;
  display: grid;
  gap: 18px;
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.9s var(--ease);
}
.ex-step.on {
  opacity: 1;
  transform: none;
}
.ex-step h3 {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(32px, 3.8vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.ex-step p {
  color: var(--ink-2);
  max-width: 34ch;
  font-size: clamp(17px, 1.4vw, 20px);
}

/* data-flow legend: the hop that is active right now lights up */
.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 0;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.flow li {
  display: flex;
  align-items: center;
  transition: color 0.3s;
}
.flow li + li::before {
  content: "";
  width: 12px;
  height: 1px;
  margin: 0 5px;
  background: var(--line);
  transition: background 0.3s;
}
.flow li span {
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition:
    border-color 0.3s,
    background 0.3s,
    color 0.3s;
}
.flow li.on span {
  color: var(--space);
  background: var(--copper);
}
.flow.up li.on span {
  background: var(--atmo);
}
.flow li.on::before {
  background: var(--copper);
}

/* ---------- never stuck ---------- */
.stuck {
  min-height: 90vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: 16vh;
}
.stuck h2 {
  font-family: var(--f-display);
  font-weight: 200;
  font-size: clamp(48px, 8vw, 128px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stuck p {
  margin-top: 28px;
  color: var(--ink-2);
  max-width: 40ch;
  margin-inline: auto;
  font-size: clamp(18px, 1.6vw, 21px);
}

/* ---------- feature chapters ---------- */
.chapter-head {
  padding-block: 14vh 4vh;
}
.chapter-head .inner {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}
.chapter-head h2 {
  font-family: var(--f-display);
  font-weight: 200;
  font-size: clamp(44px, 6vw, 92px);
  line-height: 1;
  letter-spacing: -0.015em;
}
.feat {
  position: relative;
  height: 240vh;
}
.feat .stage {
  display: grid;
  align-items: center;
}
.feat-grid {
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(24px, 5vw, 80px);
  align-items: center;
}
.feat.flip .feat-copy {
  order: 2;
}
.feat-copy {
  display: grid;
  gap: 20px;
}
.feat-copy h3 {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(36px, 4.4vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.01em;
}
.feat-copy p {
  color: var(--ink-2);
  max-width: 36ch;
  font-size: clamp(17px, 1.4vw, 20px);
}
.feat-copy .note {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.feat-vis {
  position: relative;
  height: 100%;
  display: grid;
  place-items: center;
  perspective: 1600px;
}
.feat .glow-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* gps */
.terrain-wrap {
  position: relative;
  width: min(560px, 90%);
  aspect-ratio: 1;
  transform-style: preserve-3d;
}
.terrain {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, transparent 62%, var(--space) 100%),
    repeating-linear-gradient(
      0deg,
      color-mix(in oklch, var(--atmo) 30%, transparent) 0 1px,
      transparent 1px 28px
    ),
    repeating-linear-gradient(
      90deg,
      color-mix(in oklch, var(--atmo) 30%, transparent) 0 1px,
      transparent 1px 28px
    ),
    radial-gradient(closest-side, #1a2230, var(--space));
  transform-style: preserve-3d;
}
.terrain svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.terrain .trail {
  fill: none;
  stroke: var(--copper);
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px var(--ember));
  transition: stroke 0.5s;
}
.terrain .trail-ghost {
  fill: none;
  stroke: color-mix(in oklch, var(--ink) 30%, transparent);
  stroke-width: 2;
  stroke-dasharray: 2 6;
}
.paused .terrain .trail {
  stroke: var(--ink-3);
  filter: none;
}
.loc {
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  transform-style: preserve-3d;
}
.loc b {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--core);
  box-shadow:
    0 0 0 5px color-mix(in oklch, var(--copper) 55%, transparent),
    0 0 30px var(--copper);
  transition:
    background 0.4s,
    box-shadow 0.4s;
}
.loc i {
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  border: 1px solid color-mix(in oklch, var(--copper) 70%, transparent);
  animation: ping 2.8s var(--ease) infinite;
  opacity: 0;
}
.loc i:nth-child(2) {
  animation-delay: 1.4s;
}
.paused .loc b {
  background: var(--ink-3);
  box-shadow: 0 0 0 5px color-mix(in oklch, var(--ink) 14%, transparent);
}
.paused .loc i {
  animation: none;
  opacity: 0;
}
@keyframes ping {
  from {
    transform: scale(0.2);
    opacity: 0.9;
  }
  to {
    transform: scale(1);
    opacity: 0;
  }
}
.gps-chip {
  position: absolute;
  left: 4%;
  bottom: 14%;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in oklch, var(--space) 60%, transparent);
  color: var(--copper);
}
.paused .gps-chip {
  color: var(--ink-2);
}

/* ---------- closing ---------- */
.close {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
}
.close-img {
  position: absolute;
  inset: 0;
  background: url("assets/hero.jpg") center 70% / cover no-repeat;
  transform: scaleY(-1);
  opacity: 0.5;
  filter: brightness(calc(var(--glow-exp) * 0.8)) saturate(var(--glow-sat))
    hue-rotate(var(--glow-hue));
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 55%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 55%);
}
.close-copy {
  position: relative;
  display: grid;
  gap: 20px;
  justify-items: center;
  padding-block: 20vh;
}
.close-copy .big {
  font-family: var(--f-display);
  font-weight: 200;
  font-size: clamp(64px, 11vw, 168px);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.close-copy p {
  color: var(--ink-2);
  max-width: 36ch;
}
.foot {
  padding-block: 32px calc(env(safe-area-inset-bottom, 0px) + 32px);
  border-top: 1px solid var(--line);
}
.foot-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

/* ---------- tweaks ---------- */
.tw-toggle {
  position: fixed;
  z-index: 60;
  right: calc(env(safe-area-inset-right, 0px) + 16px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  font: 500 11px/1 var(--f-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: color-mix(in oklch, var(--space) 75%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  backdrop-filter: blur(10px);
}
.tw-toggle:hover,
.tw-toggle:focus-visible {
  color: var(--ink);
  border-color: var(--copper);
  outline: none;
}
.tweaks {
  position: fixed;
  z-index: 60;
  right: calc(env(safe-area-inset-right, 0px) + 16px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 60px);
  width: min(310px, calc(100vw - 32px));
  background: color-mix(in oklch, var(--night) 90%, transparent);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 14px;
  backdrop-filter: blur(16px);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-2);
}
.tweaks[hidden] {
  display: none;
}
.tweaks h4 {
  margin: 0;
  font: 500 12px/1 var(--f-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}
.tweaks label {
  display: grid;
  gap: 6px;
}
.tweaks .row {
  display: flex;
  justify-content: space-between;
}
.tweaks input[type="range"] {
  width: 100%;
  accent-color: var(--copper);
}
.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.seg button {
  font: 500 11px/1.2 var(--f-mono);
  letter-spacing: 0.06em;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: 7px;
  padding: 8px 4px;
  cursor: pointer;
}
.seg button[aria-pressed="true"] {
  background: var(--copper);
  color: var(--space);
}
.seg-cap {
  color: var(--ink-3);
  line-height: 1.5;
  letter-spacing: 0.04em;
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .explode {
    height: 600vh;
  }
  .ex-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0;
    padding-top: 88px;
  }
  .ex-text {
    min-height: 210px;
    text-align: center;
  }
  .ex-step {
    justify-items: center;
    gap: 12px;
  }
  .ex-step .quote {
    display: none;
  }
  .ex-step p {
    font-size: 16px;
  }
  .ex-rig {
    --lw: 150px;
  }
  .callouts {
    display: none;
  }
  .feat {
    height: 260vh;
  }
  .feat-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
    padding-top: 92px;
  }
  .feat.flip .feat-copy {
    order: 0;
  }
  .feat-copy {
    text-align: center;
    justify-items: center;
    gap: 12px;
  }
  .feat-copy p {
    font-size: 16px;
  }
  .moon::before {
    background: linear-gradient(
      to bottom,
      var(--space),
      color-mix(in oklch, var(--space) 55%, transparent) 30%,
      color-mix(in oklch, var(--space) 70%, transparent) 70%,
      var(--space)
    );
  }
}
@media (prefers-reduced-motion: reduce) {
  body::after,
  .scroll-cue i,
  .loc i,
  .scan,
  .wip::before,
  .app-bar .ab-dot,
  .lc-dot,
  .otp .cur {
    animation: none !important;
  }
  .hero-in .hero-copy > *,
  .hero-in .world.bg {
    animation: none !important;
  }
}

/* ---------- hero legibility (flight variant) ---------- */
.hero-copy {
  padding-bottom: 16vh;
}
.hero-sub {
  color: color-mix(in oklch, var(--ink) 88%, var(--space));
  text-shadow:
    0 0 18px var(--space),
    0 0 36px var(--space),
    0 1px 2px rgba(0, 0, 0, 0.8);
}
.hero-copy .eyebrow {
  text-shadow: 0 0 16px var(--space);
}
.hero-end .big,
.hero-end p {
  text-shadow:
    0 0 30px var(--space),
    0 0 60px var(--space);
}

@media (max-width: 860px) {
  .explode {
    height: 780vh;
  }
  .ex-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0;
    padding-top: 84px;
  }
  .ex-col {
    gap: 14px;
    justify-items: center;
    text-align: center;
  }
  .ex-text {
    min-height: 190px;
    width: 100%;
  }
  .ex-step {
    justify-items: center;
    gap: 10px;
  }
  .ex-step h3 {
    font-size: 28px;
  }
  .ex-step p {
    font-size: 15px;
  }
  .flow {
    justify-content: center;
    font-size: 9px;
  }
  .flow li + li::before {
    width: 8px;
    margin: 0 3px;
  }
  .flow li span {
    padding: 4px 6px;
  }
  .ex-rig {
    --lw: 130px;
    translate: -30% 0;
  }
  .callouts {
    display: none;
  }
  .hero-copy {
    padding-bottom: 12vh;
  }
}

/* ---------- hero phone with the real splash screen ---------- */
.hero {
  height: 340vh;
}
.hero-phone {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
  will-change: transform;
  opacity: 0;
}
#heroPhone > .d-front {
  background: none;
  box-shadow: none;
}
#heroPhone > .d-front::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(145deg, #2c2623, #0b0a0a 45%, #1a1a1f);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--ink) 14%, transparent);
  opacity: var(--shell, 1);
}
#heroPhone > .d-slab {
  opacity: var(--shell, 1);
}
#heroPhone .d-screen {
  background: color-mix(
    in oklch,
    #050506 calc(var(--shell, 1) * 100%),
    transparent
  );
}
/* the white splash spreads out from the logo like light */
.splash-bg {
  position: absolute;
  inset: 0;
  background: #fff;
  clip-path: circle(var(--wr, 150%) at 28.8% 50%);
}
.splash-logo {
  position: absolute;
  left: 21.8%;
  top: 50%;
  width: 56.4%;
  aspect-ratio: 4.03;
  translate: 0 -50%;
}
.splash-mark {
  position: absolute;
  left: 0;
  top: 0;
  width: 24.78%;
  height: 100%;
  opacity: var(--mark-o, 1);
}
.splash-mark::before {
  opacity: var(--gl, 0);
}
.splash-word {
  position: absolute;
  left: 32.53%;
  top: 22.8%;
  width: 67.47%;
  height: 54.55%;
  opacity: var(--word, 1);
}
.m-ball,
.m-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.m-ball {
  -webkit-mask-image: radial-gradient(
    circle closest-side,
    #000 68%,
    transparent 68.5%
  );
  mask-image: radial-gradient(circle closest-side, #000 68%, transparent 68.5%);
}
.m-ring {
  -webkit-mask-image: radial-gradient(
    circle closest-side,
    transparent 68%,
    #000 68.5%
  );
  mask-image: radial-gradient(circle closest-side, transparent 68%, #000 68.5%);
  transform: scale(var(--ring-s, 1));
  opacity: var(--ring-o, 1);
}
.sunball {
  position: absolute;
  left: 0;
  top: 0;
  width: 100px;
  height: 100px;
  margin: -50px 0 0 -50px;
  opacity: 0;
  will-change: transform, opacity;
}
/* glow lives on its own layer: a filter on a masked image gets masked away */
.sunball::before,
.splash-mark::before {
  content: "";
  position: absolute;
  inset: -80%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    closest-side,
    color-mix(in oklch, var(--core) 75%, transparent),
    color-mix(in oklch, var(--copper) 45%, transparent) 32%,
    color-mix(in oklch, var(--ember) 18%, transparent) 58%,
    transparent 74%
  );
  filter: saturate(var(--glow-sat)) hue-rotate(var(--glow-hue));
}
/* ---------- stylised Cockpit screens ----------
   Colours, radii and type sizes are Cockpit tokens (docs/design-systems/cockpit/guidelines/tokens.md).
   Everything is sized in u = 1/390 of the screen width, so a screen looks the same at any phone size. */
.app,
.app-frag {
  --u: calc(100cqw / 390);
  --c-tint: #f9a13e;
  --c-tint-2: #f1631e;
  --c-bub-bg: #feefd2;
  --c-bub: #f7750d;
  --c-black: #1e293b;
  --c-dark: #475569;
  --c-mid: #64748b;
  --c-med: #94a3b8;
  --c-line: #e2e8f0;
  --c-page: #f1f5f9;
  --c-blue: #1c7ed6;
  --c-green: #22c55e;
  --c-red: #e32929;
  --c-amber: #fbbf24;
}
.app > *,
.app-frag > * {
  font-family: var(--f-app);
  color: var(--c-dark);
  font-size: calc(14 * var(--u));
  line-height: 1.43;
  text-align: left;
}
.app {
  position: absolute;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.app svg,
.app-frag svg,
.tile svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.app b,
.app-frag b {
  font-weight: 600;
}

.sbar {
  flex: none;
  height: calc(50 * var(--u));
  padding: calc(8 * var(--u)) calc(28 * var(--u)) 0 calc(36 * var(--u));
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: calc(15 * var(--u)) !important;
}
.sbar,
.sbar b {
  color: var(--c-black);
}
.sbar.on-dim,
.sbar.on-dim b {
  color: #fff;
}
.sb-ic {
  display: flex;
  align-items: flex-end;
  gap: calc(2 * var(--u));
}
.sb-ic i {
  width: calc(3.5 * var(--u));
  height: calc(5 * var(--u));
  border-radius: 1px;
  background: currentColor;
}
.sb-ic i:nth-child(2) {
  height: calc(7.5 * var(--u));
}
.sb-ic i:nth-child(3) {
  height: calc(10 * var(--u));
}
.sb-ic em {
  position: relative;
  width: calc(23 * var(--u));
  height: calc(11 * var(--u));
  margin-left: calc(6 * var(--u));
  border: 1.5px solid currentColor;
  border-radius: calc(3.5 * var(--u));
  opacity: 0.9;
}
.sb-ic em::after {
  content: "";
  position: absolute;
  inset: 1.5px;
  right: 30%;
  border-radius: 1.5px;
  background: currentColor;
}

.nav-row {
  flex: none;
  display: flex;
  align-items: center;
  gap: calc(2 * var(--u));
  padding: calc(4 * var(--u)) calc(14 * var(--u)) calc(10 * var(--u))
    calc(8 * var(--u));
  font-size: calc(17 * var(--u)) !important;
  font-weight: 500;
  color: var(--c-tint) !important;
}
.nav-row svg {
  font-size: calc(24 * var(--u));
}
.nav-row em {
  margin-left: auto;
  font-style: normal;
  font-size: calc(13 * var(--u));
  color: var(--c-mid);
}
.bub {
  display: inline-grid;
  place-items: center;
  min-width: calc(28 * var(--u));
  height: calc(28 * var(--u));
  padding: 0 calc(6 * var(--u));
  border-radius: 999px;
  background: var(--c-bub-bg);
  color: var(--c-bub);
  font-weight: 700;
  font-size: calc(14 * var(--u));
  flex: none;
}

/* stop header */
.st-head {
  flex: none;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: calc(2 * var(--u));
  padding: 0 calc(16 * var(--u)) calc(16 * var(--u));
  text-align: center !important;
}
.st-head > * {
  text-align: center;
}
.st-time {
  margin-top: calc(8 * var(--u));
  font-size: calc(16 * var(--u));
  line-height: calc(22 * var(--u));
  color: var(--c-black);
}
.st-name {
  font-size: calc(15 * var(--u));
  font-weight: 600;
  color: var(--c-black);
}
.st-addr {
  font-size: calc(15 * var(--u));
  line-height: calc(21 * var(--u));
}
.st-meta {
  font-size: calc(13 * var(--u));
  color: var(--c-mid);
}
.st-acts {
  display: flex;
  justify-content: center;
  gap: calc(20 * var(--u));
  margin-top: calc(14 * var(--u));
}
.ra {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(6 * var(--u));
  font-size: calc(12 * var(--u));
  font-weight: 500;
}
.ra i {
  position: relative;
  width: calc(46 * var(--u));
  height: calc(46 * var(--u));
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: calc(20 * var(--u));
}
.ra.r-nav i,
.ra.r-map i {
  background: #e3effa;
  color: var(--c-blue);
}
.ra.r-call i {
  background: #def7e7;
  color: var(--c-green);
}
.ra.r-copy i {
  background: var(--c-page);
  color: var(--c-mid);
}
.ra i em {
  position: absolute;
  top: calc(-4 * var(--u));
  right: calc(-6 * var(--u));
  min-width: calc(19 * var(--u));
  height: calc(19 * var(--u));
  border-radius: 999px;
  border: 2px solid #fff;
  background: #ff3b30;
  color: #fff;
  font: 700 calc(11 * var(--u)) / calc(15 * var(--u)) var(--f-app);
  font-style: normal;
  text-align: center;
}

/* grey page with white card groups */
.st-body {
  flex: 1;
  min-height: 0;
  display: flex !important;
  flex-direction: column;
  padding: 0 calc(16 * var(--u)) calc(12 * var(--u));
  background: var(--c-page);
  overflow: hidden;
}
.sec-t {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: calc(8 * var(--u));
  padding: calc(14 * var(--u)) calc(4 * var(--u)) calc(8 * var(--u));
  font-size: calc(13 * var(--u));
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--c-mid);
}
.sec-t em {
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
.cg {
  background: #fff;
  border-radius: calc(12 * var(--u));
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(71, 85, 105, 0.08);
}
.lrow,
.prow,
.rrow,
.srow,
.vrow {
  display: flex;
  align-items: flex-start;
  gap: calc(12 * var(--u));
  padding: calc(12 * var(--u)) calc(14 * var(--u));
  border-top: 1px solid var(--c-line);
  transition: background 0.4s;
}
.cg > :first-child {
  border-top: 0;
}
.lrow > div,
.prow > div,
.rrow > div,
.srow > div,
.vrow > div {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.lrow b,
.prow b,
.rrow b,
.srow b,
.vrow b {
  font-size: calc(15 * var(--u));
  line-height: calc(20 * var(--u));
  font-weight: 500;
  color: var(--c-black);
}
.lrow > div > span,
.prow > div > span,
.rrow > div > span,
.srow > div > span,
.vrow > div > span {
  font-size: calc(13 * var(--u));
  line-height: calc(18 * var(--u));
  color: var(--c-dark);
}
.lrow .ref {
  color: var(--c-mid);
}
.rem {
  margin-top: calc(4 * var(--u));
  padding-left: calc(8 * var(--u));
  border-left: calc(3 * var(--u)) solid var(--c-amber);
  color: var(--c-black) !important;
}
.app .ic,
.app-frag .ic {
  width: calc(34 * var(--u));
  height: calc(34 * var(--u));
  border-radius: calc(8 * var(--u));
  display: grid;
  place-items: center;
  background: var(--c-page);
  color: var(--c-dark);
  font-size: calc(17 * var(--u));
  flex: none;
}
.sig {
  align-self: center;
  display: grid;
  place-items: center;
  width: calc(22 * var(--u));
  height: calc(22 * var(--u));
  border-radius: 999px;
  background: var(--c-page);
  color: var(--c-mid);
  font-size: calc(12 * var(--u));
  transition:
    background 0.3s,
    color 0.3s;
}
.lrow.on .sig {
  background: #dcfce7;
  color: #15803d;
}
.badge {
  align-self: center;
  padding: calc(2 * var(--u)) calc(7 * var(--u));
  border-radius: calc(4 * var(--u));
  background: var(--c-page);
  color: #334155;
  font-size: calc(12 * var(--u));
  font-weight: 500;
}
.app .ok,
.app-frag .ok {
  align-self: center;
  width: calc(24 * var(--u));
  height: calc(24 * var(--u));
  border-radius: 50%;
  display: none;
  place-items: center;
  background: var(--c-green);
  color: #fff;
  font-size: calc(14 * var(--u));
}
.app .ok svg,
.app-frag .ok svg {
  stroke-width: 3;
}
.prow.done .ok {
  display: grid;
}
.prow.done .badge {
  display: none;
}
.prow.done > div > span {
  color: var(--c-mid);
}
.st-bar {
  flex: none;
  padding: calc(10 * var(--u)) calc(16 * var(--u)) calc(30 * var(--u));
  background: #fff;
  border-top: 1px solid var(--c-line);
}
.app .btn-p,
.app-frag .btn-p {
  display: grid;
  place-items: center;
  height: calc(48 * var(--u));
  border-radius: calc(8 * var(--u));
  background: linear-gradient(90deg, var(--c-tint), var(--c-tint-2));
  color: #fff;
  font-weight: 600;
  font-size: calc(16 * var(--u));
  transition:
    transform 0.2s,
    filter 0.2s,
    box-shadow 0.4s;
}
.app .btn-o {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(6 * var(--u));
  height: calc(48 * var(--u));
  border: 1px solid var(--c-line);
  border-radius: calc(8 * var(--u));
  background: #fff;
  color: var(--c-black);
  font-weight: 600;
  font-size: calc(15 * var(--u));
}
.app .btn-o svg {
  color: var(--c-blue);
}
.app .btn-p.glow {
  box-shadow: 0 0 0 calc(4 * var(--u))
    color-mix(in srgb, var(--c-tint) 30%, transparent);
}
.app .btn-p.press {
  transform: scale(0.96);
  filter: brightness(0.92);
}

/* map: the tour map sheet; the map itself is the lift layer above the screen */
.map-phone {
  --w: 290px;
}
.app-map {
  background: #3b4658;
}
.app-map .sheet {
  flex: 1;
  min-height: 0;
  display: flex !important;
  flex-direction: column;
  margin-top: calc(4 * var(--u));
  border-radius: calc(20 * var(--u)) calc(20 * var(--u)) 0 0;
  background: #fff;
  overflow: hidden;
}
.sh-head {
  position: relative;
  display: grid !important;
  place-items: center;
  padding: calc(16 * var(--u)) 0 calc(12 * var(--u));
  font-size: calc(17 * var(--u)) !important;
  color: var(--c-black) !important;
}
.grab {
  position: absolute;
  top: calc(6 * var(--u));
  left: 50%;
  width: calc(36 * var(--u));
  height: calc(5 * var(--u));
  margin-left: calc(-18 * var(--u));
  border-radius: 9px;
  background: var(--c-line);
}
.sh-x {
  position: absolute;
  right: calc(14 * var(--u));
  top: calc(13 * var(--u));
  width: calc(30 * var(--u));
  height: calc(30 * var(--u));
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--c-page);
  color: var(--c-dark);
  font-size: calc(16 * var(--u));
}
.map-hole {
  flex: 1;
  min-height: 0;
  background: #d9ded4;
}
.m-card {
  flex: none;
  margin: calc(12 * var(--u)) calc(16 * var(--u)) 0;
  padding: calc(14 * var(--u));
  border: 1px solid var(--c-line);
  border-radius: calc(12 * var(--u));
  display: flex !important;
  flex-direction: column;
  gap: calc(2 * var(--u));
  box-shadow: 0 calc(6 * var(--u)) calc(18 * var(--u)) rgba(15, 23, 42, 0.1);
}
.mc-top {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  font-size: calc(13 * var(--u));
  color: var(--c-mid);
}
.mc-kind {
  font-weight: 600;
  color: var(--c-dark);
}
.mc-km {
  margin-left: auto;
}
.mc-name {
  margin-top: calc(6 * var(--u));
  font-size: calc(16 * var(--u));
  color: var(--c-black);
}
.mc-addr {
  font-size: calc(14 * var(--u));
}
.mc-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(8 * var(--u));
  margin-top: calc(12 * var(--u));
}
.app .mc-btns > * {
  height: calc(42 * var(--u));
  font-size: calc(15 * var(--u));
}
.map-foot {
  flex: none;
  padding: calc(12 * var(--u)) calc(16 * var(--u)) calc(30 * var(--u));
  text-align: center !important;
  font-size: calc(13 * var(--u)) !important;
  color: var(--c-mid) !important;
}
.map-lift,
.stop-lift {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 50% 50%;
  will-change: transform;
}
.map-lift {
  overflow: hidden;
  box-shadow:
    0 calc(var(--lift, 0) * 40px) calc(var(--lift, 0) * 70px)
      calc(var(--lift, 0) * -10px) rgba(0, 0, 0, 0.75),
    0 0 calc(var(--lift, 0) * 60px)
      color-mix(in oklch, var(--copper) calc(var(--lift, 0) * 40%), transparent);
  border-radius: calc(var(--lift, 0) * 14px);
}
.tmap {
  display: block;
  width: 100%;
  height: 100%;
}
.tm-route-case,
.tm-route,
.tm-driven {
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.tm-route-case {
  stroke: #fff;
  stroke-width: 8.5;
}
.tm-route {
  stroke: #f9a13e;
  stroke-width: 4.5;
}
.tm-driven {
  stroke: #94a3b8;
  stroke-width: 4.5;
}
.mk {
  filter: drop-shadow(0 1px 1.5px rgba(15, 23, 42, 0.35));
  transition: opacity 0.3s;
}
.mk circle,
.mk rect {
  fill: #fff;
  stroke: #f9a13e;
  stroke-width: 2.5;
}
.mk text {
  fill: #f7750d;
}
.mk.done circle,
.mk.done rect {
  fill: #94a3b8;
  stroke: #fff;
}
.mk.done text,
.mk.next text {
  fill: #fff;
}
.mk.next circle {
  fill: #f9a13e;
  stroke: #fff;
}

/* stop screen: the proof list lifts out of the page */
.stop-phone,
.req-phone {
  --w: 290px;
}
.proof-hole {
  flex: none;
}
.stop-lift {
  container-type: inline-size;
}
.stop-lift .app-frag {
  padding: 0 calc(16 * var(--u)) calc(12 * var(--u));
  background: var(--c-page);
  border-radius: calc(var(--lift, 0) * 18px);
  box-shadow:
    0 calc(var(--lift, 0) * 40px) calc(var(--lift, 0) * 70px)
      calc(var(--lift, 0) * -12px) rgba(0, 0, 0, 0.7),
    0 0 calc(var(--lift, 0) * 60px)
      color-mix(in oklch, var(--copper) calc(var(--lift, 0) * 35%), transparent);
}
.stop-lift .ctr {
  font-variant-numeric: tabular-nums;
}
.prow.pop .ok {
  animation: pop 0.45s var(--ease);
}
@keyframes pop {
  from {
    transform: scale(0.3);
  }
  60% {
    transform: scale(1.2);
  }
}

/* requirements + vehicle pick */
.rq-head {
  flex: none;
  display: flex !important;
  flex-direction: column;
  gap: calc(2 * var(--u));
  padding: 0 calc(16 * var(--u)) calc(14 * var(--u));
}
.rq-id {
  font-size: calc(13 * var(--u));
  font-weight: 600;
  color: var(--c-mid);
}
.rq-lead {
  font-size: calc(20 * var(--u));
  line-height: calc(26 * var(--u));
  font-weight: 700 !important;
  color: var(--c-tint);
}
.rq-meta {
  font-size: calc(14 * var(--u));
}
.rq-note {
  margin-top: calc(8 * var(--u));
  padding: calc(8 * var(--u)) calc(10 * var(--u));
  border-left: calc(3 * var(--u)) solid var(--c-tint);
  border-radius: calc(8 * var(--u));
  background: #fff7ed;
  color: var(--c-black);
  font-size: calc(13 * var(--u));
}
.pill {
  padding: 0 calc(8 * var(--u));
  border-radius: 999px;
  background: var(--c-page);
  color: var(--c-dark) !important;
  font-weight: 600 !important;
  transition: opacity 0.3s;
}
.fixed .pill {
  opacity: 0;
}
.kv em {
  margin-right: calc(6 * var(--u));
  font-style: normal;
  color: var(--c-mid);
}
.app .warn {
  margin-top: calc(4 * var(--u));
  color: var(--c-red);
  font-weight: 500;
}
.app .pk {
  padding-left: calc(8 * var(--u));
  border-left: 2px solid #fde3e3;
}
.fixed .warn,
.fixed .pk {
  display: none;
}
.rrow.veh.flash {
  background: #fff1f1;
}
.fixed .rrow.veh.flash {
  background: #effbf3;
}
.rrow .st {
  align-self: center;
  width: calc(24 * var(--u));
  height: calc(24 * var(--u));
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--c-red);
  color: #fff;
  font-size: calc(14 * var(--u));
  flex: none;
}
.rrow .st svg {
  stroke-width: 2.6;
}
.rrow .st .s-ok,
.rrow .st.ok .s-bad,
.fixed .veh .st .s-bad {
  display: none;
}
.rrow .st.ok,
.fixed .veh .st {
  background: var(--c-green);
}
.rrow .st.ok .s-ok,
.fixed .veh .st .s-ok {
  display: block;
}
.srow {
  align-items: center;
}
.app-req .btn-p {
  filter: saturate(0.35) brightness(1.08);
}
.app-req.fixed .btn-p {
  filter: none;
}
.dimmer {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: var(--sheet, 0);
  pointer-events: none;
}
.vsheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: calc(24 * var(--u)) calc(16 * var(--u)) calc(34 * var(--u));
  border-radius: calc(20 * var(--u)) calc(20 * var(--u)) 0 0;
  background: #fff;
  transform: translateY(calc((1 - var(--sheet, 0)) * 105%));
}
.vs-t {
  display: block;
  margin-bottom: calc(10 * var(--u));
  text-align: center;
  font-size: calc(17 * var(--u));
  color: var(--c-black);
}
.vrow {
  align-items: center;
  border-radius: calc(12 * var(--u));
  border-top: 0;
}
.vrow .radio {
  width: calc(22 * var(--u));
  height: calc(22 * var(--u));
  border-radius: 50%;
  border: 2px solid var(--c-line);
  transition: border 0.25s;
  flex: none;
}
.vrow.sel {
  background: #fff7ed;
}
.vrow.sel .radio {
  border: calc(7 * var(--u)) solid var(--c-tint);
}

/* the cargo space in 3D: the van it does not fit, then the truck it does */
.req-vis {
  perspective: none;
}
.req-phone {
  translate: -44% 0;
}
.cargo {
  position: absolute;
  right: -9%;
  top: 50%;
  width: 46%;
  aspect-ratio: 1.05;
  translate: 0 -58%;
  perspective: 1400px;
  pointer-events: none;
  z-index: 2;
}
.cg-floor {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 62%;
  height: 22%;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    color-mix(in oklch, var(--copper) 26%, transparent),
    transparent
  );
  filter: blur(6px);
}
.cg-rig {
  position: absolute;
  left: 50%;
  top: 52%;
  transform-style: preserve-3d;
}
.cub {
  position: absolute;
  left: 0;
  top: 0;
  transform-style: preserve-3d;
}
.cub > i {
  position: absolute;
  left: 0;
  top: 0;
}
.cub > i:nth-child(-n + 2) {
  width: var(--w);
  height: var(--h);
  margin: calc(var(--h) / -2) 0 0 calc(var(--w) / -2);
}
.cub > i:nth-child(3),
.cub > i:nth-child(4) {
  width: var(--d);
  height: var(--h);
  margin: calc(var(--h) / -2) 0 0 calc(var(--d) / -2);
}
.cub > i:nth-child(5),
.cub > i:nth-child(6) {
  width: var(--w);
  height: var(--d);
  margin: calc(var(--d) / -2) 0 0 calc(var(--w) / -2);
}
.cub > i:nth-child(1) {
  transform: translateZ(calc(var(--d) / 2));
}
.cub > i:nth-child(2) {
  transform: rotateY(180deg) translateZ(calc(var(--d) / 2));
}
.cub > i:nth-child(3) {
  transform: rotateY(90deg) translateZ(calc(var(--w) / 2));
}
.cub > i:nth-child(4) {
  transform: rotateY(-90deg) translateZ(calc(var(--w) / 2));
}
.cub > i:nth-child(5) {
  transform: rotateX(90deg) translateZ(calc(var(--h) / 2));
}
.cub > i:nth-child(6) {
  transform: rotateX(-90deg) translateZ(calc(var(--h) / 2));
}
.cub.space > i {
  background: color-mix(in oklch, var(--atmo) 7%, transparent);
  border: 1.5px solid color-mix(in oklch, var(--atmo) 70%, transparent);
  transition:
    border-color 0.4s,
    background 0.4s;
}
.cub.space > i:nth-child(5) {
  background: color-mix(in oklch, var(--atmo) 3%, transparent);
}
.cub.space.tight > i:nth-child(5) {
  border-color: #f87171;
  background: color-mix(in oklch, #f87171 16%, transparent);
}
.cub.pkg > i {
  border: 1px solid rgba(0, 0, 0, 0.25);
  transition: background 0.4s;
}
.cub.pkg > i:nth-child(1) {
  background: #c9895a;
}
.cub.pkg > i:nth-child(2),
.cub.pkg > i:nth-child(4) {
  background: #8f5b38;
}
.cub.pkg > i:nth-child(3) {
  background: #a96c43;
}
.cub.pkg > i:nth-child(5) {
  background: #e8b083;
}
.cub.pkg > i:nth-child(6) {
  background: #5d3b25;
}
.cub.pkg.bad > i:nth-child(1) {
  background: #e05252;
}
.cub.pkg.bad > i:nth-child(3) {
  background: #b83d3d;
}
.cub.pkg.bad > i:nth-child(5) {
  background: #f48a8a;
  box-shadow: 0 0 30px #f87171;
}
.cub.pkg.bad > i:nth-child(2),
.cub.pkg.bad > i:nth-child(4) {
  background: #8f2f2f;
}
.cg-chip {
  position: absolute;
  left: 50%;
  bottom: 2%;
  translate: -50% 0;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in oklch, var(--space) 70%, transparent);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}
.cg-chip b {
  color: var(--ink);
  font-weight: 500;
}
.cg-chip::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #f87171;
  vertical-align: 1px;
  transition: background 0.3s;
}
.cg-chip.ok::before {
  background: var(--ok);
}

/* location status card */
.loc-card {
  position: absolute;
  right: 0;
  top: 50%;
  translate: 0 -50%;
  width: min(300px, 62%);
  container-type: inline-size;
  border-radius: 22px;
  background: #fff;
  overflow: hidden;
  box-shadow:
    0 30px 60px -20px #000,
    0 0 0 1px rgba(255, 255, 255, 0.2);
}
.loc-card .app-frag {
  --u: calc(100cqw / 330);
}
.lc-map {
  position: relative;
  height: calc(118 * var(--u));
}
.lc-map svg {
  stroke: none;
  display: block;
  width: 100%;
  height: 100%;
}
.lc-pin {
  position: absolute;
  left: 50%;
  top: 54%;
  width: calc(16 * var(--u));
  height: calc(16 * var(--u));
  margin: calc(-8 * var(--u)) 0 0 calc(-8 * var(--u));
  border-radius: 50%;
  border: calc(3 * var(--u)) solid #fff;
  background: var(--c-blue);
  box-shadow: 0 0 0 calc(12 * var(--u)) rgba(28, 126, 214, 0.18);
}
.lc-frost {
  position: absolute;
  inset: 0;
  display: grid !important;
  place-items: center;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--c-black) !important;
  font-weight: 600;
  text-align: center !important;
  opacity: 0;
  transition: opacity 0.4s;
}
[data-state="pause"] .lc-frost,
[data-state="idle"] .lc-frost {
  opacity: 1;
}
[data-state="idle"] .lc-frost {
  color: transparent !important;
}
.lc-status {
  display: flex !important;
  align-items: flex-start;
  gap: calc(12 * var(--u));
  padding: calc(16 * var(--u)) calc(18 * var(--u)) 0;
}
.lc-dot {
  flex: none;
  width: calc(12 * var(--u));
  height: calc(12 * var(--u));
  margin-top: calc(5 * var(--u));
  border-radius: 50%;
  background: var(--c-green);
  animation: lcpulse 1.8s ease-out infinite;
}
@keyframes lcpulse {
  from {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
  }
  to {
    box-shadow: 0 0 0 calc(10 * var(--u)) rgba(34, 197, 94, 0);
  }
}
[data-state="pause"] .lc-dot {
  background: var(--c-amber);
  animation: none;
}
[data-state="idle"] .lc-dot {
  background: var(--c-med);
  animation: none;
}
.lc-title {
  display: block;
  font-size: calc(17 * var(--u));
  line-height: calc(22 * var(--u));
  color: var(--c-black);
}
.lc-since {
  font-size: calc(13 * var(--u));
  color: var(--c-mid);
}
[data-state="pause"] .lc-since,
[data-state="idle"] .lc-since {
  display: none;
}
.lc-body {
  margin: 0;
  padding: calc(8 * var(--u)) calc(18 * var(--u)) 0;
  font-size: calc(14 * var(--u));
  line-height: calc(20 * var(--u));
  min-height: calc(60 * var(--u));
}
.lc-tour {
  display: flex !important;
  gap: calc(8 * var(--u));
  margin: calc(12 * var(--u)) calc(18 * var(--u)) 0;
  padding: calc(10 * var(--u)) calc(12 * var(--u));
  border-radius: calc(12 * var(--u));
  background: var(--c-page);
  font-size: calc(13 * var(--u)) !important;
}
.lc-tour b {
  color: var(--c-black);
}
.lc-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  height: calc(44 * var(--u));
  margin: calc(14 * var(--u)) calc(18 * var(--u)) calc(18 * var(--u));
  border: 1px solid var(--c-line);
  border-radius: calc(8 * var(--u));
  color: var(--c-black) !important;
  font-weight: 600;
  font-size: calc(15 * var(--u)) !important;
}
[data-state="idle"] .lc-tour,
[data-state="idle"] .lc-btn {
  visibility: hidden;
}
#standort .terrain-wrap {
  translate: -20% 0;
}
.loc-card {
  right: -3%;
}

/* ---------- smaller things ---------- */
.tiles-sec {
  padding-block: 18vh 12vh;
}
.tiles-head {
  max-width: 1240px;
  margin: 0 auto 48px;
  display: grid;
  gap: 14px;
}
.tiles-head h2 {
  font-family: var(--f-display);
  font-weight: 200;
  font-size: clamp(36px, 4.8vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  max-width: 18ch;
}
.tiles {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.tile {
  grid-column: span 1;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(165deg, #17120f, #0b0a0c 70%);
  opacity: 0;
  translate: 0 40px;
  transition:
    opacity 0.9s var(--ease),
    translate 0.9s var(--ease);
}
.tile.in {
  opacity: 1;
  translate: 0 0;
}
.tile.wide {
  grid-column: span 2;
}
.t-vis {
  position: relative;
  height: 210px;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(
    70% 80% at 50% 110%,
    color-mix(in oklch, var(--copper) 20%, transparent),
    transparent 70%
  );
  font-family: var(--f-app);
  color: #1e293b;
}
.tile.wide .t-vis {
  height: 250px;
}
.t-copy {
  display: grid;
  gap: 8px;
  padding: 22px 26px 28px;
}
.t-copy h3 {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(22px, 1.9vw, 28px);
  line-height: 1.12;
}
.t-copy p {
  color: var(--ink-2);
  font-size: 16px;
}
.tile .btn-p,
.tile .btn-o {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}
.tile .btn-p {
  background: linear-gradient(90deg, #f9a13e, #f1631e);
  color: #fff;
}
.tile .btn-o {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #1e293b;
}
.tile .btn-o svg {
  color: #1c7ed6;
}
.mini-dialog,
.mini-otp,
.mini-lang,
.mini-rem,
.mini-retry {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 50px -16px #000;
}
.mini-dialog {
  width: min(300px, 100%);
  padding: 18px;
  display: grid;
  gap: 8px;
  text-align: center;
}
.mini-dialog b {
  font-size: 17px;
}
.mini-dialog p {
  font-size: 13px;
  line-height: 1.45;
  color: #475569;
  margin-bottom: 6px;
}
.mini-otp {
  padding: 18px 20px;
  display: grid;
  gap: 10px;
}
.otp-lbl,
.otp-hint {
  font-size: 12px;
  color: #64748b;
}
.otp {
  display: flex;
  gap: 8px;
}
.otp i {
  display: grid;
  place-items: center;
  width: 36px;
  height: 46px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-style: normal;
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
}
.otp .cur {
  border-color: #f9a13e;
  box-shadow: 0 0 0 3px #feefd2;
}
.otp .cur::after {
  content: "";
  width: 2px;
  height: 22px;
  background: #f9a13e;
  animation: blink 1s steps(1) infinite;
}
.mini-pdf {
  width: 136px;
  height: 160px;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 6px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 24px 50px -16px #000;
  rotate: -4deg;
  font-size: 12px;
  color: #64748b;
  background:
    linear-gradient(#fff 0 78px, transparent 78px),
    repeating-linear-gradient(#fff 0 16px, #eef2f6 16px 18px);
}
.mini-pdf svg {
  width: 26px;
  height: 26px;
  color: #e32929;
}
.mini-pdf b {
  font-size: 13px;
  color: #1e293b;
}
.mini-lang {
  width: min(220px, 100%);
  overflow: hidden;
}
.mini-lang span {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 15px;
  border-top: 1px solid #e2e8f0;
}
.mini-lang span:first-child {
  border-top: 0;
}
.mini-lang .on {
  font-weight: 600;
  background: #fff7ed;
}
.mini-lang .on::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 5px solid #f9a13e;
}
.mini-rem {
  width: min(240px, 100%);
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}
.mini-rem b {
  font-size: 15px;
  font-weight: 500;
}
.mini-rem .rem {
  font-size: 13px;
  margin: 0;
}
.mini-retry {
  width: min(250px, 100%);
  padding: 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 12px;
  align-items: center;
}
.mini-retry .ph {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f1f5f9;
  color: #94a3b8;
  font-size: 20px;
}
.mini-retry .ph svg {
  width: 20px;
  height: 20px;
}
.mini-retry b {
  display: block;
  font-size: 15px;
  font-weight: 500;
}
.mini-retry div span {
  font-size: 13px;
  color: #e32929;
}
.mini-retry .btn-o {
  grid-column: 1 / -1;
}

/* ---------- finale: last stop, confetti ---------- */
.finale {
  position: relative;
  height: 230vh;
}
#confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}
.fin-grid {
  position: relative;
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 6vw, 96px);
  align-items: center;
  perspective: 1600px;
}
.fin-phone {
  --w: 270px;
  justify-self: end;
}
.fin-copy {
  display: grid;
  gap: 20px;
}
.fin-copy h2 {
  font-family: var(--f-display);
  font-weight: 200;
  font-size: clamp(56px, 8vw, 128px);
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.fin-copy p {
  max-width: 30ch;
  color: var(--ink-2);
  font-size: clamp(17px, 1.4vw, 20px);
}
.toast {
  position: absolute;
  left: calc(16 * var(--u));
  right: calc(16 * var(--u));
  top: calc(54 * var(--u));
  display: flex !important;
  align-items: center;
  gap: calc(10 * var(--u));
  padding: calc(14 * var(--u));
  border-radius: calc(12 * var(--u));
  background: #fff;
  color: var(--c-black) !important;
  font-weight: 600;
  font-size: calc(15 * var(--u)) !important;
  box-shadow: 0 calc(10 * var(--u)) calc(30 * var(--u)) rgba(15, 23, 42, 0.28);
  transform: translateY(-160%);
  transition: transform 0.6s var(--ease);
}
.toast.on {
  transform: none;
}
.app .toast .ok {
  display: grid;
}

@media (max-width: 1000px) {
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 860px) {
  .map-phone,
  .stop-phone,
  .req-phone {
    --w: 190px;
  }
  .req-phone {
    --w: 170px;
    translate: -30% 16%;
  }
  .cargo {
    right: -6%;
    top: 4%;
    width: 62%;
    translate: 0 0;
  }
  .cg-chip {
    font-size: 9px;
    padding: 6px 10px;
  }
  .loc-card {
    width: min(250px, 74%);
    top: 4%;
    translate: 0 0;
  }
  #standort .terrain-wrap {
    translate: -14% 18%;
  }
  .fin-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-content: center;
    gap: 28px;
    padding-top: 84px;
    text-align: center;
  }
  .fin-copy {
    order: -1;
    justify-items: center;
    gap: 12px;
  }
  .fin-phone {
    --w: 190px;
    justify-self: center;
  }
}
@media (max-width: 600px) {
  .tiles {
    grid-template-columns: minmax(0, 1fr);
  }
  .tile.wide {
    grid-column: span 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tile {
    opacity: 1;
    translate: none;
    transition: none;
  }
}

.m-card.swap {
  animation: cardIn 0.5s var(--ease);
}
@keyframes cardIn {
  from {
    transform: translateX(28%);
    opacity: 0;
  }
}

/* exploded view: the screen keeps its own rounded corners; the baked-in sync bar is covered while online */
.l-ui .d-screen {
  border-radius: calc(var(--lw) * 0.1);
}
.app-bar.gone {
  transform: none;
  background: #fff;
}
.app-bar.gone > * {
  opacity: 0;
}
.hint-cover {
  position: absolute;
  left: 0;
  right: 0;
  top: 72.4%;
  height: 5.6%;
  background: #fff;
  transition: opacity 0.4s;
}
.hint-cover.off {
  opacity: 0;
}

/* location: the track stays in view, the pause is a gap in it, the rail names the steps */
#standort .terrain-wrap {
  width: min(520px, 80%);
  translate: -24% -8%;
}
.loc-card {
  width: min(250px, 42%);
  right: -8%;
  top: 60%;
}
.paused .terrain .trail {
  stroke: var(--copper);
  filter: drop-shadow(0 0 6px var(--ember));
}
.gps-rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9%;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--ink-3);
}
.gps-rail li {
  position: relative;
  display: grid;
  gap: 6px;
  padding-top: 18px;
  transition: color 0.4s;
}
.gps-rail li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: var(--space);
  z-index: 1;
}
.gps-rail li::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 6px;
  top: 5px;
  height: 1px;
  background: linear-gradient(
    90deg,
    var(--copper) var(--fill, 0%),
    var(--line) var(--fill, 0%)
  );
}
.gps-rail li:last-child::after {
  display: none;
}
.gps-rail b {
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.06em;
}
.gps-rail li.past {
  color: var(--ink-2);
}
.gps-rail li.on {
  color: var(--copper);
}
.gps-rail li.on::before {
  background: var(--copper);
  box-shadow: 0 0 14px var(--copper);
}
.gps-rail li.pause.on {
  color: var(--wait);
}
.gps-rail li.pause.on::before {
  background: var(--wait);
  box-shadow: 0 0 14px var(--wait);
}
@media (max-width: 860px) {
  #standort .terrain-wrap {
    width: 92%;
    translate: -12% 0;
  }
  .loc-card {
    width: min(220px, 58%);
    right: 0;
    top: 2%;
  }
  .gps-rail {
    bottom: 17%;
    font-size: 12px;
  }
  .gps-rail b {
    font-size: 11px;
  }
}
