:root {
  --bg: #f6f2ea;
  --surface: #fffdf9;
  --ink: #1f1a16;
  --ink-soft: #62564c;
  --line: #d8cab8;
  --gold: #9b6c2f;
  --forest: #335446;
  --focus: #1f5de2;
  --max-w: 1180px;
  --shadow: 0 14px 34px rgba(31, 26, 22, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 5%, rgba(155, 108, 47, 0.2), rgba(155, 108, 47, 0) 32%),
    radial-gradient(circle at 92% 15%, rgba(51, 84, 70, 0.16), rgba(51, 84, 70, 0) 36%),
    var(--bg);
  font-family: "Manrope", sans-serif;
  line-height: 1.5;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  z-index: 50;
  background: #fff;
  color: #000;
  padding: 10px 14px;
  border-radius: 8px;
}

.skip-link:focus-visible {
  left: 12px;
}

.site-header,
main,
.site-footer {
  width: min(var(--max-w), calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 12px 14px;
  background: rgba(255, 253, 249, 0.88);
  border: 1px solid rgba(216, 202, 184, 0.9);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: "Newsreader", serif;
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--gold), #c89b63);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}

.site-nav {
  display: flex;
  gap: 16px;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.94rem;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--gold);
}

.menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--ink);
}

main {
  padding-bottom: 70px;
}

.hero {
  padding: 56px 0 30px;
  display: grid;
  gap: 18px;
  position: relative;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.65fr);
  gap: clamp(1rem, 2.4vw, 2rem);
  align-items: end;
}

.hero-theme-word {
  margin: 0;
  position: absolute;
  top: -0.45rem;
  left: 0;
  font-family: "Newsreader", serif;
  font-size: clamp(3.6rem, 14vw, 10rem);
  letter-spacing: 0.08em;
  color: rgba(51, 84, 70, 0.08);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.hero-copy-block {
  position: relative;
  z-index: 1;
}

.hero-visual {
  margin: 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-height: clamp(22rem, 43vw, 31rem);
  position: relative;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(155, 108, 47, 0.45);
  border-radius: inherit;
  pointer-events: none;
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.015);
  animation: heroPan 10s ease-in-out infinite alternate;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--forest);
}

h1,
h2,
h3 {
  font-family: "Newsreader", serif;
  line-height: 1.1;
  margin: 0;
}

h1 {
  max-width: 13ch;
  font-size: clamp(2rem, 6.5vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.hero-copy {
  margin: 0;
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  text-wrap: pretty;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0.5rem;
}

.hero-meta article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 249, 0.84);
}

.hero-meta article.stat-overlap {
  transform: translateY(16px);
  border-color: rgba(155, 108, 47, 0.5);
  box-shadow: 0 10px 22px rgba(31, 26, 22, 0.15);
}

.hero-meta strong {
  display: block;
  color: var(--gold);
  font-family: "Newsreader", serif;
  font-size: 1.55rem;
}

.hero-meta span {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.filters-panel,
.listings,
.collections,
.agents,
.contact {
  margin-top: 36px;
}

.filters-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.filter-sheet-toggle {
  display: none;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.filters-grid label {
  display: grid;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

input,
select {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 10px;
  font: inherit;
  color: var(--ink);
}

input[type="range"] {
  padding: 0;
}

#priceOutput {
  color: var(--gold);
  font-weight: 600;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

h2 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.02;
  letter-spacing: -0.008em;
  text-wrap: balance;
}

.section-head h2::after {
  content: "";
  display: block;
  width: 3.75rem;
  height: 2px;
  margin-top: 0.6rem;
  background: linear-gradient(90deg, var(--gold), transparent);
}

#resultsCount {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.results-meta {
  display: flex;
  gap: 12px;
  align-items: center;
}

#savedCount {
  margin: 0;
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 700;
}

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

.card {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  position: relative;
}

.card::after {
  content: "";
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 1.4rem;
  height: 1.4rem;
  border-top: 1px solid rgba(155, 108, 47, 0.72);
  border-right: 1px solid rgba(155, 108, 47, 0.72);
  pointer-events: none;
}

.card-visual {
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  position: relative;
}

.fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.38);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

.fav-btn.is-favorite {
  background: rgba(155, 108, 47, 0.95);
  border-color: rgba(155, 108, 47, 1);
}

.card-body {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 20px;
  background: #f0e3d2;
  color: #674119;
  font-weight: 700;
}

.card h3 {
  font-size: 1.45rem;
}

.meta {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.price {
  color: var(--forest);
  font-size: 1.28rem;
  font-family: "Newsreader", serif;
  font-weight: 700;
}

.facts {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.collection-grid,
.agent-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.market-map {
  margin-top: 36px;
}

.chapter-bridge {
  display: none;
  margin-top: 12px;
}

.chapter-bridge p {
  margin: 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(155, 108, 47, 0.35);
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255, 247, 237, 0.95), rgba(255, 253, 249, 0.9));
  color: #503922;
  letter-spacing: 0.02em;
  font-weight: 600;
}

.market-signals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.market-signals article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem 1rem;
}

.market-signals p {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.market-signals strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.12rem;
  font-family: "Newsreader", serif;
  color: var(--ink);
}

.map-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.map-card {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.map-card img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  display: block;
}

.district-list {
  display: grid;
  gap: 10px;
}

.district-list article {
  background: rgba(255, 253, 249, 0.85);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.district-list p {
  margin: 8px 0 0;
  color: var(--ink-soft);
}

.collection-grid article,
.agent-row article {
  background: rgba(255, 253, 249, 0.85);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.collection-grid p,
.agent-row p,
.contact p {
  margin: 8px 0 0;
  color: var(--ink-soft);
}

.contact {
  background: linear-gradient(145deg, #2b241e, #171311);
  border-radius: 20px;
  padding: 28px;
  color: #f5ede5;
}

.contact h2 {
  color: #fdf8f2;
}

.contact p {
  color: #d5c4b4;
}

.cta {
  display: inline-flex;
  margin-top: 14px;
  min-height: 44px;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  background: linear-gradient(120deg, var(--gold), #cc9c64);
  color: #fff;
  font-weight: 700;
}

.site-footer {
  padding: 22px 0 26px;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.is-hidden {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.reveal {
  opacity: 0;
  transform: translateY(16px) scale(0.99);
  transition: opacity 560ms ease, transform 560ms ease;
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (max-width: 980px) {
  .hero-layout {
    grid-template-columns: 1fr;
  }

  .hero-theme-word {
    top: -0.2rem;
    font-size: clamp(3rem, 18vw, 7.5rem);
  }

  .filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .listing-grid,
  .collection-grid,
  .agent-row,
  .map-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-meta {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 15ch;
    font-size: clamp(2.1rem, 7.5vw, 3.5rem);
  }

  .hero-copy {
    max-width: 54ch;
  }

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

@media (max-width: 980px) and (min-width: 721px) {
  .chapter-bridge {
    display: block;
  }
}

@media (max-width: 720px) {
  .menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 62px;
    right: 10px;
    left: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    display: none;
    flex-direction: column;
  }

  .site-nav.is-open {
    display: flex;
  }

  .hero {
    padding-top: 46px;
  }

  .hero-theme-word {
    top: -0.1rem;
    left: 0.2rem;
    font-size: clamp(2.4rem, 18vw, 4.1rem);
    letter-spacing: 0.06em;
  }

  .hero-meta article.stat-overlap {
    transform: none;
    box-shadow: none;
  }

  h1 {
    max-width: 11.5ch;
    font-size: clamp(2rem, 11vw, 2.9rem);
    line-height: 1.01;
  }

  h2 {
    font-size: clamp(1.55rem, 8vw, 2.15rem);
  }

  .hero-copy {
    font-size: 1rem;
  }

  .filter-sheet-toggle {
    width: 100%;
    min-height: 2.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    font: inherit;
    font-weight: 600;
    color: var(--ink);
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.7rem;
  }

  .filter-sheet-toggle span:last-child {
    color: var(--gold);
    font-size: 0.86rem;
  }

  .filters-panel.is-collapsed .filters-grid {
    display: none;
  }

  .filters-grid,
  .listing-grid,
  .collection-grid,
  .agent-row,
  .map-layout {
    grid-template-columns: 1fr;
  }

  .market-signals {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.3rem;
  }

  .market-signals article {
    min-width: 78%;
    scroll-snap-align: start;
  }

  .results-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .reveal {
    transform: translateY(10px) scale(0.995);
    transition-duration: 420ms;
  }

  .hero-visual img {
    animation-duration: 7s;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal,
  .reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@keyframes heroPan {
  from {
    transform: scale(1.01) translateX(-0.45%);
  }

  to {
    transform: scale(1.04) translateX(0.45%);
  }
}
