:root {
  --navy: #0F1B2B;
  --navy-card: #17263B;
  --navy-border: #24374F;
  --cream: #F5F1E8;
  --cream-dim: #B9C4D1;
  --amber: #F2A65A;
  --cyan: #5EC8D8;
  --gradient: linear-gradient(90deg, var(--cyan), var(--amber));
}
[data-theme="light"] {
  --navy: #EEF1F0;
  --navy-card: #FFFFFF;
  --navy-border: #D8DEDC;
  --cream: #14202E;
  --cream-dim: #4A5A6B;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--navy);
  color: var(--cream);
  font-family: 'Inter', sans-serif;
  transition: background .3s ease, color .3s ease;
}
.gradient-bar { height: 4px; width: 100%; background: var(--gradient); }
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px; border-bottom: 1px solid var(--navy-border);
}
.logo { display: flex; align-items: center; gap: 10px; font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.3rem; text-decoration: none; color: var(--cream); }
.logo-mark { width: 28px; height: 28px; border-radius: 50%; background: var(--gradient); flex-shrink: 0; }
nav { display: flex; align-items: center; gap: 24px; }
nav a { color: var(--cream-dim); text-decoration: none; font-size: .95rem; font-weight: 500; }
nav a:hover { color: var(--cream); }
#theme-toggle {
  background: var(--navy-card); border: 1px solid var(--navy-border); color: var(--cream);
  border-radius: 20px; padding: 8px 16px; cursor: pointer; font-size: .85rem; font-family: 'Inter', sans-serif;
}
.hero {
  padding: 72px 32px 56px; max-width: 760px; margin: 0 auto; text-align: center;
}
.hero .eyebrow {
  font-family: 'IBM Plex Mono', monospace; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--amber); margin-bottom: 18px; display: block;
}
.hero h1 {
  font-family: 'Fraunces', serif; font-weight: 600; font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.08; margin: 0 0 20px;
}
.hero h1 .warm { color: var(--amber); }
.hero h1 .cool { color: var(--cyan); }
.hero p { color: var(--cream-dim); font-size: 1.08rem; line-height: 1.6; max-width: 560px; margin: 0 auto 32px; }
.hero-bar { height: 3px; width: 120px; background: var(--gradient); margin: 0 auto 32px; border-radius: 2px; }
.stats { display: flex; justify-content: center; gap: 40px; margin-top: 8px; }
.stat { text-align: left; }
.stat .num { font-family: 'IBM Plex Mono', monospace; font-size: 1.5rem; font-weight: 500; }
.stat .label { font-size: .8rem; color: var(--cream-dim); }

.breadcrumb { max-width: 1080px; margin: 20px auto 0; padding: 0 32px; font-family: 'Inter', sans-serif; font-size: .85rem; color: var(--cream-dim); }
.breadcrumb a { color: var(--cream-dim); }

.filters { max-width: 1080px; margin: 0 auto; padding: 0 32px 12px; }
.filters-label { font-size: .8rem; color: var(--cream-dim); margin-bottom: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  border: 1px solid var(--navy-border); background: var(--navy-card); color: var(--cream);
  padding: 9px 18px; border-radius: 20px; font-size: .88rem; font-weight: 500; cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.chip.active { background: var(--gradient); color: #10161F; border-color: transparent; font-weight: 600; }

.grid {
  max-width: 1080px; margin: 32px auto 80px; padding: 0 32px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px;
}
.card {
  background: var(--navy-card); border: 1px solid var(--navy-border); border-radius: 14px;
  padding: 22px; position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gradient);
  opacity: 0; transition: opacity .2s ease;
}
.card:hover::before { opacity: 1; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.card h3 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.15rem; margin: 0 0 4px; }
.county-tag { font-size: .78rem; color: var(--cream-dim); font-family: 'IBM Plex Mono', monospace; }
.rating { font-family: 'IBM Plex Mono', monospace; font-size: .95rem; color: var(--amber); font-weight: 500; white-space: nowrap; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; }
.badge { font-size: .74rem; padding: 4px 10px; border-radius: 12px; border: 1px solid var(--navy-border); color: var(--cream-dim); }
.badge.mcs { background: rgba(94,200,216,0.14); border-color: var(--cyan); color: var(--cyan); font-weight: 600; }
.card-footer { display: flex; gap: 10px; margin-top: 4px; }
.card-footer a {
  flex: 1; text-align: center; padding: 9px; border-radius: 8px; font-size: .85rem; font-weight: 600;
  text-decoration: none;
}
.btn-primary { background: var(--gradient); color: #10161F; }
.btn-secondary { border: 1px solid var(--navy-border); color: var(--cream); }

.county-links { max-width: 1080px; margin: 0 auto 60px; padding: 0 32px; }
.county-links h2 { font-family: 'Fraunces', serif; font-size: 1.3rem; margin-bottom: 16px; }
.county-links-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.county-links-grid a {
  border: 1px solid var(--navy-border); background: var(--navy-card); color: var(--cream);
  padding: 9px 18px; border-radius: 20px; font-size: .88rem; font-weight: 500; text-decoration: none; font-family: 'Inter', sans-serif;
}
.county-links-grid a.current { background: var(--gradient); color: #10161F; font-weight: 600; border-color: transparent; }

footer { border-top: 1px solid var(--navy-border); padding: 32px; text-align: center; color: var(--cream-dim); font-size: .85rem; }
.empty { text-align: center; padding: 60px 20px; color: var(--cream-dim); grid-column: 1 / -1; }

.map-section { max-width: 1080px; margin: 40px auto 0; padding: 0 32px; }
.map-section .filters-label { margin-bottom: 12px; }
#map {
  height: 420px; width: 100%; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--navy-border);
}
.leaflet-popup-content-wrapper { background: var(--navy-card); color: var(--cream); border-radius: 10px; }
.leaflet-popup-tip { background: var(--navy-card); }
.map-popup h4 { font-family: 'Fraunces', serif; margin: 0 0 4px; font-size: 1rem; }
.map-popup-county { font-family: 'IBM Plex Mono', monospace; font-size: .74rem; color: var(--cream-dim); margin-bottom: 6px; }
.map-popup-rating { font-family: 'IBM Plex Mono', monospace; font-size: .8rem; color: var(--amber); margin-bottom: 8px; }
.map-popup-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.map-popup-actions { display: flex; gap: 8px; }
.map-popup-actions a { font-size: .8rem; font-weight: 600; text-decoration: none; padding: 5px 10px; border-radius: 6px; }
.map-popup-actions a:first-child { border: 1px solid var(--navy-border); color: var(--cream); }
.map-popup-actions a:last-child { background: var(--gradient); color: #10161F; }
