/* ==========================================================================
   Mobile Responsive
   Consolidated responsive rules (768px primary, 375px small phone,
   769-1024px tablet) plus iOS safe-area padding. Accessibility overrides
   live in base.css under prefers-reduced-motion.
   ========================================================================== */

/* --- Large mobile / tablet (769px - 1024px) --- */
@media (min-width: 769px) and (max-width: 1024px)
{
    :root { --section-padding: clamp(64px, 7vw, 88px) 0; }
    .nav-logo { font-size: 1.05rem; letter-spacing: 0.16em; }
    .albums-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}

/* --- Primary breakpoint (max 768px) --- */
@media (max-width: 768px)
{
    :root { --section-padding: 64px 0; --header-h: 62px; }

    /* --- Nav becomes a drawer --- */
    .nav-toggle { display: grid; }

    .nav-links
    {
        position: fixed;
        top: var(--header-h);
        left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin: 0;
        padding: 12px 20px 26px;
        background: var(--color-surface-glass);
        backdrop-filter: blur(18px) saturate(140%);
        -webkit-backdrop-filter: blur(18px) saturate(140%);
        border-bottom: 1px solid var(--color-border);
        transform: translateY(-140%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.35s ease, opacity 0.3s ease, visibility 0.3s;
        z-index: 999;
    }
    .nav-links.is-open
    {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-link
    {
        display: block;
        padding: 15px 4px;
        font-size: var(--fs-base);
        border-bottom: 1px solid var(--color-border);
    }
    .nav-link::after { display: none; }
    .nav-link.is-active { color: var(--color-accent); }

    .nav-links li:last-child
    {
        display: flex;
        justify-content: center;
        padding-top: 18px;
    }

    /* --- Hero --- */
    .hero { min-height: 92svh; padding-top: calc(var(--header-h) + 32px); }
    .logo { letter-spacing: 0.14em; text-indent: 0.14em; }
    .hero-actions .btn { flex: 1 1 auto; justify-content: center; }

    /* --- Sections --- */
    .section-header { max-width: 100%; }
    .pillars { grid-template-columns: 1fr; gap: 16px; margin-top: 36px; }
    .albums-grid { grid-template-columns: 1fr; gap: 28px; }
    .album-card { padding: 20px; }

    /* --- Buttons / chips --- */
    .music-btn { flex: 1 1 46%; justify-content: center; }
    .social-link { flex: 1 1 100%; }
    .back-to-top { right: 14px; bottom: 14px; width: 42px; height: 42px; }
}

/* --- Small mobile (max 375px) --- */
@media (max-width: 375px)
{
    .logo { font-size: 2rem; }
    .btn { padding: 12px 18px; letter-spacing: 0.1em; }
    .music-btn { flex: 1 1 100%; }
    .album-card { padding: 16px; }
    .deck { padding: 16px; }
    .scroll-cue { display: none; }
}

/* --- Touch devices --- */
@media (hover: none) and (pointer: coarse)
{
    .album-card:hover,
    .pillar-card:hover,
    .music-btn:hover,
    .chip:hover,
    .social-link:hover { transform: none; }
    .nav-link:hover { color: inherit; }
}

/* --- iOS / notched devices --- */
@supports (padding: env(safe-area-inset-bottom))
{
    .back-to-top { bottom: calc(14px + env(safe-area-inset-bottom)); right: calc(14px + env(safe-area-inset-right)); }
    .footer { padding-bottom: calc(clamp(64px, 8vw, 96px) + env(safe-area-inset-bottom)); }
    .nav-links { padding-left: calc(20px + env(safe-area-inset-left)); padding-right: calc(20px + env(safe-area-inset-right)); }
}

/* --- Print --- */
@media print
{
    .site-header, .scroll-progress, .back-to-top, .scroll-cue,
    .hero-glow, .player-frame, .theme-toggle { display: none !important; }
    body { background: #fff; color: #000; }
    .section, .footer { padding-block: 24px; }
}
