/* Nura — motion styles. Each block belongs to one effect and one script in /js.
   Every block only applies once its script has added a class, so removing the
   script removes the effect and leaves the static layout untouched. */

/* ---------- Effect 1: nav pill (js/nav.js) ---------- */
.nav.is-fixed { position: fixed; }
.nav.is-fixed .nav__pill {
  transition: background-color 0.2s ease-out, border-color 0.2s ease-out, box-shadow 0.2s ease-out, -webkit-backdrop-filter 0.2s ease-out, backdrop-filter 0.2s ease-out;
}
.nav.is-scrolled .nav__pill {
  background: var(--nav-pill-bg); border-color: var(--nav-pill-border);
  -webkit-backdrop-filter: blur(var(--nav-pill-blur)); backdrop-filter: blur(var(--nav-pill-blur));
  box-shadow: var(--nav-pill-shadow);
}

/* ---------- Effect 2: hero light (js/hero-light.js), replaces the particles ---------- */
.hero__light { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

/* ---------- Effect 3: rotating word (js/rotating-word.js) ---------- */
.rotating-word.is-rotating { transition: opacity 0.3s ease-out, transform 0.3s ease-out; }
.rotating-word.is-leaving { opacity: 0; transform: translateY(-0.18em); }
.rotating-word.is-entering { opacity: 0; transform: translateY(0.18em); transition: none; }

/* ---------- Effect 4: video transition (js/video-transition.js) ---------- */
.walkthrough-video.has-video-transition { padding-bottom: calc(var(--section-pad) / 2); }
/* Caption sits close under the full-width frame: cancels the empty band below the frame in the 100vh stage */
.has-video-transition .walkthrough-video__caption { margin-top: calc((min(56.25vw, 100vh) - 100vh) / 2 + var(--space-4)); }
.has-video-transition .walkthrough-video__scroll { height: 220vh; }
.has-video-transition .walkthrough-video__stage {
  position: sticky; top: 0; height: 100vh;
  display: grid; place-items: center;
  max-width: none; padding: 0; overflow: clip;
}
.has-video-transition .walkthrough-video__frame {
  width: 100vw; height: min(56.25vw, 100vh); aspect-ratio: auto;
  transform-origin: center center; will-change: transform;
}
/* The frame rises under the hero */
.walkthrough-video.has-video-transition {
  margin-top: -30vh;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0) 30vh, var(--page) 30vh);
}

/* ---------- Effect 5: software band (js/software-band.js) ---------- */
.software-band__viewport.is-moving {
  overflow: hidden; padding-block: 12px;   /* room for the wave */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, var(--ink) 10%, var(--ink) 90%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, var(--ink) 10%, var(--ink) 90%, transparent 100%);
}
.is-moving .software-band__track {
  flex-wrap: nowrap; justify-content: flex-start; gap: 0; padding: 0;
  width: max-content;
  animation: software-band-slide var(--band-duration, 40s) linear infinite;
}
.is-moving .software-band__group { display: flex; gap: var(--space-2); padding-right: var(--space-2); }
.is-moving .software-band__item { will-change: transform; }
.is-moving:hover .software-band__track { animation-play-state: paused; }
@keyframes software-band-slide { to { transform: translateX(-50%); } }

/* ---------- Effect 6: fade-in (js/fade-in.js) ---------- */
.fade-ready { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.fade-ready.is-in { opacity: 1; transform: none; }

/* ---------- Effect 7: scroll gradient (js/scroll-gradient.js) ---------- */
.has-scroll-gradient .dawn { display: block; position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.has-scroll-gradient .dawn__base { position: absolute; inset: 0; background: var(--ink); }
.has-scroll-gradient .dawn__hues {
  /* Taller than the screen so its edges never show while it drifts; every light fades to 0
     well inside the layer (eased stops, no hard rim), and a blur removes any remaining seams. */
  position: absolute; left: -10%; right: -10%; top: -50%; height: 200%;
  opacity: 0; will-change: transform, opacity;
  filter: blur(40px);
  /* The 8 star hues at full strength, in star order, as wide overlapping lights */
  background:
    radial-gradient(ellipse 26% 46% at 6% 54%, rgba(255, 90, 95, 0.85) 0%, rgba(255, 90, 95, 0.62) 22%, rgba(255, 90, 95, 0.36) 45%, rgba(255, 90, 95, 0.16) 65%, rgba(255, 90, 95, 0.05) 82%, rgba(255, 90, 95, 0) 100%),
    radial-gradient(ellipse 26% 46% at 19% 47%, rgba(255, 138, 61, 0.85) 0%, rgba(255, 138, 61, 0.62) 22%, rgba(255, 138, 61, 0.36) 45%, rgba(255, 138, 61, 0.16) 65%, rgba(255, 138, 61, 0.05) 82%, rgba(255, 138, 61, 0) 100%),
    radial-gradient(ellipse 26% 46% at 32% 53%, rgba(255, 194, 61, 0.85) 0%, rgba(255, 194, 61, 0.62) 22%, rgba(255, 194, 61, 0.36) 45%, rgba(255, 194, 61, 0.16) 65%, rgba(255, 194, 61, 0.05) 82%, rgba(255, 194, 61, 0) 100%),
    radial-gradient(ellipse 26% 46% at 44% 46%, rgba(76, 217, 138, 0.85) 0%, rgba(76, 217, 138, 0.62) 22%, rgba(76, 217, 138, 0.36) 45%, rgba(76, 217, 138, 0.16) 65%, rgba(76, 217, 138, 0.05) 82%, rgba(76, 217, 138, 0) 100%),
    radial-gradient(ellipse 26% 46% at 56% 54%, rgba(46, 196, 196, 0.85) 0%, rgba(46, 196, 196, 0.62) 22%, rgba(46, 196, 196, 0.36) 45%, rgba(46, 196, 196, 0.16) 65%, rgba(46, 196, 196, 0.05) 82%, rgba(46, 196, 196, 0) 100%),
    radial-gradient(ellipse 26% 46% at 68% 47%, rgba(56, 182, 255, 0.85) 0%, rgba(56, 182, 255, 0.62) 22%, rgba(56, 182, 255, 0.36) 45%, rgba(56, 182, 255, 0.16) 65%, rgba(56, 182, 255, 0.05) 82%, rgba(56, 182, 255, 0) 100%),
    radial-gradient(ellipse 26% 46% at 81% 53%, rgba(123, 97, 255, 0.85) 0%, rgba(123, 97, 255, 0.62) 22%, rgba(123, 97, 255, 0.36) 45%, rgba(123, 97, 255, 0.16) 65%, rgba(123, 97, 255, 0.05) 82%, rgba(123, 97, 255, 0) 100%),
    radial-gradient(ellipse 26% 46% at 94% 47%, rgba(212, 92, 255, 0.85) 0%, rgba(212, 92, 255, 0.62) 22%, rgba(212, 92, 255, 0.36) 45%, rgba(212, 92, 255, 0.16) 65%, rgba(212, 92, 255, 0.05) 82%, rgba(212, 92, 255, 0) 100%);
}
/* Fine grain over the backdrop: dithers the 8-bit steps that show as bands in dark gradients */
.has-scroll-gradient .dawn::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.has-scroll-gradient .manifesto__stage,
.has-scroll-gradient .manifesto__turn { background: none; }
.has-scroll-gradient .manifesto__stage,
.has-scroll-gradient .manifesto__stage[data-tone="light"] { color: var(--manifesto-text, var(--page)); transition: color 0.3s ease-out; }
.has-scroll-gradient .footer { background: var(--page); }

/* ---------- Effect 8: spectrum flash on buttons (CSS only) ---------- */
/* A blurred band of the spectrum line sweeps left to right; about 0.45s in, the button swaps
   to the opposite colour (the swap itself is in site.css). Hover and keyboard focus. */
@media (prefers-reduced-motion: no-preference) {
  .btn::before {
    content: ""; position: absolute; z-index: -1; top: -30%; bottom: -30%; left: 0;
    width: var(--flash-band-width);
    background: var(--spectrum-line);
    filter: blur(var(--flash-band-blur));
    opacity: 0; transform: translateX(-115%); pointer-events: none;
  }
  .btn:hover::before, .btn:focus-visible::before {
    animation: spectrum-flash var(--flash-duration) var(--flash-ease) both;
  }
  .btn:hover, .btn:focus-visible { transition-delay: var(--flash-swap-delay); }
}
@keyframes spectrum-flash {
  0%   { opacity: var(--flash-band-opacity); transform: translateX(-115%); }
  99%  { opacity: var(--flash-band-opacity); transform: translateX(182%); }
  100% { opacity: 0; transform: translateX(182%); }
}

/* ---------- Reduced motion: everything above is off ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-ready { opacity: 1; transform: none; transition: none; }
  .is-moving .software-band__track { animation: none; }
  .rotating-word.is-rotating { transition: none; }
}
