/* Shared phone layout. Loaded last, after each page's theme. */
.mobile-menu-button { display: none; }
@media (max-width: 800px) {
    html { scroll-padding-top: 90px; }
    body { -webkit-text-size-adjust: 100%; }
    body :is(.navbar, .content-section, .hero-content, .product-hero-content, .darc-hero-content) { min-width: 0; }
    body:is(.systems-theme, .darc-theme) .navbar {
        top: max(10px, env(safe-area-inset-top)); left: 4%; width: 92%;
        min-height: 60px; height: auto; padding: 10px 16px;
        border-radius: 16px; gap: 8px 12px; flex-wrap: wrap;
    }
    body:is(.systems-theme, .darc-theme) .navbar-logo { margin-right: auto; font-size: 16px; letter-spacing: 1.2px; white-space: nowrap; }
    /* A usable wrapping navigation remains available when JavaScript is off. */
    body:is(.systems-theme, .darc-theme) .navbar-links { display: flex; flex-wrap: wrap; gap: 0 14px; margin: 0; }
    body:is(.systems-theme, .darc-theme) .navbar-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; }
    .mobile-nav-ready .navbar { flex-wrap: nowrap; }
    .mobile-nav-ready .mobile-menu-button {
        display: inline-flex; align-items: center; justify-content: center; gap: 9px;
        min-width: 76px; min-height: 42px; padding: 8px 10px;
        border: 1px solid #b7c5d338; border-radius: 10px;
        background: #20293388; color: #f0f4f6; font: 600 12px 'Segoe UI', Arial, sans-serif;
        cursor: pointer; touch-action: manipulation;
    }
    .menu-icon { display: grid; gap: 4px; width: 16px; }
    .menu-icon::before, .menu-icon::after { content: ''; height: 1px; background: currentColor; transition: transform .15s; }
    [aria-expanded="true"] .menu-icon::before { transform: translateY(2.5px) rotate(45deg); }
    [aria-expanded="true"] .menu-icon::after { transform: translateY(-2.5px) rotate(-45deg); }
    .mobile-nav-ready .navbar-links[hidden] { display: none !important; }
    .mobile-nav-ready .navbar-links:not([hidden]) {
        position: absolute; top: calc(100% + 8px); left: 0; right: 0;
        display: flex; flex-direction: column; align-items: stretch; gap: 3px;
        max-height: calc(100dvh - 110px); overflow-y: auto; overscroll-behavior: contain;
        padding: 10px; border: 1px solid #b7c5d338; border-radius: 16px;
        background: #111920f5; box-shadow: 0 16px 32px #0006;
        backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    }
    .mobile-nav-ready .navbar-links a { min-height: 46px; padding: 10px 14px; border-radius: 9px; font-size: 15px; }
    .mobile-nav-ready .navbar-links a:is(:hover, :focus-visible) { background: #d6e1eb10; }
    .darc-theme .mobile-menu-button { background: #24352188; border-color: #c0e79438; }
    .darc-theme.mobile-nav-ready .navbar-links:not([hidden]) { background: #102017f5; border-color: #c0e79438; }
    body :is(a, button):focus-visible { outline: 2px solid #ff8880; outline-offset: 4px; }
    .darc-theme :is(a, button):focus-visible { outline-color: #c0e794; }

    .systems-theme .content-section, .darc-theme .content-section {
        padding-top: 46px; padding-bottom: 46px; scroll-margin-top: 90px;
    }
    .systems-theme .section-heading, .darc-theme .section-heading {
        font-size: clamp(26px, 7vw, 36px); line-height: 1.18; margin-bottom: 24px;
        overflow-wrap: break-word;
    }
    .systems-theme .section-description, .darc-theme .section-description { font-size: 15.5px; line-height: 1.7; }
    .systems-theme .button, .darc-theme .button { min-height: 46px; padding: 12px 18px; line-height: 1.5; touch-action: manipulation; }
    .systems-theme :is(.hero, .product-hero) { padding-top: 120px; }
    .darc-hero { padding-top: 120px; }
    .systems-theme .product-hero { min-height: 76svh; padding-bottom: 60px; }
    .systems-theme .product-hero h1 { font-size: clamp(37px, 10vw, 66px); }
    .systems-theme .product-intro-grid, .darc-theme .product-intro-grid { grid-template-columns: minmax(0, 1fr); }
    .systems-theme .feature-box { padding: 22px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 18px 12px; }
    .systems-theme .feature-box strong { overflow-wrap: anywhere; }
    .systems-theme .contact-section, .darc-theme .contact-section { padding-bottom: 70px; }
    .systems-theme footer, .darc-theme footer { padding: 24px 7% max(24px, env(safe-area-inset-bottom)); font-size: 12px; line-height: 1.7; }

    /* Keep the ESP32 antenna and shield recognizable without a full-screen spacer. */
    .circuit-home .hero { padding: 106px 8% 85px; min-height: auto; }
    .circuit-home main::after { inset: 87px 7px 24px; }
    .circuit-home .circuit-chip { padding: 116px 22px 99px; }
    .circuit-home .hero h1 { font-size: clamp(36px, 10vw, 68px); line-height: 1.05; }
    .circuit-home .hero h2 { font-size: 18px; line-height: 1.45; margin-top: 12px; }
    .circuit-home .hero p { font-size: 15px; line-height: 1.65; margin-top: 24px; }
    .circuit-home .hero .eyebrow { font-size: 9px; letter-spacing: 1.5px; margin-bottom: 14px; }
    .circuit-home .hero .eyebrow::before { width: 6px; height: 6px; margin-right: 9px; }
    .circuit-home .hero-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 26px; }
    .circuit-home .hero-buttons .button { display: flex; align-items: center; justify-content: center; padding: 12px 10px; font-size: 13px; text-align: center; }
    .circuit-home .module-signature { bottom: 26px; right: 22px; gap: 4px; }
    .circuit-home .project-card-content { min-height: 330px; padding: 24px; }
    .circuit-home .project-card { min-height: 330px; }
    .circuit-home .project-card h3 { font-size: 26px; }
    .circuit-home .project-fullname { font-size: 11px; overflow-wrap: break-word; }
    .circuit-home .project-card p { font-size: 15px; line-height: 1.65; }
    .circuit-home .development-item { padding: 23px; }
    .circuit-home #projects .project-grid { margin-top: 74px; }
}
@media (max-width: 600px) {
    .systems-theme :is(.project-grid, .feature-grid, .development-grid, .app-download-grid) { grid-template-columns: minmax(0, 1fr); }
    .systems-theme .gallery-item { min-height: 230px; }
    .systems-theme .gallery-item-large { min-height: 270px; }
    .systems-theme .app-download-card { padding: 24px; }
    .darc-theme .spec-row { grid-template-columns: minmax(0, 1fr); gap: 5px; padding: 16px 0; }
    .darc-theme .spec-row strong { font-size: 14px; }
    .darc-highlight-box, .mesh-box, .wifi-csi-box, .darc-recon-copy { padding: 22px; }
    .darc-recon-card .darc-recon-image figcaption { padding: 15px 22px; }
    .circuit-home::before { background-size: auto, auto, 160px 160px, 720px 585px, auto; opacity: .8; }
    .circuit-light, .circuit-pulse { filter: drop-shadow(0 0 3px #ff3333); }
    .circuit-component.is-processing { filter: drop-shadow(0 0 3px #ff4848); }
}
@media (max-width: 380px) {
    body:is(.systems-theme, .darc-theme) .navbar { padding: 9px 12px; }
    body:is(.systems-theme, .darc-theme) .navbar-logo { font-size: 14px; letter-spacing: 1px; }
    .mobile-nav-ready .mobile-menu-button { min-width: 70px; }
    .circuit-home .hero-buttons { grid-template-columns: minmax(0, 1fr); }
    .circuit-home .circuit-chip { padding-right: 20px; padding-left: 20px; }
}
@media (prefers-reduced-motion: reduce) { .menu-icon::before, .menu-icon::after { transition: none; } }
