* {
    box-sizing: border-box;
}

:root {
    --bg: #F5F2EC;
    --surface: #FFFCF7;
    --ink: #1D1C1A;
    --muted: #77736D;
    --border: #DCD7CF;
    --accent: #E63323;
    --accent-dark: #B72419;
    --white: #FFFFFF;
    --radius: 22px;
    --shadow: 0 20px 60px rgba(29, 28, 26, 0.09);
}

html {
    background: var(--bg);
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 92% 8%, rgba(230, 51, 35, 0.08), transparent 28rem),
        var(--bg);
    color: var(--ink);
    font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button {
    font: inherit;
}

.app-shell {
    width: min(100%, 760px);
    min-height: 100dvh;
    margin: 0 auto;
    padding: max(28px, env(safe-area-inset-top)) 22px max(26px, env(safe-area-inset-bottom));
}

.screen {
    min-height: calc(100dvh - 54px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

.screen--intro,
.screen--error {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 48px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 30px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.intro-copy {
    margin-top: auto;
    margin-bottom: auto;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    max-width: 620px;
    margin-bottom: 20px;
    font-size: clamp(46px, 13vw, 88px);
    line-height: 0.96;
    letter-spacing: -0.055em;
    font-weight: 760;
}

.intro-copy p,
.screen--error p {
    max-width: 580px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: clamp(18px, 5vw, 24px);
    line-height: 1.42;
    letter-spacing: -0.018em;
}

.button {
    width: 100%;
    min-height: 62px;
    border: 0;
    border-radius: 999px;
    padding: 16px 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 17px;
    transition: transform 180ms ease, background 180ms ease, opacity 180ms ease;
}

.button:active {
    transform: scale(0.985);
}

.button--primary {
    background: var(--accent);
    color: var(--white);
}

.button--primary:hover {
    background: var(--accent-dark);
}

.button--light {
    background: var(--white);
    color: var(--ink);
    box-shadow: var(--shadow);
}

.screen--quiz {
    display: flex;
    flex-direction: column;
}

.quiz-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.progress-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.progress-track {
    width: 100%;
    height: 3px;
    margin-top: 18px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--border);
}

.progress-track span {
    display: block;
    width: 20%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 450ms cubic-bezier(.22,.8,.24,1);
}

.question-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 0 24px;
    animation: questionIn 460ms cubic-bezier(.22,.8,.24,1) both;
}

.question-wrap.is-leaving {
    animation: questionOut 220ms ease both;
}

.question-wrap h2 {
    margin-bottom: 32px;
    font-size: clamp(34px, 9.2vw, 62px);
    line-height: 1.02;
    letter-spacing: -0.048em;
    font-weight: 735;
}

.options {
    display: grid;
    gap: 10px;
}

.option-button {
    width: 100%;
    min-height: 62px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 252, 247, 0.72);
    color: var(--ink);
    text-align: left;
    font-size: 16px;
    line-height: 1.25;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.option-button:hover {
    border-color: #B9B2A8;
    background: var(--surface);
}

.option-button:active {
    transform: scale(0.992);
}

.option-button[disabled] {
    cursor: default;
    opacity: 0.55;
}

.option-button.is-wrong {
    border-color: rgba(230, 51, 35, 0.55);
    background: rgba(230, 51, 35, 0.07);
    opacity: 1;
    animation: nudge 280ms ease;
}

.option-button.is-correct {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--white);
    opacity: 1;
}

.feedback {
    margin-top: 18px;
    min-height: 76px;
}

.feedback p {
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.45;
}

#feedback-message {
    color: var(--accent);
    font-weight: 700;
}

.hint-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

.hint-text {
    max-width: 520px;
    color: var(--muted);
}

.screen--reveal {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.reveal-image-wrap {
    position: relative;
    min-height: min(70dvh, 720px);
    overflow: hidden;
    border-radius: 26px;
    background: #D7CEC0;
    box-shadow: var(--shadow);
}

.reveal-image-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.075);
    opacity: 0;
}

.screen--reveal.is-revealed .reveal-image-wrap img {
    animation: imageReveal 1800ms cubic-bezier(.2,.78,.22,1) forwards;
}

.reveal-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(20,18,16,0.06) 18%, rgba(20,18,16,0.72) 100%);
}

.reveal-copy {
    position: absolute;
    inset: auto 0 0;
    padding: 28px;
    color: var(--white);
    opacity: 0;
    transform: translateY(18px);
}

.screen--reveal.is-revealed .reveal-copy {
    animation: copyReveal 800ms 560ms cubic-bezier(.22,.8,.24,1) forwards;
}

.reveal-kicker {
    max-width: 430px;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 650;
}

.reveal-copy h2 {
    margin-bottom: 8px;
    font-size: clamp(58px, 18vw, 112px);
    line-height: 0.88;
    letter-spacing: -0.075em;
    font-weight: 800;
    text-transform: uppercase;
}

.reveal-message {
    margin-bottom: 0;
    font-size: 21px;
    font-weight: 600;
}

.shortcut-note {
    margin: 4px 16px 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    text-align: center;
}

.screen--error h2 {
    margin: auto 0 12px;
    font-size: clamp(42px, 12vw, 72px);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

@keyframes questionIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes questionOut {
    to { opacity: 0; transform: translateY(-10px); }
}

@keyframes nudge {
    0%, 100% { transform: translateX(0); }
    35% { transform: translateX(-6px); }
    70% { transform: translateX(4px); }
}

@keyframes imageReveal {
    from { opacity: 0; transform: scale(1.075); filter: saturate(.7); }
    to { opacity: 1; transform: scale(1); filter: saturate(1); }
}

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

@media (min-width: 680px) {
    .app-shell {
        padding-left: 34px;
        padding-right: 34px;
    }

    .option-button {
        padding-left: 22px;
        padding-right: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 1ms !important;
        animation-delay: 0ms !important;
        scroll-behavior: auto !important;
        transition-duration: 1ms !important;
    }
}
