/* ============================================================
   Marginalia — a reading Bible
   Dark cover, warm pages. Fraunces for display, EB Garamond
   for text, oxblood and bronze for everything that speaks.
   ============================================================ */

:root {
    --paper: #f6f1e3;
    --paper-high: #fcf8ee;
    --paper-deep: #efe8d4;
    --ink: #221c12;
    --ink-soft: #6e6450;
    --ink-faint: #a4977c;
    --rule: #ddd3b9;
    --oxblood: #84291a;
    --oxblood-bright: #a23420;
    --bronze: #97743a;
    --bronze-soft: #b89a63;
    --cover: #171108;
    --cover-card: #211a0e;
    --cover-rule: #3a3021;
    --cover-text: #ece4cf;
    --cover-faint: #8d8166;
    --display: "Fraunces", "Iowan Old Style", serif;
    --text: "EB Garamond", "Iowan Old Style", Georgia, serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--text);
    font-size: 17px;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Paper grain — one SVG turbulence pass over everything */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 60;
    pointer-events: none;
    opacity: 0.05;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--oxblood); }

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

::selection { background: rgba(151, 116, 58, 0.28); }

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

/* ============================================================
   THE COVER (landing)
   ============================================================ */

body.cover {
    background: var(--cover);
    color: var(--cover-text);
    background-image:
        radial-gradient(1100px 520px at 50% -8%, rgba(162, 52, 32, 0.16), transparent 70%),
        radial-gradient(900px 600px at 85% 110%, rgba(151, 116, 58, 0.10), transparent 65%);
}

.cover-main {
    max-width: 66rem;
    margin: 0 auto;
    padding: clamp(2.5rem, 7vw, 5.5rem) clamp(1.25rem, 5vw, 3rem) 3rem;
}

.masthead {
    max-width: 44rem;
    animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.wordmark {
    margin: 0 0 1.4rem;
    font-family: var(--display);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: var(--bronze-soft);
}

.wordmark::after {
    content: "";
    display: block;
    width: 3.2rem;
    height: 1px;
    margin-top: 1.1rem;
    background: var(--oxblood-bright);
}

.masthead-title {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(2.4rem, 6.4vw, 4.4rem);
    font-weight: 330;
    line-height: 1.06;
    letter-spacing: -0.015em;
    font-variation-settings: "opsz" 110;
}

.masthead-title em {
    font-style: italic;
    font-weight: 360;
    color: var(--bronze-soft);
}

.masthead-note {
    max-width: 34rem;
    margin: 1.8rem 0 0;
    font-size: 1.12rem;
    line-height: 1.65;
    color: var(--cover-faint);
}

/* The shelf of chapters */

.shelf { margin-top: clamp(3rem, 7vw, 5rem); }

.shelf-label {
    margin: 0 0 1.4rem;
    font-size: 0.78rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--cover-faint);
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: 0.9rem;
}

.chapter-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1.6rem 1.5rem 1.4rem;
    border: 1px solid var(--cover-rule);
    background: var(--cover-card);
    color: inherit;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: background 0.35s ease;
    animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--i) * 70ms + 150ms);
}

.chapter-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 2px;
    background: var(--oxblood-bright);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.chapter-card:hover,
.chapter-card:focus-visible {
    background: #2a2113;
    outline: none;
}

.chapter-card:hover::before,
.chapter-card:focus-visible::before { transform: scaleY(1); }

.card-ref {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    font-family: var(--display);
}

.card-ref .ref-name {
    font-size: 1.5rem;
    font-weight: 420;
    letter-spacing: 0.01em;
}

.card-ref .ref-badge {
    font-size: 0.66rem;
    font-family: var(--text);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--cover);
    background: var(--bronze-soft);
    padding: 0.28em 0.7em 0.22em;
    border-radius: 2px;
    white-space: nowrap;
}

.card-title {
    margin: 0;
    font-family: var(--display);
    font-style: italic;
    font-weight: 380;
    font-size: 1.02rem;
    color: var(--bronze-soft);
}

.card-blurb {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.55;
    color: var(--cover-faint);
    flex-grow: 1;
}

.card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.4rem;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--cover-faint);
}

.card-foot .go {
    color: var(--bronze-soft);
    transition: transform 0.3s ease, color 0.3s ease;
}

.chapter-card:hover .go {
    transform: translateX(4px);
    color: var(--oxblood-bright);
}

.cover-foot {
    margin-top: 4rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--cover-rule);
}

.cover-foot p {
    margin: 0;
    max-width: 46rem;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--cover-faint);
}

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

/* ============================================================
   THE PAGE (reader)
   ============================================================ */

.bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem clamp(1rem, 4vw, 2rem);
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--rule);
}

.bar-home {
    font-family: var(--display);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink-soft);
    transition: color 0.25s ease;
}

.bar-home:hover { color: var(--oxblood); }

.bar-arrow {
    letter-spacing: 0;
    margin-right: 0.3em;
    color: var(--bronze);
}

.bar-tools { display: flex; gap: 0.4rem; }

.tool {
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-faint);
    padding: 0.45em 0.9em 0.38em;
    border: 1px solid transparent;
    border-radius: 2px;
    transition: color 0.25s ease, border-color 0.25s ease;
}

.tool::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    margin-right: 0.6em;
    vertical-align: 0.12em;
    background: var(--rule);
    transition: background 0.25s ease;
}

.tool[aria-pressed="true"] {
    color: var(--ink-soft);
    border-color: var(--rule);
}

.tool[aria-pressed="true"]::before { background: var(--oxblood-bright); }

.tool:hover { color: var(--oxblood); }

/* Chapter head */

.leaf {
    max-width: 41rem;
    margin: 0 auto;
    padding: clamp(2.6rem, 7vw, 4.6rem) 1.4rem 3rem;
}

.chapter-head {
    margin-bottom: clamp(2.2rem, 5vw, 3.4rem);
    animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.chapter-head .book {
    margin: 0;
    font-size: 0.85rem;
    letter-spacing: 0.46em;
    text-transform: uppercase;
    color: var(--bronze);
}

.chapter-head .numeral {
    margin: 0.2rem 0 0;
    font-family: var(--display);
    font-size: clamp(4.6rem, 13vw, 6.8rem);
    font-weight: 300;
    line-height: 0.95;
    letter-spacing: -0.02em;
    color: var(--ink);
    font-variation-settings: "opsz" 144;
}

.chapter-head::after {
    content: "";
    display: block;
    width: 5.4rem;
    height: 2px;
    margin-top: 1.3rem;
    background: var(--oxblood);
}

.chapter-head .edition {
    margin: 1.1rem 0 0;
    font-size: 0.74rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

/* Preview chapters — text only, study layer not yet written */

body.preview-chapter .chapter-head .numeral { color: var(--ink-faint); }

.notice {
    margin-bottom: clamp(1.8rem, 4vw, 2.6rem);
    padding: 1.1rem 1.3rem 1.2rem;
    background: var(--paper-deep);
    border: 1px solid var(--rule);
    border-radius: 3px;
    animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.notice .notice-lead {
    margin: 0 0 0.45rem;
    font-size: 0.7rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--bronze);
}

.notice p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink-soft);
}

.notice .notice-back {
    display: inline-block;
    margin-top: 0.9rem;
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-soft);
    padding: 0.45em 0.9em 0.38em;
    border: 1px solid var(--rule);
    border-radius: 2px;
    transition: color 0.25s ease, border-color 0.25s ease;
}

.notice .notice-back:hover {
    color: var(--oxblood);
    border-color: var(--oxblood);
}

/* Body text */

.chapter-body {
    font-size: 1.32rem;
    line-height: 1.78;
    animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.chapter-body p {
    margin: 0 0 1.35em;
    text-wrap: pretty;
}

.dropcap {
    float: left;
    font-family: var(--display);
    font-weight: 380;
    font-size: 4.35em;
    line-height: 0.78;
    padding: 0.07em 0.12em 0 0;
    color: var(--oxblood);
    font-variation-settings: "opsz" 144;
}

.sc {
    font-variant: small-caps;
    letter-spacing: 0.05em;
}

/* Verse numbers — hidden until asked for */

.vnum {
    display: none;
    font-size: 0.58em;
    line-height: 0;
    vertical-align: 0.65em;
    margin-right: 0.35em;
    color: var(--bronze);
    font-style: normal;
    letter-spacing: 0;
    user-select: none;
}

body.show-verses .vnum { display: inline; }

/* Deep-linked verse flash */

.verse.lit {
    background: rgba(151, 116, 58, 0.22);
    box-shadow: 0 0 0 5px rgba(151, 116, 58, 0.22);
    border-radius: 2px;
}

/* Study scopes — invisible at rest; washes fade in and out.
   scope-preview (hover) < scope-active (panel open) < scope-flash (tap). */

.verse,
.scope {
    transition: background 0.4s ease;
}

.scope-preview,
.scope-active,
.scope-flash {
    border-radius: 3px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.scope-preview { background: rgba(151, 116, 58, 0.10); }

.scope-active { background: rgba(151, 116, 58, 0.16); }

.scope-flash { animation: scope-flash 0.9s ease-out forwards; }

@keyframes scope-flash {
    from { background-color: rgba(162, 52, 32, 0.22); }
    to   { background-color: rgba(162, 52, 32, 0); }
}

/* Poetry */

.stanza {
    margin: 0 0 1.15em;
    padding-left: 1.4em;
    text-indent: -1.4em;
}

/* Chapter nav + footer */

.chapter-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3.4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
}

.chapter-nav a {
    max-width: 46%;
    text-decoration: none;
    color: var(--ink-soft);
    transition: color 0.25s ease;
}

.chapter-nav a:hover { color: var(--oxblood); }

.chapter-nav .nav-label {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 0.25rem;
}

.chapter-nav .nav-ref {
    font-family: var(--display);
    font-style: italic;
    font-size: 1.05rem;
}

.chapter-nav .next { text-align: right; margin-left: auto; }

.leaf-foot {
    margin-top: 2.6rem;
}

.leaf-foot p {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--ink-faint);
}

/* ============================================================
   THE STUDY VIEW — margin column on desktop, takeover on mobile
   ============================================================ */

.study {
    position: fixed;
    z-index: 35;
    display: flex;
    flex-direction: column;
    background: var(--paper-high);
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.study.open {
    opacity: 1;
    transform: none;
}

@media (min-width: 769px) {
    .study {
        top: var(--chrome-h, 3.3rem);
        right: 0;
        bottom: 0;
        width: min(27.5rem, 44vw);
        border-left: 1px solid var(--rule);
        box-shadow: -14px 0 40px rgba(34, 28, 18, 0.07);
        transform: translateX(14px);
    }
    .leaf {
        transition: margin 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    }
    body.study-open .leaf {
        margin-left: max(1.5rem, calc((100vw - min(27.5rem, 44vw) - 41rem) / 2));
        margin-right: calc(min(27.5rem, 44vw) + 1.5rem);
    }
}

@media (max-width: 768px) {
    .study {
        top: var(--chrome-h, 3.3rem);
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 38;
        transform: translateY(14px);
    }
}

.study-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 1.1rem 1.4rem 0.85rem;
    border-bottom: 1px solid var(--rule);
}

.study-kicker {
    margin: 0;
    font-size: 0.7rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--bronze);
}

.study-title {
    margin: 0.25rem 0 0;
    font-family: var(--display);
    font-weight: 430;
    font-size: 1.5rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.study-close {
    flex-shrink: 0;
    width: 2.1rem;
    height: 2.1rem;
    margin: -0.3rem -0.4rem 0 0;
    font-size: 1.55rem;
    line-height: 1;
    color: var(--ink-faint);
    border-radius: 50%;
    transition: color 0.2s ease, background 0.2s ease;
}

.study-close:hover {
    color: var(--oxblood);
    background: var(--paper-deep);
}

.study-scroll {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.15rem 1.4rem 2.2rem;
    font-size: 1.04rem;
    line-height: 1.62;
}

/* The context quote: the verse, with the tapped scope marked. */
.study-context {
    margin: 0 0 0.95rem;
    padding: 0.15rem 0 0.15rem 0.95rem;
    border-left: 2px solid var(--rule);
    font-style: italic;
    font-size: 1.02rem;
    color: var(--ink-soft);
}

.study-context mark {
    background: rgba(151, 116, 58, 0.2);
    color: var(--oxblood);
    padding: 0 0.12em;
    border-radius: 2px;
}

.study-context cite {
    font-style: normal;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-faint);
    white-space: nowrap;
}

.study-within {
    margin: 0 0 0.95rem;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.study-within button {
    font-size: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    color: var(--bronze);
    transition: color 0.2s ease;
}

.study-within button:hover { color: var(--oxblood); }

/* Layer 0: the gloss as lede. */
.study-gloss {
    margin: 0 0 1.15rem;
    font-size: 1.17rem;
    line-height: 1.55;
}

/* Layer 1: categories as collapsed disclosure sections. */
.study-sec { border-top: 1px solid var(--rule); }

.study-sec:last-of-type { border-bottom: 1px solid var(--rule); }

.study-sec summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    padding: 0.72rem 0.2rem;
    font-size: 0.74rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-soft);
    transition: color 0.2s ease;
    user-select: none;
}

.study-sec summary::-webkit-details-marker { display: none; }

.study-sec summary::before {
    content: "+";
    font-family: var(--display);
    width: 0.85em;
    color: var(--bronze);
}

.study-sec[open] summary::before { content: "\2212"; }

.study-sec summary:hover { color: var(--oxblood); }

.sec-n {
    font-size: 0.68rem;
    color: var(--ink-faint);
}

.sec-body { padding: 0.15rem 0.2rem 1.05rem; }

/* See also — the rabbit holes. */
.study-seealso {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-top: 1.35rem;
}

.seealso-label {
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-right: 0.25rem;
}

.study-seealso button {
    font-size: 0.92rem;
    padding: 0.22em 0.8em 0.18em;
    border: 1px solid var(--rule);
    border-radius: 999px;
    color: var(--ink-soft);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.study-seealso button:hover {
    color: var(--oxblood);
    border-color: var(--oxblood);
}

/* ============================================================
   THE TRAIL — breadcrumbs home from any rabbit hole
   ============================================================ */

.chrome {
    position: sticky;
    top: 0;
    z-index: 40;
}

.trail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem clamp(1rem, 4vw, 2rem);
    background: var(--paper-deep);
    border-bottom: 1px solid var(--rule);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    font-size: 0.69rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.trail::-webkit-scrollbar { display: none; }

.trail .crumb {
    color: var(--ink-soft);
    transition: color 0.2s ease;
}

.trail button.crumb:hover { color: var(--oxblood); }

.trail .crumb.home {
    color: var(--oxblood);
    font-weight: 600;
}

.trail .crumb.home::before {
    content: "\21A9";
    margin-right: 0.45em;
    font-weight: 400;
}

.trail .crumb.current { color: var(--ink); }

.trail .sep {
    color: var(--ink-faint);
    flex-shrink: 0;
}

/* ============================================================
   HOVER GLOSS — the dictionary layer (fine pointers only)
   ============================================================ */

.gloss-tip {
    position: fixed;
    z-index: 55;
    max-width: 24rem;
    padding: 0.55rem 0.85rem 0.6rem;
    background: var(--paper-high);
    border: 1px solid var(--rule);
    border-top: 2px solid var(--bronze);
    box-shadow: 0 10px 30px rgba(34, 28, 18, 0.16);
    font-size: 0.96rem;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    pointer-events: none;
}

.gloss-tip.open {
    opacity: 1;
    transform: none;
}

.gloss-tip strong { font-weight: 600; }

.gloss-tip strong::after {
    content: " \2014 ";
    color: var(--ink-faint);
    font-weight: 400;
}

/* ============================================================
   GLOSS CARD — first tap on touch devices: the dictionary layer
   as a bottom mini-card; second tap (or tapping the card) commits
   to the full study view.
   ============================================================ */

.gloss-card {
    position: fixed;
    left: 0.8rem;
    right: 0.8rem;
    bottom: calc(0.8rem + env(safe-area-inset-bottom));
    z-index: 38;
    max-width: 30rem;
    margin: 0 auto;
    padding: 0.75rem 1rem 0.7rem;
    background: var(--paper-high);
    border: 1px solid var(--rule);
    border-top: 2px solid var(--bronze);
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(34, 28, 18, 0.22);
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.gloss-card.open {
    opacity: 1;
    transform: none;
}

.gcard-kicker {
    margin: 0 0 0.25rem;
    font-size: 0.64rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--bronze);
}

.gcard-text {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.5;
}

.gcard-text strong { font-weight: 600; }

.gcard-text strong::after {
    content: " \2014 ";
    color: var(--ink-faint);
    font-weight: 400;
}

.gcard-more {
    margin: 0.45rem 0 0;
    font-size: 0.68rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--oxblood);
    text-align: right;
}

.ref-item + .ref-item {
    margin-top: 1.15rem;
    padding-top: 1.05rem;
    border-top: 1px solid var(--rule);
}

.ref-item h3 {
    margin: 0 0 0.35rem;
    font-family: var(--text);
    font-weight: 600;
    font-size: 1.06rem;
    letter-spacing: 0.01em;
}

.ref-item p {
    margin: 0;
    color: var(--ink);
}

.ref-item .greek {
    font-style: italic;
    color: var(--oxblood);
}

.passages {
    list-style: none;
    margin: 0.6rem 0 0;
    padding: 0;
}

.passages li {
    margin: 0.3rem 0;
    padding-left: 1rem;
    position: relative;
    font-size: 0.98rem;
}

.passages li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 0.4rem;
    height: 1px;
    background: var(--bronze);
}

.passages a {
    color: var(--oxblood);
    text-decoration: none;
    border-bottom: 1px solid rgba(132, 41, 26, 0.35);
    transition: border-color 0.2s ease;
}

.passages a:hover { border-bottom-color: var(--oxblood); }

/* Links into preview ("text only") chapters */

.passages a.draft {
    color: var(--ink-faint);
    border-bottom: 1px dashed var(--ink-faint);
}

.passages a.draft:hover {
    color: var(--ink-soft);
    border-bottom-color: var(--ink-soft);
}

.draft-tag {
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-faint);
    white-space: nowrap;
}

.passages .pref { font-weight: 600; }

.passages .pnote { color: var(--ink-soft); }

.error-note {
    font-size: 1.05rem;
    color: var(--ink-soft);
}

/* ============================================================
   MAP PLATES — atlas pages in the house style.
   SVGs are injected inline so these rules style their guts.
   ============================================================ */

.map-fig {
    margin: 0.9rem 0 0.3rem;
}

.map-fig figcaption {
    margin-top: 0.45rem;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    color: var(--ink-soft);
    font-style: italic;
}

.plate {
    display: block;
    width: 100%;
    height: auto;
    font-family: var(--text);
}

.plate-sea { fill: #e9e0c8; }

.plate-land {
    fill: var(--paper-high);
    stroke: #6b5f49;
    stroke-width: 0.8;
    stroke-linejoin: round;
}

.plate-graticule line {
    stroke: rgba(110, 100, 80, 0.16);
    stroke-width: 0.5;
}

.plate-seas text {
    font-style: italic;
    font-size: 13px;
    letter-spacing: 0.14em;
    fill: var(--ink-faint);
}

.plate-regions text {
    font-size: 11.5px;
    letter-spacing: 0.34em;
    fill: var(--bronze);
}

.plate-places circle { fill: var(--ink); }

.plate-places text {
    font-size: 12.5px;
    fill: var(--ink);
}

.plate [data-place].focus circle,
.plate [data-place].focus {
    fill: var(--oxblood-bright);
}

.plate-places [data-place].focus circle {
    stroke: var(--oxblood-bright);
    stroke-width: 4;
    stroke-opacity: 0.22;
}

.plate-places [data-place].focus text {
    fill: var(--oxblood);
    font-weight: 600;
}

.plate-regions text.focus { fill: var(--oxblood); }

.plate-routes path {
    fill: none;
    stroke: var(--oxblood-bright);
    stroke-width: 1.5;
    stroke-dasharray: 5 4;
    stroke-linecap: round;
    display: none;
}

.plate-routes path.show { display: inline; }

.plate-frame {
    fill: none;
    stroke: var(--ink-soft);
    stroke-width: 1;
}

.plate-frame-outer {
    fill: none;
    stroke: var(--rule);
    stroke-width: 1;
}

.plate-title {
    font-family: var(--display);
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    fill: var(--ink-soft);
}
