/* THE MOON'S DEBT — night, iron and old blood.
 * All colours live in the tokens below; the rest of the file only references them. */
:root {
    --bg: #0b0d12;          /* night */
    --bg-raised: #12151c;   /* button / note surface */
    --ink: #d8d2c4;         /* bone-white body text */
    --muted: #8b867a;       /* aftermath, labels */
    --silver: #c3c8d2;      /* moon, headings */
    --line: #2a2f3a;        /* borders, dividers */
    --blood: #8e2424;       /* accent: aftermath rule, focus, hover */
    --blood-bright: #b23a3a;

    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --measure: 38rem;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(ellipse 70% 40% at 50% -5%, rgba(195, 200, 210, 0.10), transparent 70%),
        var(--bg);
    background-attachment: fixed;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.125rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.page {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 4.5rem 1rem 5rem;
}

.page.enter { animation: rise 0.6s ease-out both; }
@keyframes rise {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

/* ── progress: 15 notches pinned to the top ───────────────────────── */
.progress {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 10;
    display: flex;
    gap: 3px;
    padding: 10px 16px;
    background: linear-gradient(var(--bg) 60%, transparent);
    max-width: calc(var(--measure) + 32px);
    margin: 0 auto;
}
.progress[hidden] { display: none; }
.notch {
    flex: 1;
    height: 3px;
    background: var(--line);
    transition: background 0.4s;
}
.notch.filled { background: var(--silver); }

/* ── title block (prologue) ───────────────────────────────────────── */
.title-block {
    text-align: center;
    margin-bottom: 3.5rem;
}
.moon {
    width: 88px;
    height: 88px;
    margin: 0 auto 1.75rem;
    border-radius: 50%;
    background:
        radial-gradient(circle at 34% 30%, rgba(0, 0, 0, 0.10) 0 7%, transparent 8%),
        radial-gradient(circle at 62% 58%, rgba(0, 0, 0, 0.12) 0 11%, transparent 12%),
        radial-gradient(circle at 44% 72%, rgba(0, 0, 0, 0.08) 0 5%, transparent 6%),
        radial-gradient(circle at 38% 35%, #eef0f3, #b9bec8 60%, #8d929c);
    box-shadow: 0 0 60px 8px rgba(195, 200, 210, 0.18);
}
.game-title {
    margin: 0;
    color: var(--silver);
    font-weight: normal;
    font-size: clamp(2.2rem, 9vw, 3.4rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1.15;
}
.tagline {
    margin: 0.75rem 0 0;
    color: var(--muted);
    font-style: italic;
}

/* ── chapter label + scene title ──────────────────────────────────── */
.chapter {
    margin: 0 0 0.25rem;
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
.scene-title {
    margin: 0 0 1.75rem;
    color: var(--silver);
    font-weight: normal;
    font-size: clamp(1.6rem, 6vw, 2.1rem);
    line-height: 1.2;
}
.scene-title:focus { outline: none; }

/* ── prose ───────────────────────────────────────────────────────── */
.story p,
.aftermath p { margin: 0 0 1.05em; }

.aftermath {
    color: var(--muted);
    font-style: italic;
    border-left: 2px solid var(--blood);
    padding-left: 1.1rem;
}

.divider {
    border: 0;
    height: 1px;
    margin: 2.5rem auto 2.75rem;
    width: 40%;
    background: linear-gradient(90deg, transparent, var(--line), transparent);
    overflow: visible;
    position: relative;
}
.divider::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    transform: translate(-50%, -50%) rotate(45deg);
    background: var(--bg);
    border: 1px solid var(--muted);
}

/* The note from the bartender: a scrap of paper. */
.note {
    margin: 2.25rem auto;
    width: fit-content;
    padding: 1rem 1.75rem;
    background: #d9d0bb;
    color: #1d1a15;
    font-weight: bold;
    letter-spacing: 0.25em;
    transform: rotate(-1.5deg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

/* ── buttons ─────────────────────────────────────────────────────── */
button {
    font: inherit;
    color: inherit;
    cursor: pointer;
}
button:focus-visible {
    outline: 2px solid var(--blood-bright);
    outline-offset: 3px;
}

.options {
    display: grid;
    gap: 0.85rem;
    margin-top: 2.5rem;
}
.option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.1rem;
    text-align: left;
    line-height: 1.5;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: 3px;
    transition: border-color 0.2s, background 0.2s;
}
.option:hover {
    border-color: var(--blood);
    background: #171a22;
}
.option-key {
    flex: none;
    display: grid;
    place-items: center;
    width: 1.8rem;
    height: 1.8rem;
    border: 1px solid var(--muted);
    border-radius: 50%;
    color: var(--silver);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}
.option:hover .option-key {
    border-color: var(--blood-bright);
    color: var(--ink);
}

.hint {
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 0.8rem;
    text-align: center;
    letter-spacing: 0.1em;
}
@media (hover: none) { .hint { display: none; } }

.btn-begin {
    display: block;
    margin: 3rem auto 0;
    padding: 0.85rem 2.25rem;
    background: transparent;
    border: 1px solid var(--silver);
    border-radius: 2px;
    color: var(--silver);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}
.btn-begin:hover {
    background: var(--silver);
    color: var(--bg);
}

/* ── ending ──────────────────────────────────────────────────────── */
.epitaph {
    margin: 3rem 0 0;
    color: var(--silver);
    text-align: center;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.95rem;
    line-height: 1.8;
}
.fin {
    margin: 2rem 0 0;
    color: var(--muted);
    text-align: center;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
    .page.enter { animation: none; }
    * { transition: none !important; }
}
