/* ============================================================
   Default: LIGHT THEME — clean white for long-form reading
   ============================================================ */
:root {
    /* Brand v1 — Lapis & Ochre (light / reading theme) */
    --bg-deep:     #F4EFE3;
    --bg-soft:     #EFE8D9;
    --paper:       #FCF8EF;
    --panel:       #FCF8EF;
    --panel-soft:  #F7F1E4;
    --border:      #E4DBC8;
    --border-soft: #EFE7D6;
    --text:        #211E19;
    --text-dim:    #4D463A;
    --text-mute:   #6E6757;
    --accent:      #2A5184;
    --accent-deep: #1E3D66;
    --accent-soft: #E6EDF5;
    --ochre:       #A8742A;
    --ink:         #211E19;
    --danger:      #9a3a3a;
    --radius:      14px;
    --max:         1100px;
    --max-narrow:  820px;
    --font-serif:  "Spectral", Georgia, "Times New Roman", serif;
    --font-sans:   "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono:   "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ============================================================
   Inverted: DARK THEME — cinematic, for entry pages
   Add  <body class="theme-ink">  to opt in
   ============================================================ */
body.theme-ink {
    /* Brand v1 — dark / login theme */
    --bg-deep:     #14161D;
    --bg-soft:     #1C1F28;
    --paper:       #1C1F28;
    --panel:       #1C1F28;
    --panel-soft:  #20242E;
    --border:      #2A2E39;
    --border-soft: #232733;
    --text:        #ECE5D6;
    --text-dim:    #C3BCAD;
    --text-mute:   #9A9384;
    --accent:      #7CA6DA;
    --accent-deep: #7CA6DA;
    --accent-soft: rgba(124, 166, 218, 0.18);
    --ochre:       #C79A52;
    --ink:         #ECE5D6;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-deep);
    color: var(--text);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    line-height: 1.65;
    min-height: 100%;
}

/* Light reading background — clean, no texture */
body {
    background: var(--bg-deep);
}

/* Dark theme background — cinematic radial gradients */
body.theme-ink {
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(124, 166, 218, 0.10), transparent 60%),
        radial-gradient(900px 500px at 10% 110%, rgba(42, 81, 132, 0.10), transparent 60%),
        var(--bg-deep);
    background-attachment: fixed;
}

a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

.container        { max-width: var(--max);        margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: var(--max-narrow); margin: 0 auto; padding: 0 24px; }

/* ── Header ───────────────────────────────────────────────── */
.site-header {
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    position: sticky; top: 0; z-index: 10;
}
body.theme-ink .site-header { background: rgba(7, 8, 12, 0.6); }
.site-header .inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px; max-width: var(--max); margin: 0 auto;
}
.brand {
    font-family: var(--font-sans);
    font-size: 1.08rem; font-weight: 600;
    letter-spacing: 0.01em; color: var(--text);
}
.brand .dot { color: var(--accent); margin: 0 .35em; }

.lang-switch { display: flex; gap: 6px; align-items: center; }
.lang-switch a {
    color: var(--text-mute); font-size: .82rem;
    padding: 4px 10px; border-radius: 999px;
    border: 1px solid transparent;
    text-transform: uppercase; letter-spacing: 0.08em;
}
.lang-switch a.active {
    color: var(--accent-deep);
    border-color: var(--border);
    background: var(--accent-soft);
}
.lang-switch a:hover { text-decoration: none; color: var(--text); }
.lang-switch .sep { color: var(--border); }

.logout {
    margin-left: 14px; font-size: .82rem; color: var(--text-mute);
    border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px;
}
.logout:hover { color: var(--text); text-decoration: none; border-color: var(--text-dim); }

/* ── Hero (used on entry pages) ───────────────────────────── */
.hero {
    padding: 100px 0 80px;
    text-align: center;
}
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.32em;
    font-size: .72rem;
    color: var(--accent-deep);
    margin-bottom: 24px;
}
.hero h1 {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    line-height: 1.1;
    margin: 0 0 28px;
    letter-spacing: -0.02em;
    color: var(--ink);
}
.hero .lead {
    color: var(--text-dim);
    max-width: 720px;
    margin: 0 auto 40px;
    font-size: 1.07rem;
}
.cta {
    display: inline-block; padding: 14px 28px;
    background: var(--accent-deep);
    color: #fff;
    border-radius: 999px; font-weight: 600;
    letter-spacing: 0.02em;
    transition: transform .15s ease, box-shadow .15s ease;
}
body.theme-ink .cta { color: #1a1408; background: var(--accent); }
.cta:hover {
    text-decoration: none; transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(94, 72, 24, 0.22);
}
body.theme-ink .cta:hover { box-shadow: 0 12px 30px rgba(201, 168, 106, 0.25); }

.divider {
    width: 60px; height: 1px;
    background: var(--accent); opacity: .7;
    margin: 32px auto;
}

/* ── Sections ─────────────────────────────────────────────── */
section.block {
    padding: 64px 0;
    border-top: 1px solid var(--border-soft);
}
section.block h2 {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1.7rem;
    margin: 0 0 16px;
    color: var(--ink);
    letter-spacing: -0.01em;
}
section.block p { color: var(--text-dim); max-width: 720px; }

.pillars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 28px;
}
.pillar {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
body.theme-ink .pillar { box-shadow: none; }
.pillar h3 {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1.15rem; margin: 0 0 10px;
    color: var(--accent-deep);
}
.pillar p { margin: 0; color: var(--text-dim); font-size: .96rem; }

/* ── Table of contents (research index) ───────────────────── */
.toc {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin-top: 28px;
}
.toc-item {
    display: block;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    color: var(--text);
    transition: border-color .15s ease, transform .15s ease;
}
.toc-item:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.toc-item .num {
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--accent-deep);
    font-size: .72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.toc-item .ttl {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1.05rem;
    margin: 4px 0 6px;
    color: var(--ink);
    line-height: 1.35;
}
.toc-item .sum { color: var(--text-mute); font-size: .9rem; margin: 0; }
.toc-item.soon { opacity: .55; pointer-events: none; }
.toc-item.soon .ttl::after { content: ' · ' attr(data-soon); font-size: .7rem; color: var(--text-mute); letter-spacing: 0.08em; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--border-soft);
    text-align: center;
    padding: 30px 24px;
    color: var(--text-mute);
    font-size: .85rem;
    margin-top: 60px;
}

/* ── Login page ───────────────────────────────────────────── */
.auth-shell {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 40px 20px;
}
.auth-card {
    width: 100%; max-width: 420px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 44px 36px;
    box-shadow: 0 24px 60px rgba(94, 72, 24, 0.12);
}
body.theme-ink .auth-card {
    backdrop-filter: blur(14px);
    box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}
.auth-card .eyebrow { text-align: center; }
.auth-card h1 {
    font-family: var(--font-sans); font-weight: 600;
    font-size: 1.55rem; margin: 0 0 12px; text-align: center;
    color: var(--ink); letter-spacing: -0.01em;
}
.auth-card .intro {
    color: var(--text-dim); text-align: center;
    margin: 0 0 28px; font-size: .95rem;
}
.auth-card label {
    display: block; font-size: .78rem;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--text-mute); margin-bottom: 8px;
}
.auth-card input[type="password"] {
    width: 100%; padding: 14px 16px;
    border-radius: 10px; border: 1px solid var(--border);
    background: var(--paper); color: var(--text);
    font-size: 1rem; outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
body.theme-ink .auth-card input[type="password"] { background: rgba(0,0,0,0.35); }
.auth-card input[type="password"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.auth-card button {
    margin-top: 22px; width: 100%; padding: 14px;
    border-radius: 10px; border: 0;
    background: var(--accent-deep); color: #fff;
    font-weight: 600; font-size: 1rem; cursor: pointer;
    letter-spacing: 0.02em;
}
body.theme-ink .auth-card button { background: var(--accent); color: #1a1408; }
.auth-card button:hover { filter: brightness(1.08); }
.auth-card .error {
    background: rgba(154, 58, 58, 0.08);
    border: 1px solid rgba(154, 58, 58, 0.28);
    color: var(--danger);
    padding: 10px 14px; border-radius: 8px;
    font-size: .9rem; margin-bottom: 18px;
    text-align: center;
}
body.theme-ink .auth-card .error {
    background: rgba(217, 106, 106, 0.12);
    border-color: rgba(217, 106, 106, 0.35);
    color: #d96a6a;
}
.auth-card .lang-switch { margin-top: 26px; justify-content: center; }

.auth-card.auth-card-wide { max-width: 560px; }

/* ============================================================
   ACCESS REQUEST FORM — bespoke, refined layout
   ============================================================ */
.access-card {
    width: 100%;
    max-width: 600px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 48px 44px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}
body.theme-ink .access-card { backdrop-filter: blur(14px); }

.access-head {
    text-align: center;
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border-soft);
}
.access-head .eyebrow {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.32em;
    font-size: .68rem;
    font-weight: 600;
    margin-bottom: 16px;
}
.access-head h1 {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1.85rem;
    margin: 0 0 14px;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.access-head .lead {
    color: var(--text-dim);
    font-size: .95rem;
    line-height: 1.6;
    margin: 0 auto;
    max-width: 460px;
}

.access-form { display: flex; flex-direction: column; gap: 22px; }

.access-form .field { display: flex; flex-direction: column; }
.access-form .field-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}
.access-form label {
    display: block;
    font-size: .82rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--ink);
    text-transform: none;
}
body.theme-ink .access-form label { color: #e7e7ee; }
.access-form .tag {
    font-size: .65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
}
.access-form .tag.muted { color: var(--text-mute); }

.access-form input[type="text"],
.access-form input[type="email"],
.access-form input[type="tel"],
.access-form textarea {
    width: 100%;
    padding: 13px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
body.theme-ink .access-form input,
body.theme-ink .access-form textarea {
    background: rgba(0, 0, 0, 0.35);
    color: #e7e7ee;
}
.access-form input::placeholder,
.access-form textarea::placeholder {
    color: var(--text-mute);
    opacity: 1;
}
.access-form input:focus,
.access-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: rgba(255, 255, 255, 0.06);
}
body.theme-ink .access-form input:focus,
body.theme-ink .access-form textarea:focus { background: rgba(0,0,0,0.45); }
.access-form textarea { resize: vertical; min-height: 130px; }

.access-form .field-hint {
    margin: 6px 0 0;
    font-size: .78rem;
    color: var(--text-mute);
    line-height: 1.5;
}
.access-form .field-error {
    margin: 6px 0 0;
    font-size: .8rem;
    color: var(--danger);
    font-weight: 500;
}
.access-form .has-error input,
.access-form .has-error textarea {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(154, 58, 58, 0.12);
}

.access-form .field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
@media (max-width: 560px) {
    .access-form .field-grid { grid-template-columns: 1fr; gap: 22px; }
    .access-card { padding: 36px 24px; border-radius: 14px; }
    .access-head h1 { font-size: 1.55rem; }
}

.access-form .hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.access-form .actions {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}
.access-form .primary {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    border: 0;
    background: var(--accent);
    color: #1a1408;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: filter .15s ease, transform .1s ease, box-shadow .15s ease;
}
.access-form .primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 10px 28px rgba(201, 168, 106, 0.25);
}
.access-form .primary:active { transform: translateY(1px); }
.access-form .ghost,
.access-success .ghost {
    color: var(--text-mute);
    font-size: .85rem;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}
.access-form .ghost:hover,
.access-success .ghost:hover { color: var(--text); border-color: var(--border); text-decoration: none; }

.access-card .error {
    background: rgba(217, 106, 106, 0.12);
    border: 1px solid rgba(217, 106, 106, 0.35);
    color: #d96a6a;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: .9rem;
    margin-bottom: 18px;
    text-align: center;
}

/* Success state */
.access-success { text-align: center; padding: 12px 0; }
.access-success .check {
    width: 64px; height: 64px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    font-weight: 600;
    border: 1px solid var(--accent);
}
.access-success h1 {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1.85rem;
    margin: 0 0 16px;
    color: var(--ink);
    letter-spacing: -0.02em;
}
.access-success .lead {
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 500;
    margin: 0 0 16px;
}
.access-success .body {
    color: var(--text-dim);
    font-size: .95rem;
    line-height: 1.65;
    margin: 0 auto 28px;
    max-width: 420px;
}
.auth-card textarea {
    width: 100%; padding: 14px 16px;
    border-radius: 10px; border: 1px solid var(--border);
    background: var(--paper); color: var(--text);
    font-family: inherit; font-size: 1rem; outline: none;
    line-height: 1.55; resize: vertical;
    transition: border-color .15s ease, box-shadow .15s ease;
}
body.theme-ink .auth-card textarea { background: rgba(0,0,0,0.35); }
.auth-card textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.auth-card .field-error {
    color: var(--danger);
    font-size: .82rem;
    margin-top: 6px;
}
.auth-card .hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Access pitch (below login button) */
.access-pitch {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.access-pitch p {
    color: var(--text-dim);
    font-size: .92rem;
    line-height: 1.65;
    margin: 0 0 14px;
}
body.theme-ink .access-pitch p { color: var(--text-mute); }
.access-pitch .access-cta {
    display: inline-block;
    color: var(--accent-deep);
    font-weight: 600;
    font-size: .9rem;
    letter-spacing: 0.02em;
    padding: 8px 14px;
    border: 1px solid var(--accent-deep);
    border-radius: 999px;
    transition: background-color .15s ease, color .15s ease;
}
body.theme-ink .access-pitch .access-cta { color: var(--accent); border-color: var(--accent); }
.access-pitch .access-cta:hover {
    background: var(--accent-deep);
    color: #fff;
    text-decoration: none;
}
body.theme-ink .access-pitch .access-cta:hover { background: var(--accent); color: #1a1408; }

/* ============================================================
   BOOK / READING typography
   ============================================================ */
:root {
    --book-col:        680px;   /* main reading column */
    --book-line:       1.85;
    --book-body-size:  1.05rem;
}
body.reading { background: #ffffff; }
body.reading .container-narrow { max-width: var(--book-col); }

/* ============================================================
   RESEARCH PAGES — long-form article reading
   (uses default light theme; always white background)
   ============================================================ */

.article {
    padding: 70px 0 30px;
    border-bottom: 1px solid var(--border-soft);
}
.article-meta {
    display: flex; gap: 24px; flex-wrap: wrap;
    color: var(--text-mute); font-size: .82rem;
    letter-spacing: 0.06em;
    margin-bottom: 26px;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 16px;
}
.article-meta .crumb {
    text-transform: uppercase; color: var(--accent-deep); font-weight: 600;
}
.article h1 {
    font-family: var(--font-sans); font-weight: 700;
    font-size: clamp(1.85rem, 3.5vw, 2.6rem);
    line-height: 1.15; margin: 0 0 16px;
    color: var(--ink);
    letter-spacing: -0.02em;
}
.article .subtitle {
    font-family: var(--font-sans); font-weight: 400;
    font-size: 1.12rem; color: var(--text-dim);
    margin: 0 0 28px;
    line-height: 1.5;
}
.article .abstract {
    background: var(--panel-soft);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    padding: 22px 26px;
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 1.02rem;
}
.article .abstract strong { color: var(--ink); }

.article-body { padding: 50px 0 30px; }
.article-body h2 {
    font-family: var(--font-sans); font-weight: 700;
    font-size: 1.55rem; color: var(--ink);
    margin: 56px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-soft);
    letter-spacing: -0.015em;
}
.article-body h2:first-child { margin-top: 0; }
.article-body h3 {
    font-family: var(--font-sans); font-weight: 600;
    font-size: 1.15rem; color: var(--accent-deep);
    margin: 32px 0 10px;
    letter-spacing: -0.005em;
}
.article-body p, .article-body li {
    color: var(--text); font-size: var(--book-body-size);
    line-height: var(--book-line);
    font-weight: 400;
}
.article-body p { margin: 0 0 1.1em; }
.article-body p + p { margin-top: 0; }
/* Drop cap on the first paragraph after each h2 (book-style chapter opening) */
body.reading .article-body h2 + p::first-letter {
    font-family: var(--font-serif), Georgia, "Times New Roman", serif;
    font-weight: 500;
    font-size: 3.4em;
    line-height: 0.9;
    float: left;
    margin: 0.08em 0.12em 0 -0.04em;
    color: var(--accent-deep);
}
body.reading .article-body h2 {
    margin: 72px 0 22px;
    padding-bottom: 12px;
    font-size: 1.65rem;
}
body.reading .article-body h2:first-of-type { margin-top: 12px; }
body.reading .article-body h3 { margin-top: 38px; }
body.reading .article-body { padding: 36px 0 30px; }

/* Decorative section break (ornament) */
.article-body hr.ornament,
.article-body .ornament {
    border: 0;
    text-align: center;
    margin: 50px auto;
    color: var(--accent);
    font-size: 1.1rem;
    letter-spacing: 0.6em;
    display: block;
    height: auto;
}
.article-body hr.ornament::before { content: "· · ·"; color: var(--accent); }
.article-body ul, .article-body ol { padding-left: 22px; }
.article-body li + li { margin-top: 6px; }
.article-body blockquote {
    margin: 22px 0 22px 0;
    padding: 6px 0 6px 22px;
    border-left: 3px solid var(--accent);
    color: var(--text-dim);
    font-family: var(--font-sans);
    font-size: 1.05rem;
    line-height: 1.6;
}

.article-body sup.ref {
    font-size: .68em;
    color: var(--accent-deep);
    margin-left: 1px;
    font-weight: 600;
}
.article-body sup.ref a { color: inherit; text-decoration: none; }
.article-body sup.ref a:hover { text-decoration: underline; }

/* ============================================================
   Table of Contents — inline + sticky sidebar
   ============================================================ */
.article-toc {
    margin: 36px 0 0;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 26px;
}
.article-toc-head {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--accent-deep);
    font-weight: 600;
    margin-bottom: 14px;
}
.article-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 2;
    column-gap: 28px;
    column-rule: 1px solid var(--border-soft);
}
@media (max-width: 640px) { .article-toc-list { columns: 1; } }
.article-toc-list li {
    break-inside: avoid;
    margin: 0 0 10px;
    padding: 0;
}
.article-toc-list a {
    display: flex;
    gap: 12px;
    align-items: baseline;
    color: var(--text);
    text-decoration: none;
    padding: 4px 0;
    border-bottom: 1px dashed transparent;
    transition: border-color .15s, color .15s;
}
.article-toc-list a:hover {
    color: var(--accent-deep);
    border-bottom-color: var(--accent);
    text-decoration: none;
}
.article-toc-list .toc-num {
    font-family: var(--font-mono, monospace);
    font-size: .72rem;
    color: var(--text-mute);
    letter-spacing: 0.08em;
    min-width: 22px;
}
.article-toc-list .toc-text {
    font-size: .95rem;
    line-height: 1.4;
}

/* Sticky sidebar TOC (left rail), only on wide screens */
.sticky-toc {
    display: none;
}
@media (min-width: 1200px) {
    .sticky-toc {
        display: block;
        position: fixed;
        top: 130px;
        left: calc(50% - var(--book-col) / 2 - 260px);
        width: 220px;
        max-height: calc(100vh - 180px);
        overflow-y: auto;
        padding-right: 14px;
        font-size: .85rem;
        z-index: 5;
    }
    .sticky-toc-head {
        font-size: .65rem;
        text-transform: uppercase;
        letter-spacing: 0.22em;
        color: var(--text-mute);
        font-weight: 600;
        margin-bottom: 12px;
    }
    .sticky-toc ol {
        list-style: none;
        margin: 0;
        padding: 0;
        border-left: 1px solid var(--border);
    }
    .sticky-toc li { margin: 0; padding: 0; }
    .sticky-toc a {
        display: block;
        color: var(--text-mute);
        text-decoration: none;
        padding: 6px 12px;
        font-size: .82rem;
        line-height: 1.35;
        border-left: 2px solid transparent;
        margin-left: -1px;
        transition: color .15s, border-color .15s, background-color .15s;
    }
    .sticky-toc a:hover {
        color: var(--ink);
        text-decoration: none;
    }
    .sticky-toc a.is-current {
        color: var(--accent-deep);
        border-left-color: var(--accent);
        font-weight: 600;
        background: var(--accent-soft);
    }
}
/* Make h2 jump anchors land below the sticky top nav */
.article-body h2 { scroll-margin-top: 90px; }

/* ============================================================
   COMMENTS — margin marker + side panel
   ============================================================ */
body.reading .article-body [data-cid] {
    position: relative;
}
.comment-marker {
    position: absolute;
    top: 4px;
    right: -44px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-mute);
    font-size: .82rem;
    font-weight: 600;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s, color .15s, border-color .15s, transform .15s;
    z-index: 2;
}
[data-cid]:hover > .comment-marker { opacity: 1; }
.comment-marker.has-comments {
    opacity: 1;
    color: var(--accent-deep);
    border-color: var(--accent);
    background: var(--accent-soft);
}
.comment-marker:hover {
    color: var(--accent-deep);
    border-color: var(--accent);
    transform: scale(1.08);
}
@media (max-width: 900px) {
    .comment-marker { right: 4px; top: -6px; opacity: 1; background: rgba(255,255,255,0.9); }
    body.reading .article-body [data-cid] { padding-right: 36px; }
}

/* Side panel */
.comment-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 90vw;
    background: #fff;
    border-left: 1px solid var(--border);
    box-shadow: -16px 0 40px rgba(0,0,0,0.08);
    z-index: 1100;
    transform: translateX(100%);
    transition: transform .25s ease;
    display: flex;
    flex-direction: column;
}
.comment-panel.open { transform: translateX(0); }
.comment-panel-head {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.comment-panel-head .title {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--accent-deep);
    font-weight: 600;
}
.comment-panel-head .close {
    background: transparent;
    border: 0;
    color: var(--text-mute);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}
.comment-panel-head .close:hover { color: var(--ink); }
.comment-panel-quote {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-dim);
    font-size: .85rem;
    font-style: italic;
    background: var(--panel-soft);
    max-height: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.comment-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 24px;
}
.comment {
    padding: 14px 0;
    border-bottom: 1px solid var(--border-soft);
}
.comment:last-child { border-bottom: 0; }
.comment-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-size: .78rem;
    color: var(--text-mute);
}
.comment-meta .author { color: var(--ink); font-weight: 600; }
.comment-body {
    color: var(--text);
    font-size: .95rem;
    line-height: 1.6;
    white-space: pre-wrap;
}
.comment-empty {
    text-align: center;
    color: var(--text-mute);
    padding: 20px 0;
    font-size: .9rem;
}
.comment-form {
    border-top: 1px solid var(--border);
    padding: 18px 24px;
}
.comment-form textarea {
    width: 100%;
    min-height: 96px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: .92rem;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.comment-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.comment-form button {
    margin-top: 10px;
    width: 100%;
    padding: 10px;
    background: var(--accent-deep);
    color: #fff;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.comment-form button:hover { filter: brightness(1.1); }
.comment-form button:disabled { opacity: .5; cursor: wait; }
.comment-status {
    margin-top: 10px;
    font-size: .82rem;
    color: var(--text-mute);
    text-align: center;
}
.comment-status.error { color: var(--danger); }
.comment-status.success { color: #5a8e3a; }

/* Backdrop only on mobile to dim the page when panel open */
.comment-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.18);
    opacity: 0; pointer-events: none;
    transition: opacity .25s;
    z-index: 1099;
}
.comment-backdrop.open { opacity: 1; pointer-events: auto; }

/* Page tools (Print) — top-right of the article */
.page-tools {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 14px 0 0;
}
.page-tools button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-mute);
    font: inherit;
    font-size: .82rem;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: color .15s, border-color .15s, background-color .15s;
}
.page-tools button:hover {
    color: var(--accent-deep);
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* Fact list (museum, year, etc) */
.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 24px 0 8px;
}
.facts .f {
    background: var(--panel-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
}
.facts .f .k {
    font-size: .7rem; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--text-mute);
    margin-bottom: 6px;
}
.facts .f .v {
    font-family: var(--font-sans); font-weight: 600;
    font-size: 1rem;
    color: var(--ink); line-height: 1.4;
}
.facts .f .v small { color: var(--text-mute); font-family: var(--font-sans); font-size: .8rem; display: block; margin-top: 4px; }

/* Tablet figure */
.figure {
    margin: 36px 0;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
}
.figure img {
    display: block; max-width: 100%;
    margin: 0 auto;
    border-radius: 6px;
}
.figure figcaption {
    margin-top: 14px;
    color: var(--text-mute);
    font-size: .88rem;
    text-align: center;
    font-style: italic;
    line-height: 1.45;
}
.figure-pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

/* Transliteration / translation passage */
.passage {
    background: var(--panel-soft);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    margin: 28px 0;
    padding: 22px 26px;
}
.passage .passage-head {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 12px; margin-bottom: 14px;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 10px;
}
.passage .label {
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--accent-deep);
    font-size: .95rem;
    letter-spacing: -0.005em;
}
.passage .lines {
    font-family: var(--font-sans);
    font-size: .76rem;
    color: var(--text-mute);
    letter-spacing: 0.04em;
}
.passage .cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}
.passage .col .col-head {
    font-size: .68rem; letter-spacing: 0.18em;
    text-transform: uppercase; color: var(--text-mute);
    margin-bottom: 10px;
}
.passage .akkadian {
    font-family: var(--font-sans);
    font-style: italic;
    font-size: .95rem;
    color: var(--ink);
    white-space: pre-wrap;
    line-height: 1.7;
    background: #fff;
    border: 1px solid var(--border-soft);
    padding: 12px 14px;
    border-radius: 6px;
}
.passage .akkadian em { font-style: normal; font-weight: 500; color: var(--accent-deep); }
.passage .english {
    font-family: var(--font-sans);
    font-size: 1.02rem;
    color: var(--text);
    line-height: 1.7;
    white-space: pre-wrap;
}
.passage .english em { color: var(--accent-deep); font-style: italic; }
.passage .commentary {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
    color: var(--text-dim);
    font-size: .98rem;
    line-height: 1.7;
}
@media (max-width: 680px) {
    .passage .cols { grid-template-columns: 1fr; gap: 14px; }
}

/* Glossary */
.glossary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin-top: 20px;
}
.glossary .term {
    background: var(--panel-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
}
.glossary .term .word {
    font-family: var(--font-sans);
    font-weight: 600;
    font-style: italic;
    font-size: 1.05rem;
    color: var(--accent-deep);
}
.glossary .term .pos {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-mute);
    margin-left: 6px;
}
.glossary .term .def {
    margin-top: 8px;
    color: var(--text-dim);
    font-size: .95rem;
    line-height: 1.55;
}

/* Map */
.map-wrap {
    margin: 24px 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--panel-soft);
}
.map-wrap iframe {
    width: 100%;
    height: 440px;
    border: 0;
    display: block;
}
.coords {
    background: var(--accent-soft);
    border-top: 1px solid var(--border);
    padding: 12px 18px;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: .85rem;
    color: var(--accent-deep);
    display: flex; gap: 18px; flex-wrap: wrap;
}

/* References */
.references {
    background: var(--panel-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    margin-top: 24px;
}
.references ol {
    margin: 0;
    padding-left: 24px;
    counter-reset: ref;
}
.references li {
    color: var(--text);
    font-size: .95rem;
    line-height: 1.6;
    margin-bottom: 12px;
    scroll-margin-top: 90px;
}
.references li a {
    word-break: break-word;
    color: var(--accent-deep);
}

/* Top navigation bar (above article) */
.top-nav {
    border-bottom: 1px solid var(--border-soft);
    background: var(--panel-soft);
}
.top-nav-inner {
    max-width: var(--max-narrow);
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: .88rem;
}
.top-nav a {
    color: var(--text-dim);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background-color .15s ease, color .15s ease;
    text-decoration: none;
}
.top-nav a:hover {
    color: var(--accent-deep);
    background: var(--accent-soft);
    text-decoration: none;
}
.top-nav .position {
    color: var(--text-mute);
    font-size: .78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
}
.top-nav .disabled {
    visibility: hidden;
}
.top-nav .arrow {
    font-size: 1.1em;
    line-height: 1;
    display: inline-block;
}
.top-nav a strong {
    color: var(--ink);
    font-weight: 600;
}
@media (max-width: 640px) {
    .top-nav-inner { padding: 12px 18px; font-size: .82rem; }
    .top-nav .ttl-hide { display: none; }
}

/* Entity link (with hover tooltip) */
.entity {
    color: var(--text);
    border-bottom: 1px dashed var(--accent);
    text-decoration: none;
    cursor: help;
    transition: background-color .15s ease, color .15s ease;
    padding: 0 1px;
}
.entity:hover {
    color: var(--accent-deep);
    background: var(--accent-soft);
    text-decoration: none;
}

.entity-tip {
    position: fixed;
    z-index: 1000;
    max-width: 320px;
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.15);
    font-size: .92rem;
    line-height: 1.55;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .12s ease, transform .12s ease;
}
.entity-tip.show {
    opacity: 1;
    transform: translateY(0);
}
.entity-tip .tip-title {
    font-weight: 600;
    font-size: .95rem;
    color: var(--ink);
    margin-bottom: 6px;
}
.entity-tip .tip-body {
    color: var(--text-dim);
    font-size: .9rem;
}
.entity-tip .tip-more {
    display: inline-block;
    margin-top: 10px;
    font-size: .82rem;
    color: var(--accent-deep);
    font-weight: 600;
    letter-spacing: 0.02em;
}
.entity-tip .tip-more:hover { text-decoration: underline; }

/* Inline note */
.note {
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    margin: 22px 0;
    color: var(--text-dim);
    font-size: .96rem;
    line-height: 1.65;
}
.note strong { color: var(--ink); }

/* Page-to-page nav */
.page-nav {
    border-top: 1px solid var(--border-soft);
    padding: 50px 0 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.page-nav .nav-card {
    display: block;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    color: var(--text);
    transition: border-color .15s ease, transform .15s ease;
}
.page-nav .nav-card:hover {
    text-decoration: none;
    border-color: var(--accent);
    transform: translateY(-1px);
}
.page-nav .nav-card.next { text-align: right; }
.page-nav .nav-card .dir {
    font-size: .7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-deep);
}
.page-nav .nav-card .ttl {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1rem;
    color: var(--ink);
    margin-top: 6px;
}
.page-nav .nav-card.disabled {
    opacity: .35; pointer-events: none;
}

@media (max-width: 540px) {
    .hero { padding: 64px 0 40px; }
    section.block, .article-body { padding: 44px 0; }
    .article { padding: 50px 0 30px; }
    .site-header .inner { padding: 14px 18px; }
    .page-nav { grid-template-columns: 1fr; }
    .facts { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   PRINT — clean, book-like, A4/Letter
   ============================================================ */
@media print {
    @page { size: A4; margin: 22mm 18mm 22mm 18mm; }
    body, body.reading, body.theme-ink {
        background: #ffffff !important;
        color: #111 !important;
        font-size: 11pt;
        line-height: 1.55;
    }
    .site-header, .site-footer, .top-nav, .sticky-toc, .lang-switch, .logout,
    .page-tools, .entity-tip, .page-nav, .access-pitch, .map-wrap {
        display: none !important;
    }
    main, .container-narrow, .article, .article-body, section {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #fff !important;
    }
    .article h1 {
        font-size: 22pt;
        line-height: 1.18;
        margin: 0 0 8mm;
        color: #111;
    }
    .article .subtitle {
        font-size: 12pt;
        color: #444;
        font-style: italic;
        margin: 0 0 6mm;
    }
    .article .article-meta {
        font-size: 9pt;
        color: #666;
        border-bottom: 0.4pt solid #999;
        padding-bottom: 3mm;
        margin-bottom: 4mm;
    }
    .article .abstract {
        background: #fafafa !important;
        border: 0.4pt solid #ccc;
        border-left: 1.2pt solid #8a6a2b;
        padding: 4mm 5mm;
        font-size: 10pt;
        margin: 0 0 5mm;
    }
    .facts { display: block; margin: 0 0 5mm; }
    .facts .f {
        display: inline-block;
        margin: 0 5mm 2mm 0;
        padding: 0;
        background: none !important;
        border: 0;
    }
    .facts .f .k {
        font-size: 8pt;
        color: #666;
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }
    .facts .f .v { font-size: 10pt; color: #111; }

    .article-toc {
        background: #fafafa !important;
        border: 0.4pt solid #ccc !important;
        padding: 4mm 5mm;
        margin: 4mm 0 6mm;
        page-break-after: always;
    }
    .article-toc-head { font-size: 9pt; color: #666; }
    .article-toc-list { columns: 2; column-gap: 8mm; font-size: 9.5pt; }
    .article-toc-list a { color: #111 !important; }
    .article-toc-list a::after { content: leader('.') target-counter(attr(href), page); }

    .article-body h2 {
        font-size: 14pt;
        page-break-after: avoid;
        page-break-before: auto;
        border-bottom: 0.4pt solid #999;
        margin: 8mm 0 3mm;
        padding-bottom: 1mm;
    }
    .article-body h2:first-of-type { page-break-before: auto; }
    .article-body h3 { font-size: 12pt; page-break-after: avoid; margin: 5mm 0 2mm; color: #444; }
    .article-body p, .article-body li { font-size: 10.5pt; line-height: 1.5; orphans: 3; widows: 3; }
    .article-body p::first-letter { font-size: inherit !important; color: inherit !important; float: none !important; margin: 0 !important; }

    .passage {
        page-break-inside: avoid;
        background: #fafafa !important;
        border: 0.4pt solid #ccc !important;
        border-left: 1.2pt solid #8a6a2b !important;
        padding: 4mm 5mm;
    }
    .passage .akkadian { background: #fff !important; border: 0.4pt solid #ddd !important; padding: 2mm 3mm; }
    .passage .cols { display: block; }
    .passage .col { margin-bottom: 3mm; }

    .figure { page-break-inside: avoid; background: none !important; border: 0.4pt solid #ddd !important; padding: 2mm; }
    .figure img { max-width: 100%; }
    .figure figcaption { font-size: 9pt; color: #555; }

    .glossary { display: block; }
    .glossary .term { display: block; page-break-inside: avoid; margin-bottom: 3mm; padding: 2mm 3mm; background: #fafafa !important; }

    .references { page-break-before: always; background: #fff !important; padding: 0 !important; border: 0 !important; }
    .references ol li { font-size: 9pt; line-height: 1.45; }

    a, a:visited { color: #111 !important; text-decoration: none; }
    a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 7.5pt; color: #888; }
    a.entity::after, a[href^="/"]::after { content: ""; }

    .article-body { padding: 0 !important; }
}

/* ============================================================
   Brand v1 — Spectral headings (Direction A) + ochre eyebrow
   Appended last so it overrides the earlier Inter heading rules.
   ============================================================ */
.hero h1, .hero .lead,
.access-head h1, .access-success h1,
.auth-card h1, .auth-card .intro,
section.block h2,
.pillar h3,
.article h1, .article .subtitle,
.article-body h2, .article-body h3,
.nav-card .ttl {
    font-family: var(--font-serif);
}
.eyebrow { color: var(--ochre); }

/* Brand mark in the site header */
.site-header .brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 24px; height: 24px; color: var(--accent); flex: none; }
