/* Motion graphics for the marketing pages. Everything here is disabled under prefers-reduced-motion. */

/* ---------- Shimmer sweep on badges and primary buttons ---------- */
.shimmer { position: relative; overflow: hidden; isolation: isolate; }
.shimmer::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / 0.55) 50%, transparent 70%);
  transform: translateX(-120%); animation: shimmer 4.2s ease-in-out infinite;
}
.btn.primary.shimmer::after, .plan .tag.shimmer::after { background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / 0.28) 50%, transparent 70%); z-index: 0; }
@keyframes shimmer { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }

/* ---------- Drifting glow orbs ---------- */
.glow { animation: drift 22s ease-in-out infinite alternate; }
.glow.lilac { animation-duration: 26s; animation-direction: alternate-reverse; }
.glow.mint { animation-duration: 30s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 30px) scale(1.12); }
  100% { transform: translate(-40px, 50px) scale(0.95); }
}

/* ---------- Headline: words rise in ---------- */
.rise-words .w { display: inline-block; opacity: 0; transform: translateY(0.45em); filter: blur(6px); animation: word-rise 0.8s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: calc(var(--i) * 70ms + 120ms); }
@keyframes word-rise { to { opacity: 1; transform: none; filter: none; } }
.fade-up { opacity: 0; transform: translateY(14px); animation: fade-up 0.8s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: var(--d, 0.5s); }
@keyframes fade-up { to { opacity: 1; transform: none; } }

/* ---------- Hero stage: tilt-in on scroll + floating notifications ---------- */
.hero-stage { position: relative; width: min(1040px, 100%); perspective: 1400px; margin-top: 28px; }
.hero-stage .mock-browser { margin-top: 0; transform-origin: 50% 0; transform: rotateX(var(--tilt, 14deg)) scale(var(--scale, 0.94)); transition: transform 0.1s linear; will-change: transform; }
.float-note {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px 10px 10px;
  box-shadow: 0 18px 40px -16px rgb(40 30 20 / 0.35); font-size: 13px; max-width: 260px;
  opacity: 0; transform: translateY(12px) scale(0.96); transition: opacity 0.5s, transform 0.5s cubic-bezier(.2,.8,.2,1);
}
.float-note.show { opacity: 1; transform: none; }
.float-note b { display: block; font-size: 13px; }
.float-note span { color: var(--ink-3); }
.float-note .avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; position: relative; overflow: hidden; }
.float-note.n1 { left: -28px; top: 34%; }
.float-note.n2 { right: -24px; top: 12%; }
.float-note.n3 { right: 6%; bottom: -22px; }
@media (max-width: 760px) {
  .float-note { max-width: 210px; font-size: 12px; }
  .float-note.n1 { left: 6px; top: auto; bottom: -26px; }
  .float-note.n2 { right: 6px; top: -18px; }
  .float-note.n3 { display: none; }
}

/* Live sheen moving across the hero mock grid */
.mock-grid { position: relative; }
.mock-grid::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: 8px;
  background: linear-gradient(100deg, transparent 35%, rgb(255 255 255 / 0.22) 50%, transparent 65%); background-size: 250% 100%;
  animation: sheen 5s ease-in-out infinite; }
@keyframes sheen { 0% { background-position: 120% 0; } 60%, 100% { background-position: -40% 0; } }

/* ---------- Film reel: photos streaming past ---------- */
.reel { padding: 64px 0 8px; display: grid; gap: 14px; overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.reel-row { display: flex; gap: 14px; width: max-content; animation: reel 70s linear infinite; }
.reel-row.reverse { animation-direction: reverse; animation-duration: 84s; }
.reel:hover .reel-row { animation-play-state: paused; }
@keyframes reel { to { transform: translateX(-50%); } }
.reel-card { position: relative; width: 190px; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; flex: none; }
.reel-card.wide { width: 260px; }
.reel-card::before { content: ''; position: absolute; inset: 50% 0 0; background: linear-gradient(transparent, rgb(0 0 0 / 0.55)); }
.reel-card figcaption { position: absolute; left: 10px; bottom: 10px; right: 10px; display: flex; justify-content: space-between; gap: 6px;
  color: #fff; font-size: 12px; font-weight: 600; text-shadow: 0 1px 4px rgb(0 0 0 / 0.4); }
.reel-card figcaption span { opacity: 0.8; font-variant-numeric: tabular-nums; }
.reel-card .face-tag { position: absolute; top: 18%; left: 32%; width: 34%; aspect-ratio: 1; border: 2px solid #fff; border-radius: 10px; opacity: 0;
  animation: face-tag 6s ease-in-out infinite; animation-delay: var(--fd, 0s); box-shadow: 0 0 0 9999px rgb(0 0 0 / 0); }
@keyframes face-tag { 0%, 40% { opacity: 0; transform: scale(1.3); } 50%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ---------- Text ticker of moments ---------- */
.ticker { overflow: hidden; padding: 18px 0; border-block: 1px solid var(--line); background: var(--surface);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.ticker-track { display: flex; gap: 40px; width: max-content; animation: reel 60s linear infinite; font-family: var(--font-display); font-size: 26px; color: var(--ink-2); white-space: nowrap; }
.ticker-track.reverse { animation-direction: reverse; animation-duration: 72s; }
.ticker-track span::after { content: '✦'; margin-left: 40px; font-size: 14px; color: var(--accent); vertical-align: middle; }
.ticker + .ticker { border-top: 0; }

/* ---------- Floating "replaces" chips ---------- */
.replaces span { animation: bob 3.6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -0.7s); }
@keyframes bob { 50% { transform: translateY(-6px); } }

/* ---------- Pipeline: shutter to guest ---------- */
.pipeline { padding: 96px 0; }
.pipe { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.pipe-track { position: absolute; left: 12.5%; right: 12.5%; top: 27px; height: 2px; background: var(--line); border-radius: 2px; }
.pipe-track i { position: absolute; inset: 0 auto 0 0; width: var(--progress, 0%); background: var(--accent); border-radius: 2px; transition: width 0.4s linear; }
.pipe-track b { position: absolute; top: 50%; left: var(--progress, 0%); width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent); transition: left 0.4s linear; }
.pipe-step { position: relative; display: grid; justify-items: center; gap: 10px; text-align: center; }
.pipe-step .pipe-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); color: var(--ink-3); transition: all 0.35s; z-index: 1; }
.pipe-step .pipe-icon svg { width: 24px; height: 24px; }
.pipe-step b { font-size: 15px; }
.pipe-step small { color: var(--ink-3); font-size: 13px; max-width: 200px; }
.pipe-step.active .pipe-icon, .pipe-step.done .pipe-icon { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pipe-step.active .pipe-icon { animation: pulse-ring 1.4s ease-out infinite; }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }

.pipe-stage { display: grid; grid-template-columns: minmax(0, 480px) 1fr; gap: 20px; align-items: stretch; justify-content: center; }
/* Same aspect as img-haldi.jpg so the face boxes (in %) land on the real faces */
.scan-card { position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: 928 / 1152; border: 1px solid var(--line); }
.scan-card > .ph { position: absolute; inset: 0; }
.scan-card .faces { position: absolute; inset: 0; }
.scan-card .fbox { position: absolute; border: 2px solid #fff; border-radius: 6px; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.25), 0 0 18px rgb(255 255 255 / 0.4);
  opacity: 0; transform: scale(1.5); transition: opacity 0.3s, transform 0.45s cubic-bezier(.2,.8,.2,1); }
.scan-card.found .fbox { opacity: 1; transform: none; }
.scan-card.found .fbox:nth-child(2) { transition-delay: 0.12s; }
.scan-card.found .fbox:nth-child(3) { transition-delay: 0.24s; }
.scan-card.found .fbox:nth-child(4) { transition-delay: 0.36s; }
.scan-card.found .fbox:nth-child(5) { transition-delay: 0.48s; }
.scan-card.found .fbox:nth-child(6) { transition-delay: 0.6s; }
.scan-line { position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: #fff; box-shadow: 0 0 24px 6px rgb(255 255 255 / 0.55); opacity: 0; }
.scan-card.scanning .scan-line { animation: scan 1.3s ease-in-out forwards; }
@keyframes scan { 0% { left: 0; opacity: 1; } 90% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
.scan-hud { position: absolute; left: 16px; top: 16px; right: 16px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hud-pill { display: inline-flex; align-items: center; gap: 8px; background: rgb(0 0 0 / 0.55); color: #fff; backdrop-filter: blur(6px); padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.hud-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: #ff5a5f; animation: pulse 1.4s infinite; }
.hud-timer { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.upload-bar { position: absolute; left: 16px; right: 16px; bottom: 16px; height: 6px; border-radius: 999px; background: rgb(255 255 255 / 0.3); overflow: hidden; }
.upload-bar i { display: block; height: 100%; width: var(--up, 0%); background: #fff; transition: width 0.3s linear; }

.phone-card { border-radius: 22px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.mini-phone { width: 200px; border-radius: 28px; padding: 8px; background: #15120e; }
.mini-phone .screen { border-radius: 21px; background: #faf7f2; color: #1a1712; min-height: 320px; padding: 14px 10px; display: grid; gap: 8px; align-content: start; position: relative; overflow: hidden; }
.mini-phone .lock-time { text-align: center; font-size: 34px; font-weight: 600; letter-spacing: -0.02em; margin: 8px 0 2px; }
.mini-phone .lock-date { text-align: center; font-size: 11px; color: #5c554b; margin-bottom: 8px; }
.notif { display: flex; gap: 8px; align-items: center; background: #fff; border-radius: 14px; padding: 8px; box-shadow: 0 6px 18px -8px rgb(0 0 0 / 0.3); font-size: 11px;
  opacity: 0; transform: translateY(-16px) scale(0.96); transition: opacity 0.45s, transform 0.5s cubic-bezier(.2,.8,.2,1); }
.notif.show { opacity: 1; transform: none; }
.notif .app { flex: none; width: 26px; height: 26px; border-radius: 7px; background: #1a1712; color: #faf7f2; display: grid; place-items: center; font-size: 8px; font-weight: 800; }
.notif b { display: block; font-size: 11px; }
.notif span { color: #5c554b; }
.mini-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.mini-thumbs .ph { aspect-ratio: 1; border-radius: 5px; position: relative; overflow: hidden; opacity: 0; transform: scale(0.8); transition: opacity 0.35s, transform 0.4s cubic-bezier(.2,.8,.2,1); }
.mini-thumbs.show .ph { opacity: 1; transform: none; }
.mini-thumbs.show .ph:nth-child(2) { transition-delay: 0.08s; } .mini-thumbs.show .ph:nth-child(3) { transition-delay: 0.16s; }
.mini-thumbs.show .ph:nth-child(4) { transition-delay: 0.24s; } .mini-thumbs.show .ph:nth-child(5) { transition-delay: 0.32s; } .mini-thumbs.show .ph:nth-child(6) { transition-delay: 0.4s; }
@media (max-width: 860px) {
  .pipe { grid-template-columns: repeat(2, 1fr); row-gap: 24px; }
  .pipe-track { display: none; }
  .pipe-stage { grid-template-columns: 1fr; }
  .scan-card { width: min(100%, 420px); justify-self: center; }
}

/* ---------- Feature visuals come alive ---------- */
.tl-item { opacity: 0; transform: translateX(24px); transition: opacity 0.5s, transform 0.6s cubic-bezier(.2,.8,.2,1); }
.in .tl-item, .feature-row.in .tl-item { opacity: 1; transform: none; }
.feature-row.in .tl-item:nth-child(2) { transition-delay: 0.15s; }
.feature-row.in .tl-item:nth-child(3) { transition-delay: 0.3s; }
.feature-row.in .tl-item:nth-child(4) { transition-delay: 0.45s; }
.tl-item:first-child .tl-time { animation: pulse 1.6s infinite; }

.phone-grid .ph.match { outline-color: transparent; transition: outline-color 0.3s; }
.phone-grid .ph.match.lit { outline-color: #b4520f; }
.phone-scan { position: absolute; left: 0; right: 0; height: 40%; top: -40%; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgb(180 82 15 / 0.18), transparent); animation: phone-scan 3.2s ease-in-out infinite; }
.phone-screen { position: relative; }
@keyframes phone-scan { 0% { top: -40%; } 60%, 100% { top: 100%; } }

.proof .wm, .proof .corner { transition: opacity 0.6s; }
.proof.released .wm, .proof.released .corner { opacity: 0; }
.switch { transition: background 0.3s; }
.switch::after { transition: right 0.3s, left 0.3s; }
.proof-toggle.off .switch { background: var(--ink-3); }
.proof-toggle.off .switch::after { right: auto; left: 2px; }

/* Steps: connecting line draws itself */
.steps { position: relative; }
.step { transition: border-color 0.4s, transform 0.4s; }
.steps.in .step, .step.in { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }

/* Card hover lift with a soft spotlight that follows the pointer */
.ev-card, .aud-card, .plan { position: relative; overflow: hidden; }
.ev-card::before, .aud-card::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%); }
.ev-card:hover::before, .aud-card:hover::before { opacity: 1; }
.ev-card .aud-icon, .aud-card .aud-icon { transition: transform 0.4s cubic-bezier(.2,.8,.2,1); }
.ev-card:hover .aud-icon, .aud-card:hover .aud-icon { transform: rotate(-8deg) scale(1.08); }

@media (prefers-reduced-motion: reduce) {
  .shimmer::after, .glow, .rise-words .w, .fade-up, .mock-grid::after, .reel-row, .ticker-track, .replaces span,
  .pipe-step.active .pipe-icon, .hud-pill .dot, .reel-card .face-tag, .phone-scan, .tl-item:first-child .tl-time { animation: none !important; }
  .rise-words .w, .fade-up { opacity: 1; transform: none; filter: none; }
  .hero-stage .mock-browser { transform: none; }
  .tl-item { opacity: 1; transform: none; }
}
