/* ==========================================================================
   ApexCast motion layer (added 2026-09-30).
   Everything in this file is additive. To roll it back completely, remove the
   <link rel="stylesheet" href="./motion.css"> and <script src="./motion.js">
   tags from the pages; the site falls back to the previous look.
   ========================================================================== */

/* ---------- 1. Start screen background, rebuilt in code ------------------
   The scene is drawn in the original artwork's 1686 x 933 coordinate space and
   scaled by the start screen's HEIGHT (1 unit = 100cqh / 933). It is never
   stretched: wider screens reveal more of the extended scene at the sides,
   narrower screens crop the sides, and the corner labels are live text that
   stays pinned to the corners. Visit /?bg=image to compare with the old PNG. */

.splash .splash-bg.splash-bg--scene {
  background: #000;
  container-type: size;
  overflow: hidden;
}
/* The approved diagonal flow keeps running above the scene at a true 45deg. */
.splash .splash-bg.splash-bg--scene::before { z-index: 2; }
.splash .splash-bg.splash-bg--scene::after { z-index: 3; }

.scene-layer,
.scene-live {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  user-select: none;
}
.scene-layer--back { z-index: 0; }
.scene-layer--car { z-index: 1; }
.scene-layer--front { z-index: 1; }
.scene-live { z-index: 1; }

/* Pre-rendered layers (WebP snapshots of the code scene, generated by
   tools/start-scene/render.mjs). Height-driven and centred on scene x = 843. */
.scene-layer.scene-raster {
  inset: auto;
  top: 0;
  left: 50%;
  translate: -50% 0;
  height: 100%;
  width: auto;
  max-width: none;
}
.splash-bg--scene.is-vector .scene-layer.scene-raster { inset: 0; left: 0; translate: none; width: 100%; }
.splash-bg--scene.is-vector .scene-layer--front,
.splash-bg--scene.is-vector .scene-live { mix-blend-mode: plus-lighter; }

/* The car sits at (40, 430) and is 660 x 450 in scene units. */
.scene-layer.scene-layer--car {
  inset: auto;
  left: calc(50% + (40 - 843) * 100cqh / 933);
  top: calc(430 * 100cqh / 933);
  width: calc(660 * 100cqh / 933);
  height: calc(450 * 100cqh / 933);
  opacity: 0;
  transition: opacity .6s ease;
}
.scene-layer.scene-layer--car.is-loaded { opacity: 1; }

.scene-corners {
  /* One scene unit, capped on tall narrow screens so labels stay label-sized. */
  --u: min(calc(100cqh / 933), calc(100cqw / 1124));
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  color: #e4e8ec;
  font-family: var(--font-body);
  font-weight: 400;
}
.scene-c {
  position: absolute;
  margin: 0;
  font-size: max(12px, calc(12.6 * var(--u)));
  line-height: calc(22.33 * var(--u));
  letter-spacing: calc(2.4 * var(--u));
  text-transform: uppercase;
  white-space: nowrap;
}
.scene-c::after {
  content: '';
  display: block;
  width: calc(41 * var(--u));
  height: calc(2.6 * var(--u));
  margin-top: calc(9.4 * var(--u));
  background: #ee010b;
}
.scene-c--tl,
.scene-c--bl { left: max(16px, min(calc(41.6 * var(--u)), calc(50% - 801.4 * var(--u)))); }
.scene-c--tr,
.scene-c--br {
  right: max(16px, min(calc(46.4 * var(--u)), calc(50% - 796.6 * var(--u))));
  text-align: right;
  margin-right: calc(-2.4 * var(--u));
}
.scene-c--tr::after,
.scene-c--br::after { margin-left: auto; margin-right: calc(2.4 * var(--u)); }
.scene-c--tl { top: calc(51.3 * var(--u)); }
.scene-c--tr { top: calc(56.3 * var(--u)); }
.scene-c--bl,
.scene-c--br { bottom: calc(57.4 * var(--u)); }
.scene-c--tr .scene-plus { position: relative; }
.scene-c--tr .scene-plus::before {
  content: '';
  position: absolute;
  left: calc(-18.5 * var(--u));
  top: 50%;
  width: calc(11 * var(--u));
  height: calc(11 * var(--u));
  transform: translateY(-50%);
  background:
    linear-gradient(#e10202, #e10202) center / 100% calc(1.6 * var(--u)) no-repeat,
    linear-gradient(#e10202, #e10202) center / calc(1.6 * var(--u)) 100% no-repeat;
}

/* The code scene has its own corner labels, so hide the image-era copies. */
.splash:has(.splash-bg--scene) .splash-mobile-corners { display: none; }

@media (max-width: 650px) {
  .scene-c {
    font-size: max(10px, calc(10.2 * var(--u)));
    line-height: max(14px, calc(17.5 * var(--u)));
    letter-spacing: .16em;
  }
  .scene-c::after { width: 26px; height: 2px; margin-top: 7px; }
  .scene-c--tl, .scene-c--tr { top: 18px; }
  .scene-c--bl, .scene-c--br { bottom: 18px; }
  .scene-c--tl, .scene-c--bl { left: 16px; }
  .scene-c--tr, .scene-c--br { right: 16px; margin-right: -.16em; }
  .scene-c--tr::after, .scene-c--br::after { margin-right: .16em; }
  .scene-c--tr .scene-plus::before { left: -14px; width: 8px; height: 8px; }
}

/* Live motion drawn on top of the scene. */
.scene-live .lv-comet {
  opacity: 0;
  animation: lv-comet 3.6s cubic-bezier(.5, 0, .85, .5) var(--d, 0s) infinite;
}
.scene-live .lv-comet--r { animation-duration: 4.4s; }
@keyframes lv-comet {
  0% { transform: translateX(0); opacity: 0; }
  18% { opacity: .9; }
  70% { opacity: .75; }
  100% { transform: translateX(var(--len)); opacity: 0; }
}
.scene-live .lv-beam { animation: lv-beam 6.5s ease-in-out infinite; }
@keyframes lv-beam { from { transform: translateY(0); } to { transform: translateY(470px); } }
.scene-live .lv-horizon { transform-origin: 841px 596px; animation: lv-breathe 4.2s ease-in-out infinite alternate; }
.scene-live .lv-tail { animation: lv-breathe 1.8s ease-in-out infinite alternate; }
.scene-live .lv-tail--b { animation-delay: -.9s; }
@keyframes lv-breathe { from { opacity: .35; } to { opacity: 1; } }
.scene-live .lv-ping { transform-origin: 841px 206px; animation: lv-ping 3.2s ease-out infinite; }
@keyframes lv-ping { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(2.1); opacity: 0; } }
.scene-live .lv-tick { animation: lv-blink 1.1s steps(2, jump-none) infinite; }
@keyframes lv-blink { 50% { opacity: 0; } }

.scene-live.is-offscreen * { animation-play-state: paused; }



/* ---------- 2. Sitewide motion -------------------------------------------
   Only active once motion.js adds .mo-js to <html>, and never for visitors
   who ask for reduced motion. Content is visible without JavaScript. */

/* Scroll progress: a thin rev-light bar under the header. */
.mo-progress {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  width: 100%;
  height: 2px;
  pointer-events: none;
  transform-origin: 0 50%;
  transform: scaleX(var(--mo-progress, 0));
  background: linear-gradient(90deg, #ff4b1f, var(--color-primary) 60%, #ffd2c2);
  box-shadow: 0 0 10px color-mix(in oklab, var(--color-primary) 70%, transparent);
}

/* Broadcast-style headline slam: words wipe up from a clipped baseline. */
.mo-js .mo-words .mo-w,
.mo-js .hero h1.mo-words span,
.mo-js .page-hero h1.mo-words span { color: inherit; }
.mo-js .mo-words .mo-w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: .06em;
  margin-bottom: -.06em;
}
.mo-js .mo-words .mo-w > span {
  display: inline-block;
  transform: translateY(108%) skewY(7deg);
  transform-origin: 0 100%;
  transition: transform .72s cubic-bezier(.2, .9, .15, 1) calc(var(--i, 0) * 55ms);
}
.mo-js .mo-words.is-in .mo-w > span { transform: none; }

/* Kicker dash draws itself in. */
.mo-js .kicker.mo-watch::before {
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .6s cubic-bezier(.2, .9, .15, 1) .1s;
}
.mo-js .kicker.mo-watch.is-in::before { transform: none; }

/* Cards and panels rise into place, staggered within their row. */
.mo-js .mo-rise {
  translate: 0 26px;
  opacity: 0;
  transition: translate .8s cubic-bezier(.2, .9, .15, 1) calc(var(--i, 0) * 80ms),
              opacity .6s ease calc(var(--i, 0) * 80ms);
}
.mo-js .mo-rise.reveal { opacity: 1; } /* existing scroll fade keeps control of opacity */
.mo-js .mo-rise.is-in { translate: 0 0; opacity: 1; }

/* Primary and ghost buttons: a light sweep that always finishes, plus eased
   color changes in both directions (hovering out no longer snaps). */
.mo-js .btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: background-color .35s ease, color .35s ease, border-color .35s ease, box-shadow .35s ease, transform .35s ease;
}
.mo-js .btn::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .34) 48%, transparent 66%);
  transform: translateX(-120%);
}
.mo-js .btn-ghost::after { background: linear-gradient(110deg, transparent 30%, color-mix(in oklab, var(--color-primary) 30%, transparent) 48%, transparent 66%); }
.mo-js .btn.mo-sweep::after { animation: mo-sweep .8s cubic-bezier(.3, .7, .2, 1); }
@keyframes mo-sweep { from { transform: translateX(-120%); } to { transform: translateX(120%); } }

/* Cursor-following glow on cards (desktop pointers only). */
.mo-spot {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in oklab, var(--color-primary) 20%, transparent), transparent 70%);
  z-index: -1;
}
.mo-spot-host { position: relative; isolation: isolate; }
.mo-spot-host:hover > .mo-spot { opacity: 1; }

/* Page change: a red diagonal band sweeps across the arriving page. */
.mo-wipe {
  position: fixed;
  inset: -10vh -40vw;
  z-index: 200;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 0 34%, #ff3b1f 38%, var(--color-primary) 50%, #7a0010 62%, transparent 66%);
  transform: translateX(-10%) skewX(-18deg);
  animation: mo-wipe .62s cubic-bezier(.6, 0, .25, 1) forwards;
}
@keyframes mo-wipe { to { transform: translateX(95%) skewX(-18deg); } }
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: mo-vt-out .38s ease both; }
::view-transition-new(root) { animation: mo-vt-in .5s cubic-bezier(.2, .9, .15, 1) both; }
@keyframes mo-vt-out { to { opacity: 0; transform: translateX(-2%); } }
@keyframes mo-vt-in { from { opacity: 0; transform: translateX(2%); } }



/* ---------- 3. Homepage ---------------------------------------------------- */

/* Race tower: rows slide when positions change; the gap column ticks. */
.race-console .driver-row { transition: background-color .4s ease, border-color .4s ease; }
.race-console .driver-row.mo-flash { animation: mo-row-flash 1.1s ease; }
@keyframes mo-row-flash {
  0%, 100% { box-shadow: none; }
  25% { box-shadow: inset 3px 0 0 var(--color-primary), 0 0 22px color-mix(in oklab, var(--color-primary) 40%, transparent); }
}
.race-console .gap { font-variant-numeric: tabular-nums; }
.commentary-feed .feed-item:first-child { animation: mo-feed-in .55s cubic-bezier(.2, .9, .15, 1); }
@keyframes mo-feed-in { from { opacity: 0; transform: translateX(-14px); clip-path: inset(0 100% 0 0); } to { opacity: 1; transform: none; clip-path: inset(0 0 0 0); } }

/* Voice waveform: the race never goes quiet. */
.mo-wave {
  position: relative;
  margin-top: var(--space-8);
  height: 120px;
  border-block: 1px solid var(--color-border);
  overflow: hidden;
}
.mo-wave-canvas {
  width: 100%;
  height: 100%;
  display: block;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.mo-wave-tag {
  position: absolute;
  left: 0;
  top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.mo-wave-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary); box-shadow: 0 0 10px var(--color-primary); animation: blink 1.6s linear infinite; }

/* Feature card visuals. */
.mo-viz { margin-bottom: var(--space-6); color: var(--color-primary); }
.mo-viz svg { display: block; width: 100%; height: auto; overflow: visible; }
.mo-viz--engine { max-width: 360px; }
.mo-viz--engine .mo-chips rect { fill: color-mix(in oklab, var(--color-text) 16%, transparent); animation: mo-chip 2.4s ease-in-out infinite; }
.mo-viz--engine .mo-chips rect:nth-child(2) { animation-delay: .4s; }
.mo-viz--engine .mo-chips rect:nth-child(3) { animation-delay: .8s; }
@keyframes mo-chip { 0%, 100% { fill: color-mix(in oklab, var(--color-text) 16%, transparent); transform: none; } 45% { fill: var(--color-primary); transform: translateX(10px); } }
.mo-viz--engine .mo-flow { stroke: var(--color-primary); stroke-width: 2; stroke-dasharray: 6 8; animation: mo-dash .6s linear infinite; }
@keyframes mo-dash { to { stroke-dashoffset: -14; } }
.mo-viz--engine .mo-eq rect { fill: var(--color-primary); transform-box: fill-box; transform-origin: 50% 50%; animation: mo-eq 1.1s ease-in-out calc(var(--i) * -97ms) infinite alternate; }
@keyframes mo-eq { from { transform: scaleY(.18); opacity: .55; } to { transform: scaleY(1); opacity: 1; } }
.mo-viz--strategy { max-width: 220px; margin-bottom: var(--space-5); }
.mo-viz--strategy + .card-label { margin-bottom: var(--space-5); }
.mo-viz--strategy .mo-tyre-bg { fill: none; stroke: color-mix(in oklab, var(--color-text) 14%, transparent); stroke-width: 6; }
.mo-viz--strategy .mo-tyre { fill: none; stroke: #ffc53d; stroke-width: 6; stroke-dasharray: 100; transform: rotate(-90deg); transform-origin: 28px 28px; animation: mo-tyre 6s ease-in-out infinite; }
@keyframes mo-tyre { 0% { stroke-dashoffset: 0; stroke: #ffc53d; } 70% { stroke-dashoffset: 72; stroke: var(--color-primary); } 78%, 100% { stroke-dashoffset: 0; stroke: #ffc53d; } }
.mo-viz--strategy text { fill: var(--color-text); font: 900 13px/1 var(--font-body); text-anchor: middle; }
.mo-viz--strategy .mo-pit-bg { fill: color-mix(in oklab, var(--color-text) 12%, transparent); }
.mo-viz--strategy .mo-pit-win { fill: none; stroke: var(--color-primary); stroke-width: 1.5; stroke-dasharray: 3 3; }
.mo-viz--strategy .mo-pit-car { fill: var(--color-primary); animation: mo-pit-car 6s ease-in-out infinite; }
@keyframes mo-pit-car { 0% { transform: translateX(0); } 70% { transform: translateX(68px); } 78% { transform: translateX(68px); opacity: 1; } 84% { opacity: 0; transform: translateX(118px); } 85% { transform: translateX(0); opacity: 0; } 100% { opacity: 1; } }
.mo-viz--state { height: 30px; margin-bottom: var(--space-5); overflow: hidden; }
.mo-viz--state + .card-label { margin-bottom: var(--space-5); }
.mo-flag { display: grid; animation: mo-flag 8s steps(1) infinite; }
.mo-flag b {
  height: 30px;
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 0 12px;
  color: #fff;
  background: var(--color-primary-fill, #e0101f);
  font: 900 12px/1 var(--font-body);
  letter-spacing: .16em;
  text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
  animation: mo-flag-in 2s cubic-bezier(.2, .9, .15, 1) infinite;
}
@keyframes mo-flag { 0% { transform: translateY(0); } 25% { transform: translateY(-30px); } 50% { transform: translateY(-60px); } 75% { transform: translateY(-90px); } }
@keyframes mo-flag-in { 0% { clip-path: polygon(0 0, 0 0, 0 50%, 0 100%, 0 100%); } 18%, 100% { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); } }

/* Track map: a live car laps the racing line; sectors and signals light up. */
.track-svg .mo-sector { fill: none; stroke-width: 6; stroke-linecap: round; opacity: 0; }
.track-svg .mo-sector.is-flash { animation: mo-sector 1.3s ease-out; }
@keyframes mo-sector { 0% { opacity: .95; } 100% { opacity: 0; } }
.track-svg .mo-trail { fill: none; stroke: #ff5a3c; stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 6px #ff2a18); }
.track-svg .mo-car { fill: #fff; filter: drop-shadow(0 0 5px #ff3a28) drop-shadow(0 0 12px #ff2a18); }
.track-svg .corner-dots circle { transition: r .25s ease, fill .25s ease; }
.track-svg .corner-dots circle.is-live { r: 8; fill: var(--color-primary); }
.pill { transition: color .3s ease, border-color .3s ease, background-color .3s ease, box-shadow .3s ease; }
.pill.is-live { color: #fff; border-color: var(--color-primary); background: var(--color-primary); box-shadow: 0 0 18px color-mix(in oklab, var(--color-primary) 55%, transparent); }
[data-theme='light'] .pill.is-live { color: #fff; }

/* Broadcast ticker above the final call to action. */
.mo-ticker {
  overflow: hidden;
  margin-bottom: var(--space-3);
  border-block: 1px solid var(--color-border);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.mo-ticker-track { display: flex; width: max-content; animation: mo-ticker 28s linear infinite; }
.mo-ticker span {
  padding: 10px 22px;
  color: var(--color-text-muted);
  font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .2em;
  text-transform: uppercase;
  white-space: nowrap;
}
.mo-ticker span::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 22px; vertical-align: middle; background: var(--color-primary); transform: rotate(45deg); }
@keyframes mo-ticker { to { transform: translateX(-50%); } }

/* ---------- 4. Features, How it works, Pricing ------------------------------ */
.mo-icon { width: 52px; height: 52px; margin-bottom: var(--space-5); color: var(--color-primary); }
.mo-icon svg { width: 100%; height: 100%; overflow: visible; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mo-icon + .card-label { margin-bottom: var(--space-5); }
.mo-icon .mo-f { fill: currentColor; stroke: none; }
.mo-icon .mo-dim { stroke: color-mix(in oklab, var(--color-text) 25%, transparent); }
.mo-icon--gap .mo-chase { animation: mo-chase 2.6s ease-in-out infinite; }
@keyframes mo-chase { 0%, 100% { transform: translateX(0); } 60% { transform: translateX(13px); } }
.mo-icon--radar .mo-sweep { transform-origin: 26px 26px; animation: mo-spin 2.8s linear infinite; }
@keyframes mo-spin { to { transform: rotate(360deg); } }
.mo-icon--radar .mo-blip { animation: mo-blip 2.8s ease-out infinite; }
@keyframes mo-blip { 0%, 30% { opacity: 0; } 34% { opacity: 1; } 100% { opacity: 0; } }
.mo-icon--momentum .mo-line { stroke-dasharray: 90; animation: mo-draw 3.2s ease-in-out infinite; }
@keyframes mo-draw { 0% { stroke-dashoffset: 90; } 60%, 100% { stroke-dashoffset: 0; } }
.mo-icon--flag .mo-cloth { transform-origin: 14px 14px; animation: mo-wave-flag 1.4s ease-in-out infinite alternate; }
@keyframes mo-wave-flag { from { transform: skewY(-6deg) scaleX(.94); } to { transform: skewY(5deg) scaleX(1); } }
.mo-icon--tone .mo-needle { transform-origin: 26px 36px; animation: mo-needle 3.6s cubic-bezier(.5, 0, .3, 1) infinite; }
@keyframes mo-needle { 0%, 100% { transform: rotate(-55deg); } 33% { transform: rotate(0deg); } 66% { transform: rotate(55deg); } }
.mo-icon--finish .mo-cell { animation: mo-cell 1.6s steps(2, jump-none) infinite; }
.mo-icon--finish .mo-cell:nth-child(odd) { animation-delay: -.8s; }
@keyframes mo-cell { 50% { opacity: .15; } }

.mo-js .workflow-grid { position: relative; }
.mo-pipe {
  position: absolute;
  left: 0;
  right: 0;
  top: -18px;
  height: 2px;
  background: color-mix(in oklab, var(--color-text) 14%, transparent);
  pointer-events: none;
}
.mo-pipe::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-primary);
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform 1.6s cubic-bezier(.4, 0, .2, 1);
}
.mo-pipe.is-in::before { transform: none; }
.mo-pipe i {
  position: absolute;
  top: -4px;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px var(--color-primary), 0 0 18px var(--color-primary);
  opacity: 0;
}
.mo-pipe.is-in i { animation: mo-pipe-dot 3.4s cubic-bezier(.5, 0, .5, 1) 1.6s infinite; }
@keyframes mo-pipe-dot { 0% { left: 0; opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { left: calc(100% - 10px); opacity: 0; } }
.mo-js .workflow-step strong { transition: text-shadow .4s ease, color .4s ease; }
.mo-js .workflow-step.is-lit strong { text-shadow: 0 0 14px color-mix(in oklab, var(--color-primary) 80%, transparent), 0 0 34px color-mix(in oklab, var(--color-primary) 45%, transparent); }
@media (max-width: 900px) { .mo-pipe { display: none; } }

@property --mo-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.mo-js .price-card.recommended::before {
  content: '';
  position: absolute;
  inset: -3px;
  padding: 3px;
  pointer-events: none;
  background: conic-gradient(from var(--mo-angle), var(--color-primary), #ffd2c2 12%, var(--color-primary) 24%, #7a0010 60%, var(--color-primary));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: mo-halo 5s linear infinite;
}
@keyframes mo-halo { to { --mo-angle: 360deg; } }
.mo-fuel {
  display: block;
  height: 6px;
  margin-top: var(--space-3);
  background: color-mix(in oklab, var(--color-text) 12%, transparent);
  overflow: hidden;
}
.mo-fuel i {
  display: block;
  height: 100%;
  width: calc(var(--fill, 1) * 100%);
  background: linear-gradient(90deg, #7a0010, var(--color-primary) 70%, #ffb49e);
  transform-origin: 0 50%;
}
.mo-js .mo-fuel i { transform: scaleX(0); transition: transform 1.2s cubic-bezier(.2, .9, .15, 1) .2s; }
.mo-js .is-in .mo-fuel i, .mo-js .mo-fuel.is-in i { transform: none; }



/* ---------- 5. Start screen intro ------------------------------------------
   Before the visitor presses Enter ApexCast, the code-drawn scene boots up:
   glow and beam fade in, the linework wipes in along the approved top-left to
   bottom-right diagonal, the car rolls in, labels and the title land last. */

  .splash-bg--scene .scene-layer--back { animation: mo-intro-back 1.5s cubic-bezier(.2, .7, .2, 1) both; }
  .splash-bg--scene .scene-layer--front { animation: mo-intro-wipe 1.25s cubic-bezier(.6, 0, .2, 1) .25s both; }
  .splash-bg--scene .scene-layer--car { animation: mo-intro-car 1.2s cubic-bezier(.2, .8, .2, 1) .75s both; }
  .splash-bg--scene .scene-live { animation: mo-intro-fade 1s ease 1.5s both; }
  .splash .splash-bg.splash-bg--scene::after { animation: diagonal-grid-flow 1.5s linear infinite, mo-intro-fade 1s ease .9s backwards; }
  .splash-bg--scene .scene-c { animation: mo-intro-label .8s cubic-bezier(.2, .8, .2, 1) both; }
  .splash-bg--scene .scene-c--tl { animation-delay: 1.0s; }
  .splash-bg--scene .scene-c--tr { animation-delay: 1.1s; }
  .splash-bg--scene .scene-c--bl { animation-delay: 1.2s; }
  .splash-bg--scene .scene-c--br { animation-delay: 1.3s; }
  .splash-bg--scene .scene-c::after { transform-origin: 0 50%; animation: mo-intro-line .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: inherit; }
  .splash-bg--scene .scene-c--tr::after, .splash-bg--scene .scene-c--br::after { transform-origin: 100% 50%; }
  .splash-bg--scene .scene-corners::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff3a26 20%, #ffd2c2 50%, #ff3a26 80%, transparent);
    box-shadow: 0 0 14px #ff2a18, 0 0 40px rgba(255, 42, 24, .6);
    opacity: 0;
    animation: mo-intro-scan 1.1s cubic-bezier(.5, 0, .5, 1) .05s both;
  }
  .splash:has(.splash-bg--scene) .splash-inner > * { animation: mo-intro-rise .9s cubic-bezier(.2, .8, .2, 1) both; }
  .splash:has(.splash-bg--scene) .splash-inner > .splash-brandline { animation-delay: 1.25s; }
  .splash:has(.splash-bg--scene) .splash-inner > h1 { animation: mo-intro-title 1s cubic-bezier(.2, .8, .2, 1) 1.4s both; }
  .splash:has(.splash-bg--scene) .splash-inner > p { animation-delay: 1.6s; }
  .splash:has(.splash-bg--scene) .splash-inner > .start-lights { animation-delay: 1.72s; }
  .splash:has(.splash-bg--scene) .splash-inner > .light-instruction { animation-delay: 1.84s; }
  .splash:has(.splash-bg--scene) .splash-inner > .launch-pad { animation-delay: 1.96s; }

@keyframes mo-intro-back { from { opacity: 0; } to { opacity: 1; } }
@keyframes mo-intro-wipe { from { clip-path: polygon(0 0, 0 0, 0 0, 0 0); } to { clip-path: polygon(0 0, 200% 0, 0 200%, 0 200%); } }
@keyframes mo-intro-car { from { opacity: 0; } to { opacity: 1; } }
@keyframes mo-intro-fade { from { opacity: 0; } }
@keyframes mo-intro-label { from { opacity: 0; transform: translateY(8px); clip-path: inset(0 100% 0 0); } to { opacity: 1; transform: none; clip-path: inset(0 0 0 0); } }
@keyframes mo-intro-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes mo-intro-scan { 0% { top: 0; opacity: 0; } 10% { opacity: 1; } 85% { opacity: .9; } 100% { top: 100%; opacity: 0; } }
@keyframes mo-intro-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes mo-intro-title { from { opacity: 0; transform: scale(1.12); letter-spacing: .04em; } to { opacity: 1; transform: none; } }

/* Demo page: chequered finish line painted on the Miami aerial track (decorative,
   never intercepts the pointer, so driver selection is unaffected). */
.aerial-track .demo-finish rect, .aerial-track .demo-finish path, .aerial-track .demo-finish-tag path { stroke: none; }
.aerial-track .demo-finish .df-l { fill: #f4f1ea; }
.aerial-track .demo-finish .df-d { fill: #0b0c10; }
.aerial-track .demo-finish .df-edge { fill: none; stroke: #ff2a1f; stroke-width: 1.4; }
.aerial-track .demo-finish .df-glow { fill: #ff2a1f; opacity: .35; filter: blur(5px); animation: df-glow 2.4s ease-in-out infinite alternate; }
@keyframes df-glow { from { opacity: .15; } to { opacity: .5; } }
.aerial-track .demo-finish-tag path { fill: none; stroke: #ff2a1f; stroke-width: 1.6; }
.aerial-track .demo-finish-tag text { fill: #fff; font: 800 14px/1 var(--font-body); letter-spacing: 3px; paint-order: stroke; stroke: rgba(0, 0, 0, .65); stroke-width: 3px; }


/* ---------- 6. Roadmap page motion ---------------------------------------- */

  .rm-lap-track { stroke-dasharray: 760; animation: rm-draw 1.4s cubic-bezier(.5, 0, .2, 1) .2s backwards; }
  .rm-lap-done { animation: rm-done 1.2s cubic-bezier(.5, 0, .2, 1) 1.1s backwards; }
  .rm-lap-pt { animation: rm-pop .5s cubic-bezier(.2, 1.4, .4, 1) backwards; transform-box: fill-box; transform-origin: center; }
  .rm-lap-pt:nth-of-type(1) { animation-delay: .9s; } .rm-lap-pt:nth-of-type(2) { animation-delay: 1s; } .rm-lap-pt:nth-of-type(3) { animation-delay: 1.1s; } .rm-lap-pt:nth-of-type(4) { animation-delay: 1.2s; } .rm-lap-pt:nth-of-type(5) { animation-delay: 1.3s; }
  .rm-lap-pt.is-current circle { animation: rm-beacon 1.8s ease-in-out 1.6s infinite; }
  .rm-lap-car { animation: mo-intro-fade .6s ease 1.5s backwards; }
  .rm-live i { animation: blink 1.6s linear infinite; }
  .rm-lap-readout strong { animation: rm-count .8s steps(5) 1s backwards; }
  .mo-js .rm-sector::before { transform: scaleX(0); transition: transform .9s cubic-bezier(.2, .9, .15, 1); }
  .mo-js .rm-sectors.is-in .rm-sector::before { transform: none; }
  .mo-js .rm-sectors.is-in .rm-sector--next::before { transition-delay: .25s; }
  .mo-js .rm-sectors.is-in .rm-sector--later::before { transition-delay: .5s; }
  .mo-js .rm-track { --p: 0; }
  .mo-js .rm-card { opacity: .35; translate: 0 18px; transition: opacity .6s ease, translate .7s cubic-bezier(.2, .9, .15, 1), border-color .4s ease; }
  .mo-js .rm-stop.is-lit .rm-card { opacity: 1; translate: 0 0; }
  .mo-js .rm-stop.is-lit .rm-node::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--color-primary); animation: rm-ping .9s ease-out 1; }
  .rm-stop.is-current .rm-node::before { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 1px solid var(--color-primary); animation: rm-ping 2s ease-out infinite; }
  .rm-chip--now::before { animation: blink 1.6s linear infinite; }

@keyframes rm-draw { from { stroke-dashoffset: 760; } to { stroke-dashoffset: 0; } }
@keyframes rm-done { from { stroke-dasharray: 0 100; } }
@keyframes rm-pop { from { transform: scale(0); opacity: 0; } }
@keyframes rm-beacon { 50% { filter: drop-shadow(0 0 7px #ff3a2a); } }
@keyframes rm-ping { from { transform: scale(1); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }
@keyframes rm-count { from { opacity: 0; transform: translateY(10px); } }

/* ---------- 7. Light theme start screen --------------------------------------
   Daylight artwork (tools/start-scene/art/ref-light.png) on warm paper, with dark
   type. The background image swaps via motion.js when the theme changes. */
[data-theme='light'] .splash { background: #f7f5f0; color: #0b0c10; }
[data-theme='light'] .splash .splash-bg.splash-bg--scene { background: #f7f5f0; }
/* The daylight artwork already contains the car and linework. */
[data-theme='light'] .splash-bg--scene .scene-layer--car,
[data-theme='light'] .splash-bg--scene .scene-layer--front { display: none; }
[data-theme='light'] .splash-bg--scene::before { background: radial-gradient(ellipse at 50% 52%, rgba(244, 241, 234, .55), transparent 62%); }
[data-theme='light'] .splash .splash-bg.splash-bg--scene::after { opacity: .22; }
[data-theme='light'] .scene-live { mix-blend-mode: multiply; opacity: .8; }
/* No light streaks, brake-light glows or horizon flare in daylight. */
[data-theme='light'] .scene-live .lv-comet,
[data-theme='light'] .scene-live .lv-tail,
[data-theme='light'] .scene-live .lv-horizon,
[data-theme='light'] .scene-live .lv-beam { display: none; }
[data-theme='light'] .scene-corners { color: #2a2b31; }
[data-theme='light'] .scene-c::after { background: #d60016; }
[data-theme='light'] .splash-kicker { color: #b3001a; }
[data-theme='light'] .splash h1 { color: #0b0c10; text-shadow: none; }
[data-theme='light'] .splash h1 > span { color: #d60016; text-shadow: none; }
[data-theme='light'] .splash p { color: #2a2b31; text-shadow: none; }
[data-theme='light'] .light-instruction { color: #4f5259; }
[data-theme='light'] .launch-status { color: #4f5259; }
[data-theme='light'] .start-lights span { background: #fffdf8; border-color: #c4524a; box-shadow: inset 0 0 6px rgba(0, 0, 0, .15); }
[data-theme='light'] .start-lights span.is-red { background: #d60016; border-color: #d60016; box-shadow: 0 0 14px rgba(214, 0, 22, .55); }
[data-theme='light'] .start-lights.is-green span { background: #12a150; border-color: #12a150; box-shadow: 0 0 14px rgba(18, 161, 80, .5); }
[data-theme='light'] .start-lights::before, [data-theme='light'] .start-lights::after { background: linear-gradient(90deg, transparent, #d60016); box-shadow: none; }
[data-theme='light'] .launch-pad { filter: drop-shadow(0 10px 22px rgba(214, 0, 22, .22)); }
[data-theme='light'] .launch-button { background: #f4c4ac; }

/* ---------- 8. Theme switch transition --------------------------------------
   "Light gate": the old theme sinks back and dims while the new theme slices in
   through diagonal slats (the start-screen line angle). A solid sweep follows,
   led by a bright red streak with two trailing light lines, and the new theme
   lands with a soft flash. ~1.1s. Runs only during a theme switch. */
@property --mo-slat { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --mo-sweep { syntax: '<percentage>'; inherits: false; initial-value: -12%; }
html.mo-theme-switch::view-transition-group(root) { animation-duration: 1.1s; }
html.mo-theme-switch::view-transition-old(root),
html.mo-theme-switch::view-transition-new(root) { mix-blend-mode: normal; }
html.mo-theme-switch::view-transition-old(root) {
  animation: mo-theme-old 1.1s cubic-bezier(.6, 0, .3, 1) both;
  transform-origin: 70% 70%;
}
html.mo-theme-switch.mo-to-light::view-transition-old(root) { animation-name: mo-theme-old-dark; }
@keyframes mo-theme-old { to { transform: scale(.965); filter: brightness(.82) saturate(.8); } }
@keyframes mo-theme-old-dark { to { transform: scale(.965); filter: brightness(.55) saturate(1.2); } }
html.mo-theme-switch::view-transition-new(root) {
  -webkit-mask-image:
    linear-gradient(135deg, #000 calc(var(--mo-sweep) - 7%), transparent var(--mo-sweep)),
    repeating-linear-gradient(135deg, #000 0 var(--mo-slat), transparent var(--mo-slat) 64px);
  mask-image:
    linear-gradient(135deg, #000 calc(var(--mo-sweep) - 7%), transparent var(--mo-sweep)),
    repeating-linear-gradient(135deg, #000 0 var(--mo-slat), transparent var(--mo-slat) 64px);
  animation: mo-theme-reveal 1.1s cubic-bezier(.7, 0, .2, 1) both;
}
@keyframes mo-theme-reveal {
  0% { --mo-slat: 0px; --mo-sweep: -12%; }
  30% { --mo-slat: 3px; }
  70% { --mo-slat: 22px; }
  100% { --mo-slat: 34px; --mo-sweep: 118%; }
}
.mo-theme-streak {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
  view-transition-name: mo-theme-streak;
}
html.mo-theme-switch::view-transition-group(mo-theme-streak) { animation: none; }
html.mo-theme-switch::view-transition-image-pair(mo-theme-streak) { isolation: auto; }
html.mo-theme-switch::view-transition-new(mo-theme-streak) {
  width: 100%;
  height: 100%;
  /* lead streak on the sweep front, two thinner trails behind it */
  background:
    linear-gradient(135deg, transparent calc(50% - 1.8vmax), rgba(255, 70, 50, .5) calc(50% - .45vmax), #fff3ec 50%, rgba(255, 36, 26, .95) calc(50% + .3vmax), transparent calc(50% + 1.3vmax)),
    linear-gradient(135deg, transparent calc(44% - .25vmax), rgba(255, 60, 40, .8) 44%, transparent calc(44% + .25vmax)),
    linear-gradient(135deg, transparent calc(39.5% - .15vmax), rgba(255, 60, 40, .55) 39.5%, transparent calc(39.5% + .15vmax));
  filter: drop-shadow(0 0 14px rgba(255, 40, 28, .85));
  animation: mo-theme-streak 1.1s cubic-bezier(.7, 0, .2, 1) both;
}
html.mo-theme-switch.mo-to-dark::view-transition-new(mo-theme-streak) {
  background:
    linear-gradient(135deg, transparent calc(50% - 1.8vmax), rgba(214, 0, 22, .45) calc(50% - .45vmax), #ff6a50 50%, rgba(130, 0, 18, .95) calc(50% + .3vmax), transparent calc(50% + 1.3vmax)),
    linear-gradient(135deg, transparent calc(44% - .25vmax), rgba(214, 0, 22, .75) 44%, transparent calc(44% + .25vmax)),
    linear-gradient(135deg, transparent calc(39.5% - .15vmax), rgba(214, 0, 22, .5) 39.5%, transparent calc(39.5% + .15vmax));
}
/* the streak's centre line tracks the sweep front: x/W + y/H = 2 * sweep */
@keyframes mo-theme-streak {
  0% { transform: translate(-62%, -62%); opacity: 0; }
  8% { opacity: 1; }
  88% { opacity: 1; }
  100% { transform: translate(68%, 68%); opacity: 0; }
}
/* landing flash */
html.mo-theme-switch::view-transition-old(mo-theme-streak) { display: none; }
html.mo-theme-switch::view-transition(root)::after { content: none; }
.mo-theme-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2147482999;
  view-transition-name: mo-theme-flash;
}
html.mo-theme-switch::view-transition-group(mo-theme-flash) { animation: none; }
html.mo-theme-switch::view-transition-new(mo-theme-flash) {
  width: 100%;
  height: 100%;
  background: radial-gradient(120% 90% at 100% 100%, rgba(255, 236, 228, .9), rgba(255, 90, 60, .25) 40%, transparent 70%);
  animation: mo-theme-flash 1.1s ease-out both;
}
html.mo-theme-switch.mo-to-dark::view-transition-new(mo-theme-flash) {
  background: radial-gradient(120% 90% at 100% 100%, rgba(255, 60, 40, .45), rgba(120, 0, 16, .2) 40%, transparent 70%);
}
@keyframes mo-theme-flash { 0%, 72% { opacity: 0; } 84% { opacity: 1; } 100% { opacity: 0; } }


/* Daylight background layer: always loaded, shown only in light mode. */
.scene-light { position: absolute; inset: 0; z-index: 0; opacity: 0; pointer-events: none; }
[data-theme='light'] .scene-light { opacity: 1; }

  .splash-bg--scene .scene-layer--back-light { animation: mo-intro-back 1.5s cubic-bezier(.2, .7, .2, 1) both; }


/* Theme switch fallback (browsers without View Transitions, e.g. Safari before 18):
   the old theme's colour is drawn over the page and swept away along the diagonal,
   led by the same red streak. */
@property --mo-fb { syntax: '<percentage>'; inherits: false; initial-value: -12%; }
.mo-theme-fallback {
  position: fixed;
  inset: 0;
  z-index: 2147482998;
  pointer-events: none;
  background: var(--mo-fb-color, #08090c);
  -webkit-mask-image: linear-gradient(135deg, transparent calc(var(--mo-fb) - 7%), #000 var(--mo-fb));
  mask-image: linear-gradient(135deg, transparent calc(var(--mo-fb) - 7%), #000 var(--mo-fb));
  animation: mo-theme-fb .9s cubic-bezier(.7, 0, .2, 1) both;
}
@keyframes mo-theme-fb { from { --mo-fb: -12%; } to { --mo-fb: 118%; } }
.mo-theme-fallback-streak {
  position: fixed;
  inset: 0;
  z-index: 2147482999;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent calc(50% - 1.8vmax), rgba(255, 70, 50, .5) calc(50% - .45vmax), #fff3ec 50%, rgba(255, 36, 26, .95) calc(50% + .3vmax), transparent calc(50% + 1.3vmax)),
    linear-gradient(135deg, transparent calc(44% - .25vmax), rgba(255, 60, 40, .8) 44%, transparent calc(44% + .25vmax));
  animation: mo-theme-streak .9s cubic-bezier(.7, 0, .2, 1) both;
}
