/* Public-site motion layer.
 * Everything here is opt-in via classes added by js/motion.js (html.js-motion),
 * so if scripts fail the page simply renders normally.
 * Uses the individual `translate` / `scale` properties so it never fights
 * Tailwind's `transform` utilities (hover:-translate-y-*, scale-*, rotate-*).
 */
html { scroll-behavior: smooth; }

/* ---- scroll reveal ---- */
.js-motion .reveal {
    opacity: 0;
    translate: 0 32px;
    transition: opacity .8s cubic-bezier(.22,.61,.36,1), translate .8s cubic-bezier(.22,.61,.36,1), scale .8s cubic-bezier(.22,.61,.36,1);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, translate;
}
.js-motion .reveal[data-reveal="left"]  { translate: -40px 0; }
.js-motion .reveal[data-reveal="right"] { translate: 40px 0; }
.js-motion .reveal[data-reveal="zoom"]  { translate: 0 0; scale: .92; }
.js-motion .reveal[data-reveal="fade"]  { translate: 0 0; }
.js-motion .reveal.is-visible { opacity: 1; translate: 0 0; scale: 1; will-change: auto; }

/* ---- scroll progress bar ---- */
.scroll-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 99998;
    transform-origin: 0 50%; transform: scaleX(0);
    background: linear-gradient(90deg, #dc2626, #f59e0b, #0ea5e9);
    pointer-events: none;
}

/* ---- header: soft shadow + glass once the page scrolls ---- */
header.sticky { transition: box-shadow .3s ease, background-color .3s ease, backdrop-filter .3s ease; }
header.sticky.is-scrolled {
    box-shadow: 0 8px 30px -12px rgba(15, 23, 42, .25);
    background-color: rgba(255, 255, 255, .86);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
}
.dark header.sticky.is-scrolled { background-color: rgba(17, 24, 39, .82); }

/* ---- card hover polish (opt in with .lift, auto-applied to rounded bordered cards) ---- */
.lift { transition: translate .35s cubic-bezier(.22,.61,.36,1), box-shadow .35s ease, border-color .35s ease; }
.lift:hover { translate: 0 -6px; box-shadow: 0 24px 50px -18px rgba(15, 23, 42, .35); }

/* ---- button shine ---- */
.btn-shine { position: relative; overflow: hidden; isolation: isolate; }
.btn-shine::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
    translate: -120% 0; transition: translate .7s ease;
}
.btn-shine:hover::after { translate: 120% 0; }

/* ---- animated gradient text ---- */
.text-shimmer {
    background-image: linear-gradient(100deg, #fff 0%, #fca5a5 35%, #fde68a 55%, #fff 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: -220% 0; } }

/* ---- hero ambience ---- */
.hero-blob { position: absolute; border-radius: 9999px; filter: blur(70px); opacity: .55; animation: blob-drift 18s ease-in-out infinite; pointer-events: none; }
.hero-blob.b2 { animation-duration: 24s; animation-delay: -6s; }
.hero-blob.b3 { animation-duration: 21s; animation-delay: -12s; }
@keyframes blob-drift {
    0%, 100% { translate: 0 0; scale: 1; }
    33% { translate: 6vw -4vh; scale: 1.15; }
    66% { translate: -5vw 5vh; scale: .92; }
}
.hero-grid {
    position: absolute; inset: 0; pointer-events: none; opacity: .18;
    background-image: linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}
.float-slow { animation: float-slow 7s ease-in-out infinite; }
.float-slower { animation: float-slow 9s ease-in-out infinite reverse; }
@keyframes float-slow { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -14px; rotate: 1.5deg; } }

/* hero entrance (plays on load, staggered by --i) */
.js-motion .hero-in { opacity: 0; translate: 0 26px; animation: hero-in .9s cubic-bezier(.22,.61,.36,1) forwards; animation-delay: calc(var(--i, 0) * 120ms + 120ms); }
@keyframes hero-in { to { opacity: 1; translate: 0 0; } }

/* glass panels */
.glass { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }

/* infinite marquee for logo / trust strips */
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; width: max-content; gap: 3rem; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { translate: -50% 0; } }

/* gentle pulse ring for primary call-to-actions */
.pulse-ring { position: relative; }
.pulse-ring::before { content: ""; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid currentColor; opacity: 0; animation: pulse-ring 2.6s ease-out infinite; pointer-events: none; }
@keyframes pulse-ring { 0% { opacity: .5; scale: 1; } 100% { opacity: 0; scale: 1.18; } }


/* ---- inner-page hero banners (auto-tagged by motion.js) ---- */
.page-hero { position: relative; isolation: isolate; }
.page-hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .14;
    background-image: linear-gradient(rgba(255,255,255,.4) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.4) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: radial-gradient(ellipse 80% 90% at 50% 0%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 80% 90% at 50% 0%, #000 20%, transparent 75%);
}
.page-hero h1 { letter-spacing: -.02em; }
.page-hero .hero-blob-auto { position: absolute; border-radius: 9999px; filter: blur(80px); opacity: .35; pointer-events: none; z-index: -1; animation: blob-drift 20s ease-in-out infinite; }

/* feature tiles */
.feature-tile { position: relative; overflow: hidden; }
.feature-tile::after {
    content: ""; position: absolute; inset: auto -30% -60% auto; width: 14rem; height: 14rem; border-radius: 9999px;
    background: radial-gradient(circle, rgba(14,165,233,.18), transparent 65%); transition: scale .6s ease; pointer-events: none;
}
.feature-tile:hover::after { scale: 1.6; }

/* ---- respect users who ask for less motion ---- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .js-motion .reveal, .js-motion .hero-in { opacity: 1 !important; translate: 0 0 !important; scale: 1 !important; transition: none !important; animation: none !important; }
    .hero-blob, .hero-blob-auto, .float-slow, .float-slower, .text-shimmer, .marquee-track, .pulse-ring::before { animation: none !important; }
    .scroll-progress { display: none; }
}
