/* ============================================================
   Brainflood — "What are you here for?" taste quiz
   Mirrors the visual language of the router landing.
   ============================================================ */

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
}
h1, h2, h3, h4, h5, h6, .font-display {
    font-family: 'Space Grotesk', sans-serif;
}

.emoji {
    font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji',
                 'Twemoji Mozilla', 'EmojiOne Color', 'Android Emoji',
                 'Segoe UI Symbol', sans-serif;
    font-variant-emoji: emoji;
}

/* ----- Panels (single mounted page; show one at a time) ----- */
.quiz-panel {
    position: relative;
    min-height: 60vh;
    padding: clamp(2.5rem, 8vh, 5rem) 1.25rem clamp(3rem, 8vh, 5rem);
    display: flex;
    align-items: center;
    justify-content: center;
}
.quiz-panel[hidden] { display: none; }
.quiz-panel.quiz-active { display: flex; }

.quiz-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 65% 50% at 50% -10%, rgba(124, 58, 237, 0.22) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 85% 60%, rgba(34, 211, 238, 0.14) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 15% 80%, rgba(244, 114, 182, 0.14) 0%, transparent 55%);
    z-index: 0;
    pointer-events: none;
    animation: panel-drift 22s ease-in-out infinite;
}
@keyframes panel-drift {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(0, -10px, 0) scale(1.03); }
}

.quiz-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
    text-align: center;
}

/* ----- Shared text styles ----- */
.quiz-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
}
.quiz-h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5.5vw, 3.5rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0 0 1.25rem;
}
.quiz-h1 .lit,
.result-title .lit {
    background: linear-gradient(90deg, #f472b6 0%, #a855f7 50%, #22d3ee 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.quiz-sub {
    font-size: clamp(1rem, 1.5vw, 1.1rem);
    color: var(--text-secondary);
    line-height: 1.55;
    max-width: 520px;
    margin: 0 auto 2rem;
}
.quiz-note {
    font-size: 0.825rem;
    color: var(--text-muted);
    margin: 1rem 0 0;
    letter-spacing: 0.01em;
}

/* ----- CTA buttons ----- */
.quiz-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.95rem 1.75rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #a855f7 0%, #f472b6 100%);
    color: #ffffff;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.01em;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(168, 85, 247, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.quiz-cta:hover, .quiz-cta:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(168, 85, 247, 0.45);
    filter: brightness(1.05);
    outline: none;
}
.quiz-cta:focus-visible { outline: 2px solid #f472b6; outline-offset: 4px; }
.quiz-cta .arrow { transition: transform 0.2s ease; }
.quiz-cta:hover .arrow, .quiz-cta:focus-visible .arrow { transform: translateX(4px); }

/* ----- Progress bar ----- */
.quiz-progress { margin-bottom: 2rem; }
.progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    min-height: 1.5rem;
}
.quiz-back {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}
.quiz-back:hover, .quiz-back:focus-visible {
    color: var(--text-primary);
    background: rgba(var(--glass-overlay-color), 0.06);
    outline: none;
}
.quiz-back[hidden] { visibility: hidden; display: inline-block; }
.progress-track {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(var(--glass-overlay-color), 0.07);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #a855f7 0%, #f472b6 100%);
    border-radius: 2px;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----- Question card ----- */
.quiz-card {
    background: rgba(var(--glass-overlay-color), 0.04);
    border: 1px solid rgba(var(--glass-overlay-color), 0.10);
    border-radius: 18px;
    padding: clamp(1.5rem, 4vw, 2.25rem);
    backdrop-filter: blur(12px);
    text-align: left;
}
.quiz-q {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0 0 1.5rem;
    letter-spacing: -0.01em;
}

.answer-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.answer-btn {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    border-radius: 12px;
    background: rgba(var(--glass-overlay-color), 0.03);
    border: 1px solid rgba(var(--glass-overlay-color), 0.10);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    width: 100%;
    transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}
.answer-btn:hover, .answer-btn:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(168, 85, 247, 0.45);
    background: rgba(168, 85, 247, 0.08);
    outline: none;
}
.answer-btn:focus-visible { outline: 2px solid #a855f7; outline-offset: 2px; }
.answer-letter {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(var(--glass-overlay-color), 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: background 0.2s ease, color 0.2s ease;
}
.answer-btn:hover .answer-letter,
.answer-btn:focus-visible .answer-letter {
    background: linear-gradient(135deg, #a855f7, #f472b6);
    color: #ffffff;
}

/* ----- Result panel ----- */
.result-wrap { max-width: 580px; }
.result-card {
    background: rgba(var(--glass-overlay-color), 0.04);
    border: 1px solid rgba(var(--glass-overlay-color), 0.10);
    border-radius: 22px;
    padding: clamp(2rem, 5vw, 3rem) clamp(1.5rem, 4vw, 2.5rem);
    backdrop-filter: blur(14px);
    text-align: center;
    box-shadow: 0 22px 60px rgba(2, 6, 23, 0.35);
}
.result-emoji {
    font-size: clamp(3.5rem, 8vw, 4.5rem);
    line-height: 1;
    display: inline-block;
    margin-bottom: 1rem;
}
.result-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0 0 1rem;
}
.result-blurb {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 auto 2rem;
    max-width: 440px;
}
.result-runner {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(var(--glass-overlay-color), 0.08);
}
.result-runner-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
}
.quiz-runner-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(168, 85, 247, 0.4);
    padding-bottom: 1px;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.quiz-runner-link:hover, .quiz-runner-link:focus-visible {
    color: var(--text-primary);
    border-color: #f472b6;
    outline: none;
}
.quiz-restart {
    margin-top: 1.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.825rem;
    cursor: pointer;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
    display: inline-block;
}
.quiz-restart:hover, .quiz-restart:focus-visible {
    color: var(--text-secondary);
    background: rgba(var(--glass-overlay-color), 0.05);
    outline: none;
}

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
    .quiz-panel::before { animation: none; }
    .quiz-cta, .answer-btn, .quiz-cta .arrow { transition: none; }
    .quiz-cta:hover, .quiz-cta:focus-visible,
    .answer-btn:hover, .answer-btn:focus-visible {
        transform: none;
    }
    .progress-fill { transition: none; }
}
