/* Landing Page Hero */
.hero-section {
    max-width: 820px;
    margin: 0 auto;
    padding: clamp(80px, 12vh, 120px) 20px 0;
    text-align: center;
}

.badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 20px;
}

.hero-title {
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.hero-title .highlight {
    color: var(--accent-color);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.6;
    max-width: 630px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    .hero-section {
        padding-top: clamp(55px, 8vh, 80px);
    }
    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 20px;
        line-height: 1.5;
    }
    .badge { margin-bottom: 14px; }
    .hero-title { margin-bottom: 14px; }
}

/* Search Container */
.search-container {
    max-width: 540px;
    margin: 0 auto 25px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-box:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.08);
}

.at-symbol {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-tertiary);
    user-select: none;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
    color: var(--text-primary);
    padding: 12px 0;
}

.search-box input::placeholder { color: var(--text-tertiary); }

.search-btn {
    background: var(--search-btn-bg);
    color: var(--search-btn-color);
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn svg { width: 20px; height: 20px; }

/* Stats - optimize: only transition opacity (composite-only, no layout thrash) */
.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 80px;
    flex-wrap: wrap;
    transition: opacity 0.2s ease;
    opacity: 1;
}

.stats.hidden {
    opacity: 0;
    pointer-events: none;
    max-height: 0;
    margin-bottom: 0;
    overflow: hidden;
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.stat-icon {
    width: 18px;
    height: 18px;
    color: var(--accent-color);
    flex-shrink: 0;
}

/* Lower sections */
.lower-sections { margin-top: -40px; }
.lower-sections.pushed-down { display: none; }

/* Defer rendering of below-fold sections until scrolled into view */
.features,
.steps,
.seo-content,
.faq,
.stat-bar,
.landing-section,
.disclaimer-section {
    content-visibility: auto;
    contain-intrinsic-size: auto 300px;
}

/* Allow hover lift to paint outside content-visibility box */
.features {
    content-visibility: visible;
    contain: none;
}

.story-viewer-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 900px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.feature {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 22px 18px;
    text-align: center;
}

@media (hover: hover) {
    .feature:hover {
        border-color: var(--accent-color);
        box-shadow: var(--shadow);
        transform: translateY(-2px);
    }
}

.feature-icon { width: 32px; height: 32px; margin: 0 auto 12px; color: var(--accent-color); }
.feature-title { font-size: 0.92rem; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.feature-text { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; }

/* Steps */
.steps { max-width: 900px; margin: 0 auto 70px; padding: 0 20px; }
.steps-title { text-align: center; font-size: 1.8rem; font-weight: 700; color: var(--text-primary); margin-bottom: 40px; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.step { background: var(--card-bg); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 32px 24px; }
.step-number { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-color); color: var(--text-on-accent); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.95rem; margin-bottom: 16px; }
.step-title { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 10px; }
.step-text { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }

/* FAQ */
.faq { max-width: 750px; margin: 70px auto; padding: 0 20px; }
.faq-title { text-align: center; font-size: 1.8rem; font-weight: 700; color: var(--text-primary); margin-bottom: 40px; }
.faq-list { display: flex; flex-direction: column; gap: 24px; }
.faq-item { padding-bottom: 24px; border-bottom: 1px solid var(--border-light); }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-size: 1.05rem; font-weight: 600; color: var(--text-primary); margin-bottom: 10px; }
.faq-a { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.7; }

/* Results section spacing */
#results { margin-top: 10px; }
#loading, #error { margin: 0 auto; }

@media (max-width: 768px) {
    .features { grid-template-columns: 1fr; }
    .stats { gap: 24px; }
    .stat { font-size: 0.85rem; }
    .stat-icon { width: 16px; height: 16px; }
    .user-item { margin: 0 !important; padding: 12px 10px !important; }

    /* On mobile the ad above #results (Zone B) already supplies a 12px bottom
       margin — that's the only gap we want above the profile card. theme.css
       cancels `.results`' 14px shadow-bleed padding with a matching negative
       `margin-block`, but the `#results` ID rule above re-introduces a
       positive margin-top, so restate the cancellation here. */
    #results { margin-top: calc(var(--lab-results-bleed-block) * -1); }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .features { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .user-item { margin: 0 !important; padding: 10px 8px !important; }
}

/* ===== Mobile Menu Fixes ===== */
.mobile-menu-overlay {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    width: 100vw !important; height: 100vh !important;
}
.mobile-menu {
    position: fixed !important;
    top: 0 !important; right: 0 !important;
    bottom: auto !important; height: 100vh !important;
}
body.mobile-menu-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important; height: 100% !important;
}
