/* =========================================
   home.css — Homepage-Specific Controller
   Supplements style.css for index.html layout
   ========================================= */

/* =========================================
   1. HERO BENTO GRID RESPONSIVE BEHAVIOR
   ========================================= */
.page-home .hero {
    /* Dynamic ambient lighting for the hero section */
    background: radial-gradient(ellipse at 70% 40%, rgba(var(--primary-rgb), 0.12) 0%, transparent 60%),
                radial-gradient(ellipse at 30% 60%, rgba(var(--accent-rgb), 0.08) 0%, transparent 50%);
}

/* Tablet / Small Desktop adjustments for Bento Grid */
@media (max-width: 1100px) {
    .hero-text-cell { grid-column: span 12; grid-row: auto; text-align: center; align-items: center; }
    .hero-subtitle { max-width: 80%; margin: 0 auto 32px; }
    .cta-group { justify-content: center; }
    
    .stats-cell { grid-column: span 6; }
    .float-card-cell { grid-column: span 3; flex-direction: column; text-align: center; justify-content: center; }
}

@media (max-width: 900px) {
    .hero { padding: 120px 20px 60px; }
    .hero-title { font-size: 48px; }
}

@media (max-width: 768px) {
    .stats-cell { grid-column: span 12; }
    .float-card-cell { grid-column: span 6; flex-direction: row; text-align: left; justify-content: flex-start; }
    .hero-subtitle { max-width: 100%; }
}

@media (max-width: 500px) {
    .float-card-cell { grid-column: span 12; }
    .stats-bento-grid { gap: 8px; }
    .stat-box h3 { font-size: 24px; }
}

/* =========================================
   2. AI CONSOLE INTERFACE (MOCKUP)
   ========================================= */
#aiMessages { 
    max-height: 280px; 
    overflow-y: auto; 
    scroll-behavior: smooth;
    padding-right: 10px; /* Space for custom scrollbar */
}

/* Glassmorphic Scrollbar for AI Console */
#aiMessages::-webkit-scrollbar { 
    width: 6px; 
}
#aiMessages::-webkit-scrollbar-track { 
    background: rgba(255,255,255,0.02); 
    border-radius: 4px;
}
#aiMessages::-webkit-scrollbar-thumb { 
    background: rgba(255,255,255,0.15); 
    border-radius: 4px; 
    border: 1px solid rgba(255,255,255,0.05);
}
#aiMessages::-webkit-scrollbar-thumb:hover { 
    background: rgba(var(--primary-rgb), 0.5); 
}

/* Typing Indicator Animation */
.chat-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    border-radius: 0 16px 16px 16px;
    width: fit-content;
    align-self: flex-start;
}
.chat-typing .dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}
.chat-typing .dot:nth-child(1) { animation-delay: -0.32s; }
.chat-typing .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* =========================================
   3. LEADERBOARD SPECIFICS
   ========================================= */
/* Ensure the glass leaderboard stays readable on small screens */
@media (max-width: 600px) {
    .lb-header { padding: 20px 15px; }
    .lb-row { 
        padding: 16px 15px; 
        gap: 12px; 
        flex-direction: column;
        text-align: center;
    }
    .lb-rank { width: auto; font-size: 20px; }
    .lb-avatar { margin: 0 auto; }
    .lb-meta { justify-content: center; flex-wrap: wrap; text-align: center; }
    .dot-separator { display: none; }
    .lb-meta span { display: block; width: 100%; margin: 4px 0; }
}

/* =========================================
   4. HOW IT WORKS TIMELINE SPECIFICS
   ========================================= */
@media (max-width: 768px) {
    .how-it-works-section .container { padding: 0 15px; }
    .timeline-step { 
        padding: 24px 15px 24px 50px; /* Give room for indicator on left */
        margin-bottom: 30px;
    }
}

/* =========================================
   5. LIGHTWEIGHT AOS (Animate On Scroll)
   ========================================= */
/* These classes supplement the AOS library or act as a 
   standalone polyfill if the library isn't loaded immediately.
*/
[data-aos] {
    opacity: 0;
    transition-property: transform, opacity;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 0.8s;
}

[data-aos].aos-animate {
    opacity: 1;
    transform: translate(0);
}

/* Animations Definitions */
[data-aos="fade-up"] { transform: translateY(40px); }
[data-aos="fade-down"] { transform: translateY(-40px); }
[data-aos="fade-left"] { transform: translateX(40px); }
[data-aos="fade-right"] { transform: translateX(-40px); }
[data-aos="zoom-in"] { transform: scale(0.9); }

/* Stagger Delays */
[data-aos-delay="100"] { transition-delay: 0.1s; }
[data-aos-delay="200"] { transition-delay: 0.2s; }
[data-aos-delay="300"] { transition-delay: 0.3s; }
[data-aos-delay="400"] { transition-delay: 0.4s; }
[data-aos-delay="500"] { transition-delay: 0.5s; }
[data-aos-delay="600"] { transition-delay: 0.6s; }
[data-aos-delay="700"] { transition-delay: 0.7s; }

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
    [data-aos] {
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
/* =========================================
   ULTIMATE RESPONSIVE OVERRIDE PATCH
   Guarantees fluidity on Mac, iPad, and iPhone
   ========================================= */

/* Prevent all horizontal scrolling globally */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* 💻 MACBOOK & SMALL DESKTOP (Max: 1200px) */
@media (max-width: 1200px) {
    .container {
        padding: 0 32px;
    }
    .bento-features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .col-span-2 {
        grid-column: span 3;
    }
    .hero-title {
        font-size: clamp(3rem, 6vw, 4rem);
    }
}

/* 📱 TABLET & IPAD (Max: 992px) */
@media (max-width: 992px) {
    .hero {
        padding-top: 120px;
        min-height: auto;
    }
    .hero-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    .hero-text-cell {
        text-align: center;
        padding: 32px 20px;
    }
    .hero-subtitle {
        margin: 0 auto 30px auto;
        max-width: 90%;
    }
    .cta-group {
        justify-content: center;
    }
    .stats-bento-grid {
        grid-template-columns: 1fr 1fr;
    }
    .bento-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .col-span-2 {
        grid-column: span 2;
    }
    .grid-2-col {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .ai-text-content {
        text-align: center;
    }
    .ai-benefits {
        align-items: center;
    }
    .flex-gap {
        justify-content: center;
    }
}

/* 📱 IPHONE & MOBILE (Max: 768px) */
@media (max-width: 768px) {
    .section {
        padding: 60px 0;
    }
    .container {
        padding: 0 20px;
    }
    
    /* Force Bento Cells to stack */
    .bento-cell, .os-card, .bento-feat {
        padding: 24px;
        width: 100%;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    /* Stats grid scaling */
    .stats-bento-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .stat-box {
        text-align: center;
    }
    
    /* Float cards alignment */
    .float-card-cell {
        flex-direction: row;
        text-align: left;
        justify-content: flex-start;
    }

    /* Platform & Features Grid */
    .platform-bento-grid, .bento-features-grid {
        grid-template-columns: 1fr;
    }
    .col-span-2 {
        grid-column: span 1;
    }
    .row-span-2 {
        grid-row: span 1;
    }
    .feat-flex-content {
        flex-direction: column;
        text-align: left;
        align-items: flex-start;
    }

    /* Leaderboard Mobile Fixes */
    .lb-row {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    .lb-meta {
        flex-direction: column;
        gap: 6px;
    }
    .dot-separator {
        display: none;
    }

    /* Navbar Mobile Constraints */
    .navbar {
        padding: 16px 0;
    }
    .nav-links {
        display: none; /* Handled by JS toggle */
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 30px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .nav-links.active {
        display: flex;
    }
    .nav-actions .btn-primary, .nav-actions .btn-ghost {
        display: none;
    }
    
    /* Footer Mobile Constraints */
    .footer-bento-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    .social-links {
        justify-content: center;
    }
    .footer-bio {
        margin: 16px auto 0;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

/* 📱 SMALL IPHONE (Max: 480px) */
@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    .hero-subtitle {
        font-size: 16px;
    }
    .btn-large, .btn-massive {
        padding: 14px 24px;
        font-size: 15px;
        width: 100%;
    }
    .cta-group {
        flex-direction: column;
        width: 100%;
    }
    .marquee-content {
        gap: 30px;
    }
    .timeline-step {
        padding: 20px 15px 20px 40px;
    }
    .step-indicator {
        width: 36px;
        height: 36px;
        font-size: 14px;
        left: -18px;
    }
    .timeline-line {
        left: 0;
    }
    .massive-title {
        font-size: 2.2rem;
    }
    .chat-bubble {
        max-width: 95%;
    }
}