/* Site-wide premium responsive layer — loaded last */
html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}
body { overflow-x: hidden; }
body.nav-lock { overflow: hidden; }

img, video, iframe, svg { max-width: 100%; }
.hero-laptop img {
    max-width: none;
}
.pay-icons img {
    max-width: 78px;
    width: auto;
    height: 22px;
    max-height: 24px;
    object-fit: contain;
    flex: 0 0 auto;
}

/* Desktop hero stays original; scale only on smaller screens */
@media (min-width: 1101px) {
    .hero-stage { min-height: 368px; }
    .hero-laptop {
        width: 650px;
        max-width: none;
        height: 368px;
    }
    .hero-laptop img {
        width: 650px !important;
        height: 368px !important;
        max-width: none !important;
    }
    .hero-books-wrap {
        width: min(100%, 1630px);
        min-width: 1480px;
        max-width: none;
        transform: translate(-50%, -50%);
    }
}

@media (max-width: 1100px) {
    .hero,
    .hero-stage {
        overflow: hidden;
        max-width: 100%;
    }
    .hero-stage { min-height: 0; }
    .hero-laptop {
        width: min(650px, 92%);
        max-width: 92%;
        height: auto;
    }
    .hero-laptop img {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        display: block;
    }
    .hero-books-wrap {
        width: 1630px;
        min-width: 1630px;
        max-width: none;
        transform: translate(-50%, -50%) scale(min(1, calc(100vw * 0.92 / 650)));
        transform-origin: center center;
    }
}

.stats-band {
    overflow: hidden;
    padding: 40px max(16px, var(--page-gutter, 20px));
}
.stats-row {
    width: min(1250px, 100%);
    max-width: 100%;
}
.stat-item { min-width: 0; }
.stat-item img {
    width: 44px;
    height: auto;
    max-width: 44px;
}
.stat-number { white-space: nowrap; }
iframe { border: 0; }
table { max-width: 100%; }
.table-wrap, pre { overflow-x: auto; -webkit-overflow-scrolling: touch; }

main { min-width: 0; }

.site-header { z-index: 100; }

@media (min-width: 1101px) and (max-width: 1280px) {
    .nav-mega-grid {
        grid-template-columns: 1fr 1fr;
        gap: 18px 20px;
    }
    .nav-mega-aside {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        gap: 20px 28px;
        min-height: 0;
        padding: 18px 22px;
    }
    .nav-mega-aside h3 {
        margin: 0;
        font-size: 22px;
        white-space: nowrap;
    }
    .nav-mega-aside p {
        margin: 0;
        flex: 1;
        max-width: 420px;
    }
    .nav-mega-cta { margin-bottom: 0; min-width: 180px; }
    .nav-mega-panel {
        max-height: min(78vh, 680px);
        overflow-y: auto;
    }
}

@media (max-width: 1100px) {
    .site-header { padding-top: 12px; }
    .header-shell {
        min-height: 64px;
        padding: 8px 14px;
        gap: 12px;
    }
    .site-nav {
        z-index: 120;
        max-height: min(78vh, 720px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 10px 16px 18px;
        gap: 2px;
    }
    .site-nav > a,
    .nav-mega-trigger {
        width: 100%;
        min-height: 44px;
        padding: 12px 4px;
        font-size: 16px;
    }
    .nav-mega-item {
        min-height: 44px;
        align-items: center;
        padding: 8px 4px;
    }
    .nav-mega-item em { font-size: 12px; }
    .nav-toggle {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }
    .nav-started {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }
}

@media (max-width: 1024px) {
    .stats-band { padding: 36px 20px; }
    .stats-row {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 26px;
    }
    .stat-item {
        flex: none;
        width: min(100%, 280px);
        padding: 0;
        justify-content: flex-start;
        gap: 12px;
    }
    .stat-item + .stat-item::before { content: none; display: none; }
    .stat-copy {
        max-width: none;
        gap: 2px;
    }
    .stat-item img {
        width: 38px;
        height: auto;
        max-width: 38px;
    }
    .stat-number { font-size: clamp(36px, 10vw, 43px); }
    .stat-label {
        font-size: 17px;
        line-height: 1.25;
        overflow-wrap: break-word;
    }
    .footer-band {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 28px;
        padding: 32px 24px;
        overflow: visible;
    }
    .trust-badges {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 22px;
        width: 100%;
    }
    .trust-item {
        max-width: 100%;
        width: 100%;
        min-width: 0;
    }
    .trust-item strong {
        font-size: clamp(20px, 5.4vw, 24px);
        line-height: 1.25;
        overflow-wrap: break-word;
    }
    .trust-item span {
        font-size: 15px;
        line-height: 1.4;
    }
    .trust-ico svg {
        width: 28px;
        height: 28px;
    }
    .footer-paywrap {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        text-align: left;
    }
    .pay-icons {
        justify-content: flex-start;
        gap: 12px 16px;
    }
    .footer-copy {
        text-align: left !important;
        margin-top: 14px !important;
    }
    .how-section { padding: 48px 16px 56px; }
    .how-card {
        padding: 8px 18px 18px;
        border-radius: 20px;
        overflow: hidden;
    }
    .how-copy h3 { width: auto; max-width: 100%; }
    .how-shot { max-width: 100%; height: auto; }
    .how-float { max-width: 120px; }
}

@media (max-width: 900px) {
    .spd-hero { padding: 36px 16px 32px; }
    .spd-hero h1 { font-size: clamp(28px, 8vw, 40px); }
    .spd-hero-lead { font-size: 16px; }
    .spd-pills { justify-content: center; }
    .spd-pills span { font-size: 12px; }
    .spd-cta { padding: 48px 16px 80px; }
    .spd-cta-form,
    .prc-cta-form { width: 100%; }
}

@media (max-width: 767px) {
    :root { --page-gutter: 16px; }

    input, select, textarea { font-size: 16px !important; }

    .brand img { height: 34px; }
    .site-header { padding-top: 10px; padding-left: 12px; padding-right: 12px; }

    .hero-blobs { height: 420px; }
    .hero-laptop {
        width: min(650px, 94%);
        max-width: 94%;
    }
    .hero-books-wrap {
        transform: translate(-50%, -50%) scale(min(1, calc(100vw * 0.94 / 650)));
    }
    .stats-band { padding: 32px 16px; }
    .stat-item { width: min(100%, 260px); }
    .stat-item img { width: 35px; max-width: 35px; }
    .stat-label { font-size: 16px; }

    .contact-hero h1,
    .about-hero-title,
    .svc-hero-copy h1,
    .faq-heading,
    .authors-title { overflow-wrap: break-word; }

    .authors-marquee {
        width: 100%;
        overflow: hidden;
        max-width: 100%;
    }
    .authors-marquee::before,
    .authors-marquee::after {
        display: block;
        width: 24px;
        max-width: 36px;
    }
    .authors-overflow {
        overflow: hidden;
        width: 100%;
        max-width: 100%;
    }
    .authors-card {
        width: min(340px, calc(100vw - 48px));
        max-width: calc(100vw - 48px);
        padding: 18px 16px;
        overflow: hidden;
    }
    .authors-text {
        font-size: 16px;
        letter-spacing: -0.03em;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }
    .authors-user {
        white-space: normal;
        overflow-wrap: break-word;
    }
    .authors-bio {
        padding-left: 54px;
        padding-right: 24px;
        min-width: 0;
    }
    .authors-letter { width: 44px; height: 44px; }

    .contact-row { flex-direction: column; }
    .contact-field,
    .contact-field-full { width: 100% !important; max-width: 100%; }

    .footer-top {
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding: 28px 20px;
        column-gap: 16px;
        row-gap: 28px;
    }
    a.footer-logo { grid-column: 1 / -1; }
    .footer-touch { grid-column: 1 / -1; width: 100%; }
    .footer-col h4 { font-size: 17px; }
    .site-footer .footer-links a,
    .site-footer .footer-links span { font-size: 15px; }
    .site-footer { padding-bottom: 28px; }
    .footer-band { padding: 24px 20px 80px; }
    .trust-ico svg { width: 26px; height: 26px; }
    .pay-icons img {
        height: 20px;
        max-height: 22px;
        max-width: 70px;
    }
    .footer-copy {
        padding-right: 72px !important;
        font-size: 14px !important;
        line-height: 1.45;
        overflow-wrap: break-word;
    }

    .talk-btn {
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
    }
    .talk-btn span { display: none; }
    .talk-btn i { width: 50px; height: 50px; }

    .legal { padding: 0 4px; }

    .page-svc-detail .faq-acc-q { font-size: 18px; }
    .spd-feat,
    .spd-rel { padding: 20px; }
    .spd-step { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }

    .how-title-serif,
    .how-title-sans { font-size: clamp(26px, 8vw, 34px); }
    .how-lead { font-size: 16px; line-height: 1.5; }
    .how-tab { min-height: 48px; padding: 14px 28px 14px 0; }
    .how-copy { gap: 18px; }
    .how-copy h3 { font-size: clamp(22px, 6.5vw, 26px); }
    .how-list span { font-size: 15px; }
    .how-list svg { width: 22px; height: 22px; }
    .how-cta { padding: 14px 26px; font-size: 16px; }
    .start-modal { padding: 12px; align-items: flex-end; }
    .start-modal-card {
        width: 100%;
        max-height: min(92vh, 760px);
        border-radius: 20px 20px 12px 12px;
        padding: 26px 18px 20px;
    }
    .start-modal-card h2 { font-size: 26px; }
    .start-modal.is-open .start-modal-card {
        transform: none;
    }
}

@media (max-width: 980px) {
    .prv-hero { padding: 72px 20px 40px; }
    .prv-shell { grid-template-columns: 1fr; gap: 18px; }
    .prv-toc { position: static; }
    .prv-toc nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2px 8px;
    }
    .prv-card { padding: 26px 22px 24px; }
    .prv-rights { grid-template-columns: 1fr; }
    .tstm-stats-inner,
    .tstm-featured,
    .tstm-grid { grid-template-columns: 1fr 1fr; }
    .nf-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .footer-top { grid-template-columns: 1fr; }
    .nav-mega-item em { display: none; }
    .nav-mega-aside h3 { font-size: 20px; }
    .spd-hero-frame { width: min(220px, 70vw); }
    .btn-hero { padding-left: 28px; padding-right: 28px; font-size: 17px; }
    .prv-hero { padding: 64px 16px 36px; }
    .prv-card { padding: 24px 18px 22px; border-radius: 18px; }
    .prv-card h2 { font-size: 24px; }
    .prv-toc nav { grid-template-columns: 1fr; }
    .tstm-stats-inner,
    .tstm-featured,
    .tstm-grid { grid-template-columns: 1fr; }
    .tstm-stats-inner strong { font-size: 32px; }
    .nf-hero { padding: 56px 16px 24px; }
    .nf-grid { grid-template-columns: 1fr; }
    .nf-actions { flex-direction: column; }
    .nf-home,
    .nf-actions .authors-cta { width: min(100%, 320px); }
}

@media (max-width: 360px) {
    .header-shell { padding: 8px 10px; }
    .brand img { height: 30px; }
}
