:root {
    --bg-1: #020617;
    --bg-2: #0f172a;
    --panel: rgba(15, 23, 42, 0.82);
    --panel-2: rgba(30, 41, 59, 0.72);
    --text: #e5e7eb;
    --muted: #94a3b8;
    --line: rgba(255, 255, 255, 0.08);
    --accent: #8b5cf6;
    --accent-2: #3b82f6;
    --good: #22c55e;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(139, 92, 246, 0.22), transparent 28%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 24%),
        linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* Accessible keyboard focus ring */
:focus-visible {
    outline: 3px solid #8b5cf6;
    outline-offset: 3px;
    border-radius: 12px;
}

/* Slightly stronger focus for buttons/interactive elements */
button:focus-visible,
a:focus-visible,
.choice-card:focus-visible {
    box-shadow:
        0 0 0 3px rgba(139, 92, 246, 0.35),
        0 0 0 6px rgba(59, 130, 246, 0.18);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem clamp(1rem, 4vw, 3rem);
}

.site-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-weight: 800;
    text-decoration: none;
}

.site-nav {
    display: flex;
    gap: 1rem;
}

.site-nav a {
    text-decoration: none;
}

@media (max-width: 640px) {
  .site-nav a[href="/"],
  .site-nav a[href="index.html"] {
    display: none;
  }

  .site-header {
    gap: 1rem;
  }

  .site-logo {
    font-size: 1rem;
  }

  .site-nav {
    gap: 0.75rem;
  }
}

.site-footer {
    padding: 2rem clamp(1rem, 4vw, 3rem);
    opacity: 0.7;
    font-size: 0.9rem;
}

.app {
    width: 100%;
    max-width: 980px;
    border-radius: 30px;
    overflow: hidden;
    background: var(--panel);
    border: 1px solid var(--line);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    font-size: 20px;
}

.brand h1 {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.1;
}

.brand p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.progress-wrap {
    width: 320px;
    max-width: 100%;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.86rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.progress {
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 180ms ease;
}

.content {
    padding: 28px 22px 24px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

.eyebrow {
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #c4b5fd;
    font-weight: 800;
    margin-bottom: 10px;
}

h2 {
    margin: 0 0 12px;
    font-size: clamp(1.75rem, 3vw, 2.8rem);
    line-height: 1.04;
}

.lead {
    margin: 0;
    max-width: 58ch;
    color: var(--muted);
    line-height: 1.65;
    font-size: 1rem;
}

.actions,
.question-actions,
.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

button {
    font: inherit;
    border: 0;
    border-radius: 16px;
    padding: 14px 18px;
    cursor: pointer;
    transition: transform 0.14s ease, opacity 0.14s ease, background 0.14s ease;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    font-weight: 800;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid var(--line);
}

.question-shell,
.result-card,
.backup-panel,
.mini-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025));
    border: 1px solid var(--line);
    border-radius: 26px;
}

.question-shell {
    padding: 22px;
}

.question-meta {
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 8px;
}

.question-title {
    margin: 0 0 18px;
    font-size: clamp(1.55rem, 2.8vw, 2.2rem);
    line-height: 1.12;
    max-width: 16ch;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.choice-card {
    min-height: 240px;
    padding: 22px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
    color: var(--text);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.choice-card::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 160ms ease;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(59, 130, 246, 0.08));
}

.choice-card:hover::before {
    opacity: 1;
}

.choice-card>* {
    position: relative;
    z-index: 1;
}

.choice-label {
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #cbd5e1;
    margin-bottom: 16px;
    font-weight: 800;
}

.choice-title {
    font-size: clamp(1.35rem, 2.4vw, 1.95rem);
    line-height: 1.05;
    margin: 0 0 12px;
    max-width: 12ch;
}

.choice-text {
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
    max-width: 28ch;
}

.choice-hint {
    margin-top: 18px;
    display: inline-flex;
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #dbeafe;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.86rem;
}

.result-layout {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 18px;
    margin-top: 20px;
}

.result-card {
    padding: 22px;
}

.result-kicker {
    color: #86efac;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
}

.result-title {
    margin: 0 0 10px;
    font-size: clamp(1.8rem, 3.3vw, 2.7rem);
    line-height: 1.04;
}

.pills,
.why-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.055);
    color: var(--text);
    font-size: 0.9rem;
}

.result-description {
    margin: 16px 0 0;
    color: var(--muted);
    line-height: 1.65;
}

.section-title {
    margin: 18px 0 10px;
    font-size: 0.98rem;
}

.why-item {
    display: inline-flex;
    align-items: center;
    padding: 8px 11px;
    border-radius: 12px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.24);
    color: #bbf7d0;
    font-size: 0.9rem;
}

.backup-panel {
    padding: 18px;
}

.backup-list {
    display: grid;
    gap: 12px;
}

.mini-card {
    padding: 14px 14px 13px;
}

.mini-card h4 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.mini-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    font-size: 0.92rem;
}

.small-note {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.reveal {
    display: grid;
    place-items: center;
    min-height: 320px;
    text-align: center;
}

.reveal-card {
    width: 100%;
    max-width: 540px;
    padding: 34px 24px;
    border-radius: 28px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025));
}

.spinner {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    margin: 0 auto 20px;
    border: 4px solid rgba(255, 255, 255, 0.08);
    border-top-color: #c4b5fd;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 820px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .choice-grid,
    .result-layout {
        grid-template-columns: 1fr;
    }

    .choice-card {
        min-height: 200px;
    }
}

.trailer-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.trailer-modal.is-open {
    display: block;
}

.trailer-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(3px);
}

.trailer-modal-dialog {
    position: relative;
    width: min(960px, calc(100vw - 32px));
    margin: 5vh auto 0;
    z-index: 2;
}

.trailer-modal-body {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.trailer-modal-body iframe {
    width: 100%;
    height: 100%;
    display: block;
}

.trailer-modal-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #111;

    font-size: 16px;
    font-weight: 600;
    line-height: 1;

    cursor: pointer;
    z-index: 3;

    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.trailer-modal-close:hover {
    transform: scale(1.05);
}

body.modal-open {
    overflow: hidden;
}

#watch-trailer-btn,
#listen-score-btn {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
}

.media-modal-title {
    color: white;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.media-eq {
    display: none;
    align-items: end;
    gap: 3px;
    height: 16px;
}

.media-eq span {
    display: block;
    width: 4px;
    border-radius: 999px;
    background: #fff;
    transform-origin: bottom;
    animation: eqBounce 0.9s infinite ease-in-out;
}

.media-eq span:nth-child(1) {
    height: 8px;
    animation-delay: 0s;
}

.media-eq span:nth-child(2) {
    height: 14px;
    animation-delay: 0.15s;
}

.media-eq span:nth-child(3) {
    height: 10px;
    animation-delay: 0.3s;
}

.media-eq.is-active {
    display: inline-flex;
}

@keyframes eqBounce {

    0%,
    100% {
        transform: scaleY(0.45);
        opacity: 0.7;
    }

    50% {
        transform: scaleY(1.1);
        opacity: 1;
    }
}

.trailer-modal-dialog.is-score {
    width: min(1200px, calc(100vw - 32px));
    margin-top: 4vh;
}

.trailer-modal-body.is-score {
    aspect-ratio: auto;
    height: min(78vh, 760px);
}


/* Trailer button */
.trailer-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;

    padding: 14px 24px;
    border-radius: 14px;

    background: #ffffff;
    color: #111111;

    font-weight: 700;
    text-decoration: none;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;

    box-shadow:
        0 0 0 rgba(255, 255, 255, 0),
        0 0 24px rgba(255, 255, 255, 0.08);

    overflow: hidden;
}

/* Soft glow pulse */
.trailer-btn::before {
    content: "";

    position: absolute;
    inset: -2px;

    border-radius: inherit;

    background: radial-gradient(circle,
            rgba(255, 255, 255, 0.28) 0%,
            rgba(255, 255, 255, 0.08) 45%,
            transparent 75%);

    opacity: 0.7;
    z-index: -1;

    animation: trailerGlow 3s ease-in-out infinite;
}

/* Gentle shimmer sweep */
.trailer-btn::after {
    content: "";

    position: absolute;
    top: 0;
    left: -120%;

    width: 60%;
    height: 100%;

    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.25),
            transparent);

    transform: skewX(-20deg);

    animation: trailerShimmer 4.5s infinite;
}

/* Hover interaction */
.trailer-btn:hover {
    transform: translateY(-2px) scale(1.02);

    box-shadow:
        0 0 18px rgba(255, 255, 255, 0.18),
        0 0 42px rgba(255, 255, 255, 0.10);
}

/* Keyboard accessibility */
.trailer-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 4px;
}

@keyframes trailerGlow {

    0%,
    100% {
        opacity: 0.45;
        transform: scale(1);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.03);
    }
}

@keyframes trailerShimmer {
    0% {
        left: -120%;
    }

    100% {
        left: 160%;
    }
}

/* Instant Pick button */
.instant-pick-btn {
    position: relative;
    overflow: hidden;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;

    box-shadow:
        0 0 12px rgba(255, 255, 255, 0.04);
}

/* Very subtle shimmer */
.instant-pick-btn::after {
    content: "";

    position: absolute;
    top: 0;
    left: -140%;

    width: 50%;
    height: 100%;

    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.12),
            transparent);

    transform: skewX(-20deg);

    animation: instantPickShimmer 7s linear infinite;
}

/* Soft hover lift */
.instant-pick-btn:hover {
    transform: translateY(-1px);

    box-shadow:
        0 0 18px rgba(255, 255, 255, 0.08);
}

@keyframes instantPickShimmer {
    0% {
        left: -140%;
    }

    100% {
        left: 180%;
    }
}


/* =========
   ERROR PAGES
========= */


.card {
    width: 100%;
    max-width: 720px;
    border-radius: 30px;
    padding: 34px 28px;
    background: var(--panel);
    border: 1px solid var(--line);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    text-align: center;
}

.logo {
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    font-size: 28px;
}

.eyebrow {
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #c4b5fd;
    font-weight: 800;
    margin-bottom: 10px;
}

h1 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.04;
}

p {
    margin: 0 auto;
    max-width: 52ch;
    color: var(--muted);
    line-height: 1.65;
    font-size: 1rem;
}

.actions {
    margin-top: 24px;
}

a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    font-weight: 800;
    transition: transform 0.14s ease;
}

a:hover {
    transform: translateY(-1px);
}