/* ============================================================
   Veil Automotive — Animations & Effects
   ============================================================ */

/* --------  Custom Cursor  -------- */
.veil-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    top: 0;
    left: 0;
    mix-blend-mode: difference;
    opacity: 0;
    transition: opacity .3s ease;
}
.veil-cursor.is-active {
    opacity: 1;
}
.veil-cursor__dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background: var(--veil-accent, #ff7a1a);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10000;
    transition: transform .12s ease, width .25s ease, height .25s ease, background .25s ease;
    mix-blend-mode: normal;
}
.veil-cursor__ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border: 1.5px solid var(--veil-accent, #ff7a1a);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    transition: transform .25s cubic-bezier(.2,.7,.2,1), width .25s ease, height .25s ease, border-color .25s ease, opacity .25s ease;
    opacity: .55;
}
.veil-cursor.is-hover .veil-cursor__ring {
    width: 70px;
    height: 70px;
    border-color: var(--veil-accent, #ff7a1a);
    opacity: .8;
    border-width: 1px;
}
.veil-cursor.is-hover .veil-cursor__dot {
    width: 10px;
    height: 10px;
}
.veil-cursor.is-down .veil-cursor__ring {
    width: 28px;
    height: 28px;
    opacity: 1;
}

/* Hide on touch */
@media (hover: none), (pointer: coarse) {
    .veil-cursor,
    .veil-cursor__dot,
    .veil-cursor__ring {
        display: none !important;
    }
    body.veil-has-cursor {
        cursor: auto !important;
    }
}
body.veil-has-cursor,
body.veil-has-cursor * {
    cursor: none;
}
body.veil-has-cursor a,
body.veil-has-cursor button,
body.veil-has-cursor input,
body.veil-has-cursor textarea,
body.veil-has-cursor select {
    cursor: none;
}

/* --------  Preloader  -------- */
.veil-preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--veil-bg, #0a0a0a);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 30px;
    transition: opacity .6s ease, visibility .6s ease;
}
.veil-preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.veil-preloader__logo {
    width: 80px;
    height: 80px;
    animation: veilPulse 1.6s ease-in-out infinite;
}
.veil-preloader__bar {
    width: 180px;
    height: 2px;
    background: rgba(255,255,255,.08);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}
.veil-preloader__bar::before {
    content: '';
    position: absolute;
    inset: 0;
    width: 30%;
    background: linear-gradient(90deg, transparent, var(--veil-accent, #ff7a1a), transparent);
    animation: veilLoadingBar 1.4s ease-in-out infinite;
}
@keyframes veilPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .55; transform: scale(.95); }
}
@keyframes veilLoadingBar {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

/* --------  Floating particles / blobs for backgrounds  -------- */
.veil-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .35;
    pointer-events: none;
    animation: veilBlobFloat 18s ease-in-out infinite;
}
.veil-blob--accent { background: var(--veil-accent, #ff7a1a); }
.veil-blob--accent2 { background: var(--veil-accent-2, #ffa040); }
@keyframes veilBlobFloat {
    0%, 100% { transform: translate(0,0) scale(1); }
    25%      { transform: translate(50px,-30px) scale(1.1); }
    50%      { transform: translate(-30px,40px) scale(.95); }
    75%      { transform: translate(20px,20px) scale(1.05); }
}

/* --------  Gradient sweep over headings on reveal  -------- */
.veil-gradient-sweep {
    background: linear-gradient(110deg,
        var(--veil-text, #fff) 0%,
        var(--veil-text, #fff) 30%,
        var(--veil-accent, #ff7a1a) 50%,
        var(--veil-text, #fff) 70%,
        var(--veil-text, #fff) 100%);
    background-size: 250% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    transition: background-position 1.2s cubic-bezier(.2,.7,.2,1);
}
.veil-gradient-sweep.is-revealed {
    background-position: 0 0;
}

/* --------  Text glitch effect (used sparingly)  -------- */
@keyframes veilTextGlitch {
    0%, 100% { transform: translate(0,0); text-shadow: none; }
    20% { transform: translate(-1px,1px); text-shadow: 1px 0 var(--veil-accent, #ff7a1a); }
    40% { transform: translate(1px,-1px); text-shadow: -1px 0 var(--veil-accent-2, #ffa040); }
    60% { transform: translate(-1px,0); text-shadow: 1px 1px var(--veil-accent, #ff7a1a); }
    80% { transform: translate(1px,0); text-shadow: -1px -1px var(--veil-accent-2, #ffa040); }
}
.veil-glitch:hover {
    animation: veilTextGlitch .35s steps(4) 1;
}

/* --------  Magnetic hover targets (used by JS) -------- */
[data-veil-magnetic] {
    will-change: transform;
    transition: transform .25s cubic-bezier(.2,.7,.2,1);
}

/* --------  Tilt cards  -------- */
[data-veil-tilt] {
    transform-style: preserve-3d;
    transition: transform .35s cubic-bezier(.2,.7,.2,1);
    will-change: transform;
}
[data-veil-tilt] > * {
    transform-style: preserve-3d;
}

/* --------  Page transition overlay  -------- */
.veil-page-transition {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: var(--veil-bg, #0a0a0a);
    transform: translateY(100%);
    pointer-events: none;
    transition: transform .8s cubic-bezier(.76,0,.24,1);
}
.veil-page-transition.is-active {
    transform: translateY(0);
}

/* --------  Marquee continuous strip  -------- */
.veil-marquee {
    overflow: hidden;
    border-block: 1px solid rgba(255,255,255,.06);
    background: var(--veil-bg-2, #111);
    padding: 26px 0;
}
.veil-marquee__track {
    display: inline-flex;
    align-items: center;
    gap: 60px;
    animation: veilMarquee 40s linear infinite;
    white-space: nowrap;
    padding-right: 60px;
}
.veil-marquee__item {
    font-family: var(--veil-font, "Inter", sans-serif);
    font-size: clamp(28px, 4vw, 56px);
    font-weight: 800;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: rgba(255,255,255,.12);
    -webkit-text-stroke: 1px rgba(255,255,255,.3);
    transition: color .3s ease;
}
.veil-marquee__item .veil-dot {
    color: var(--veil-accent, #ff7a1a);
    -webkit-text-stroke: 0;
    margin-inline: 30px;
}
@keyframes veilMarquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* --------  Counter element prep  -------- */
[data-veil-counter] {
    display: inline-block;
}

/* --------  Reveal masks (used by GSAP) -------- */
.veil-reveal-mask {
    position: relative;
    overflow: hidden;
    display: inline-block;
}
.veil-reveal-mask > * {
    display: inline-block;
}

/* --------  Reduced motion overrides  -------- */
@media (prefers-reduced-motion: reduce) {
    .veil-blob,
    .veil-marquee__track,
    .veil-preloader__logo,
    .veil-preloader__bar::before {
        animation: none !important;
    }
    [data-veil-tilt] {
        transform: none !important;
    }
}
