/* JuniorMath 2025 - Ultravelozmente Redesign */
:root {
    /* Palette - Dark Navy & Neon Accents */
    --jm-bg: #050a14;
    --jm-bg-secondary: #0a1124;
    --jm-primary: #3b82f6; /* Bright Blue */
    --jm-accent: #8b5cf6; /* Violet */
    --jm-success: #10b981; /* Emerald */
    --jm-danger: #ef4444;
    --jm-gold: #f59e0b;
    
    /* Text */
    --jm-text-main: #f8fafc;
    --jm-text-muted: #94a3b8;
    
    /* Glassmorphism */
    --jm-glass-bg: rgba(255, 255, 255, 0.03);
    --jm-glass-border: rgba(255, 255, 255, 0.08);
    --jm-glass-highlight: rgba(255, 255, 255, 0.15);
    --jm-blur: 12px;
    
    /* Glow */
    --glow-color: rgba(59, 130, 246, 0.5);
}

body.jm-page {
    background-color: var(--jm-bg);
    color: var(--jm-text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* Typography Overrides */
.jm-page h1, .jm-page h2, .jm-page h3 {
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.02em;
}

/* --- Glassmorphism Utilities --- */
.glass-panel {
    background: var(--jm-glass-bg);
    backdrop-filter: blur(var(--jm-blur));
    -webkit-backdrop-filter: blur(var(--jm-blur));
    border: 1px solid var(--jm-glass-border);
    border-radius: 1.5rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* --- Glow Effect (Mouse Follow) --- */
.glow-card {
    position: relative;
    overflow: hidden;
    background: var(--jm-glass-bg);
    border-radius: 1.5rem;
    border: 1px solid var(--jm-glass-border);
    transition: transform 0.3s ease;
}

.glow-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(
        600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
        rgba(59, 130, 246, 0.15), 
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 1;
}

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

.glow-card:hover {
    transform: translateY(-5px);
    border-color: var(--jm-glass-highlight);
}

/* --- Hero Section --- */
.jm-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    overflow: hidden;
}

.video-background {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    opacity: 0.4;
    background: #000; /* Fallback */
}

.video-background video {
    width: 100%; height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, var(--jm-bg) 0%, transparent 50%, var(--jm-bg) 100%);
    z-index: 0;
}

.hero-content-wrapper {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero-title-lg {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--jm-text-muted);
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.btn-glow {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: var(--jm-primary);
    border-radius: 99px;
    text-decoration: none;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.btn-glow:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.7);
}

/* --- Scrollytelling Section --- */
.scrolly-section {
    position: relative;
    padding: 100px 0;
}

.sticky-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 4rem;
    position: relative;
}

.sticky-content {
    flex: 1;
    position: sticky;
    top: 150px; /* Adjust based on header height */
}

.sticky-visuals {
    flex: 1;
    height: 150vh; /* Make it tall to allow scrolling */
    position: relative;
}

.visual-card {
    position: sticky;
    top: 150px;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 2rem;
    overflow: hidden;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.visual-state-1 {
    background: #334155; /* Grey/Frustrated */
    filter: grayscale(100%);
    opacity: 1;
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.visual-state-2 {
    background: linear-gradient(135deg, var(--jm-primary), var(--jm-accent));
    opacity: 0;
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* When active class is added via JS */
.visual-card.active .visual-state-1 {
    opacity: 0;
}
.visual-card.active .visual-state-2 {
    opacity: 1;
}

/* --- Bento Grid --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(200px, auto);
    gap: 1.5rem;
    padding: 2rem 0;
}

.bento-item {
    grid-column: span 4;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bento-item.large {
    grid-column: span 8;
}

.bento-item.tall {
    grid-row: span 2;
}

.bento-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--jm-primary);
}

/* --- Grand Slam Offer --- */
.offer-stack {
    max-width: 700px;
    margin: 0 auto;
    background: var(--jm-glass-bg);
    border: 1px solid var(--jm-glass-border);
    border-radius: 2rem;
    padding: 3rem;
    position: relative;
}

.stack-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.stack-item:last-child {
    border-bottom: none;
}

.price-strike {
    text-decoration: line-through;
    color: var(--jm-danger);
    font-size: 0.9rem;
}

.price-highlight {
    color: var(--jm-success);
    font-weight: 700;
    font-size: 1.2rem;
}

.urgency-bonus {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--jm-gold);
    color: var(--jm-gold);
    padding: 1rem;
    border-radius: 1rem;
    margin: 2rem 0;
    text-align: center;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.guarantee-seal {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--jm-success);
    padding: 1.5rem;
    border-radius: 1rem;
    margin-top: 2rem;
}

.guarantee-icon {
    font-size: 2.5rem;
    color: var(--jm-success);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Responsive */
@media (max-width: 768px) {
    .sticky-wrapper {
        flex-direction: column;
    }
    .sticky-content, .sticky-visuals {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
    }
    .bento-item, .bento-item.large {
        grid-column: span 12;
    }
    .hero-title-lg {
        font-size: 2.5rem;
    }
}
