/* ============================================================
   PsiSpacer — "Nocny spacer" design system.
   Atmosphere: dusk walk under lamplight. Dark soil surfaces, warm
   cream ink, amber lamplight, moss/rust semantics, film grain.
   Motion: CSS owns the load choreography (LCP-safe: hero text is
   the LCP and starts painting immediately); fx.js adds reveals,
   fireflies, paw trail and GSAP magnetics (desktop only).
   Loaded ASYNC (preload → onload) — tokens.css + the tiny inline
   <style> in each template stay the blocking critical layer.
   ============================================================ */

:root {
  --moss: #9fc978;
  --moss-soft: rgba(159, 201, 120, .14);
  --rust: #e0644d;
  --rust-soft: rgba(224, 100, 77, .14);
  --amber-hot: #ffc65c;

  --r-s: 10px; --r-m: 16px; --r-l: 24px; --r-pill: 999px;
  --pad: clamp(20px, 4.5vw, 56px);
  --maxw: 1200px;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .4, 1);

  --shadow-1: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 10px 30px rgba(0, 0, 0, .35);
  --glow-amber: 0 0 0 1px rgba(245, 165, 36, .35), 0 0 34px rgba(245, 165, 36, .18);
}

::selection { background: var(--accent); color: var(--accent-ink); }

body {
  min-height: 100svh;
  /* NOTE: no background-attachment:fixed and no blend-mode overlays here —
     both force full-page re-raster per scroll frame and can black out /
     hang the compositor. Learned the hard way; keep layers cheap. */
  background:
    radial-gradient(1200px 700px at 82% -10%, rgba(245, 165, 36, .07), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(159, 201, 120, .045), transparent 55%),
    linear-gradient(180deg, #191509 0%, var(--bg) 24%);
}

/* film grain — one fixed overlay, generated, zero requests, NO blend mode */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

/* ---------- typography ---------- */
h1, h2, h3, .display {
  font-family: var(--f-display);
  font-variation-settings: 'opsz' 96;
  letter-spacing: -.01em;
  line-height: 1.04;
  text-wrap: balance;
}
h2 { font-size: clamp(26px, 3.4vw, 40px); }
p { text-wrap: pretty; }
small, .mono { font-family: var(--f-mono); }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px;
}

/* ---------- nav (pill links + CTA, boiska-style) ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 10px;
  padding: 12px var(--pad);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.nav__logo strong {
  color: var(--ink); font-family: var(--f-display); font-size: 21px; font-weight: 800;
  letter-spacing: -.02em;
}
.nav__logo strong::after {
  content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 3px;
  border-radius: 50%; background: var(--accent);
  transition: transform .3s var(--ease-spring);
}
.nav__logo:hover strong::after { transform: scale(1.5); }
.nav__links { display: flex; gap: 2px; margin-left: 16px; }
.nav__links a {
  padding: 9px 16px; border-radius: var(--r-pill);
  color: var(--dim); font-weight: 600; font-size: 14.5px;
  transition: color .2s, background .2s;
}
.nav__links a:hover { color: var(--ink); background: rgba(243, 236, 221, .07); }
.nav__links a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.nav__cta { margin-left: auto; padding: 11px 20px; font-size: 14px; }
@media (max-width: 640px) { .nav__links { display: none; } }

/* ---------- shared page shell ---------- */
.page-main { max-width: var(--maxw); margin: 0 auto; padding: clamp(28px, 5vw, 64px) var(--pad) 90px; }
.page-main > header { margin-bottom: 28px; }

/* legal pages typography */
[data-page="legal"] .page-main { max-width: 760px; }
[data-page="legal"] h1 { font-size: clamp(34px, 5vw, 52px); margin-bottom: 18px; }
[data-page="legal"] h2 { font-size: 22px; margin: 34px 0 10px; }
[data-page="legal"] p, [data-page="legal"] li { color: var(--dim); margin-bottom: 10px; }
[data-page="legal"] ul { padding-left: 20px; }
[data-page="legal"] a { color: var(--amber-hot); }

/* ============================================================
   HOME — "Dziennik Terenowy": dark field-guide index. Typography +
   hairlines carry the design; fireflies/lamp glow carry the brand.
   ============================================================ */
.hero.journal {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: calc(100svh - 57px);
  display: flex; flex-direction: column;
  padding: clamp(28px, 4.5vh, 56px) var(--pad) 0;
  border-bottom: 1px solid var(--line);
}
#hero-canvas { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; }
.hero__glow {
  position: absolute; z-index: -1; top: -280px; right: -160px;
  width: 760px; height: 760px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 165, 36, .15) 0%, rgba(245, 165, 36, .05) 42%, transparent 70%);
}
.journal__ghost, .chapter__ghost, .plate__ghost {
  position: absolute; z-index: -1; right: 2vw; bottom: 0;
  font-family: var(--f-display); font-weight: 800;
  font-size: clamp(160px, 24vw, 340px); line-height: .8;
  color: rgba(243, 236, 221, .04); pointer-events: none; user-select: none;
}
.journal__inner {
  position: relative; max-width: var(--maxw); width: 100%;
  margin: 0 auto; display: flex; flex-direction: column; flex: 1;
}
.dateline {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent); margin-bottom: clamp(24px, 5vh, 56px);
}
.dateline span { color: var(--chalk); }
.dateline::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.journal__grid {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  gap: clamp(28px, 4vw, 72px); align-items: center; flex: 1;
}
.journal__title {
  font-size: clamp(38px, 5.2vw, 72px);
  font-weight: 800; color: var(--chalk); line-height: 1.02;
  margin-bottom: clamp(16px, 2.4vh, 26px); max-width: 15ch;
}
.journal__title em { font-style: normal; color: var(--accent); text-shadow: 0 0 40px rgba(245, 165, 36, .3); }
.journal__sub { color: var(--dim); font-size: clamp(15px, 1.35vw, 18px); line-height: 1.55; max-width: 56ch; margin-bottom: clamp(20px, 3.2vh, 32px); }
.journal__sub b, .chapter__copy b { color: var(--amber-hot); font-variant-numeric: tabular-nums; }
.journal__quick { margin-top: 14px; color: var(--faint); font-size: 14px; }
.journal__quick a { color: var(--dim); font-weight: 600; padding: 2px 0; transition: color .25s; }
.journal__quick a:hover { color: var(--amber-hot); }
.journal__quick-map { color: var(--accent) !important; }
.near-me {
  display: inline-flex; align-items: center; gap: 6px;
  margin-right: 14px; padding: 8px 16px; cursor: pointer;
  background: none; border: 1px solid var(--line); border-radius: var(--r-pill);
  color: var(--ink); font: 600 13.5px/1 var(--f-body);
  transition: border-color .25s, color .25s, box-shadow .3s var(--ease-out);
}
.near-me:hover { border-color: var(--accent); color: var(--amber-hot); box-shadow: var(--glow-amber); }
.near-me[disabled] { opacity: .6; cursor: wait; }

.toc {
  display: grid; grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line); margin-top: clamp(20px, 4vh, 40px);
}
.toc a {
  display: flex; align-items: baseline; gap: 8px;
  padding: 18px 6px; font-family: var(--f-mono); font-size: 12.5px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--dim);
  border-left: 1px solid transparent;
  transition: color .25s, background .25s;
}
.toc a:first-child { padding-left: 0; }
.toc a:hover { color: var(--chalk); background: rgba(245, 165, 36, .05); }
.toc i { font-style: normal; color: var(--faint); }
.toc b { margin-left: auto; padding-right: 14px; color: var(--accent); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- chapters ---------- */
.journal-main { display: block; }
.chapter {
  position: relative; overflow: hidden; isolation: isolate;
  max-width: none; padding: clamp(64px, 9vw, 120px) var(--pad);
  border-bottom: 1px solid var(--line);
}
.chapter > *:not(.chapter__ghost), .chapter__grid { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
/* dusk deepens as the walk goes on (graft from the scroll-narrative direction) */
.chapter--dusk1 { background: #100e0a; }
.chapter--dusk2 { background: #0e0c08; }
.chapter--dusk3 { background: #0c0a07; }
.chapter--dusk4 { background: #0a0906; }

.kicker {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.chapter h2 { font-size: clamp(28px, 3.6vw, 46px); color: var(--chalk); margin-bottom: 16px; max-width: 24ch; }
.chapter__copy { color: var(--dim); font-size: clamp(15px, 1.3vw, 17px); line-height: 1.6; max-width: 58ch; margin-bottom: 22px; }
.chapter__more { display: inline-block; color: var(--amber-hot); font-weight: 700; }
.chapter__more span { display: inline-block; transition: transform .3s var(--ease-spring); }
.chapter__more:hover span { transform: translateX(6px); }
.chapter__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.chapter__foot { margin-top: 28px; font-family: var(--f-mono); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.chapter__foot a { color: var(--accent); }
.chapter__foot a:hover { color: var(--amber-hot); }

/* index rows (_01_) — typographic, lamp-glow hover */
.index-list { list-style: none; border-top: 1px solid var(--line); }
.index-list a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
  padding: 15px 10px; border-bottom: 1px solid var(--line);
  transition: background .3s var(--ease-out), box-shadow .3s var(--ease-out), padding-left .3s var(--ease-out);
}
.index-list span { font-family: var(--f-display); font-weight: 700; font-size: clamp(19px, 1.9vw, 25px); color: var(--chalk); }
.index-list b { font-family: var(--f-mono); font-weight: 500; font-size: 14px; color: var(--faint); font-variant-numeric: tabular-nums; transition: color .25s; }
.index-list b::after { content: ' miejsc'; letter-spacing: .08em; }
.index-list a:hover {
  background: rgba(245, 165, 36, .05); padding-left: 18px;
  box-shadow: inset 3px 0 0 var(--accent), 0 12px 34px -18px rgba(245, 165, 36, .45);
}
.index-list a:hover b { color: var(--amber-hot); }

/* type index (_02_ left) */
.type-index { list-style: none; margin-top: 26px; border-top: 1px solid var(--line); }
.type-index li > a, .type-index__soon {
  display: flex; align-items: baseline; gap: 14px;
  padding: 13px 8px; border-bottom: 1px solid var(--line);
  transition: background .25s, padding-left .25s;
}
.type-index i { font-family: var(--f-mono); font-style: normal; font-size: 11px; color: var(--faint); }
.type-index span { font-weight: 700; color: var(--chalk); font-size: 17px; }
.type-index b { margin-left: auto; font-family: var(--f-mono); font-weight: 500; font-size: 13.5px; color: var(--accent); font-variant-numeric: tabular-nums; }
.type-index li > a:hover { background: rgba(245, 165, 36, .05); padding-left: 16px; }
.type-index__soon { opacity: .5; }
.type-index__soon b { color: var(--faint); font-style: italic; }

/* legend + spec sheet (_02_ right) */
.legend { display: flex; flex-direction: column; gap: 18px; }
.legend__badges {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 18px; border: 1px solid var(--line); border-radius: var(--r-m);
  background: color-mix(in srgb, var(--panel) 60%, transparent);
}
.legend__label { width: 100%; font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.badge--dashed { color: var(--dim); border: 1px dashed var(--faint); background: none; }
.spec-sheet {
  display: block; padding: 20px 22px;
  border: 1px solid rgba(245, 165, 36, .3); border-radius: var(--r-l);
  background: linear-gradient(150deg, var(--panel-2), var(--panel));
  transition: transform .3s var(--ease-spring), box-shadow .3s var(--ease-out), border-color .25s;
}
.spec-sheet:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 16px 44px -18px rgba(245, 165, 36, .4); }
.spec-sheet__kicker { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.spec-sheet__name { font-family: var(--f-display); font-weight: 800; font-size: 24px; color: var(--chalk); margin-bottom: 14px; }
.spec-sheet__name small { font-family: var(--f-body); font-weight: 500; font-size: 13px; color: var(--faint); margin-left: 10px; }
.spec-sheet dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; margin-bottom: 16px; }
.spec-sheet dt { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.spec-sheet dd { font-weight: 600; color: var(--ink); font-size: 14.5px; }
.spec-sheet dd.good { color: var(--moss); }
.spec-sheet__go { font-size: 13.5px; font-weight: 700; color: var(--amber-hot); }
.legend__note { font-size: 13.5px; color: var(--faint); line-height: 1.6; }
.legend__note b { color: var(--amber-hot); }
.legend__note a { color: var(--dim); text-decoration: underline; text-underline-offset: 3px; }
.legend__note a:hover { color: var(--amber-hot); }

/* city TOC (_03_) — dotted leaders */
.city-toc {
  list-style: none; column-count: 3; column-gap: clamp(28px, 4vw, 64px);
  margin-top: 30px; border-top: 1px solid var(--line); padding-top: 22px;
}
.city-toc li { break-inside: avoid; }
.city-toc a {
  display: flex; align-items: baseline; gap: 8px;
  padding: 8px 2px; font-size: 15.5px; color: var(--dim); font-weight: 600;
  transition: color .25s;
}
.city-toc a::after { content: ''; order: 2; flex: 1; border-bottom: 1px dotted var(--faint); opacity: .5; transform: translateY(-3px); transition: opacity .25s; }
.city-toc span { order: 1; }
.city-toc b { order: 3; font-family: var(--f-mono); font-weight: 500; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; transition: color .25s; }
.city-toc a:hover { color: var(--chalk); }
.city-toc a:hover::after { opacity: 1; }
.city-toc a:hover b { color: var(--amber-hot); }

/* voivodeship grid (_04_) */
.voiv-grid { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 30px; }
.voiv-grid a {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 16px 16px 14px; border: 1px solid var(--line); border-radius: var(--r-m);
  transition: border-color .25s, background .25s, transform .3s var(--ease-spring);
}
.voiv-grid i { font-family: var(--f-mono); font-style: normal; font-size: 10.5px; letter-spacing: .18em; color: var(--accent); }
.voiv-grid span { font-size: 13.5px; color: var(--dim); }
.voiv-grid b { font-family: var(--f-mono); font-weight: 500; font-size: 26px; color: var(--chalk); font-variant-numeric: tabular-nums; transition: color .25s; }
.voiv-grid a:hover { border-color: rgba(245, 165, 36, .45); background: rgba(245, 165, 36, .05); transform: translateY(-3px); }
.voiv-grid a:hover b { color: var(--amber-hot); }

/* hero map preview (right column) — paw stamps from live data */
.hero-map {
  position: relative; display: block; width: 100%; max-width: 520px;
  justify-self: end; padding: 0 0 30px; /* room for the floating CTA */
  transition: transform .35s var(--ease-spring);
}
.hero-map:hover { transform: translateY(-5px); }
.hero-map svg {
  width: 100%; height: auto; display: block;
  filter: drop-shadow(0 0 34px rgba(245, 165, 36, .1));
  transition: filter .4s var(--ease-out);
}
.hero-map:hover svg { filter: drop-shadow(0 0 48px rgba(245, 165, 36, .22)); }
#hero-dots use { fill: var(--accent); opacity: .8; }

/* Poland silhouette + CTA (hero map) */
.hero-map__shape {
  fill: rgba(245, 165, 36, .05); stroke: rgba(245, 165, 36, .45);
  stroke-width: .7; stroke-linejoin: round; transition: fill .35s var(--ease-out);
}
.hero-map:hover .hero-map__shape { fill: rgba(245, 165, 36, .1); }
.hero-map__cta { position: absolute; left: 0; right: 0; bottom: clamp(14px, 2vw, 24px); display: flex; justify-content: center; pointer-events: none; }
.hero-map__cta .btn { pointer-events: none; padding: 12px 22px; font-size: 14px; }
.hero-map__cta b { font-weight: 700; display: inline-block; transition: transform .3s var(--ease-spring); }
.hero-map:hover .hero-map__cta b { transform: translateX(5px); }

/* closing plate (_05_) */
.plate { position: relative; overflow: hidden; isolation: isolate; padding: clamp(64px, 9vw, 120px) var(--pad); }
.plate__inner { max-width: 860px; margin: 0 auto; text-align: center; }
.plate__inner .kicker, .plate__inner h2 { text-align: center; }
.plate__inner h2 { margin-left: auto; margin-right: auto; }
.plate__inner .chapter__copy { margin: 0 auto 30px; }
.plate__ghost { right: auto; left: 2vw; }
.plate__return { max-width: 560px; margin: 0 auto; }
.plate__return h3 { font-size: clamp(20px, 2.2vw, 27px); color: var(--chalk); margin-bottom: 18px; }
.plate__return .search { margin: 0 auto; }
.plate__colophon { margin-top: 44px; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.plate__colophon a { color: var(--dim); }
.plate__colophon a:hover { color: var(--amber-hot); }

/* load choreography — pure CSS, tight timings so LCP stays early */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .7s var(--ease-out) both; }
  .rise-1 { animation-delay: .05s; } .rise-2 { animation-delay: .14s; }
  .rise-3 { animation-delay: .24s; } .rise-4 { animation-delay: .36s; }
  @keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
}

/* search — the primary job, one warm pill of lamplight */
.search {
  display: flex; gap: 8px; align-items: center;
  max-width: 560px; padding: 7px 7px 7px 20px;
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  box-shadow: var(--shadow-1);
  transition: border-color .3s var(--ease-out), box-shadow .3s var(--ease-out), transform .3s var(--ease-out);
}
.search:focus-within { border-color: var(--accent); box-shadow: var(--glow-amber); transform: translateY(-2px); }
.search input {
  flex: 1; min-width: 0; background: none; border: 0; color: var(--ink);
  font: 500 16px/1 var(--f-body); padding: 12px 0;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; border-radius: var(--r-pill);
  font: 700 15px/1 var(--f-body); padding: 14px 24px;
  transition: transform .25s var(--ease-spring), box-shadow .3s var(--ease-out), background .3s var(--ease-out);
  will-change: transform;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--amber-hot); box-shadow: 0 6px 26px rgba(245, 165, 36, .35); transform: translateY(-1px); }
.btn--primary:active { transform: translateY(0) scale(.98); }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--accent); color: var(--amber-hot); }

/* ============================================================
   LIST / HUB
   ============================================================ */
[data-page="list"] .page-main > header { max-width: 860px; }
#hub-h1 { font-size: clamp(34px, 5.6vw, 68px); color: var(--chalk); margin-bottom: 14px; }
.hub-intro { color: var(--dim); font-size: clamp(15px, 1.5vw, 18px); max-width: 68ch; }
.hub-intro b { color: var(--amber-hot); font-variant-numeric: tabular-nums; }

#filters {
  position: sticky; top: 64px; z-index: 50;
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin: 26px 0 10px; padding: 10px;
  background: color-mix(in srgb, var(--bg-2) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--r-m);
}
#filters input[type="search"] {
  flex: 2 1 200px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-s); color: var(--ink); font: 500 15px/1 var(--f-body);
  padding: 13px 16px; transition: border-color .25s, box-shadow .25s;
}
#filters input[type="search"]:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow-amber); }
#filters select {
  flex: 1 1 160px; appearance: none; -webkit-appearance: none;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23f5a524' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid var(--line); border-radius: var(--r-s); color: var(--ink);
  font: 500 15px/1 var(--f-body); padding: 13px 38px 13px 14px; cursor: pointer;
  transition: border-color .25s;
}
#filters select:hover { border-color: var(--accent); }
#filters select:disabled { opacity: .45; cursor: default; }
#filters button { padding: 13px 24px; }

#results-count {
  font-family: var(--f-mono); font-size: 13px; color: var(--faint);
  letter-spacing: .12em; text-transform: uppercase; margin: 16px 2px 14px;
}

/* city browser (bare /szukaj) — chip cloud */
#city-browser h2 { margin: 18px 0 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; }
.chip {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 10px 17px; border-radius: var(--r-pill);
  background: var(--panel); border: 1px solid var(--line);
  font-weight: 600; font-size: 14.5px;
  transition: border-color .25s var(--ease-out), background .25s var(--ease-out), transform .25s var(--ease-spring);
}
.chip small { color: var(--accent); font-size: 12px; }
.chip:hover { border-color: var(--accent); background: var(--panel-2); transform: translateY(-3px); }
.city-browser__note { margin-top: 22px; font-size: 13.5px; color: var(--faint); }

/* result cards */
#results, #related { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
#related { grid-template-columns: repeat(3, 1fr); }
.card a {
  position: relative; display: flex; flex-direction: column; gap: 8px; height: 100%;
  padding: 20px 20px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m);
  transition: transform .3s var(--ease-spring), border-color .25s var(--ease-out), background .25s var(--ease-out);
  overflow: hidden;
}
.card a::after { /* amber baseline sweep */
  content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--amber-hot));
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease-out);
}
.card a:hover { transform: translateY(-4px); border-color: rgba(245, 165, 36, .4); background: var(--panel-2); }
.card a:hover::after { transform: scaleX(1); }
.card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card__name { font-size: 17px; font-weight: 700; color: var(--chalk); line-height: 1.3; }
.card__arrow { flex: 0 0 18px; width: 18px; height: 18px; color: var(--accent); opacity: 0; transform: translate(-6px, 6px); transition: all .3s var(--ease-spring); }
.card a:hover .card__arrow { opacity: 1; transform: none; }
.card__meta { color: var(--faint); font-size: 13.5px; }
.card__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.badge {
  font: 500 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 9px; border-radius: var(--r-pill); font-style: normal;
}
.badge--good { color: var(--moss); background: var(--moss-soft); border: 1px solid rgba(159, 201, 120, .3); }
.badge--warn { color: var(--rust); background: var(--rust-soft); border: 1px solid rgba(224, 100, 77, .3); }
.badge--info { color: var(--dim); background: rgba(243, 236, 221, .06); border: 1px solid var(--line); }

/* results + sticky map split (hub/search pages) */
.list-bar { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.list-openmap {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-pill);
  transition: border-color .25s, background .25s;
}
.list-openmap:hover { border-color: var(--accent); background: var(--accent-soft); }
.list-openmap span { display: inline-block; transition: transform .3s var(--ease-spring); }
.list-openmap:hover span { transform: translateX(4px); }

.list-split { display: block; }
.list-split.has-map {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: clamp(18px, 2.4vw, 34px); align-items: start;
}
.list-split.has-map #results { grid-template-columns: 1fr; } /* single column beside the map */
.list-map-wrap {
  position: sticky; top: 78px; height: min(72vh, 720px);
  border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden;
  box-shadow: var(--shadow-1);
}
#list-map { width: 100%; height: 100%; background: var(--bg-2); }
/* marker-hover echoes onto the card */
.card--hot a { border-color: rgba(245, 165, 36, .55); background: var(--panel-2); box-shadow: 0 12px 34px -18px rgba(245, 165, 36, .5); }
@media (max-width: 900px) {
  .list-split.has-map { display: block; }
  .list-map-wrap { display: none; }        /* heavy JS opt-in — skipped on mobile */
}

/* ============================================================
   ITEM (detail)
   ============================================================ */
#item-kicker, #item-meta {
  font-family: var(--f-mono); font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}
#item-name { font-size: clamp(36px, 6vw, 76px); color: var(--chalk); margin-bottom: 26px; max-width: 18ch; }
.item-cols { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; align-items: start; margin-bottom: 44px; }

#item-facts { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.fact {
  display: grid; grid-template-columns: 150px 1fr; gap: 14px;
  padding: 16px 20px; background: var(--panel);
}
.fact + .fact { border-top: 1px solid var(--line); }
.fact dt { font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); padding-top: 3px; }
.fact dd { color: var(--ink); font-weight: 500; }
#item-source { margin-top: 12px; }
#item-source a { color: var(--dim); font-size: 14px; border-bottom: 1px dashed var(--line); transition: color .25s, border-color .25s; }
#item-source a:hover { color: var(--amber-hot); border-color: var(--amber-hot); }

.map-card {
  position: relative; overflow: hidden; min-height: 240px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  padding: 24px; border: 1px solid var(--line); border-radius: var(--r-l);
  background:
    repeating-radial-gradient(circle at 70% 30%, transparent 0 34px, rgba(243, 236, 221, .05) 34px 35px),
    radial-gradient(500px 300px at 70% 20%, rgba(245, 165, 36, .12), transparent 70%),
    linear-gradient(160deg, var(--panel-2), var(--bg-2));
}
.map-card::before {
  content: ''; position: absolute; top: 27%; left: 66%; width: 14px; height: 14px;
  background: var(--accent); border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  box-shadow: 0 0 0 6px rgba(245, 165, 36, .18), 0 0 30px rgba(245, 165, 36, .5);
}
@media (prefers-reduced-motion: no-preference) {
  .map-card::before { animation: pin-pulse 2.4s var(--ease-out) infinite; }
  @keyframes pin-pulse {
    0%, 100% { box-shadow: 0 0 0 6px rgba(245, 165, 36, .18), 0 0 30px rgba(245, 165, 36, .5); }
    50% { box-shadow: 0 0 0 12px rgba(245, 165, 36, .07), 0 0 40px rgba(245, 165, 36, .6); }
  }
}
.map-card__coords { font-family: var(--f-mono); font-size: 15px; color: var(--amber-hot); }
.map-card__city { color: var(--dim); font-size: 14px; margin-bottom: 12px; }
.map-card__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* FAQ accordion */
#item-faq h2, #item-related h2 { margin-bottom: 18px; }
#item-faq { margin-bottom: 44px; }
.faq {
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--panel);
  margin-bottom: 8px; overflow: hidden; transition: border-color .25s var(--ease-out);
}
.faq[open], .faq:hover { border-color: rgba(245, 165, 36, .35); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  cursor: pointer; list-style: none; padding: 18px 20px;
  font-weight: 600; color: var(--chalk);
}
.faq summary::-webkit-details-marker { display: none; }
.faq__ico { position: relative; flex: 0 0 14px; height: 14px; }
.faq__ico::before, .faq__ico::after {
  content: ''; position: absolute; inset: 0; margin: auto; background: var(--accent);
  transition: transform .3s var(--ease-spring);
}
.faq__ico::before { width: 14px; height: 2px; }
.faq__ico::after { width: 2px; height: 14px; }
.faq[open] .faq__ico::after { transform: rotate(90deg) scaleY(0); }
.faq[open] .faq__ico::before { transform: rotate(180deg); }
.faq__body { overflow: hidden; }
.faq__body p { padding: 0 20px 18px; color: var(--dim); max-width: 70ch; }

#item-loading { color: var(--faint); font-family: var(--f-mono); padding: 40px 0; }

/* ---------- community: ratings + report form ---------- */
.community { margin-bottom: 44px; }
.community h2 { margin-bottom: 14px; }
.rscore { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.rscore b { font-family: var(--f-display); font-size: 34px; color: var(--amber-hot); }
.rstars { color: var(--accent); font-size: 19px; letter-spacing: 3px; }
.rscore small { color: var(--faint); font-size: 13px; }
.rscore--empty { color: var(--faint); }
.rpick { display: inline-flex; gap: 2px; }
.rpick__star {
  background: none; border: 0; cursor: pointer; padding: 4px;
  font-size: 30px; line-height: 1; color: var(--faint);
  transition: color .15s, transform .2s var(--ease-spring);
}
.rpick__star:hover { transform: scale(1.2); }
.rpick__star.is-on { color: var(--accent); text-shadow: 0 0 18px rgba(245, 165, 36, .45); }
.rnote { margin-top: 6px; font-size: 13px; color: var(--moss); min-height: 18px; }

.report-intro { color: var(--dim); font-size: 14.5px; margin-bottom: 16px; max-width: 60ch; }
#report-form { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
#report-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.rf { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--faint); }
.rf select, #report-form textarea, #report-form input[type="email"] {
  appearance: none; -webkit-appearance: none; width: 100%;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-s);
  color: var(--ink); font: 500 14px/1.4 var(--f-body); padding: 10px 12px;
}
.rf select { background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23f5a524' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center; padding-right: 32px; cursor: pointer; }
#report-form textarea { resize: vertical; }
#report-form :focus { outline: none; border-color: var(--accent); }
#report-form button { align-self: flex-start; }
#r-www { position: absolute; left: -9999px; height: 0; opacity: 0; pointer-events: none; }
.report-note { font-size: 13.5px; color: var(--moss); min-height: 18px; }
@media (max-width: 640px) { #report-fields { grid-template-columns: 1fr; } }

/* ============================================================
   REVEAL SYSTEM (fx.js toggles .in; without JS everything shows)
   ============================================================ */
html.fx .reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 55ms);
}
html.fx .reveal.in { opacity: 1; transform: none; }
html.fx-off .reveal { opacity: 1 !important; transform: none !important; }

/* paw-print cursor stamps (spawned by fx.js) */
.paw-stamp {
  position: absolute; z-index: 1; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  color: rgba(245, 165, 36, .5); pointer-events: none;
  transform: rotate(var(--rot, 0deg));
  animation: paw-fade 1.3s var(--ease-out) forwards;
}
@keyframes paw-fade {
  0% { opacity: 0; scale: .6; } 18% { opacity: 1; scale: 1; }
  100% { opacity: 0; scale: 1; }
}

/* ---------- footer (sitemap-style link lists) ---------- */
footer {
  margin-top: 70px; padding: 50px var(--pad) 60px;
  border-top: 1px solid var(--line);
  color: var(--faint); font-size: 14px;
}
footer .foot-inner { max-width: var(--maxw); margin: 0 auto; }
.foot-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 30px clamp(24px, 4vw, 60px);
}
.foot-brand strong { font-family: var(--f-display); font-size: 20px; color: var(--ink); }
.foot-brand p { margin-top: 8px; color: var(--faint); max-width: 26ch; }
.foot-grid nav { display: flex; flex-direction: column; gap: 9px; }
.foot-grid h3 {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 4px;
}
footer a { color: var(--dim); transition: color .25s; width: fit-content; }
footer a:hover { color: var(--amber-hot); }
.foot-bottom {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between;
  font-size: 13px; color: var(--faint);
}

/* ---------- /mapa: floating filters (left) + viewport list (right) ---------- */
.map-shell { display: grid; grid-template-columns: 1fr 380px; height: calc(100svh - 61px); }
.map-stage { position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: var(--bg-2); }

.map-filters {
  position: absolute; z-index: 1100; top: 16px; left: 16px; width: 264px;
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px;
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: var(--r-l);
  box-shadow: var(--shadow-1);
}
.map-filters h1 { font-size: 19px; color: var(--chalk); margin-bottom: 2px; }
.map-filters input[type="search"], .map-filters select {
  width: 100%; appearance: none; -webkit-appearance: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-s);
  color: var(--ink); font: 500 14px/1.2 var(--f-body); padding: 10px 12px;
  transition: border-color .25s;
}
.map-filters select {
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23f5a524' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center;
  padding-right: 32px; cursor: pointer;
}
.map-filters input:focus, .map-filters select:focus { outline: none; border-color: var(--accent); }
.mf-check {
  display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; color: var(--dim); cursor: pointer; user-select: none;
}
.mf-check input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.mf-check:hover { color: var(--ink); }
.mf-near { display: flex; gap: 8px; align-items: center; }
.mf-near .near-me { margin: 0; flex: 1; justify-content: center; padding: 9px 10px; }
.mf-near select { flex: 0 0 96px; }
.mf-near select:disabled { opacity: .45; cursor: default; }
.mf-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
#map-count { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.mf-reset { background: none; border: 0; cursor: pointer; color: var(--faint); font: 600 12.5px var(--f-body); text-decoration: underline; text-underline-offset: 3px; }
.mf-reset:hover { color: var(--amber-hot); }

/* right dock: places in viewport */
.map-list { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--bg-2); }
.map-list header {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.map-list h2 { font-size: 16px; color: var(--chalk); }
#list-count { font-family: var(--f-mono); font-size: 12px; color: var(--accent); }
#list-items { list-style: none; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
#list-items li {
  padding: 12px 18px; border-bottom: 1px solid var(--line); cursor: pointer;
  transition: background .2s, box-shadow .2s;
}
#list-items li:hover { background: rgba(245, 165, 36, .05); }
#list-items li.is-active { background: rgba(245, 165, 36, .09); box-shadow: inset 3px 0 0 var(--accent); }
.mli__top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.mli__top b { font-size: 14.5px; color: var(--chalk); line-height: 1.3; }
.mli__go { flex: 0 0 auto; color: var(--accent); font-weight: 700; padding: 0 2px; }
.mli__go:hover { color: var(--amber-hot); }
.mli__meta { display: block; margin-top: 2px; font-size: 12.5px; color: var(--faint); }
.mli__badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.mli__badges .badge { font-size: 10px; padding: 4px 7px; }
#list-more { padding: 12px 18px; font-size: 12.5px; color: var(--faint); }

/* mobile: list becomes a slide-over sheet */
.map-list-toggle {
  display: none; position: absolute; z-index: 1100; bottom: 18px; right: 14px;
  padding: 12px 20px; border: 0; border-radius: var(--r-pill); cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: 700 14px var(--f-body);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
}
.map-list-toggle b { font-family: var(--f-mono); font-weight: 500; }

.leaflet-container { font-family: var(--f-body); }
.leaflet-tile { filter: grayscale(.25) brightness(.92); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel-2); color: var(--ink); box-shadow: var(--shadow-1); }
.leaflet-popup-content { margin: 12px 16px; line-height: 1.5; }
.leaflet-popup-content a { color: var(--amber-hot); font-weight: 600; }
.leaflet-popup-content i { color: var(--rust); font-style: normal; font-size: 12px; }

@media (max-width: 900px) {
  .map-shell { grid-template-columns: 1fr; }
  .map-list {
    position: fixed; z-index: 1200; inset: auto 0 0 0; height: 62svh;
    border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0;
    transform: translateY(105%); transition: transform .35s var(--ease-out);
  }
  .map-list.is-open { transform: none; }
  .map-list-toggle { display: block; }
  .map-filters { width: calc(100% - 32px); max-width: 320px; }
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .item-cols { grid-template-columns: 1fr; }
  #related { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  /* journal: single column, colophon tucks under the lead */
  .journal__grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-map { max-width: 420px; justify-self: start; }
  .toc { grid-template-columns: 1fr 1fr; border-top: 0; gap: 0; }
  .toc a { border-top: 1px solid var(--line); padding: 14px 6px; }
  .chapter__grid { grid-template-columns: 1fr; gap: 30px; }
  .city-toc { column-count: 2; }
  .voiv-grid { grid-template-columns: repeat(2, 1fr); }
  .journal__ghost, .chapter__ghost, .plate__ghost { font-size: clamp(120px, 30vw, 220px); opacity: .7; }
}
@media (max-width: 640px) {
  #results, #related { grid-template-columns: 1fr; }
  .search { flex-direction: row; padding-left: 16px; }
  .fact { grid-template-columns: 110px 1fr; }
  #filters { top: 58px; }
  .cookie { left: 12px; right: 12px; }
  .foot-grid { grid-template-columns: 1fr; }
  .map-topbar h1 { font-size: 17px; }
  .journal__title { font-size: clamp(34px, 11vw, 44px); }
  .dateline { flex-wrap: wrap; letter-spacing: .14em; }
  .toc { grid-template-columns: 1fr; }
  .toc b { padding-right: 0; }
  .city-toc { column-count: 1; }
  .index-list span { font-size: 18px; }
  .spec-sheet dl { grid-template-columns: 1fr; }
}
