:root {
  --bg: #f7f5f2;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-muted: #5c5c5c;
  --ink-soft: #8a8a8a;
  --accent: #2c4a3e;
  --accent-hover: #1e342c;
  --accent-soft: #e8efe9;
  --border: #e6e2dc;
  --shadow: 0 4px 24px rgba(26, 26, 26, 0.06);
  --radius: 12px;
  --radius-lg: 20px;
  --max: 1100px;
  --font: "DM Sans", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 245, 242, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 0; gap: 1rem;
}
.nav-brand {
  font-weight: 600; font-size: 0.95rem; letter-spacing: 0.02em;
  color: var(--ink); text-decoration: none;
}
.nav-brand:hover { text-decoration: none; color: var(--accent); }
.nav-brand span { color: var(--accent); }
.nav-links {
  display: flex; gap: 1.5rem; list-style: none; font-size: 0.9rem;
}
.nav-links a { color: var(--ink-muted); text-decoration: none; font-weight: 500; }
.nav-links a:hover { color: var(--accent); }
.nav-cta {
  background: var(--accent); color: #fff !important;
  padding: 0.55rem 1.1rem; border-radius: 999px;
  font-size: 0.875rem; font-weight: 600; text-decoration: none !important;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--accent-hover); }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 0.4rem 0.6rem; cursor: pointer; font-size: 1.1rem;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.85rem 1.5rem; border-radius: 999px;
  font-family: var(--font); font-size: 0.95rem; font-weight: 600;
  cursor: pointer; border: none; transition: background 0.2s, transform 0.15s;
  text-decoration: none !important;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost {
  background: var(--surface); color: var(--ink); border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); }
.btn-light {
  background: #fff; color: var(--accent);
}
.btn-light:hover { background: var(--accent-soft); }

/* Hero (home) */
.hero-home { padding: 3.5rem 0 2.5rem; text-align: center; }
.hero-badge {
  display: inline-block; background: var(--accent-soft); color: var(--accent);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 0.35rem 0.75rem; border-radius: 999px;
  margin-bottom: 1rem;
}
.hero-home h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 400; line-height: 1.15; letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.hero-home .lede {
  color: var(--ink-muted); font-size: 1.1rem; max-width: 36rem; margin: 0 auto 1.5rem;
}

/* Listing cards */
.listings { padding: 0 0 4rem; }
.listings-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none; color: inherit;
}
.card:hover {
  transform: translateY(-3px); box-shadow: 0 8px 32px rgba(26,26,26,0.1);
  text-decoration: none; color: inherit;
}
.card-img {
  aspect-ratio: 4 / 3; background: #d4d0c8; overflow: hidden; position: relative;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-badge {
  position: absolute; top: 0.75rem; left: 0.75rem;
  background: rgba(44,74,62,0.92); color: #fff;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 0.3rem 0.65rem; border-radius: 999px;
}
.card-body { padding: 1.25rem 1.35rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.card-price {
  font-size: 1.25rem; font-weight: 700; color: var(--accent); margin-bottom: 0.25rem;
}
.card-title {
  font-family: var(--serif); font-size: 1.25rem; font-weight: 400;
  letter-spacing: -0.01em; margin-bottom: 0.35rem; line-height: 1.3;
}
.card-address { color: var(--ink-muted); font-size: 0.9rem; margin-bottom: 0.85rem; }
.card-meta {
  display: flex; flex-wrap: wrap; gap: 0.65rem 1rem;
  font-size: 0.85rem; color: var(--ink-soft); margin-top: auto;
  padding-top: 0.75rem; border-top: 1px solid var(--border);
}
.card-meta strong { color: var(--ink); font-weight: 600; }

/* Sections */
section { padding: 3.5rem 0; }
.section-label {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem;
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 400; letter-spacing: -0.01em; margin-bottom: 1.5rem;
}

/* House detail hero */
.hero { padding: 3rem 0 2rem; }
.hero-grid {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2.5rem; align-items: center;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 400; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 0.75rem;
}
.hero-price {
  font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 700; color: var(--accent); margin-bottom: 0.5rem;
}
.hero-address { color: var(--ink-muted); font-size: 1.05rem; margin-bottom: 1.5rem; }
.hero-address svg { display: inline-block; vertical-align: -2px; margin-right: 4px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-image {
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow);
  aspect-ratio: 4 / 3; background: #d4d0c8;
}
.hero-image img { width: 100%; height: 100%; object-fit: cover; }

/* Facts */
.facts { padding: 0 0 2.5rem; }
.facts-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow);
}
.fact { text-align: center; padding: 0.5rem; }
.fact + .fact { border-left: 1px solid var(--border); }
.fact-value { font-size: 1.5rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.fact-label {
  font-size: 0.8rem; color: var(--ink-soft); text-transform: uppercase;
  letter-spacing: 0.05em; margin-top: 0.25rem; font-weight: 500;
}

/* Gallery */
.gallery {
  background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.gallery-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr;
  gap: 0.75rem; height: 420px;
}
.gallery-grid.single {
  grid-template-columns: 1fr; grid-template-rows: 1fr; height: 420px;
}
.gallery-grid.two {
  grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; height: 360px;
}
.gallery-item {
  border-radius: var(--radius); overflow: hidden; background: #d4d0c8; position: relative;
}
.gallery-grid:not(.single):not(.two) .gallery-item:first-child { grid-row: 1 / 3; }
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.04); }
.gallery-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e8e4dc 0%, #d0cbc2 100%);
  color: var(--ink-soft); font-size: 0.85rem; font-weight: 500;
}

/* Description */
.desc-body p { color: var(--ink-muted); font-size: 1.05rem; margin-bottom: 1rem; }
.desc-body p:last-child { margin-bottom: 0; }
.post-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-top: 1.25rem; font-weight: 600; font-size: 0.95rem;
}

/* Contact */
.contact { background: var(--accent); color: #fff; }
.contact .section-label { color: rgba(255,255,255,0.7); }
.contact .section-title { color: #fff; }
.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start;
}
.contact-info p { color: rgba(255,255,255,0.85); margin-bottom: 1rem; font-size: 1.05rem; }
.contact-detail { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem; }
.contact-detail span { font-size: 0.95rem; color: rgba(255,255,255,0.9); }
.contact-detail strong {
  display: block; font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: rgba(255,255,255,0.55); margin-bottom: 0.15rem; font-weight: 600;
}
.contact-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* Home contact strip */
.contact-strip {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem; box-shadow: var(--shadow);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.contact-strip h2 {
  font-family: var(--serif); font-size: 1.6rem; font-weight: 400; margin-bottom: 0.35rem;
}
.contact-strip p { color: var(--ink-muted); font-size: 0.95rem; }
.contact-strip .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Footer */
footer {
  padding: 2rem 0; text-align: center; font-size: 0.85rem;
  color: var(--ink-soft); border-top: 1px solid var(--border);
}
footer a { color: var(--ink-soft); }

.back-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.9rem; font-weight: 500; color: var(--ink-muted);
  margin-bottom: 1.5rem; text-decoration: none;
}
.back-link:hover { color: var(--accent); }

@media (max-width: 900px) {
  .listings-grid { grid-template-columns: 1fr 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-image { order: -1; max-height: 320px; }
  .gallery-grid {
    grid-template-columns: 1fr 1fr; grid-template-rows: auto; height: auto;
  }
  .gallery-grid:not(.single):not(.two) .gallery-item:first-child {
    grid-column: 1 / 3; grid-row: auto; aspect-ratio: 16 / 9;
  }
  .gallery-item { aspect-ratio: 4 / 3; }
  .contact-grid { grid-template-columns: 1fr; }
  .fact + .fact { border-left: none; }
  .facts-grid { gap: 0.5rem; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute;
    top: 100%; left: 0; right: 0; background: var(--bg);
    border-bottom: 1px solid var(--border); padding: 1rem 1.25rem 1.25rem; gap: 0.75rem;
  }
  .nav-toggle { display: block; }
  .nav-cta { display: none; }
  .listings-grid { grid-template-columns: 1fr; }
  .gallery-grid, .gallery-grid.two { grid-template-columns: 1fr; }
  .gallery-grid:not(.single):not(.two) .gallery-item:first-child { grid-column: auto; }
  .contact-strip { flex-direction: column; align-items: flex-start; }
}
