/* The Wrong Mountain — weathered expedition map. System fonts only. */
:root {
  --paper: #F2ECDF;
  --paper-2: #E9E1CF;
  --paper-3: #FAF6EC;
  --ink: #24302E;
  --ink-soft: #4A5552;
  --copper: #8A4A22;
  --copper-line: #B06A38;
  --contour: #CDBF9F;
  --moss: #3F5A47;
  --focus: #1D58BA;
  --halo: #FFFFFF;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
  --display: "Hoefler Text", "Baskerville", "Libre Baskerville", "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141A19;
    --paper-2: #1B2321;
    --paper-3: #1F2826;
    --ink: #EAE3D3;
    --ink-soft: #BDB5A5;
    --copper: #E8A67C;
    --copper-line: #C98458;
    --contour: #34413D;
    --moss: #9CC4A6;
    --focus: #9CC0FF;
    --halo: #000000;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1rem + 0.25vw, 1.2rem);
  line-height: 1.7;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(255,255,255,0.35), transparent 60%),
    radial-gradient(ellipse at 85% 75%, rgba(138,74,34,0.07), transparent 55%);
}
a { color: var(--copper); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; box-shadow: 0 0 0 6px var(--halo); border-radius: 3px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0; }
html:not(.js) .js-only { display: none !important; }
html.js .nojs-only { display: none !important; }

.wrap { max-width: 72rem; margin-inline: auto; padding-inline: clamp(1rem, 5vw, 2.5rem); }
.wrap-narrow { max-width: 42rem; margin-inline: auto; padding-inline: clamp(1rem, 5vw, 1.5rem); }

.eyebrow, .note-label, .card-no, .thesis-label, .principle-label, .meta, .nav-list a, .home-link {
  font-variant-caps: all-small-caps; letter-spacing: 0.09em; font-weight: 600;
}
.eyebrow { color: var(--copper); margin: 0 0 0.4rem; font-size: 1.05rem; }
.small { font-size: 0.9rem; color: var(--ink-soft); }

.skip-link { position: absolute; left: 1rem; top: -5rem; z-index: 60; background: var(--ink); color: var(--paper); padding: 0.7rem 1rem; border-radius: 4px; font-family: var(--sans); text-decoration: none; }
.skip-link:focus { top: 1rem; }

/* Route: one thin line that draws as you read */
.route { position: fixed; top: 0; left: 0; width: 100%; height: 14px; z-index: 50; pointer-events: none; }
.route path { fill: none; vector-effect: non-scaling-stroke; }
.route-ghost { stroke: var(--contour); stroke-width: 1.5; stroke-dasharray: 3 5; }
.route-line { stroke: var(--copper-line); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; }
.route-fork { stroke: var(--contour); stroke-width: 1.5; }
html:not(.js) .route-line { display: none; }
@media (prefers-reduced-motion: reduce) {
  .route-line { display: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Header */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 92%, transparent); border-bottom: 1px solid var(--contour); padding-top: 14px; }
@supports not (background: color-mix(in srgb, red 50%, blue)) { .site-header { background: var(--paper); } }
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.2rem 1.2rem; padding-block: 0.45rem; }
.home-link { color: var(--ink); text-decoration: none; font-size: 1.05rem; display: inline-flex; align-items: center; min-height: 44px; border-bottom: 2px solid var(--copper-line); }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1rem; }
.nav-list a { color: var(--ink-soft); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; font-size: 1rem; }
.nav-list a:hover { color: var(--copper); }
@media (max-width: 420px) { .nav-list { gap: 0 0.8rem; } .nav-list a { font-size: 0.95rem; } }

/* Hero */
.hero { padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(1.5rem, 4vw, 3rem); background-image: repeating-radial-gradient(circle at 80% 30%, transparent 0 34px, rgba(176,106,56,0.08) 34px 35px); }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 860px) { .hero-grid { grid-template-columns: 1.25fr 1fr; gap: 3rem; } }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.6rem, 1.6rem + 5vw, 5.2rem); letter-spacing: -0.015em; }
.dek { font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.6rem); font-style: italic; color: var(--ink-soft); max-width: 34rem; }
.thesis { border-left: 3px solid var(--copper-line); padding: 0.3rem 0 0.3rem 1rem; max-width: 34rem; }
.thesis-label { display: block; color: var(--copper); font-size: 0.95rem; }
.meta { color: var(--ink-soft); font-size: 0.95rem; }
.hero-map { margin: 0; }
.hero-map svg { width: 100%; height: auto; max-width: 30rem; display: block; margin-inline: auto; }
.contours path { fill: none; stroke: var(--copper-line); stroke-width: 1.2; opacity: 0.75; }
.map-route { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 2 6; stroke-linecap: round; }
.map-camp { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.compass circle { fill: none; stroke: var(--ink-soft); stroke-width: 1.2; }
.compass .compass-inner { stroke-dasharray: 2 3; }
.compass path { fill: var(--ink); }
.compass .compass-light { fill: var(--copper-line); }
.compass text { fill: var(--ink); font-family: var(--display); font-size: 13px; }

/* Essay */
.essay { padding-block: 1rem 3rem; }
.essay section { margin-bottom: 3.2rem; }
.essay h2 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem); }
.essay p { margin: 0 0 1.1em; }
.section-mark { font-family: var(--display); color: var(--copper); font-size: 1.1rem; letter-spacing: 0.2em; margin-bottom: 0.2rem !important; }
.section-mark::before { content: ""; display: inline-block; width: 2.5rem; height: 1px; background: var(--copper-line); vertical-align: middle; margin-right: 0.7rem; }
.dropcap::first-letter { font-family: var(--display); float: left; font-size: 3.6em; line-height: 0.85; padding: 0.08em 0.12em 0 0; color: var(--copper); }
.pull { font-family: var(--display); font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.7rem); line-height: 1.35; font-style: italic; border-block: 1px solid var(--contour); padding-block: 1rem; margin-block: 1.8rem !important; }

.engines { margin: 0 0 1.4rem; display: grid; gap: 0.9rem; }
.engines div { padding: 0.8rem 1rem; background: var(--paper-3); border: 1px solid var(--contour); border-radius: 4px; }
.engines dt { font-family: var(--display); font-weight: 600; color: var(--copper); font-size: 1.15rem; }
.engines dd { margin: 0.2rem 0 0; }

.note { margin: 1.8rem 0; padding: 1rem 1.2rem 0.2rem; border-radius: 4px; background: var(--paper-3); border: 1px solid var(--contour); position: relative; font-size: 0.98em; }
.note-label { margin: 0 0 0.3rem !important; font-size: 1rem; }
.note-evidence { border-left: 4px solid var(--moss); }
.note-evidence .note-label { color: var(--moss); }
.note-counter { border-left: 4px solid var(--copper-line); }
.note-counter .note-label { color: var(--copper); }
.note-open { border-left: 4px dashed var(--ink-soft); }
.note-open .note-label { color: var(--ink-soft); }

/* Passport */
.passport {
  margin-inline: calc(50% - min(50vw, 36rem));
  padding: 2.4rem clamp(1rem, 4vw, 2.5rem);
  background: var(--paper-2);
  border-block: 1px solid var(--contour);
  background-image: repeating-linear-gradient(0deg, transparent 0 39px, rgba(176,106,56,0.08) 39px 40px), repeating-linear-gradient(90deg, transparent 0 39px, rgba(176,106,56,0.08) 39px 40px);
}
.passport-head { max-width: 42rem; }
.skip-routes { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }
.skip-routes a { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--sans); font-size: 0.95rem; }
.passport-static { max-width: 42rem; }
.cards { display: grid; gap: 1.1rem; margin-top: 1.4rem; }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card {
  margin: 0; min-width: 0;
  background: var(--paper-3); border: 1px solid var(--contour); border-radius: 6px;
  padding: 1rem 1.1rem 1.2rem; box-shadow: 0 1px 0 var(--contour), 0 10px 24px -18px rgba(0,0,0,0.5);
  position: relative;
}
.card::after { content: ""; position: absolute; right: 0.9rem; top: 0.9rem; width: 1.6rem; height: 1.6rem; border: 1.5px dashed var(--copper-line); border-radius: 50%; opacity: 0.7; }
.card legend { font-family: var(--display); font-size: 1.25rem; font-weight: 600; padding: 0; margin-bottom: 0.6rem; float: left; width: 100%; padding-right: 2rem; }
.card legend + * { clear: both; }
.card-no { display: block; color: var(--copper); font-family: var(--serif); font-size: 0.95rem; }
.card label { display: block; font-size: 0.95rem; margin: 0.4rem 0 0.35rem; }
textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--ink-soft); border-radius: 4px; padding: 0.6rem 0.7rem; resize: vertical; min-height: 44px; line-height: 1.5;
}
.voices { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.6rem; }
.voices-label { width: 100%; margin: 0 !important; font-size: 0.95rem; }
.voices label { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; padding: 0.3rem 0.7rem 0.3rem 0.5rem; min-height: 44px; border: 1px solid var(--contour); border-radius: 999px; background: var(--paper); cursor: pointer; font-family: var(--sans); font-size: 0.88rem; }
.voices label:has(input:checked) { border-color: var(--copper); background: var(--paper-2); }
input[type="checkbox"] { accent-color: var(--copper); width: 1.05rem; height: 1.05rem; margin: 0; }
.passport-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.4rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0.55rem 1.1rem;
  font-family: var(--sans); font-size: 0.95rem; font-weight: 600; color: var(--ink); background: var(--paper-3);
  border: 1.5px solid var(--ink); border-radius: 999px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--paper); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--copper); border-color: var(--copper); color: var(--paper-3); }
.status { font-family: var(--sans); font-size: 0.92rem; color: var(--ink-soft); min-height: 1.4em; margin: 0.8rem 0 0; }

.routes { margin-top: 2rem; }
.routes:focus { outline: none; }
.routes:focus-visible { outline: 3px solid var(--focus); }
.echo { background: var(--paper-3); border: 1px dashed var(--copper-line); border-radius: 6px; padding: 0.9rem 1.1rem 0.3rem; margin-bottom: 1.2rem; }
.echo h4 { font-family: var(--display); font-size: 1.1rem; margin: 0 0 0.5rem; }
.echo dl { margin: 0; }
.echo dt { font-variant-caps: all-small-caps; letter-spacing: 0.08em; color: var(--copper); font-weight: 600; }
.echo dd { margin: 0 0 0.7rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.route-cols { display: grid; gap: 1rem; }
@media (min-width: 900px) { .route-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.route-col { background: var(--paper-3); border: 1px solid var(--contour); border-top: 4px solid var(--copper-line); border-radius: 4px; padding: 1rem 1.1rem 0.3rem; font-size: 0.98rem; }
.route-col:nth-child(2) { border-top-color: var(--moss); }
.route-col:nth-child(3) { border-top-color: var(--ink-soft); }
.route-col h4 { font-family: var(--display); font-size: 1.3rem; margin: 0 0 0.6rem; }
.route-col .label { font-variant-caps: all-small-caps; letter-spacing: 0.08em; font-weight: 600; color: var(--ink-soft); display: block; }
.route-col p { margin: 0 0 0.8rem; }
.route-col .personal { font-style: italic; border-left: 2px solid var(--contour); padding-left: 0.7rem; overflow-wrap: anywhere; }

/* Resolution */
.resolution { padding-top: 1rem; }
.principle { background: var(--ink); color: var(--paper); padding: 1.3rem 1.4rem 0.4rem; border-radius: 6px; margin: 1.8rem 0; }
.principle-label { color: #E8AE84; margin-bottom: 0.4rem !important; font-size: 1rem; }
@media (prefers-color-scheme: dark) { .principle-label { color: #7A3F1A; } }
.closing { font-family: var(--display); font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.7rem); line-height: 1.4; }
.notes { font-size: 0.95rem; color: var(--ink-soft); border-top: 1px solid var(--contour); padding-top: 1.2rem; }
.notes h2 { font-size: 1.4rem; color: var(--ink); }
.onward h2 { font-size: 1.4rem; }
.onward-list { list-style: none; padding: 0; margin: 0 0 1.6rem; display: grid; gap: 0.8rem; }
.onward-list li { padding: 0.8rem 1rem; border: 1px solid var(--contour); border-radius: 4px; background: var(--paper-3); }
.onward-list a { font-family: var(--display); font-size: 1.2rem; font-weight: 600; }
.onward-list span { display: block; font-size: 0.95rem; color: var(--ink-soft); }
.return { margin: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--contour); padding-block: 1.6rem; background: var(--paper-2); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; font-size: 0.95rem; }
.footer-inner p { margin: 0; }
.footer-inner a { display: inline-flex; align-items: center; min-height: 44px; }

/* 404 */
.lost { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 3rem 1rem; }
.lost p { max-width: 32rem; margin-inline: auto; }
.lost .links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; margin-top: 1.4rem; }

@media (forced-colors: active) { .route { display: none; } .principle { border: 2px solid CanvasText; } }
@media print { .route, .site-header, .passport, .skip-link { display: none !important; } body { background: #fff; color: #000; } }
