/* LocalLore — guidebook skin.
   Visual language borrowed from ObsidianUI (MIT): dotted field, arrow-fill
   buttons, trading-card tilt, catalog hover preview. Implemented in CSS so
   the site stays a static Eleventy catalog — no React, no Tailwind. */

:root {
  --paper: #f3ead8;
  --paper-deep: #e7dcc6;
  --card: #fffaf1;
  --ink: #221c16;
  --ink-muted: #5c564c;
  --lantern: #c44512;
  --lantern-hot: #e25a1c;
  --moss: #3d4a34;
  --gold: #b0893e;
  --rule: #d4c6ae;
  --dot: rgba(36, 30, 22, 0.11);
  --shadow: 0 18px 40px -24px rgba(34, 28, 22, 0.45);
  --max: 40rem;
  --wide: 72rem;
  --serif: "Source Serif 4", "Iowan Old Style", Palatino, Georgia, serif;
  --display: "Fraunces", "Iowan Old Style", Palatino, serif;
  --sans: "DM Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.785, 0.135, 0.15, 0.86);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html {
  background-color: var(--paper);
  background-image: radial-gradient(circle, var(--dot) 0.9px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink);
}
body {
  min-height: 100vh;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}
a { color: var(--lantern); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--lantern); outline-offset: 3px; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  background: var(--ink); color: var(--paper); padding: 0.5rem 0.8rem;
}
.skip:focus { top: 0.6rem; }

.wrap { width: min(var(--wide), calc(100% - 2.4rem)); margin: 0 auto; }

.site-header {
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  padding: 0.85rem 0;
}
.site-header .wrap {
  display: flex; align-items: center;
  gap: 0.7rem 1rem; flex-wrap: wrap;
}
.city-pick {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-right: auto;
}
.city-pick > span {
  font-family: var(--sans); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted);
}
.city-pick select {
  font-family: var(--sans); font-size: 0.82rem; font-weight: 500;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink);
  padding: 0.38rem 0.7rem; border-radius: 999px;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
/* Keep the sprite in the render tree — Safari drops <use> from display:none / 0×0 SVGs. */
.icon-sprite {
  position: absolute; left: 0; top: 0; width: 1px; height: 1px;
  overflow: hidden; pointer-events: none;
}
.wordmark {
  font-family: var(--display);
  font-weight: 600; font-size: 1.35rem; letter-spacing: -0.03em;
  text-decoration: none; color: var(--ink);
}
.wordmark span { color: var(--lantern); }
.nav { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.15rem; flex-wrap: wrap; }
.nav a {
  font-family: var(--sans); font-size: 0.82rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-muted); text-decoration: none;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

main { padding: 2.6rem 0 5rem; flex: 1; }

.mark {
  font-family: var(--sans);
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--lantern); font-weight: 600; margin: 0 0 0.7rem;
}
h1, h2, h3 {
  font-family: var(--display);
  font-style: normal;
  font-optical-sizing: auto;
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.03em;
}
h1 { font-size: clamp(2.05rem, 5.4vw, 3.5rem); margin: 0 0 0.85rem; }
h2 { font-size: 1.45rem; margin: 2.2rem 0 0.7rem; }
.lede { font-size: 1.18rem; max-width: var(--max); color: var(--ink-muted); margin: 0 0 1.4rem; overflow-wrap: break-word; }

.hero { padding-bottom: 0.4rem; }
.hero-title { max-width: min(16ch, 100%); text-wrap: pretty; overflow-wrap: break-word; }
.hero-bar {
  width: min(7rem, 36%);
  height: 3px;
  background: var(--lantern);
  margin: 0 0 1.5rem;
}

.rule { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

.board-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin: 0 0 0.4rem;
}
.board-head h2 { margin: 0; }
.board-date {
  font-family: var(--sans); font-size: 0.82rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-muted);
}

.board {
  display: grid; gap: 1.15rem;
  grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
  margin: 1.5rem 0 2rem;
  perspective: 1400px;
}
.quest-card {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 40%;
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 0 1.15rem 1.25rem;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 0.4rem;
  min-height: 16rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.quest-card:hover {
  border-color: color-mix(in srgb, var(--lantern) 55%, var(--rule));
  box-shadow: 0 28px 50px -28px rgba(196, 69, 18, 0.45);
}
.quest-card__rank {
  position: absolute; top: 0.7rem; right: 0.85rem; z-index: 2;
  font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.12em;
  color: var(--gold);
}
.kind-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem;
  color: var(--lantern);
}
.kind-badge {
  width: 2.55rem; height: 2.55rem; border-radius: 999px;
  display: grid; place-items: center; flex-shrink: 0;
  background: color-mix(in srgb, currentColor 16%, var(--card));
}
.kind-icon { width: 1.4rem; height: 1.4rem; display: block; }
.kind-tile__label {
  font-family: var(--sans); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 600;
}
.kind-tile--sunset, .kind-tile--sunrise { color: #c44512; }
.kind-tile--water { color: #2f5d62; }
.kind-tile--indoor { color: #6a4a2f; }
.kind-tile--civic { color: #4a3a28; }
.kind-tile--play { color: #9a3f16; }
.kind-tile--wander, .kind-tile--viewpoint { color: #3d4a34; }
.kind-tile--night { color: #3a3548; }
.kind-tile--seasonal { color: #6b5a28; }
.kind-tile--ritual { color: #8a3a16; }
.quest-card .kind-tile {
  flex-direction: row; align-items: center; gap: 0.7rem;
  margin: 0 -1.15rem 0.85rem; padding: 0.85rem 1.15rem;
  background: color-mix(in srgb, currentColor 9%, var(--paper-deep));
  border-bottom: 1px solid var(--rule);
}
.quest-hero .kind-tile { margin: 0 0 0.85rem; flex-direction: row; align-items: center; gap: 0.7rem; }
.quest-hero .kind-badge { width: 3rem; height: 3rem; }
.quest-hero .kind-icon { width: 1.65rem; height: 1.65rem; }
.quest-card__sheen {
  pointer-events: none; position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255,255,255,0.38), transparent 55%);
  opacity: 0; mix-blend-mode: soft-light; transition: opacity 0.25s ease;
}
.quest-card:hover .quest-card__sheen { opacity: 1; }
.quest-card h2 { font-size: 1.28rem; margin: 0; position: relative; z-index: 2; }
.quest-card .mark { margin-bottom: 0.15rem; position: relative; z-index: 2; }
.quest-card__hook { margin: 0; color: var(--ink-muted); font-size: 0.98rem; position: relative; z-index: 2; }
.quest-card .meta {
  font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.04em;
  color: var(--ink-muted); margin-top: auto; padding-top: 0.7rem;
  position: relative; z-index: 2;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.8rem 0 1.3rem; }
.chip {
  font-family: var(--sans); font-size: 0.75rem; font-weight: 500;
  background: var(--paper-deep); color: var(--ink);
  padding: 0.28rem 0.7rem; border-radius: 999px; text-decoration: none;
  border: 1px solid transparent;
}
.chip-link:hover { border-color: var(--lantern); color: var(--lantern); }

.city-rail {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1.6rem 0 0;
}
.city-rail a {
  font-family: var(--sans); font-size: 0.8rem; text-decoration: none;
  padding: 0.35rem 0.75rem; border: 1px solid var(--rule); border-radius: 999px;
  color: var(--ink-muted); background: color-mix(in srgb, var(--card) 70%, transparent);
}
.city-rail a:hover, .city-rail a.is-here { color: var(--ink); border-color: var(--ink); }

.cover {
  width: 100%; height: auto; display: block; margin: 0 0 1.5rem;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}
.quest-hero .cover { margin-top: 0.4rem; }

.prose { max-width: var(--max); }
.prose h2 { font-size: 1.3rem; }
.prose p { margin: 0.85rem 0; }
.prose ol { padding-left: 1.2rem; }
.prose li { margin: 0.45rem 0; }


.safety {
  border: 1px dashed var(--gold); padding: 0.95rem 1.05rem; margin: 1.6rem 0;
  background: color-mix(in srgb, var(--gold) 8%, var(--card));
  max-width: var(--max);
}
.map-links { display: flex; gap: 0.7rem; flex-wrap: wrap; margin: 0.6rem 0 1.4rem; }
.map-links a {
  font-family: var(--sans); font-size: 0.82rem; text-decoration: none;
  border-bottom: 1px solid var(--rule); padding-bottom: 0.1rem;
}

.catalog { list-style: none; padding: 0; margin: 0; }
.catalog-row {
  display: grid; grid-template-columns: 3.6rem 1fr; gap: 0.95rem; align-items: center;
  border-top: 1px solid var(--rule); padding: 1.05rem 0;
  text-decoration: none; color: inherit;
}
.catalog li:last-child .catalog-row { border-bottom: 1px solid var(--rule); }
.catalog-row .kind-tile { margin: 0; }
.catalog-row .kind-tile__label { display: none; }
.catalog-row .kind-badge { width: 2.4rem; height: 2.4rem; }
.catalog-row h2 { margin: 0 0 0.2rem; font-size: 1.22rem; }
.catalog-row p { margin: 0; color: var(--ink-muted); font-size: 0.95rem; }
.catalog-row:hover h2 { color: var(--lantern); }

.city-grid {
  display: grid; gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  margin: 1.6rem 0 0;
}
.city-tile {
  display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--rule);
  padding: 1.15rem 1.2rem 1.2rem; min-height: 7.2rem;
  box-shadow: var(--shadow); transition: border-color 0.2s ease, transform 0.2s ease;
}
.city-tile:hover { border-color: var(--lantern); transform: translateY(-2px); }
.city-tile h2 { margin: 0 0 0.3rem; font-size: 1.35rem; }
.city-tile p { margin: 0; color: var(--ink-muted); font-size: 0.9rem; }

.fill-btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  height: 2.75rem; padding: 0 1.15rem 0 1.2rem;
  border-radius: 1000px; border: 0; cursor: pointer;
  background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: 0.86rem; font-weight: 500;
  text-decoration: none; white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}
.fill-btn svg { width: 0.72rem; height: 0.72rem; }
.fill-btn:is(:hover, :focus-visible) { background: var(--lantern); color: #fffaf1; }
.fill-btn[aria-pressed="true"] {
  background: var(--paper); color: var(--ink); border: 1px solid var(--ink);
}

.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; margin: 1.4rem 0 0; }
.text-link { font-family: var(--sans); font-size: 0.86rem; }
.muted { color: var(--ink-muted); }
.thin { max-width: var(--max); }
.status-pill {
  display: inline-flex; align-items: center;
  font-family: var(--sans); font-size: 0.84rem;
  margin: 0 0.55rem 0.75rem 0; color: var(--ink);
  background: var(--paper-deep); border: 1px solid var(--rule);
  padding: 0.38rem 0.85rem; border-radius: 999px;
}
.status-pill[hidden] { display: none; }
.kind-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
  margin: 0.2rem 0 0.4rem;
}
.kind-filters__label {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted);
  margin-right: 0.15rem;
}
.return-hook { max-width: var(--max); margin: 1rem 0 0; }
.related { max-width: var(--max); padding-left: 1.2rem; }
.related a { text-decoration: none; }
.onboard-cities-title { font-size: 1.15rem; margin: 2.2rem 0 0.7rem; }
.beats { max-width: var(--max); padding-left: 1.2rem; }
.beats li { margin: 0.55rem 0; }
.onboard-form {
  display: grid; gap: 1.1rem; max-width: 32rem; margin: 1.6rem 0 1.2rem;
}
fieldset.field { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
.field span, .field legend {
  display: block; font-family: var(--sans); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.4rem;
}
.field select, .field input[type="text"] {
  width: 100%; font: inherit; padding: 0.55rem 0.7rem;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--card);
}
.choice-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.choice {
  font: inherit; font-family: var(--sans); font-size: 0.84rem;
  border: 1px solid var(--rule); border-radius: 999px; padding: 0.35rem 0.75rem;
  background: var(--card); cursor: pointer; color: inherit;
}
.choice:has(input:checked),
.choice[aria-pressed="true"] { border-color: var(--ink); background: var(--paper-deep); }
.choice input { margin-right: 0.3rem; }

.site-footer {
  border-top: 1px solid var(--rule); margin-top: auto; padding: 2.4rem 0 2.6rem;
  color: var(--ink-muted); font-size: 0.95rem;
}
.site-footer .wrap {
  display: grid; gap: 1.4rem;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 0.55rem 1rem; margin: 0; padding: 0; list-style: none; }
.footer-links a { color: var(--ink-muted); text-decoration: none; font-family: var(--sans); font-size: 0.82rem; }
.footer-links a:hover { color: var(--ink); }

@media (max-width: 720px) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 0.55rem; }
  .nav { width: 100%; gap: 0.7rem 0.95rem; }
  .hero-title { max-width: none; }
  .site-footer .wrap { grid-template-columns: 1fr; }
  .catalog-row { grid-template-columns: 3.2rem 1fr; }
  h1 { font-size: clamp(1.85rem, 8.4vw, 2.5rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .quest-card, .hover-thumb, .fill-btn {
    animation: none !important; transition: none !important;
  }
  .quest-card { transform: none; }
}
