/* ==========================================================================
   Ritual Wiki
   Dark archival reading room: parchment type, brass accents, candle themes.
   Loaded after the HTML shell; no build-time dependencies.
   ========================================================================== */

:root,
[data-theme="ember"] {
  --bg: #0a0908;
  --bg-2: #0d0b09;
  --panel: #12100d;
  --panel-2: #18140f;
  --ink: #eadfc6;
  --ink-2: #d3c6ac;
  --dim: #9d9283;
  --faint: #6c6358;
  --line: #2a241d;
  --line-2: #3c3226;
  --acc: #d9ad4f;
  --acc-2: #f0cf86;
  --acc-soft: rgba(217, 173, 79, .12);
  --blood: #b0202f;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --max: 1180px;
  --r: 14px;
}

[data-theme="violet"] {
  --bg: #090811;
  --bg-2: #0c0a15;
  --panel: #110e1c;
  --panel-2: #171227;
  --ink: #e8e0f5;
  --ink-2: #cec4e2;
  --dim: #9d94b4;
  --faint: #6f6882;
  --line: #282240;
  --line-2: #393153;
  --acc: #b49bff;
  --acc-2: #d9ccff;
  --acc-soft: rgba(180, 155, 255, .13);
  --blood: #c02f7a;
}

[data-theme="moss"] {
  --bg: #070a08;
  --bg-2: #090d0a;
  --panel: #0e140f;
  --panel-2: #131b14;
  --ink: #e2e7d3;
  --ink-2: #c6cfb4;
  --dim: #929c86;
  --faint: #66705e;
  --line: #222c22;
  --line-2: #313d30;
  --acc: #a8bf72;
  --acc-2: #d3e39f;
  --acc-soft: rgba(168, 191, 114, .13);
  --blood: #a94a3c;
}

[data-theme="mist"] {
  --bg: #080a0c;
  --bg-2: #0a0d10;
  --panel: #0e1216;
  --panel-2: #13191f;
  --ink: #dde6ec;
  --ink-2: #c1ced8;
  --dim: #8d9aa6;
  --faint: #616c77;
  --line: #202a33;
  --line-2: #2f3b47;
  --acc: #8fc4d9;
  --acc-2: #c6e7f3;
  --acc-soft: rgba(143, 196, 217, .13);
  --blood: #b0505a;
}

[data-theme="red"] {
  --bg: #0b0707;
  --bg-2: #0e0909;
  --panel: #150d0d;
  --panel-2: #1c1010;
  --ink: #f0ddd4;
  --ink-2: #dcbfb2;
  --dim: #a98d83;
  --faint: #786058;
  --line: #321d1b;
  --line-2: #472724;
  --acc: #e0785f;
  --acc-2: #ffb59f;
  --acc-soft: rgba(224, 120, 95, .13);
  --blood: #c02434;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  background:
    radial-gradient(1000px 620px at 12% -12%, color-mix(in srgb, var(--acc) 8%, transparent), transparent 62%),
    radial-gradient(900px 680px at 102% 0%, color-mix(in srgb, var(--blood) 7%, transparent), transparent 56%),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .4;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, .016) 0 1px, transparent 1px 3px);
}

body > * { position: relative; z-index: 1; }

::selection { background: var(--acc); color: #14100a; }

[hidden] { display: none !important; }

img { max-width: 100%; }

a { color: var(--acc); text-underline-offset: 3px; }
a:hover { color: var(--acc-2); }

:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 3px; }

* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border: 3px solid var(--bg); border-radius: 99px; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: fixed;
  top: -60px; left: 16px;
  z-index: 100;
  padding: 10px 14px;
  border: 1px solid var(--acc);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  transition: top .15s ease;
}
.skip:focus { top: 12px; }

.progress {
  position: fixed;
  top: 0; left: 0;
  width: 0; height: 2px;
  z-index: 80;
  background: linear-gradient(90deg, var(--acc), var(--blood));
  transition: width .08s linear;
}

/* --------------------------------------------------------------- topbar --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 13px clamp(16px, 4vw, 34px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand-sigil { filter: drop-shadow(0 0 9px rgba(217, 173, 79, .28)); flex: none; }
.brand-copy b {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: .01em;
}
.brand-copy small {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}
.top-nav a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  color: var(--dim);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .02em;
  text-decoration: none;
}
.top-nav a:hover { color: var(--ink); border-color: var(--acc); }
.top-nav svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.top-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.top-nav + .top-tools { margin-left: 0; }

.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 38px; height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
}
.menu-btn span:not(.sr-only) { display: block; width: 100%; height: 1.5px; background: var(--ink-2); }
body.nav-open .menu-btn span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
body.nav-open .menu-btn span:nth-child(2) { opacity: 0; }
body.nav-open .menu-btn span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
.menu-btn span { transition: transform .2s ease, opacity .2s ease; }

/* ---------------------------------------------------------------- shell --- */
.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  align-items: start;
  gap: clamp(26px, 4vw, 54px);
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 34px);
}

.side {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 34px 4px 70px 0;
  overscroll-behavior: contain;
}

.side-block { margin-bottom: 28px; }

.side-label {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--acc);
}

.side-list { display: flex; flex-direction: column; gap: 2px; }

.side-art {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.3;
  text-decoration: none;
}
.side-art small {
  flex: none;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
}
.side-art:hover { color: var(--ink); background: var(--panel); border-color: var(--line); }
.side-art.on {
  color: var(--ink);
  background: var(--acc-soft);
  border-color: color-mix(in srgb, var(--acc) 38%, transparent);
  box-shadow: inset 2px 0 0 var(--acc);
}

.theme-row { display: flex; align-items: center; gap: 7px; }
.theme-dot {
  width: 22px; height: 22px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.theme-dot span { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); transition: background .15s ease; }
.theme-dot[data-theme-btn="ember"] span { background: #d9ad4f; }
.theme-dot[data-theme-btn="violet"] span { background: #b49bff; }
.theme-dot[data-theme-btn="moss"] span { background: #a8bf72; }
.theme-dot[data-theme-btn="mist"] span { background: #8fc4d9; }
.theme-dot[data-theme-btn="red"] span { background: #e0785f; }
.theme-dot:hover { border-color: var(--dim); }
.theme-dot.on { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-soft); }

.side-note {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.65;
}
.side-note a { color: var(--dim); }

.scrim { display: none; }

.main { min-width: 0; padding: 34px 0 90px; }

/* ----------------------------------------------------------------- hero --- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, .85fr);
  align-items: center;
  gap: clamp(24px, 5vw, 54px);
  padding: clamp(18px, 4vw, 44px) 0 clamp(28px, 5vw, 52px);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--acc);
}

.hero h1 {
  margin: 12px 0 16px;
  font-family: var(--serif);
  font-size: clamp(54px, 9vw, 98px);
  font-weight: 400;
  line-height: .9;
  letter-spacing: -.025em;
}

.lede {
  max-width: 58ch;
  margin: 0;
  color: var(--ink-2);
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.65;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 30px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 10px 16px;
  border: 1px solid var(--acc);
  border-radius: 8px;
  background: var(--acc);
  color: #14100a;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:hover { background: var(--acc-2); border-color: var(--acc-2); color: #14100a; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn.ghost:hover { color: var(--ink); border-color: var(--acc); background: var(--acc-soft); }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin: 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}
.stats div { display: flex; flex-direction: column; gap: 5px; }
.stats dt {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}
.stats dd { margin: 0; font-family: var(--serif); font-size: 24px; line-height: 1; color: var(--ink); }

.hero-art { display: grid; justify-items: center; gap: 18px; }
.orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: min(280px, 82%);
  aspect-ratio: 1;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  animation: breathe 9s ease-in-out infinite;
}
.orbit::before {
  content: "";
  position: absolute;
  inset: 11%;
  border: 1px dashed var(--line-2);
  border-radius: 50%;
  animation: spin 80s linear infinite;
}
.orbit::after {
  content: "";
  position: absolute;
  inset: -9%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--acc-soft), transparent 62%);
  z-index: -1;
}
.orbit img { filter: drop-shadow(0 0 26px rgba(217, 173, 79, .22)); }
.orbit i {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 12px var(--acc);
}
.orbit i:nth-of-type(1) { top: 6%; left: 50%; }
.orbit i:nth-of-type(2) { bottom: 14%; left: 4%; }
.orbit i:nth-of-type(3) { right: 9%; bottom: 22%; }
.hero-art p {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
  color: var(--faint);
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.015); } }

/* ---------------------------------------------------------------- index --- */
.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 48px 0 18px;
}
.sec-head h2 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 400;
  line-height: 1;
}
.count {
  margin: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

.find {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.find-input {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1 1 280px;
  max-width: 440px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.find-input:focus-within { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-soft); }
.find-input svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--faint); stroke-width: 1.7; }
.find-input input {
  flex: 1;
  min-width: 0;
  padding: 11px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  outline: none;
}
.find-input input::placeholder { color: var(--faint); }
.find-input kbd {
  flex: none;
  padding: 2px 5px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
}

.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}
.pill:hover { color: var(--ink); border-color: var(--line-2); }
.pill.on { background: var(--acc); border-color: var(--acc); color: #14100a; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 22px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(160deg, var(--panel-2), var(--bg-2));
  color: inherit;
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--acc), transparent);
  opacity: 0;
  transition: opacity .2s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--acc) 45%, var(--line));
  box-shadow: 0 18px 38px -26px rgba(0, 0, 0, .9);
  color: inherit;
}
.card:hover::before { opacity: 1; }
.card-num {
  position: absolute;
  top: 12px; right: 16px;
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1;
  color: color-mix(in srgb, var(--acc) 24%, transparent);
}
.card-kicker {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--acc);
}
.card h2 {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 400;
  line-height: 1.05;
}
.card p { flex: 1; margin: 0; color: var(--dim); font-size: 13px; line-height: 1.6; }
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
}

.empty {
  margin: 26px 0;
  padding: 26px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
  color: var(--dim);
  font-size: 13.5px;
  text-align: center;
}

.about-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(24px, 4vw, 42px);
  margin-top: 54px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 72%, transparent);
}
.about-strip h2 {
  margin: 6px 0 12px;
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 400;
  line-height: 1.05;
}
.about-strip p { margin: 0 0 18px; color: var(--dim); font-size: 13.5px; line-height: 1.7; }
.principles { display: flex; flex-direction: column; gap: 13px; margin: 0; padding: 0; list-style: none; }
.principles li { position: relative; padding-left: 17px; color: var(--dim); font-size: 12.5px; line-height: 1.6; }
.principles li::before { content: "✦"; position: absolute; left: 0; color: var(--acc); }
.principles b { color: var(--ink-2); font-weight: 600; }

/* -------------------------------------------------------------- article --- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--faint);
}
.crumbs a { color: var(--dim); text-decoration: none; }
.crumbs a:hover { color: var(--acc); }

.entry-head { padding-bottom: 28px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.entry-head h1 {
  margin: 10px 0 16px;
  font-family: var(--serif);
  font-size: clamp(42px, 7vw, 74px);
  font-weight: 400;
  line-height: .94;
  letter-spacing: -.022em;
}
.entry-head .lede { max-width: 66ch; }

.kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .19em;
  text-transform: uppercase;
  color: var(--acc);
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0 0; padding: 0; list-style: none; }
.chips li {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  align-items: start;
  gap: clamp(26px, 4vw, 48px);
}
.entry-body { min-width: 0; }

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 36px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--line);
}
.facts > div { display: flex; flex-direction: column; gap: 5px; padding: 13px 15px; background: var(--panel); }
.facts dt {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
}
.facts dd { margin: 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.45; }

.entry-sec { margin: 0 0 36px; }
.entry-sec h2 {
  margin: 0 0 13px;
  font-family: var(--serif);
  font-size: clamp(26px, 3.4vw, 35px);
  font-weight: 400;
  line-height: 1.08;
}
.anchor {
  margin-left: 8px;
  color: var(--acc);
  font-family: var(--mono);
  font-size: .5em;
  vertical-align: middle;
  text-decoration: none;
  opacity: 0;
  transition: opacity .15s ease;
}
.entry-sec h2:hover .anchor, .anchor:focus-visible { opacity: .85; }

.entry-sec p { margin: 0 0 15px; color: var(--ink-2); font-size: 14.5px; line-height: 1.8; }
.entry-sec p a, .entry-body > p a { color: var(--acc); text-decoration-thickness: 1px; }
.entry-sec p a:hover { color: var(--acc-2); }

.entry-list { display: flex; flex-direction: column; gap: 9px; margin: 4px 0 18px; padding: 0; list-style: none; }
.entry-list li { position: relative; padding-left: 19px; color: var(--ink-2); font-size: 14px; line-height: 1.7; }
.entry-list li::before { content: "—"; position: absolute; left: 0; color: var(--acc); }
.entry-list strong { color: var(--ink); font-weight: 600; }

.see-also .see-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}
.see-also .see-card:hover { border-color: color-mix(in srgb, var(--acc) 45%, var(--line)); background: var(--panel-2); }
.see-card b { font-family: var(--serif); font-size: 22px; font-weight: 400; color: var(--ink); }
.see-card span { color: var(--dim); font-size: 12.5px; line-height: 1.55; }

.sources {
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
.sources p { color: var(--dim); font-size: 12.5px; line-height: 1.7; }
.source-list { display: flex; flex-direction: column; gap: 7px; margin: 12px 0 0; padding: 0; list-style: none; }
.source-list a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-2);
  font-size: 12.5px;
  text-decoration: none;
  border-bottom: 1px dotted var(--line-2);
  padding-bottom: 2px;
}
.source-list a:hover { color: var(--acc); border-color: var(--acc); }
.source-list svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.toc { position: sticky; top: 92px; font-size: 12px; }
.toc nav { border-left: 1px solid var(--line); }
.toc ol { display: flex; flex-direction: column; gap: 1px; margin: 0; padding: 0; list-style: none; }
.toc a {
  display: block;
  margin-left: -1px;
  padding: 6px 0 6px 12px;
  border-left: 1px solid transparent;
  color: var(--dim);
  line-height: 1.35;
  text-decoration: none;
}
.toc a:hover, .toc a.on { color: var(--ink); border-left-color: var(--acc); }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.pager-link { display: flex; flex-direction: column; gap: 5px; max-width: 46%; color: inherit; text-decoration: none; }
.pager-link small {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--acc);
}
.pager-link b { font-family: var(--serif); font-size: 23px; font-weight: 400; line-height: 1.1; color: var(--ink); }
.pager-link:hover b { color: var(--acc); }
.pager-link.next { margin-left: auto; text-align: right; }

.prose-page .entry-body { max-width: 760px; }
.prose-page .entry-sec h2 { font-size: clamp(25px, 3vw, 31px); }
.dim { color: var(--faint); }

.lost { max-width: 640px; padding: clamp(36px, 9vh, 110px) 0; }
.lost h1 {
  margin: 12px 0 14px;
  font-family: var(--serif);
  font-size: clamp(44px, 8vw, 72px);
  font-weight: 400;
  line-height: .96;
}

/* ---------------------------------------------------------------- footer --- */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 26px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 34px) 42px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11px;
}
.foot-mark { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-family: var(--serif); font-size: 18px; }
.foot p { flex: 1 1 320px; margin: 0; line-height: 1.6; }
.foot a { color: var(--dim); }
.foot-links { display: flex; gap: 15px; }

/* ------------------------------------------------------------- responsive --- */
@media (max-width: 980px) {
  .entry-grid { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; order: -1; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
  .toc nav { border-left: 0; }
  .toc ol { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }
  .toc a { padding: 4px 0; margin-left: 0; border-left: 0; }
  .toc a:hover, .toc a.on { border-left: 0; color: var(--acc); }
}

@media (max-width: 900px) {
  .top-nav { display: none; }
  .top-tools { margin-left: auto; }
  .menu-btn { display: flex; }

  .shell { display: block; padding: 0 18px; }

  .side {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 60;
    width: min(86vw, 320px);
    max-height: none;
    padding: 24px 20px 40px;
    overflow-y: auto;
    border-right: 1px solid var(--line);
    background: var(--panel);
    transform: translateX(-103%);
    transition: transform .25s ease;
  }
  body.nav-open .side { transform: none; }

  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(0, 0, 0, .62);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
  }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }

  .main { padding: 26px 0 70px; }

  .hero { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .hero-art { display: none; }
  .hero h1 { font-size: clamp(48px, 15vw, 76px); }

  .stats { gap: 20px; }
  .sec-head { margin-top: 38px; }
  .about-strip { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  .foot { flex-direction: column; align-items: flex-start; }
  .find { align-items: stretch; }
  .find-input { max-width: none; }
  .pills { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; scrollbar-width: none; }
  .pills::-webkit-scrollbar { display: none; }
  .pill { flex: none; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .entry-head h1 { font-size: clamp(38px, 12vw, 58px); }
  .pager { flex-direction: column; }
  .pager-link { max-width: none; }
  .pager-link.next { margin-left: 0; text-align: left; }
}

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