/* ===== Responsive Styles ===== */

/* ===== Home Page Responsive ===== */
@media (max-width: 900px) {
    .key-grid { grid-template-columns: repeat(3, 1fr); }
    .hero-demo-block {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .hero-demo-grid {
        gap: 0.75rem;
        margin: 0 auto;
        max-width: 500px;
    }
    .hero-content {
        gap: 1.5rem;
    }
    .hero-demo-video-block {
        max-width: 260px;
        margin: 0 auto 1.5rem;
    }
    .works {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-demo-video-block {
        margin-top: 1.5rem;
    }
    body.now-playing-visible .hero-demo-video-block {
        margin-top: 1.25rem;
        padding-top: 0.5rem;
    }
    .ticker-item { font-size: 0.85rem; padding: 0 1rem; }
    .key-grid { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
    .key-card { padding: 1rem 0.5rem; font-size: 0.8rem; }
}


@media (max-width: 640px) {
    .key-grid { grid-template-columns: repeat(2, 1fr); }
    .block-divider { height: 2.5rem; }
    .block-divider-alt { height: 2rem; }
    .hero-demo-video-block {
        margin-top: 1.5rem;
    }
    body.now-playing-visible .hero-demo-video-block {
        margin-top: 1rem;
        padding-top: 0.5rem;
    }
    .hero { padding: 4rem 1rem 2.5rem; }
    .hero-content {
        gap: 1.25rem;
        padding: 0 0.5rem;
    }
    body.now-playing-visible .hero-content {
        padding-top: 1.5rem;
    }
    .hero h1.hero-title {
        font-size: clamp(1.75rem, 5.5vw, 2.75rem);
        margin: 0 0 1.25rem;
        line-height: 1.5;
        padding: 0 0.5rem;
    }
    .hero-line {
        line-height: 1.6;
    }
    .hero-line-1 {
        line-height: 1.4;
    }
    .hero-line-2 {
        font-size: 0.58em;
        margin-top: 0.5em;
        line-height: 1.6;
    }
    .hero-line-3 {
        font-size: 0.48em;
        margin-top: 0.9em;
        line-height: 1.7;
    }
    .hero-demo-video-block {
        max-width: 240px;
        margin: 1.5rem auto 1rem;
    }
    .hero-demo-block {
        margin: 1.5rem 0;
        padding: 0 0.5rem;
        display: flex;
        justify-content: center;
    }
    .hero-demo-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        justify-items: center;
        max-width: 100%;
    }
    .hero-demo-player-small {
        padding: 0.65rem;
    }
    .hero-demo-visualizer-small {
        height: 35px;
        gap: 2px;
    }
    .hero-demo-beat-small {
        width: 3px;
        min-height: 4px;
        max-height: 24px;
    }
    .hero-demo-play-small {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.7rem;
    }
    .hero-demo-title-small {
        font-size: 0.75rem;
    }
    .hero-demo-time-small {
        font-size: 0.65rem;
    }
    .section { padding: 2.5rem 0; }
    .container { padding: 0 1rem; }
    .container-narrow { padding: 0 1rem; }
    .youtube-grid { grid-template-columns: 1fr; }
    .hero-buttons { flex-direction: column; width: 100%; max-width: 280px; margin: 0 auto; }
    .hero-buttons .btn { width: 100%; justify-content: center; }
    .seo-content { font-size: 0.9rem; }
    .reviews-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .review-card { padding: 0.75rem 1rem; }
    .reviews-pagination a,
    .reviews-pagination .pagination-current {
        min-width: 2rem;
        height: 2rem;
        font-size: 0.85rem;
    }
    .works {
        grid-template-columns: 1fr;
    }

    /* CTA buttons on inner pages (reviews/ideas/etc.) */
    .cta { padding: 3rem 0; }
    .cta .container { display: flex; flex-direction: column; align-items: center; }
    .cta .btn {
        width: 100%;
        max-width: 320px;
        text-align: center;
    }
    .cta .btn + .btn {
        margin-left: 0;
        margin-top: 0.75rem;
    }
}

@media (max-width: 520px) {
    .works { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .hero-demo-video-block {
        max-width: 200px;
        margin: 1.5rem auto 1rem;
    }
    .hero h1.hero-title {
        font-size: clamp(1.5rem, 5vw, 2.25rem);
        margin: 0 0 1.5rem;
        line-height: 1.55;
    }
    .hero-line-2 {
        font-size: 0.6em;
        margin-top: 0.55em;
    }
    .hero-line-3 {
        font-size: 0.5em;
        margin-top: 1em;
    }
    .hero-demo-player-small {
        padding: 0.5rem;
    }
    .hero-demo-visualizer-small {
        height: 30px;
    }
    .hero-demo-beat-small {
        width: 2px;
        max-height: 20px;
    }
}


@media (max-width: 380px) {
    .key-grid { grid-template-columns: 1fr; }
    .hero-demo-video-block {
        max-width: 180px;
        margin: 1.5rem auto 1rem;
    }
    .hero-content {
        gap: 1rem;
        padding: 0;
    }
    body.now-playing-visible .hero-content {
        padding-top: 1rem;
    }
    .hero h1.hero-title {
        font-size: clamp(1.4rem, 4.5vw, 2rem);
        margin: 0 0 1.25rem;
        line-height: 1.6;
    }
    .hero-line-2 {
        font-size: 0.62em;
        margin-top: 0.6em;
    }
    .hero-line-3 {
        font-size: 0.52em;
        margin-top: 1.1em;
    }
    .hero-demo-block {
        margin: 1rem 0;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

/* ===== Modal Responsive (мобильная версия: отступы в px для Vivaldi/Chrome, форма не выходит за экран) ===== */
@media (max-width: 768px) {
    .modal {
        padding: 16px;
        align-items: flex-start;
        box-sizing: border-box;
        overflow: hidden;
    }
    @supports (padding: max(0px, 0px)) {
        .modal {
            padding-top: max(16px, env(safe-area-inset-top));
            padding-left: max(16px, env(safe-area-inset-left));
            padding-right: max(16px, env(safe-area-inset-right));
            padding-bottom: max(16px, env(safe-area-inset-bottom));
        }
    }
    .modal-content {
        width: 100%;
        max-width: calc(100vw - 32px);
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px);
        height: auto;
        min-height: 0;
        padding: 16px 16px 16px;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overflow-anchor: none;
        box-sizing: border-box;
        min-width: 0;
        align-self: flex-start;
    }
    @supports (padding: max(0px, 0px)) {
        .modal-content {
            max-height: calc(100vh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
            max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
            max-width: calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right));
            padding-left: max(16px, env(safe-area-inset-left));
            padding-right: max(16px, env(safe-area-inset-right));
            padding-bottom: max(16px, env(safe-area-inset-bottom));
        }
    }
    .modal .order-form label,
    .modal .order-form input,
    .modal .order-form select,
    .modal .order-form textarea,
    .modal .order-form .usdt-hint,
    .modal .order-form .form-policy-note {
        max-width: 100%;
        box-sizing: border-box;
    }
    .modal .order-form input,
    .modal .order-form select,
    .modal .order-form textarea {
        width: 100%;
    }
    .modal .order-form input,
    .modal .order-form select,
    .modal .order-form textarea {
        padding-left: 12px;
        padding-right: 12px;
    }
    .modal .order-form .btn {
        margin-top: 1rem;
        margin-bottom: 0;
    }
    .modal-content .modal-title { font-size: 1.1rem; margin-bottom: 0.5rem; padding-right: 2.25rem; }
    .modal-close { right: 12px; top: 12px; width: 2.25rem; height: 2.25rem; }
}

@media (max-height: 640px) {
    .modal {
        align-items: flex-start;
        padding-top: 0.5rem;
        overflow: hidden;
    }
    .modal-content {
        padding: 0.75rem 1rem 16px;
        max-height: calc(100vh - 2rem);
        max-height: calc(100dvh - 2rem);
        height: auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        overflow-anchor: none;
        min-width: 0;
        align-self: flex-start;
    }
    .modal-content .modal-title { font-size: 1.05rem; margin-bottom: 0.5rem; }
    .modal .order-form label + label { margin-top: 0.35rem; }
    .modal .order-form input, .modal .order-form select, .modal .order-form textarea { padding: 0.4rem 0.6rem; font-size: 0.9rem; }
    .modal .order-form textarea.story-field { min-height: 64px; max-height: 88px; }
    .modal .order-form .usdt-hint { font-size: 0.7rem; }
    .modal .order-form .form-policy-note { font-size: 0.65rem; margin-top: 0.35rem; }
    .modal .order-form .btn { margin-top: 0.35rem; margin-bottom: 0 !important; padding: 0.5rem 1rem; }
}
