/* =========================================================
 * MythBytes — Phase 1 components
 *
 * Loaded after style.css, which owns the design tokens. Everything here
 * reads those tokens; no new colours are introduced.
 * ========================================================= */

/* Navigation structure (.nav-toggle, #primary-nav, .social-links, .btn-sm)
 * now lives entirely in style.css alongside the rest of the button and
 * token system — see its NAVIGATION section. Only the narrow-width
 * media-query behaviour stays down in this file's own breakpoint block. */

/* ---------------------------------------------------------
 * YOUTUBE FACADE
 * Poster + play control until clicked, so the player's payload and
 * cookies stay off the page until someone actually wants them.
 * ------------------------------------------------------- */

.video-embed {
    position: relative;
    aspect-ratio: 16 / 9;
    margin: 0 0 1.6rem;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--rule);
    box-shadow: var(--engrave);
}
.video-embed .video-poster,
.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
/* hqdefault is 4:3 with letterbox bars; cropping recovers the 16:9 frame. */
.video-embed .video-poster { object-fit: cover; transform: scale(1.34); }
.video-embed.is-playing .video-poster,
.video-embed.is-playing .video-play { display: none; }

.video-play {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    background: rgba(7, 9, 12, 0.45);
    color: var(--stone);
    text-decoration: none;
    transition: background-color 0.2s ease;
}
.video-play:hover,
.video-play:focus-visible { background: rgba(7, 9, 12, 0.25); text-decoration: none; }
.video-play-mark {
    display: grid;
    place-items: center;
    width: clamp(52px, 7vw, 74px);
    aspect-ratio: 1;
    border: 1px solid var(--gold);
    color: var(--gold-hi);
    font-size: 1.4rem;
    padding-left: 0.18em;
    background: rgba(7, 9, 12, 0.6);
    transition: background-color 0.2s ease;
}
.video-play:hover .video-play-mark { background: rgba(232, 185, 60, 0.18); }
.video-play-label {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.82rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

/* ---------------------------------------------------------
 * MYTHOLOGY CARD
 *
 * True 2.5in x 3.5in (5:7) so the same composition can go to print later.
 * Bleed and safe-area exist as variables and are zeroed for screen; a
 * print sheet can set them without the layout being rebuilt.
 *
 * No power/attack numbers anywhere. These are reference entries.
 * ------------------------------------------------------- */

.card-shelf {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr));
    gap: clamp(1.1rem, 2.6vw, 2rem);
    list-style: none;
    margin: 0;
    padding: 0;
}

.myth-card {
    --card-bleed: 0mm;
    --card-safe: 4%;
    --card-edge: var(--bronze);

    display: block;
    aspect-ratio: 5 / 7;
    color: inherit;
    text-decoration: none;
    container-type: inline-size;
    transition: transform 0.22s ease;
}
.myth-card:hover { text-decoration: none; transform: translateY(-3px); }

.myth-card-frame {
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    height: 100%;
    padding: var(--card-safe);
    gap: 2.5%;
    background: var(--ink-raised);
    /* One rule at the rarity colour, not a stacked glow — a card should
       read as collectible, not as a loot-rarity effect. */
    border: 1px solid var(--card-edge);
    box-shadow:
        inset 0 0 0 1px rgba(7, 9, 12, 0.85),
        0 2px 10px rgba(0, 0, 0, 0.5);
}

.myth-card-name {
    display: block;
    font-family: 'Cinzel', Georgia, serif;
    font-size: clamp(0.78rem, 7.5cqi, 1.05rem);
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--stone);
    text-align: center;
    padding: 0.35em 0.2em;
    border-bottom: 1px solid var(--rule);
}

.myth-card-art {
    display: block;
    position: relative;
    overflow: hidden;
    background: var(--slate);
    border: 1px solid var(--rule-dim);
    min-height: 0;
}
.myth-card-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.myth-card-art.is-empty {
    background-image: url('../brand/monogram-flat.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 44%;
    opacity: 0.4;
}
.myth-card-art::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(252, 215, 95, 0.08), transparent 40%, rgba(7, 9, 12, 0.6));
    pointer-events: none;
}

.myth-card-body { display: block; text-align: center; min-height: 0; }
.myth-card-epithet {
    display: block;
    font-style: italic;
    font-size: clamp(0.66rem, 5cqi, 0.86rem);
    color: var(--accent);
    line-height: 1.3;
}
.myth-card-line {
    display: flex;
    justify-content: center;
    gap: 0.5em;
    flex-wrap: wrap;
    font-size: clamp(0.58rem, 4.2cqi, 0.76rem);
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--stone-faint);
    font-family: 'Cinzel', Georgia, serif;
}
.myth-card-line span + span::before { content: '· '; }

.myth-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5em;
    padding-top: 0.4em;
    border-top: 1px solid var(--rule);
    font-family: 'Cinzel', Georgia, serif;
    font-size: clamp(0.56rem, 4cqi, 0.72rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.myth-card-rarity { color: var(--card-edge); }
.myth-card-no { color: var(--stone-faint); }

/* Rarity treatments — edge colour only, so the hierarchy is legible
   without turning the card into a gradient. */
.myth-card.rarity-common     { --card-edge: #8b8c8e; }
.myth-card.rarity-uncommon   { --card-edge: #9c7b4a; }
.myth-card.rarity-rare       { --card-edge: #b9c2cc; }
.myth-card.rarity-legendary  { --card-edge: var(--bronze-hi); }
.myth-card.rarity-unranked   { --card-edge: #55585c; }

/* Detail page: card at reading size beside its reference text. */
.card-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: start;
}
.card-detail-face .myth-card { cursor: default; }
.card-detail-face .myth-card:hover { transform: none; }
.card-back { margin: 1.2rem 0 0; }
.card-back img { width: 100%; height: auto; border: 1px solid var(--rule-dim); display: block; }
.card-back figcaption {
    font-size: var(--step--1);
    color: var(--stone-faint);
    text-align: center;
    margin-top: 0.4rem;
}

.did-you-know {
    margin: 1.6rem 0 0;
    padding: 1.1rem 1.3rem;
    border-left: 2px solid var(--bronze);
    background: rgba(15, 20, 22, 0.5);
}
.did-you-know h2 { font-size: var(--step-0); margin-bottom: 0.4em; }
.did-you-know p { margin: 0; }
/* Nested inside a parchment card-reference panel — a light inset rather
   than a dark box, so it reads as a note on the page, not a hole in it. */
.parchment .did-you-know {
    border-left-color: var(--oxblood);
    background: rgba(255, 252, 240, 0.35);
}

/* ---------------------------------------------------------
 * CULTURE EXPLORER
 * ------------------------------------------------------- */

.culture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr));
    gap: clamp(0.8rem, 2vw, 1.3rem);
    list-style: none;
    margin: 0;
    padding: 0;
}
.culture-tile {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.2rem 1.3rem;
    border: 1px solid var(--rule-dim);
    border-left: 2px solid var(--accent);
    background: linear-gradient(90deg, var(--accent-soft), transparent 80%);
    color: inherit;
    transition: border-color 0.18s ease, transform 0.18s ease;
}
.culture-tile:hover { text-decoration: none; border-color: var(--rule-strong); transform: translateX(3px); }
.culture-name {
    font-family: 'Cinzel', Georgia, serif;
    font-size: var(--step-0);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--stone);
}
.culture-count { font-size: var(--step--1); color: var(--stone-faint); }

/* ---------------------------------------------------------
 * ENTRY EXTRAS
 * ------------------------------------------------------- */

.story-art { margin: 0 0 2rem; border: 1px solid var(--rule); box-shadow: var(--engrave); }
.story-art img { display: block; width: 100%; height: auto; }

.character-main { min-width: 0; }
.pronunciation { font-style: italic; color: var(--stone-faint); margin-bottom: 0.6rem; }

.plate-fallback {
    aspect-ratio: 3 / 4;
    background-color: var(--slate);
    background-image: url('../brand/monogram-flat.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 34%;
    opacity: 0.45;
}

.connection-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
    gap: clamp(1rem, 2.5vw, 2rem);
}
.connection-columns h3 { font-size: var(--step-0); margin-bottom: 0.5rem; }

.inline-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.source-list { margin: 0; padding-left: 1.2rem; color: var(--stone-dim); }
.source-list li { margin-bottom: 0.4rem; }
.source-notes { color: var(--stone-dim); }
.parchment .source-notes { color: var(--ink-on-parchment-dim); }

.historical-note,
.timeline-caveat {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--step--1);
    color: var(--stone-faint);
    font-style: italic;
    margin-bottom: 1.4rem;
}
.timeline-date.is-historical { display: flex; align-items: center; gap: 0.5rem; }

.entry-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
}
.entry-nav a {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem 1.2rem;
    border: 1px solid var(--rule-dim);
    color: var(--stone);
}
.entry-nav a:hover { border-color: var(--rule-strong); text-decoration: none; }
.entry-nav .entry-nav-next { text-align: right; }

/* ---------------------------------------------------------
 * FOOTER — compact by design.
 *
 * One row of brand + nav + social, a hairline, then a single small legal
 * line. The old three-column stacked-list footer ran ~550px tall on a page
 * with two Stories in it; this tops out well under half that. */

.site-footer {
    margin-top: clamp(3rem, 7vw, 5rem);
    padding-block: clamp(1.6rem, 3.5vw, 2.2rem) 1.2rem;
    border-top: 1px solid var(--rule);
    background: linear-gradient(to bottom, transparent, rgba(15, 20, 22, 0.4));
    font-size: 0.92rem;
}
.footer-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding-bottom: 1.2rem;
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--stone-dim);
}
.footer-brand img { display: block; flex: none; opacity: 0.9; }
.footer-name {
    font-family: 'Cinzel', Georgia, serif;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.82rem;
    color: var(--stone);
}
.footer-brand-line { display: block; font-style: italic; font-size: 0.86rem; color: var(--stone-faint); }

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.3rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-nav a { color: var(--stone-dim); }
.footer-nav a:hover { color: var(--gold-hi); }

.footer-social {
    display: flex;
    align-items: center;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-social a { color: var(--stone-dim); }
.footer-social a:hover { color: var(--gold-hi); }
.footer-social .btn { padding: 0.4em 1em; }

.footer-legal {
    margin: 0;
    padding-top: 1rem;
    border-top: 1px solid var(--rule-dim);
    color: var(--stone-faint);
    font-size: 0.82rem;
}
.footer-legal .sep { margin: 0 0.5em; opacity: 0.6; }

/* ---------------------------------------------------------
 * HOMEPAGE — HERO
 * Not a full-bleed marketing slab: text and a naturally-proportioned
 * portrait sit side by side, so the very first viewport carries both the
 * page's purpose and its one primary action, not a banner someone has to
 * scroll past. */

/* Deliberately asymmetric — a wide reading column with a narrower, offset
   plate of artwork, not a marketing-template even split with everything
   vertically centred. The image sits lower than the text, like a figure
   set into a page rather than a hero banner beside a headline. */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
    gap: clamp(1.75rem, 5vw, 4rem);
    align-items: start;
    padding-block: clamp(1.6rem, 4vw, 2.6rem) clamp(1.2rem, 3vw, 2rem);
}
.hero-copy .eyebrow {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.82rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--bronze);
}
.hero h1 {
    font-size: clamp(2rem, 1.5rem + 2.8vw, 3.2rem);
    line-height: 1.1;
    margin: 0.25em 0 0.55em;
    max-width: 16ch;
}
.hero-lede { max-width: 50ch; }
.hero-lede p { font-size: var(--step-1); }

.hero-art {
    margin: clamp(1.5rem, 5vw, 3rem) 0 0;
    aspect-ratio: 3 / 4;
    border: 1px solid var(--rule);
    box-shadow: var(--engrave);
    overflow: hidden;
    justify-self: center;
    width: 100%;
    max-width: 380px;
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* A small, quiet hint that the page continues — not an animated arrow
   fighting for attention, and static outright under reduced motion. */
.scroll-hint {
    display: flex;
    justify-content: center;
    color: var(--stone-faint);
    font-size: 1.1rem;
    padding-bottom: clamp(1rem, 3vw, 1.8rem);
    animation: mb-bob 2.4s ease-in-out infinite;
}
.scroll-hint:hover { color: var(--gold); }
@keyframes mb-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* ---------------------------------------------------------
 * HOMEPAGE — FOUNDER NOTE
 * Deliberately the most spacious, least "archive" section on the page —
 * a plain, generously set editorial note, not a bordered About box. */

/* .founder's colour, texture and manuscript initial all come from
   .parchment plus the founder rules further down this file (the section
   carries both classes — see front-page.php). */

/* ---------------------------------------------------------
 * HOMEPAGE — START WITH A STORY
 * Adapts to how many stories actually exist: one secondary card sits
 * beside the feature as a balanced pair; two stack beside it instead of
 * forcing a three-up grid that a two-Story site can never fill honestly. */

.story-duet {
    display: grid;
    gap: clamp(1.5rem, 3vw, 2.5rem);
}
.story-duet[data-secondary="0"] { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
.story-duet[data-secondary="1"] { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.story-duet[data-secondary="2"] { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }

.story-duet-secondary { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }

.story-card { display: flex; flex-direction: column; height: 100%; }
.story-card-art {
    display: block;
    aspect-ratio: 16 / 10;
    background: var(--slate);
    border: 1px solid var(--rule);
    box-shadow: var(--engrave);
    overflow: hidden;
    margin-bottom: 1.1rem;
}
.story-card--secondary .story-card-art { aspect-ratio: 16 / 9; }
.story-card-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-card-art.is-empty {
    background-image: url('../brand/monogram-flat.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18%;
    opacity: 0.28;
}
.story-card-body { display: flex; flex-direction: column; flex: 1; }
.story-card--feature h3 { font-size: var(--step-2); }
.story-card--secondary h3 { font-size: var(--step-1); }
.story-card h3 { margin: 0.3em 0 0.4em; }
.story-card h3 a { color: inherit; }
.story-card h3 a:hover { color: var(--gold-hi); }
.story-card-excerpt { color: var(--stone-dim); flex: 1; }
.story-duet-secondary .story-card-excerpt { max-width: 48ch; }

/* ---------------------------------------------------------
 * HOMEPAGE — EXPLORE THE MYTHOLOGIES
 * Editorial cards, not filter chips: each is a real destination with its
 * own count, not a control that narrows a list on the same page. */

.section--muted { background: rgba(15, 20, 22, 0.35); }

.culture-editorial {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: clamp(1.2rem, 3vw, 2rem);
    list-style: none;
    margin: 0;
    padding: 0;
}
.culture-card {
    display: block;
    padding: clamp(1.4rem, 3vw, 2rem);
    border: 1px solid var(--rule-dim);
    border-left: 2px solid var(--accent);
    background: linear-gradient(120deg, var(--accent-soft), transparent 75%);
    color: inherit;
    transition: border-color 0.18s ease, transform 0.18s ease;
}
.culture-card:hover { text-decoration: none; border-color: var(--rule-strong); transform: translateY(-2px); }
.culture-card h3 { font-size: var(--step-1); margin: 0 0 0.5rem; }
.culture-desc { color: var(--stone-dim); margin-bottom: 0.9rem; }
.culture-count {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--stone-faint);
}

/* ---------------------------------------------------------
 * HOMEPAGE — EVERY STORY OPENS ANOTHER DOOR
 * A plain divided list, deliberately not a grid of icon boxes — four
 * sentences explaining how the archive fits together read faster than
 * four cards someone has to visually parse. */

.door-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-dim); }
.door-list li { border-bottom: 1px solid var(--rule-dim); }
.door-list a,
.door-list .is-empty {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.3rem 1.5rem;
    padding: clamp(1.1rem, 2.5vw, 1.6rem) 0.25rem;
    color: inherit;
}
.door-list a:hover { text-decoration: none; background: var(--accent-soft); }
.door-title {
    font-family: 'Cinzel', Georgia, serif;
    font-size: var(--step-1);
    color: var(--stone);
    grid-column: 1;
}
.door-desc { grid-column: 1; color: var(--stone-dim); max-width: 62ch; }
.door-go {
    grid-column: 2;
    grid-row: 1 / span 2;
    color: var(--gold);
    font-size: 1.3rem;
}
.door-list a:hover .door-title { color: var(--gold-hi); }
.door-list .is-empty { opacity: 0.55; }
.door-soon {
    display: inline-block;
    margin-left: 0.7em;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--stone-faint);
    border: 1px solid var(--rule-dim);
    padding: 0.2em 0.6em;
    vertical-align: middle;
}

/* ---------------------------------------------------------
 * HOMEPAGE — CLOSING
 * The one place on the page gold is allowed to fill a whole button —
 * everywhere else it is text and hairlines only. */

.closing {
    text-align: center;
    padding-block: clamp(2.8rem, 6vw, 4.5rem);
    border-top: 1px solid var(--rule-dim);
}
.closing h2 { font-size: var(--step-2); }
.closing-body { max-width: 52ch; margin-inline: auto; color: var(--stone-dim); }
.closing .action-row { justify-content: center; }

/* ---------------------------------------------------------
 * RESPONSIVE
 * Verified at 375 / 768 / 1440.
 * ------------------------------------------------------- */

@media (max-width: 900px) {
    .card-detail-layout { grid-template-columns: 1fr; }
    .card-detail-face { max-width: 320px; }

    .hero { grid-template-columns: 1fr; }
    .hero-art { order: -1; max-width: 320px; }

    .story-duet[data-secondary="1"],
    .story-duet[data-secondary="2"] { grid-template-columns: 1fr; }
    .story-duet-secondary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
    .story-duet-secondary { grid-template-columns: 1fr; }
    .door-list a,
    .door-list .is-empty { grid-template-columns: 1fr; }
    .door-go { display: none; } /* the whole row is already the link */
    .founder-body p:first-child::first-letter { font-size: 2.1em; }
}

@media (max-width: 782px) {
    /* Collapse the primary nav behind the native <details> toggle. Without
       this the five archive links plus the CTA wrap into an unreadable
       stack. Above this width style.css's base rules keep the panel
       permanently visible regardless of the [open] attribute; below it we
       hand control back to the browser's native open/closed state. */
    .nav-toggle { display: flex; }

    .nav-disclosure:not([open]) .nav-panel { display: none; }

    .nav-panel {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 50;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.25rem 0 1.25rem;
        background: var(--ink-raised);
        border-bottom: 1px solid var(--rule);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
        max-height: 85vh;
        overflow-y: auto;
    }
    .nav-disclosure { position: relative; z-index: 50; }

    #primary-nav ul { flex-direction: column; align-items: stretch; }
    #primary-nav li + li { border-left: 0; border-top: 1px solid var(--rule-dim); }
    /* Tracked small caps are the desktop bar's accent, not a default for a
       list of primary destinations someone reads normally on a phone. */
    #primary-nav a {
        padding: 1rem clamp(1.15rem, 3.5vw, 2.75rem);
        font-family: 'EB Garamond', Georgia, serif;
        font-size: 1.05rem;
        letter-spacing: normal;
        text-transform: none;
    }
    #primary-nav a::after { display: none; }
    #primary-nav .is-current a { color: var(--gold); }

    .nav-panel .btn-youtube-header {
        margin: 0.9rem clamp(1.15rem, 3.5vw, 2.75rem) 0;
        justify-content: center;
    }
    .nav-panel .social-links {
        justify-content: center;
        padding-top: 1rem;
        margin: 0.9rem clamp(1.15rem, 3.5vw, 2.75rem) 0;
        border-top: 1px solid var(--rule-dim);
    }
}

/* Locks background scroll while the mobile panel is open — added by
   site.js (an enhancement; the menu still opens/closes without it). */
body.nav-is-locked { overflow: hidden; }

@media (max-width: 620px) {
    .codex-row {
        grid-template-columns: 72px 1fr;
        gap: 1rem;
    }
    .character-detail { grid-template-columns: 1fr; }
    .character-plate { max-width: 280px; }
    .entry-nav .entry-nav-next { text-align: left; }
    .filters { gap: 0.6rem; }
    .filters select { width: 100%; }
    .filters label { width: 100%; margin-bottom: -0.3rem; }
}

@media (max-width: 420px) {
    .card-shelf { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
    .action-row .btn { width: 100%; text-align: center; }
}

/* Touch targets: anything tappable clears 44px on coarse pointers. */
@media (pointer: coarse) {
    #primary-nav a,
    .footer-nav a,
    .footer-social a,
    .social-links a,
    .pagination .page-numbers { min-height: 44px; display: flex; align-items: center; }
    .btn, .btn-primary, .btn-youtube-text { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .myth-card:hover,
    .culture-tile:hover,
    .culture-card:hover,
    .codex-row:hover { transform: none; }
    .scroll-hint { animation: none; }
}

/* ---------------------------------------------------------
 * CONTRAST + LEGIBILITY CORRECTIONS
 * Found by rendering the real pages, not by reading the CSS.
 * ------------------------------------------------------- */

.site-nav .btn:hover { text-decoration: none; }

/* --stone-faint on --ink is about 3:1 — fine for a decorative rule, not
   for a link someone is meant to click. */
.social-links a,
.footer-nav a,
.footer-social a {
    color: var(--stone-dim);
}
.social-links a:hover { color: var(--gold-hi); }

.codex-excerpt,
.story-card-excerpt,
.hero-lede p,
.closing-body,
.culture-desc,
.door-desc,
.lede {
    color: #c6bfae; /* lifts body copy clear of the 4.5:1 line on --ink */
}

/* Empty artwork states: present but recessive. A wall of large MB
   monograms reads as an unfinished site rather than a reserved space. */
.codex-figure.is-empty,
.portrait-frame.is-empty,
.myth-card-art.is-empty,
.story-card-art.is-empty,
.plate-fallback {
    background-size: 26%;
    opacity: 0.22;
}

/* Focus states must be obvious against a near-black page. */
:where(a, button, select, input, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--gold-hi);
    outline-offset: 3px;
}
.myth-card:focus-visible,
.codex-row:focus-visible,
.portrait-card:focus-visible,
.culture-tile:focus-visible,
.culture-card:focus-visible,
.door-list a:focus-visible {
    outline: 2px solid var(--gold-hi);
    outline-offset: 4px;
}

/* One portrait niche per row at phone width leaves a very tall column of
   mostly-empty frames. Two up reads as a contact sheet instead. */
@media (max-width: 620px) {
    .portrait-grid { grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr)); }
    .card-shelf { grid-template-columns: repeat(auto-fill, minmax(min(145px, 100%), 1fr)); }
}

/* =========================================================
 * PARCHMENT — the manuscript surface.
 *
 * A deliberately small set of places get this treatment (see each
 * template): the founder note, story excerpts, source notes, pull quotes,
 * the full-story reading surface, timeline annotations, character
 * reference/source details, and a card's supporting text. Everywhere else
 * — header, nav, footer, archive shells, artwork presentation — stays
 * dark. The site should read as moving between an archive room and a
 * manuscript laid open on a table in it, not as one uniform skin.
 *
 * Text/link colours on this surface are NOT the dark-surface tokens.
 * Verified against WCAG 2.2 AA (see the colour audit run for this phase):
 *   ink-on-parchment      9.41:1 on parchment — body text
 *   ink-on-parchment-dim  6.05:1 on parchment — secondary text
 *   oxblood               6.43:1 on parchment — links/emphasis here
 * --bronze (the dark-surface accent) measures only 2.19:1 on parchment —
 * it must never be used as text or a link colour on this surface.
 * Conversely --oxblood measures only 1.87:1 on --ink — it must never be
 * used as text on a dark surface; it belongs on parchment, or as a small
 * non-text filled marker paired with real text elsewhere on the page.
 * ========================================================= */

.parchment {
    --texture-op: 0.05;
    position: relative;
    background-color: var(--parchment);
    background-image:
        radial-gradient(120% 140% at 15% 0%, rgba(255, 252, 240, 0.35), transparent 60%),
        radial-gradient(100% 120% at 100% 100%, rgba(41, 36, 28, 0.08), transparent 55%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23p)' opacity='0.05'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat, repeat;
    color: var(--ink-on-parchment-dim);
    box-shadow: inset 0 1px 0 rgba(255, 252, 240, 0.4), inset 0 -1px 0 rgba(41, 36, 28, 0.12);
}
.parchment h1, .parchment h2, .parchment h3, .parchment h4 { color: var(--ink-on-parchment); }
.parchment a { color: var(--oxblood); text-decoration-color: rgba(110, 40, 40, 0.4); }
.parchment a:hover { color: var(--ink-on-parchment); }
.parchment :where(a, button, select, input, summary, [tabindex]):focus-visible {
    outline-color: var(--ink-on-parchment);
}
.parchment .tag,
.parchment .tag-plain { color: var(--ink-on-parchment-dim); border-color: rgba(41, 36, 28, 0.3); }
.parchment hr, .parchment .rule { background: linear-gradient(90deg, transparent, var(--parchment-line), transparent); }

/* Respect reduced data/motion preferences by dropping the texture layer
   rather than the colour — atmosphere is allowed to go, legibility and
   brand colour are not. Also protects against any low-end renderer that
   handles repeating SVG turbulence poorly. */
@media (prefers-reduced-motion: reduce), (update: slow) {
    .parchment { background-image: none; }
}

/* ---------- founder note: a signed editorial page, not a profile card ---------- */

.founder {
    padding-block: clamp(3rem, 7vw, 5rem);
}
.founder-inner {
    max-width: 62ch;
    margin-inline: auto;
    padding: clamp(2rem, 5vw, 3.2rem) clamp(1.8rem, 5vw, 3rem);
}
.founder h2 { font-size: var(--step-2); margin-bottom: 1.1em; }
.founder-body p { font-size: var(--step-1); margin-bottom: 1.1em; max-width: 58ch; }
/* One restrained manuscript initial, not a drop cap on every excerpt on the
   site — this is the single place the device is used on the homepage. */
.founder-body p:first-child::first-letter {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 2.5em;
    line-height: 0.72;
    float: left;
    padding: 0.05em 0.08em 0 0;
    color: var(--oxblood);
}
.founder-sign {
    margin-top: 1.6rem;
    padding-top: 1rem;
    border-top: 1px solid var(--parchment-line);
}
.founder-name {
    display: block;
    font-family: 'Cinzel', Georgia, serif;
    font-size: var(--step-0);
    letter-spacing: 0.03em;
    color: var(--ink-on-parchment);
}
.founder-role { display: block; font-size: var(--step--1); font-style: italic; color: var(--ink-on-parchment-dim); }

/* ---------- pull quotes ---------- */

.pull-quote {
    margin: 2rem 0;
    padding: 0.3rem 0 0.3rem 1.4rem;
    border-left: 3px solid var(--oxblood-dim);
    font-family: 'EB Garamond', Georgia, serif;
    font-size: var(--step-1);
    font-style: italic;
    color: var(--stone);
    max-width: 46ch;
}
.parchment .pull-quote { color: var(--ink-on-parchment); border-left-color: var(--oxblood); }

/* ---------- small manuscript markers ----------
 * A filled diamond, used sparingly (timeline points, source markers). On
 * dark surfaces it stays bronze, matching the site's dark-surface accent —
 * oxblood is reserved for parchment and cannot be relied on for meaning
 * against --ink (see the contrast note above), so it is not the default
 * marker colour here despite being the "manuscript" colour on paper. */
.ms-marker {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--bronze);
    transform: rotate(45deg);
    flex: none;
}
.parchment .ms-marker { background: var(--oxblood); }

/* ---------- editorial note / source note surface ---------- */

.editorial-note {
    padding: clamp(1.2rem, 3vw, 1.8rem) clamp(1.3rem, 3.5vw, 2rem);
    margin: 1.8rem 0;
}
.editorial-note h2, .editorial-note h3 { font-size: var(--step-0); margin-bottom: 0.5em; }

/* ---------------------------------------------------------
 * STORY TABLE OF CONTENTS
 * Alternating art side, a folio number instead of a repeated card frame —
 * a publication's contents page, not a database listing. Scales to any
 * count: at two entries it already reads as a considered pair rather than
 * a stretched grid; at twenty it becomes a real table of contents.
 * ------------------------------------------------------- */

.archive-intro { margin-bottom: 2rem; }

.story-toc {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--rule-dim);
}
.story-toc-entry {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(140px, 220px) minmax(0, 1fr);
    align-items: start;
    gap: clamp(1rem, 3vw, 2rem);
    padding-block: clamp(1.8rem, 4vw, 2.6rem);
    border-bottom: 1px solid var(--rule-dim);
}
/* Every second entry swaps which side the artwork sits on — a plain
   editorial device, not decoration, and it's what actually breaks the
   "identical card repeated" pattern the rest of the archive still has. */
.story-toc-entry:nth-child(even) { grid-template-columns: auto minmax(0, 1fr) minmax(140px, 220px); }
.story-toc-entry:nth-child(even) .story-toc-art { order: 2; }
.story-toc-entry:nth-child(even) .story-toc-body { order: 1; }

.story-toc-num {
    font-family: 'Cinzel', Georgia, serif;
    font-size: var(--step-1);
    color: var(--stone-faint);
    line-height: 1;
    padding-top: 0.15em;
}

.story-toc-art {
    display: block;
    aspect-ratio: 4 / 3;
    background: var(--slate);
    overflow: hidden;
    border: 1px solid var(--rule-dim);
}
.story-toc-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-toc-art.is-empty {
    background-image: url('../brand/monogram-flat.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22%;
    opacity: 0.22;
}

.story-toc-body h2 { font-size: var(--step-2); margin-bottom: 0.35em; }
.story-toc-body h2 a { color: inherit; }
.story-toc-body h2 a:hover { color: var(--bronze-hi); }
.story-toc-meta {
    font-size: var(--step--1);
    color: var(--stone-faint);
    margin-bottom: 0.7em;
}
.story-toc-video-yes { color: var(--bronze); }
.story-toc-intro { color: #c6bfae; max-width: 62ch; margin-bottom: 0.8em; }
.story-toc-read {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.86rem;
    letter-spacing: 0.06em;
    color: var(--bronze-hi);
}
.story-toc-read:hover { color: var(--stone); }

@media (max-width: 620px) {
    .story-toc-entry,
    .story-toc-entry:nth-child(even) {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }
    .story-toc-entry:nth-child(even) .story-toc-art,
    .story-toc-entry:nth-child(even) .story-toc-body { order: initial; }
    .story-toc-num { display: none; }
    .story-toc-art { aspect-ratio: 16 / 9; }
}

/* ---------------------------------------------------------
 * MANUSCRIPT PAGE — the full Story reading surface.
 * The strongest parchment treatment on the site, and the only place a
 * whole article body sits on it. Everything before and after this block
 * (video, "Who Appears," related content, prev/next) stays on the dark
 * shell on purpose — the manuscript is a page opened inside the archive,
 * not the whole site turning to paper.
 * ------------------------------------------------------- */

.manuscript-page {
    margin: 2rem 0;
    padding: clamp(1.8rem, 5vw, 3.5rem) clamp(1.6rem, 5vw, 3.2rem);
}
.manuscript-page .entry-head {
    border-bottom: 1px solid var(--parchment-line);
    margin-bottom: 1.8rem;
    padding-bottom: 1.4rem;
}
.manuscript-page .story-art {
    margin: 0 0 1.6rem;
    border: 1px solid var(--parchment-line);
    box-shadow: none;
}
.manuscript-byline-line {
    font-size: var(--step--1);
    color: var(--ink-on-parchment-dim);
    margin: 0.5em 0 0;
}
.manuscript-body { max-width: var(--measure-article); }
.manuscript-sources {
    margin-top: 2.2rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--parchment-line);
}
.manuscript-sources .source-list { color: var(--ink-on-parchment-dim); }

@media (max-width: 620px) {
    .manuscript-page { margin-inline: calc(var(--gutter) * -1); border-radius: 0; }
}
