/* ============================================================
   Default: LIGHT THEME — clean white for long-form reading
   ============================================================ */
:root {
    --bg-deep:     #ffffff;
    --bg-soft:     #f7f5f0;
    --paper:       #ffffff;
    --panel:       #ffffff;
    --panel-soft:  #faf8f3;
    --border:      #e3dccc;
    --border-soft: #efe9da;
    --text:        #1a1612;
    --text-dim:    #4a4338;
    --text-mute:   #877e6e;
    --accent:      #8a6a2b;
    --accent-deep: #5e4818;
    --accent-soft: #f5ecd6;
    --ink:         #16131b;
    --danger:      #9a3a3a;
    --radius:      14px;
    --max:         1100px;
    --max-narrow:  820px;
    --font-serif:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-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 {
    --bg-deep:     #07080c;
    --bg-soft:     #0d1018;
    --paper:       #0d1018;
    --panel:       rgba(16, 19, 28, 0.72);
    --panel-soft:  rgba(20, 23, 32, 0.6);
    --border:      rgba(255, 255, 255, 0.10);
    --border-soft: rgba(255, 255, 255, 0.06);
    --text:        #e7e7ee;
    --text-dim:    #b3b6c2;
    --text-mute:   #8a8fa3;
    --accent:      #c9a86a;
    --accent-deep: #c9a86a;
    --accent-soft: rgba(201, 168, 106, 0.18);
    --ink:         #f4f4f8;
}

* { 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(201, 168, 106, 0.08), transparent 60%),
        radial-gradient(900px 500px at 10% 110%, rgba(120, 100, 200, 0.06), 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; }

/* ============================================================
   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: 1.02rem;
    line-height: 1.75;
    font-weight: 400;
}
.article-body p + p { margin-top: 14px; }
.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; }

/* 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; }
}
