/* Sprint echo: keep the readable type still; animate only its decorative trace. */
.page-index { --type-echo-color:#a92436; }
.page-index.theme-night { --type-echo-color:#9dbde4; }
.type-echo { position:relative; }
.type-echo__ink { display:none; }

body.page-index main :is(.atlas-heading,.field-gallery__intro,.section-heading,.home-feature-copy,.news-home > div),
body.page-index main :is(#official-home,#supporter-home) .section-heading,
body.page-index main #custom-home .custom-home__copy {
  animation:none;
}

@supports (-webkit-text-stroke:1px currentColor) and (clip-path:polygon(0 0,100% 0,100% 100%,0 100%)) {
  @media (prefers-reduced-motion:no-preference) {
    .type-echo__ink {
      display:block;
      position:absolute;
      inset:0;
      color:transparent;
      pointer-events:none;
      -webkit-text-stroke-width:clamp(.65px,.08vw,1.2px);
      -webkit-text-stroke-color:var(--type-echo-color);
      opacity:0;
    }
    .type-echo__ink::before { content:attr(data-echo); }
    .match-hero h1 .type-echo__ink {
      animation:hnfl-type-sprint 640ms cubic-bezier(.28,.63,.2,1) 780ms 1 both;
    }
    .match-hero h1 .type-echo:nth-child(2) .type-echo__ink { animation-delay:870ms; }
  }
}

@supports (animation-timeline:view()) and (view-timeline-name:--hnfl-type-chapter) and (-webkit-text-stroke:1px currentColor) {
  @media (prefers-reduced-motion:no-preference) {
    .type-echo--chapter { view-timeline-name:--hnfl-type-chapter; }
    .type-echo--chapter .type-echo__ink {
      animation:hnfl-type-sprint auto linear both;
      animation-timeline:--hnfl-type-chapter;
      animation-range:entry 12% entry 98%;
    }
  }
}

@keyframes hnfl-type-sprint {
  0% {
    opacity:0;
    translate:-.16em -.032em;
    clip-path:polygon(-38% -12%,-6% -12%,-19% 112%,-51% 112%);
  }
  30% { opacity:.81; }
  62% { opacity:.68; }
  100% {
    opacity:0;
    translate:.115em -.032em;
    clip-path:polygon(110% -12%,142% -12%,129% 112%,97% 112%);
  }
}

/* The score-strip swap only clips the city name, not the number or the poster. */
@media (prefers-reduced-motion:no-preference) {
  .page-index .city-preview .city-scene .signal-copy > * {
    translate:none;
    transition:opacity 260ms ease 40ms;
  }
  @supports (clip-path:polygon(0 0,100% 0,100% 100%,0 100%)) {
    .page-index .city-preview .city-scene .signal-copy h3 {
      --type-city-edge:calc((var(--city-preview-layer,1) - 1) * 118% - 2%);
      opacity:1;
      clip-path:polygon(-4% -12%,var(--type-city-edge) -12%,
                    calc(var(--type-city-edge) - 14%) 112%,-4% 112%);
      transition:clip-path 450ms cubic-bezier(.22,.73,.22,1) var(--type-city-delay,0ms);
    }
    .page-index .city-selector:has(.city-card:focus-visible,.city-card:hover) .city-scene .signal-copy h3 {
      --type-city-delay:calc((var(--city-preview-layer,1) - 1) * 55ms);
    }
  }
}
