/* economics.quest — The Gilded Counting House at the Edge of the World
   Art-Deco. Timeline-vertical. Gold-on-black-vellum. */

:root {
    --vellum-black: #0F0C08;
    --ink-black:    #1A1410;
    --gilt:         #C8A24B;
    --gilt-pale:    #E8C879;
    --gilt-deep:    #8E6D2E;
    --oxblood:      #6B1E20;
    --ivory:        #EDE5D2;
    --ivory-cool:   #C9C0A8;
    --patina:       #3A4A3D;

    --easing-in:    cubic-bezier(0.16, 1, 0.3, 1);
    --easing-out:   cubic-bezier(0.7, 0, 0.84, 0);
    --easing-spring:cubic-bezier(0.34, 1.56, 0.64, 1);

    --display-font: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
    --wordmark-font: 'Cinzel', Georgia, serif;
    --body-font:    'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --italic-font:  'Cormorant Infant', 'Cormorant Garamond', Georgia, serif;
    --mono-font:    'IBM Plex Mono', 'SFMono-Regular', Menlo, monospace;
}

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

html { background: var(--vellum-black); }

body {
    background-color: var(--vellum-black);
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(200, 162, 75, 0.04) 0%, transparent 60%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='600'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.012' numOctaves='3' seed='7'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.08  0 0 0 0 0.05  0 0 0 0.4 0'/></filter><rect width='600' height='600' filter='url(%23n)' opacity='0.55'/></svg>");
    background-size: auto, 600px 600px;
    background-attachment: fixed, fixed;
    color: var(--ivory);
    font-family: var(--body-font);
    font-size: 19px;
    line-height: 1.78;
    letter-spacing: -0.005em;
    overflow-x: hidden;
    min-height: 100vh;
}

.svg-defs { position: absolute; width: 0; height: 0; }

i, em { font-family: var(--italic-font); font-style: italic; font-weight: 400; }

/* ─────────── Cornice (fixed elevator-floor indicator) ─────────── */
.cornice {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 36px;
    z-index: 100;
    background: linear-gradient(180deg, rgba(15, 12, 8, 0.96) 0%, rgba(15, 12, 8, 0.88) 100%);
    backdrop-filter: blur(2px);
    border-bottom: 1px solid var(--gilt-deep);
    box-shadow: 0 1px 0 0 rgba(200, 162, 75, 0.18), 0 8px 24px -12px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.cornice::after {
    content: "";
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 1px;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--gilt) 12%, var(--gilt) 88%, transparent 100%);
    opacity: 0.35;
}

.wordmark {
    font-family: var(--wordmark-font);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gilt);
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
}
.wordmark-text { white-space: nowrap; }
.wordmark-dot { width: 14px; height: 14px; flex-shrink: 0; }

.floor-indicator {
    font-family: var(--mono-font);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ivory-cool);
    overflow: hidden;
    position: relative;
    display: inline-block;
    min-width: 220px;
    text-align: right;
}
.floor-indicator-inner {
    display: inline-block;
    transition: opacity 280ms ease-out, transform 280ms ease-out;
}
.floor-indicator-inner.is-out {
    opacity: 0;
    transform: translateY(-6px);
}

/* ─────────── Counting House Spine ─────────── */
.counting-house {
    position: relative;
    width: 100%;
    padding-top: 36px;
}

/* ─────────── Hall (chapter) ─────────── */
.hall {
    position: relative;
    min-height: 100vh;
    padding: 80px 0 120px;
    background: var(--vellum-black);
    overflow: hidden;
    isolation: isolate;
}

.hall::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 18%, rgba(232, 200, 121, 0.06) 0%, transparent 55%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='800' height='800'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.012' numOctaves='3' seed='3'/><feColorMatrix values='0 0 0 0 0.12  0 0 0 0 0.10  0 0 0 0 0.07  0 0 0 0.32 0'/></filter><rect width='800' height='800' filter='url(%23n)' opacity='0.45'/></svg>");
    background-size: auto, 800px 800px;
    z-index: -1;
    pointer-events: none;
}

/* per-Hall texture seed variation */
.hall--marketplace::before { background-position: 0 0, 200px 80px; }
.hall--promise::before     { background-position: 0 0, 400px 160px; }
.hall--coin::before        { background-position: 0 0, 100px 240px; }
.hall--ruin::before        { background-position: 0 0, 320px 320px; }
.hall--ledger::before      { background-position: 0 0, 80px 400px; }
.hall--quest::before       { background-position: 0 0, 480px 480px; }

/* ─────────── Hall Threshold (sunburst + numeral) ─────────── */
.hall-threshold {
    position: relative;
    text-align: center;
    padding: 60px 24px 40px;
    margin-bottom: 36px;
}

.threshold-medallion {
    width: 480px;
    max-width: 64vw;
    height: auto;
    display: block;
    margin: 0 auto -200px;
    pointer-events: none;
    filter: drop-shadow(0 12px 40px rgba(200, 162, 75, 0.18));
}

.threshold-medallion .medallion-rays line {
    transform-origin: 0 0;
    transform: scaleY(0);
    transition: transform 1100ms var(--easing-in);
}

.hall.is-revealed .threshold-medallion .medallion-rays line {
    transform: scaleY(1);
}

.threshold-medallion .medallion-ring,
.threshold-medallion .medallion-device {
    opacity: 0;
    transition: opacity 800ms var(--easing-in) 600ms;
}
.hall.is-revealed .threshold-medallion .medallion-ring,
.hall.is-revealed .threshold-medallion .medallion-device {
    opacity: 1;
}

.hall-numeral {
    position: relative;
    z-index: 1;
    font-family: var(--display-font);
    font-weight: 900;
    font-size: 11vw;
    line-height: 0.9;
    color: var(--gilt-pale);
    letter-spacing: 0.12em;
    text-shadow:
        0 0 1px var(--gilt),
        0 2px 0 var(--gilt-deep),
        0 6px 14px rgba(0, 0, 0, 0.7);
    background: linear-gradient(180deg, var(--gilt-pale) 0%, var(--gilt) 50%, var(--gilt-deep) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transform: scale(0.78);
    transition: opacity 1100ms var(--easing-in) 200ms, transform 1100ms var(--easing-in) 200ms;
}
.hall.is-revealed .hall-numeral { opacity: 1; transform: scale(1); }

.hall-title {
    margin-top: 0.4em;
    font-family: var(--display-font);
    font-weight: 700;
    font-size: 2.4rem;
    letter-spacing: 0.18em;
    color: var(--gilt);
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 900ms var(--easing-in) 400ms, transform 900ms var(--easing-in) 400ms;
}
.hall.is-revealed .hall-title { opacity: 1; transform: none; }

.hall-epigraph {
    margin: 14px auto 0;
    max-width: 56ch;
    font-family: var(--italic-font);
    font-style: italic;
    font-weight: 300;
    font-size: 17px;
    color: var(--ivory-cool);
    letter-spacing: 0.01em;
    opacity: 0;
    transition: opacity 900ms var(--easing-in) 700ms;
}
.hall.is-revealed .hall-epigraph { opacity: 1; }

/* ─────────── Hall Grid (12-col with gilded marginalia) ─────────── */
.hall-grid {
    display: grid;
    grid-template-columns: 1fr min(1180px, calc(100% - 64px)) 1fr;
    column-gap: 32px;
    row-gap: 0;
}
.hall-grid > * { grid-column: 2; }

.hall-body {
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: 32px;
    row-gap: 28px;
}
.hall-body > p,
.hall-body > .conversion-table,
.hall-body > .coin-gallery,
.hall-body > .ledger-intro,
.hall-body > .commonplace {
    grid-column: 1 / span 8;
    max-width: 64ch;
}

/* The marginalia rail nests inside .hall-body grid columns 9-12 */
.marginalia-rail {
    grid-column: 10 / span 3;
    grid-row: 1 / span 99;
    align-self: start;
    padding: 18px 0 18px 22px;
    border-left: 1px solid rgba(200, 162, 75, 0.28);
    font-family: var(--mono-font);
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--ivory-cool);
    position: sticky;
    top: 80px;
    will-change: transform;
}
.marginalia-rail .footnote {
    margin-bottom: 14px;
    letter-spacing: 0.02em;
}
.marginalia-rail .footnote sup {
    font-size: 10px;
    color: var(--gilt);
    margin-right: 0.4em;
    font-family: var(--mono-font);
}
.marginalia-rail .footnote-quote {
    margin: 18px 0;
    color: var(--gilt-pale);
    font-family: var(--italic-font);
    font-style: italic;
    font-size: 15px;
    line-height: 1.55;
    letter-spacing: 0;
    border-left: 2px solid var(--gilt-deep);
    padding-left: 12px;
}
.marginalia-rail .footnote-rule {
    height: 1px;
    margin: 22px 0;
    background: linear-gradient(90deg, var(--gilt-deep) 0%, transparent 100%);
    opacity: 0.5;
}

/* Rail variant for the falling-stair Hall (no normal body) */
.marginalia-rail--ruin {
    position: absolute;
    top: 280px;
    right: 5vw;
    max-width: 240px;
    border-left: 1px solid rgba(200, 162, 75, 0.28);
    padding: 18px 0 18px 22px;
    background: rgba(15, 12, 8, 0.4);
    z-index: 2;
}

/* ─────────── Body copy ─────────── */
.hall-body p {
    font-family: var(--body-font);
    font-weight: 400;
    font-size: 19px;
    line-height: 1.78;
    color: var(--ivory);
    letter-spacing: -0.005em;
    text-rendering: optimizeLegibility;
}
.hall-body p + p { margin-top: 0; }

/* ─────────── Drop-cap / engraved initial ─────────── */
.lead-with-cap {
    position: relative;
}
.drop-cap {
    float: left;
    width: 110px;
    height: 110px;
    margin: 6px 22px 0 0;
    position: relative;
    display: block;
}
.drop-cap-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.drop-cap-letter {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--display-font);
    font-weight: 900;
    font-size: 78px;
    line-height: 1;
    color: var(--gilt);
    background: linear-gradient(180deg, var(--gilt-pale) 0%, var(--gilt) 55%, var(--gilt-deep) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 1px 0 rgba(0,0,0,0.4);
    letter-spacing: 0;
}

/* ─────────── Chevron Band (mezzanine floor) ─────────── */
.chevron-band {
    position: relative;
    height: 64px;
    width: 100%;
    background: var(--ink-black);
    overflow: hidden;
    border-top: 1px solid var(--gilt-deep);
    border-bottom: 1px solid var(--gilt-deep);
    display: flex;
    align-items: stretch;
}

/* Triangles built via gradient on a pseudo-element (also augmented via JS-injected svg polygons) */
.chevron-band::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            45deg,
            var(--gilt) 0,
            var(--gilt) 32px,
            var(--ink-black) 32px,
            var(--ink-black) 64px
        );
    opacity: 0.16;
}

.chevron-band svg {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
}

.chevron-band svg polygon {
    transform-origin: center;
    transform: rotateY(90deg);
    transition: transform 380ms var(--easing-in);
}
.chevron-band.is-cascaded svg polygon {
    transform: rotateY(0deg);
}

/* ─────────── Hall IV (Coins) ─────────── */
.coin-gallery {
    grid-column: 1 / span 12 !important;
    max-width: none !important;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px 24px;
    margin: 18px 0;
    padding: 22px 0;
    border-top: 1px solid rgba(200, 162, 75, 0.28);
    border-bottom: 1px solid rgba(200, 162, 75, 0.28);
}
.coin {
    position: relative;
    text-align: center;
    perspective: 800px;
    cursor: crosshair;
}
.coin-svg {
    width: 100%;
    max-width: 140px;
    height: auto;
    display: block;
    margin: 0 auto;
    transform: translateZ(0);
    transition: transform 460ms var(--easing-spring);
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.6));
}
.coin:hover .coin-svg {
    transform: translateY(-4px) translateZ(0);
}
.coin figcaption {
    margin-top: 10px;
    font-family: var(--mono-font);
    font-size: 11px;
    color: var(--ivory-cool);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.4;
}
.coin .coin-name {
    display: block;
    color: var(--gilt-pale);
    font-weight: 500;
    margin-bottom: 2px;
}
.coin .coin-place {
    display: block;
    color: var(--ivory-cool);
    opacity: 0.75;
}

/* ─────────── Conversion table (Hall IV) ─────────── */
.conversion-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-family: var(--mono-font);
    font-size: 13px;
    color: var(--ivory);
    border-top: 2px solid var(--gilt);
    border-bottom: 2px solid var(--gilt);
    background: rgba(26, 20, 16, 0.4);
}
.conversion-table caption {
    caption-side: top;
    text-align: left;
    padding: 12px 0 10px;
    font-family: var(--italic-font);
    font-style: italic;
    font-size: 16px;
    color: var(--gilt-pale);
    letter-spacing: 0.02em;
}
.conversion-table thead tr {
    border-bottom: 1px solid var(--gilt-deep);
}
.conversion-table th,
.conversion-table td {
    padding: 10px 14px;
    text-align: left;
    letter-spacing: 0.04em;
}
.conversion-table th {
    color: var(--gilt);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 11px;
}
.conversion-table tbody tr:nth-child(even) {
    background: rgba(200, 162, 75, 0.04);
}
.conversion-table tbody tr {
    border-bottom: 1px solid rgba(200, 162, 75, 0.12);
}

/* ─────────── Hall V (Falling Stair) ─────────── */
.hall--ruin {
    min-height: 130vh;
}
.falling-stair {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 60px auto 0;
    padding: 0 5vw;
    height: 90vh;
    min-height: 760px;
}
.ruin-step {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    --step-x: calc(78% - var(--step-index) * 11.5%);
    --step-y: calc(var(--step-index) * 12%);
    left: var(--step-x);
    top: var(--step-y);
    transform: translate(-50%, 0);
    will-change: opacity, transform;
    opacity: 0;
    transform: translate(-50%, 24px);
    transition: opacity 900ms var(--easing-in), transform 900ms var(--easing-in);
}
.hall--ruin.is-revealed .ruin-step {
    opacity: 1;
    transform: translate(-50%, 0);
}
.hall--ruin.is-revealed .ruin-step:nth-child(1) { transition-delay: 0ms; }
.hall--ruin.is-revealed .ruin-step:nth-child(2) { transition-delay: 140ms; }
.hall--ruin.is-revealed .ruin-step:nth-child(3) { transition-delay: 280ms; }
.hall--ruin.is-revealed .ruin-step:nth-child(4) { transition-delay: 420ms; }
.hall--ruin.is-revealed .ruin-step:nth-child(5) { transition-delay: 560ms; }
.hall--ruin.is-revealed .ruin-step:nth-child(6) { transition-delay: 700ms; }
.hall--ruin.is-revealed .ruin-step:nth-child(7) { transition-delay: 840ms; }

.ruin-year {
    font-family: var(--display-font);
    font-weight: 700;
    font-size: 6vw;
    line-height: 0.92;
    color: var(--oxblood);
    letter-spacing: 0.06em;
    text-shadow:
        0 1px 0 rgba(0,0,0,0.6),
        0 8px 24px rgba(107, 30, 32, 0.4);
    background: linear-gradient(180deg, #8a2a2c 0%, var(--oxblood) 60%, #4a1416 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.ruin-caption {
    font-family: var(--italic-font);
    font-style: italic;
    font-weight: 300;
    font-size: 18px;
    color: var(--ivory-cool);
    max-width: 28ch;
    line-height: 1.5;
    letter-spacing: 0.005em;
}
.ruin-caption i { font-style: italic; }

/* ─────────── Hall VI (Ledger / commonplace book) ─────────── */
.hall-body--ledger { row-gap: 14px; }
.ledger-intro {
    font-family: var(--italic-font);
    font-style: italic;
    font-weight: 300;
    color: var(--ivory-cool);
    font-size: 17px;
    margin-bottom: 16px;
}
.ledger-intro kbd {
    font-family: var(--mono-font);
    font-style: normal;
    font-size: 11px;
    padding: 2px 6px;
    border: 1px solid var(--gilt-deep);
    border-radius: 2px;
    color: var(--gilt-pale);
    background: var(--ink-black);
    letter-spacing: 0.06em;
}

.commonplace {
    grid-column: 1 / span 8;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 36px;
    row-gap: 6px;
    border-top: 1px solid var(--gilt-deep);
    border-bottom: 1px solid var(--gilt-deep);
    padding: 22px 0;
}
.commonplace dt {
    font-family: var(--display-font);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.08em;
    color: var(--gilt-pale);
    text-transform: lowercase;
    margin-top: 14px;
}
.commonplace dt:first-of-type,
.commonplace dt:nth-of-type(2) { margin-top: 0; }
.commonplace dd {
    font-family: var(--italic-font);
    font-style: italic;
    font-weight: 300;
    font-size: 17px;
    color: var(--ivory);
    line-height: 1.5;
    margin-bottom: 4px;
}
.commonplace dfn {
    font-style: normal;
    cursor: help;
    border-bottom: 1px dotted var(--gilt-deep);
    color: var(--gilt-pale);
    transition: color 220ms ease, border-color 220ms ease;
}
.commonplace dfn:hover {
    color: var(--gilt-pale);
    border-bottom-color: var(--gilt-pale);
}

/* Etymology popover */
.etymology-popover {
    position: fixed;
    z-index: 200;
    max-width: 320px;
    padding: 14px 16px;
    background: var(--gilt-pale);
    color: var(--vellum-black);
    border: 1px solid var(--gilt-deep);
    border-radius: 0;
    box-shadow:
        0 0 0 1px var(--gilt) inset,
        0 18px 38px -12px rgba(0,0,0,0.7);
    font-family: var(--mono-font);
    font-size: 12.5px;
    line-height: 1.55;
    letter-spacing: 0.005em;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 180ms ease-out, transform 180ms ease-out;
    text-transform: none;
}
.etymology-popover.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.etymology-popover::before {
    content: "";
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(15, 12, 8, 0.18);
    pointer-events: none;
}
.etymology-text { display: block; position: relative; }

/* ─────────── Hall VII (Quest) ─────────── */
.hall--quest {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 60px;
    padding-bottom: 80px;
}
.hall-threshold--quest { margin-bottom: 48px; }
.threshold-medallion--quest {
    width: 320px;
    max-width: 36vw;
    margin-bottom: -120px;
}
.quest-stage {
    flex: 1;
    width: 100%;
    max-width: 1100px;
    padding: 60px 32px 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.closing-aphorism {
    font-family: var(--display-font);
    font-weight: 700;
    font-size: clamp(28px, 4.6vw, 60px);
    line-height: 1.18;
    text-align: center;
    color: var(--gilt-pale);
    letter-spacing: 0.04em;
    background: linear-gradient(180deg, var(--gilt-pale) 0%, var(--gilt) 50%, var(--gilt-deep) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    max-width: 24ch;
    text-shadow: 0 0 1px rgba(232, 200, 121, 0.4);
}

/* ─────────── Colophon ─────────── */
.colophon {
    position: relative;
    padding: 36px 32px 48px;
    text-align: center;
    background: var(--ink-black);
    border-top: 1px solid var(--gilt-deep);
}
.colophon-rule {
    width: 60%;
    max-width: 320px;
    height: 1px;
    margin: 0 auto 22px;
    background: linear-gradient(90deg, transparent, var(--gilt) 50%, transparent);
    opacity: 0.6;
}
.colophon-line {
    font-family: var(--mono-font);
    font-size: 12px;
    line-height: 1.7;
    color: var(--ivory-cool);
    letter-spacing: 0.06em;
}
.colophon-cookies {
    margin-top: 10px;
    font-family: var(--mono-font);
    font-size: 11px;
    color: var(--ivory-cool);
    opacity: 0.65;
    letter-spacing: 0.04em;
}

/* ─────────── Patina grain (fixed dust) ─────────── */
.patina-grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 90;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='5'/><feColorMatrix values='0 0 0 0 0.92  0 0 0 0 0.86  0 0 0 0 0.74  0 0 0 0.7 0'/></filter><rect width='320' height='320' filter='url(%23g)' opacity='0.55'/></svg>");
    background-size: 320px 320px;
    mix-blend-mode: multiply;
    opacity: 0.18;
}

/* ─────────── Marginalia rail parallax (slight) ─────────── */
.marginalia-rail {
    transform: translateY(0);
    will-change: transform;
}

/* ─────────── Reduced motion ─────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .threshold-medallion .medallion-rays line { transform: scaleY(1); }
    .hall-numeral { opacity: 1; transform: none; }
    .hall-title, .hall-epigraph { opacity: 1; transform: none; }
    .ruin-step { opacity: 1; transform: translate(-50%, 0); }
    .chevron-band svg polygon { transform: rotateY(0); }
}

/* ─────────── Responsive ─────────── */
@media (max-width: 980px) {
    .hall-body { grid-template-columns: 1fr; }
    .hall-body > p,
    .hall-body > .conversion-table,
    .hall-body > .coin-gallery,
    .hall-body > .ledger-intro,
    .hall-body > .commonplace {
        grid-column: 1 / -1;
        max-width: 100%;
    }
    .marginalia-rail {
        position: relative;
        grid-column: 1 / -1;
        grid-row: auto;
        top: 0;
        margin-top: 28px;
        padding-left: 18px;
    }
    .marginalia-rail--ruin {
        position: relative;
        top: 0;
        right: 0;
        max-width: none;
        margin: 24px 5vw 0;
    }
    .coin-gallery { grid-template-columns: repeat(2, 1fr) !important; }
    .commonplace { grid-template-columns: 1fr; }
    .hall-numeral { font-size: 22vw; }
    .hall-title { font-size: 1.6rem; }
    .ruin-year { font-size: 12vw; }
    .ruin-caption { font-size: 14px; }
    .ruin-step {
        --step-x: calc(60% - var(--step-index) * 7%);
    }
    .threshold-medallion { max-width: 80vw; }
    .floor-indicator { font-size: 9px; min-width: 0; }
}

@media (max-width: 560px) {
    body { font-size: 17px; }
    .cornice { padding: 0 14px; height: 32px; }
    .wordmark { font-size: 11px; letter-spacing: 0.12em; }
    .floor-indicator { font-size: 8px; letter-spacing: 0.16em; }
    .hall { padding: 60px 0 80px; }
    .hall-grid { grid-template-columns: 1fr min(100%, calc(100% - 32px)) 1fr; }
    .drop-cap { width: 78px; height: 78px; margin: 4px 14px 0 0; }
    .drop-cap-letter { font-size: 56px; }
    .ruin-step { --step-x: 50%; }
    .ruin-year { font-size: 18vw; }
    .conversion-table { font-size: 11px; }
    .conversion-table th, .conversion-table td { padding: 8px 6px; }
}
