/* ==========================================================================
   Argent Codex - design system
   Wood + parchment, ink, wax, gold leaf. Editorial / library mood.
   Atoms ported from the design bundle (styles.css + shared.jsx primitives).
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=UnifrakturCook:wght@700&family=UnifrakturMaguntia&family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=IM+Fell+English+SC&family=Cinzel:wght@400;600;700&family=Pinyon+Script&family=JetBrains+Mono:wght@400;500&display=swap");

@font-face {
    font-family: "Morpheus";
    src: url("../fonts/MORPHEUS.ttf");
}
@font-face {
    font-family: "LifeCraft";
    src: url("../fonts/LifeCraft_Font.ttf");
}
@font-face {
    font-family: "Friz";
    src: url("../fonts/Friz Quadrata Regular.ttf");
}

:root {
    /* Neutral / Argent palette */
    --ink: #14100a;
    --ink-soft: #281e12;
    --ink-faded: #524130;
    --vellum: #f1e6cf;
    --vellum-deep: #e6d5b0;
    --vellum-shadow: #b89c70;
    --wine: #5a1626;
    --wine-deep: #3d0d18;
    --silver: #c9c2b3;
    --silver-deep: #8e8674;
    --gold: #b89048;
    --gold-light: #d8b46a;
    --bone: #f4ecdc;

    --wood-1: #2d1d12;
    --wood-2: #1c110a;
    --wood-3: #44291a;
    --iron: #2a2520;

    --parchment-grain: 0.55;
}

/* ─────────────────────────────────────────────────────────────────────────
   Base
   ───────────────────────────────────────────────────────────────────────── */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: #5a3a22;
    color: var(--vellum);
    font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
    font-size: 17px;
    line-height: 1.55;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

a {
    color: var(--gold-light);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.18s ease, border-color 0.18s ease;
}
a:hover {
    color: var(--vellum);
    border-bottom-color: rgba(216, 180, 106, 0.4);
}

img {
    max-width: 100%;
}

/* ─────────────────────────────────────────────────────────────────────────
   Typography helpers
   ───────────────────────────────────────────────────────────────────────── */
.fnt-display {
    font-family: "UnifrakturCook", "UnifrakturMaguntia", serif;
    font-weight: 700;
}
.fnt-display-soft {
    font-family: "Cormorant Garamond", "EB Garamond", serif;
    font-weight: 600;
    font-style: italic;
}
.fnt-body {
    font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
}
.fnt-meta {
    font-family: "IM Fell English SC", "Cinzel", serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.fnt-script {
    font-family: "Pinyon Script", "Tangerine", cursive;
}
.fnt-mono {
    font-family: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
}

/* Legacy utility kept for compatibility with existing markup */
.lifecraft {
    font-family: "UnifrakturCook", "LifeCraft", serif;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.lifecraft-title {
    font-family: "UnifrakturCook", "LifeCraft", serif;
    font-weight: 700;
    -webkit-text-stroke-width: 1px;
    -webkit-text-stroke-color: rgba(0, 0, 0, 0.3);
}

/* Drop cap on first paragraph of a card */
.dropcap::first-letter {
    font-family: "UnifrakturCook", serif;
    font-size: 4.4em;
    line-height: 0.85;
    float: left;
    padding: 0.12em 0.14em 0 0;
    color: var(--wine-deep);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

/* Ink rule - section underline with diamond */
.ink-rule {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ink) 20%, var(--ink) 80%, transparent);
    position: relative;
    margin: 14px 0;
}
.ink-rule::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 12px;
    height: 12px;
    border: 1px solid var(--ink);
    background: var(--vellum);
}

.ink-heading {
    margin: 0 0 14px 0;
    color: var(--ink);
}
.ink-heading .kicker {
    font-family: "IM Fell English SC", "Cinzel", serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 11px;
    color: var(--ink-faded);
    margin-bottom: 6px;
}
.ink-heading .title {
    font-family: "UnifrakturCook", serif;
    color: var(--ink);
    line-height: 1;
    letter-spacing: 0.01em;
}

/* ─────────────────────────────────────────────────────────────────────────
   Wood plank background
   ───────────────────────────────────────────────────────────────────────── */
.wood,
body.wood {
    background: radial-gradient(140% 80% at 50% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.35) 100%), url("../images/backgrounds/wood-pattern.png") repeat, #6c4a2c;
    background-size: auto, 256px 256px, auto;
    background-attachment: fixed, fixed, fixed;
}

.wood-warm {
    background: radial-gradient(140% 80% at 50% 0%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.25) 100%), url("../images/backgrounds/wood-pattern.png") repeat, #7a542f;
    background-size: auto, 256px 256px, auto;
}

/* ─────────────────────────────────────────────────────────────────────────
   Parchment - Illuminated Folio
   Layered architecture: paper visuals live on ::before so the SVG turbulence
   filter (used by .torn-edges) can displace the paper edge while leaving the
   real content (text) unfiltered and crisp.
     ::before  z-index:-1  paper  (cream + grain + corners + vignette + shadow)
     ::after   z-index:-1  foxing (multiplied onto paper, painted after)
     content   z-index:0   text   (no filter applied)
   ───────────────────────────────────────────────────────────────────────── */
.parchment {
    position: relative;
    isolation: isolate; /* contains the negative-z pseudos */
    color: var(--ink);
    padding: 28px;
}

/* Paper layer - the visible card. .torn-edges adds the SVG filter here. */
.parchment::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 2px 4px 3px 5px / 4px 2px 5px 3px;
    background-color: #f3e7c6;
    background-image:
        /* soft elliptical vignette - fades smoothly */ radial-gradient(ellipse 110% 95% at 50% 50%, transparent 58%, rgba(110, 65, 25, 0.2) 100%),
        /* warm rim glow at corners only */ radial-gradient(circle 90px at 0% 0%, rgba(125, 75, 30, 0.32), transparent 70%),
        radial-gradient(circle 90px at 100% 0%, rgba(125, 75, 30, 0.3), transparent 70%), radial-gradient(circle 90px at 0% 100%, rgba(125, 75, 30, 0.3), transparent 70%),
        radial-gradient(circle 90px at 100% 100%, rgba(125, 75, 30, 0.34), transparent 70%),
        /* fiber/grain noise - ported from the original design */
            url("data:image/png;base64,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");
    background-blend-mode: multiply, multiply, multiply, multiply, multiply, normal;
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat;
    box-shadow: 0 1px 0 rgba(255, 250, 235, 0.35) inset, 0 22px 30px -16px rgba(0, 0, 0, 0.55), 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Foxing layer - sits on top of the paper but below content. Both pseudos
   share z-index:-1, so DOM order decides paint order: ::before paints first
   (paper), ::after paints second (foxing multiplies onto paper). Where the
   paper has been displaced away by the filter, foxing multiplies against
   transparent → invisible, so foxing never leaks past the wavy edge. */
.parchment::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    mix-blend-mode: multiply;
    opacity: 0.8;
    background-repeat: no-repeat;
    background-image: radial-gradient(ellipse 11% 9% at 14% 23%, rgba(140, 82, 38, 0.18), transparent 70%), radial-gradient(ellipse 7% 6% at 81% 17%, rgba(165, 95, 42, 0.16), transparent 70%),
        radial-gradient(ellipse 13% 11% at 67% 76%, rgba(135, 78, 32, 0.14), transparent 75%), radial-gradient(ellipse 6% 5% at 38% 61%, rgba(150, 85, 40, 0.12), transparent 70%),
        radial-gradient(ellipse 9% 7% at 22% 89%, rgba(155, 88, 42, 0.13), transparent 70%), radial-gradient(ellipse 5% 4% at 92% 48%, rgba(145, 82, 38, 0.11), transparent 70%);
}

/* Dropdown menus are too small for foxing to look good - strip it there. */
.dropdown-menu.parchment::after {
    display: none;
}

/* ─────────────────────────────────────────────────────────────────────────
   Illuminated drop cap - rubricated initial letter with wine block behind.
   Use as: <span class="illuminated-cap">A</span> at the start of a paragraph,
   or wrap a paragraph with .illuminated to drop-cap the first letter.
   ───────────────────────────────────────────────────────────────────────── */
.illuminated-cap,
.illuminated::first-letter {
    font-family: "UnifrakturCook", "UnifrakturMaguntia", serif;
    font-weight: 700;
    float: left;
    font-size: 4.6em;
    line-height: 0.82;
    padding: 0.12em 0.18em 0.04em 0.14em;
    margin: 0.04em 0.14em -0.06em 0;
    color: var(--vellum);
    background: radial-gradient(ellipse 70% 90% at 30% 30%, rgba(255, 255, 255, 0.18), transparent 60%), linear-gradient(160deg, var(--wine) 0%, var(--wine-deep) 75%);
    box-shadow: 0 0 0 1px rgba(184, 144, 72, 0.6), 0 0 0 3px rgba(60, 30, 12, 0), 0 0 0 4px rgba(184, 144, 72, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 8px -4px rgba(0, 0, 0, 0.4);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
    border-radius: 1px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Gilded divider - a refined alternative to .ink-rule with a gold accent.
   Two hairline rules with a centered diamond plus gilt sparks at the ends.
   ───────────────────────────────────────────────────────────────────────── */
.gilded-divider {
    position: relative;
    height: 16px;
    margin: 18px 0;
    pointer-events: none;
}
.gilded-divider::before,
.gilded-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ink) 14%, var(--ink) 86%, transparent);
    transform: translateY(-50%);
}
.gilded-divider::before {
    left: 0;
    right: 50%;
    margin-right: 14px;
}
.gilded-divider::after {
    right: 0;
    left: 50%;
    margin-left: 14px;
}
.gilded-divider > .diamond {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 14px;
    transform: translate(-50%, -50%) rotate(45deg);
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 60%, #6e5118 100%);
    box-shadow: 0 0 0 1px var(--ink), inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 2px rgba(0, 0, 0, 0.35);
}
.gilded-divider > .diamond::before,
.gilded-divider > .diamond::after {
    content: "";
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--gold);
    transform: rotate(-45deg);
    box-shadow: 0 0 0 1px rgba(60, 30, 12, 0.7);
}
.gilded-divider > .diamond::before {
    left: -18px;
    top: 5px;
}
.gilded-divider > .diamond::after {
    right: -18px;
    top: 5px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Marginalia - small italic note hugging the left or right margin
   ───────────────────────────────────────────────────────────────────────── */
.marginalia {
    font-family: "Cormorant Garamond", "EB Garamond", serif;
    font-style: italic;
    font-size: 12px;
    line-height: 1.4;
    color: var(--ink-faded);
    letter-spacing: 0.01em;
}
.marginalia--rotated {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

/* Torn edge - SVG turbulence displaces only the paper layer (::before).
   Content stays unfiltered and crisp. Box-shadow on ::before goes through
   the filter too, so the drop shadow follows the wavy silhouette. */
.torn-edges::before {
    border-radius: 0;
    filter: url(#wavy2);
}

/* Scroll variant - heavier curl shadows top + bottom, suggests paper rolling */
.scroll-edges {
    border-radius: 14px / 6px;
    box-shadow: inset 0 16px 28px -14px rgba(28, 12, 2, 0.75), inset 0 -16px 28px -14px rgba(28, 12, 2, 0.75), inset 0 0 110px rgba(50, 22, 4, 0.55), inset 0 0 28px rgba(28, 12, 2, 0.65),
        0 22px 36px -14px rgba(0, 0, 0, 0.6), 0 6px 12px rgba(0, 0, 0, 0.4);
}

/* Ink smudge - decorative, place inside .parchment with absolute coords */
.smudge {
    position: absolute;
    pointer-events: none;
    background: radial-gradient(closest-side, rgba(40, 25, 10, 0.45), transparent 70%);
    border-radius: 50%;
    filter: blur(1px);
    opacity: var(--smudge-opacity, 0.7);
}

/* ─────────────────────────────────────────────────────────────────────────
   Wax seal, brass pin, twine, iron rivet
   ───────────────────────────────────────────────────────────────────────── */
.seal {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #c2403c 0%, #8b1c1c 55%, #4a0a0a 100%);
    box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.45), inset 0 4px 8px rgba(255, 180, 160, 0.35), 0 4px 8px rgba(0, 0, 0, 0.35);
    display: grid;
    place-items: center;
    color: rgba(20, 0, 0, 0.7);
    position: relative;
}
.seal::before {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 1px dashed rgba(20, 0, 0, 0.45);
}
.seal--silver {
    background: radial-gradient(circle at 35% 30%, #d8d2c2 0%, #8e8674 55%, #3c362c 100%);
    color: rgba(40, 40, 40, 0.7);
}
.seal--gold {
    background: radial-gradient(circle at 35% 30%, #f1d18a 0%, #b89048 55%, #5a3e10 100%);
    color: rgba(60, 30, 0, 0.75);
}
.seal-text {
    font-family: "Cinzel", serif;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.04em;
    color: rgba(30, 0, 0, 0.75);
    text-shadow: 0 1px 0 rgba(255, 180, 160, 0.25);
}

.pin {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #f0d28a, #b88835 60%, #5a3e10 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), inset 0 -2px 2px rgba(0, 0, 0, 0.4);
    position: absolute;
}

.twine {
    height: 4px;
    background: repeating-linear-gradient(90deg, #6b4a26 0 6px, #4a3216 6px 12px);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.rivet {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #6c6258 0%, #2a2520 60%, #0e0c0a 100%);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.6), inset 0 -2px 2px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.15);
    position: absolute;
}

/* ─────────────────────────────────────────────────────────────────────────
   Filigree corners
   ───────────────────────────────────────────────────────────────────────── */
.filigree {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 1px solid var(--ink);
    pointer-events: none;
}
.filigree.tl {
    top: 12px;
    left: 12px;
    border-right: none;
    border-bottom: none;
}
.filigree.tr {
    top: 12px;
    right: 12px;
    border-left: none;
    border-bottom: none;
}
.filigree.bl {
    bottom: 12px;
    left: 12px;
    border-right: none;
    border-top: none;
}
.filigree.br {
    bottom: 12px;
    right: 12px;
    border-left: none;
    border-top: none;
}
.filigree::before {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    border: 1px solid var(--ink);
    transform: rotate(45deg);
}
.filigree.tl::before {
    top: -5px;
    left: -5px;
}
.filigree.tr::before {
    top: -5px;
    right: -5px;
}
.filigree.bl::before {
    bottom: -5px;
    left: -5px;
}
.filigree.br::before {
    bottom: -5px;
    right: -5px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Buttons
   ───────────────────────────────────────────────────────────────────────── */
.btn-ink,
.btn-ghost,
button.btn-ink,
button.btn-ghost {
    font-family: "IM Fell English SC", "Cinzel", serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 11px;
    padding: 10px 18px;
    cursor: pointer;
    line-height: 1;
    display: inline-block;
    transition: background 0.18s ease, color 0.18s ease;
}
.btn-ink {
    background: var(--ink);
    color: var(--vellum);
    border: 1px solid var(--ink);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
.btn-ink:hover {
    background: var(--wine-deep);
    color: var(--vellum);
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--ink);
}
.btn-ghost:hover {
    background: rgba(31, 26, 20, 0.08);
}

.btn-vellum {
    background: transparent;
    color: var(--vellum);
    border: 1px solid var(--vellum);
}
.btn-vellum:hover {
    background: rgba(241, 230, 207, 0.08);
    color: var(--vellum);
}

/* ─────────────────────────────────────────────────────────────────────────
   Tab strip
   ───────────────────────────────────────────────────────────────────────── */
.tab-strip {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--ink);
}
.tab-strip .tab {
    font-family: "IM Fell English SC", serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 11px;
    padding: 10px 20px;
    cursor: pointer;
    color: var(--ink-faded);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    text-decoration: none;
}
.tab-strip .tab:hover {
    color: var(--ink);
}
.tab-strip .tab.active {
    color: var(--ink);
    border-bottom-color: var(--wine-deep);
}

/* Tab strip on dark wood (used for header / gallery navs) */
.tab-strip--dark {
    border-bottom-color: var(--vellum-deep);
}
.tab-strip--dark .tab {
    color: rgba(241, 230, 207, 0.75);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}
.tab-strip--dark .tab:hover {
    color: var(--gold-light);
}
.tab-strip--dark .tab.active {
    color: var(--gold-light);
    border-bottom-color: var(--gold-light);
}

/* ─────────────────────────────────────────────────────────────────────────
   Field rows (definition list)
   ───────────────────────────────────────────────────────────────────────── */
.field-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dotted rgba(60, 40, 20, 0.4);
    padding: 6px 0;
    font-family: "EB Garamond", serif;
    font-size: 16px;
}
.field-row .key {
    font-family: "IM Fell English SC", serif;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 11px;
    color: var(--ink-faded);
    align-self: end;
}
.field-row .val {
    font-weight: 600;
    color: var(--ink);
}

/* ─────────────────────────────────────────────────────────────────────────
   Image / portrait placeholder
   ───────────────────────────────────────────────────────────────────────── */
.placeholder-img {
    background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.08) 0 8px, rgba(0, 0, 0, 0) 8px 16px), linear-gradient(180deg, #2a2018, #1a120c);
    display: grid;
    place-items: center;
    color: rgba(220, 200, 170, 0.5);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border: 1px solid rgba(60, 40, 20, 0.5);
}
.placeholder-vellum {
    background-image: repeating-linear-gradient(135deg, rgba(80, 55, 25, 0.18) 0 8px, rgba(80, 55, 25, 0) 8px 16px), linear-gradient(180deg, #e6d5b0, #c9b487);
    color: rgba(60, 40, 20, 0.65);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: grid;
    place-items: center;
}

/* ─────────────────────────────────────────────────────────────────────────
   Modal veil
   ───────────────────────────────────────────────────────────────────────── */
.modal-veil {
    position: fixed;
    inset: 0;
    background: radial-gradient(60% 60% at 50% 30%, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.85));
    display: grid;
    place-items: center;
    z-index: 1080;
    backdrop-filter: blur(2px);
}
.modal-veil[hidden] {
    display: none;
}

.modal-parchment {
    width: 460px;
    max-width: calc(100vw - 32px);
    padding: 40px;
    position: relative;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), inset 0 0 60px rgba(120, 80, 30, 0.22);
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-family: "Cinzel", serif;
    font-size: 22px;
    color: var(--ink);
    line-height: 1;
}

/* ─────────────────────────────────────────────────────────────────────────
   Inputs
   ───────────────────────────────────────────────────────────────────────── */
.input-ink,
input.input-ink,
textarea.input-ink,
select.input-ink {
    display: block;
    width: 100%;
    margin-top: 6px;
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(60, 40, 20, 0.4);
    border-bottom: 2px solid var(--ink);
    padding: 10px 12px;
    font-family: "EB Garamond", serif;
    font-size: 16px;
    color: var(--ink);
    outline: none;
}
.input-ink:focus {
    background: rgba(255, 255, 255, 0.55);
    border-bottom-color: var(--wine-deep);
}

.label-ink {
    display: block;
    font-family: "IM Fell English SC", serif;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 10px;
    color: var(--ink-faded);
    margin-top: 12px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Top bar (navigation chrome on the wood)
   ───────────────────────────────────────────────────────────────────────── */
.codex-topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    padding: 18px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--vellum);
    border-bottom: 3px solid #000;
    box-shadow: inset 0 1px 0 rgba(255, 220, 180, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.85), 0 12px 28px -8px rgba(0, 0, 0, 0.85);
    /* Solid dark base first, then a subtle texture overlay. Guarantees readability
       even if the texture image fails to load. */
    background-color: #14100b;
    background-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.75)), url("../images/backgrounds/menu-pattern.jpg");
    background-repeat: repeat;
    background-size: auto, 320px 320px;
    gap: 24px;
    flex-wrap: wrap;
}

.codex-topbar .brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--vellum);
    text-decoration: none;
    border: none;
}
.codex-topbar .brand:hover {
    color: var(--vellum);
}
.codex-topbar .brand .mark {
    width: 26px;
    height: 26px;
    border: 1px solid var(--gold-light);
    transform: rotate(45deg);
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(216, 180, 106, 0.08);
}
.codex-topbar .brand .mark::after {
    content: "";
    position: absolute;
    inset: 4px;
    background: var(--gold-light);
}
.codex-topbar .brand .name {
    font-family: "UnifrakturCook", serif;
    font-size: 24px;
    line-height: 1;
    color: var(--gold-light);
    letter-spacing: 0.02em;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}
.codex-topbar .brand .tagline {
    font-family: "IM Fell English SC", serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 9px;
    color: rgba(241, 230, 207, 0.7);
    margin-top: 3px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

.codex-nav {
    display: flex;
    gap: 28px;
    align-items: center;
    flex-wrap: wrap;
}
.codex-nav a,
.codex-nav .navlink {
    font-family: "IM Fell English SC", "Cinzel", serif;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 11px;
    color: rgba(241, 230, 207, 0.85);
    padding-bottom: 4px;
    border-bottom: 1px solid transparent;
    cursor: pointer;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}
.codex-nav a:hover,
.codex-nav .navlink:hover {
    color: var(--gold-light);
    border-bottom-color: rgba(216, 180, 106, 0.5);
}
.codex-nav a.active {
    color: var(--gold-light);
    border-bottom-color: var(--gold-light);
}

.codex-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(241, 230, 207, 0.85);
    font-family: "IM Fell English SC", serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 10px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}
.codex-meta .divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.18);
}

/* ─────────────────────────────────────────────────────────────────────────
   Page chrome / footer
   ───────────────────────────────────────────────────────────────────────── */
.codex-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.codex-page {
    flex: 1 0 auto;
    padding: 32px 48px 64px;
}

@media (max-width: 900px) {
    .codex-topbar {
        padding: 14px 20px;
    }
    .codex-page {
        padding: 20px 16px 56px;
    }
    .codex-nav {
        gap: 16px;
    }
}

.codex-footer {
    padding: 22px 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(241, 230, 207, 0.6);
    border-top: 2px solid rgba(0, 0, 0, 0.7);
    box-shadow: inset 0 1px 0 rgba(255, 220, 180, 0.06), 0 -10px 22px -10px rgba(0, 0, 0, 0.6);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7)), url("../images/backgrounds/menu-pattern.jpg") repeat, #1c1410;
    background-size: auto, 320px 320px, auto;
    font-family: "IM Fell English SC", serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 10px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

/* ─────────────────────────────────────────────────────────────────────────
   Card system - replaces Bootstrap card visuals while keeping the markup
   ───────────────────────────────────────────────────────────────────────── */
.card {
    background: transparent;
    border: 0;
    color: var(--ink);
}
.card-header {
    background: transparent;
    border: 0;
    padding: 0 0 12px 0;
}
.card-body {
    padding: 0;
}

/* When you want the card to look like aged paper, add .card.parchment */
.card.parchment .card-header,
.card.parchment .card-body {
    padding: 0;
}
.card.parchment .card-body {
    color: var(--ink);
}

/* ─────────────────────────────────────────────────────────────────────────
   Bootstrap nav / dropdown overrides - so existing markup adopts the look
   ───────────────────────────────────────────────────────────────────────── */
.nav,
.navbar,
.navbar-nav {
    font-family: "IM Fell English SC", "Cinzel", serif;
}

.nav .nav-link,
.navbar .nav-link {
    font-family: "IM Fell English SC", "Cinzel", serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 11px;
    color: rgba(220, 210, 190, 0.75);
    padding: 8px 14px;
    border-bottom: 1px solid transparent;
}
.nav .nav-link:hover,
.navbar .nav-link:hover {
    color: var(--gold-light);
    border-bottom-color: rgba(216, 180, 106, 0.5);
}
.nav .nav-link.active,
.navbar .nav-link.active {
    color: var(--gold-light);
    border-bottom-color: var(--gold-light);
}

.dropdown-menu {
    border: 0;
    padding: 0;
    min-width: 220px;
}
.dropdown-menu:not(.parchment) {
    background: transparent;
}
.dropdown-menu .dropdown-item {
    font-family: "IM Fell English SC", serif;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 10px;
    color: var(--ink);
    padding: 10px 14px;
    border-bottom: 1px dotted rgba(60, 40, 20, 0.35);
    background: transparent;
}
.dropdown-menu .dropdown-item:last-child {
    border-bottom: 0;
}
.dropdown-menu .dropdown-item:hover {
    background: rgba(31, 26, 20, 0.08);
    color: var(--wine-deep);
    padding-left: 22px;
}
.dropdown-header {
    font-family: "UnifrakturCook", serif;
    color: var(--wine-deep);
    font-size: 18px;
    padding: 8px 14px 6px;
}
.dropdown-divider {
    border-top: 1px dotted rgba(60, 40, 20, 0.4);
    margin: 6px 0;
}

/* Wrap dropdown-menu in a .parchment to give it the aged-paper look */
.dropdown-menu.parchment {
    padding: 8px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Tables - dotted ledger rows on parchment
   ───────────────────────────────────────────────────────────────────────── */
.table {
    color: var(--ink);
}
.table th {
    font-family: "IM Fell English SC", serif;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 10px;
    color: var(--ink-faded);
    border-bottom: 1px solid var(--ink);
    padding: 10px 8px;
    background: transparent;
}
.table td {
    border-top: 0;
    border-bottom: 1px dotted rgba(60, 40, 20, 0.35);
    padding: 12px 8px;
    color: var(--ink);
    background: transparent;
}
.table tr:last-child td {
    border-bottom: 0;
}
.table-borderless td,
.table-borderless th {
    border: 0;
}

/* ─────────────────────────────────────────────────────────────────────────
   Horizontal rule - twine ribbon
   ───────────────────────────────────────────────────────────────────────── */
hr {
    height: 0;
    border: 0;
    border-top: 1px solid var(--ink);
    margin: 18px 0;
    opacity: 1;
    position: relative;
}
hr::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 10px;
    height: 10px;
    border: 1px solid var(--ink);
    background: var(--vellum);
}
hr.twine-rule {
    border: 0;
    height: 4px;
    background: repeating-linear-gradient(90deg, #6b4a26 0 6px, #4a3216 6px 12px);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
hr.twine-rule::after {
    display: none;
}
hr.dark {
    border-top-color: rgba(220, 210, 190, 0.25);
}
hr.dark::after {
    background: #1a0e07;
    border-color: rgba(220, 210, 190, 0.25);
}

/* ─────────────────────────────────────────────────────────────────────────
   Forms (Bootstrap form-control adoption)
   ───────────────────────────────────────────────────────────────────────── */
.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(60, 40, 20, 0.4);
    border-bottom: 2px solid var(--ink);
    border-radius: 0;
    color: var(--ink);
    font-family: "EB Garamond", serif;
    font-size: 16px;
    padding: 10px 12px;
}
.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(60, 40, 20, 0.5);
    border-bottom-color: var(--wine-deep);
    box-shadow: none;
    outline: none;
}
.form-label,
label {
    font-family: "IM Fell English SC", serif;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 10px;
    color: var(--ink-faded);
}
.form-check-input:checked {
    background-color: var(--wine-deep);
    border-color: var(--wine-deep);
}

/* ─────────────────────────────────────────────────────────────────────────
   List groups
   ───────────────────────────────────────────────────────────────────────── */
.list-group-item {
    background: transparent;
    border: 0;
    border-bottom: 1px dotted rgba(60, 40, 20, 0.35);
    color: var(--ink);
    padding: 12px 0;
}
.list-group-item:last-child {
    border-bottom: 0;
}

/* ─────────────────────────────────────────────────────────────────────────
   Decorative sigil cluster (used in section headings)
   ───────────────────────────────────────────────────────────────────────── */
.sigil {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: var(--ink-faded);
    font-family: "Cinzel", serif;
}
.sigil .ornament {
    font-size: 14px;
    opacity: 0.6;
}

/* ─────────────────────────────────────────────────────────────────────────
   Utility: opacity steps (kept for compatibility)
   ───────────────────────────────────────────────────────────────────────── */
.opacity-0 {
    opacity: 0 !important;
}
.opacity-1 {
    opacity: 0.1 !important;
}
.opacity-2 {
    opacity: 0.2 !important;
}
.opacity-3 {
    opacity: 0.3 !important;
}
.opacity-4 {
    opacity: 0.4 !important;
}
.opacity-5 {
    opacity: 0.5 !important;
}
.opacity-6 {
    opacity: 0.6 !important;
}
.opacity-7 {
    opacity: 0.7 !important;
}
.opacity-8 {
    opacity: 0.8 !important;
}
.opacity-9 {
    opacity: 0.9 !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   WoW-specific kept utilities (item quality, money, item icons)
   ───────────────────────────────────────────────────────────────────────── */
.wow-icon,
.iconblizzard {
    font-family: "Cinzel", "Helvetica Neue", Helvetica, sans-serif;
    position: relative;
    z-index: 0;
}
.wow-icon ins,
.iconblizzard ins {
    background-repeat: no-repeat;
    background-size: contain;
    display: block;
    position: absolute;
    z-index: 5;
}
.wow-icon del,
.iconblizzard del {
    background-repeat: no-repeat;
    display: block;
    left: 0;
    top: 0;
    position: absolute;
    z-index: 10;
}
.wow-icon {
    height: 44px;
    width: 44px;
}
.wow-icon ins {
    height: 36px;
    width: 36px;
    left: 4px;
    top: 4px;
    border-radius: 4px;
}
.wow-icon del {
    height: 44px;
    width: 44px;
    background-image: url(https://wow.zamimg.com/images/Icon/medium/border/default.png);
}

.moneygold,
.moneysilver,
.moneycopper {
    background: no-repeat right center;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}
.moneygold {
    -webkit-text-fill-color: #c89218;
}
.moneysilver {
    -webkit-text-fill-color: #8a8170;
}
.moneycopper {
    -webkit-text-fill-color: #a4541f;
}
.moneyfont {
    -webkit-text-stroke: 0.02em rgba(0, 0, 0, 0.3);
    font-family: "UnifrakturCook", "LifeCraft", serif;
    font-size: 1.2em;
    letter-spacing: 1px;
}

.item {
    font-family: "UnifrakturCook", "Morpheus", serif;
    font-weight: 700;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
    letter-spacing: 0.02em;
}
.poorItem {
    color: #6c6258;
}
.commonItem {
    color: var(--ink);
}
.uncommonItem {
    color: #1f7a14;
}
.rareItem {
    color: #1f5fb8;
}
.epicItem {
    color: #7f2eb8;
}
.legendaryItem {
    color: #c46a14;
}
.artifactItem {
    color: #a07a36;
}
.heirloomItem {
    color: #2f8fa8;
}

/* ─────────────────────────────────────────────────────────────────────────
   Two- and three-column ledger layouts (used by profile / shop pages)
   ───────────────────────────────────────────────────────────────────────── */
.ledger-3 {
    display: grid;
    grid-template-columns: minmax(0, 260px) minmax(0, 1fr) minmax(0, 320px);
    gap: 24px;
    align-items: start;
}
.ledger-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
    gap: 24px;
    align-items: start;
}
.ledger-stack {
    display: grid;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1100px) {
    .ledger-3,
    .ledger-2 {
        grid-template-columns: 1fr;
    }
}

/* ─────────────────────────────────────────────────────────────────────────
   Notice (banner / status bar - pinned aged paper)
   ───────────────────────────────────────────────────────────────────────── */
.notice {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 22px;
    position: relative;
}
.notice .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7a1d1d;
    box-shadow: 0 0 0 3px rgba(122, 29, 29, 0.25);
}
