/* Nordhaven: the lodge theme.
   Same bones as the steward's professional site (dark bands, monospace kickers,
   card grids, a chapter sidebar), dressed for a hall at night: fjord slate,
   birch-bark parchment, ember amber and a thread of aurora green. */

:root {
  --bg-deep: #0c121b;
  --bg-surface: #121b27;
  --bg-surface-alt: #182435;
  --border: #26364b;
  --text-main: #e8e0cc;
  --text-muted: #a3a99f;
  --ember: #d0913e;
  --ember-glow: rgba(208, 145, 62, 0.28);
  --aurora: #67bb93;
  --aurora-glow: rgba(103, 187, 147, 0.25);
  --frost: #9cc3d5;
  --on-ember: #1a1208;
  --font-display: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --font-body: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-ui: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-tech: 'JetBrains Mono', 'Courier New', monospace;
  --font-rune: 'Noto Sans Runic', 'Segoe UI Historic', 'Segoe UI Symbol', serif;
  --radius: 6px;
}

html[data-mode='parchment'] {
  --bg-deep: #efe7d3;
  --bg-surface: #f6f0e1;
  --bg-surface-alt: #ebe1c9;
  --border: #cfc1a0;
  --text-main: #2a2318;
  --text-muted: #5d5444;
  --ember: #9a5a14;
  --ember-glow: rgba(154, 90, 20, 0.18);
  --aurora: #2f7a57;
  --aurora-glow: rgba(47, 122, 87, 0.15);
  --frost: #3d6f86;
  --on-ember: #fbf5e6;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1.06rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ember); text-decoration: none; }
a:hover { color: var(--text-main); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; color: var(--text-main); }
img, video { max-width: 100%; height: auto; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 820px; }
.text-center { text-align: center; }
.rune { font-family: var(--font-rune); }
.muted { color: var(--text-muted); }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ember); color: var(--on-ember); padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 10px; }

/* ---------- Top bar ---------- */
.nh-top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12, 18, 27, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
html[data-mode='parchment'] .nh-top { background: rgba(239, 231, 211, 0.94); }
.nh-top .container { display: flex; align-items: center; gap: 18px; min-height: 60px; position: relative; }
.nh-brand { display: flex; align-items: center; gap: 10px; color: var(--text-main); font-family: var(--font-display); font-size: 1.55rem; font-weight: 700; letter-spacing: 0.5px; }
.nh-brand .rune { color: var(--ember); font-size: 1.3rem; }
.nh-brand:hover { color: var(--ember); }
.nh-menu { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.nh-menu a {
  font-family: var(--font-tech); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-muted); padding: 7px 10px; border-radius: 20px; border: 1px solid transparent;
}
.nh-menu a:hover { color: var(--ember); border-color: var(--border); }
.nh-menu a[aria-current='page'] { color: var(--on-ember); background: var(--ember); }
.nh-tools { display: flex; gap: 6px; }
.icon-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 0.95rem;
}
.icon-btn:hover { color: var(--ember); border-color: var(--ember); }
.nh-burger { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; text-align: center;
  padding: 110px 20px 90px;
  background:
    radial-gradient(ellipse at 50% 130%, rgba(103, 187, 147, 0.16) 0%, transparent 60%),
    radial-gradient(ellipse at 20% -20%, rgba(156, 195, 213, 0.12) 0%, transparent 55%),
    var(--bg-deep);
  border-bottom: 1px solid var(--border);
}
.hero::before {
  content: ''; position: absolute; inset: 0; opacity: 0.05; pointer-events: none;
  background:
    repeating-linear-gradient(45deg, var(--text-main) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(-45deg, var(--text-main) 0 1px, transparent 1px 46px);
}
.hero > * { position: relative; }
.hero .kicker { margin-bottom: 14px; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.4rem); margin: 0 0 8px; text-shadow: 0 0 30px var(--ember-glow); }
.hero h2 { font-family: var(--font-tech); font-weight: 400; font-size: clamp(0.92rem, 2vw, 1.12rem); color: var(--ember); margin: 0 auto 18px; max-width: 760px; letter-spacing: 0.5px; line-height: 1.5; }
.hero p.lead { color: var(--text-muted); max-width: 680px; margin: 0 auto; font-size: 1.12rem; }
.hero-runes { font-family: var(--font-rune); color: var(--aurora); letter-spacing: 14px; opacity: 0.8; margin-bottom: 18px; font-size: 1.2rem; }
.doc-hero { padding: 76px 20px 56px; }
.doc-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); max-width: 900px; margin-left: auto; margin-right: auto; }
.doc-hero p.lead { font-style: italic; }

.kicker { font-family: var(--font-tech); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 3px; color: var(--aurora); }
.kicker a { color: var(--aurora); }
.kicker a:hover { color: var(--ember); }
.kicker .sep { color: var(--text-muted); opacity: 0.5; margin: 0 6px; }

/* ---------- Buttons ---------- */
.cta { margin-top: 32px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 11px 22px; border-radius: 4px; font-family: var(--font-tech);
  font-size: 0.78rem; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; transition: all 0.25s ease; cursor: pointer;
}
.btn-primary { background: var(--ember); color: var(--on-ember); border: 1px solid var(--ember); box-shadow: 0 0 16px var(--ember-glow); }
.btn-primary:hover { background: transparent; color: var(--ember); }
.btn-secondary { border: 1px solid var(--ember); color: var(--ember); background: transparent; }
.btn-secondary:hover { background: var(--ember); color: var(--on-ember); }
.btn-ghost { border: 1px solid var(--border); color: var(--text-muted); background: transparent; }
.btn-ghost:hover { border-color: var(--aurora); color: var(--aurora); }

/* ---------- Bands ---------- */
.band { padding: 76px 0; }
.band-light { background: var(--bg-surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.band-dark { background: var(--bg-deep); }
.band-title { font-size: 2.1rem; margin: 0 0 6px; }
.band-title i { color: var(--ember); font-size: 1.45rem; margin-right: 10px; }
.band-lead { color: var(--text-muted); max-width: 720px; margin: 0 0 34px; }
.band-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; }
.band-head .band-lead { margin: 0; }

/* ---------- Measure panel ---------- */
.measure { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.measure-cell { background: var(--bg-surface-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 16px; text-align: center; }
.measure-cell .label { font-family: var(--font-tech); font-size: 0.7rem; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); }
.measure-cell .big { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; color: var(--text-main); margin: 6px 0 2px; line-height: 1.15; }
.measure-cell .big.rune { font-family: var(--font-rune); font-size: 2.4rem; color: var(--ember); }
.measure-cell .sub { color: var(--text-muted); font-size: 0.9rem; }
.moon-disc { width: 54px; height: 54px; margin: 8px auto 4px; display: block; }
.measure-note { color: var(--text-muted); font-size: 0.85rem; margin-top: 14px; font-style: italic; }

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.card-grid.three { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--bg-surface-alt); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; transition: all 0.25s ease; position: relative;
}
.card:hover { border-color: var(--ember); transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); }
html[data-mode='parchment'] .card:hover { box-shadow: 0 10px 24px rgba(80, 60, 20, 0.18); }
.card-meta { font-family: var(--font-tech); font-size: 0.7rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--aurora); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-meta i { color: var(--ember); }
.card h3 { font-size: 1.42rem; margin: 10px 0 8px; }
.card h3 a { color: var(--text-main); }
.card h3 a::after { content: ''; position: absolute; inset: 0; }
.card:hover h3 a { color: var(--ember); }
.card p { color: var(--text-muted); font-size: 0.97rem; margin: 0 0 14px; }
.card-foot { margin-top: auto; font-family: var(--font-tech); font-size: 0.72rem; color: var(--text-muted); display: flex; justify-content: space-between; gap: 10px; }
.card-icon { font-size: 1.6rem; color: var(--ember); margin-bottom: 4px; }
.card.feature { border-left: 4px solid var(--ember); }
.card .card-links { position: relative; z-index: 2; margin-top: auto; }

.chip {
  display: inline-block; font-family: var(--font-tech); font-size: 0.7rem; letter-spacing: 1px; text-transform: uppercase;
  border: 1px solid var(--border); color: var(--text-muted); border-radius: 20px; padding: 4px 11px; margin: 0 6px 6px 0;
  background: transparent; cursor: pointer;
}
.chip:hover { color: var(--ember); border-color: var(--ember); }
.chip.on { background: var(--ember); color: var(--on-ember); border-color: var(--ember); }
.chip .n { opacity: 0.7; margin-left: 4px; }

/* Series list */
.series-list { list-style: none; padding: 0; margin: 0; }
.series-list li { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); }
.series-list li:first-child { border-top: 0; }
.series-list .part { font-family: var(--font-tech); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--ember); padding-top: 5px; }
.series-list a { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: var(--text-main); }
.series-list a:hover { color: var(--ember); }
.series-list .desc { color: var(--text-muted); font-size: 0.93rem; display: block; }
.series-list .len { font-family: var(--font-tech); font-size: 0.7rem; color: var(--aurora); margin-left: 6px; }

/* ---------- Article layout ---------- */
.doc-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 46px; align-items: start; padding-top: 50px; padding-bottom: 60px; }
.doc-layout.single { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
.doc-toc {
  position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto;
  background: var(--bg-surface-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 14px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.doc-toc h4 { margin: 0 0 10px; font-family: var(--font-tech); font-size: 0.76rem; letter-spacing: 2px; text-transform: uppercase; color: var(--ember); font-weight: 600; }
.doc-toc ul { list-style: none; margin: 0; padding: 0; }
.doc-toc li { margin: 0 0 7px; line-height: 1.35; }
.doc-toc li.lvl3 { padding-left: 12px; }
.doc-toc a { color: var(--text-muted); font-family: var(--font-ui); font-size: 0.85rem; }
.doc-toc li.lvl3 a { font-size: 0.8rem; }
.doc-toc a:hover, .doc-toc a.active { color: var(--ember); }
.doc-toc .toc-meta { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 10px; font-family: var(--font-tech); font-size: 0.7rem; color: var(--text-muted); line-height: 1.6; }
.doc-toc .toc-meta a { font-family: var(--font-tech); font-size: 0.7rem; }

.prose { min-width: 0; color: var(--text-main); }
.prose h1 { font-size: 2.3rem; margin: 0 0 0.5em; }
.prose h2 { font-size: 1.9rem; color: var(--ember); margin: 2.2em 0 0.6em; padding-bottom: 8px; border-bottom: 1px solid var(--border); scroll-margin-top: 80px; }
.prose h3 { font-size: 1.45rem; margin: 1.8em 0 0.5em; scroll-margin-top: 80px; }
.prose h4 { font-size: 1.2rem; margin: 1.5em 0 0.4em; color: var(--frost); scroll-margin-top: 80px; }
.prose > h1:first-child, .prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.15em; }
.prose strong { color: var(--text-main); font-weight: 600; }
.prose a { border-bottom: 1px dotted var(--ember-glow); }
.prose a:hover { border-bottom-color: var(--text-main); }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.prose li { margin: 0.3em 0; }
.prose li::marker { color: var(--ember); }
.prose hr { border: 0; height: 1px; margin: 2.8em auto; background: linear-gradient(90deg, transparent, var(--border) 20%, var(--border) 80%, transparent); position: relative; overflow: visible; }
.prose hr::after { content: '\16DF'; font-family: var(--font-rune); position: absolute; left: 50%; top: -0.8em; transform: translateX(-50%); background: var(--bg-deep); color: var(--ember); padding: 0 12px; font-size: 1rem; line-height: 1.6; }
.band-light .prose hr::after { background: var(--bg-surface); }
.prose blockquote { margin: 1.6em 0; padding: 14px 22px; background: var(--bg-surface-alt); border-left: 4px solid var(--aurora); border-radius: 0 var(--radius) var(--radius) 0; color: var(--text-main); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code { font-family: var(--font-tech); font-size: 0.85em; background: var(--bg-surface-alt); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; }
.prose pre {
  font-family: var(--font-tech); font-size: 0.83rem; line-height: 1.5; overflow-x: auto;
  background: #0a0f17; color: #e3d8bd; border: 1px solid var(--border); border-left: 3px solid var(--ember);
  border-radius: var(--radius); padding: 18px 20px; margin: 1.6em 0;
}
html[data-mode='parchment'] .prose pre { background: #e6dbc0; color: #2a2318; }
.prose pre code { background: none; border: 0; padding: 0; font-size: 1em; }
/* the measure boxes: plain-text code blocks become carved stone panels */
.prose .language-plaintext pre, .prose .language-text pre {
  background: linear-gradient(180deg, #141d2a, #0e151f);
  border: 1px solid var(--border); border-top: 3px solid var(--ember); border-left: 1px solid var(--border);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.25);
  color: #ecd9ae;
}
html[data-mode='parchment'] .prose .language-plaintext pre, html[data-mode='parchment'] .prose .language-text pre { background: #e6dbc0; color: #3a2c12; box-shadow: none; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 0.94rem; display: block; overflow-x: auto; font-family: var(--font-ui); }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--bg-surface-alt); color: var(--ember); font-family: var(--font-tech); font-size: 0.8em; text-transform: uppercase; letter-spacing: 1px; }
.prose tr:nth-child(even) td { background: rgba(24, 36, 53, 0.45); }
html[data-mode='parchment'] .prose tr:nth-child(even) td { background: rgba(207, 193, 160, 0.25); }
.prose img { border-radius: var(--radius); }
.prose figure { margin: 2em 0; }
.prose figcaption { color: var(--text-muted); font-size: 0.9rem; font-style: italic; text-align: center; margin-top: 8px; }
.prose .footnotes { font-size: 0.9rem; color: var(--text-muted); }
.prose p.rune-line { font-family: var(--font-rune); text-align: center; font-size: 1.9rem; letter-spacing: 18px; color: var(--ember); margin-top: 1.4em; }

.post-tags { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--border); }
.post-tags .label { font-family: var(--font-tech); font-size: 0.7rem; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); display: block; margin-bottom: 8px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 46px; }
.pager a {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-surface-alt); color: var(--text-main); font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; line-height: 1.3;
}
.pager a:hover { border-color: var(--ember); color: var(--ember); }
.pager a span { font-family: var(--font-tech); font-size: 0.7rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--aurora); font-weight: 400; }
.pager .next { text-align: right; grid-column: 2; }

.series-note {
  background: var(--bg-surface-alt); border: 1px solid var(--border); border-left: 4px solid var(--ember); border-radius: var(--radius);
  padding: 14px 18px; margin: 0 0 28px; font-size: 0.95rem; color: var(--text-muted);
}
.series-note strong { color: var(--text-main); }
.series-note ol { margin: 8px 0 0; padding-left: 1.4em; }
.series-note li.here a { color: var(--text-main); font-weight: 600; }

/* ---------- Science figures (kept from the old theme, re-coloured) ---------- */
.nh-sim-figure { margin: 2rem 0; text-align: center; }
.nh-sim-figure video, .nh-sim-figure img { width: 100%; max-width: 760px; border-radius: var(--radius); background: #000; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5); }
.nh-sim-figure figcaption { color: var(--text-muted); font-size: 0.92em; font-style: italic; margin: 0.6rem auto 0; max-width: 700px; line-height: 1.45; }
.nh-sim-hero { margin: 1.5rem 0 2rem; padding: 1rem; background: #05070b; border-radius: 8px; border: 1px solid var(--border); }
.nh-sim-hero video { box-shadow: none; }
.nh-sim-hero figcaption { color: #c9c9d1; }
.nh-sim-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem; margin: 1.5rem 0 0.5rem; }
.nh-sim-strip figure, .nh-sim-pair figure { margin: 0; text-align: center; }
.nh-sim-strip img, .nh-sim-pair img { width: 100%; border-radius: 4px; display: block; }
.nh-sim-strip figcaption, .nh-sim-pair figcaption { font-size: 0.82em; color: var(--text-muted); margin-top: 0.3rem; line-height: 1.3; }
.nh-sim-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin: 1.5rem 0 0.5rem; }
.nh-sim-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin: 1.5rem 0; }
.nh-sim-facts div { border: 1px solid var(--border); border-top: 3px solid var(--ember); background: var(--bg-surface-alt); border-radius: var(--radius); padding: 0.7rem 0.8rem; text-align: center; }
.nh-sim-facts b { display: block; font-size: 1.35em; color: var(--ember); font-family: var(--font-display); }
.nh-sim-facts span { font-size: 0.85em; color: var(--text-muted); }
.nh-sim-small img { max-width: 420px; }
.nh-sim-big video { max-width: 100%; }

/* ---------- Wheel ---------- */
.wheel-wrap { display: grid; grid-template-columns: minmax(280px, 460px) 1fr; gap: 44px; align-items: center; }
.wheel-svg { width: 100%; height: auto; display: block; overflow: visible; }
.wheel-svg .ring { fill: none; stroke: var(--border); stroke-width: 2; }
.wheel-svg .ring-inner { fill: var(--bg-surface-alt); stroke: var(--border); }
.wheel-svg .spoke { stroke: var(--border); stroke-width: 1; }
.wheel-svg .dark-half { fill: var(--frost); opacity: 0.07; }
.wheel-svg .node { fill: var(--bg-deep); stroke: var(--ember); stroke-width: 2; cursor: pointer; transition: all 0.2s; }
.wheel-svg .node.has { fill: var(--ember); }
.wheel-svg .node.sel { stroke: var(--aurora); stroke-width: 4; }
.wheel-svg g.turning:hover .node { stroke: var(--aurora); }
.wheel-svg g.turning { cursor: pointer; }
.wheel-svg g.turning:focus { outline: none; }
.wheel-svg g.turning:focus .node { stroke: var(--aurora); stroke-width: 4; }
.wheel-svg .lbl { fill: var(--text-main); font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.wheel-svg .now-hand { stroke: var(--aurora); stroke-width: 3; stroke-linecap: round; }
.wheel-svg .now-dot { fill: var(--aurora); }
.wheel-svg .center-rune { fill: var(--ember); font-family: var(--font-rune); font-size: 46px; }
.wheel-svg .center-txt { fill: var(--text-muted); font-family: var(--font-tech); font-size: 10px; letter-spacing: 2px; }
.wheel-svg .half-lbl { fill: var(--text-muted); font-family: var(--font-tech); font-size: 9px; letter-spacing: 3px; }
.wheel-panel h3 { font-size: 1.9rem; margin: 6px 0; }
.wheel-panel .glyph { font-family: var(--font-rune); color: var(--ember); font-size: 1.6rem; margin-left: 8px; }
.wheel-panel p { color: var(--text-muted); }
.wheel-panel ul { list-style: none; padding: 0; margin: 0; }
.wheel-panel li { padding: 10px 0; border-top: 1px solid var(--border); }
.wheel-panel li a { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--text-main); }
.wheel-panel li a:hover { color: var(--ember); }
.wheel-panel li small { display: block; color: var(--text-muted); font-family: var(--font-tech); font-size: 0.7rem; letter-spacing: 1px; text-transform: uppercase; }

/* ---------- Runes ---------- */
.aett { margin-bottom: 46px; }
.aett h2 { font-size: 1.7rem; margin: 0 0 16px; }
.aett h2 small { font-family: var(--font-tech); font-size: 0.72rem; color: var(--text-muted); letter-spacing: 2px; text-transform: uppercase; margin-left: 10px; font-weight: 400; }
.rune-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; }
.rune-tile {
  background: var(--bg-surface-alt); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 6px 12px; text-align: center; cursor: pointer; color: var(--text-main); font: inherit; transition: all 0.2s;
}
.rune-tile:hover, .rune-tile.sel { border-color: var(--ember); transform: translateY(-3px); }
.rune-tile.sel { box-shadow: 0 0 0 2px var(--ember-glow); }
.rune-tile .glyph { font-family: var(--font-rune); font-size: 2.4rem; line-height: 1; height: 2.6rem; display: flex; align-items: center; justify-content: center; color: var(--ember); }
.rune-tile .rname { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; display: block; margin-top: 4px; }
.rune-tile .gloss { font-family: var(--font-tech); font-size: 0.62rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); display: block; }
.rune-tile .count { display: inline-block; margin-top: 8px; font-family: var(--font-tech); font-size: 0.68rem; color: var(--aurora); }
.rune-tile.empty .glyph { color: var(--text-muted); opacity: 0.75; }
.rune-tile.empty .count { color: var(--text-muted); }
.rune-detail { margin-top: 16px; background: var(--bg-surface); border: 1px solid var(--border); border-left: 4px solid var(--ember); border-radius: var(--radius); padding: 18px 22px; }
.rune-detail[hidden] { display: none; }
.rune-detail .rd-head { display: flex; gap: 16px; align-items: center; }
.rune-detail .rd-glyph { font-family: var(--font-rune); font-size: 3.2rem; color: var(--ember); line-height: 1; }
.rune-detail h3 { margin: 0; font-size: 1.6rem; }
.rune-detail p { color: var(--text-muted); margin: 4px 0 0; }
.rune-detail ul { margin: 14px 0 0; padding-left: 1.2em; }
.rune-detail li { margin: 4px 0; }
.rune-detail li::marker { color: var(--ember); }

/* ---------- Archive / search ---------- */
.search-bar { display: flex; gap: 10px; margin-bottom: 18px; }
.search-bar input, .search-box input {
  flex: 1; background: var(--bg-surface-alt); border: 1px solid var(--border); color: var(--text-main);
  font-family: var(--font-ui); font-size: 1.05rem; padding: 12px 16px; border-radius: var(--radius);
}
.search-bar input:focus { outline: none; border-color: var(--ember); box-shadow: 0 0 0 3px var(--ember-glow); }
.filter-row { margin-bottom: 10px; }
.filter-row .label { font-family: var(--font-tech); font-size: 0.7rem; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); margin-right: 8px; }
.result-count { font-family: var(--font-tech); font-size: 0.76rem; color: var(--aurora); margin: 16px 0 10px; letter-spacing: 1px; }
.month-group h3 { font-size: 1.5rem; margin: 34px 0 10px; color: var(--ember); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.post-row { display: grid; grid-template-columns: 90px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.post-row .d { font-family: var(--font-tech); font-size: 0.76rem; color: var(--text-muted); padding-top: 5px; }
.post-row a.t { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; color: var(--text-main); }
.post-row a.t:hover { color: var(--ember); }
.post-row .m { font-family: var(--font-tech); font-size: 0.68rem; letter-spacing: 1px; text-transform: uppercase; color: var(--aurora); }
.post-row p { margin: 2px 0 0; color: var(--text-muted); font-size: 0.93rem; }
.post-row mark, .search-results mark { background: var(--ember-glow); color: inherit; border-radius: 2px; padding: 0 1px; }

.search-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(5, 8, 12, 0.78); padding: 9vh 16px 16px; }
.search-overlay[hidden] { display: none; }
.search-box { max-width: 720px; margin: 0 auto; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); overflow: hidden; }
.search-box input { width: 100%; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; font-size: 1.15rem; padding: 18px 20px; background: transparent; }
.search-box input:focus { outline: none; }
.search-results { max-height: 60vh; overflow-y: auto; padding: 6px 0; }
.search-results a { display: block; padding: 10px 20px; color: var(--text-main); border-left: 3px solid transparent; }
.search-results a:hover, .search-results a.hl { background: var(--bg-surface-alt); border-left-color: var(--ember); }
.search-results .st { font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; display: block; }
.search-results .sm { font-family: var(--font-tech); font-size: 0.68rem; color: var(--aurora); letter-spacing: 1px; text-transform: uppercase; }
.search-results .empty { padding: 16px 20px; color: var(--text-muted); }
.search-hint { padding: 10px 20px; border-top: 1px solid var(--border); font-family: var(--font-tech); font-size: 0.68rem; color: var(--text-muted); }

/* ---------- Press ---------- */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 26px; }
.book { display: grid; grid-template-columns: 124px 1fr; align-items: start; gap: 20px; background: var(--bg-surface-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: border-color 0.2s; }
.book:hover { border-color: var(--ember); }
.cover {
  aspect-ratio: 2 / 3; border-radius: 3px 6px 6px 3px; padding: 14px 10px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(160deg, var(--c1, #1d3b2f), var(--c2, #0c1a14)); border: 1px solid rgba(232, 224, 204, 0.18);
  box-shadow: inset 7px 0 10px rgba(0, 0, 0, 0.35), 4px 6px 14px rgba(0, 0, 0, 0.45); color: #f0e4c4; position: relative; overflow: hidden;
}
.cover::before { content: ''; position: absolute; inset: 6px; border: 1px solid rgba(208, 145, 62, 0.55); border-radius: 2px; pointer-events: none; }
.cover .ct { font-family: var(--font-display); font-weight: 700; font-size: 0.98rem; line-height: 1.1; text-align: center; position: relative; }
.cover .cr { font-family: var(--font-rune); font-size: 1.7rem; text-align: center; color: #e0aa55; position: relative; }
.cover .cp { font-family: var(--font-tech); font-size: 0.48rem; letter-spacing: 1.5px; text-transform: uppercase; text-align: center; position: relative; opacity: 0.85; }
.book h3 { margin: 0 0 4px; font-size: 1.4rem; }
.book .sub { font-style: italic; color: var(--text-muted); font-size: 0.92rem; margin: 0 0 8px; line-height: 1.4; }
.book p { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 12px; }
.book label { font-family: var(--font-tech); font-size: 0.68rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); display: block; margin-bottom: 4px; }
.book select { width: 100%; background: var(--bg-deep); color: var(--text-main); border: 1px solid var(--border); border-radius: 4px; padding: 8px; font-family: var(--font-ui); font-size: 0.9rem; margin-bottom: 8px; }
.book .ed-note { font-size: 0.84rem; color: var(--text-muted); margin-bottom: 12px; }
.book .btn { padding: 8px 14px; font-size: 0.7rem; }
.book .meta { font-family: var(--font-tech); font-size: 0.7rem; color: var(--aurora); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }

/* ---------- Manual ---------- */
.manual-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.manual-strip a { border: 1px solid var(--border); border-radius: 22px; padding: 8px 16px; font-family: var(--font-tech); font-size: 0.78rem; color: var(--text-muted); background: var(--bg-surface-alt); }
.manual-strip a:hover { color: var(--ember); border-color: var(--ember); }
.manual-strip a i { color: var(--ember); margin-right: 6px; }

/* ---------- Footer ---------- */
.nh-foot { background: var(--bg-deep); border-top: 1px solid var(--border); padding: 50px 0 40px; text-align: center; }
.nh-foot .foot-runes { font-family: var(--font-rune); color: var(--ember); letter-spacing: 12px; font-size: 1.3rem; }
.nh-foot nav { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin: 16px 0; }
.nh-foot nav a { font-family: var(--font-tech); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); }
.nh-foot nav a:hover { color: var(--ember); }
.nh-foot p { color: var(--text-muted); font-size: 0.88rem; margin: 6px 0; }
.nh-foot em { color: var(--text-main); }

/* ---------- Highlight (rouge), muted to the palette ---------- */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs { color: #7d8a8f; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kc { color: var(--ember); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sh { color: var(--aurora); }
.highlight .m, .highlight .mi, .highlight .mf { color: var(--frost); }
.highlight .na, .highlight .nt, .highlight .py { color: #d6b37c; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 30px; }
  .doc-toc { position: static; max-height: none; }
  .rune-grid { grid-template-columns: repeat(4, 1fr); }
  .wheel-wrap { grid-template-columns: 1fr; }
  .card-grid.three { grid-template-columns: 1fr 1fr; }
  .measure { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .nh-burger { display: inline-block; }
  .nh-menu { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; background: var(--bg-surface); border-bottom: 1px solid var(--border); padding: 10px 16px; }
  .nh-menu.open { display: flex; }
  .nh-tools { margin-left: auto; }
}
@media (max-width: 640px) {
  .hero { padding: 76px 18px 60px; }
  .band { padding: 54px 0; }
  .card-grid.three { grid-template-columns: 1fr; }
  .post-row { grid-template-columns: 1fr; gap: 2px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .book { grid-template-columns: 92px 1fr; gap: 14px; padding: 14px; }
  .book-grid { grid-template-columns: 1fr; }
  .nh-sim-pair { grid-template-columns: 1fr; }
  .nh-sim-facts { grid-template-columns: repeat(2, 1fr); }
  .series-list li { grid-template-columns: 1fr; gap: 2px; }
  .rune-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .measure-cell .big { font-size: 1.5rem; }
  .prose pre { font-size: 0.72rem; padding: 14px; }
}
@media print {
  .nh-top, .nh-foot, .doc-toc, .pager, .post-tags, .search-overlay { display: none !important; }
  body { background: #fff; color: #000; }
  .doc-layout { display: block; }
}

.book .book-size { display: inline-block; font-family: var(--font-tech); font-size: 0.72rem; color: var(--text-muted); margin-left: 10px; white-space: nowrap; vertical-align: middle; }
.prose h2 code, .prose h3 code, .prose h4 code { font-size: 0.72em; vertical-align: 0.12em; padding: 0 5px; }
.prose pre { scrollbar-width: thin; scrollbar-color: var(--ember) transparent; }
.prose pre::-webkit-scrollbar { height: 6px; }
.prose pre::-webkit-scrollbar-thumb { background: var(--ember-glow); border-radius: 3px; }
