/* =========================================================
   HISTORY MOBILE STYLES (Max-Width: 991px)
   ========================================================= */

@media only screen and (max-width: 991px) {

    /* 1. HERO & INTRO */
    .roadmap-hero {
        height: auto !important;
        min-height: 400px !important;
        padding: 120px 20px 60px 20px !important;
        border-radius: 0 0 50px 50px !important;
        background-attachment: scroll !important;
        text-align: center !important;
    }

    .hero-title {
        font-size: 2.22rem !important;
        line-height: 1.1 !important;
    }

    .hero-lead {
        font-size: 1rem !important;
        margin: 0 auto !important;
    }

    .profile-intro {
        padding: 40px 15px !important;
        margin-top: -30px !important;
    }

    .intro-card {
        padding: 30px 20px !important;
        border-radius: 25px !important;
    }

    .section-title {
        font-size: 1.8rem !important;
    }

    /* 2. TRUE STACKING ROADMAP MOBILE */
    .roadmap-stack-section {
        position: relative;
        height: 800vh !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    .stack-sticky-viewport {
        position: -webkit-sticky !important;
        /* Safari support */
        position: sticky !important;
        top: 85px !important;
        height: calc(100vh - 85px) !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        overflow: visible !important;
        /* Ensure children can stack and peek */
    }

    .roadmap-header-stack {
        margin-bottom: 25px;
    }

    .cards-stack-container {
        width: 100%;
        height: 500px;
        position: relative;
        padding: 0 10px;
    }

    .roadmap-card {
        position: absolute;
        top: 0;
        left: 2.5%;
        width: 95%;
        height: 100%;
        padding: 30px 20px;
        border-radius: 30px;
        text-align: center;
        background: white !important;
        border: 1px solid rgba(6, 78, 59, 0.1) !important;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.05) !important;
        transition: transform 0.08s ease-out, opacity 0.08s ease-out !important;
        /* Slightly faster for mobile */
        opacity: 0;
        visibility: hidden;
        will-change: transform, opacity;
        transform: translate3d(0, 110%, 0);
        /* Force GPU */
        backface-visibility: hidden;
    }

    .card-number {
        font-size: 6rem;
        right: 15px;
        top: -10px;
    }

    .roadmap-card .milestone-icon {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
        margin-bottom: 25px;
    }

    .roadmap-card h3 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

    .roadmap-card p {
        font-size: 1rem;
        line-height: 1.6;
    }

    .roadmap-card .stat-value {
        font-size: 2.8rem;
    }

    .roadmap-card .stat-value small {
        font-size: 0.9rem;
    }

    .production-breakdown {
        padding-top: 15px;
    }

    .prod-row {
        gap: 12px;
        margin-bottom: 12px;
    }

    .prod-label {
        font-size: 0.85rem;
        min-width: 80px;
    }

    .prod-bar {
        height: 8px;
    }

    .cert-badges {
        justify-content: center;
        gap: 10px;
    }

    .cert-badge {
        padding: 8px 15px;
        font-size: 0.8rem;
    }

    .gallery-section {
        padding: 40px 15px !important;
    }

    .gallery-card {
        height: 250px !important;
        margin-bottom: 20px !important;
    }
}

/* 4. EXTRA SMALL DEVICES (PHONES) */
@media only screen and (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem !important;
    }

    .section-title {
        font-size: 1.5rem !important;
    }

    .timeline-item {
        padding-left: 40px !important;
    }

    .timeline-line,
    .timeline-dot {
        left: 15px !important;
    }

    .timeline-content {
        padding: 15px !important;
    }

    .stat-value {
        font-size: 1.3rem !important;
    }

    .timeline-content h3 {
        font-size: 1.1rem !important;
    }
}
