/* Variant 3 — calm editorial presentation.
   Warm ivory, deep ink, restrained teal. Class names and states match the existing site. */

:root {
    --primary: #165c56;
    --primary-hover: #0f4f4a;
    --secondary: #165c56;
    --accent: #1d4a52;
    --text-main: #1c2430;
    --text-muted: #4e4942;
    --bg-body: #f6f1e7;
    --bg-white: #fffdf8;
    --border-light: #e3d8c8;
    --ink: #152033;
    --shadow-sm: 0 1px 2px rgba(21, 32, 51, 0.04);
    --shadow-md: 0 16px 40px rgba(21, 32, 51, 0.06);
    --shadow-lg: 0 28px 60px rgba(21, 32, 51, 0.08);
    --radius: 1.15rem;
    --transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
    font-size: 1.0625rem;
}

h1,
h2,
h3,
h4,
.font-heading {
    font-family: Fraunces, Georgia, serif;
    font-weight: 560;
    color: var(--ink);
    letter-spacing: -0.025em;
    line-height: 1.18;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

::selection {
    background: #d5ebe7;
    color: var(--ink);
}

:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hidden {
    display: none !important;
}

/* --- Header --- */
header {
    background: rgba(246, 241, 231, 0.94);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.9rem 0;
}

header.scrolled {
    background: rgba(255, 253, 248, 0.96);
    box-shadow: 0 8px 24px rgba(21, 32, 51, 0.05);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    font-family: Fraunces, Georgia, serif;
    font-size: 1.65rem;
    font-weight: 640;
    letter-spacing: -0.03em;
    color: var(--ink);
    display: flex;
    align-items: center;
    min-height: 44px;
}

.logo span {
    color: var(--primary);
}

nav ul {
    display: flex;
    gap: 0.35rem 1.35rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

nav ul a {
    font-weight: 600;
    color: var(--text-muted);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.15rem;
}

nav ul a:hover,
nav ul a.active {
    color: var(--ink);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.4rem;
    border-radius: 999px;
    font-weight: 650;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    font-size: 1rem;
    gap: 0.5rem;
    min-height: 48px;
    line-height: 1.2;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: #fffdf8;
    box-shadow: none;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid #cfc3b0;
    color: var(--ink);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f3faf8;
}

.btn-lg {
    padding: 0.95rem 1.7rem;
    font-size: 1.08rem;
    min-height: 52px;
}

.btn-block {
    width: 100%;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

/* --- Hero --- */
#hero {
    padding: 5.5rem 0 4.25rem;
    text-align: center;
    background:
        linear-gradient(180deg, rgba(22, 92, 86, 0.06), rgba(246, 241, 231, 0) 70%);
}

.hero-content {
    max-width: 46rem;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 5.4vw, 4.35rem);
    line-height: 1.08;
    margin-bottom: 1.35rem;
    font-weight: 560;
}

.hero-content h1 span {
    color: var(--primary);
    background: none;
    -webkit-text-fill-color: currentColor;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.25rem;
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.65;
}

.hero-btns {
    display: flex;
    justify-content: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

/* --- Features Grid --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    padding: 1rem 0 3.5rem;
}

.feature-card {
    background: var(--bg-white);
    padding: 1.75rem 1.6rem 1.6rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: none;
}

.feature-card:hover {
    border-color: #c9ddd9;
}

.icon-box {
    width: 3rem;
    height: 3rem;
    background: #e7f3f1;
    border-radius: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.15rem;
    color: var(--primary);
}

.icon-box svg {
    width: 1.45rem;
    height: 1.45rem;
}

.feature-card h3 {
    font-size: 1.45rem;
    margin-bottom: 0.55rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 1.02rem;
}

/* --- Generic Section Styles --- */
.section-head {
    text-align: center;
    max-width: 40rem;
    margin: 0 auto 2.25rem;
}

.section-head h2 {
    font-size: clamp(2rem, 4vw, 2.85rem);
    margin-bottom: 0.75rem;
}

.section-head p {
    color: var(--text-muted);
    font-size: 1.12rem;
}

.content-box {
    background: var(--bg-white);
    padding: 2.5rem 2.4rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: none;
    margin-bottom: 2.5rem;
}

.content-box h2 {
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    margin-bottom: 1rem;
}

.content-box p {
    max-width: 68ch;
}

.content-box li {
    max-width: 68ch;
}

/* --- FAQ Accordion --- */
.faq-item {
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0;
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 1.15rem 0;
    background: none;
    border: none;
    font-size: 1.12rem;
    font-weight: 650;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-height: 52px;
    line-height: 1.35;
}

.faq-question:hover {
    color: var(--primary);
}

.faq-toggle-icon {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--primary);
    flex-shrink: 0;
    width: 1.5rem;
    text-align: center;
    transition: transform 0.2s ease;
}

.faq-item.active .faq-toggle-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
    color: var(--text-muted);
}

.faq-answer p {
    padding-bottom: 1.35rem;
    max-width: 70ch;
}

/* --- Pricing --- */
#pricing {
    padding: 1rem 0 3rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    max-width: 860px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 2.25rem 1.75rem 1.75rem;
    border: 1px solid var(--border-light);
    text-align: center;
    position: relative;
    box-shadow: none;
}

.pricing-card.featured {
    border-color: var(--ink);
    background: #fffdf8;
}

.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--ink);
    color: #f6f1e7;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: "Source Sans 3", sans-serif;
}

.price {
    font-family: Fraunces, Georgia, serif;
    font-size: 3.25rem;
    font-weight: 560;
    color: var(--ink);
    margin: 1rem 0 0.75rem;
    letter-spacing: -0.03em;
    line-height: 1;
}

.price span {
    font-family: "Source Sans 3", sans-serif;
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0;
}

.features-list {
    text-align: left;
    margin: 1.5rem 0 1.35rem;
}

.features-list li {
    padding: 0.55rem 0;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.features-list li svg {
    color: var(--primary);
    width: 1.15rem;
    height: 1.15rem;
}

/* --- Footer --- */
footer {
    background: var(--ink);
    color: #f6f1e7;
    padding: 4rem 0 2rem;
    margin-top: 4.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2.25rem;
    margin-bottom: 2.5rem;
}

.footer-col h4 {
    color: #f6f1e7;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-col ul li {
    margin-bottom: 0.35rem;
}

.footer-col ul a {
    color: #ddd6ca;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.footer-col ul a:hover {
    color: #ffffff;
}

.footer-col p {
    color: #ddd6ca !important;
    font-size: 0.98rem !important;
    line-height: 1.6;
}

.footer-disclaimer {
    border-top: 1px solid rgba(246, 241, 231, 0.16);
    padding-top: 1.5rem;
    color: #cfc6b8;
    font-size: 0.92rem;
    text-align: left;
    line-height: 1.65;
}

/* --- Homepage test shell (unused until shown) --- */
.test-card {
    background: var(--bg-white);
    max-width: 800px;
    margin: 2.5rem auto;
    padding: 2.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: none;
}

.progress-container {
    background: #efe7da;
    height: 0.45rem;
    border-radius: 999px;
    margin-top: 1.5rem;
    overflow: hidden;
}

#progress {
    background: var(--primary);
    height: 100%;
    width: 0;
    transition: width 0.3s ease;
}

.option-btn {
    width: 100%;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-light);
    background: var(--bg-white);
    border-radius: 0.9rem;
    text-align: left;
    font-size: 1.05rem;
    cursor: pointer;
    color: var(--text-main);
    min-height: 52px;
}

.option-btn:hover {
    border-color: var(--primary);
    background: #f3faf8;
}

/* --- Research Section --- */
#research {
    background: transparent;
    padding: 3rem 0;
    margin-top: 2rem;
}

.research-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.research-content h2 {
    font-size: clamp(2rem, 4vw, 2.7rem);
    margin-bottom: 1rem;
}

.research-content p {
    color: var(--text-muted);
    font-size: 1.08rem;
    margin-bottom: 1rem;
    line-height: 1.75;
}

.research-stat {
    display: flex;
    gap: 2rem;
    margin-top: 1.75rem;
    flex-wrap: wrap;
}

.stat-item h4 {
    font-size: 2.4rem;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.4rem;
}

.stat-item span {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
}

.research-visual {
    position: relative;
}

.image-canvas {
    background: linear-gradient(160deg, #e7f3f1 0%, #e7e0d2 100%);
    border-radius: 1.5rem;
    height: 360px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.location-tag {
    position: absolute;
    bottom: 1.25rem;
    left: 1.25rem;
    background: rgba(255, 253, 248, 0.94);
    padding: 0.7rem 1rem;
    border-radius: 999px;
    font-weight: 650;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Popup Overlay --- */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(21, 32, 51, 0.52);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 1.25rem;
    overflow-y: auto;
}

.popup-card {
    background: var(--bg-white);
    border-radius: 1.25rem;
    padding: 2.25rem 1.75rem 1.75rem;
    max-width: 32rem;
    width: 100%;
    max-height: min(88vh, 720px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    text-align: left;
    position: relative;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    animation: popupIn 0.22s ease;
}

@keyframes popupIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.popup-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.popup-close:hover {
    color: var(--ink);
    background: #f3eee4;
}

.popup-icon {
    width: 3.25rem;
    height: 3.25rem;
    background: #e7f3f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 1.1rem;
    color: var(--primary);
}

.popup-icon svg {
    width: 1.6rem;
    height: 1.6rem;
}

.popup-card h2 {
    font-size: 1.85rem;
    margin-bottom: 0.7rem;
}

.popup-card p {
    color: var(--text-muted);
    line-height: 1.65;
}

/* --- Donation Popup --- */
.donation-preview-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 4000;
    background: var(--ink);
    color: #e7e1d6;
    text-align: center;
    font-size: 0.9rem;
    padding: 0.7rem 1rem;
}

.donation-popup-card {
    max-width: 28rem;
    padding: 1.6rem 1.45rem 1.3rem;
    text-align: left;
    max-height: min(92vh, 860px);
}

.donation-popup-icon {
    width: 2.8rem;
    height: 2.8rem;
    margin-bottom: 0.85rem;
    background: #e7f3f1;
    color: var(--primary);
}

.donation-popup-icon svg {
    width: 1.35rem;
    height: 1.35rem;
}

.donation-popup-card h2 {
    font-size: 1.7rem;
    margin-bottom: 0.45rem;
}

.donation-lead {
    margin-bottom: 0.9rem;
    font-size: 1rem;
    line-height: 1.55;
}

.donation-perks {
    list-style: none;
    margin: 0 0 1.1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.donation-perks li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.98rem;
    color: var(--text-main);
    line-height: 1.45;
}

.donation-perk-check {
    flex-shrink: 0;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    background: #e7f3f1;
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.15rem;
}

.donation-cta {
    width: 100%;
}

.donation-custom {
    margin-top: 0.75rem;
    text-align: center;
}

.donation-custom-toggle {
    background: none;
    border: none;
    padding: 0.4rem 0.25rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-family: inherit;
    min-height: 44px;
}

.donation-custom-toggle:hover {
    color: var(--primary);
}

.donation-custom-form {
    margin-top: 0.75rem;
}

.donation-custom-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 280px;
    margin: 0 auto;
}

.donation-currency {
    font-weight: 700;
    color: var(--ink);
    font-size: 1.15rem;
}

.donation-custom-row input {
    flex: 1;
    min-width: 0;
    padding: 0.7rem 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: 0.7rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-main);
    background: #fffdf8;
    min-height: 48px;
}

.donation-custom-row input:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-color: var(--primary);
}

.donation-custom-row .btn {
    padding: 0.7rem 1rem;
    flex-shrink: 0;
}

.donation-custom-hint {
    margin-top: 0.45rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.donation-custom-error,
.donation-pay-error {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: #6e2e28;
}

.donation-payment-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border-light);
}

.donation-pay-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    padding: 0 0.55rem;
    background: #fffdf8;
    border: 1px solid var(--border-light);
    border-radius: 0.45rem;
}

.donation-pay-badge svg {
    height: 1rem;
    width: auto;
    display: block;
}

.donation-secure-note {
    margin-top: 0.65rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.donation-popup-card.is-checkout {
    max-width: 30rem;
    max-height: min(94vh, 860px);
}

.donation-checkout {
    margin-top: 0.25rem;
}

#donation-payment-element {
    margin: 0.75rem 0 1rem;
}

.donation-processing {
    text-align: left;
    padding: 0.25rem 0 0.15rem;
}

.donation-processing h2 {
    margin-bottom: 0.5rem;
}

.donation-processing p {
    margin-bottom: 1rem;
}

.donation-cta:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* --- Contact --- */
.contact-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.contact-form label {
    color: var(--ink);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 0.8rem 0.85rem;
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    background: #fffdf8;
    color: var(--text-main);
    font-size: 1.05rem;
    min-height: 48px;
}

.contact-form textarea {
    min-height: 9rem;
    resize: vertical;
}

.contact-form input:focus-visible,
.contact-form select:focus-visible,
.contact-form textarea:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-color: var(--primary);
}

.contact-notice {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    font-size: 1rem;
}

.contact-notice.ok {
    background: #e7f3f1;
    color: #0f4f4a;
}

.contact-notice.bad {
    background: #f3e6df;
    color: #6e2e28;
}

#contact-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Quiz --- */
.test-container {
    max-width: 44rem;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3.5rem;
}

.test-instructions,
.question-card,
.results-container,
.spinner-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 1.2rem;
    box-shadow: none;
}

.test-instructions {
    padding: 2rem 1.6rem 1.6rem;
}

.test-instructions h2,
.results-container h2 {
    font-size: clamp(1.8rem, 3vw, 2.3rem);
}

.test-instructions ul {
    margin: 0 0 1.5rem;
    padding: 0;
    border-top: 1px solid var(--border-light);
}

.test-instructions li {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-main);
    line-height: 1.5;
}

.quiz-notice {
    background: #f7f1e4;
    border-left: 4px solid #8a5a2a;
    border-radius: 0.8rem;
    padding: 0.95rem 1rem;
    margin-bottom: 1.35rem;
}

.quiz-notice p {
    margin: 0;
    font-weight: 650;
    color: #5c3b16;
}

.quiz-status {
    position: sticky;
    top: 4.75rem;
    z-index: 20;
    background: rgba(246, 241, 231, 0.94);
    padding: 0.85rem 0 0.9rem;
    margin-bottom: 0.85rem;
}

.timer-display {
    position: static;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    background: var(--ink);
    color: #f6f1e7;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-weight: 650;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.75rem;
    box-shadow: none;
}

.timer-warning {
    background: #8a3d32;
    color: #fffdf8;
}

.progress-bar {
    height: 0.45rem;
    background: #e7dfd2;
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: inherit;
    transition: width 0.25s ease;
}

.question-card {
    padding: 1.6rem 1.4rem 1.35rem;
}

.question-number {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.75rem;
    font-size: 0.92rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: "Source Sans 3", sans-serif;
}

.question-text {
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(1.45rem, 2.6vw, 1.95rem);
    font-weight: 560;
    letter-spacing: -0.025em;
    line-height: 1.28;
    margin-bottom: 1.35rem;
    color: var(--ink);
}

.options-list {
    display: grid;
    gap: 0.7rem;
}

.option-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 56px;
    padding: 0.9rem 1.05rem;
    border: 1.5px solid #ddd3c4;
    border-radius: 0.95rem;
    cursor: pointer;
    background: #fffdf8;
    color: var(--text-main);
    font-size: 1.08rem;
    line-height: 1.4;
    text-align: left;
    font-family: inherit;
}

.option-item:hover {
    border-color: var(--primary);
    background: #f7fbfa;
}

.option-item.selected {
    border-color: var(--primary);
    background: #e7f3f1;
    box-shadow: inset 0 0 0 1px var(--primary);
}

.option-item:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

.quiz-nav {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.15rem;
}

.quiz-nav .btn {
    flex: 1;
}

#submit-test-btn {
    width: 100%;
    margin-top: 0.75rem;
}

.results-container {
    padding: 1.7rem 1.4rem 1.4rem;
}

.score-summary {
    background: #f7f3ea;
    border: 1px solid var(--border-light);
    padding: 1.4rem 1.2rem;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.score-summary h3 {
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
}

.score-fraction,
.score-iq {
    font-family: Fraunces, Georgia, serif;
    font-weight: 560;
    color: var(--primary);
    letter-spacing: -0.03em;
    line-height: 1;
}

.score-fraction {
    font-size: 2.6rem;
}

.score-percent,
.score-meta {
    color: var(--text-muted);
    margin-top: 0.45rem;
}

.score-iq-block {
    border-top: 1px solid var(--border-light);
    padding-top: 1.15rem;
    margin-top: 1.15rem;
}

.score-iq {
    font-size: 3.4rem;
    margin: 0.25rem 0 0.35rem;
}

.answer-item {
    padding: 1rem 1rem 1rem 1.05rem;
    margin-bottom: 0.75rem;
    border-radius: 0.9rem;
    border: 1px solid var(--border-light);
    border-left-width: 4px;
    background: #fffdf8;
}

.answer-question,
.answer-yours {
    margin-bottom: 0.4rem;
}

.answer-question {
    font-weight: 700;
    color: var(--ink);
}

.answer-item.correct {
    border-left-color: #1d4a32;
    background: #f4f7f2;
}

.answer-item.incorrect {
    border-left-color: #8a3d32;
    background: #fbf6f3;
}

.spinner-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    padding: 2.4rem 2rem;
    animation: popupIn 0.22s ease;
    text-align: center;
}

.spinner-ring,
.loader {
    width: 2.75rem;
    height: 2.75rem;
    border: 3px solid #e7dfd2;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-muted);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 860px) {
    .container {
        padding: 0 1.15rem;
    }

    nav {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    nav ul {
        width: 100%;
        justify-content: flex-start;
        gap: 0.15rem 0.9rem;
    }

    #hero {
        padding: 2.75rem 0 2.25rem;
    }

    .hero-btns {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-btns .btn {
        width: 100%;
    }

    .content-box {
        padding: 1.45rem 1.15rem;
    }

    .research-grid {
        grid-template-columns: 1fr;
    }

    .quiz-status {
        position: relative;
        top: auto;
    }

    .quiz-nav {
        flex-direction: column;
    }

    .test-container {
        padding: 0.75rem 0.9rem 2.5rem;
    }

    .question-card,
    .test-instructions,
    .results-container {
        padding: 1.2rem 1rem;
    }
}

@media (max-width: 480px) {
    .popup-overlay {
        padding: 0.65rem;
        align-items: flex-end;
    }

    .popup-card {
        max-height: min(94vh, 720px);
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .donation-popup-card {
        padding: 1.35rem 1.05rem 1.15rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

@media (forced-colors: active) {
    .option-item {
        border: 1px solid ButtonText;
    }

    .option-item.selected {
        border-width: 3px;
    }
}
