:root {
  --parchment: #f2ebd9;
  --parchment-2: #e9dfc6;
  --paper: #faf6ec;
  --ink: #2b2a26;
  --muted: #5d5649;
  --forest: #2f5d3a;
  --forest-dark: #1f4229;
  --ochre: #b26b00;
  --contour: rgba(140, 106, 67, 0.22);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 400 1.125rem/1.65 var(--serif);
  background:
    repeating-radial-gradient(ellipse 60% 40% at 85% 10%, transparent 0 26px, var(--contour) 26px 27px),
    repeating-radial-gradient(ellipse 50% 35% at 5% 95%, transparent 0 30px, var(--contour) 30px 31px),
    var(--parchment);
}
[hidden] { display: none !important; }
a { color: var(--forest); text-underline-offset: 0.2em; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.12; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: var(--gutter); top: -80px; z-index: 20; background: var(--forest); color: #fff; padding: 0.6rem 1rem; }
.skip:focus { top: 12px; }

.site-header {
  max-width: 1200px; margin: 0 auto; padding: 18px var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; font-size: 1.3rem; font-weight: 700; }
.brand svg { width: 34px; height: 34px; }
.brand em { color: var(--forest); }
.site-header ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.4rem; margin: 0; padding: 0; list-style: none; }
.site-header nav a { color: var(--ink); text-decoration: none; font-style: italic; }
.site-header nav a:hover { color: var(--forest); text-decoration: underline; }

.eyebrow { font-size: 0.85rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ochre); font-weight: 700; }

.trailhead { max-width: 1200px; margin: 0 auto; padding: clamp(32px, 6vw, 80px) var(--gutter) clamp(24px, 4vw, 48px); }
.trailhead h1 { font-size: clamp(2.3rem, 6vw, 4.4rem); max-width: 18ch; margin: 0.8rem 0 1.5rem; color: var(--forest-dark); letter-spacing: -0.01em; }
.trail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 2rem; align-items: end; }
.lede { font-size: 1.2rem; max-width: 56ch; }
.trail-facts { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); border: 2px solid var(--forest); border-radius: 10px; background: var(--paper); }
.trail-facts div { padding: 0.8rem 0.9rem; border-right: 1px dashed var(--forest); text-align: center; }
.trail-facts div:last-child { border-right: 0; }
.trail-facts dt { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.trail-facts dd { margin: 0; font-size: 1.6rem; font-weight: 700; color: var(--forest-dark); }

/* Map */
.map-section { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.map-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem 1rem; margin-bottom: 0.75rem; }
.map-head h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); color: var(--forest-dark); }
.progress-text { font-style: italic; color: var(--muted); }
.map {
  position: relative; aspect-ratio: 1000 / 360; border: 2px solid var(--forest); border-radius: 14px; overflow: hidden;
  background:
    repeating-radial-gradient(ellipse 30% 45% at 30% 60%, transparent 0 16px, rgba(47, 93, 58, 0.16) 16px 17px),
    repeating-radial-gradient(ellipse 25% 40% at 75% 30%, transparent 0 14px, rgba(140, 106, 67, 0.2) 14px 15px),
    var(--paper);
  box-shadow: 0 18px 40px -28px rgba(43, 42, 38, 0.6);
}
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.stops { list-style: none; margin: 0; padding: 0; }
.stops li { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); }
.stops button {
  display: grid; justify-items: center; gap: 0.2rem; background: none; border: 0; padding: 0.2rem; cursor: pointer; font: inherit; color: var(--ink);
}
.stops .n {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--ochre); font-weight: 700; font-size: 0.95rem; box-shadow: 0 4px 8px -4px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, background 0.2s ease;
}
.stops .t {
  font-size: 0.78rem; line-height: 1.15; max-width: 9.5em; text-align: center; background: rgba(250, 246, 236, 0.92); padding: 0.1rem 0.35rem; border-radius: 4px;
}
.stops button:hover .n { transform: scale(1.1); }
.stops button.visited .n { background: var(--forest); border-color: var(--forest); color: #fff; }
.stops button[aria-current="step"] .n { background: var(--ochre); border-color: var(--forest-dark); color: #1d1300; transform: scale(1.15); }
.stops button[aria-current="step"] .t { font-weight: 700; color: var(--forest-dark); }

/* Panel */
.panel-section { max-width: 900px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) var(--gutter) clamp(32px, 5vw, 64px); }
.stop-panel { position: relative; background: var(--paper); border: 2px solid var(--forest); border-radius: 14px; padding: clamp(22px, 4vw, 40px); margin-bottom: 1.25rem; }
.js .stop-panel { margin-bottom: 0; }
.stop-meta { font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ochre); font-weight: 700; margin-bottom: 0.4rem; }
.stop-panel h2 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); color: var(--forest-dark); margin-bottom: 1rem; padding-right: 5.5rem; }
.stop-panel h2:focus { outline: none; }
.plain { font-size: 1.15rem; margin-bottom: 1.25rem; }
.key, .think { padding: 0.9rem 1rem; border-radius: 10px; margin-top: 0.75rem; }
.key { background: rgba(47, 93, 58, 0.1); border-left: 5px solid var(--forest); }
.think { background: rgba(178, 107, 0, 0.1); border-left: 5px solid var(--ochre); font-style: italic; }
.key strong, .think strong { display: block; font-style: normal; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.15rem; }
.key strong { color: var(--forest-dark); }
.think strong { color: #7a4900; }
.stamp {
  position: absolute; top: 1.2rem; right: 1.2rem; transform: rotate(8deg);
  border: 3px double var(--forest); color: var(--forest); padding: 0.2rem 0.6rem; border-radius: 6px;
  font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.8rem;
}
.panel-nav { display: flex; justify-content: space-between; gap: 0.75rem; margin-top: 1.25rem; flex-wrap: wrap; }
.hint { margin-top: 0.8rem; text-align: center; color: var(--muted); font-size: 0.95rem; font-style: italic; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0.7rem 1.25rem; border-radius: 999px;
  background: var(--forest); color: #fff; border: 2px solid var(--forest); font: 700 1rem/1 var(--serif); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--forest-dark); color: #fff; }
.btn-line { background: transparent; color: var(--forest-dark); }
.btn-line:hover { color: #fff; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.summit { max-width: 900px; margin: 0 auto clamp(40px, 6vw, 72px); padding: clamp(24px, 4vw, 40px); background: var(--forest-dark); color: var(--parchment); border-radius: 14px; width: calc(100% - 2 * var(--gutter)); }
.summit h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin-bottom: 0.6rem; }
.summit p { max-width: 60ch; }
.summit-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
.summit .btn { background: var(--ochre); border-color: var(--ochre); color: #1d1300; }
.summit .btn:hover { background: #d08a1a; }
.summit .btn-line { background: transparent; border-color: var(--parchment); color: var(--parchment); }
.summit .btn-line:hover { background: var(--parchment); color: var(--forest-dark); }
.summit :focus-visible { outline-color: var(--parchment); }

.site-footer { max-width: 1200px; margin: 0 auto; padding: 1.5rem var(--gutter) 2.5rem; border-top: 1px dashed var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; font-size: 0.95rem; color: var(--muted); }

@media (max-width: 820px) {
  .trail-grid { grid-template-columns: 1fr; }
  .map { aspect-ratio: auto; padding: 1rem; }
  .map-svg { display: none; }
  .stops { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.6rem; }
  .stops li { position: static; transform: none; }
  .stops button { width: 100%; grid-template-columns: auto 1fr; justify-items: start; align-items: center; gap: 0.6rem; padding: 0.45rem; border: 1px solid var(--parchment-2); border-radius: 10px; background: rgba(250, 246, 236, 0.9); text-align: left; }
  .stops .n { width: 32px; height: 32px; font-size: 0.85rem; }
  .stops .t { font-size: 0.9rem; max-width: none; text-align: left; background: none; padding: 0; }
}
@media (max-width: 400px) {
  .stops { grid-template-columns: 1fr 1fr; }
  .stop-panel h2 { padding-right: 0; }
  .stamp { position: static; display: inline-block; margin-bottom: 0.6rem; }
}

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