/* Curse of Strahd: The Owlbear Chronicles
   Dark editorial theme with one blood-red accent. No web fonts or frameworks: a serif for display,
   the system sans for reading and UI. Colours meet WCAG AA on the backgrounds they sit on. */

:root {
  --bg: #121014;
  --surface: #1b181c;
  --surface-2: #232026;
  --line: #2e2a31;
  --text: #ece7e1;
  --muted: #a59d97;
  --accent: #c8213f;        /* links, active nav, chips: 4.6:1 on --bg */
  --accent-hi: #e04a63;
  --accent-deep: #8f1027;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.25);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 68ch;
  --header-h: 3.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.65 var(--sans);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent-hi); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: #ff7389; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: 0.005em; color: #f5f0ea; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); margin: 0.2rem 0 0.6rem; }
h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.75rem); margin: 2.4rem 0 0.8rem; }
h3 { font-size: 1.25rem; margin: 1.8rem 0 0.6rem; }
code { background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 5px; font-size: 0.9em; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--accent); color: #fff; padding: 0.4rem 0.8rem; border-radius: 6px; z-index: 10; }
.skip:focus { left: 0.5rem; }

/* Header: slim, sticky; on phones the menu folds into a <details> drop-down. */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: rgba(18, 16, 20, 0.88);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar { max-width: 74rem; margin: 0 auto; padding: 0 1.25rem; height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text); text-decoration: none; min-width: 0; }
.brand-mark { width: 0.85rem; height: 1.1rem; flex: none; background: var(--accent); clip-path: path("M7 0C5 5 0 8 0 13a7 7 0 0 0 14 0C14 8 9 5 7 0Z"); transform: scale(0.95); }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-toggle { position: absolute; opacity: 0; pointer-events: none; }
.menu-toggle:focus-visible + .menu-button { outline: 2px solid var(--accent-hi); border-radius: 6px; }
.menu-button { display: none; cursor: pointer; padding: 0.6rem 0.4rem; }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 1.25rem; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.2s, background 0.2s; }
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; } .menu-icon::after { top: 6px; }
.site-nav { display: flex; gap: 0.25rem; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; font-weight: 500; padding: 0.4rem 0.75rem; border-radius: 999px; transition: color 0.15s, background 0.15s; }
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: #fff; background: var(--accent-deep); }
@media (max-width: 719px) {
  .menu-button { display: block; }
  .site-nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 0.5rem 1rem 1rem; box-shadow: var(--shadow);
  }
  .site-nav a { padding: 0.7rem 0.9rem; font-size: 1.05rem; }
  .menu-toggle:checked ~ .site-nav { display: flex; }
  .menu-toggle:checked + .menu-button .menu-icon { background: transparent; }
  .menu-toggle:checked + .menu-button .menu-icon::before { transform: translateY(6px) rotate(45deg); }
  .menu-toggle:checked + .menu-button .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }
}

main { max-width: 74rem; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.eyebrow { margin: 0; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.eyebrow a { color: inherit; text-decoration: none; } .eyebrow a:hover { color: var(--text); }
.lede { font-size: 1.15rem; color: #cfc7c0; margin: 0.4rem 0 0; max-width: var(--measure); }
.page-head { margin: 1rem 0 2rem; }
.button {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none; font-weight: 600;
  padding: 0.65rem 1.2rem; border-radius: 999px; transition: background 0.15s, transform 0.15s;
}
.button:hover { background: var(--accent-hi); color: #fff; transform: translateY(-1px); }
.chip {
  display: inline-block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; color: #f2c6ce;
  background: rgba(200, 33, 63, 0.16); border: 1px solid rgba(200, 33, 63, 0.35); padding: 0.15rem 0.6rem; border-radius: 999px; text-decoration: none;
}
a.chip:hover { background: rgba(200, 33, 63, 0.3); color: #fff; }
.chip small { color: var(--muted); font-weight: 500; margin-left: 0.2rem; }

/* Home */
.hero {
  position: relative; overflow: hidden; padding: clamp(1.5rem, 4vw, 3rem); margin-bottom: 3rem;
  border-radius: calc(var(--radius) + 6px); border: 1px solid var(--line);
  background: radial-gradient(120% 140% at 100% 0%, rgba(143, 16, 39, 0.38), transparent 55%), var(--surface);
  box-shadow: var(--shadow);
}
.hero h1 { max-width: 22ch; } .hero h1 a { color: inherit; text-decoration: none; } .hero h1 a:hover { color: #fff; }
.glance-list { margin: 1.2rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.45rem; max-width: var(--measure); }
.glance-list li { padding-left: 1.1rem; position: relative; color: #d9d2cb; }
.glance-list li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--accent); }
.glance-list a { color: inherit; }
.hero-actions { margin: 1.6rem 0 0; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.year-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0.5rem; }
.year { font-family: var(--sans); font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 0.4rem; margin: 2.2rem 0 1rem; }

.card-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.card-grid.compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 0.75rem; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.card:hover { border-color: rgba(200, 33, 63, 0.55); background: var(--surface-2); transform: translateY(-2px); }
.card:focus-within { border-color: var(--accent-hi); }
.card h3, .card h4 { margin: 0.6rem 0 0.4rem; font-size: 1.15rem; }
.card.compact h3, .card-grid.compact h3 { margin-top: 0; font-size: 1.05rem; }
.stretched { color: var(--text); text-decoration: none; }
.stretched::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.stretched:focus-visible { outline: none; } .stretched:focus-visible::after { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.teaser { margin: 0; color: #c9c1ba; font-size: 0.95rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.82rem; }

/* Posts and wiki pages */
.post-head { max-width: 46rem; margin: 0.5rem auto 2rem; }
.pills { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pill { display: inline-block; font-size: 0.85rem; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); padding: 0.2rem 0.7rem; border-radius: 999px; text-decoration: none; }
.pill:hover { border-color: var(--accent); color: #fff; }
.prose, .post > section, .post > .source { max-width: 46rem; margin-left: auto; margin-right: auto; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose li { max-width: var(--measure); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: 0.3rem 0; }
.prose li::marker { color: var(--accent); }
.prose strong { color: #fff; }
.prose h2 { padding-top: 0.4rem; border-top: 1px solid var(--line); }
.prose img { display: block; margin: 1.5rem auto; border-radius: var(--radius); border: 1px solid var(--line); }
.prose blockquote {
  margin: 1.6rem 0; padding: 1rem 1.3rem; border-left: 3px solid var(--accent); background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0; font-family: var(--serif); font-size: 1.12rem; font-style: italic; color: #e8dfd6;
}
.prose blockquote p { margin: 0.3rem 0; }
.prose table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; font-size: 0.95rem; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 0.5rem 0.7rem; text-align: left; }
.prose th { color: var(--muted); font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.prose a.wiki-link { color: var(--text); text-decoration: underline dotted rgba(224, 74, 99, 0.7); text-underline-offset: 0.22em; }
.prose a.wiki-link:hover { color: #fff; text-decoration-style: solid; }
.callout.glance {
  background: linear-gradient(180deg, rgba(143, 16, 39, 0.16), rgba(143, 16, 39, 0.06)); border: 1px solid rgba(200, 33, 63, 0.35);
  border-radius: var(--radius); padding: 1rem 1.3rem 0.6rem; margin: 0 0 2rem;
}
.callout.glance h2, .callout.glance h3 { border: 0; margin: 0 0 0.4rem; padding: 0; font-size: 0.85rem; font-family: var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: #f2c6ce; }
.source { margin-top: 3rem; font-size: 0.9rem; }
.where-we-were, .appears-in { margin-top: 3rem; }
.where-we-were h2, .appears-in h2 { font-size: 1.3rem; }

/* Table of contents: collapsible above the text; a sticky sidebar on wide screens. */
.toc { max-width: 46rem; margin: 0 auto 2rem; }
.toc details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.7rem 1rem; }
.toc summary { cursor: pointer; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.toc ol { list-style: none; margin: 0.6rem 0 0.2rem; padding: 0; font-size: 0.92rem; }
.toc li { margin: 0.15rem 0; } .toc .toc-h3 { padding-left: 0.9rem; font-size: 0.86rem; }
.toc a { color: var(--muted); text-decoration: none; display: block; padding: 0.15rem 0.5rem; border-left: 2px solid transparent; }
.toc a:hover { color: var(--text); } .toc a.active { color: var(--text); border-left-color: var(--accent); }
@media (min-width: 1100px) {
  main.with-toc .post { display: grid; grid-template-columns: minmax(0, 46rem) 15rem; column-gap: 3.5rem; justify-content: center; }
  main.with-toc .post > * { grid-column: 1; margin-left: 0; margin-right: 0; }
  main.with-toc .post > .toc { grid-column: 2; grid-row: 1 / span 20; align-self: start; position: sticky; top: calc(var(--header-h) + 1.5rem); margin: 0; }
  main.with-toc .post > .toc details { background: none; border: 0; padding: 0; }
  main.with-toc .post > .toc summary { pointer-events: none; list-style: none; }
  main.with-toc .post > .toc summary::-webkit-details-marker { display: none; }
}

.pager { max-width: 46rem; margin: 3rem auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pager-card { display: flex; flex-direction: column; gap: 0.25rem; text-decoration: none; color: var(--text); }
.pager-card strong { font-family: var(--serif); font-size: 1.05rem; line-height: 1.3; }
.pager-card .muted { font-size: 0.85rem; }
.pager-card.next { text-align: right; grid-column: 2; }
@media (max-width: 600px) { .pager { grid-template-columns: 1fr; } .pager-card.next { grid-column: 1; grid-row: 1; } }

.session-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.session-list li { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.session-list a { color: var(--text); text-decoration: none; font-weight: 500; } .session-list a:hover { color: var(--accent-hi); }
.session-list time { color: var(--muted); font-size: 0.85rem; margin-left: 0.4rem; }
.session-list.numbered li { display: grid; grid-template-columns: 2.2rem 1fr; column-gap: 0.6rem; }
.session-list .num { grid-row: span 2; align-self: start; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; background: rgba(200, 33, 63, 0.16); color: #f2c6ce; font-size: 0.8rem; font-weight: 700; }
.session-list .route { grid-column: 2; color: var(--muted); font-size: 0.88rem; }

/* Wiki and search */
.filter input, .search-form input {
  width: 100%; max-width: 34rem; padding: 0.75rem 1rem; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
}
.filter input:focus, .search-form input:focus { outline: none; border-color: var(--accent-hi); box-shadow: 0 0 0 3px rgba(200, 33, 63, 0.25); }
.wiki-group { margin-top: 2rem; } .wiki-group h2 { font-size: 1.3rem; margin-bottom: 0.8rem; }
.results { list-style: none; padding: 0; display: grid; gap: 0.75rem; max-width: 50rem; }
.result h2 { font-size: 1.15rem; margin: 0.5rem 0 0.3rem; }
.result mark { background: rgba(200, 33, 63, 0.35); color: #fff; padding: 0 0.1em; border-radius: 3px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.post-list { list-style: none; padding: 0; }

/* Map: our drawing underneath, places and the red breadcrumb trail on top. */
main.wide { max-width: 80rem; }
.map-figure { position: relative; margin: 1rem 0 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #e6dcc0; box-shadow: var(--shadow); }
.map { display: block; width: 100%; height: auto; touch-action: pan-y; }
.map.zoomed { cursor: grab; touch-action: none; }
.map .pin { cursor: pointer; }
.map .pin-dot { fill: #2b1d12; stroke: #f4ead2; stroke-width: 1.5; }
.map .labels text { font: italic 600 13px var(--serif); fill: #2b1d12; stroke: #f1e7cd; stroke-width: 3.5px; paint-order: stroke; stroke-linejoin: round; }
.map .pin:hover .pin-dot, .map .pin:focus .pin-dot { fill: var(--accent); }

.map .crumb { fill: none; stroke: #b3122e; stroke-width: 1.7; stroke-dasharray: 1.5 4.5; stroke-linecap: round; opacity: 0.9; }
.map .crumb.offroad { stroke-dasharray: 1 7; opacity: 0.55; }
.map .crumb.faded { opacity: 0.22; }
.map .crumb.current, .map .crumb.latest { stroke-width: 3; stroke-dasharray: 5 4; opacity: 1; }
.map .marker circle { fill: #fff8ec; stroke: #b3122e; stroke-width: 1.3; }
.map .marker text { font: 700 6.5px var(--sans); fill: #8f1027; pointer-events: none; }
.map .marker:hover circle, .map .marker.latest circle, .map .marker.current circle { fill: #b3122e; }
.map .marker:hover text, .map .marker.latest text, .map .marker.current text { fill: #fff; }
.map .hidden, .map.no-trail .trail, .map.no-trail .markers { display: none; }
.map-zoom { position: absolute; top: 0.75rem; right: 0.75rem; z-index: 1; display: flex; flex-direction: column; gap: 0.35rem; }
.map-zoom button { width: 2.2rem; height: 2.2rem; border-radius: 10px; border: 1px solid rgba(43, 29, 18, 0.25); background: rgba(255, 250, 240, 0.92); color: #2b1d12; font: 600 1.2rem/1 var(--sans); cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.map-zoom button:hover { background: #fff; }
.map-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.5rem; font-size: 0.95rem; color: var(--muted); }
.map-controls input { accent-color: var(--accent); }
.trail-range input { vertical-align: middle; width: 11rem; }
.trail-range output { color: var(--text); font-weight: 600; }
.trail-now { margin: 0; flex-basis: 100%; min-height: 1.6em; color: var(--text); }
.place-panel { margin-top: 1rem; max-width: 40rem; }
.place-panel h2 { margin: 0.2rem 0 0.3rem; font-size: 1.35rem; }
.place-close { position: absolute; top: 0.5rem; right: 0.7rem; background: none; border: 0; color: var(--muted); font-size: 1.6rem; cursor: pointer; }
.trail-list { margin-top: 3rem; max-width: 50rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: #0e0c10; color: var(--muted); font-size: 0.9rem; }
.footer-inner { max-width: 74rem; margin: 0 auto; padding: 2rem 1.25rem 2.5rem; }
.footer-inner .brand-name { color: var(--text); margin: 0 0 0.4rem; }
.site-footer a { color: #d9cfc6; }
.legal { font-size: 0.78rem; max-width: 46rem; margin-top: 1rem; }

@media (max-width: 600px) {
  body { font-size: 17px; }
  main { padding-top: 1.25rem; }
  .map-figure { margin-left: -1.25rem; margin-right: -1.25rem; border-radius: 0; border-left: 0; border-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .card:hover, .button:hover { transform: none; }
}
@media print {
  :root { --bg: #fff; --surface: #fff; --text: #111; --muted: #555; --line: #ccc; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .site-header, .site-footer, .toc, .pager, .where-we-were, .map-controls, .skip { display: none !important; }
  .prose a { color: #111; } h1, h2, h3, .prose strong { color: #111; }
  .callout.glance, .prose blockquote { background: none; }
}
.map .labels { pointer-events: none; }
.session-list.numbered time { margin-left: 0; }
.chip.former { vertical-align: middle; font-family: var(--sans); font-size: 0.7rem; color: var(--muted); background: var(--surface-2); border-color: var(--line); }
h1 .chip.former { font-size: 0.8rem; }
.meta.player { margin-top: 0.1rem; }
