/* Styles that exist only for motion. Everything here is inert without html.motion,
   so the page reads completely with JavaScript off or with reduced motion. */

/* The travelling dots */
.dots { position: fixed; inset: 0; z-index: 60; pointer-events: none; contain: strict; }
.dot {
  position: absolute; left: 0; top: 0; width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border-radius: 50%; background: var(--ink); display: none;
  transition: background-color 400ms ease;
}
.dots.is-cobalt .dot { background: var(--cobalt); }
.dots-live .dot { display: block; will-change: transform; }
.dots-live .dot-pair[data-dot-anchor] .dot-slot { background: transparent; }

/* Cursor label over the lead stories, fine pointers only */
.cursor-label {
  position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none;
  padding: 10px 14px; background: var(--ink); color: var(--paper);
  font: 500 var(--step-meta)/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
  opacity: 0; transform: translate(-100px, -100px) scale(0.85); transform-origin: 0 0;
  transition: opacity 180ms ease, scale 180ms var(--ease-out);
  display: none;
}
@media (hover: hover) and (pointer: fine) {
  .motion-ready .cursor-label { display: block; }
}
.cursor-label.is-visible { opacity: 1; scale: 1.176; }

/* Before the motion script takes over, hold the hero's parts back so they never flash */
.motion:not(.motion-ready) .hero [data-enter],
.motion:not(.motion-ready) .hero-name .ch { opacity: 0; }

/* Cross-document view transitions: the story headline and plate travel to the project page */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-group(*) { animation-duration: 560ms; animation-timing-function: cubic-bezier(0.77, 0, 0.175, 1); }
  ::view-transition-old(root) { animation: 240ms ease both vt-fade-out; }
  ::view-transition-new(root) { animation: 420ms 140ms cubic-bezier(0.23, 1, 0.32, 1) both vt-rise-in; }
}
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-rise-in { from { opacity: 0; transform: translateY(24px); } }

/* The ink roller lifted off each homepage code plate as it scrolls in */
.plate-roller { position: absolute; inset: 0; background: var(--ink); pointer-events: none; }
.plate { transition: border-color var(--dur) ease; }
@media (hover: hover) and (pointer: fine) {
  .story:hover .plate { border-top-color: var(--cobalt); }
  .story:hover .ln.is-key::after { transform: scaleX(1); }
}

/* Without motion, each plate shows its key line marked from the start */
html:not(.motion) .ln.is-key::after { transform: scaleX(1); transition: none; }
