.journey-light {
  position: absolute;
  pointer-events: none;
  inset: 0;
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  :root[data-motion="on"] .site-header::after { content: none; }
}

@supports not (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    :root[data-motion="on"] .site-header::after {
      content: "";
      position: absolute;
      inset: auto 0 -1px;
      block-size: 2px;
      background: linear-gradient(90deg, var(--copper), var(--champagne));
      pointer-events: none;
      transform: scaleX(var(--journey-progress, 0));
      transform-origin: left;
    }
  }
}

@media (prefers-reduced-motion: no-preference) {
  :root[data-motion="on"] .sparta-panorama.journey-visible:not(.has-video) > picture {
    scale: 1.045;
    translate: 0 calc((var(--journey-phase, .5) - .5) * 28px);
  }

  :root[data-motion="on"] .sparta-panorama.journey-visible:not(.has-video) .journey-light {
    z-index: 2;
    visibility: visible;
    background: linear-gradient(108deg, transparent 32%, #e9a8611f 49%, transparent 65%);
    transform: translateX(calc((var(--journey-phase, .5) - .5) * 120%));
  }

  :root[data-motion="on"] .team-photo.journey-visible::before {
    content: "";
    pointer-events: none;
    position: absolute;
    z-index: 1;
    inset: .62rem;
    border: 1px solid #e7ad6880;
    clip-path: polygon(0 0, 25% 0, 8% 20%, 8% 80%, 25% 100%, 0 100%, 0 0, 100% 0, 100% 100%, 75% 100%, 92% 80%, 92% 20%, 75% 0);
    animation: journey-framing 1.1s cubic-bezier(.14,.78,.17,1) both;
  }

  :root[data-motion="on"] .team-photo.journey-visible figcaption {
    z-index: 2;
    animation: journey-caption .7s .15s cubic-bezier(.16,.68,.24,1) both;
  }

  :root[data-motion="on"] .battle-ledger .battle-results a {
    position: relative;
  }

  :root[data-motion="on"] .battle-ledger.journey-visible .battle-results a::after {
    content: "";
    pointer-events: none;
    position: absolute;
    inset: auto 0 0;
    block-size: 1px;
    background: linear-gradient(90deg, transparent, #e5b57d, transparent);
    transform-origin: left;
    animation: journey-engraving .85s var(--engraving-delay, 0ms) cubic-bezier(.22,.7,.18,1) both;
  }

  :root[data-motion="on"] .battle-ledger.journey-visible .battle-results strong {
    animation: journey-numerals .62s var(--engraving-delay, 0ms) cubic-bezier(.2,.72,.24,1) both;
  }

  .battle-results li:nth-child(2) { --engraving-delay: 110ms; }
  .battle-results li:nth-child(3) { --engraving-delay: 220ms; }

  :root[data-motion="on"] .battle-ledger.journey-visible .battle-results a:focus-visible strong { animation: none; }

  :root[data-motion="on"] .join.journey-visible .journey-light {
    z-index: 1;
    visibility: visible;
    background: radial-gradient(ellipse at 64% 90%, #e189473a, #af482815 41%, transparent 70%);
    transform: translateX(calc((var(--journey-phase, .5) - .5) * 48%));
  }

  :root[data-motion="on"] .join.journey-visible .btn-primary {
    animation: journey-invitation 1.35s .12s ease-out both;
  }

  :root[data-motion="on"] .join .btn-primary:focus-visible { animation: none; }

  @keyframes journey-framing {
    from { opacity: 0; transform: scale(.96, .89); }
    to { opacity: .62; transform: scale(1); }
  }

  @keyframes journey-caption {
    from { opacity: .55; translate: 0 .5rem; }
    to { opacity: 1; translate: 0; }
  }

  @keyframes journey-engraving {
    from { opacity: 0; transform: scaleX(.05); }
    55% { opacity: 1; }
    to { opacity: .25; transform: scaleX(1); }
  }

  @keyframes journey-numerals {
    from { opacity: .52; translate: 0 .24em; }
    to { opacity: 1; translate: 0; }
  }

  @keyframes journey-invitation {
    50% { box-shadow: 0 0 0 5px #d5915330, 0 8px 30px #d37d4055; }
  }
}

@media (max-width: 680px) and (prefers-reduced-motion: no-preference) {
  :root[data-motion="on"] .sparta-panorama.journey-visible:not(.has-video) > picture {
    scale: 1.032;
    translate: 0 calc((var(--journey-phase, .5) - .5) * 16px);
  }

  :root[data-motion="on"] .sparta-panorama.journey-visible:not(.has-video) .journey-light {
    opacity: .75;
  }
}
