/* Tablet layouts */
@media (max-width: 1024px) {
    .container,
    .footer__container,
    .hero-content {
        padding-left: 28px;
        padding-right: 28px;
    }

    .hero-header {
        margin-bottom: 72px;
        gap: 24px;
    }

    .hero-nav {
        gap: 22px;
    }

    .hero-main {
        grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
        gap: 40px;
    }

    .hero-left h1 {
        font-size: clamp(4.5rem, 9vw, 6rem);
    }

    .hero-text {
        font-size: clamp(2rem, 4vw, 2.6rem);
    }

    .how-it-works,
    .testimonials {
        padding-top: 84px;
        padding-bottom: 84px;
    }

    .how-it-works h2,
    .result-left h2 {
        font-size: 3.2rem;
    }

    .steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 32px;
    }

    .result-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 36px;
    }

    .result-right {
        height: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 14px;
    }

    .document,
    .document-center,
    .document-left,
    .document-right {
        position: relative;
        inset: auto;
        width: calc(50% - 14px);
        max-width: 280px;
        height: 340px;
        transform: none;
    }

    .testimonial-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
    }

    .question-card {
        min-height: 0;
        padding: 42px;
    }

    .question-title {
        min-height: 0;
        font-size: 29px;
    }

    .result-page {
        padding: 104px 28px 48px;
    }

    .profile-card,
    .locked-card {
        padding: 40px;
    }

    .profile-circles {
        gap: 26px;
    }

    .letter-content {
        padding: 56px 36px;
    }
}

/* Phones and small tablets */
@media (max-width: 768px) {
    img,
    video,
    canvas {
        max-width: 100%;
    }

    pre {
        max-width: 100%;
        overflow-x: auto;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
    }

    .site-logo {
        top: 16px;
        left: 18px;
        width: 92px;
    }

    .hero-logo {
        flex-basis: 92px;
        width: 92px;
    }

    .hero {
        min-height: auto;
        background-image:
            linear-gradient(rgba(0,0,0,.76), rgba(0,0,0,.62)),
            url("/static/images/hero-mobile.webp");
        background-position: center;
    }

    .hero-content {
        padding: 24px 22px 58px;
    }

    .hero-header {
        flex-direction: column;
        align-items: stretch;
        gap: 22px;
        margin-bottom: 52px;
    }

    .hero-logo {
        align-self: center;
    }

    .hero-nav {
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px 20px;
    }

    .hero-nav a {
        padding: 8px 14px;
    }

    .header-cta,
    .hero-button {
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .header-cta {
        width: 100%;
    }

    .hero-main {
        grid-template-columns: minmax(0, 1fr);
        gap: 38px;
    }

    .hero-left h1 {
        font-size: clamp(3.5rem, 15vw, 5rem);
        line-height: .98;
        overflow-wrap: anywhere;
    }

    .hero-tagline {
        font-size: .75rem;
        letter-spacing: .16rem;
        line-height: 1.6;
    }

    .hero-text {
        font-size: clamp(1.7rem, 7vw, 2.25rem);
        line-height: 1.25;
    }

    .hero-subtext {
        font-size: 1rem;
        line-height: 1.65;
    }

    .hero-right {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 14px;
    }

    .benefit {
        flex: 1 1 200px;
        font-size: 1rem;
    }

    .how-it-works,
    .testimonials {
        padding: 64px 0;
    }

    .container {
        padding-left: 22px;
        padding-right: 22px;
    }

    .how-it-works h2,
    .result-left h2,
    .testimonials h2 {
        font-size: clamp(2rem, 9vw, 2.75rem);
        line-height: 1.15;
    }

    .section-subtitle {
        font-size: 1.05rem;
        margin-bottom: 38px;
    }

    .steps,
    .testimonial-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .result-preview {
        padding: 68px 0;
    }

    .result-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    .result-left h2 {
        margin-bottom: 24px;
    }

    .result-list {
        padding-left: 0;
    }

    .result-list li {
        font-size: 1.05rem;
        line-height: 1.55;
    }

    .result-right {
        flex-direction: column;
    }

    .document,
    .document-center,
    .document-left,
    .document-right {
        width: min(100%, 300px);
        height: 340px;
    }

    .testimonial {
        padding: 26px;
    }

    .footer__container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 28px;
        padding: 34px 22px;
    }

    .footer__nav,
    .footer__social {
        flex-wrap: wrap;
        justify-content: center;
        gap: 14px 20px;
    }

    .start-page {
        min-height: 100svh;
        padding: 108px 18px 28px;
    }

    .start-card {
        padding: 30px 24px;
        border-radius: 20px;
    }

    .start-card h1 {
        font-size: clamp(1.8rem, 8vw, 2.25rem);
    }

    .form-group input {
        min-height: 48px;
        font-size: 16px;
    }

    .start-btn {
        min-height: 50px;
    }

    .test-bg {
        min-height: 100svh;
        padding: 100px 16px 24px;
    }

    .question-card {
        min-height: 0;
        padding: 30px 24px;
        border-radius: 20px;
    }

    .question-nav {
        margin-bottom: 18px;
    }

    .progress {
        margin-bottom: 12px;
    }

    .question-title {
        min-height: 0;
        margin-bottom: 26px;
        font-size: clamp(1.45rem, 6vw, 1.8rem);
        line-height: 1.35;
    }

    .answers {
        gap: 12px;
    }

    .answer-option {
        min-height: 68px;
        padding: 16px 18px;
        border-radius: 14px;
        font-size: 1rem;
        line-height: 1.45;
    }

    .answer-option:hover {
        transform: none;
    }

    .continue-btn,
    .back-btn {
        min-height: 48px;
    }

    textarea {
        min-height: 160px;
        font-size: 16px;
    }

    .result-page {
        padding: 100px 16px 32px;
    }

    .result-header {
        margin-bottom: 30px;
    }

    .result-header h1 {
        font-size: clamp(1.8rem, 8vw, 2.3rem);
        line-height: 1.2;
        margin-bottom: 22px;
    }

    .result-tabs {
        gap: 10px;
    }

    .tab {
        min-height: 46px;
        padding: 11px 16px;
        font-size: .95rem;
    }

    .profile-card,
    .locked-card,
    .paywall-preview {
        padding: 26px 21px;
        border-radius: 18px;
    }

    .profile-card h2 {
        font-size: 2rem;
    }

    .profile-description {
        margin-bottom: 30px;
        font-size: 1rem;
        line-height: 1.65;
    }

    .profile-circles {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px 12px;
        margin: 34px 0;
    }

    .circle {
        width: 92px;
        height: 92px;
        margin: 0 auto;
    }

    .circle::before {
        width: 68px;
        height: 68px;
    }

    .circle span {
        font-size: 1rem;
    }

    .trait-label {
        font-size: .85rem;
        line-height: 1.25;
    }

    .result-card h2 {
        font-size: 1.35rem;
        line-height: 1.3;
    }

    .paywall-preview {
        margin-top: 28px;
    }

    .paywall-preview h3 {
        font-size: 1.45rem;
        line-height: 1.3;
    }

    .unlock-btn {
        width: 100%;
        padding: 15px 20px;
        line-height: 1.4;
    }

    .locked-card {
        padding: 34px 22px;
    }

    .locked-card h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .letter-content {
        padding: 100px 22px 36px;
    }
}

/* Narrow phones */
@media (max-width: 480px) {
    .site-logo {
        top: 12px;
        left: 14px;
        width: 78px;
    }

    .hero-logo {
        flex-basis: 82px;
        width: 82px;
    }

    .hero-content {
        padding: 18px 18px 46px;
    }

    .hero-header {
        gap: 18px;
        margin-bottom: 40px;
    }

    .hero-nav {
        gap: 8px 14px;
        font-size: .9rem;
    }

    .hero-button {
        width: 100%;
    }

    .hero-right {
        flex-direction: column;
        align-items: flex-start;
    }

    .benefit {
        flex-basis: auto;
    }

    .footer__logo {
        width: 100px;
    }

    .question-card {
        padding: 24px 18px;
    }

    .answer-option {
        padding: 15px;
        font-size: .96rem;
    }

    .profile-card,
    .locked-card,
    .paywall-preview {
        padding: 22px 17px;
    }

    .trait-label {
        font-size: .8rem;
    }

    .letter-content {
        padding-right: 18px;
        padding-left: 18px;
    }
}
