/* Motion on top of site.css. All of it switches off for people who ask for reduced motion. */

/* clip, not hidden: the glow reaches past the edges, and hidden would break the sticky header. */
html,
body {
  overflow-x: clip;
}

/* Header sticks, and turns to glass once the page scrolls. */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid transparent;
  transition:
    background 0.3s,
    border-color 0.3s;
}
.bar.scrolled {
  background: hsl(222.2 84% 4.9% / 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
}
.block {
  scroll-margin-top: 88px;
}

/* Hero: drifting glow, staggered entrance, a tilted screenshot that flattens as you scroll. */
.hero {
  position: relative;
  max-width: none;
}
.hero > :not(.glow, .stage) {
  max-width: 820px;
  position: relative;
}
.glow {
  position: absolute;
  inset: -160px -30vw auto;
  height: 900px;
  z-index: -1;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.55;
}
.glow span {
  position: absolute;
  border-radius: 50%;
  animation: drift 18s ease-in-out infinite alternate;
}
.glow span:nth-child(1) {
  width: 520px;
  height: 520px;
  left: 30%;
  top: 40px;
  background: hsl(173 100% 35% / 0.55);
}
.glow span:nth-child(2) {
  width: 420px;
  height: 420px;
  left: 55%;
  top: 180px;
  background: hsl(199 89% 48% / 0.35);
  animation-duration: 22s;
  animation-delay: -6s;
}
.glow span:nth-child(3) {
  width: 360px;
  height: 360px;
  left: 15%;
  top: 320px;
  background: hsl(262 83% 58% / 0.25);
  animation-duration: 26s;
  animation-delay: -12s;
}
@keyframes drift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(60px, -40px) scale(1.12);
  }
  100% {
    transform: translate(-50px, 30px) scale(0.95);
  }
}

.pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--primary);
  vertical-align: 2px;
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 hsl(173 100% 35% / 0.6);
  }
  70%,
  100% {
    box-shadow: 0 0 0 10px hsl(173 100% 35% / 0);
  }
}

.hero .eyebrow,
.hero h1,
.hero .lead,
.hero .cta,
.hero .stage {
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero h1 {
  animation-delay: 0.08s;
}
.hero .lead {
  animation-delay: 0.18s;
}
.hero .cta {
  animation-delay: 0.28s;
}
.hero .stage {
  animation-delay: 0.4s;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
}

.hero h1 .accent {
  background: linear-gradient(90deg, var(--primary), hsl(199 89% 60%), var(--primary));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 6s linear infinite;
}
@keyframes sheen {
  to {
    background-position: 200% center;
  }
}

/* biome-ignore lint/style/noDescendingSpecificity: .hero .cta above only sets the entrance animation */
.cta {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.ghost {
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid hsl(173 100% 35% / 0.6);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition:
    background 0.2s,
    transform 0.2s;
}
.ghost:hover {
  background: var(--primary-soft);
  transform: translateY(-1px);
}
.ghost.quiet {
  border-color: var(--border);
  color: var(--muted);
}
.ghost:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

/* biome-ignore lint/style/noDescendingSpecificity: .hero .stage above only sets the entrance animation */
.stage {
  margin-top: 56px;
  perspective: 1600px;
}
.hero-shot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow:
    0 40px 120px hsl(173 100% 35% / 0.18),
    0 30px 60px rgb(0 0 0 / 0.5);
  transform-origin: 50% 0;
  transform: rotateX(calc(18deg * (1 - var(--flat, 0)))) scale(calc(0.94 + 0.06 * var(--flat, 0)));
  will-change: transform;
}

/* Works-with strip: an endless slow scroll, faded at both edges. */
.strip {
  overflow: hidden;
  padding: 8px 0 72px;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.track {
  display: flex;
  width: max-content;
  gap: 12px;
  animation: slide 40s linear infinite;
}
.track span {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
  font-size: 15px;
}
@keyframes slide {
  to {
    transform: translateX(calc(-50% - 6px));
  }
}

/* Reveal on scroll, only with script: the inline script in index.html sets .js before paint. */
.js .reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--delay, 0s);
}
.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* Feature cards: a spotlight that follows the cursor. */
.group {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.3s,
    border-color 0.3s;
}
.group::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    360px circle at var(--x, 50%) var(--y, 50%),
    hsl(173 100% 35% / 0.14),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.group:hover {
  transform: translateY(-3px);
  border-color: hsl(173 100% 35% / 0.45);
}
.group:hover::before {
  opacity: 1;
}

/* Download button: a shine that passes now and then. */
.download {
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px hsl(173 100% 35% / 0.35);
}
.download::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgb(255 255 255 / 0.35) 50%,
    transparent 70%
  );
  transform: translateX(-120%);
  animation: shine 3.6s ease-in-out infinite;
}
@keyframes shine {
  60%,
  100% {
    transform: translateX(120%);
  }
}

.code {
  box-shadow: 0 30px 80px hsl(262 83% 58% / 0.08);
}

@media (max-width: 760px) {
  .stage {
    margin-top: 40px;
  }
  .glow {
    opacity: 0.4;
  }
}

/* The AI board story, page wide: a tall section whose pinned window shows the ad, the scroll
   position picking its frame. The edges fade into the page, which has the ad's own navy. */
.scrolly {
  height: 700vh;
  position: relative;
  /* Out of main's centred column to the full window width. */
  width: 100vw;
  margin-left: calc(50% - 50vw);
}
.pin {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.screen {
  position: absolute;
  inset: 0;
  opacity: var(--in, 0);
  transform: scale(calc(0.92 + 0.08 * var(--grow, 0)));
  mask-image:
    linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent),
    linear-gradient(transparent, #000 9%, #000 88%, transparent);
  mask-composite: intersect;
  -webkit-mask-image:
    linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent),
    linear-gradient(transparent, #000 9%, #000 88%, transparent);
  -webkit-mask-composite: source-in;
}
/* The composition is 1920 by 1080, centred under the header; story.js sets --scale and --cy. */
.screen iframe {
  position: absolute;
  left: 50%;
  top: var(--cy, 50%);
  width: 1920px;
  height: 1080px;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%) scale(var(--scale, 0.5));
  pointer-events: none;
}
.rail {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, calc(24px * (1 - var(--in, 0))));
  opacity: var(--in, 0);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 12px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: hsl(222.2 84% 4.9% / 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  width: max-content;
  max-width: calc(100vw - 32px);
}
.chapters {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.chapters button {
  font: inherit;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    background 0.25s,
    color 0.25s,
    border-color 0.25s;
}
.chapters button:hover {
  color: var(--text);
}
.chapters button[aria-current="step"] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-text);
}
.chapters button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
.meter {
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), hsl(199 89% 60%));
  transform-origin: left;
  transform: scaleX(var(--story, 0));
}

@media (max-width: 760px) {
  .scrolly {
    height: 560vh;
  }
  .chapters button {
    font-size: 13px;
    padding: 5px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    /* biome-ignore lint/complexity/noImportantStyles: reduced motion must beat every animation on the page */
    animation: none !important;
    /* biome-ignore lint/complexity/noImportantStyles: same */
    transition: none !important;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
  }
  .hero-shot {
    transform: none;
  }
}
