:root {
  color-scheme: light;
  --ink: #19211c;
  --muted: #65706a;
  --panel: #ffffff;
  --line: #dce4de;
  --soft: #f4f7f1;
  --green: #1f6f53;
  --gold: #b98523;
  --clay: #a85735;
  --blue: #345f8f;
  --plum: #694d72;
  --shadow: 0 18px 55px rgba(22, 31, 27, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f8faf6;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(25, 33, 28, 0.08);
  background: rgba(248, 250, 246, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  min-width: 210px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), #263f34);
  font-weight: 800;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav a,
.button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  background: #fff;
  color: var(--ink);
}

.nav a {
  padding: 9px 12px;
  font-size: 14px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: clamp(24px, 4vw, 54px);
  align-items: stretch;
  padding: clamp(36px, 7vw, 82px) clamp(18px, 5vw, 72px) 28px;
  background:
    linear-gradient(120deg, rgba(31, 111, 83, 0.9), rgba(25, 33, 28, 0.88)),
    url("https://images.unsplash.com/photo-1599946347371-68eb71b16afc?auto=format&fit=crop&w=1800&q=80") center/cover;
  color: #fff;
}

.hero-copy {
  max-width: 980px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.section-band .eyebrow {
  border-color: rgba(31, 111, 83, 0.18);
  color: var(--green);
  background: rgba(31, 111, 83, 0.08);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 1040px;
  margin-bottom: 18px;
  font-size: clamp(42px, 6.5vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero p {
  max-width: 810px;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 15px;
  font-weight: 800;
  cursor: pointer;
}

.button.primary {
  border-color: #d8ac54;
  background: #f4c76a;
  color: #1d201b;
}

.button.secondary {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.market-panel {
  display: grid;
  align-content: end;
  gap: 12px;
}

.market-panel > div {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
}

.metric {
  display: block;
  font-size: 42px;
  font-weight: 900;
}

.metric-label {
  color: rgba(255, 255, 255, 0.78);
}

.notice,
.workspace,
.section-band {
  margin: 0 auto;
  width: min(1480px, calc(100% - 36px));
}

.notice {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #ead8ad;
  border-radius: 8px;
  background: #fff7df;
  color: #53411c;
  line-height: 1.45;
}

.workspace {
  padding: 24px 0;
}

.toolbar {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(160px, 0.55fr));
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(22, 31, 27, 0.06);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fbfcfa;
  font: inherit;
}

.search-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(420px, 1.05fr);
  gap: 16px;
  align-items: start;
}

.map-shell,
.list-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.map-shell {
  position: sticky;
  top: 88px;
  padding: 16px;
}

.map-head,
.list-head,
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.map-head h2,
.list-head h2,
.section-head h2 {
  margin-bottom: 4px;
  font-size: 24px;
  letter-spacing: 0;
}

.map-head p,
.section-head p {
  color: var(--muted);
  margin-bottom: 0;
  line-height: 1.45;
}

.count-pill {
  flex: none;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--green);
  font-weight: 900;
  font-size: 13px;
}

.sa-map {
  position: relative;
  min-height: 460px;
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.68), transparent 18%),
    linear-gradient(150deg, #dfeadd, #eef2df 54%, #d9e7ed);
}

.sa-map::before {
  content: "";
  position: absolute;
  inset: 9% 10% 12% 9%;
  background: #d0dfc5;
  clip-path: polygon(16% 29%, 26% 17%, 49% 13%, 73% 18%, 86% 34%, 82% 54%, 69% 70%, 44% 84%, 24% 75%, 12% 53%);
  border: 1px solid rgba(31, 111, 83, 0.2);
}

.province-label {
  position: absolute;
  color: rgba(25, 33, 28, 0.5);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  pointer-events: none;
}

.marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 10px 18px rgba(25, 33, 28, 0.22);
  cursor: pointer;
}

.marker::after {
  content: attr(data-count);
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.marker.sheriff,
.dot.sheriff,
.badge.sheriff {
  background: var(--clay);
}

.marker.bank,
.dot.bank,
.badge.bank {
  background: var(--green);
}

.marker.portal,
.dot.portal,
.badge.portal {
  background: var(--blue);
}

.marker.gazette,
.dot.gazette,
.badge.gazette {
  background: var(--plum);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
}

.list-shell {
  padding: 16px;
}

.listing-grid {
  display: grid;
  gap: 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: #fff;
}

.card:hover {
  border-color: rgba(31, 111, 83, 0.45);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.card h3 {
  margin-bottom: 5px;
  font-size: 18px;
}

.address {
  color: var(--muted);
  font-size: 14px;
}

.price {
  margin: 12px 0 10px;
  font-size: 22px;
  font-weight: 900;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.meta span,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.meta span {
  background: var(--soft);
  color: var(--muted);
}

.badge {
  color: #fff;
  flex: none;
}

.confidence {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.confidence meter {
  width: 120px;
}

.empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.section-band {
  padding: 40px 0;
}

.section-head {
  align-items: end;
}

.section-head > div,
.section-head {
  max-width: 950px;
}

.province-grid,
.source-grid,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.province-card,
.source-card,
.event-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(22, 31, 27, 0.06);
}

.province-card button {
  width: 100%;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.province-card h3,
.source-card h3,
.event-card h3 {
  margin-bottom: 8px;
}

.city-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.city-list span {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.source-card p,
.event-card p,
.roadmap span {
  color: var(--muted);
  line-height: 1.5;
}

.source-link {
  display: inline-flex;
  margin-top: 10px;
  color: var(--green);
  font-weight: 900;
  text-decoration: none;
}

.roadmap {
  display: grid;
  gap: 12px;
  padding-left: 0;
  list-style: none;
  counter-reset: roadmap;
}

.roadmap li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.roadmap li::before {
  counter-increment: roadmap;
  content: counter(roadmap);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
}

.roadmap strong,
.roadmap span {
  grid-column: 2;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 26px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
}

@media (max-width: 980px) {
  .topbar,
  .hero,
  .toolbar,
  .search-layout,
  .province-grid,
  .source-grid,
  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

  .map-shell {
    position: static;
  }
}

@media (max-width: 680px) {
  .topbar {
    position: static;
  }

  .nav {
    justify-content: flex-start;
  }

  .nav a {
    padding: 8px 10px;
  }

  .hero {
    padding-top: 32px;
  }

  h1 {
    font-size: 40px;
  }

  .market-panel {
    grid-template-columns: 1fr;
  }

  .sa-map {
    min-height: 360px;
  }

  .map-head,
  .list-head,
  .section-head,
  .card-top,
  .confidence {
    display: grid;
  }

  .roadmap li {
    grid-template-columns: 42px 1fr;
  }
}
