/* ============================================================
   ANIMATIONS — loader, marquee, cursor, keyframes,
   reduced-motion overrides
   ============================================================ */

/* ============================================
   PAGE LOADER
   ============================================ */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}
.loader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.loader-logo {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}
.loader-logo span { color: var(--accent); }
.loader-bar {
    width: 140px;
    height: 3px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}
.loader-bar-inner {
    width: 0%;
    height: 100%;
    background: var(--gradient-accent);
    border-radius: 3px;
    animation: loaderFill 1.1s ease forwards;
}
@keyframes loaderFill {
    to { width: 100%; }
}

/* ============================================
   CUSTOM CURSOR
   ============================================ */
.cursor-dot,
.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10001;
    pointer-events: none;
    border-radius: 50%;
    opacity: 0;
}
body.has-cursor .cursor-dot,
body.has-cursor .cursor-ring { opacity: 1; }
.cursor-dot {
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    background: var(--accent);
}
.cursor-ring {
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 1px solid rgba(0, 212, 170, 0.45);
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
body.cursor-hover .cursor-ring {
    transform: scale(1.6);
    border-color: rgba(0, 212, 170, 0.8);
    background: rgba(0, 212, 170, 0.06);
}

/* ============================================
   MARQUEE (trusted-by strip)
   ============================================ */
.marquee {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
    display: flex;
    width: max-content;
    animation: marqueeScroll 32s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group {
    display: flex;
    align-items: center;
    gap: 56px;
    padding-right: 56px;
}
@keyframes marqueeScroll {
    to { transform: translateX(-50%); }
}

/* ============================================
   AMBIENT KEYFRAMES
   ============================================ */

/* Hero typewriter caret */
.hero-typewriter .cursor {
    animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Hero glow breathing */
.hero-glow {
    animation: glowPulse 6s ease-in-out infinite;
}
@keyframes glowPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Scroll indicator: light travelling down the line */
.scroll-indicator-line::after {
    content: '';
    position: absolute;
    top: -48px;
    left: 0;
    width: 100%;
    height: 48px;
    background: linear-gradient(180deg, transparent, var(--accent-2));
    animation: scrollTravel 2.2s ease-in-out infinite;
}
@keyframes scrollTravel {
    0% { transform: translateY(0); opacity: 1; }
    70% { transform: translateY(96px); opacity: 1; }
    100% { transform: translateY(96px); opacity: 0; }
}

/* Availability dot pulse */
.availability-dot {
    animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
}

/* SplitText fragments — gradient text must be re-applied per
   fragment because background-clip:text does not survive the
   wrapper elements SplitText creates. */
/* Keep split words intact — inline-block char wrappers would
   otherwise allow line breaks mid-word. */
.hero-name > div,
.section-title > div {
    white-space: nowrap;
}
.hero-name .hero-char {
    background: linear-gradient(135deg, var(--text-primary) 0%, #C8D0DC 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    will-change: transform;
}
.hero-name-accent .hero-char {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.section-title .split-word {
    background: var(--gradient-title);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .marquee-track {
        animation: none;
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }
    .marquee {
        -webkit-mask-image: none;
        mask-image: none;
    }
    .marquee-group[aria-hidden="true"] { display: none; }
    .marquee-group {
        flex-wrap: wrap;
        justify-content: center;
        padding-right: 0;
        gap: 32px;
        row-gap: 16px;
    }
    .cursor-dot, .cursor-ring { display: none !important; }
    .hero-glow { animation: none; }
    .scroll-indicator-line::after { animation: none; opacity: 0; }
}
