:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #63716d;
  --paper: #f7f4ed;
  --surface: #fffdf8;
  --line: #dcd8ce;
  --green: #126b54;
  --green-soft: #dff2e9;
  --amber: #8b5200;
  --amber-soft: #fff1ce;
  --shadow: 0 16px 44px rgba(35, 50, 45, .09);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}
button, select, input { font: inherit; }
button, summary, select, input[type="checkbox"], input[type="range"] { cursor: pointer; }
a { color: inherit; }

.topbar {
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 12px 16px;
  background: rgba(255, 253, 248, .86);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(12px);
}
.brand { font-weight: 900; text-decoration: none; letter-spacing: -.04em; }
.topbar nav { display: flex; gap: 6px; }
.topbar nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 700;
}
.topbar nav a.active { background: var(--ink); color: white; }

main, footer {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}
.hero {
  padding: clamp(64px, 9vw, 112px) 0 54px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, .8fr);
  column-gap: 64px;
  align-items: end;
}
.hero .eyebrow, .hero h1, .hero .lede { grid-column: 1; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
h1, h2, h3, p { text-wrap: pretty; }
h1 {
  margin: 0;
  max-width: 760px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 7vw, 6.6rem);
  line-height: .91;
  letter-spacing: -.065em;
  font-weight: 500;
}
.lede {
  margin: 28px 0 0;
  max-width: 680px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.28rem);
}
.hero-stats {
  grid-column: 2;
  grid-row: 1 / span 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}
.hero-stats div {
  min-height: 118px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
}
.hero-stats strong { font-size: clamp(1.35rem, 3vw, 2rem); letter-spacing: -.045em; }
.hero-stats span { color: var(--muted); font-size: .78rem; }

.quick {
  padding: 34px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
}
.quick h2, .results h2 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.6rem); letter-spacing: -.045em; }
.quick .eyebrow { color: #91d5bd; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-width: min(100%, 480px); }
.quick-card {
  padding: 16px;
  display: grid;
  gap: 2px;
  text-align: left;
  color: white;
  background: #25332f;
  border: 1px solid #40514c;
  border-radius: 14px;
}
.quick-card:hover, .quick-card.active { background: var(--green); border-color: #57a98d; }
.quick-card span { color: #c2d2cd; font-size: .78rem; }
.quick-card strong { font-size: 1.05rem; }
.quick-card small { margin-top: 8px; color: #9ed9c5; }

.catalog-layout {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.filters {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.filters summary {
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  font-weight: 900;
}
.filters summary::-webkit-details-marker { display: none; }
.filters summary span:last-child { color: var(--green); font-size: .74rem; font-weight: 800; }
.filters form {
  padding: 0 18px 18px;
  display: grid;
  gap: 13px;
}
.filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
}
.filters select {
  width: 100%;
  padding: 10px 34px 10px 11px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.range-label output { float: right; color: var(--ink); }
input[type="range"] { width: 100%; accent-color: var(--green); }
.check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  padding: 10px;
  color: var(--ink) !important;
  background: var(--green-soft);
  border-radius: 10px;
}
.check-row input { width: 18px; height: 18px; accent-color: var(--green); }
.clear, .empty button {
  padding: 10px 12px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 800;
}
.clear:hover, .empty button:hover { border-color: var(--green); color: var(--green); }

.results-head {
  min-height: 76px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
}
#resultCount { margin: 0 0 4px; color: var(--muted); font-weight: 800; }
.active-filters {
  min-height: 42px;
  padding: 10px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.active-filters span {
  padding: 5px 9px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
}
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(35, 50, 45, .06);
}
.card:hover { box-shadow: var(--shadow); }
.photo {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #d8ddd9;
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rank, .score, .photo-count {
  position: absolute;
  top: 12px;
  padding: 6px 9px;
  color: white;
  background: rgba(20, 30, 27, .82);
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 900;
  backdrop-filter: blur(8px);
}
.rank { left: 12px; }
.score { right: 12px; }
.photo-count { top: auto; right: 12px; bottom: 12px; }
.photo-nav {
  position: absolute;
  top: 50%;
  width: 34px;
  height: 42px;
  translate: 0 -50%;
  color: white;
  background: rgba(20, 30, 27, .72);
  border: 0;
  border-radius: 10px;
  font-size: 1.5rem;
}
.photo-nav.prev { left: 10px; }
.photo-nav.next { right: 10px; }
.card-body { padding: 18px; display: flex; flex: 1; flex-direction: column; }
.card-kicker { display: flex; justify-content: space-between; gap: 12px; color: var(--green); font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.card h3 { margin: 9px 0 4px; font-size: 1.3rem; line-height: 1.15; letter-spacing: -.03em; }
.address { margin: 0; color: var(--muted); font-size: .82rem; }
.metro {
  margin: 16px 0 0;
  padding: 12px;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
  background: var(--green-soft);
  border-radius: 12px;
}
.metro-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
  border-radius: 50%;
  font-size: .78rem;
  font-weight: 900;
}
.metro div { display: grid; }
.metro strong { font-size: .88rem; }
.metro span { color: #3e5d53; font-size: .7rem; }
.highlight { margin: 14px 0; color: #44514d; font-size: .84rem; }
.risk {
  margin: 0 0 14px;
  padding: 12px;
  color: #714400;
  background: var(--amber-soft);
  border-radius: 12px;
}
.risk strong { font-size: .84rem; }
.risk p { margin: 5px 0 0; font-size: .75rem; }
.cost { margin-top: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cost summary { padding: 13px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; list-style: none; }
.cost summary::-webkit-details-marker { display: none; }
.cost summary > span { display: grid; font-size: .8rem; font-weight: 800; }
.cost summary small { color: var(--green); font-size: .66rem; font-weight: 800; text-transform: uppercase; }
.cost summary > strong { font-size: 1.2rem; }
.cost ul { margin: 0 0 12px; padding: 0; display: grid; gap: 6px; list-style: none; }
.cost li { display: flex; justify-content: space-between; color: var(--muted); font-size: .76rem; }
.cost li strong { color: var(--ink); }
.open-listing {
  margin-top: 14px;
  padding: 11px 13px;
  display: block;
  text-align: center;
  color: white;
  background: var(--green);
  border-radius: 10px;
  text-decoration: none;
  font-size: .84rem;
  font-weight: 900;
}
.open-listing:hover { background: #0b5541; }
.empty {
  grid-column: 1 / -1;
  padding: 48px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed #aeb7b3;
  border-radius: var(--radius);
}
.empty strong { font-size: 1.2rem; }
.empty p { max-width: 560px; margin: 10px auto 18px; color: var(--muted); }
footer {
  margin-top: 72px;
  margin-bottom: 36px;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: .8rem;
}
footer p { margin: 0; max-width: 720px; }
footer a { color: var(--green); font-weight: 800; }

@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; }
  .hero-stats { grid-column: 1; grid-row: auto; margin-top: 36px; }
  .catalog-layout { grid-template-columns: 230px minmax(0, 1fr); gap: 18px; }
  .cards { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .quick { align-items: stretch; flex-direction: column; }
  .quick-actions { width: 100%; min-width: 0; }
  .catalog-layout { grid-template-columns: 1fr; }
  .filters { position: static; top: auto; max-height: none; overflow: visible; box-shadow: none; }
  .filters[open] summary { border-bottom: 1px solid var(--line); }
  .filters form { padding-top: 16px; grid-template-columns: 1fr 1fr; }
  .check-row, .clear { align-self: end; }
}

@media (max-width: 560px) {
  .topbar, main, footer { width: min(100% - 20px, 1180px); }
  .topbar { margin-top: 10px; padding: 9px 11px; }
  .topbar nav a { padding: 7px 9px; font-size: .78rem; }
  .hero { padding: 48px 0 38px; }
  h1 { font-size: clamp(3rem, 18vw, 4.6rem); }
  .hero-stats div { min-height: 94px; padding: 15px; }
  .quick { padding: 22px; }
  .quick-actions { grid-template-columns: 1fr; }
  .filters form { grid-template-columns: 1fr; }
  .results-head { align-items: start; flex-direction: column; gap: 4px; }
  .cards { gap: 14px; }
  .card-body { padding: 16px; }
  .photo-nav { opacity: .92; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
