/* ============================================
   HEDONIC INTELLIGENCE - Premium Effects
   Custom cursor, grain texture, marquee, enhanced animations
   ============================================ */

/* ─────────────────────────────────────────
   NOISE/GRAIN OVERLAY - Editorial Feel
───────────────────────────────────────── */

.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* ─────────────────────────────────────────
   CUSTOM CURSOR - Desktop Only
───────────────────────────────────────── */

/* Hide on mobile - display none by default */
.cursor-dot,
.cursor-ring {
    display: none;
}

/* Desktop only styles */
@media (min-width: 768px) {

    /* Hide default cursor on ALL elements */
    body:not(.touch-device),
    body:not(.touch-device) * {
        cursor: none !important;
    }

    /* Show cursor elements on desktop */
    .cursor-dot {
        display: block;
        position: fixed;
        width: 8px;
        height: 8px;
        background: var(--color-gold);
        border-radius: 50%;
        pointer-events: none;
        z-index: 999999;
        transform: translate(-50%, -50%);
        transition:
            width 0.15s ease,
            height 0.15s ease,
            background 0.15s ease,
            opacity 0.15s ease;
    }

    .cursor-ring {
        display: block;
        position: fixed;
        width: 40px;
        height: 40px;
        border: 1px solid rgba(212, 175, 55, 0.5);
        border-radius: 50%;
        pointer-events: none;
        z-index: 999998;
        transform: translate(-50%, -50%);
        transition:
            width 0.3s ease,
            height 0.3s ease,
            border-color 0.3s ease,
            background 0.3s ease;
    }

    /* Hover state */
    .cursor-dot.hovering {
        width: 12px;
        height: 12px;
        background: #fff;
    }

    .cursor-ring.hovering {
        width: 60px;
        height: 60px;
        border-color: rgba(255, 255, 255, 0.8);
        background: rgba(212, 175, 55, 0.1);
    }

    /* Click state */
    .cursor-dot.clicking {
        width: 6px;
        height: 6px;
    }

    .cursor-ring.clicking {
        width: 30px;
        height: 30px;
    }

    /* Hidden state */
    .cursor-dot.hidden,
    .cursor-ring.hidden {
        opacity: 0;
    }
}

/* ─────────────────────────────────────────
   MARQUEE TEXT STRIP
───────────────────────────────────────── */

.marquee-section {
    overflow: hidden;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-4) 0;
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 30s linear infinite;
}

.marquee-content {
    display: flex;
    align-items: center;
    gap: var(--space-12);
    padding: 0 var(--space-6);
}

.marquee-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    white-space: nowrap;
}

.marquee-item .dot {
    width: 6px;
    height: 6px;
    background: var(--color-gold);
    border-radius: 50%;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.marquee-section:hover .marquee-track {
    animation-play-state: paused;
}

/* ─────────────────────────────────────────
   ENHANCED TILT CARDS WITH SHINE
───────────────────────────────────────── */

.metric-card {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.metric-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.03) 50%,
            rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.metric-card:hover::before {
    opacity: 1;
}

.metric-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(105deg,
            transparent 40%,
            rgba(255, 255, 255, 0.08) 45%,
            rgba(255, 255, 255, 0.12) 50%,
            rgba(255, 255, 255, 0.08) 55%,
            transparent 60%);
    background-size: 200% 100%;
    background-position: 200% 0;
    transition: background-position 0.8s ease;
    pointer-events: none;
}

.metric-card:hover::after {
    background-position: -50% 0;
}

/* ─────────────────────────────────────────
   SCROLL PROGRESS BAR
───────────────────────────────────────── */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light));
    width: 0%;
    z-index: 100000;
    transition: width 0.1s ease-out;
}

/* ─────────────────────────────────────────
   ENHANCED BUTTON EFFECTS
───────────────────────────────────────── */

.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary .btn-ripple {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(255, 255, 255, 0.15) 0%,
            transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.btn-primary:hover .btn-ripple {
    opacity: 1;
}

/* ─────────────────────────────────────────
   SMOOTH SCROLL (Lenis)
───────────────────────────────────────── */

html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}