:root {
  --bg: #f8f4ed;
  --ink: #0f172a;          /* slate-900 */
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --green: #073f3d;
  --green-hover: #052f2e;
  --green-deep: #082c2b;
  --teal: #1f5b59;
  --terracotta: #b45b45;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

/* ---------- Icons ---------- */
.icon {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
}
.icon--sm { width: 1rem; height: 1rem; }
.icon--lg { width: 1.75rem; height: 1.75rem; }

/* ---------- Layout helpers ---------- */
.section {
  max-width: 80rem;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}
.section--tight {
  padding-top: 0;
  padding-bottom: 2.5rem;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--terracotta);
}

.h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-top: 0.75rem;
}

.lede {
  margin-top: 1.25rem;
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--slate-700);
}
.lede--tight { margin-top: 0.5rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn--pill { border-radius: 9999px; }
.btn--lg { padding: 0.85rem 1.75rem; font-size: 1rem; }

.btn--dark {
  background: var(--green);
  color: #fff;
}
.btn--dark:hover { background: var(--green-hover); }

.btn--light {
  background: #fff;
  color: var(--ink);
}
.btn--light:hover { background: rgba(255, 255, 255, 0.9); }

.btn--ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.7);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.1); }

/* ===================== HERO ===================== */
.hero {
  position: relative;
  overflow: hidden;
  /* fallback gradient when the photo is absent */
  background: radial-gradient(120% 120% at 75% 0%, #0d4f4c 0%, var(--green-deep) 55%, #04201f 100%);
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(8, 44, 43, 0.85),
    rgba(8, 44, 43, 0.45) 55%,
    rgba(8, 44, 43, 0)
  );
}

.nav {
  position: relative;
  z-index: 10;
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 1.5rem;
}
.nav__brand {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.nav__links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.nav__link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.nav__link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.nav__link--active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.hero__grid {
  position: relative;
  z-index: 10;
  max-width: 80rem;
  margin: 0 auto;
  display: grid;
  gap: 2.5rem;
  align-items: center;
  padding: 2.5rem 1.5rem 6rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(7, 63, 61, 0.8);
  color: #fff;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  backdrop-filter: blur(6px);
  margin-bottom: 1.5rem;
}

.hero__title {
  font-family: "Fraunces", Georgia, serif;
  max-width: 36rem;
  color: #fff;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.05;
  font-size: clamp(2.75rem, 6vw, 4.5rem);
}

.hero__lede {
  margin-top: 1.5rem;
  max-width: 36rem;
  font-size: 1.125rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
}

.hero__actions {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero__logo img {
  margin: 0 auto;
  max-height: 360px;
  width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 25px 25px rgba(0, 0, 0, 0.25));
}

/* ===================== WHY ===================== */
.why__grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.cards {
  display: grid;
  gap: 1rem;
}

.card {
  background: #fff;
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(8, 44, 43, 0.1);
}
.card__icon {
  color: var(--teal);
  margin-bottom: 1.25rem;
}
.card__title {
  font-size: 1.25rem;
  font-weight: 600;
}
.card__copy {
  margin-top: 0.75rem;
  line-height: 1.6;
  color: var(--slate-600);
}

/* ===================== COMMUNITIES ===================== */
.communities__head { text-align: center; }

.towns {
  list-style: none;
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}
.town {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}
.town__icon {
  color: var(--teal);
  margin-right: 0.35rem;
}

/* ===================== FEATURE / ABOUT ===================== */
.feature {
  display: grid;
  gap: 2rem;
  align-items: center;
  background: #fff;
  border-radius: 2rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 6px 24px rgba(0, 0, 0, 0.05);
}
.feature__img {
  width: 100%;
  border-radius: 1.5rem;
  object-fit: cover;
}
.feature__img--placeholder {
  min-height: 260px;
  background: linear-gradient(135deg, #0d4f4c, var(--green-deep));
}

/* ===================== CLOSING CTA ===================== */
.cta {
  position: relative;
  overflow: hidden;
  border-radius: 2rem;
  background: linear-gradient(135deg, #0d4f4c, var(--green-deep));
}
.cta__bg {
  width: 100%;
  height: 18rem;
  object-fit: cover;
}
.cta__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}
.cta__inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  color: #fff;
}
.cta__title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
}
.cta__inner .btn { margin-top: 1.5rem; }

/* ===================== FOOTER ===================== */
.footer {
  background: #fff;
  padding: 2.5rem 1.5rem;
}
.footer__grid {
  max-width: 64rem;
  margin: 0 auto;
  display: grid;
  gap: 2rem;
  align-items: center;
}
.footer__name {
  font-size: 1.75rem;
  font-weight: 600;
}
.footer__copy {
  margin-top: 0.5rem;
  font-size: 1.75rem;
  color: var(--slate-600);
}
.footer__broker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 2rem;
}
.footer__label {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--slate-500);
}
.footer__logo {
  max-height: 6rem;
  width: 100%;
  object-fit: contain;
}
.footer__contact {
  max-width: 64rem;
  margin: 2.5rem auto 0;
  border-top: 1px solid #e2e8f0;
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 2rem;
  text-align: center;
  font-size: 1.75rem;
  color: var(--slate-600);
}
.footer__contact-item {
  color: var(--slate-600);
  text-decoration: none;
}
.footer__contact-item:hover {
  color: var(--ink);
  text-decoration: underline;
}
.footer__legal {
  max-width: 64rem;
  margin: 1.5rem auto 0;
  border-top: 1px solid #e2e8f0;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--slate-500);
}
.footer__broker-blurb {
  max-width: 64rem;
  margin: 1.25rem auto 0;
  text-align: center;
}
.footer__broker-blurb p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--slate-500);
}

/* ===================== GUIDE DOWNLOAD MODAL ===================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal[hidden] { display: none; }

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 44, 43, 0.55);
  backdrop-filter: blur(3px);
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26rem;
  background: var(--bg);
  border-radius: 1.5rem;
  padding: 2.25rem 1.75rem 2rem;
  box-shadow: 0 24px 60px rgba(8, 44, 43, 0.3);
  animation: fade-scale 0.25s ease both;
}

.modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: var(--slate-500);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.modal__close:hover { background: rgba(15, 23, 42, 0.06); color: var(--ink); }

.modal__title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.1;
  margin-top: 0.5rem;
}
.modal__lede {
  margin-top: 0.75rem;
  color: var(--slate-600);
  line-height: 1.6;
}

.guide-form { margin-top: 1.5rem; }
.guide-form__field { display: block; margin-bottom: 1rem; }
.guide-form__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 0.4rem;
}
.guide-form__field input,
.guide-form__field select,
.guide-form__field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid #d6cfc2;
  border-radius: 0.75rem;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.guide-form__field textarea { resize: vertical; }
.guide-form__field input:focus,
.guide-form__field select:focus,
.guide-form__field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(7, 63, 61, 0.12);
}
.guide-form__submit { width: 100%; margin-top: 0.25rem; }
.guide-form__submit:disabled { opacity: 0.7; cursor: default; }
.guide-form__note {
  margin-top: 0.85rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--slate-500);
  text-align: center;
}

.modal__body--success { text-align: center; }
.modal__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 0.5rem;
  border-radius: 9999px;
  background: rgba(7, 63, 61, 0.12);
  color: var(--green);
}
.modal__check svg { width: 1.75rem; height: 1.75rem; }
.modal__body--success .btn { margin-top: 1.5rem; }

/* Family Fit modal — wider, scrollable, grouped */
.modal__dialog--wide {
  max-width: 32rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
}
.guide-form__group-label {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin: 1.5rem 0 0.85rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e7e0d3;
}
.guide-form__group-label:first-of-type {
  margin-top: 0.5rem;
  padding-top: 0;
  border-top: none;
}
.guide-form__group-note {
  margin: -0.4rem 0 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--slate-600);
}

/* ===================== RESPONSIVE ===================== */
@media (min-width: 640px) {
  .hero__actions { flex-direction: row; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .hero__grid {
    grid-template-columns: repeat(2, 1fr);
    padding-bottom: 7rem;
    padding-top: 4rem;
  }
  .why__grid { grid-template-columns: 0.9fr 1.1fr; }
  .feature { grid-template-columns: 0.8fr 1fr; }
  .footer__grid { grid-template-columns: repeat(2, 1fr); }
  .footer__broker {
    border-top: 0;
    border-left: 1px solid #e2e8f0;
    padding-top: 0;
  }
}

/* ===================== ENTRANCE ANIMATIONS ===================== */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; animation: fade-in 0.7s ease forwards; }
  .reveal--up { animation-name: fade-up; }
  .reveal--scale { animation-name: fade-scale; animation-delay: 0.1s; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-scale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===================== LISTINGS PAGE ===================== */
.hero--listings {
  background: radial-gradient(120% 120% at 75% 0%, #0d4f4c 0%, var(--green-deep) 55%, #04201f 100%);
}
.hero__grid--listings {
  grid-template-columns: 1fr;
  padding-bottom: 4rem;
}
.hero__grid--listings .hero__copy { max-width: 42rem; }

.listings-search__head {
  max-width: 40rem;
  margin: 0 auto;
  text-align: center;
}
.listings-search__widget {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}
.listings-search__widget--full {
  width: 100%;
}
.listings-search__head--secondary {
  margin-top: 4rem;
}

@media (min-width: 768px) {
  .hero__grid--listings { padding-top: 3rem; }
}
