:root {
  --cream: #f6efe1;
  --cream-2: #efe6d2;
  --ink: #1c2a35;
  --ink-soft: #4a5b67;
  --rule: #d9cdb1;
  --accent: #c2532a;       /* brick red, like the old whalers' shutters */
  --accent-2: #2c5e6b;     /* harbor teal */
  --gold: #c89a3b;
  --paper-shadow: 0 1px 0 #e7dcc1, 0 18px 40px -24px rgba(28,42,53,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  /* paper texture */
  background-image:
    radial-gradient(circle at 20% 10%, rgba(200,154,59,.08), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(44,94,107,.08), transparent 45%),
    repeating-linear-gradient(0deg, rgba(28,42,53,.025) 0 1px, transparent 1px 3px);
}

/* ---------- Masthead ---------- */
.masthead {
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, #fbf6e9 0%, var(--cream) 100%);
}
.masthead-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 28px 28px;
}
.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 14px;
}
.masthead h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 800;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.masthead h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.dek {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 0 0 22px;
  font-weight: 400;
}
.meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-soft);
}
.meta strong { color: var(--ink); font-weight: 600; }
.meta-sep { opacity: .5; }
.reset {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
}
.reset:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Layout ---------- */
.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
}

/* ---------- Map ---------- */
.map-wrap {
  position: sticky;
  top: 20px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  background: #e8e1cc;
  box-shadow: var(--paper-shadow);
}
#map {
  width: 100%;
  height: 560px;
}
@media (max-width: 880px) {
  .map-wrap { position: static; }
  #map { height: 380px; }
}
.map-legend {
  padding: 10px 14px;
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
  background: var(--cream-2);
}

/* Leaflet attribution tweak */
.leaflet-container { background: #e8e1cc; font-family: 'Inter', sans-serif; }
.leaflet-popup-content-wrapper {
  border-radius: 2px;
  background: var(--cream);
  border: 1px solid var(--rule);
  box-shadow: 0 12px 30px -16px rgba(0,0,0,.35);
}
.leaflet-popup-content {
  margin: 12px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
}
.leaflet-popup-content b {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  display: block;
  margin-bottom: 4px;
}
.leaflet-popup-tip { background: var(--cream); }

/* ---------- Pin marker ---------- */
.hunt-pin {
  width: 38px;
  height: 46px;
  position: relative;
}
.hunt-pin .body {
  position: absolute; inset: 0;
  background: var(--accent);
  border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
  border: 2px solid var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 6px 10px -4px rgba(0,0,0,.35);
}
.hunt-pin .body::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -10px;
  transform: translateX(-50%) rotate(45deg);
  width: 12px; height: 12px;
  background: var(--accent);
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}
.hunt-pin .num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--cream);
  transform: translateY(-4px);
  z-index: 1;
}
.hunt-pin.found .body { background: var(--accent-2); }
.hunt-pin.found .body::after { background: var(--accent-2); }

/* ---------- Stops ---------- */
.stops ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  counter-reset: stop;
}
.stop {
  position: relative;
  background: #fbf6e9;
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  padding: 22px 22px 20px 64px;
  border-radius: 2px;
  cursor: pointer;
  box-shadow: var(--paper-shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.stop:hover { transform: translateY(-2px); }
.stop.active { border-left-color: var(--gold); }
.stop.found { border-left-color: var(--accent-2); background: #f1ece0; }
.stop .num {
  position: absolute;
  left: 16px;
  top: 18px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-weight: 800;
  font-size: 22px;
  color: var(--accent);
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: var(--cream);
}
.stop.found .num { color: var(--accent-2); }
.stop.found .num::after {
  content: '\2713';
  position: absolute;
  font-size: 18px;
}
.stop.found .num span { display: none; }
.stop h3 {
  margin: 0 0 4px;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -.01em;
  line-height: 1.15;
}
.stop .addr {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.stop .clue {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  color: var(--ink);
  margin: 0 0 12px;
  font-style: italic;
}
.stop .jelly {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 14px;
}
.stop .jelly b {
  color: var(--accent);
  font-weight: 600;
  font-style: normal;
}
.stop.found .jelly b { color: var(--accent-2); }
.stop .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--cream);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s ease;
}
.btn:hover { border-color: var(--ink); }
.btn.primary {
  background: var(--accent);
  color: var(--cream);
  border-color: var(--accent);
}
.btn.primary:hover { background: #a8431f; border-color: #a8431f; }
.stop.found .btn.primary {
  background: var(--accent-2);
  border-color: var(--accent-2);
}

/* ---------- Footer ---------- */
.foot {
  border-top: 1px solid var(--rule);
  margin-top: 20px;
  padding: 24px 28px 40px;
  text-align: center;
  color: var(--ink-soft);
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 15px;
}
