:root {
  --bg: #13110D;
  --bg-hero: #0B0A07;
  --bg-panel: #1B1812;
  --ink: #ECE6DA;
  --ink-dim: #B8AE9C;
  --ink-faint: #857B6A;
  --gold: #D4AF62;
  --gold-dim: #8C7443;
  --rust: #9E3B33;
  --slate: #6F9A86;
  --rule: #332D23;
  --max-w: 42rem;
  --display: "Marcellus", "Palatino Linotype", Palatino, Georgia, serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 3px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
h1, h2, h3, .display { font-family: var(--display); font-weight: 400; letter-spacing: 0.01em; }
a { color: var(--gold); }
a:focus-visible, button:focus-visible, summary:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
img { max-width: 100%; display: block; }

/* ---------- buttons ---------- */
.btn { font: inherit; font-size: 0.95rem; color: var(--ink); background: var(--bg-panel); border: 1px solid var(--rule); border-radius: var(--r); padding: 0.55rem 1rem; cursor: pointer; }
.btn:hover { border-color: var(--gold-dim); }
.btn.primary { background: var(--gold-dim); border-color: var(--gold-dim); color: #10120b; font-weight: 600; }
.btn.primary:hover { background: var(--gold); }
.btn.small { font-size: 0.85rem; padding: 0.4rem 0.8rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- topbar — same two elements as every other section, no tabs ---------- */
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 1.25rem;
  padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
  background: var(--bg-panel);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 5;
}
.topbar .home { white-space: nowrap; font-family: var(--display); font-size: 1.2rem; text-decoration: none; color: var(--ink); }
.topbar .where { color: var(--ink-faint); font-size: 0.95rem; margin-left: auto; text-align: right; }

/* ---------- hero (index page) ---------- */
.hero { position: relative; overflow: hidden; background: var(--bg-hero); padding: 5rem 1.5rem 4rem; text-align: center; border-bottom: 1px solid var(--rule); }
.hero-beam { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.55; pointer-events: none; }
.hero-inner { position: relative; max-width: 38rem; margin: 0 auto; }
.hero-eyebrow { color: var(--ink-faint); font-size: 0.85rem; letter-spacing: 0.04em; margin-bottom: 1.1rem; }
.hero h1 { font-size: clamp(2.4rem, 7vw, 3.6rem); line-height: 1.05; margin: 0 0 1.4rem; color: var(--ink); }
.hero h1 em { color: var(--gold); font-style: italic; }
.hero-narrative { text-align: left; color: var(--ink-dim); font-size: 1rem; line-height: 1.8; }
.hero-narrative p { margin: 0 0 1.1rem; }
.hero-cry { margin-top: 2rem; font-family: var(--display); font-style: italic; font-size: 1.4rem; color: var(--gold); }
.hero-note { margin-top: 2.2rem; font-size: 0.92rem; color: var(--ink-faint); }

/* ---------- path (index list of the poems) ---------- */
.path { max-width: 46rem; margin: 0 auto; padding: 3rem 1.5rem 4rem; }
.path h2 { font-size: 1.5rem; margin-bottom: 1.2rem; }
.path ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.path li a {
  display: grid; grid-template-columns: 2.6rem 1fr; gap: 1rem; align-items: center;
  background: var(--bg-panel); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 1.1rem 1.3rem; text-decoration: none; color: var(--ink);
}
.path li a:hover { border-color: var(--gold-dim); }
.path .icon { width: 1.6rem; height: 1.6rem; stroke-width: 1.3; fill: none; }
.path .t { font-family: var(--display); font-size: 1.3rem; display: block; }
.path .d { color: var(--ink-dim); font-size: 0.92rem; }
.path li:nth-child(1) .icon { stroke: var(--gold); }
.path li:nth-child(2) .icon { stroke: var(--slate); }
.path li:nth-child(3) .icon { stroke: var(--rust); }

/* ---------- poem pages ---------- */
main.wrap { max-width: var(--max-w); margin: 0 auto; padding: 3.2rem 1.5rem 4rem; }
.poem-kicker { display: flex; align-items: center; gap: 0.6rem; color: var(--ink-faint); font-size: 0.88rem; margin-bottom: 0.6rem; }
.poem-kicker svg { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
main[data-accent="gold"] .poem-kicker svg, main[data-accent="gold"] .divider svg { stroke: var(--gold); }
main[data-accent="slate"] .poem-kicker svg, main[data-accent="slate"] .divider svg { stroke: var(--slate); }
main[data-accent="rust"] .poem-kicker svg, main[data-accent="rust"] .divider svg { stroke: var(--rust); }

h1.poem-title { font-size: 2.1rem; margin: 0 0 0.2rem; color: var(--ink); }
.german-title { font-style: italic; color: var(--ink-faint); font-weight: 400; }
.poem-meta { color: var(--ink-faint); font-size: 0.9rem; margin: 0 0 1.6rem; }
.context p { color: var(--ink-dim); margin: 0 0 1.1rem; }

.divider { display: flex; justify-content: center; margin: 2.3rem 0; }
.divider svg { width: 3.2rem; height: auto; stroke: var(--gold-dim); }

.poem { margin-bottom: 2rem; }
.poem p.stanza { margin: 0 0 1.5rem; color: var(--ink); }
.poem p.stanza:last-child { margin-bottom: 0; }
.translator-note { font-size: 0.86rem; font-style: italic; color: var(--ink-faint); margin: -0.8rem 0 1.8rem; }
sup.fn a { text-decoration: none; color: var(--gold); font-size: 0.72em; }

.endnotes { margin-top: 2.4rem; padding-top: 1.6rem; border-top: 1px dashed var(--rule); }
.endnotes h3 { font-size: 1.05rem; font-weight: 600; color: var(--ink-faint); margin: 0 0 0.9rem; font-family: var(--body); font-style: italic; }
.endnotes ol { margin: 0; padding-left: 1.3rem; color: var(--ink-dim); font-size: 0.95rem; }
.endnotes li { margin-bottom: 0.7rem; }
.endnotes a.back { font-size: 0.85em; margin-left: 0.3em; }

/* ---------- short answers — same structure/classes as Frankenstein's .sq ---------- */
.questions { margin-top: 2.6rem; }
.questions > h3 { font-size: 1.15rem; color: var(--ink); margin: 0 0 1.1rem; font-weight: 500; }
.hint { font-size: 0.95rem; color: var(--ink-faint); }
.sq { border-top: 1px solid var(--rule); padding: 1.3rem 0; }
.sq:first-of-type { border-top: 0; padding-top: 0.3rem; }
.sq label { display: block; font-weight: 700; margin-bottom: 0.5rem; max-width: 68ch; color: var(--ink); }
.sq .n { font-family: var(--display); color: var(--gold); font-weight: 400; margin-right: 0.35rem; }
textarea { width: 100%; min-height: 5.5rem; font-size: 1.02rem; font-family: var(--body); color: var(--ink); padding: 0.7rem; border: 1px solid var(--rule); border-radius: var(--r); resize: vertical; background: var(--bg); }
.sq .row { display: flex; gap: 0.8rem; align-items: center; margin-top: 0.5rem; flex-wrap: wrap; }
.reveal { margin-top: 0.8rem; padding: 0.9rem 1.1rem; border-radius: var(--r); background: var(--bg-panel); color: var(--ink-dim); }
.reveal p { margin: 0; }
.reveal b { color: var(--ink); }

.page-nav { display: flex; justify-content: space-between; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); font-size: 0.95rem; }
.page-nav a { text-decoration: none; }

/* ---------- the shared "Send to teacher" panel (.ce-* classes come from ../assets/send-panel.css) ---------- */
.ce-send { margin-top: 2.6rem; background: var(--bg-panel); border: 1px solid var(--rule); border-radius: var(--r); padding: 1.4rem 1.5rem; }
.ce-send h2 { font-size: 1.2rem; color: var(--ink); }
.ce-send p { color: var(--ink-dim); font-size: 0.92rem; }
.ce-sum { color: var(--ink) !important; }
.ce-fields input { background: var(--bg); border: 1px solid var(--rule); color: var(--ink); }
.ce-fields label { color: var(--ink-dim); }

/* ---------- synthesis / footer ---------- */
.synthesis { max-width: var(--max-w); margin: 0 auto; padding: 1rem 1.5rem 4rem; color: var(--ink-dim); }
.synthesis h2 { color: var(--ink); font-size: 1.6rem; margin-bottom: 1.1rem; }
.synthesis p { margin: 0 0 1.1rem; }
footer.site-footer { text-align: center; padding: 2rem 1.5rem calc(2rem + env(safe-area-inset-bottom, 0px)); color: var(--ink-faint); font-size: 0.85rem; border-top: 1px solid var(--rule); }

@media (max-width: 560px) {
  .topbar { padding: 0.65rem 1.1rem; }
  .hero { padding: 3.5rem 1.1rem 3rem; }
  main.wrap { padding: 2.2rem 1.1rem 3rem; }
  .path { padding: 2.2rem 1.1rem 3rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ================= Wilderness of Mirrors additions ================= */
.btn.primary { color: #0b1013; }
.hero-mirror { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.5; pointer-events: none; }
.hero-cry { color: var(--gold); }

/* poem with line numbers */
.poem.numbered p.stanza { counter-reset: none; }
.poem .ln { display: block; position: relative; padding-left: 2.6rem; }
.poem .ln[data-n]::before { content: attr(data-n); position: absolute; left: 0; width: 2rem; text-align: right; font-size: 0.72rem; color: var(--ink-faint); top: 0.35em; font-variant-numeric: tabular-nums; }
.poem .ln.indent { padding-left: 12rem; }
.poem .epigraph { font-style: italic; color: var(--ink-dim); margin: 0 0 1.8rem 2.6rem; }
.poem .epigraph .src { display: block; font-style: normal; font-size: 0.85rem; color: var(--ink-faint); margin-top: 0.3rem; }
@media (max-width: 560px) { .poem .ln.indent { padding-left: 5rem; } .poem { font-size: 0.98rem; } }
mark.key { background: rgba(185,199,208,0.16); color: inherit; padding: 0 0.15em; border-radius: 2px; }

/* gloss buttons inside text */
button.g { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  border-bottom: 1px dotted var(--gold-dim); line-height: inherit; text-align: inherit; }
button.g.ref { border-bottom: 1px solid rgba(160,69,58,0.75); }
button.g:hover, button.g[aria-expanded="true"] { color: var(--gold); border-bottom-color: var(--gold); }
.legend-g { font-size: 0.88rem; color: var(--ink-faint); margin: -0.6rem 0 1.6rem; }
.legend-g span { border-bottom: 1px dotted var(--gold-dim); }
.legend-g span.r { border-bottom: 1px solid rgba(160,69,58,0.75); }

.wm-card { position: absolute; z-index: 20; width: min(23rem, calc(100vw - 16px)); background: #221E17; color: var(--ink);
  border: 1px solid var(--gold-dim); border-radius: 6px; padding: 0.9rem 1rem 1rem; box-shadow: 0 10px 28px rgba(0,0,0,0.5); font-size: 0.95rem; line-height: 1.55; }
.wm-card h4 { margin: 0 1.6rem 0.35rem 0; font-family: var(--display); font-weight: 400; font-size: 1.15rem; color: var(--gold); }
.wm-card .kind { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.3rem; }
.wm-card p { margin: 0.35rem 0 0; color: var(--ink-dim); }
.wm-card .own { display: block; margin-top: 0.15rem; font-size: 0.95rem; color: var(--ink);
  font-family: "PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans SC","Noto Sans Thai","Leelawadee UI",Tahoma,system-ui,sans-serif; }
.wm-card .x { position: absolute; top: 0.35rem; right: 0.5rem; background: none; border: 0; color: var(--ink-faint); font-size: 1.3rem; cursor: pointer; line-height: 1; }
@media (max-width: 640px) { .wm-card { position: fixed; left: 8px !important; right: 8px; bottom: 8px; top: auto !important; width: auto; } }

/* content note */
.content-note { border-left: 3px solid var(--rust); background: var(--bg-panel); padding: 0.8rem 1rem; color: var(--ink-dim); font-size: 0.93rem; margin: 0 0 1.6rem; }
.content-note b { color: var(--ink); }

/* prose pages */
.prose h2 { font-size: 1.5rem; margin: 2.6rem 0 0.8rem; color: var(--ink); }
.prose p { color: var(--ink-dim); margin: 0 0 1.1rem; }
.prose p strong { color: var(--ink); }
.pull { margin: 1.6rem 0; padding: 0.9rem 1.2rem; border-left: 2px solid var(--gold-dim); font-family: var(--display); font-size: 1.15rem; color: var(--ink); background: var(--bg-panel); }
.pull .src { display: block; font-family: var(--body); font-size: 0.82rem; color: var(--ink-faint); margin-top: 0.4rem; }

/* timeline */
.timeline { list-style: none; margin: 1.2rem 0 2rem; padding: 0 0 0 1.2rem; border-left: 1px solid var(--rule); }
.timeline li { position: relative; margin: 0 0 1rem; color: var(--ink-dim); }
.timeline li::before { content: ""; position: absolute; left: -1.55rem; top: 0.55em; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--bg); border: 1px solid var(--gold-dim); }
.timeline .yr { display: block; font-family: var(--display); color: var(--gold); font-size: 1.05rem; }
.timeline li.p::before { border-color: var(--rust); background: var(--rust); }

/* two-column mirror */
.mirror2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; margin: 1.4rem 0 2rem; }
.mirror2 > div { background: var(--bg-panel); border: 1px solid var(--rule); border-radius: var(--r); padding: 1rem 1.1rem; }
.mirror2 h3 { margin: 0 0 0.5rem; font-size: 1.2rem; color: var(--ink); }
.mirror2 p { margin: 0 0 0.6rem; font-size: 0.93rem; color: var(--ink-dim); }
.mirror2 .tag { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
@media (max-width: 600px) { .mirror2 { grid-template-columns: 1fr; } }

/* clue cards: judge, then reveal */
.clues { display: grid; gap: 0.9rem; margin: 1.2rem 0 1rem; }
.clue { background: var(--bg-panel); border: 1px solid var(--rule); border-radius: var(--r); padding: 1rem 1.1rem; }
.clue .who { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.clue p { margin: 0.35rem 0 0.7rem; color: var(--ink); }
.clue .choice { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.clue .choice .btn[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.clue .after { margin-top: 0.8rem; padding-top: 0.7rem; border-top: 1px dashed var(--rule); color: var(--ink-dim); font-size: 0.93rem; }
.clue .after b { color: var(--ink); }

/* close-reading meanings */
.meanings { counter-reset: m; list-style: none; padding: 0; margin: 1rem 0 1.6rem; }
.meanings li { counter-increment: m; position: relative; padding: 0.6rem 0 0.6rem 2.2rem; border-top: 1px solid var(--rule); color: var(--ink-dim); }
.meanings li::before { content: counter(m); position: absolute; left: 0.3rem; top: 0.55rem; font-family: var(--display); color: var(--gold); }
.sources { font-size: 0.88rem; color: var(--ink-faint); }
.sources li { margin-bottom: 0.4rem; }
.topbar a.where { text-decoration: none; } .topbar a.where:hover { color: var(--gold); }

/* photos and videos */
figure.ph { margin: 1.4rem 0 1.8rem; }
figure.ph img { border: 1px solid var(--rule); border-radius: var(--r); filter: grayscale(0.15); }
figure.ph figcaption { font-size: 0.86rem; color: var(--ink-faint); margin-top: 0.5rem; line-height: 1.5; }
figure.ph.wide img { width: 100%; height: auto; }
figure.ph.side { float: right; width: 11rem; margin: 0.3rem 0 1rem 1.4rem; }
figure.ph.side img { width: 100%; height: auto; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.4rem 0 1.8rem; align-items: start; }
.pair figure.ph { margin: 0; }
.pair figure.ph img { width: 100%; height: auto; }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose h2 { clear: both; }
@media (max-width: 560px) { figure.ph.side { float: none; width: 60%; margin: 1rem 0 1.4rem; } }
.mirror2 figure.ph.col { margin: 0.2rem 0 0.9rem; } .mirror2 figure.ph.col img { width: 100%; height: 15rem; object-fit: cover; object-position: center 25%; }
/* hero: the poet and the spy side by side, same height */
.hero-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 30rem; margin: 0 auto 2rem; }
.hero-pair figure { margin: 0; }
.hero-pair img { width: 100%; height: 17rem; object-fit: cover; border: 1px solid var(--rule); border-radius: var(--r); filter: grayscale(1); }
.hero-pair figcaption { font-size: 0.82rem; color: var(--ink-faint); margin-top: 0.45rem; text-align: center; }
@media (max-width: 560px) { .hero-pair img { height: 12rem; } }

/* ---------- The Impostor's Ordeal: comparison tables and source quotes ---------- */
.cmp-wrap { overflow-x: auto; margin: 1.2rem 0 2rem; -webkit-overflow-scrolling: touch; }
table.cmp { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: 0.97rem; line-height: 1.5; }
table.cmp th, table.cmp td { text-align: left; vertical-align: top; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--rule); }
table.cmp thead th { font-family: var(--display); color: var(--gold); font-weight: normal; font-size: 1.05rem; }
table.cmp tbody th { color: var(--ink-dim); font-weight: 600; width: 22%; }
blockquote.src-quote { margin: 1rem 0 1.6rem; padding: 0.8rem 1.1rem; border-left: 3px solid var(--rust); background: color-mix(in srgb, var(--rust) 7%, transparent); }
blockquote.src-quote p { margin: 0 0 0.4rem; }
blockquote.src-quote .src { display: block; font-size: 0.85rem; color: var(--ink-dim); }
.warn { border: 1px solid var(--rule); border-left: 3px solid var(--gold); padding: 0.7rem 1rem; margin: 1.2rem 0; color: var(--ink-dim); }

/* colour artwork in this section: no grayscale */
.hero-pair img, figure.ph img { filter: none; }

/* ---------- full-text reader pages (gatsby/, bel-ami/) ---------- */
.novel .poem-kicker a { color: inherit; }
.novel-text p { color: var(--ink); font-size: 1.06rem; line-height: 1.75; margin: 0 0 1rem; }
.novel-text .epigraph { margin: 0 0 2rem 1.5rem; font-style: italic; color: var(--ink-dim); line-height: 1.7; }
.path.chapters { padding: 1rem 0 2rem; max-width: none; }
.path.chapters li a { grid-template-columns: 1fr auto; padding: 0.8rem 1.1rem; }
.path.chapters .t { font-size: 1.1rem; }
