/* ==========================================================================
   XTREAM · RADWIN — motion & interaction layer
   Loaded after style.css. Everything here is disabled for prefers-reduced-motion.
   ========================================================================== */

/* ---------- Buttons: sweep, lift, ripple ---------- */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn--primary::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .3) 50%, transparent 70%);
    transform: translateX(-120%); transition: transform .7s var(--ease);
}
.btn--primary:hover::before { transform: translateX(120%); }
.btn--primary:hover { box-shadow: 0 14px 28px -10px rgba(var(--accent-rgb), .8); }
.btn .icon { transition: transform .2s var(--ease); }
.btn:hover .icon { transform: translateX(3px); }

.filter, .mobile-bar a { position: relative; overflow: hidden; }
.ripple {
    position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
    background: currentColor; opacity: .18; transform: scale(0);
    animation: ripple-ink .65s var(--ease) forwards;
}
@keyframes ripple-ink { to { transform: scale(1); opacity: 0; } }

.spinner {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Header hide/show, scroll progress, back to top ---------- */
.header { transition: border-color .2s, box-shadow .2s, transform .35s var(--ease); }
.header.is-hidden { transform: translateY(-100%); }

.scroll-progress {
    position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100;
    background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--accent-hi));
    transform: scaleX(0); transform-origin: 0 50%; pointer-events: none;
}

/* Zoho SalesIQ chat owns the bottom-right corner; WhatsApp + back-to-top live bottom-left */
.wa-float { right: auto !important; left: 20px; }
.to-top {
    position: fixed; left: 24px; bottom: 92px; z-index: 60;
    display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
    border: 0; border-radius: 50%; background: var(--navy-800); color: #fff;
    box-shadow: var(--shadow); cursor: pointer;
    opacity: 0; transform: translateY(16px) scale(.9); pointer-events: none;
    transition: opacity .25s, transform .3s var(--ease), background .2s;
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--accent); }
.to-top .icon { width: 20px; height: 20px; }
.to-top__ring { position: absolute; inset: 0; width: 48px; height: 48px; transform: rotate(-90deg); }
.to-top__ring circle { fill: none; stroke: var(--accent-hi); stroke-width: 2.5; stroke-linecap: round; transition: stroke-dashoffset .1s linear; }
.wa-float { animation: wa-pulse 2.8s ease-out infinite; }
@keyframes wa-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .55), 0 10px 25px -8px rgba(37, 211, 102, .8); }
    70%, 100% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0), 0 10px 25px -8px rgba(37, 211, 102, .8); }
}

/* count-up numbers inherit their heading's type (beats ".trust span" etc.) */
.trust strong [data-count], .stat-chip strong [data-count] {
    display: inline; font: inherit; color: inherit; letter-spacing: inherit;
    font-variant-numeric: tabular-nums;
}
[data-count] { font-variant-numeric: tabular-nums; }

/* ---------- Hero ---------- */
.hero__canvas { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero__inner { z-index: 1; }
.hero__visual { transition: transform .4s var(--ease); will-change: transform; }
.stat-chip { transition: translate .4s var(--ease); }

/* intro choreography */
.js .hero__copy > * { opacity: 0; transform: translateY(22px); animation: hero-in .8s var(--ease) forwards; }
.js .hero__copy > *:nth-child(1) { animation-delay: .1s; }
.js .hero__copy > *:nth-child(2) { animation-delay: .22s; }
.js .hero__copy > *:nth-child(3) { animation-delay: .36s; }
.js .hero__copy > *:nth-child(4) { animation-delay: .5s; }
.js .hero__copy > *:nth-child(5) { animation-delay: .62s; }

/* keyword headline + typewriter tagline */
.hero__title { font-size: clamp(2rem, 3.7vw, 2.85rem); line-height: 1.08; }
.hero__title .text-accent { display: block; }
.hero__tagline { margin: 4px 0 14px; font-size: clamp(1.1rem, 2vw, 1.45rem); font-weight: 700; color: var(--ink); letter-spacing: -.01em; min-height: 1.5em; }
.hero__tagline .typer { color: var(--accent); }
.js .hero__visual { opacity: 0; animation: hero-fade 1.2s .4s var(--ease) forwards; }
@keyframes hero-in { to { opacity: 1; transform: none; } }
@keyframes hero-fade { from { opacity: 0; scale: .94; } to { opacity: 1; scale: 1; } }

.typer { display: inline-block; min-height: 1.1em; }
.typer::after {
    content: ""; display: inline-block; width: 3px; height: .9em; margin-left: 4px; vertical-align: -.05em;
    background: var(--accent); border-radius: 2px; animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.beam-pulse--2 { animation-delay: -1.2s !important; }
.ripples--rx circle { animation-duration: 2.4s !important; }
.ripples--rx circle:nth-child(2) { animation-delay: 1.2s !important; }

.pill { position: relative; overflow: hidden; }
.pill::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(110deg, transparent 35%, rgba(var(--accent-rgb), .1) 50%, transparent 65%);
    animation: shimmer 3.5s 1.2s ease-in-out infinite; transform: translateX(-100%);
}
@keyframes shimmer { 60%, 100% { transform: translateX(100%); } }

.scroll-cue {
    position: absolute; left: 50%; bottom: 58px; z-index: 1; translate: -50% 0;
    width: 26px; height: 42px; border: 2px solid rgba(24, 18, 32, .22); border-radius: 14px;
}
.scroll-cue span {
    position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
    border-radius: 2px; background: var(--accent); animation: cue 1.8s ease-in-out infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 80%, 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Ticker (markets marquee) ---------- */
.ticker {
    overflow: hidden; padding: 18px 0; background: var(--navy-900); color: var(--on-dark-2);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker__track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item {
    display: inline-flex; align-items: center; gap: 10px; padding: 0 34px;
    font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: .85rem; white-space: nowrap;
}
.ticker__item .icon { color: var(--accent-hi); width: 20px; height: 20px; }
.ticker__item::after { content: "•"; margin-left: 34px; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Reveal variants ---------- */
.js .reveal[data-reveal="left"]  { transform: translateX(-36px); }
.js .reveal[data-reveal="right"] { transform: translateX(36px); }
.js .reveal[data-reveal="zoom"]  { transform: scale(.9); }
.js .reveal.is-visible { transform: none; }

/* ---------- Tilt + cursor spotlight on cards ---------- */
.tilt { position: relative; transform-style: preserve-3d; will-change: transform; }
.tilt.reveal-done { transition: transform .18s ease-out, box-shadow .25s, border-color .25s; }
.tilt::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--accent-rgb), .09), transparent 45%);
    opacity: 0; transition: opacity .3s;
}
.tilt:hover::after { opacity: 1; }
.tilt--soft { border-radius: var(--radius); transition: transform .2s ease-out; }

.cat-card__icon { transition: transform .35s var(--ease), background .25s, color .25s; }
.cat-card:hover .cat-card__icon { transform: translateY(-3px) rotate(-6deg) scale(1.08); background: var(--accent); color: #fff; }
.cat-card__count {
    display: inline-block; align-self: flex-start; margin: -2px 0 14px; padding: .2em .65em;
    border-radius: 999px; background: var(--bg-alt); color: var(--ink-3); font-size: .75rem; font-weight: 600;
}

.feature__icon, .solution__icon { transition: transform .35s var(--ease), background .25s; }
.feature:hover .feature__icon, .solution:hover .solution__icon { transform: rotate(-8deg) scale(1.08); background: var(--accent); color: #fff; }
.market .icon { transition: transform .35s var(--ease); }
.market:hover .icon { transform: scale(1.18) rotate(-6deg); }

.badge { animation: badge-pop 2.6s ease-in-out infinite; }
@keyframes badge-pop { 0%, 85%, 100% { transform: scale(1); } 92% { transform: scale(1.12); } }

/* ---------- Spotlight ---------- */
.spotlight__img { overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow-lg); margin-bottom: 20px; }
.spotlight__img img { margin: 0; box-shadow: none; transition: scale .6s var(--ease); }
.spotlight__img:hover img { scale: 1.05; }
.spotlight::before { animation: glow-drift 12s ease-in-out infinite alternate; }
@keyframes glow-drift { to { transform: translate(-120px, 90px) scale(1.2); } }
.big-stat { transition: transform .3s var(--ease), border-color .3s; }
.big-stat:hover { transform: translateY(-4px); border-color: rgba(255, 64, 64, .45); }

/* ---------- Products page: search + filter animation ---------- */
.search {
    position: relative; display: flex; align-items: center; margin-bottom: 18px; max-width: 560px;
}
.search > .icon { position: absolute; left: 16px; color: var(--ink-3); pointer-events: none; }
.search input {
    width: 100%; padding: .85em 7em .85em 2.9em; font: inherit; font-size: 16px; color: var(--ink);
    border: 1px solid var(--line); border-radius: 999px; background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .12); }
.search__count { position: absolute; right: 18px; font-size: .8rem; font-weight: 600; color: var(--accent-600); }
.filter { transition: all .2s, transform .2s var(--ease); }
.filter:active { transform: scale(.95); }
.product-card.pop-in { animation: pop-in .45s var(--ease) both; }
@keyframes pop-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.empty { animation: pop-in .4s var(--ease) both; }

/* ---------- Product gallery + lightbox ---------- */
.gallery__main { cursor: zoom-in; }
.gallery__main img { transition: opacity .16s, transform .4s var(--ease); }
.gallery__main img.is-swapping { opacity: 0; transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
    .gallery__main:hover img { transform: scale(1.6); }
}
.gallery__zoom {
    position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center;
    width: 42px; height: 42px; border: 0; border-radius: 50%; cursor: pointer;
    background: rgba(18, 16, 22, .75); color: #fff; backdrop-filter: blur(6px);
    transition: background .2s, transform .2s var(--ease);
}
.gallery__zoom:hover { background: var(--accent); transform: scale(1.08); }
.gallery__thumb { transition: border-color .15s, transform .2s var(--ease); }
.gallery__thumb:hover { transform: translateY(-2px); }

.lightbox {
    position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
    background: rgba(6, 6, 7, .92); backdrop-filter: blur(6px);
    opacity: 0; transition: opacity .2s;
}
.lightbox.is-open { opacity: 1; }
/* never let a display rule override the hidden attribute (an invisible overlay would block all clicks) */
.lightbox[hidden], .empty[hidden], [hidden] { display: none !important; }
.lightbox__img {
    max-width: min(92vw, 1100px); max-height: 84vh; object-fit: contain; border-radius: 10px; background: #fff;
    transform: scale(.94); transition: transform .3s var(--ease);
}
.lightbox.is-open .lightbox__img { transform: none; }
.lightbox__close, .lightbox__nav {
    position: absolute; display: grid; place-items: center; border: 0; cursor: pointer; color: #fff;
    background: rgba(255, 255, 255, .1); border-radius: 50%; transition: background .2s, transform .2s var(--ease);
}
.lightbox__close { top: 18px; right: 18px; width: 48px; height: 48px; font-size: 2rem; line-height: 1; }
.lightbox__nav { top: 50%; width: 56px; height: 56px; margin-top: -28px; font-size: 2.4rem; line-height: 1; }
.lightbox__nav--prev { left: 18px; }
.lightbox__nav--next { right: 18px; }
.lightbox__close:hover, .lightbox__nav:hover { background: var(--accent); transform: scale(1.08); }
.lightbox.is-single .lightbox__nav, .lightbox.is-single .lightbox__count { display: none; }
.lightbox__count { position: absolute; bottom: 22px; left: 50%; translate: -50% 0; color: var(--on-dark-2); font-size: .85rem; font-weight: 600; }

/* ---------- Product detail ---------- */
.value { transition: transform .25s var(--ease), box-shadow .25s; }
.value:hover { transform: translateX(6px); box-shadow: var(--shadow); }
.download .icon { transition: transform .3s var(--ease); }
.download:hover .icon { transform: translateY(3px); }
.checklist li { transition: transform .2s var(--ease); }
.specs .checklist li:hover { transform: translateX(4px); }

/* ---------- Forms ---------- */
.field input, .field select, .field textarea { transition: border-color .15s, box-shadow .2s, transform .2s var(--ease); }
.field input:focus, .field textarea:focus { transform: translateY(-1px); }
.field.shake { animation: shake .4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.alert { animation: pop-in .45s var(--ease) both; }
.alert--success .icon { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw-check .6s .3s var(--ease) forwards; width: 22px; height: 22px; }
@keyframes draw-check { to { stroke-dashoffset: 0; } }

/* ---------- FAQ accordion ---------- */
.faq__list { display: grid; gap: 12px; max-width: 880px; }
.faq__item {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    transition: border-color .2s, box-shadow .25s;
}
.faq__item[open] { border-color: rgba(var(--accent-rgb), .35); box-shadow: 0 14px 30px -20px rgba(var(--accent-rgb), .45); }
.faq__item summary {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 18px 22px; cursor: pointer; list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary h3 { margin: 0; font-size: 1.02rem; }
.faq__item summary:hover h3 { color: var(--accent); }
.faq__icon { position: relative; flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--accent-50); transition: background .2s, transform .3s var(--ease); }
.faq__icon::before, .faq__icon::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; margin: -1px 0 0 -6px;
    background: var(--accent); border-radius: 2px; transition: transform .3s var(--ease);
}
.faq__icon::after { transform: rotate(90deg); }
.faq__item[open] .faq__icon { background: var(--accent); transform: rotate(180deg); }
.faq__item[open] .faq__icon::before, .faq__item[open] .faq__icon::after { background: #fff; }
.faq__item[open] .faq__icon::after { transform: rotate(0deg); }
.faq__answer { padding: 0 22px 18px; }
.faq__answer p { margin: 0; }
.faq__item[open] .faq__answer { animation: panel-in .35s var(--ease) both; }

/* ---------- Steps (services) ---------- */
.steps span { transition: transform .35s var(--ease), box-shadow .3s; }
.steps li:hover span { transform: scale(1.15) rotate(-8deg); box-shadow: 0 0 0 6px rgba(var(--accent-rgb), .15); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .scroll-cue { display: none; }
}
@media (max-width: 640px) {
    .to-top { display: none; }
    /* lift the Zoho chat button above the sticky Call / WhatsApp / Quote bar */
    #zsiq_float, .zsiq_floatmain, .zsiq_theme1.zsiq_floatmain { bottom: calc(74px + env(safe-area-inset-bottom)) !important; }
    .search input { padding-right: 5.5em; }
    .ticker { padding: 14px 0; }
    .ticker__item { padding: 0 20px; font-size: .78rem; }
    .ticker__item::after { margin-left: 20px; }
    .lightbox__nav { display: none; }
}

/* ---------- Reduced motion: keep everything static ---------- */
@media (prefers-reduced-motion: reduce) {
    .js .hero__copy > *, .js .hero__visual { opacity: 1; transform: none; animation: none; }
    .ticker__track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; }
    .typer::after, .hero__canvas, .scroll-cue { display: none; }
    .gallery__main:hover img { transform: none; }
}
