/* ═══════════════════════════════════════════════════════════
   SpaceEconomy.lk — Full Responsive Stylesheet
   All devices: Mobile → Tablet → Desktop
═══════════════════════════════════════════════════════════ */

/* ─── BASE ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body { overflow-x: hidden; }
img, svg { max-width: 100%; display: block; }

/* ─── CUSTOM SCROLLBAR ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #07111F; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #00C2FF; }

/* ─── GLASSMORPHISM ─────────────────────────────────────────── */
.glass {
    background: rgba(17,24,39,0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(209,213,219,0.1);
}

/* ─── MOBILE NAV MENU ───────────────────────────────────────── */
#mobile-menu {
    display: none;
    position: fixed;
    top: 80px;
    left: 0; right: 0;
    background: rgba(7,17,31,0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(209,213,219,0.1);
    z-index: 49;
    padding: 1.5rem;
    flex-direction: column;
    gap: 0;
}
#mobile-menu.open { display: flex; }
#mobile-menu a {
    display: block;
    padding: 14px 0;
    color: #D1D5DB;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    text-decoration: none;
    transition: color 0.2s;
}
#mobile-menu a:hover { color: #00C2FF; }
#mobile-menu .mob-cta {
    margin-top: 1rem;
    padding: 14px;
    background: linear-gradient(135deg, #5B3DF5, #00C2FF);
    border-radius: 10px;
    text-align: center;
    color: white;
    font-weight: 600;
    border-bottom: none;
}

/* ─── HERO CANVAS ───────────────────────────────────────────── */
#hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ─── HUD CARDS ─────────────────────────────────────────────── */
.hud-card {
    position: relative;
    overflow: hidden;
}
.hud-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 100%);
    pointer-events: none;
}

/* ─── HERO BUTTONS ──────────────────────────────────────────── */
.hero-btn-primary {
    padding: 14px 28px;
    background: linear-gradient(135deg, #5B3DF5, #00C2FF);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 24px rgba(91,61,245,0.4);
    white-space: nowrap;
}
.hero-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 36px rgba(0,194,255,0.5); }

.hero-btn-secondary {
    padding: 14px 28px;
    background: transparent;
    color: #D1D5DB;
    border: 1px solid rgba(209,213,219,0.2);
    border-radius: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    backdrop-filter: blur(8px);
    white-space: nowrap;
}
.hero-btn-secondary:hover { border-color: rgba(0,194,255,0.5); background: rgba(0,194,255,0.05); color: #fff; }

/* ─── KEYFRAMES ─────────────────────────────────────────────── */
@keyframes rocketFloat {
    0%,100% { transform: translateY(0) rotate(-2deg); }
    50%     { transform: translateY(-24px) rotate(0deg); }
}
@keyframes rocketLaunch {
    0%   { bottom: -60px; opacity: 0; }
    5%   { opacity: 1; }
    100% { bottom: 110%; opacity: 0.3; }
}
@keyframes flameFlicker {
    0%   { transform: scaleY(1) scaleX(1); opacity: 0.85; }
    100% { transform: scaleY(1.18) scaleX(0.88); opacity: 1; }
}
@keyframes engineGlow {
    0%   { opacity: 0.5; transform: translateX(-50%) scaleX(1); }
    100% { opacity: 0.9; transform: translateX(-50%) scaleX(1.2); }
}
@keyframes smokeDrift {
    0%   { transform: translateY(0) scale(1);   opacity: 0.25; }
    100% { transform: translateY(40px) scale(2); opacity: 0; }
}
@keyframes orbitSpin1 {
    from { transform: rotateX(70deg) rotateZ(20deg) rotateY(0deg); }
    to   { transform: rotateX(70deg) rotateZ(20deg) rotateY(360deg); }
}
@keyframes orbitSpin2 {
    from { transform: rotateX(65deg) rotateZ(-10deg) rotateY(0deg); }
    to   { transform: rotateX(65deg) rotateZ(-10deg) rotateY(-360deg); }
}
@keyframes orbitDot {
    0%   { transform: rotate(0deg)   translateX(160px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(160px) rotate(-360deg); }
}
@keyframes floatUD {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(-10px); }
}
@keyframes ping {
    0%   { transform: scale(1);   opacity: 0.7; }
    100% { transform: scale(2.2); opacity: 0; }
}
@keyframes dashMove { to { stroke-dashoffset: -24; } }
@keyframes lensFlare {
    0%,100% { opacity: 0.5; transform: scale(1); }
    50%     { opacity: 1;   transform: scale(1.4); }
}
@keyframes float {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(-20px); }
}
@keyframes pulse {
    0%,100% { opacity: 1; transform: scale(1); }
    50%     { opacity: 0.5; transform: scale(0.85); }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE FIRST — max-width: 640px (phones)
═══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

    /* ── HERO ── */
    #hero { min-height: 100svh; }

    /* Hide rocket scene on small phones — keep background canvas */
    #rocket-scene { display: none !important; }

    /* HUD cards hidden on mobile to keep it clean */
    #hero > div[style*="right:1.5rem;top:30%"],
    #hero > div[style*="bottom:4rem"] { display: none !important; }

    /* Hero text section adjustments */
    #hero .gsap-hero-text {
        max-width: 100% !important;
        padding: 6rem 0 4rem !important;
    }

    #hero h1 {
        font-size: clamp(2.2rem, 9vw, 3rem) !important;
        line-height: 1.1 !important;
    }

    #hero p { font-size: 0.95rem !important; }

    /* Make buttons full-width on phones */
    #hero .gsap-hero-text > div:nth-child(4) {
        flex-direction: column !important;
    }
    .hero-btn-primary,
    .hero-btn-secondary {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
    }

    /* Mini stats row — 3 columns on phone */
    #hero .gsap-hero-text > div:last-child {
        gap: 1.2rem !important;
    }

    /* Left gradient full-width on mobile (covers entire hero) */
    #hero > div[style*="linear-gradient(90deg"] {
        background: linear-gradient(180deg, rgba(7,17,31,0.5) 0%, rgba(7,17,31,0.85) 100%) !important;
    }

    /* ── MAIN LAYOUT — reduce section gaps ── */
    main { gap: 4rem !important; }

    /* ── STATS CARDS — single column ── */
    .gsap-stat-card { padding: 1.5rem !important; }

    /* ── WHAT IS SPACE ECONOMY — stack ── */
    section .grid.lg\:grid-cols-2 { grid-template-columns: 1fr !important; }

    /* ── SRI LANKA FOCUS CARDS — full width ── */
    .gsap-sl-card { padding: 1.5rem !important; }
    .gsap-sl-card.lg\:col-span-2 { grid-column: span 1 !important; }

    /* ── BENTO GRID — 1 col on mobile ── */
    .grid.grid-cols-2.md\:grid-cols-4 {
        grid-template-columns: 1fr !important;
        auto-rows: unset !important;
    }
    .gsap-bento.col-span-2.row-span-2,
    .gsap-bento.col-span-2 {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
        height: 200px !important;
    }

    /* ── CAREER CARDS — single col ── */
    .gsap-career-card { padding: 1.25rem !important; }

    /* ── TIMELINE — simplify to single column ── */
    .border-l.border-light-gray\/20 { margin-left: 0.75rem !important; }
    .gsap-timeline-item .md\:w-1\/2 { width: 100% !important; padding-left: 1rem !important; text-align: left !important; }
    .gsap-timeline-item .md\:w-1\/2.md\:ml-auto { margin-left: 0 !important; }
    .gsap-timeline-item .absolute { left: -9px !important; }

    /* ── COMMUNITY SECTION ── */
    section .max-w-5xl.mx-auto { padding: 2rem 1.25rem !important; border-radius: 1.25rem !important; }
    section .max-w-5xl .flex.flex-wrap { flex-direction: column !important; }
    section .max-w-5xl button { width: 100% !important; justify-content: center; }

    /* ── FOOTER — stack ── */
    footer .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-5 {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    footer .lg\:col-span-2 { grid-column: span 1 !important; }
    footer .flex.flex-col.md\:flex-row.justify-between.items-center {
        flex-direction: column !important;
        text-align: center;
        gap: 0.75rem !important;
    }
    /* Index bar in footer */
    footer .flex.flex-col.md\:flex-row.justify-between.items-center.gap-6 {
        flex-direction: column !important;
        text-align: center;
    }
    footer .flex.gap-8.text-center { gap: 1.5rem !important; }

    /* ── NAVBAR — padding ── */
    header .max-w-7xl { padding-left: 1rem !important; padding-right: 1rem !important; }

    /* ── SECTION PADDING ── */
    section[class*="px-6"] { padding-left: 1rem !important; padding-right: 1rem !important; }
    footer .max-w-7xl { padding-left: 1rem !important; padding-right: 1rem !important; }
}

/* ═══════════════════════════════════════════════════════════
   TABLET — 641px – 1023px
═══════════════════════════════════════════════════════════ */
@media (min-width: 641px) and (max-width: 1023px) {

    /* ── HERO ── */
    #rocket-scene {
        width: 45% !important;
        opacity: 0.7;
    }
    #rocket-scene #rocket-wrap svg { width: 100px !important; height: 240px !important; }

    /* HUD right — reposition slightly */
    #hero > div[style*="right:1.5rem;top:30%"] { right: 0.75rem !important; top: 20% !important; }
    #hero > div[style*="bottom:4rem"] { bottom: 2rem !important; right: 0.75rem !important; }
    .hud-card span[style*="font-size:11px"] { font-size: 9px !important; }

    #hero h1 { font-size: clamp(2.4rem, 5vw, 3.8rem) !important; }

    /* ── BENTO — 2 col on tablet ── */
    .grid.grid-cols-2.md\:grid-cols-4 { grid-template-columns: repeat(2, 1fr) !important; }

    /* ── TIMELINE — single col on tablet ── */
    .gsap-timeline-item .md\:w-1\/2 { width: 100% !important; padding-left: 2rem !important; text-align: left !important; }
    .gsap-timeline-item .md\:w-1\/2.md\:ml-auto { margin-left: 0 !important; }
    .gsap-timeline-item .absolute { left: -9px !important; }

    /* ── FOOTER ── */
    footer .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-5 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    footer .lg\:col-span-2 { grid-column: span 2 !important; }

    /* ── CAREER GRID ── */
    .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ═══════════════════════════════════════════════════════════
   LARGE DESKTOP — 1280px+
═══════════════════════════════════════════════════════════ */
@media (min-width: 1280px) {
    #hero h1 { font-size: 4.5rem !important; }
}

/* ─── UTILITY: Touch-friendly tap targets ───────────────────── */
@media (hover: none) {
    .hero-btn-primary:hover, .hero-btn-secondary:hover { transform: none; }
    a, button { -webkit-tap-highlight-color: rgba(0,194,255,0.15); }
}

/* ─── REDUCED MOTION ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
