/* ============================================================
   economics.quest — Marble-Palazzo × Dopamine-Puzzle Stylesheet
   Palette: Honeyed Neutral
   Type: IBM Plex Mono + Source Sans 3 + Space Mono
   Font availability note: IBM Plex Mono" (Google Fonts), Source Sans 3" (Google Fonts),
   and Space Mono" (Google Fonts) are represented through named CSS stacks with
   system fallbacks only; no external font files are requested.
   Motion note: Interactive Pattern uses IntersectionObserver (threshold: 0.3 and
   threshold 0.15.); these are NOT scroll-triggered parallax effects. The heading
   draws its underline (a thin SVG path) as each quest enters view.
   ============================================================ */

:root {
    --bg-primary: #f5f0e8;       /* Parchment Cream */
    --bg-secondary: #ede6d8;     /* Warm Linen */
    --vein: #d4c9b4;             /* Honey Dust */
    --vein-soft: #b8a890;        /* Marble warm-grey */
    --text-primary: #3a3224;     /* Dark Umber */
    --text-secondary: #5a5040;   /* Muted Sienna */
    --accent-warm: #c49a3c;      /* Burnt Honey */
    --accent-deep: #8b6c2e;      /* Amber Resin */
    --surface-glow: #f0e6d0;     /* Pale Honey */
    --pop: #e8a817;              /* Dopamine Gold */
    --contrast: #1e1a14;         /* Obsidian Brown */

    --spine: 8vw;
    --spine-tablet: 4vw;
    --spine-mobile: 5vw;

    --font-display: "IBM Plex Mono", "Space Mono", ui-monospace, monospace;
    --font-body: "Source Sans 3", "Inter", "Lato", system-ui, sans-serif;
    --font-data: "Space Mono", "IBM Plex Mono", ui-monospace, monospace;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

    --frieze-h: 90px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.5vw, 1.125rem);
    line-height: 1.72;
    color: var(--text-secondary);
    background: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Page-wide marble background: layered gradients only (no image) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse at 20% 10%, rgba(232, 168, 23, 0.06), transparent 60%),
        radial-gradient(ellipse at 85% 80%, rgba(139, 108, 46, 0.07), transparent 60%),
        linear-gradient(135deg, #f5f0e8 0%, #ede6d8 40%, #e8dfd0 100%);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: transparent;
    filter: url(#marble);
    mix-blend-mode: multiply;
    opacity: 0.14;
    pointer-events: none;
}

/* Hide the defs SVG entirely */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ============================================================
   MARBLE FRIEZE HEADER
   ============================================================ */
.frieze {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--frieze-h);
    background:
        linear-gradient(180deg, rgba(245, 240, 232, 0.96) 0%, rgba(237, 230, 216, 0.9) 100%);
    border-bottom: 1px solid var(--vein);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    overflow: hidden;
}

.frieze::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--bg-secondary);
    filter: url(#marble);
    mix-blend-mode: multiply;
    opacity: 0.18;
    pointer-events: none;
}

.frieze-veining {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background:
        linear-gradient(90deg,
            transparent 0%,
            var(--vein) 10%,
            var(--vein-soft) 40%,
            var(--accent-warm) 50%,
            var(--vein-soft) 60%,
            var(--vein) 90%,
            transparent 100%);
    opacity: 0.7;
}

.frieze-inner {
    position: relative;
    height: 100%;
    padding: 0 var(--spine);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logotype {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1rem, 1.4vw, 1.18rem);
    letter-spacing: 0.04em;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 200ms var(--ease-out);
}

.logotype:hover {
    color: var(--accent-deep);
}

.logo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--pop) 0%, var(--accent-warm) 60%, var(--accent-deep) 100%);
    box-shadow: 0 0 8px rgba(232, 168, 23, 0.5);
}

.logo-sep {
    color: var(--accent-warm);
    font-weight: 400;
}

.logo-accent {
    color: var(--accent-deep);
}

.frieze-nav {
    display: flex;
    gap: 1.75rem;
    align-items: center;
}

.menu-rune {
    display: none;
    width: 42px;
    height: 34px;
    border: 1px solid var(--vein);
    border-radius: 999px;
    background: var(--surface-glow);
    position: relative;
    cursor: pointer;
    padding: 0 10px;
    box-shadow: inset 0 0 12px rgba(232, 168, 23, 0.08);
}

.menu-rune span {
    display: block;
    width: 100%;
    height: 1px;
    margin: 5px 0;
    background: var(--accent-deep);
    transform-origin: center;
    transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out);
}

.menu-rune.is-open span:nth-child(1) {
    transform: translateY(6px) rotate(35deg);
}

.menu-rune.is-open span:nth-child(2) {
    opacity: 0;
}

.menu-rune.is-open span:nth-child(3) {
    transform: translateY(-6px) rotate(-35deg);
}

.nav-token {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.4rem 0.65rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    transition: all 220ms var(--ease-out);
    position: relative;
}

.nav-token::before {
    content: "·";
    margin-right: 0.45rem;
    color: var(--accent-warm);
    opacity: 0;
    transition: opacity 200ms var(--ease-out);
}

.nav-token:hover {
    color: var(--text-primary);
    border-color: var(--vein);
    background: var(--surface-glow);
}

.nav-token:hover::before {
    opacity: 1;
}

/* ============================================================
   QUEST BLOCKS — F-pattern spine, asymmetric 45/55
   ============================================================ */
main {
    padding-top: 0;
}

.quest {
    position: relative;
    width: 100%;
    padding: clamp(3.5rem, 7vw, 6rem) var(--spine) clamp(3.5rem, 7vw, 6rem) var(--spine);
    border-bottom: 1px solid rgba(212, 201, 180, 0.4);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}

.quest.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.quest-alt {
    background:
        linear-gradient(180deg, rgba(237, 230, 216, 0) 0%, rgba(237, 230, 216, 0.55) 40%, rgba(237, 230, 216, 0) 100%);
}

.quest-alt::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--bg-secondary);
    filter: url(#marble);
    mix-blend-mode: multiply;
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
}

.quest-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 45fr 55fr;
    gap: clamp(2rem, 4vw, 4rem);
    align-items: start;
}

.quest-heading {
    max-width: 44ch;
}

.quest-visual {
    position: relative;
    min-height: 320px;
}

/* Quest eyebrow */
.quest-eyebrow {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-deep);
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--vein);
    border-radius: 999px;
    background: var(--surface-glow);
    margin-bottom: 1.25rem;
}

/* Quest title */
.quest-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.6rem, 3.5vw, 3.2rem);
    line-height: 1.22;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

.quest-title .title-draw {
    display: inline-block;
    position: relative;
    color: var(--accent-deep);
    white-space: nowrap;
}

.title-underline {
    position: absolute;
    left: 0;
    bottom: -0.45em;
    width: 100%;
    height: 0.45em;
    overflow: visible;
    pointer-events: none;
}

.title-underline .drawable {
    filter: drop-shadow(0 0 4px rgba(196, 154, 60, 0.25));
}

.quest-lede {
    font-size: clamp(1rem, 1.6vw, 1.22rem);
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

.quest-body {
    font-size: clamp(0.95rem, 1.45vw, 1.08rem);
    line-height: 1.78;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.quest-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.quest-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Data chips */
.data-chip {
    display: inline-block;
    font-family: var(--font-data);
    font-size: clamp(0.78rem, 1vw, 0.88rem);
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--accent-deep);
    background: var(--surface-glow);
    border: 1px solid rgba(196, 154, 60, 0.18);
    border-radius: 4px;
    padding: 2px 6px;
    white-space: nowrap;
}

/* Bullets */
.quest-bullets {
    list-style: none;
    margin-top: 1.25rem;
    padding: 0;
}

.quest-bullets li {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    padding: 0.5rem 0;
    border-top: 1px dashed rgba(212, 201, 180, 0.6);
    font-size: clamp(0.92rem, 1.4vw, 1rem);
    color: var(--text-secondary);
}

.quest-bullets li:first-child {
    border-top: none;
}

.quest-bullets li strong {
    font-family: var(--font-data);
    color: var(--accent-deep);
    font-weight: 700;
    margin-right: 0.35em;
}

.bullet-dot {
    flex: 0 0 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 0.4em;
    background: radial-gradient(circle at 30% 30%, var(--pop) 0%, var(--accent-warm) 70%);
    box-shadow: 0 0 0 2px rgba(232, 168, 23, 0.12);
    flex-shrink: 0;
}

/* Formula */
.quest-formula {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.85rem;
    padding: 0.9rem 1.1rem;
    background: var(--surface-glow);
    border: 1px solid var(--vein);
    border-left: 3px solid var(--accent-warm);
    border-radius: 6px;
    margin: 1rem 0;
}

.formula-chip {
    font-family: var(--font-data);
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.04em;
}

.formula-note {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.92em;
}

/* Stats (Quest 03) */
.quest-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
    margin-top: 1.25rem;
}

.stat {
    padding: 0.85rem 0.9rem;
    background: var(--surface-glow);
    border: 1px solid var(--vein);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.stat::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-warm), var(--pop), var(--accent-warm));
    opacity: 0.7;
}

.stat-num {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.4rem, 2.2vw, 1.9rem);
    color: var(--text-primary);
    letter-spacing: 0.02em;
    line-height: 1.1;
}

.stat-unit {
    font-size: 0.65em;
    color: var(--accent-deep);
    margin-left: 0.15em;
}

.stat-label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
    line-height: 1.4;
}

/* Voice grid (Quest 04) */
.voice-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
    margin-top: 1.25rem;
}

.voice {
    position: relative;
    padding: 1rem 0.9rem 0.95rem;
    background: var(--bg-primary);
    border: 1px solid var(--vein);
    border-radius: 6px;
    overflow: hidden;
}

.voice::after {
    content: "";
    position: absolute;
    bottom: -40px;
    right: -40px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(232, 168, 23, 0.16), rgba(196, 154, 60, 0) 70%);
    pointer-events: none;
}

.voice-roman {
    display: inline-block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--accent-deep);
    letter-spacing: 0.12em;
    margin-bottom: 0.35rem;
}

.voice-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
    letter-spacing: 0.03em;
    margin-bottom: 0.4rem;
}

.voice p {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

/* Payoff table (Quest 05) */
.payoff {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    border: 1px solid var(--vein);
    border-radius: 6px;
    overflow: hidden;
    margin-top: 1rem;
    background: var(--bg-primary);
    font-family: var(--font-display);
}

.payoff > div {
    padding: 0.75rem 0.85rem;
    border-right: 1px solid var(--vein);
    border-bottom: 1px solid var(--vein);
    font-size: 0.88rem;
}

.payoff > div:nth-child(3n) {
    border-right: none;
}

.payoff > div:nth-last-child(-n+3) {
    border-bottom: none;
}

.payoff-corner {
    background: var(--surface-glow);
}

.payoff-col {
    background: var(--surface-glow);
    color: var(--accent-deep);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: lowercase;
}

.payoff-row {
    background: var(--surface-glow);
    color: var(--accent-deep);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: lowercase;
}

.payoff-cell {
    text-align: center;
    font-family: var(--font-data);
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-primary);
}

.payoff-cell.payoff-best {
    background: rgba(232, 168, 23, 0.12);
    color: var(--text-primary);
}

.payoff-cell.payoff-nash {
    background: rgba(232, 168, 23, 0.22);
    color: var(--contrast);
    font-weight: 700;
    position: relative;
}

.payoff-cell.payoff-nash::before {
    content: "★";
    position: absolute;
    top: 4px;
    right: 6px;
    color: var(--pop);
    font-size: 0.7rem;
}

.payoff-caption {
    margin-top: 0.9rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Glossary (Quest 06) */
.glossary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
    margin-top: 1rem;
}

.gloss-item {
    padding: 0.8rem 0.9rem;
    background: var(--bg-primary);
    border: 1px solid var(--vein);
    border-radius: 6px;
    transition: border-color 220ms var(--ease-out), background 220ms var(--ease-out), transform 220ms var(--ease-out);
    cursor: default;
}

.gloss-item:hover,
.gloss-item.is-active {
    border-color: var(--accent-warm);
    background: var(--surface-glow);
    transform: translateY(-2px);
}

.gloss-item dt {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.96rem;
    color: var(--text-primary);
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}

.gloss-index {
    font-family: var(--font-data);
    font-size: 0.78rem;
    color: var(--accent-warm);
    letter-spacing: 0.1em;
    flex-shrink: 0;
}

.gloss-item dd {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

/* Closing signet (Quest 07) */
.closing-signet {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.25rem;
    padding: 1.25rem 1.1rem;
    background: var(--surface-glow);
    border: 1px solid var(--vein);
    border-radius: 8px;
}

.signet {
    flex: 0 0 120px;
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 0 6px rgba(196, 154, 60, 0.25));
}

.signet-text {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 9px;
    fill: var(--accent-deep);
    letter-spacing: 0.18em;
}

.closing-lede {
    font-family: var(--font-display);
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 0.4rem;
    font-style: italic;
}

.closing-author {
    font-size: 0.86rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.closing-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* ============================================================
   QUEST VISUAL (SVG diagrams + bubbles)
   ============================================================ */
.diagram {
    width: 100%;
    height: auto;
    max-height: 420px;
    display: block;
    border: 1px solid var(--vein);
    border-radius: 8px;
    background:
        linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    padding: 0.5rem;
    box-shadow:
        0 2px 0 rgba(58, 50, 36, 0.04),
        0 12px 28px rgba(30, 26, 20, 0.06);
    overflow: visible;
}

.quest-map {
    width: 100%;
    height: auto;
    border: 1px solid var(--vein);
    border-radius: 10px;
    box-shadow:
        0 2px 0 rgba(58, 50, 36, 0.04),
        0 14px 36px rgba(30, 26, 20, 0.09);
    background: var(--bg-primary);
    overflow: visible;
}

.map-marble {
    mix-blend-mode: multiply;
    opacity: 0.8;
}

/* SVG text styling */
.diagram text,
.quest-map text {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 500;
    fill: var(--text-primary);
    letter-spacing: 0.05em;
}

.axis-label {
    font-size: 9px !important;
    fill: var(--text-secondary) !important;
    font-weight: 400 !important;
}

.curve-label {
    font-size: 10px !important;
    font-weight: 600 !important;
    font-family: var(--font-data) !important;
}

.cell-label {
    font-family: var(--font-data) !important;
    font-size: 9px !important;
    fill: var(--text-secondary) !important;
}

.flow-label {
    font-family: var(--font-data) !important;
    font-size: 10px !important;
    fill: var(--accent-deep) !important;
    font-weight: 400 !important;
}

.eq-label {
    font-family: var(--font-data) !important;
    font-size: 10px !important;
    fill: var(--accent-deep) !important;
    font-weight: 700 !important;
}

/* Drawable paths */
.drawable {
    filter: drop-shadow(0 0 3px rgba(196, 154, 60, 0.25));
}

/* Nodes (hover) */
.node,
.flow-node,
.mini-nodes > g {
    cursor: pointer;
    transition: transform 220ms var(--ease-out);
}

.node:hover,
.flow-node:hover,
.mini-nodes > g:hover {
    transform: translate(var(--nx, 0px), var(--ny, 0px)) scale(1.06);
    transform-box: fill-box;
    transform-origin: center;
}

.node circle:first-child,
.flow-node circle:first-child,
.mini-nodes > g circle {
    transition: filter 220ms var(--ease-out), stroke 220ms var(--ease-out);
}

.node:hover circle:first-child,
.flow-node:hover circle:first-child,
.mini-nodes > g:hover circle,
.mini-nodes > g.is-active circle {
    stroke: var(--pop);
    stroke-width: 2;
    filter: drop-shadow(0 0 6px rgba(232, 168, 23, 0.7));
}

.node-pulse,
.eq-pulse {
    opacity: 0;
    transform-origin: center;
    transform-box: fill-box;
}

.is-drawn .node-pulse {
    animation: nodePulse 2.4s var(--ease-io) infinite;
    animation-delay: var(--pulse-delay, 0s);
}

.is-drawn .eq-pulse {
    animation: nodePulse 2.2s var(--ease-io) infinite;
}

@keyframes nodePulse {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.55);
    }
}

/* ============================================================
   BUBBLES — floating decoration in the right margin
   ============================================================ */
.bubbles-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.bubble {
    position: absolute;
    left: var(--b-left, auto);
    top: var(--b-top, auto);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(232, 168, 23, 0.14), rgba(196, 154, 60, 0.05) 70%);
    border: 1px solid rgba(196, 154, 60, 0.18);
    box-shadow: inset 0 0 10px rgba(232, 168, 23, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bubbleFloat 6s var(--ease-io) infinite;
}

.bubble em {
    font-family: var(--font-data);
    font-style: normal;
    font-size: 10px;
    color: var(--accent-deep);
    opacity: 0.55;
    letter-spacing: 0.05em;
}

.bubble.b-1 {
    width: 56px;
    height: 56px;
    animation-duration: 5.2s;
}

.bubble.b-2 {
    width: 84px;
    height: 84px;
    animation-duration: 6.4s;
    animation-delay: -1.2s;
}

.bubble.b-3 {
    width: 34px;
    height: 34px;
    animation-duration: 4.8s;
    animation-delay: -0.5s;
}

.bubble.b-4 {
    width: 110px;
    height: 110px;
    animation-duration: 7.6s;
    animation-delay: -2s;
}

.bubble.b-5 {
    width: 28px;
    height: 28px;
    animation-duration: 4.2s;
    animation-delay: -1.8s;
}

@keyframes bubbleFloat {
    0% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-12px) scale(1.03);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

/* ============================================================
   COLOPHON / FOOTER
   ============================================================ */
.colophon {
    padding: 2.5rem var(--spine);
    border-top: 1px solid var(--vein);
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.colophon::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--bg-secondary);
    filter: url(#marble);
    mix-blend-mode: multiply;
    opacity: 0.14;
    pointer-events: none;
}

.colophon-inner {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.colophon-logo {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.04em;
    color: var(--text-primary);
}

.colophon-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============================================================
   MINI-MAP (Quest 06)
   ============================================================ */
.tiny-map {
    max-height: 340px;
}

.mini-nodes circle {
    transition: stroke 220ms var(--ease-out), filter 220ms var(--ease-out);
}

.mini-nodes text {
    font-size: 9px !important;
    pointer-events: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
    .quest-stats,
    .voice-grid {
        grid-template-columns: 1fr 1fr;
    }

    .glossary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    :root {
        --spine: var(--spine-tablet);
        --frieze-h: 76px;
    }

    .quest-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .quest-heading {
        max-width: 100%;
    }

    .quest-visual {
        min-height: 260px;
    }

    .frieze-nav {
        gap: 1rem;
    }

    .nav-token {
        font-size: 0.76rem;
        padding: 0.3rem 0.55rem;
    }
}

@media (max-width: 640px) {
    :root {
        --spine: var(--spine-mobile);
        --frieze-h: 56px;
    }

    .quest {
        padding: clamp(2.25rem, 6vw, 3.5rem) var(--spine);
    }

    .quest-title {
        font-size: clamp(1.4rem, 6vw, 2rem);
    }

    .quest-stats,
    .voice-grid {
        grid-template-columns: 1fr;
    }

    .closing-signet {
        flex-direction: column;
        align-items: flex-start;
    }

    .signet {
        flex: 0 0 96px;
        width: 96px;
        height: 96px;
    }

    .bubbles-container {
        display: none;
    }

    .frieze-inner {
        justify-content: space-between;
    }

    .menu-rune {
        display: block;
        z-index: 4;
    }

    .frieze-nav {
        position: absolute;
        top: calc(100% - 1px);
        right: var(--spine);
        width: min(220px, 70vw);
        display: grid;
        gap: 0.4rem;
        padding: 0.7rem;
        border: 1px solid var(--vein);
        border-radius: 0 0 12px 12px;
        background:
            linear-gradient(135deg, rgba(245, 240, 232, 0.98) 0%, rgba(237, 230, 216, 0.96) 100%);
        box-shadow: 0 14px 34px rgba(30, 26, 20, 0.12);
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
    }

    .frieze.is-menu-open {
        overflow: visible;
    }

    .frieze.is-menu-open .frieze-nav {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-token {
        padding: 0.25rem 0.45rem;
        font-size: 0.7rem;
        letter-spacing: 0.06em;
        width: 100%;
    }

    .logotype {
        font-size: 0.92rem;
    }

    .payoff > div {
        padding: 0.55rem 0.5rem;
        font-size: 0.78rem;
    }

    .voice {
        padding: 0.85rem;
    }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .bubble {
        animation: none;
    }

    .is-drawn .node-pulse,
    .is-drawn .eq-pulse {
        animation: none;
        opacity: 0.3;
    }

    .quest {
        transition: none;
        opacity: 1;
        transform: none;
    }

    html {
        scroll-behavior: auto;
    }
}
