/**
 * hw-components.css — HIPHOP.WORLD Immersive Component Library
 *
 * Design tokens, scroll-reveal animations, tilt transforms,
 * magnetic cursor styles, glow effects, and reduced-motion support.
 */

/* ── Design Tokens ───────────────────────────────────────────────── */

:root {
    /* Timing */
    --hw-timing-fast: 200ms;
    --hw-timing-normal: 400ms;
    --hw-timing-slow: 800ms;
    --hw-timing-reveal: 600ms;

    /* Easing */
    --hw-easing-default: cubic-bezier(0.25, 0.8, 0.25, 1);
    --hw-easing-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --hw-easing-smooth: cubic-bezier(0.4, 0, 0.2, 1);

    /* Glow intensities */
    --hw-glow-soft: 0 0 15px rgba(255, 215, 0, 0.2);
    --hw-glow-medium: 0 0 25px rgba(255, 215, 0, 0.35);
    --hw-glow-strong: 0 0 40px rgba(255, 215, 0, 0.5);
    --hw-glow-pulse-min: 0 0 15px rgba(255, 215, 0, 0.2);
    --hw-glow-pulse-max: 0 0 35px rgba(255, 215, 0, 0.5);

    /* Particle canvas */
    --hw-particles-z: -1;
}

/* ── Particle Canvas ─────────────────────────────────────────────── */

#hw-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--hw-particles-z);
    pointer-events: none;
}

/* ── Scroll Reveal ───────────────────────────────────────────────── */

.hw-reveal {
    opacity: 0;
    will-change: opacity, transform;
    transition:
        opacity var(--hw-timing-reveal) var(--hw-easing-default),
        transform var(--hw-timing-reveal) var(--hw-easing-default);
}

/* Reveal variants — initial states */
.hw-reveal[data-hw-reveal="fade-up"] {
    transform: translateY(30px);
}

.hw-reveal[data-hw-reveal="fade-left"] {
    transform: translateX(-30px);
}

.hw-reveal[data-hw-reveal="fade-right"] {
    transform: translateX(30px);
}

.hw-reveal[data-hw-reveal="scale-in"] {
    transform: scale(0.9);
}

/* Visible state — applied by IntersectionObserver */
.hw-reveal--visible {
    opacity: 1 !important;
    transform: none !important;
}

/* ── Tilt Effect ─────────────────────────────────────────────────── */

.hw-tilt {
    transform-style: preserve-3d;
    transition: transform var(--hw-timing-fast) var(--hw-easing-smooth);
    will-change: transform;
}

.hw-tilt:hover {
    /* Actual transform values set by JS — this ensures smooth reset */
    transition: transform var(--hw-timing-normal) var(--hw-easing-bounce);
}

/* Inner content lifts forward on hover */
.hw-tilt > .hw-tilt-inner {
    transition: transform var(--hw-timing-normal) var(--hw-easing-bounce);
}

.hw-tilt:hover > .hw-tilt-inner {
    transform: translateZ(20px);
}

/* ── Magnetic Cursor ─────────────────────────────────────────────── */

.hw-magnetic {
    transition: transform var(--hw-timing-fast) var(--hw-easing-bounce);
    will-change: transform;
}

/* ── Glow Pulse Keyframe ─────────────────────────────────────────── */

@keyframes hw-glow-pulse {
    0%, 100% {
        box-shadow: var(--hw-glow-pulse-min);
    }
    50% {
        box-shadow: var(--hw-glow-pulse-max);
    }
}

.hw-glow-pulse {
    animation: hw-glow-pulse 2.5s var(--hw-easing-smooth) infinite;
}

/* ── Gold Shimmer ────────────────────────────────────────────────── */

@keyframes hw-shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.hw-shimmer {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 215, 0, 0.1) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: hw-shimmer 3s var(--hw-easing-smooth) infinite;
}

/* ── Hero Section ────────────────────────────────────────────────── */

.hw-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 60vh;
    padding: 4rem 1.5rem;
    overflow: hidden;
}

.hw-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at 50% 30%,
        rgba(255, 215, 0, 0.08) 0%,
        transparent 70%
    );
    pointer-events: none;
}

.hw-hero-title {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 6vw, 4rem);
    line-height: 1.1;
    color: #fff;
    margin-bottom: 1rem;
    position: relative;
}

.hw-hero-subtitle {
    font-family: 'Roboto', sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: rgba(255, 255, 255, 0.6);
    max-width: 600px;
    position: relative;
}

/* ── Feature Card (Glassmorphism) ────────────────────────────────── */

.hw-feature-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.hw-feature-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.3), transparent);
}

.hw-feature-card-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.hw-feature-card-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.125rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.hw-feature-card-desc {
    font-family: 'Roboto', sans-serif;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
}

/* ── Stat Grid ───────────────────────────────────────────────────── */

.hw-stat-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.hw-stat-item {
    text-align: center;
    padding: 1.5rem 1rem;
}

.hw-stat-value {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 2rem;
    color: #FFD700;
    line-height: 1;
}

.hw-stat-label {
    font-family: 'Roboto', sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Section Divider ─────────────────────────────────────────────── */

.hw-divider {
    height: 1px;
    border: none;
    margin: 3rem 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
}

.hw-divider--gold {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 215, 0, 0.4),
        transparent
    );
}

/* ── Network Card (Domain Showcase) ──────────────────────────────── */

.hw-network-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: border-color var(--hw-timing-normal) var(--hw-easing-default),
                box-shadow var(--hw-timing-normal) var(--hw-easing-default);
}

.hw-network-card:hover {
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: var(--hw-glow-soft);
}

.hw-network-card-domain {
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    color: #FFD700;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}

.hw-network-card-desc {
    font-family: 'Roboto', sans-serif;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
}

/* ── Grid Preview (Land) ─────────────────────────────────────────── */

.hw-grid-preview {
    display: grid;
    gap: 2px;
    aspect-ratio: 1;
    max-width: 500px;
    margin: 0 auto;
}

.hw-grid-cell {
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 2px;
    transition:
        background var(--hw-timing-fast) var(--hw-easing-default),
        border-color var(--hw-timing-fast) var(--hw-easing-default),
        box-shadow var(--hw-timing-fast) var(--hw-easing-default);
}

.hw-grid-cell:hover {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: inset 0 0 10px rgba(255, 215, 0, 0.1);
}

/* ── Reduced Motion ──────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    /* Kill all animations and transitions */
    .hw-reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        will-change: auto;
    }

    .hw-tilt {
        transition: none !important;
        will-change: auto;
    }

    .hw-magnetic {
        transition: none !important;
        will-change: auto;
    }

    .hw-glow-pulse {
        animation: none !important;
        box-shadow: var(--hw-glow-soft);
    }

    .hw-shimmer {
        animation: none !important;
        background: transparent;
    }

    .hw-grid-cell {
        transition: none !important;
    }

    .hw-feature-card {
        transition: none !important;
    }

    .hw-network-card {
        transition: none !important;
    }

    /* Hide particle canvas entirely */
    #hw-particles {
        display: none;
    }
}

/* ── Mobile Optimizations ────────────────────────────────────────── */

@media (max-width: 767px) {
    .hw-hero {
        min-height: 50vh;
        padding: 3rem 1rem;
    }

    .hw-feature-card {
        padding: 1.5rem;
    }

    .hw-stat-value {
        font-size: 1.5rem;
    }

    .hw-grid-preview {
        max-width: 300px;
    }

    /* Disable tilt on touch devices */
    .hw-tilt {
        transform: none !important;
        will-change: auto;
    }

    /* Disable magnetic on touch */
    .hw-magnetic {
        transform: none !important;
        will-change: auto;
    }
}
