/* ZEVNIK motion layer (Checkpoint 3C). Native CSS inspired by React Bits effects (Split Text, Animated Content,
   Spotlight Card, Shiny Text). No React, no library. Everything here is decoration: remove this file and motion.js
   (or set ZEVNIK_MOTION=0) and the site looks and works like Checkpoint 3B.
   Rules: only transform and opacity are animated (no layout shift); the main hero text never starts invisible
   (it only glides, so the page's main content is painted at once); nothing below the fold is hidden unless
   motion.js is running; every movement sits inside "prefers-reduced-motion: no-preference". */

@media (prefers-reduced-motion: no-preference) {
  /* Smooth cross-fade between pages (finder steps, application pages) in browsers that support it. */
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }

  @keyframes zv-glide { from { transform: translateY(10px); } to { transform: none; } }
  @keyframes zv-word { from { opacity: 0; transform: translateY(.7em); } to { opacity: 1; transform: none; } }
  @keyframes zv-settle { from { transform: scale(1.035); } to { transform: none; } }
  @keyframes zv-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
  @keyframes zv-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes zv-sheen { from { background-position: 180% 0; } to { background-position: -80% 0; } }
  @keyframes zv-pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }

  /* A. Hero: Split Text-style reveal of the tagline, word by word. The words are real HTML text in the page. */
  .hero .eyebrow .sw { display: inline-block; animation: zv-word .5s cubic-bezier(.2,.7,.2,1) both; }
  .hero .eyebrow .sw:nth-child(1) { animation-delay: .05s; } .hero .eyebrow .sw:nth-child(2) { animation-delay: .11s; }
  .hero .eyebrow .sw:nth-child(3) { animation-delay: .17s; } .hero .eyebrow .sw:nth-child(4) { animation-delay: .29s; }
  .hero .eyebrow .sw:nth-child(5) { animation-delay: .35s; } .hero .eyebrow .sw:nth-child(6) { animation-delay: .41s; }
  .hero .eyebrow .sw:nth-child(n+7) { animation-delay: .47s; }
  /* Headline, intro and buttons are visible from the first paint and only glide into place. */
  .hero h1 { animation: zv-glide .6s cubic-bezier(.2,.7,.2,1) both; }
  .hero p.lead { animation: zv-glide .6s .06s cubic-bezier(.2,.7,.2,1) both; }
  .hero .cta { animation: zv-glide .6s .12s cubic-bezier(.2,.7,.2,1) both; }
  .heroimg img, .apphead .appimg img { animation: zv-settle 1.1s cubic-bezier(.2,.7,.2,1) both; }

  /* B/C. Scroll reveal ("Animated Content"). motion.js adds .rv ONLY to items that start below the screen. */
  .motion .rv { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--d, 0) * 70ms); }
  .motion .rv.in { opacity: 1; transform: none; }

  /* Card hovers */
  .tile img { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
  .tile:hover img, .tile:focus-visible img { transform: scale(1.045); }
  .tile span i { transition: transform .25s ease; }
  .tile:hover span i, .tile:focus-visible span i { transform: translateX(4px); }
  .prod, .cand, .concept { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
  .prod:hover, .prod:focus-within, .cand:not(.draft):hover, a.concept:hover, a.concept:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(10,26,60,.12); border-color: var(--gold); }
  .prod img, .cand .ph img { transition: transform .35s ease; }
  .prod:hover img, .cand:not(.draft):hover .ph img { transform: scale(1.04); }
  .btn { transition: transform .12s ease, background-color .2s ease, border-color .2s ease; }
  .btn:active { transform: scale(.97); }

  /* D. Finder: the new step's panel rises in, the current step pill pops, choices respond to the touch. */
  #finder .panel, .narrowpage form.panel { animation: zv-rise .4s cubic-bezier(.2,.7,.2,1) both; }
  .steps li.on { animation: zv-pop .45s .1s both; }
  .opt { transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .12s ease; }
  .opt:active { transform: scale(.985); }
  .opt:has(input:checked) b::after, .opt.sel b::after { animation: zv-pop .3s both; }
  .cand .tag.match { background-image: linear-gradient(110deg, transparent 40%, rgba(201,162,74,.45) 50%, transparent 60%); background-size: 250% 100%; animation: zv-sheen 1.4s .5s 1 both; }

  /* E. Company and laboratory pages: one quiet gold sheen across the "Illustrative Concept" badge (the badge itself never moves or hides). */
  .badge { background-image: linear-gradient(110deg, transparent 35%, rgba(201,162,74,.55) 50%, transparent 65%); background-size: 250% 100%; animation: zv-sheen 1.6s .6s 1 both; }
  .motion .head h2.rv.in::after, .narrowpage > h1::after { animation: zv-grow .6s .15s cubic-bezier(.2,.7,.2,1) both; }
}

/* Static decoration (no movement): gold rule, selected tick, finder progress line, pointer spotlight. */
.head h2::after, .narrowpage > h1::after { content: ""; display: block; width: 56px; height: 3px; margin-top: 8px; border-radius: 2px; background: var(--gold); transform-origin: left; }
.opt:has(input:checked) b::after, .opt.sel b::after { content: "✓"; display: inline-block; margin-left: 8px; color: var(--ok); font-weight: 700; }
.steps { position: relative; padding-bottom: 8px; }
.steps::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--gold) var(--p, 20%), var(--line) var(--p, 20%)); }
.steps[data-step="2"] { --p: 40%; } .steps[data-step="3"] { --p: 60%; } .steps[data-step="4"] { --p: 80%; } .steps[data-step="5"] { --p: 100%; }
.motion .how li, .motion .flow div, .motion .prod { background-image: radial-gradient(220px circle at var(--mx, -300px) var(--my, -300px), rgba(201,162,74,.16), transparent 70%); }

/* Printing always shows everything. */
@media print { .motion .rv { opacity: 1 !important; transform: none !important; } }
