*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Rivercrest palette: river water + sunrise over the ridge */
  --teal: #0F4C5C;          /* primary: header, headings, card buttons */
  --teal-light: #146A7E;    /* hover / gradient partner for teal */
  --spruce: #1F3A3D;        /* dark: hero base, footer */
  --copper: #B9532A;        /* accent: main buttons, labels, icons */
  --copper-dark: #9C4421;   /* accent hover */
  --sage: #8FB5A3;          /* secondary */
  --sage-light: #B7D3C6;    /* highlight text on dark backgrounds */
  --mist: #EEF4F3;          /* light section background */
  --mist-dark: #DCE8E5;
  --white: #ffffff;
  --gray-100: #f2f5f5;
  --gray-200: #e1e8e8;
  --gray-400: #9aa9ab;
  --gray-500: #66777a;
  --gray-600: #4f5f62;
  --gray-700: #36464a;
  --gray-900: #142427;
  --text: #24363a;
  --font-display: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --max-width: 1100px;
  --radius: 10px;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
}

/* ── Navigation ─────────────────────────────────────── */
header {
  background: var(--teal);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.65rem;
  align-items: center;
  line-height: 1.2;
}

.logo::before {
  content: "";
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
  background: url("/favicon.svg") center / contain no-repeat;
}

.logo-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.01em;
}

.logo-tagline {
  font-size: 0.7rem;
  color: var(--sage-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--gray-200);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--sage-light);
}

.nav-cta {
  margin-left: auto;
}

.nav-cta a {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: var(--copper);
  color: var(--white) !important;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}

.nav-cta a:hover {
  background: var(--copper-dark);
  color: var(--white) !important;
  transform: translateY(-1px);
}

/* ── Hero ────────────────────────────────────────────── */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--spruce) 0%, var(--teal) 100%);
  color: var(--white);
  padding: 5rem 1.5rem 6.5rem;
  text-align: center;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 40px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 24 C150 4 300 4 450 20 S750 38 900 20 S1100 6 1200 18 V40 H0 Z' fill='%23EEF4F3'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
  pointer-events: none;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero h1 span {
  color: var(--sage-light);
}

.hero p {
  font-size: 1.1rem;
  color: var(--gray-200);
  max-width: 560px;
  margin: 0 auto 2rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  cursor: pointer;
  border: none;
}

.btn-gold {
  background: var(--copper);
  color: var(--white);
}

.btn-gold:hover {
  background: var(--copper-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--sage-light);
  color: var(--sage-light);
  margin-left: 1rem;
}

.btn-outline:hover {
  background: var(--sage-light);
  color: var(--spruce);
}

/* ── Section ─────────────────────────────────────────── */
section {
  padding: 4rem 1.5rem;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--copper);
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--teal);
  margin-bottom: 0.75rem;
}

.section-sub {
  color: var(--gray-500);
  max-width: 560px;
  margin-bottom: 2.5rem;
}

/* ── Trust bar ───────────────────────────────────────── */
.trust-bar {
  background: var(--mist);
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  padding: 1.5rem 1.5rem;
}

.trust-items {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem 3rem;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--teal);
}

.trust-item svg {
  flex-shrink: 0;
  color: var(--copper);
}

/* ── Homes grid ──────────────────────────────────────── */
.homes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
}

.home-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.home-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.home-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--gray-100);
  object-fit: cover;
  display: block;
}

.home-card-img-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  font-size: 0.85rem;
}

.home-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.home-card-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  margin-bottom: 0.75rem;
}

.badge-sale {
  background: #d4e8ec;
  color: var(--teal);
}

.badge-rent-to-own {
  background: #dcebe4;
  color: #2c5a45;
}

.badge-rent {
  background: #f6e2d6;
  color: #8a3d1d;
}

.badge-sold {
  background: #f6e2d6;
  color: #8a3d1d;
}

.badge-coming-soon {
  background: var(--mist-dark);
  color: var(--teal);
}

.home-card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--teal);
  margin-bottom: 0.4rem;
  font-weight: 700;
}

.home-card-location {
  font-size: 0.82rem;
  color: var(--gray-500);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.home-card-specs {
  display: flex;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--gray-500);
  margin-bottom: 1rem;
}

.home-card-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--teal);
  margin-top: auto;
}

.home-card-cta {
  display: block;
  text-align: center;
  margin-top: 1rem;
  padding: 0.55rem 1rem;
  background: var(--teal);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}

.home-card-cta:hover {
  background: var(--teal-light);
}

/* ── How it works ────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  counter-reset: step;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.step-number {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--teal);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.step h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--teal);
}

.step p {
  font-size: 0.88rem;
  color: var(--gray-500);
  line-height: 1.5;
}

/* ── About page ──────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--spruce) 0%, var(--teal) 100%);
  color: var(--white);
  padding: 3.5rem 1.5rem;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  margin-bottom: 0.75rem;
}

.page-hero p {
  color: var(--gray-200);
  max-width: 600px;
  font-size: 1.05rem;
}

.prose {
  max-width: 720px;
}

.prose p {
  margin-bottom: 1.25rem;
  color: var(--gray-700);
  font-size: 1rem;
  line-height: 1.75;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--teal);
  margin: 2rem 0 0.75rem;
}

.prose ul {
  margin: 0 0 1.25rem 1.5rem;
  color: var(--gray-700);
  line-height: 1.75;
}

.prose h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--teal);
  margin: 1.5rem 0 0.6rem;
}

.prose .toc-box {
  background: var(--mist);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0 2rem;
}

.prose .toc-box p {
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.prose .toc-box ul {
  margin: 0;
  list-style: none;
  columns: 2;
  column-gap: 1.5rem;
}

.prose .toc-box li {
  margin-bottom: 0.4rem;
  break-inside: avoid;
}

.prose .toc-box a {
  color: var(--gray-700);
  text-decoration: none;
  font-size: 0.9rem;
}

.prose .toc-box a:hover {
  color: var(--teal);
  text-decoration: underline;
}

.prose .table-wrap {
  overflow-x: auto;
  margin: 0 0 1.5rem;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.prose th {
  background: var(--mist);
  color: var(--teal);
  text-align: left;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--gray-200);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prose td {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  vertical-align: top;
}

.prose h2[id],
.prose h3[id] {
  scroll-margin-top: 90px;
}

.states-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.state-card {
  background: var(--mist);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  text-align: center;
}

.state-card .state-name {
  font-weight: 700;
  color: var(--teal);
  font-size: 0.95rem;
}

.state-card .state-abbr {
  font-size: 1.5rem;
  color: var(--copper);
  font-weight: 700;
  font-family: var(--font-display);
  display: block;
  margin-bottom: 0.25rem;
}

/* ── Listing page ────────────────────────────────────── */
.listing-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 3rem;
  align-items: start;
}

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

.listing-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.listing-gallery .main-img {
  grid-column: 1 / -1;
  aspect-ratio: 16/9;
  background: var(--gray-100);
  border-radius: var(--radius);
  overflow: hidden;
}

.listing-gallery .thumb {
  aspect-ratio: 4/3;
  background: var(--gray-100);
  border-radius: var(--radius);
  overflow: hidden;
}

.gallery-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  font-size: 0.8rem;
}

.listing-specs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 1.5rem;
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.spec-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  font-weight: 600;
}

.spec-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--teal);
}

.listing-description {
  color: var(--gray-700);
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

.features-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.features-list li {
  font-size: 0.9rem;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.features-list li::before {
  content: "✓";
  color: var(--copper);
  font-weight: 700;
}

/* Form sidebar */
.form-sidebar {
  position: sticky;
  top: 1.5rem;
}

.form-card {
  background: var(--mist);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.form-card-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 0.25rem;
  font-family: var(--font-display);
}

.form-card-price-note {
  font-size: 0.82rem;
  color: var(--gray-500);
  margin-bottom: 1.25rem;
}

.form-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

/* ── Hamburger toggle ────────────────────────────────── */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--white);
  line-height: 1;
}

.nav-toggle-icon {
  font-size: 1.5rem;
  display: block;
}

@media (max-width: 768px) {
  header {
    position: relative;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 2px solid var(--copper);
    padding: 0.5rem 0 1rem;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links > li {
    width: 100%;
  }

  .nav-links > li > a,
  .nav-dropdown-toggle {
    display: block;
    padding: 0.7rem 1.5rem;
    font-size: 0.95rem;
    color: var(--teal) !important;
    border-bottom: 1px solid var(--gray-200);
  }

  .nav-links > li > a:hover,
  .nav-dropdown-toggle:hover {
    background: var(--mist);
  }

  /* CTA button — full width pill on mobile */
  .nav-cta {
    margin-left: 0;
    padding: 0.75rem 1.5rem 0.25rem;
    border-bottom: none;
  }

  .nav-cta a {
    display: block;
    text-align: center;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
  }

  .nav-cta a:hover {
    background: var(--teal) !important;
  }

  /* Locations dropdown — expand inline on mobile */
  .nav-dropdown-toggle {
    width: 100%;
    justify-content: space-between;
    color: var(--teal) !important;
  }

  .nav-dropdown-menu {
    display: none;
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: var(--mist);
    padding: 0;
    min-width: 0;
  }

  .nav-dropdown.open .nav-dropdown-menu {
    display: block;
  }

  .nav-dropdown.open .nav-dropdown-toggle svg {
    transform: rotate(180deg);
  }

  .nav-dropdown-menu a {
    padding: 0.6rem 1.5rem 0.6rem 2.25rem;
    color: var(--teal) !important;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.9rem;
  }

  .nav-dropdown-menu a:hover {
    background: var(--mist-dark);
    color: var(--teal) !important;
  }
}

/* ── Dropdown nav ────────────────────────────────────── */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  color: var(--gray-200);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.nav-dropdown-toggle:hover {
  color: var(--sage-light);
}

.nav-dropdown-toggle svg {
  transition: transform 0.2s;
}

.nav-dropdown-menu {
  display: none;
}

@media (min-width: 769px) {
  .nav-dropdown.open .nav-dropdown-toggle svg {
    transform: rotate(180deg);
  }

  .nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    min-width: 180px;
    z-index: 100;
    padding: 0.4rem 0;
  }

  .nav-dropdown.open .nav-dropdown-menu {
    display: block;
  }
}

.nav-dropdown-menu a {
  display: block;
  padding: 0.55rem 1rem;
  color: var(--gray-700) !important;
  font-size: 0.88rem;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-dropdown-menu a:hover {
  background: var(--mist);
  color: var(--teal) !important;
}

/* ── Footer ──────────────────────────────────────────── */
footer {
  background: var(--spruce);
  color: var(--gray-200);
  padding: 3rem 1.5rem 1.5rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 640px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .nav-links {
    display: none;
  }
}

.footer-brand .logo-name {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.footer-brand p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--gray-500);
  max-width: 280px;
}

.footer-col h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sage-light);
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-col a {
  color: var(--gray-500);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--gray-500);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── Utility ─────────────────────────────────────────── */
.bg-cream {
  background: var(--mist);
}

.text-center {
  text-align: center;
}

.mt-2 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }

@media (max-width: 640px) {
  .hero {
    padding: 3.5rem 1.25rem 5rem;
  }
  .btn-outline {
    margin-left: 0;
    margin-top: 0.75rem;
  }
  .features-list {
    grid-template-columns: 1fr;
  }
}
