/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — Docker Image Updater Landing Page
   Strategy: cascade over style.css (loaded after), no !important spam   
   Breakpoints: 1280 | 1024 | 900 | 768 | 640 | 480 | 375
   ════════════════════════════════════════════════════════════════ */

/* ── 1280px — MacBook Air 13" / Pro 14" native scale ────────── */
@media (max-width: 1280px) {
    :root {
        --max-width: 1180px;
    }

    .container {
        padding: 0 2rem;
    }

    /* Hero: disable the bleed-out video effect at this width */
    .hero-video-wrap {
        width: 100%;
        transform: none;
        margin-top: 0;
    }

    .hero-inner {
        gap: 2rem;
    }

    .footer-top {
        gap: 2rem;
    }
}

/* ── 1024px — Tablet landscape / small laptops ───────────────── */
@media (max-width: 1024px) {

    /* ── Mobile Navigation ── */
    .mobile-menu-btn {
        display: flex;
        z-index: 1001;
    }

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(8, 9, 13, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
        padding: 2rem 1.5rem;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        display: flex;
        overflow-y: auto;
        border-left: 1px solid var(--border-default);
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-links a {
        font-size: 1.2rem;
        font-weight: 600;
        width: 100%;
        max-width: 320px;
        text-align: center;
        padding: 1rem 1.5rem;
        border-radius: 10px;
        color: var(--text-secondary);
        border-bottom: 1px solid var(--border-default);
    }

    .nav-links li:last-child a {
        border-bottom: none;
    }

    .nav-links a:hover {
        color: var(--text-primary);
        background: rgba(255, 255, 255, 0.05);
    }

    .hide-mobile {
        display: none !important;
    }

    /* ── Footer ── */
    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

/* ── 900px — Hero stacks, layout simplifies ──────────────────── */
@media (max-width: 900px) {

    /* ── Hero ── */
    .hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2.5rem;
    }

    .hero-eyebrow {
        justify-content: center;
    }

    .hero-text .lead {
        max-width: unset;
    }

    .hero-ctas {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-video-wrap {
        width: 100%;
        transform: none;
        margin-right: 0;
    }

    /* ── Section layouts ── */
    .split-layout {
        grid-template-columns: 1fr;
        direction: ltr;
        gap: 2.5rem;
    }

    .split-layout.reverse {
        direction: ltr;
    }

    .problem-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    /* ── Steps flow ── */
    .steps-flow {
        grid-template-columns: 1fr;
        max-width: 460px;
        margin-left: auto;
        margin-right: auto;
        gap: 0;
    }

    .step-connector {
        padding: 0.5rem 0;
        flex-direction: row;
        justify-content: center;
    }

    .step-connector i {
        transform: rotate(90deg);
    }

    /* ── Architecture SVG: scrollable on smaller screens ── */
    .arch-wrap {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        padding-bottom: 0.75rem;
    }

    .arch-svg {
        min-width: 820px;
        width: 820px;
    }

    /* ── Registry feature card ── */
    .registry-card-content {
        flex-direction: column;
        gap: 1.5rem;
        align-items: flex-start;
    }

    .registry-tiles {
        width: 100%;
        grid-template-columns: repeat(3, 1fr);
    }

    /* ── Log Dashboard ── */
    .log-dashboard-wrapper {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
    }

    .dashboard-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-default);
    }

    .sidebar-services {
        display: flex;
        flex-direction: row;
        padding: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .service-item {
        flex-shrink: 0;
        border-left: 3px solid transparent;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
    }

    .service-item.active {
        border-left-color: transparent;
        border-bottom-color: var(--accent-blue);
    }

    .dashboard-toolbar {
        height: auto;
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.875rem 1.25rem;
    }

    .dashboard-terminal {
        font-size: 0.875rem;
        min-height: 260px;
    }
}

/* ── 768px — Tablet portrait ─────────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --nav-height: 64px;
    }

    .section {
        padding: 3.5rem 0;
    }

    .container {
        padding: 0 1.25rem;
    }

    h2 {
        font-size: clamp(1.6rem, 5vw, 2.25rem);
    }

    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    /* ── Hero ── */
    .hero {
        padding-top: calc(var(--nav-height) + 2.5rem);
        padding-bottom: 3rem;
    }

    h1 {
        font-size: clamp(2rem, 7vw, 2.75rem);
    }

    .hero-ctas {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .hero-ctas .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .hero-stats {
        gap: 1rem;
    }

    /* ── Features bento → single column ── */
    .features-bento {
        grid-template-columns: 1fr;
    }

    .feature-wide,
    .feature-full {
        grid-column: span 1;
    }

    .registry-tiles {
        grid-template-columns: repeat(2, 1fr);
    }

    /* ── Comparison table: horizontal scroll ── */
    .comparison-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0.5rem 0;
        border-radius: 12px;
    }

    .comparison-table {
        min-width: 460px;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }

    /* ── Install block ── */
    .install-code {
        font-size: 0.825rem;
        padding: 1.5rem 1.25rem;
    }

    /* ── CTA section ── */
    .cta-card {
        padding: 3rem 1.5rem;
    }

    .cta-card h2 {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }

    .cta-actions {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .cta-actions .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .cta-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }

    /* ── Footer ── */
    .footer-top {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-brand {
        grid-column: 1;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
        padding: 1.5rem 0;
    }

    /* ── Dashboard toolbar: strip less-useful controls ── */
    .tool-pill,
    .tool-toggle {
        display: none;
    }

    .toolbar-right {
        width: 100%;
    }

    .tool-btn {
        flex: 1;
        justify-content: center;
    }
}

/* ── 640px — Large phones ────────────────────────────────────── */
@media (max-width: 640px) {

    /* Hero stats: remove dividers so stats wrap cleanly */
    .stat-divider {
        display: none;
    }

    .hero-stats {
        gap: 0.75rem;
    }

    /* Problem list: tighter spacing */
    .problem-list {
        gap: 1.25rem;
    }

    /* Steps: compact cards */
    .step-card {
        padding: 2rem 1.25rem;
    }

    /* Dashboard terminal: reduce font */
    .dashboard-terminal {
        font-size: 0.78rem;
        line-height: 1.75;
        padding: 1.25rem 1rem;
    }

    .l-tag {
        font-size: 0.7rem;
        padding: 2px 5px;
    }

    /* Install block */
    .install-code {
        font-size: 0.78rem;
        line-height: 1.9;
    }

    /* FAQ */
    .faq-q {
        padding: 1rem 1.25rem;
        font-size: 0.9rem;
    }

    .faq-a {
        padding: 0 1.25rem;
    }

    .faq-item.open .faq-a {
        padding: 0 1.25rem 1rem;
    }
}

/* ── 480px — Standard mobile ─────────────────────────────────── */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    h1 {
        font-size: clamp(1.75rem, 8vw, 2.25rem);
    }

    h3 {
        font-size: 1.1rem;
    }

    .section {
        padding: 2.75rem 0;
    }

    /* ── Navbar ── */
    .logo span:not(.logo-icon) {
        display: none;
    }

    .nav-btns-wrapper .btn-primary {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        gap: 0.35rem;
    }

    .nav-btns-wrapper .btn-primary i {
        display: none;
    }

    /* ── Hero ── */
    .hero {
        padding-top: calc(var(--nav-height) + 2rem);
        padding-bottom: 2.5rem;
    }

    .hero-ctas .btn-lg {
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }

    /* ── Terminal mockup ── */
    .terminal-body {
        padding: 1rem;
        font-size: 0.775rem;
        min-height: 200px;
    }

    /* ── Solution card ── */
    .solution-card {
        padding: 1.25rem;
    }

    /* Hide tag column on very narrow screens to avoid overflow */
    .svc-tag {
        display: none;
    }

    .service-row {
        padding: 0.75rem 0.875rem;
        gap: 0.75rem;
    }

    /* ── Feature cards ── */
    .feature-card {
        padding: 1.25rem;
    }

    /* ── Registry tiles ── */
    .registry-tiles {
        grid-template-columns: repeat(2, 1fr);
    }

    /* ── Architecture SVG: smaller min-width for phones ── */
    .arch-svg {
        min-width: 660px;
        width: 660px;
    }

    /* ── Install block ── */
    .install-code {
        font-size: 0.7rem;
        padding: 1.25rem 1rem;
    }

    /* ── CTA ── */
    .cta-card {
        padding: 2.5rem 1.25rem;
    }

    /* ── Dashboard sidebar ── */
    .sidebar-id {
        padding: 0.875rem 1rem;
        font-size: 0.65rem;
    }

    .service-item {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        gap: 0.5rem;
    }

    /* ── Footer ── */
    .chai-link {
        font-size: 0.8rem;
    }
}

/* ── 375px — Small phones (iPhone SE) ───────────────────────── */
@media (max-width: 375px) {
    h1 {
        font-size: 1.8rem;
    }

    .btn-lg {
        padding: 0.75rem 1.1rem;
        font-size: 0.875rem;
    }

    /* Hide nav CTA at very small widths */
    .nav-btns-wrapper .btn-primary {
        display: none;
    }

    .comparison-table {
        min-width: 400px;
    }

    .install-code {
        font-size: 0.65rem;
    }

    .arch-svg {
        min-width: 600px;
        width: 600px;
    }

    /* Compact hero stats */
    .hero-stats {
        gap: 0.5rem;
    }

    .stat {
        font-size: 0.78rem;
    }
}