﻿
@media (max-width: 480px) {
    /* ── Hero: single column, board first ── */
    .landing-page .hero {
        display: flex !important;
        flex-direction: column !important;
        min-height: unset !important;
        gap: 1.5rem !important;
        padding: 1rem 3vw !important;
        align-items: center !important;
    }

    /* ── Board panel: full width, first in view ── */
    .landing-page .hero-board-panel {
        order: 1 !important;
        min-width: unset !important;
        max-width: 100% !important;
        width: 100% !important;
        justify-self: center !important;
    }

    /* ── Hero copy: below the board ── */
    .landing-page .hero-copy {
        order: 2 !important;
        max-width: 100% !important;
        justify-self: center !important;
        text-align: center !important;
    }

        .landing-page .hero-copy h1 {
            font-size: clamp(2.2rem, 10vw, 3rem) !important;
            max-width: unset !important;
        }

        .landing-page .hero-copy > p {
            font-size: 0.88rem !important;
            max-width: unset !important;
            margin: 0.75rem 0 0 !important;
        }

    .landing-page .eyebrow {
        font-size: 0.6rem !important;
        padding: 0.35rem 0.6rem !important;
        margin-bottom: 0.6rem !important;
    }

    /* ── CTA buttons: stack vertically ── */
    .landing-page .hero-actions {
        flex-direction: column !important;
        gap: 0.6rem !important;
        margin-top: 1rem !important;
        padding: 0 !important;
    }

    .landing-page .button {
        width: 100% !important;
        min-height: 44px !important;
        font-size: 0.72rem !important;
    }

    /* ── Feature cards: tighter ── */
    .landing-page .feature-list {
        gap: 0.6rem !important;
        margin-top: 1.2rem !important;
    }

    .landing-page .feature-card {
        grid-template-columns: 36px 1fr !important;
        gap: 0.6rem !important;
        padding: 0.75rem !important;
        border-radius: 12px !important;
    }

    .landing-page .feature-card__icon {
        width: 36px !important;
        height: 36px !important;
    }

        .landing-page .feature-card__icon img {
            width: 24px !important;
            height: 24px !important;
        }

    .landing-page .feature-card h3 {
        font-size: 0.82rem !important;
    }

    .landing-page .feature-card p {
        font-size: 0.75rem !important;
    }

    /* ── Board: 44px squares ── */
    .landing-page .chess-square {
        width: 36px !important;
        height: 36px !important;
    }

    .landing-page .chess-board-threed {
        grid-template-columns: repeat(8, 36px) !important;
        grid-template-rows: repeat(8, 36px) !important;
    }

    .landing-page .chess-board-classic {
        grid-template-columns: repeat(8, 36px) !important;
        grid-template-rows: repeat(8, 36px) !important;
    }

    /* ── Board frame: tighter ── */
    .landing-page .board-frame {
        padding: 14px !important;
    }

    /* ── Board stage: less padding ── */
    .landing-page .board-stage {
        padding: 0.6rem !important;
        border-radius: 16px !important;
        max-height: 418px;
    }

    /* ── Disable 3D on mobile ── */
    .landing-page .board-stage--3d {
        perspective: 300px !important;
    }

    .landing-page .board-container-threed {
        transform: rotateX(8deg) rotateZ(0deg) !important;
    }

    /* ── Pieces: flat transform when 3D disabled ── */
    .landing-page .chess-piece-threed {
        transform: rotateX(-18deg) translateY(-3px) translateX(10px) scaleY(var(--piece-scale-y, 1)) scaleX(var(--piece-scale-x, 1)) !important;
        filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.4)) !important;
    }

    /* ── Labels ── */
    .landing-page .ranks {
        height: 288px !important;
        font-size: 0.6rem !important;
        left: 4px !important;
        top: 14px !important;
    }

    .landing-page .files {
        width: 288px !important;
        font-size: 0.6rem !important;
        bottom: 2px !important;
        left: 14px !important;
    }

    /* ── Board status ── */
    /*    .landing-page .board-status {
        position: relative !important;
        left: unset !important;
        right: unset !important;
        top: unset !important;
        font-size: 0.55rem !important;
        margin-bottom: 0.35rem !important;
        justify-content: center !important;
    }*/

    .landing-page .board-status__dot {
        width: 6px !important;
        height: 6px !important;
    }

    /* ── Preview controls: wrap and center ── */
    .landing-page .preview-controls {
        justify-content: center !important;
        gap: 0.4rem !important;
        margin-bottom: 0.5rem !important;
    }

    .landing-page .segmented-control {
        padding: 0.25rem !important;
        font-size: 0.55rem !important;
    }

    .landing-page .segmented-control__label {
        padding: 0 0.35rem 0 0.45rem !important;
        font-size: 0.55rem !important;
    }

    .landing-page .segmented-control__button {
        padding: 0.35rem 0.55rem !important;
        font-size: 0.6rem !important;
    }

    /* ── Board caption: compact ── */
    .landing-page .board-caption {
        padding: 0.65rem 0.85rem !important;
        border-radius: 12px !important;
        margin-top: 0.6rem !important;
    }

        .landing-page .board-caption strong {
            font-size: 0.78rem !important;
        }

        .landing-page .board-caption span {
            font-size: 0.72rem !important;
        }

    .landing-page .board-caption__hint {
        font-size: 0.65rem !important;
    }

    /* ── Demo playback button ── */
    .landing-page .demo-playback-button {
        width: 36px !important;
        height: 36px !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
    }

    /* ── Vision overlay ── */
    .landing-page .vision-helper-overlay {
        left: 14px !important;
        top: 14px !important;
        width: 288px !important;
        height: 288px !important;
    }

    /* ── Moving piece ── */
    .landing-page .moving-piece {
        --sq-size: 36px !important;
        --frame-pad: 14px !important;
        --piece-base-transform: translate(-50%, -50%) rotateX(-18deg) translateY(-6px) translateX(8px) !important;
    }

    @keyframes pieceSlide {
        from {
            transform: translate(-50%, -50%) translate(0, 0);
        }

        to {
            transform: translate(-50%, -50%) translate(var(--move-x), var(--move-y));
        }
    }

    /* ── Fog: slightly simpler for performance ── */
    .landing-page .chess-square.has-fog::before {
        filter: blur(5px) !important;
    }

    /* ── Top nav ── */
    .top-nav {
        height: 52px !important;
        padding: 0 3vw !important;
    }

    .top-nav__mobile {
        display: none;
        align-items: center;
        gap: 0;
    }

    .top-nav__home,
    .top-nav__hamburger {
        width: 38px;
        height: 38px;
        display: grid;
        place-items: center;
        color: #ffe8a0;
        background: transparent;
        border: none;
        font-size: 1.3rem;
        cursor: pointer;
    }

    .mobile-menu {
        display: none;
    }

    @media (max-width: 480px) {
        .brand,
        .nav-links {
            display: none;
        }

        .top-nav {
            justify-content: space-between;
            padding: 0 4vw;
            height: 56px;
        }

        .top-nav__mobile {
            display: flex;
            width: 100%;
            justify-content: space-between;
        }

        .mobile-menu {
            display: flex;
            flex-direction: column;
            background: rgba(5, 5, 6, 0.96);
            backdrop-filter: blur(10px);
            border-bottom: 1px solid rgba(213, 166, 66, 0.25);
            padding: 0.5rem 4vw 1rem;
        }

            .mobile-menu a {
                color: rgba(247, 234, 208, 0.85);
                text-decoration: none;
                font-size: 0.95rem;
                font-weight: 700;
                letter-spacing: 0.05em;
                text-transform: uppercase;
                padding: 0.75rem 0.5rem;
                border-bottom: 1px solid rgba(213, 166, 66, 0.12);
            }
    }

    .landing-page .brand__mark,
    .landing-page .brand__mark > a {
        width: 32px !important;
        height: 32px !important;
        font-size: 1rem !important;
    }

    .landing-page .brand__name,
    .landing-page .brand__name > a {
        font-size: 0.8rem !important;
    }

    .landing-page .brand__tagline {
        display: none !important;
    }

    .landing-page .nav-links {
        gap: 0.6rem !important;
    }

        .landing-page .nav-links a {
            font-size: 0.6rem !important;
            letter-spacing: 0.04em !important;
        }

    .landing-page .nav-links__login {
        padding: 0.4rem 0.65rem !important;
    }

    /* ── Specter pulse: reduce for performance ── */
    .landing-page .chess-piece-threed.unknown-piece,
    .landing-page .chess-piece-classic.unknown-piece {
        animation: specterPulse 2.5s ease-in-out infinite !important;
    }
}
