:root {
  --color-green: #1E4B3D;
  --color-blue: #003B49;
  --color-gold: #DFD19C;
  --color-white: #FFFFFF;
  --font-heading: 'Montserrat', sans-serif;
  --container-max: 1240px;
  /* Same on desktop and mobile: heading-to-paragraph gap, and its double for paragraph-to-button. */
  --gap-heading-text: 18px;
  --gap-text-btn: 36px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
}

body {
  font-family: var(--font-heading);
  color: var(--color-white);
  background: var(--color-green);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.1;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
}

img { max-width: 100%; display: block; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

a { color: inherit; text-decoration: none; }

/* Shared vertical section rhythm: desktop 70/100, tablet 60/80, mobile 40/40.
   Applied to all sections except the header, hero, and the section right after the hero. */
.section-pad {
  padding-top: 70px;
  padding-bottom: 100px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Scroll-reveal: progressive enhancement only, below-the-fold sections.
   .js class is set by the inline script so content stays visible with JS off. */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal:nth-child(2) { transition-delay: 0.12s; }
.reveal:nth-child(3) { transition-delay: 0.24s; }
.trellis-page-wrapper {
  width: 100%;
  overflow: hidden;
}

.mobile-sticky-cta { display: none; }

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

h2 {
  font-size: clamp(20px, calc(16.5px + 0.94vw), 30px);
  color: var(--color-gold);
  text-align: center;
}

.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 700;
  padding: 12px 30px;
  transition: filter 0.2s ease, background-color 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn-gold {
  background: var(--color-gold);
  color: var(--color-green);
}
.btn-gold:hover { filter: brightness(0.92); }

.btn-outline {
  background: transparent;
  color: var(--color-white);
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  padding: 11px 26px;
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.12); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  padding: 32px 0 0;
  background: transparent;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

.site-header.is-scrolled {
  padding: 16px 0;
  background: rgba(30, 75, 61, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  z-index: 400;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 34px;
  width: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 40px;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 36px;
}

.main-nav a {
  font-weight: 600;
  transition: 0.5s;
}
.main-nav a:hover {
  color: var(--color-gold);
}

.nav-toggle {
  display: none;
  position: relative;
  z-index: 21;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle .icon-close { display: none; }
.nav-toggle.is-open .icon-burger { display: none; }
.nav-toggle.is-open .icon-close { display: block; }

.mobile-menu { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 720px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--color-green) url('../assets/e49e009f2e01c467-1440.webp') center 30% / cover no-repeat;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 20, 15, 0.45) 0%, rgba(10, 20, 15, 0) 30%, rgba(10, 20, 15, 0) 60%, rgba(10, 20, 15, 0.35) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 760px;
  padding-top: 145px;
  padding-bottom: 200px;
}

.hero-content h1 {
  font-size: clamp(30px, calc(18.6px + 3.05vw), 50px);
  color: var(--color-white);
  text-align: center;
}

.hero-content p {
  color: var(--color-white);
  text-align: center;
  max-width: 560px;
  margin: var(--gap-heading-text) auto 0;
}

.hero-content .btn {
  margin-top: var(--gap-text-btn);
}

/* ---------- Stats band ---------- */
.stats {
  background: var(--color-green);
  padding: 0 0 50px;
}

.stats .container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  margin-top: -30px;
  position: relative;
  z-index: 10;
}

.stat-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 12px;
}

.stat-icon-ring {
  width: 61px;
  height: 61px;
  border-radius: 50%;
  background: var(--color-gold);
  border: 1.5px solid var(--color-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.stat-item h3 {
  font-size: 20px;
  line-height: 1;
  color: var(--color-gold);
  text-align: center;
  margin-bottom: var(--gap-heading-text);
}

.stat-item p {
  font-weight: 400;
  color: var(--color-white);
  text-align: center;
  max-width: 300px;
}

/* ---------- Living / Perfect place ---------- */
.living {
  position: relative;
  background: var(--color-blue);
  overflow: hidden;
}

.living-bg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

.living-inner {
  position: relative;
  z-index: 1;
}

.living-subtitle {
  margin-top: var(--gap-heading-text);
  font-weight: 400;
  color: var(--color-white);
  text-align: center;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.living-grid {
  margin-top: 60px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.living-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.living-card figcaption {
  margin-top: 20px;
  color: var(--color-white);
  text-align: center;
}

.living-carousel-nav { display: none; }

.living-cta {
  display: block;
  width: max-content;
  margin: 60px auto 0;
}

/* ---------- Location ---------- */
.location {
  display: flex;
  flex-direction: row-reverse;
  background: #1A4036;
}

.location-media {
  flex: 1 1 50%;
  min-width: 0;
}

.location-media img {
  width: 100%;
  max-width: 805px;
  object-fit: cover;
  display: block;
}

.location-content {
  flex: 1 1 calc(40% - 20px);
  display: flex;
  justify-content: end;
}

.location-inner {
  margin: 0 60px 0 0;
  max-width: 480px;
  padding-bottom: 60px;
}

.location-heading {
  color: var(--color-gold);
  text-align: left;
}

.location-tagline {
  margin-top: var(--gap-heading-text);
  font-weight: 700;
  color: var(--color-white);
}

.location-body {
  margin-top: 14px;
}

.location-list { margin-top: 28px; }

.location-list h3 {
  color: var(--color-gold);
  margin-bottom: 5px;
}

.location-list ul {
  list-style: disc;
  padding-left: 18px;
}

.location-list li::marker {
  color: var(--color-gold);
}

.location-list li + li {
  margin-top: 4px;
}

.location-cta { margin-top: 32px; }

/* ---------- Nearby amenities ---------- */
.nearby {
  position: relative;
  background: var(--color-green);
  overflow: hidden;
  padding-bottom: 0;
  min-height: 780px;
}

.nearby-bg {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

.nearby-inner {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 64px;
}

.nearby-content {
  flex: 1 1 420px;
  max-width: 460px;
}

.nearby-heading {
  color: var(--color-gold);
  text-align: left;
}

.nearby-tagline {
  margin-top: var(--gap-heading-text);
  font-weight: 700;
  color: var(--color-white);
}

.nearby-body {
  margin-top: 18px;
  color: var(--color-white);
}

.nearby-cta { margin-top: var(--gap-text-btn); }

.nearby-collage {
  position: absolute;
  width: 1026px;
  aspect-ratio: 1 / 1;
  right: 0;
  bottom: 0;
  height: 666px;
}

/* height:auto is essential on all three: they carry width/height attributes, so a
   CSS width alone leaves the intrinsic height behind and stretches them into ovals. */
.nearby-map {
  position: absolute;
  bottom: -100px;
  left: 0;
  width: 680px;
  height: auto;
}

.nearby-photo {
  position: absolute;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  border-radius: 50%;
  height: auto;
}

.nearby-photo--daughter {
  width: 284px;
  top: 0;
  left: 400px;
}

.nearby-photo--running {
    width: 490px;
    top: 25px;
    right: -65px;
}

/* ---------- Trusted partners ---------- */
.partners {
  padding-top: 30px;
  background: var(--color-white);
}

.partners-heading {
  color: var(--color-green);
  text-align: center;
  margin-bottom: 60px;
}

.partners-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 48px;
}

.partners-logos img {
  max-height: 32px;
  width: auto;
}
.partners-logos img[alt='Fairhaven Homes'] {
    max-height: 64px;
}

/* ---------- FAQ ---------- */
.faq {
  position: relative;
  background: #E7ECEC;
}

.faq-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 60px;
}

.faq-heading {
  flex: 0 0 280px;
  color: var(--color-green);
  text-align: left;
}

.faq-list {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 740px;
}

.faq-item {
  background: var(--color-white);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(15, 40, 30, 0.08);
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  font-weight: 700;
  color: var(--color-green);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-icon {
  flex-shrink: 0;
  display: inline-flex;
  width: 18px;
  height: 16px;
  transition: transform 0.25s ease;
}

.faq-icon svg { width: 100%; height: 100%; }

.faq-item[open] .faq-icon { transform: rotate(45deg); }

.faq-answer {
  margin: 0;
  padding: 0 24px 22px;
  color: #4B5A56;
}

/* ---------- Enquiry form ---------- */
.enquiry {
  background: var(--color-green);
}

.enquiry-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 64px;
}

.enquiry-intro {
  flex: 0 0 480px;
}

.enquiry-heading {
  color: var(--color-gold);
  text-align: left;
}

.enquiry-subhead {
  margin-top: var(--gap-heading-text);
  font-weight: 700;
}

.enquiry-address {
  margin-top: 18px;
}

.enquiry-form {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 545px
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.enquiry-form > * + * {
  margin-top: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 700;
  color: var(--color-white);
}

.form-group input {
  height: 40px;
  width: 100%;
  background: var(--color-white);
  border: none;
  padding: 0 10px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--color-green);
}

.form-group input::placeholder {
  color: rgba(26, 64, 54, 0.40);
}

.timeframe-group {
  margin-top: 24px;
  border: none;
}

.timeframe-group legend {
  padding: 0;
  margin-bottom: 12px;
  font-weight: 700;
  color: var(--color-white);
}

.timeframe-options {
  display: grid;
  grid-template-columns: repeat(2, 262px);
  gap: 16px;
}

.timeframe-option {
  position: relative;
  display: flex;
  align-items: center;
  width: 262px;
  height: 40px;
  padding: 0 20px;
  border: 1px solid var(--color-white);
  cursor: pointer;
}

.timeframe-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.timeframe-option span {
  display: flex;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  font-weight: 400;
  color: var(--color-white);
}

.timeframe-option:has(input:checked) {
  background: var(--color-gold);
  border-color: var(--color-gold);
}

.timeframe-option:has(input:checked) span { color: var(--color-green); }

.timeframe-option:has(input:focus-visible) {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

.enquiry-submit {
  margin-top: 32px;
}

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
      .section-pad { padding-top: 60px; padding-bottom: 80px; }
    .hero{
        min-height: 600px;
    }
    .hero-content{
        padding-top: 60px;
        padding-bottom: 120px;
    }
    .main-nav ul{
        gap: 24px;
        font-size: 14px;
    }
    .site-header .btn-outline{
        font-size: 14px;
    }
    .stats {
        padding-bottom: 30px;
    }
    .stat-item{
        padding: 0;
    }
    .stats .container{
        gap: 16px;
    }
    .partners-logos{
        gap: 24px;
    }
    .location-list h3{
       font-size: 16px; 
    }
    /* Desktop composition scaled down ~0.46; the copy column narrows so it
       clears the leaf instead of leaving a void beside it. */
    .nearby{
        min-height: 560px;
    }
    .nearby-content {
        max-width: 360px;
    }
    .nearby-collage {
        width: 472px;
        height: 306px;
    }
    .nearby-map {
        width: 313px;
        bottom: -46px;
        left: 0;
    }
    .nearby-photo--daughter {
        width: 131px;
        top: 0;
        left: 184px;
    }
    .nearby-photo--running {
        width: 225px;
        top: 12px;
        right: -30px;
    }
    .enquiry-inner{
        gap: 24px;
    }
    .enquiry-intro {
        flex: 0 0 280px;
    }
    .timeframe-options {
        grid-template-columns: repeat(2, auto);
    }
    .timeframe-option{
        width: auto;
    }
    .faq-inner {
        gap: 24px;
    }
    .faq-list {
        max-width: auto;
    }
  .partners-logos img[alt='Fairhaven Homes'] {
    max-height: 44px;
}
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  html { scroll-padding-top: 80px; }
    .hero {
            align-items: start;
        min-height: 640px;
    }

  .hero { background-image: url('../assets/af4da2b7bb1598f2.webp'); }

  .site-header { padding: 22px 0 0; }

  .logo-img { height: 24px; }

  .main-nav ul,
  .main-nav .btn-outline { display: none; }

  .nav-toggle { display: block; }

  .mobile-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    position: fixed;
    inset: 0;
    z-index: 20;
    background: var(--color-green);
    padding: 100px 24px 40px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .mobile-menu.is-open { transform: translateX(0); }

  .mobile-menu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 26px;
  }

  .mobile-menu a {
    font-weight: 600;
    color: var(--color-white);
  }
  .mobile-menu a.btn-gold {
    color: var(--color-green);
}

  .hero-content {
    padding-top: 120px;
    padding-bottom: 56px;
    max-width: 100%;
  }

  .section-pad { padding-top: 40px; padding-bottom: 40px; }

  .stats .container{
        margin-top: -80px;
  }
  .stats { padding: 48px 0 56px; }

  .stats .container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .stat-item p { max-width: 320px; }

  .living-grid {
    margin-top: 32px;
    grid-template-columns: 100%;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .living-grid::-webkit-scrollbar { display: none; }

  .living-card { scroll-snap-align: start; padding: 0 4px; }

  .living-carousel-nav {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 36px;
  }

  .carousel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 4.415px;
    border: none;
    background: #FFF;
    cursor: pointer;
  }

  .carousel-btn--prev svg { transform: scaleX(-1); }

  .living {
    padding-bottom: 80px;
}
  .living-cta { display: none; }

  .partners-logos { gap: 28px; }
  .partners-logos img { max-height: 24px; }

  .location { flex-direction: column; }
  .location-media img { width: 100%; height: 260px; object-fit: cover; }
  .location-inner { max-width: 100%; width: 100%; margin: 0; }
  .location-cta { display: none; }

  /* Nearby amenities collage — mirrors Figma "LCP B Mobile" (66:88), a 320px artboard.
     Sizes/offsets below are that artboard's values expressed as ratios of --w. */
  .nearby {
    display: flex;
    flex-direction: column;
    padding-top: 20px;
    padding-bottom: 40px;
    min-height: 0;
  }

  .nearby-bg { display: none; }

  /* The collage runs above the copy in normal flow, so the two can't collide. */
  .nearby-collage {
    order: -1;
    position: relative;
    inset: auto;
    margin: 0;
    --w: min(100vw, 390px);
    width: 100%;
    max-width: none;
    height: calc(var(--w) * 1.55);        /* 496 / 320 */
  }

  .nearby-map {
    top: 0;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    min-width: 0;
    max-width: none;                      /* the leaf is meant to bleed past both edges */
    width: calc(var(--w) * 1.259375);     /* 403 / 320 */
  }

  .nearby-photo--running {
    top: calc(var(--w) * 0.79375);        /* 254 / 320 */
    bottom: auto;
    left: auto;
    right: calc(var(--w) * -0.1125);      /* overflows the right edge by 36 / 320 */
    width: calc(var(--w) * 0.753125);     /* 241 / 320 */
  }

  /* Left edge lines up with the copy's container padding, as it does in Figma. */
  .nearby-photo--daughter {
    top: calc(var(--w) * 1.109375);       /* 355 / 320 */
    bottom: auto;
    left: 20px;
    width: calc(var(--w) * 0.4375);       /* 140 / 320 */
    z-index: 2;
  }

  .nearby-inner { flex-direction: column; gap: 32px; margin-top: 27px; }
  .nearby-content { max-width: 100%; flex: none; }
  .nearby-cta { display: none; }


  .faq-inner { flex-direction: column; gap: 24px; }
  .faq-heading { 
        flex: none; 
        margin-bottom: 20px;
    }
    .faq-list {
        max-width: 100%;
        width: 100%;
        flex: none;
    }
  .faq-item summary { padding: 16px 18px; }
  .faq-answer { padding: 0 18px 18px; }

  .enquiry-inner { flex-direction: column; gap: var(--gap-text-btn); }
  .enquiry-intro { 
    max-width: 100%; 
    flex:none;
    margin-bottom: 0;
  }
  .enquiry-submit{
    width: 100%;
  }
.enquiry-form {
        width: 100%;
    }
  .form-row { grid-template-columns: 1fr; gap: 20px; }
  .timeframe-options { grid-template-columns: 1fr; }
  .timeframe-option,
  .timeframe-option span { width: 100%; }

  .mobile-sticky-cta {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
    background: var(--color-green);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
    transform: translateY(0);
    transition: transform 0.3s ease;
  }

  .mobile-sticky-cta.is-hidden {
    transform: translateY(100%);
  }

  .mobile-sticky-cta .btn {
    display: block;
    width: 100%;
    text-align: center;
  }
}
