:root {
  --enter-ease: cubic-bezier(.22,.72,.24,1);
}

/* The preview has its own framing and corner mark at this aspect ratio. */
.immersive { overflow: clip; }
.hero-stage > * { min-width: 0; }
.immersive .scene-wrap,
.immersive .hero-contact {
  animation: preview-arrive 460ms var(--enter-ease) both;
  will-change: auto;
}
@keyframes preview-arrive {
  from { opacity: .84; translate: 0 5px; }
  to { opacity: 1; translate: 0 0; }
}
.immersive .scene-portal {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
}
.scene-portal .ambient-video,
.scene-portal:hover .ambient-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: none;
}
.scene-portal .scene-shade {
  background: linear-gradient(0deg,#0c293a46,transparent 28%);
}
.scene-portal .scene-play {
  color: white;
  background: #113440bd;
  border-color: #e1f7edb3;
  backdrop-filter: blur(5px);
}
.scene-portal .scene-play::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 3px;
  border-block: 6px solid transparent;
  border-left: 10px solid currentColor;
}
.scene-portal:is(:hover,:focus-visible) .scene-play {
  transform: scale(1.055);
  background: #14534ee6;
}
.video-dialog .viewer-frame video {
  height: auto;
  aspect-ratio: 16 / 9;
}
.immersive .scene-under > span { max-width: none; line-height: 1.4; }

.motion-ready .reveal {
  transition: opacity 510ms var(--enter-ease), transform 580ms var(--enter-ease);
}
.motion-ready .reveal:not(.is-visible) {
  transform: translateY(13px);
  /* Reset only beyond the viewport. Do not animate away from the reader. */
  transition: none;
}
.motion-ready :is(.sim-grid,.possibilities-grid,.audience-grid) > .reveal:nth-child(2) { transition-delay: 45ms; }
.motion-ready :is(.sim-grid,.possibilities-grid,.audience-grid) > .reveal:nth-child(3) { transition-delay: 90ms; }
.motion-ready .sim-grid > .reveal:nth-child(4) { transition-delay: 135ms; }
.motion-ready .reveal:focus-within {
  opacity: 1;
  transform: none;
  transition-delay: 0s;
}

/* The outgoing photograph covers the canvas during the incoming dissolve. */
.mode-route .journey-visual {
  border-radius: 16px 5px 12px 5px;
}
.mode-route .journey-image {
  z-index: 0;
  opacity: 0;
  transform: none;
  transition: none;
}
.mode-route .journey-image.is-previous { z-index: 1; opacity: 1; }
.mode-route .journey-image.is-active { z-index: 2; opacity: 1; }
.mode-route .journey-visual::after {
  z-index: 3;
  background: linear-gradient(0deg,#092b38c2,transparent 45%);
}
.mode-route .scene-overlay,
.mode-route .journey-track { z-index: 4; }
.mode-route[data-step] .journey-track span {
  width: 100%;
  transform: scaleX(var(--stage-progress,.333333));
  transform-origin: left;
  transition: transform 540ms var(--enter-ease);
}
.route-links a,
.route-number { transition-timing-function: var(--enter-ease); }
.assessment .story-scene {
  transition: opacity 390ms var(--enter-ease), visibility 0s linear 390ms;
}
.assessment .story-scene.is-active {
  transition-delay: 0s;
}
@media (min-width:601px) {
  .motion-ready .reveal:not(.is-visible) {
    transform: translateY(23px);
  }
  .motion-ready .reveal.is-visible {
    transition-duration: 610ms, 690ms;
    transition-timing-function: cubic-bezier(.25,.58,.24,1);
  }
  .motion-ready .sim-grid > .reveal:nth-child(2) { transition-delay: 60ms; }
  .motion-ready .sim-grid > .reveal:nth-child(3) { transition-delay: 120ms; }
  .motion-ready .sim-grid > .reveal:nth-child(4) { transition-delay: 180ms; }
}
@media (max-width:600px) {
  .motion-ready :is(.sim-grid,.possibilities-grid,.audience-grid) > .reveal:nth-child(n) { transition-delay: 0s; }
  .mode-route .route-mobile-image {
    border-radius: 14px 4px 11px 4px;
    height: auto;
    aspect-ratio: 3 / 2;
  }
  .motion-ready .route-mobile-image.reveal:not(.is-visible) { transform: translateY(8px) scale(.985); }
}

@media (prefers-reduced-motion: reduce) {
/* Text and scene changes stay animated. A reduced-motion request selects a
   stationary dissolve, so the reader can follow the change without camera travel. */
html { scroll-behavior: auto; }
@keyframes title-enter {
  from { opacity: 0; transform: none; }
  to { opacity: 1; transform: none; }
}
@keyframes preview-arrive {
  from { opacity: .45; }
  to { opacity: 1; }
}
@keyframes viewer-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes viewer-leave {
  from { opacity: 1; }
  to { opacity: 0; }
}
.immersive .title-line > span {
  animation-duration: 850ms;
  animation-timing-function: ease-in-out;
}
.motion-ready .reveal,
.motion-ready .reveal:not(.is-visible),
.motion-ready .route-mobile-image.reveal:not(.is-visible) { transform: none; }
.motion-ready .reveal.is-visible {
  transition-property: opacity;
  transition-duration: 620ms;
  transition-timing-function: ease-in-out;
}
.scene-wrap, .scene-portal,
.scene-portal:is(:hover,:focus-visible) .scene-play,
.sim-card:hover .sim-shot img { transform: none; }
}

/* Colour travels across the existing emphasis, leaving the lettering readable. */
@media screen and (forced-colors: none) {
  @supports ((background-clip: text) or (-webkit-background-clip: text)) {
    .assessment, .immersive { --word-base: #f3faf9; }
    .motion-ready [data-ink] em,
    .motion-ready .immersive .title-line.accent > span {
      background-image: linear-gradient(100deg, currentColor 0% 44%, var(--word-base,var(--ink)) 57% 100%);
      background-size: 250% 100%;
      background-position: 0% 50%;
      background-repeat: no-repeat;
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
    }
    .motion-ready [data-ink].reveal:not(.is-visible) em { background-position: 100% 50%; }
    .motion-ready [data-ink].is-visible em {
      transition: background-position 740ms var(--enter-ease) 100ms;
    }
    .motion-ready .immersive .title-line.accent > span {
      width: fit-content;
      max-width: 100%;
      animation-name: title-enter, accent-ink;
      animation-duration: 1s, 800ms;
      animation-delay: 280ms, 480ms;
      animation-timing-function: var(--enter-ease), var(--enter-ease);
      animation-fill-mode: both, both;
    }
  }
}
@keyframes accent-ink {
  from { background-position: 100% 50%; }
  to { background-position: 0% 50%; }
}

/* A stationary frame opens above and below the photograph. */
.motion-ready .sim-card {
  --shutter-inset: 29%;
  --shutter-delay: 0ms;
}
.motion-ready .sim-card .sim-shot { background-color: #142e3b; }
.motion-ready .sim-card .sim-shot img {
  clip-path: inset(0% 0);
  transition: clip-path 690ms var(--enter-ease) var(--shutter-delay), transform 450ms var(--enter-ease);
}
.motion-ready .sim-card.reveal:not(.is-visible) .sim-shot img {
  clip-path: inset(var(--shutter-inset) 0);
  transition: none;
}
.motion-ready .sim-card.reveal:focus-visible .sim-shot img {
  clip-path: inset(0% 0);
  transition: none;
}
@media (min-width:601px) {
  .sim-grid .sim-card:nth-child(2) { --shutter-delay: 60ms; }
  .sim-grid .sim-card:nth-child(3) { --shutter-delay: 120ms; }
  .sim-grid .sim-card:nth-child(4) { --shutter-delay: 180ms; }
}

/* The same marker follows the selected CRM row or mobile tab. */
.assessment-flow { position: relative; }
.assessment-flow.has-step-marker::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 0;
  top: 0;
  width: 2px;
  height: 26px;
  border-radius: 2px;
  background-color: var(--mint);
  pointer-events: none;
  transform: translate3d(calc(var(--step-left) - 13px),calc(var(--step-top) + var(--step-height) / 2 - 13px),0);
  transition: transform 440ms var(--enter-ease);
}
@media (max-width:600px) {
  .assessment-flow.has-step-marker::after {
    width: var(--step-width);
    height: 2px;
    transform: translate3d(var(--step-left),calc(var(--step-top) + var(--step-height) - 2px),0);
  }
  .assessment-flow.has-step-marker .flow-step[aria-pressed="true"] { border-bottom-color: #ffffff20; }
}
@media (prefers-reduced-motion:reduce) {
  .motion-ready .immersive .title-line.accent > span {
    animation-duration: 850ms, 800ms;
    animation-timing-function: ease-in-out, var(--enter-ease);
  }
  .motion-ready .sim-card { --shutter-inset: 17%; }
  .assessment-flow.has-step-marker::after { transition-duration: 320ms; }
}
@media print {
  .motion-ready .sim-card.reveal .sim-shot img { clip-path: none; }
  .assessment-flow.has-step-marker::after { display: none; }
}
