/* ═══════════════════════════════════════════════════════════════════════
   OAK STUDIO — Animations
   Keyframes, Page Loader, Floating Elements, Glow Effects
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Page Loader ─────────────────────────────────────────────────────── */
.loader {
    position: fixed;
    inset: 0;
    z-index: var(--z-loader);
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s var(--ease-out), visibility 0.6s var(--ease-out);
}

.loader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader__icon {
    width: 80px;
    height: 80px;
    margin-bottom: var(--space-xl);
    animation: loaderPulse 1.5s var(--ease-in-out) infinite,
        loaderRotate 3s linear infinite;
}

.loader__icon svg {
    width: 100%;
    height: 100%;
}

.loader__bar {
    width: 200px;
    height: 2px;
    background: var(--color-gray-500);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.loader__bar-fill {
    width: 0%;
    height: 100%;
    background: var(--color-primary);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-glow-sm);
    transition: width 0.3s var(--ease-out);
}

.loader__text {
    font-family: var(--font-heading);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    letter-spacing: var(--ls-widest);
    text-transform: uppercase;
    color: var(--color-gray-300);
}

@keyframes loaderPulse {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(0.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

@keyframes loaderRotate {
    from {
        filter: drop-shadow(0 0 10px rgba(var(--color-primary-rgb), 0.3));
    }

    50% {
        filter: drop-shadow(0 0 25px rgba(var(--color-primary-rgb), 0.6));
    }

    to {
        filter: drop-shadow(0 0 10px rgba(var(--color-primary-rgb), 0.3));
    }
}

/* ── Custom Cursor ───────────────────────────────────────────────────── */
.cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-cursor);
    pointer-events: none;

}

.cursor__dot {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    position: absolute;
    top: -4px;
    left: -4px;
    transition: transform 0.1s var(--ease-out),
        opacity 0.3s var(--ease-out);
}

.cursor__ring {
    width: 40px;
    height: 40px;
    border: 1.5px solid rgba(var(--color-primary-rgb), 0.4);
    border-radius: 50%;
    position: absolute;
    top: -20px;
    left: -20px;
    transition: transform 0.15s var(--ease-out),
        border-color 0.3s var(--ease-out),
        width 0.3s var(--ease-out),
        height 0.3s var(--ease-out),
        top 0.3s var(--ease-out),
        left 0.3s var(--ease-out);
}

/* Cursor hover states */
.cursor.cursor--hover .cursor__ring {
    width: 64px;
    height: 64px;
    top: -32px;
    left: -32px;
    border-color: var(--color-primary);
}

.cursor.cursor--hover .cursor__dot {
    transform: scale(0.5);
    opacity: 0.5;
}

.cursor.cursor--text .cursor__ring {
    width: 100px;
    height: 100px;
    top: -50px;
    left: -50px;
    border-color: rgba(var(--color-primary-rgb), 0.3);
}

.cursor.cursor--hidden .cursor__dot,
.cursor.cursor--hidden .cursor__ring {
    transform: scale(0);
    opacity: 0;
}

/* ── Floating Elements ───────────────────────────────────────────────── */
@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-15px) rotate(2deg);
    }

    50% {
        transform: translateY(-8px) rotate(-1deg);
    }

    75% {
        transform: translateY(-20px) rotate(1.5deg);
    }
}

@keyframes floatSlow {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-30px) rotate(5deg);
    }
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }

    33% {
        transform: translateY(-12px) rotate(120deg) scale(0.95);
    }

    66% {
        transform: translateY(-6px) rotate(240deg) scale(1.05);
    }
}

.floating-icon {
    position: absolute;
    opacity: 0.04;
    animation: floatIcon 20s var(--ease-smooth) infinite;
    pointer-events: none;
    z-index: 0;
}

.floating-icon svg {
    fill: var(--color-primary);
}

.floating-icon--1 {
    top: 10%;
    right: 5%;
    width: 120px;
    animation-delay: 0s;
}

.floating-icon--2 {
    top: 40%;
    left: 3%;
    width: 80px;
    animation-delay: -5s;
}

.floating-icon--3 {
    bottom: 20%;
    right: 8%;
    width: 100px;
    animation-delay: -10s;
}

.floating-icon--4 {
    bottom: 5%;
    left: 10%;
    width: 60px;
    animation-delay: -15s;
}

/* ── Glow Effects ────────────────────────────────────────────────────── */
@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.1);
    }

    50% {
        box-shadow: 0 0 40px rgba(var(--color-primary-rgb), 0.3);
    }
}

@keyframes glowLine {
    0% {
        left: -100%;
    }

    100% {
        left: 200%;
    }
}

.glow-line {
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 50%;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            rgba(var(--color-primary-rgb), 0.5),
            transparent);
    animation: glowLine 4s var(--ease-in-out) infinite;
}

/* ── Text Reveal ─────────────────────────────────────────────────────── */
@keyframes textRevealUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes textRevealLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.text-reveal-wrap {
    overflow: hidden;
    display: inline-block;
}

.text-reveal-inner {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
}

/* ── Scale In ────────────────────────────────────────────────────────── */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ── Gradient Shift ──────────────────────────────────────────────────── */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ── Particle Drift ──────────────────────────────────────────────────── */
@keyframes particleDrift {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translate(var(--drift-x, 100px), var(--drift-y, -200px)) rotate(360deg);
        opacity: 0;
    }
}

/* ── Scroll Indicator ────────────────────────────────────────────────── */
@keyframes scrollBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(8px);
    }
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    color: var(--color-gray-300);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    letter-spacing: var(--ls-widest);
    text-transform: uppercase;
    animation: scrollBounce 2s var(--ease-in-out) infinite;
    cursor: pointer;
}

.scroll-indicator__mouse {
    width: 22px;
    height: 34px;
    border: 2px solid rgba(var(--color-white-rgb), 0.3);
    border-radius: 11px;
    position: relative;
}

.scroll-indicator__wheel {
    width: 3px;
    height: 8px;
    background: var(--color-primary);
    border-radius: var(--radius-pill);
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 1.5s var(--ease-in-out) infinite;
}

@keyframes scrollWheel {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(12px);
    }
}

/* ── Marquee ─────────────────────────────────────────────────────────── */
@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.marquee {
    overflow: hidden;
    white-space: nowrap;
}

.marquee__inner {
    display: inline-flex;
    animation: marquee 30s linear infinite;
}

/* ── Background Pattern ──────────────────────────────────────────────── */
.bg-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-pattern::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(var(--color-primary-rgb), 0.03) 1px, transparent 0);
    background-size: 40px 40px;
}

/* Blue gradient orb decorations */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

.bg-orb--1 {
    width: 600px;
    height: 600px;
    background: rgba(var(--color-primary-rgb), 0.08);
    top: -200px;
    right: -200px;
}

.bg-orb--2 {
    width: 400px;
    height: 400px;
    background: rgba(var(--color-primary-rgb), 0.05);
    bottom: -100px;
    left: -100px;
}

/* ── Stagger Delays ──────────────────────────────────────────────────── */
.stagger-1 {
    transition-delay: 0.05s;
}

.stagger-2 {
    transition-delay: 0.1s;
}

.stagger-3 {
    transition-delay: 0.15s;
}

.stagger-4 {
    transition-delay: 0.2s;
}

.stagger-5 {
    transition-delay: 0.25s;
}

.stagger-6 {
    transition-delay: 0.3s;
}