/* Motion layer (Animations note + animate skill). Only transform, opacity and clip-path move.
   Runs on every device at Marti's instruction (2026-10-11), like the Beauty Room reviews strip: when the
   device asks for reduced motion the distances and the zoom shrink and the timing stays the same.
   Reveal states only apply once js/motion.js has added .js-motion, so without JavaScript nothing is hidden. */
:root { --rise: 22px; --rise-title: .5em; --device-rise: 48px; }
@media (prefers-reduced-motion: reduce) { :root { --rise: 8px; --rise-title: .2em; --device-rise: 16px; } }

/* Scroll reveals: rise and fade, 70 ms stagger inside groups */
.js-motion [data-reveal] { opacity: 0; transform: translateY(var(--rise)); transition: opacity 640ms var(--ease-out), transform 820ms var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.js-motion [data-reveal].is-in { opacity: 1; transform: none; }

/* Section titles wipe up out of a slot */
.js-motion h2[data-reveal] { opacity: 1; clip-path: inset(100% -0.5em -0.3em -0.5em); transform: translateY(var(--rise-title)); transition: clip-path 950ms var(--ease-out), transform 950ms var(--ease-out); }
.js-motion h2[data-reveal].is-in { clip-path: inset(-0.3em -0.5em -0.3em -0.5em); transform: none; }

/* Hero: the opening copy arrives in sequence on load; the hint bobs until the story starts */
.hero__intro > * { animation: hero-in 900ms var(--ease-out) both; }
.hero__intro > :nth-child(2) { animation-delay: 140ms; }
.hero__intro > :nth-child(3) { animation-delay: 280ms; }
.hero__intro > :nth-child(4) { animation-delay: 700ms; }
@keyframes hero-in { from { opacity: 0; transform: translateY(calc(var(--rise) * 1.6)); } }
.hero__hint i { display: inline-block; animation: hint-bob 1.8s var(--ease-in-out) infinite; }
@keyframes hint-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(calc(var(--rise) * .3)); } }

/* The viewing photo: once it has arrived, the Mirv0 notification card pops onto it */
.js-motion .when__photo[data-reveal] .when__notice { opacity: 0; transform: translateY(14px) scale(.96); }
.js-motion .when__photo .when__notice { transition: opacity 500ms var(--ease-out) 650ms, transform 600ms var(--ease-out) 650ms; }
.js-motion .when__photo.is-in .when__notice { opacity: 1; transform: none; }

/* Onboarding steps: the connector line draws across, behind the numbers */
.steps__list { position: relative; }
.steps__list::before { content: ""; position: absolute; left: 22px; right: 10%; top: 25px; height: 2px; background: var(--line); transform-origin: left center; transition: transform 1400ms var(--ease-in-out) 250ms; }
.js-motion .steps__list:not(.is-in)::before { transform: scaleX(0); }
@media (max-width: 900px) { .steps__list::before { display: none; } }

/* Web process: each connector draws down to the next number, one after another */
.webs__steps li:not(:last-child)::after { content: ""; position: absolute; left: 18px; top: 38px; bottom: -6px; width: 2px; background: var(--line); transform-origin: top center; transition: transform 500ms var(--ease-in-out); }
.webs__steps li:nth-child(1)::after { transition-delay: 450ms; }
.webs__steps li:nth-child(2)::after { transition-delay: 850ms; }
.webs__steps li:nth-child(3)::after { transition-delay: 1250ms; }
.js-motion .webs__steps:not(.is-in) li::after { transform: scaleY(0); }

/* Example sites: the laptop rises, the phone follows from the side */
.js-motion .devices .laptop { opacity: 0; transform: translateY(var(--device-rise)) scale(.985); transition: opacity 700ms var(--ease-out), transform 1000ms var(--ease-out); }
.js-motion .devices .handset { opacity: 0; transform: translate(calc(var(--device-rise) * .6), var(--device-rise)); transition: opacity 700ms var(--ease-out) 200ms, transform 1000ms var(--ease-out) 200ms; }
.js-motion .devices.is-shown .laptop, .js-motion .devices.is-shown .handset { opacity: 1; transform: none; }
.devices.is-swap .laptop { animation: laptop-in 800ms var(--ease-out) both; }
.devices.is-swap .handset { animation: handset-in 800ms var(--ease-out) 150ms both; }
@keyframes laptop-in { from { opacity: 0; transform: translateY(calc(var(--device-rise) * .6)); } }
@keyframes handset-in { from { opacity: 0; transform: translate(calc(var(--device-rise) * .5), calc(var(--device-rise) * .6)); } }

/* Closing: the zero draws itself, then the dot lands */
.closing__zero ellipse { stroke-dasharray: 100; }
.js-motion [data-closing] .closing__zero ellipse { stroke-dashoffset: 100; transition: stroke-dashoffset 1500ms var(--ease-in-out); }
.js-motion [data-closing].is-in .closing__zero ellipse { stroke-dashoffset: 0; }
.js-motion [data-closing] .closing__zero circle { transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform 520ms var(--ease-out) 1200ms; }
.js-motion [data-closing].is-in .closing__zero circle { transform: none; }

/* Portal digest rows arrive one after another */
.digest:not(.is-entering) .digest__list li { animation: row-in 500ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms + 120ms); }
@keyframes row-in { from { opacity: 0; transform: translateY(calc(var(--rise) * .4)); } }

/* The eye in the logo: drops in and bounces on load, glances and blinks every 7 s, hops on hover.
   The pupil follows a mouse through js/logo.js (it moves .logo-eye__look). */
.logo-eye__ring, .logo-eye__pupil, .logo-eye { transform-box: fill-box; transform-origin: center; }
.logo-eye__look { transition: transform 220ms var(--ease-out); }
.logo-eye__ring { animation: eye-blink 7s 3s infinite; }
.logo-eye__pupil { animation: eye-idle 7s 3s infinite; }
.logo-svg.is-landing .logo-eye__pupil { animation: eye-land 1300ms 250ms both, eye-idle 7s 3s infinite; }
.logo-svg.is-following .logo-eye__pupil { animation: none; }
.logo-svg.is-hop .logo-eye { animation: eye-hop 560ms; }
@keyframes eye-land {
  0% { transform: translateY(-90px); opacity: 0; animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  8% { opacity: 1; }
  40% { transform: translateY(0); animation-timing-function: cubic-bezier(0, 0.55, 0.45, 1); }
  58% { transform: translateY(-22px); animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  74% { transform: translateY(0) scale(1.08, .9); animation-timing-function: cubic-bezier(0, 0.55, 0.45, 1); }
  86% { transform: translateY(-7px); animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  100% { transform: none; }
}
@keyframes eye-idle {
  0%, 58% { transform: none; }
  63%, 72% { transform: translate(-7px, -4px); }
  77%, 85% { transform: translate(7px, -4px); }
  90% { transform: none; }
  94% { transform: scaleY(1); } 95.5% { transform: scaleY(.15); } 97.5%, 100% { transform: none; }
}
@keyframes eye-blink { 0%, 94% { transform: none; } 95.5% { transform: scaleY(.12); } 97.5%, 100% { transform: none; } }
@keyframes eye-hop {
  0% { transform: none; animation-timing-function: cubic-bezier(0, 0.55, 0.45, 1); }
  35% { transform: translateY(-16px); animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  70% { transform: translateY(0) scale(1.06, .94); }
  100% { transform: none; }
}

/* Hover: only for a real mouse (touch fires false hovers on tap) */
.pillar__media img { transition: transform 900ms var(--ease-out); }
.plan { transition: transform 260ms var(--ease-out), box-shadow 260ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .pillar:hover .pillar__media img { transform: scale(1.035); }
  .plan:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
  .features li:hover i { transform: translateY(-3px); }
}
.features i { display: inline-block; transition: transform 220ms var(--ease-out); }
