/* =============================================================
   responsive.css  —  LearnGecko
   ALL media queries for every breakpoint.
   Edit ONLY this file when fixing mobile/tablet layout issues.

   Breakpoints used:
   ≤640px  → Phone
   641–1023px → Tablet
   ≥1024px → Desktop (default, no query needed)
   ============================================================= */


/* ══════════════════════════════════════════════════════════════
   BASE SAFEGUARDS (apply at all sizes)
   ══════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}


/* ══════════════════════════════════════════════════════════════
   ① LARGE TABLET / SMALL DESKTOP  (≤1024px)
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {

    /* Bento grid collapses to 6 columns */
    .bento-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    /* Board carousel slides — single column */
    .board-slide-inner {
        grid-template-columns: 1fr;
        padding: 28px;
        gap: 28px;
    }

    .slide-full-section {
        padding: 28px;
        gap: 28px;
    }

    .slide-full-top {
        padding: 28px 28px 20px;
    }

    .slide-full-cards {
        padding: 0 28px 28px;
    }
}


/* ══════════════════════════════════════════════════════════════
   ② TABLET — HERO, GECKO, INSTITUTIONAL  (≤1023px)
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 1023px) {

    /* HERO */
    #knowly-hero>div {
        min-height: unset !important;
        padding: 24px 16px 40px !important;
    }

    #knowly-hero h1 {
        font-size: clamp(2rem, 9vw, 3.5rem) !important;
        line-height: 1.15 !important;
    }

    .shape-container {
        width: 1.5em !important;
    }

    #hero-dashboard-grid {
        grid-template-columns: 1fr !important;
        grid-auto-rows: auto !important;
    }

    #hero-dashboard-grid>div {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
        min-height: unset !important;
        height: auto !important;
    }

    #hero-card-diagnostic {
        flex-direction: column !important;
    }

    #hero-card-diagnostic .diag-half {
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .task-tile-wide {
        width: 100% !important;
    }

    /* GECKO ENGINE */
    #gecko-engine-grid {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }

    #gecko-engine-grid>div {
        grid-column: span 1 !important;
    }

    #gecko-step-content-area {
        min-height: auto !important;
        position: relative !important;
    }

    .gecko-content-pane {
        position: relative !important;
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
        display: none !important;
        grid-template-columns: 1fr !important;
    }

    .gecko-content-pane.active {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    /* INSTITUTIONAL INTELLIGENCE */
    #institutional-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    #institutional-labels-left,
    #institutional-labels-right {
        display: none !important;
    }

    #institutional-box {
        border-radius: 24px !important;
        padding: 24px 16px !important;
    }

    #institutional-box h2 {
        font-size: clamp(1.6rem, 6vw, 2.5rem) !important;
    }
}


/* ══════════════════════════════════════════════════════════════
   ③ MEDIUM TABLET / LARGE PHONE  (≤768px)
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    /* Hide desktop nav links */
    .hero-nav-links {
        display: none;
    }

    /* Bento grid */
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bento-card[style*="span 3"],
    .bento-card[style*="span 4"],
    .bento-card[style*="span 8"],
    .bento-card[style*="span 2"] {
        grid-column: span 2;
    }

    .pill-cloud {
        transform: scale(.8);
    }

    /* Generic section */
    .section {
        padding: 60px 20px;
    }

    .boards-section-wrap {
        padding: 60px 0;
    }
}


/* ══════════════════════════════════════════════════════════════
   ④ DARK BENTO FEATURE CARD SECTION  (≤768px)
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    .bento-section {
        padding: 32px 16px;
    }

    .bento-section .grid {
        grid-template-columns: 1fr;
    }

    .bento-section .card {
        grid-column: 1 !important;
        grid-row: auto !important;
    }
}


/* ══════════════════════════════════════════════════════════════
   ⑤ BOARDS CAROUSEL INNER  (≤767px)
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {

    .board-slide-inner {
        grid-template-columns: 1fr !important;
        padding: 24px !important;
        gap: 24px !important;
    }

    /* Generic Tailwind-utility overrides for older sections */
    .py-24 {
        padding-top: 48px !important;
        padding-bottom: 48px !important;
    }

    .py-20 {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }

    .px-8 {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .text-7xl {
        font-size: 2.5rem !important;
    }

    .text-6xl {
        font-size: 2rem !important;
    }

    .text-5xl {
        font-size: 1.75rem !important;
    }

    /* Competitors + Beta section — stack vertically */
    #competitors-grid,
    #beta-section-content {
        flex-direction: column !important;
    }

    /* Waitlist modal */
    #waitlistModal>div {
        margin: 16px !important;
        max-width: calc(100vw - 32px) !important;
    }

    /* Footer */
    #footer-grid {
        grid-template-columns: 1fr !important;
    }

    #footer-grid>div {
        grid-column: span 1 !important;
    }

    #footer-bottom {
        flex-direction: column !important;
        gap: 16px !important;
    }
}


/* ══════════════════════════════════════════════════════════════
   ⑥ PHONE  (≤640px)  ← PRIMARY MOBILE BREAKPOINT
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {

    /* ── 1. BODY — must always be a normal block on mobile ── */
    body {
        display: block !important;
        align-items: unset !important;
        justify-content: unset !important;
        padding: 0 !important;
        min-height: unset !important;
        overflow-x: hidden !important;
    }

    /* ── 2. Every element fills full width, no side-scroll ── */
    section,
    div,
    header,
    footer,
    nav {
        max-width: 100vw;
        box-sizing: border-box;
    }

    /* ── 3. HERO — dark bento section ── */

    /* Remove the dark strip gap below the stats tiles */
    #knowly-hero {
        margin-bottom: 0 !important;
        border-bottom: none !important;
    }

    #knowly-hero>div {
        padding: 16px !important;
        padding-bottom: 0 !important;
        min-height: unset !important;
    }

    #knowly-hero h1 {
        font-size: clamp(1.9rem, 8.5vw, 3rem) !important;
        line-height: 1.15 !important;
    }

    /* Hero dashboard grid — single column, auto heights */
    #hero-dashboard-grid {
        grid-template-columns: 1fr !important;
        grid-auto-rows: auto !important;
        gap: 10px !important;
        margin-bottom: 0 !important;
    }

    #hero-dashboard-grid>div {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
        min-height: unset !important;
        height: auto !important;
    }

    /* Daily Diagnostic card — stack vertically */
    #hero-card-diagnostic {
        flex-direction: column !important;
        gap: 16px !important;
    }

    .diag-half {
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* The Trusted By strip that follows — remove top gap */
    #knowly-hero+section {
        padding-top: 12px !important;
        margin-top: 0 !important;
        border-top: none !important;
    }

    /* ── 4. BOARDS CAROUSEL ── */
    .board-slide-inner {
        grid-template-columns: 1fr !important;
        padding: 20px !important;
        gap: 16px !important;
    }

    .slide-full-section {
        padding: 20px !important;
        gap: 16px !important;
        flex-direction: column !important;
    }

    .slide-full-top {
        padding: 20px 20px 12px !important;
    }

    .slide-full-cards {
        padding: 0 20px 20px !important;
        flex-direction: column !important;
    }

    /* ── 5. GECKO ENGINE STEPPER ── */
    #gecko-engine-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    #gecko-engine-grid>div {
        grid-column: span 1 !important;
    }

    #gecko-step-content-area {
        min-height: auto !important;
        position: relative !important;
    }

    .gecko-content-pane {
        position: relative !important;
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
        display: none !important;
    }

    .gecko-content-pane.active {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* ── 6. COMPETITORS section ── */
    #competitors-grid,
    .competitors-flex {
        flex-direction: column !important;
    }

    /* ── 7. TEAM grid — 2 columns on phone ── */
    .team-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* ── 8. FAQ accordion ── */
    .faq-question {
        font-size: 0.9rem !important;
    }

    /* ── 9. FOOTER ── */
    #footer-grid {
        grid-template-columns: 1fr !important;
    }

    #footer-grid>div {
        grid-column: span 1 !important;
    }

    #footer-bottom {
        flex-direction: column !important;
        gap: 16px !important;
    }

    /* ── 10. Tailwind utility overrides ── */
    .py-24 {
        padding-top: 48px !important;
        padding-bottom: 48px !important;
    }

    .py-20 {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }

    .px-8 {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .text-7xl {
        font-size: 2.25rem !important;
    }

    .text-6xl {
        font-size: 1.9rem !important;
    }

    .text-5xl {
        font-size: 1.6rem !important;
    }

    /* ── 11. Waitlist modal ── */
    #waitlistModal>div {
        margin: 12px !important;
        max-width: calc(100vw - 24px) !important;
    }

    /* ── 12. Sticky CTA — smaller on phone so it doesn't cover content ── */
    .sticky-cta {
        bottom: 16px !important;
        right: 16px !important;
        font-size: 13px !important;
        padding: 10px 18px !important;
    }

    /* ── 13. Institutional labels grid — show on mobile ── */
    .inst-mobile-labels {
        display: grid !important;
    }
}


/* ══════════════════════════════════════════════════════════════
   ⑦ TABLET — Mid range  (641px – 1023px)
   ══════════════════════════════════════════════════════════════ */

@media (min-width: 641px) and (max-width: 1023px) {

    /* Hero dashboard — 6-column grid on tablet */
    #hero-dashboard-grid {
        grid-template-columns: repeat(6, 1fr) !important;
        grid-auto-rows: auto !important;
    }

    #hero-dashboard-grid>div {
        min-height: unset !important;
    }

    /* Gecko Engine — single column on tablet */
    #gecko-engine-grid {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }

    #gecko-step-content-area {
        position: relative !important;
        min-height: auto !important;
    }

    .gecko-content-pane {
        position: relative !important;
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
        display: none !important;
    }

    .gecko-content-pane.active {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 16px !important;
    }

    /* Team grid — 4 columns on tablet */
    .team-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}