:root {
  --bg: #f4f1ea;
  --paper: #fffdf9;
  --ink: #1c1a16;
  --mute: #5d5850;
  --line: #ddd6c8;
  --brand: #163f3a;
  --brand-2: #21554e;
  --accent: #b4531e;
  --accent-2: #8d3f14;
  --good: #1f6b43;
  --bad: #9a2f1f;
  --chip: #e8f0ed;
  --shadow: 0 10px 28px rgba(22, 63, 58, 0.08);
  --radius: 14px;
  --max: 1120px;
  --sans: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--brand-2); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.22;
  color: var(--ink);
}
h1 { font-size: clamp(1.85rem, 3.4vw, 2.55rem); margin: 0 0 12px; }
h2 { font-size: clamp(1.28rem, 2vw, 1.5rem); margin: 0; }
h3 { font-size: 1.08rem; margin: 0; }

.wrap { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: #fff;
  padding: 8px 12px;
  z-index: 80;
}
.skip:focus { left: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 241, 234, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-top {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex: 0 0 auto;
}
.mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
}
.brand strong { display: block; font-size: 1.02rem; line-height: 1.15; font-weight: 700; }
.brand small { display: block; color: var(--mute); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }

.header-search {
  flex: 1;
  display: flex;
  gap: 8px;
  min-width: 0;
}
.header-search input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 44px;
}
.header-search button {
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}
.header-actions { display: flex; align-items: center; gap: 10px; }

.subnav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 12px;
}
.subnav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.subnav a:hover, .subnav a.is-on { background: #fff; color: var(--brand); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  min-height: 44px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.btn-dark { background: var(--brand); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.menu-btn { display: none; }

.drawer {
  display: none;
  padding: 8px 0 16px;
  border-top: 1px solid var(--line);
}
.drawer.open { display: block; }
.drawer nav { display: grid; gap: 6px; }
.drawer a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  padding: 10px 4px;
}

.hero { padding: 36px 0 10px; }
.kicker {
  display: inline-block;
  background: #efe6d6;
  color: var(--accent-2);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hero h1 { max-width: 16ch; }
.lead { font-size: 1.05rem; color: var(--mute); max-width: 62ch; margin: 0 0 20px; }

.searchbox {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr auto;
  gap: 8px;
  padding: 10px;
}
.searchbox input, .searchbox select {
  border: 1px solid transparent;
  background: var(--bg);
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 48px;
}
.searchbox button { min-height: 48px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 22px 0 8px;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.stat b { display: block; font-size: 1.35rem; font-weight: 700; }
.stat span { color: var(--mute); font-size: 0.86rem; }

.cats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 22px 0 8px;
}
.cat {
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  min-height: 146px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: box-shadow .16s ease, transform .16s ease;
}
.cat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cat .ico {
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 10px;
  background: var(--chip);
  color: var(--brand);
}
.cat h3 { margin: 14px 0 6px; font-size: 1.2rem; }
.cat p { margin: 0; color: var(--mute); font-size: 0.94rem; }

.section { padding: 28px 0 36px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 16px;
}
.section-head a { font-weight: 600; text-decoration: none; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 16px 18px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 198px;
}
.card:hover { box-shadow: var(--shadow); }
.card h3 { font-size: 1.12rem; }
.card p { margin: 0; color: var(--mute); font-size: 0.95rem; }
.badge {
  align-self: start;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--chip);
  color: var(--brand);
  border-radius: 999px;
  padding: 4px 8px;
}
.badge-jobs { background: #e7eef8; color: #24406b; }
.badge-housing { background: #efe8f6; color: #5a3476; }
.badge-vehicles { background: #e9f3ea; color: #275a32; }
.badge-services { background: #f7ecd8; color: #7a4a12; }
.badge-for-sale { background: #f6e6e2; color: #7a3224; }
.badge-community { background: #e6f2f1; color: #1b534c; }
.price { color: var(--brand); font-weight: 700; font-variant-numeric: tabular-nums; }
.meta { color: var(--mute); font-size: 0.88rem; }

.prose { max-width: 68ch; }
.prose p, .prose li { color: #2d2a25; }
.prose h2 { margin-top: 1.5em; }
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.form { display: grid; gap: 12px; }
.form label { font-size: 0.86rem; font-weight: 650; display: grid; gap: 6px; }
.form input, .form select, .form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
}
.form textarea { min-height: 140px; resize: vertical; }
.note { color: var(--mute); font-size: 0.9rem; }
.ok { background: #e7f5ec; border: 1px solid #c5e4d0; color: var(--good); border-radius: 10px; padding: 12px 14px; }
.err { background: #fbecea; border: 1px solid #f0c8c0; color: var(--bad); border-radius: 10px; padding: 12px 14px; }

.legal { color: var(--mute); font-size: 0.98rem; }
.legal h1 { max-width: none; }

.page-hero { padding: 32px 0 8px; }
.listing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 18px;
}
.listing-hero h1 { max-width: none; }
.listing-hero .price { font-size: 1.35rem; margin: 4px 0; }
.sidebox { position: sticky; top: 96px; height: fit-content; }
.sidebox h2 { margin-bottom: 12px; }

footer {
  margin-top: 12px;
  background: var(--brand);
  color: #d7e4df;
  padding: 40px 0 22px;
}
footer a { color: #f3d2b8; text-decoration: none; }
footer a:hover { text-decoration: underline; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 24px; }
.foot-grid h4 { margin: 0 0 10px; color: #fff; font-size: 1.05rem; }
.foot-grid a { display: block; margin: 7px 0; }
.copy { margin-top: 26px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px; color: #b9c9c3; font-size: 0.86rem; }

.cookie {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: none;
  max-width: 640px;
  margin: 0 auto;
}
.cookie.show { display: block; }
.cookie p { margin: 0 0 10px; }
.cookie .row { display: flex; gap: 8px; flex-wrap: wrap; }

.mobile-nav { display: none; }
.mobile-only { display: none; }

@media (max-width: 900px) {
  .desk-only { display: none !important; }
  .menu-btn, .mobile-only { display: inline-flex; }
  .header-top { min-height: 64px; }
  .searchbox, .stats, .cats, .grid, .foot-grid, .listing-hero { grid-template-columns: 1fr; }
  .hero h1, .page-hero h1 { max-width: none; }
  .sidebox { position: static; }
  .mobile-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: #fff;
    border-top: 1px solid var(--line);
    justify-content: space-around;
    padding: 6px 4px 10px;
    z-index: 35;
  }
  .mobile-nav a {
    text-decoration: none;
    color: var(--ink);
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    padding: 6px 8px;
    min-width: 60px;
  }
  .mobile-nav svg { width: 20px; height: 20px; margin: 0 auto 2px; }
  body { padding-bottom: 74px; }
  .cookie { bottom: 80px; left: 12px; right: 12px; }
}

@media (min-width: 901px) {
  .mobile-nav, .mobile-only { display: none !important; }
}
