:root {
  color-scheme: light;
  --bg: #f6f1e8;
  --panel: #fffaf2;
  --ink: #22170f;
  --muted: #766a5f;
  --line: #e8dccb;
  --brand: #2f6f62;
  --brand-dark: #1c4a41;
  --accent: #c97943;
  --good: #227a52;
  --bad: #9f3a38;
  --shadow: 0 18px 50px rgba(52, 36, 20, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(47, 111, 98, 0.14), transparent 34rem),
    linear-gradient(180deg, #fbf5eb 0%, var(--bg) 42%, #f1e8db 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

a {
  color: var(--brand-dark);
}

.hero,
main,
footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding: 46px 0 26px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 7vw, 76px);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

.subtitle {
  max-width: 720px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.hero-card {
  min-width: 240px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 250, 242, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-card span,
.hero-card strong {
  display: block;
}

.hero-card span {
  color: var(--muted);
  font-size: 13px;
}

.hero-card strong {
  margin-top: 10px;
  font-size: 28px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 8px 0 18px;
}

.city-chooser {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) 1.4fr;
  gap: 18px;
  margin: 8px 0 18px;
  align-items: stretch;
}

.city-chooser > div:first-child,
.city-card {
  border: 1px solid var(--line);
  background: rgba(255, 250, 242, 0.86);
  box-shadow: var(--shadow);
}

.city-chooser > div:first-child {
  padding: 22px;
  border-radius: 28px;
}

.city-chooser h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.city-chooser p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.city-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.city-card {
  display: grid;
  gap: 9px;
  width: 100%;
  min-height: 176px;
  padding: 22px;
  border-radius: 28px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.city-card:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 111, 98, 0.45);
}

.city-card.active {
  border-color: var(--brand);
  background: linear-gradient(135deg, rgba(47, 111, 98, 0.16), rgba(255, 250, 242, 0.92));
}

.city-card span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.city-card strong {
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.city-card small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.city-card em {
  align-self: end;
  color: var(--brand-dark);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.stats article,
.filters,
.card,
.empty-state {
  border: 1px solid var(--line);
  background: rgba(255, 250, 242, 0.86);
  box-shadow: var(--shadow);
}

.stats article {
  padding: 18px;
  border-radius: 24px;
}

.stats span {
  font-size: 32px;
  font-weight: 850;
}

.stats p {
  margin: 6px 0 0;
  color: var(--muted);
}

.filters {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(150px, 0.65fr));
  gap: 14px;
  padding: 18px;
  border-radius: 28px;
  position: sticky;
  top: 12px;
  z-index: 2;
  backdrop-filter: blur(14px);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid #d6c8b6;
  border-radius: 15px;
  background: #fffdf8;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 111, 98, 0.14);
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid #d6c8b6;
  border-radius: 15px;
  background: #fffdf8;
  color: var(--ink);
}

.check input {
  width: auto;
}

.results-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 0;
  color: var(--muted);
}

button,
.button {
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  padding: 11px 16px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
}

#reset-filters {
  background: #eadfce;
  color: var(--ink);
}

.listings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.card {
  display: grid;
  overflow: hidden;
  border-radius: 30px;
}

.image {
  aspect-ratio: 4 / 3;
  background: #e7dccd;
  overflow: hidden;
}

.image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
  font-weight: 800;
}

.content {
  padding: 18px;
}

.card h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.card .city {
  margin: 6px 0 14px;
  color: var(--muted);
}

.top-row,
.actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.price {
  flex: 0 0 auto;
  color: var(--brand-dark);
  font-size: 24px;
  font-weight: 900;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.chip {
  border-radius: 999px;
  background: #ede3d5;
  color: var(--ink);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
}

.chip.good {
  background: rgba(34, 122, 82, 0.14);
  color: var(--good);
}

.chip.bad {
  background: rgba(159, 58, 56, 0.13);
  color: var(--bad);
}

.details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin: 14px 0;
}

.details div {
  padding: 10px;
  border-radius: 16px;
  background: #f3eadc;
}

.details span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.details strong {
  display: block;
  margin-top: 3px;
}

.description {
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

details.contact {
  margin: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

details.contact summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 900;
}

.contact-body {
  margin-top: 10px;
  display: grid;
  gap: 7px;
}

.actions {
  margin-top: 14px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.secondary {
  background: #eadfce;
  color: var(--ink);
}

.empty-state {
  padding: 28px;
  border-radius: 28px;
  color: var(--muted);
  text-align: center;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px 0 8px;
}

.page-button {
  min-width: 44px;
  border: 1px solid var(--line);
  background: #fffaf2;
  color: var(--ink);
  box-shadow: none;
}

.page-button.active {
  background: var(--brand);
  color: white;
}

.page-button.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-gap {
  color: var(--muted);
  padding: 0 4px;
}

footer {
  padding: 30px 0 46px;
  color: var(--muted);
  line-height: 1.5;
}

.policy {
  display: grid;
  gap: 16px;
}

.policy h2 {
  margin: 0 0 10px;
  letter-spacing: -0.03em;
}

.policy p {
  margin: 0;
  line-height: 1.65;
}

@media (max-width: 980px) {
  .hero,
  .stats,
  .city-chooser,
  .filters,
  .listings {
    grid-template-columns: 1fr 1fr;
  }

  .hero-card {
    min-width: auto;
  }
}

@media (max-width: 680px) {
  .hero,
  .stats,
  .city-chooser,
  .city-options,
  .filters,
  .listings,
  .details {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
  }
}
