/* ==========================================================================
   Bridgewater Bay Villas
   Palette is taken straight off the logo: sand #EADEBA and the pale-blue
   medallion, with a deep teal-navy ink derived from them for type.
   Sand is decorative only — it never carries body text on a light ground.
   ========================================================================== */

:root {
  --ink:        #123A4A;
  --ink-deep:   #0C2A36;
  --ink-soft:   #4A6673;
  --muted:      #6B7F88;

  --sand:       #EADEBA;
  --sand-deep:  #D8C79A;
  --sky:        #DCE8F0;

  --paper:      #FFFFFF;
  --cream:      #F8F5EE;
  --line:       #E4DDCE;
  --line-soft:  #EFEAE0;

  --wrap:       1200px;
  --gap:        clamp(1.25rem, 3vw, 2.5rem);
  --pad-y:      clamp(4rem, 9vw, 8rem);
  --radius:     4px;

  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ------------------------------------------------------------------ reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-underline-offset: .2em; }
button { font: inherit; color: inherit; }

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -.015em;
  margin: 0 0 .6em;
}

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: .75rem 1.25rem;
}
.skip:focus { left: 0; }

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ----------------------------------------------------------------- layout */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.section { padding-block: var(--pad-y); }
/* Anchor targets must clear the sticky header when jumped to. */
:target, section[id], #top { scroll-margin-top: 92px; }
.section-tint { background: var(--cream); }
.section-ink { background: var(--ink); color: rgba(255,255,255,.78); }
.section-ink h2, .section-ink h3 { color: #fff; }
.section-ink .eyebrow { color: var(--sand); }

.eyebrow {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
  font-weight: 600;
}
.h2 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3.1rem); }
.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-sub { font-size: 1.075rem; margin: 0; }
.fineprint { font-size: .82rem; color: var(--muted); margin-top: 2.5rem; max-width: 46rem; }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  background: var(--ink); color: #fff;
  border: 1px solid var(--ink);
  padding: .8rem 1.6rem;
  border-radius: var(--radius);
  font-size: .875rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.btn:hover { background: var(--ink-deep); border-color: var(--ink-deep); transform: translateY(-1px); }
.btn-lg { padding: 1rem 2.1rem; }
.btn-sm { padding: .6rem 1.15rem; font-size: .78rem; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.section-ink .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.section-ink .btn-ghost:hover { background: var(--sand); color: var(--ink); border-color: var(--sand); }

/* ---------------------------------------------------------------- header */
.site-head {
  position: sticky; top: 0; z-index: 90;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.site-head.is-stuck {
  border-bottom-color: var(--line-soft);
  box-shadow: 0 8px 30px -22px rgba(18,58,74,.55);
}
.head-inner {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 76px;
}
.brand { flex: 0 0 auto; line-height: 0; }
.brand img { width: clamp(168px, 20vw, 226px); height: auto; }

.nav { margin-left: auto; display: flex; gap: clamp(1rem, 2.2vw, 2rem); }
.nav a {
  font-size: .82rem; font-weight: 600; letter-spacing: .05em;
  color: var(--ink-soft); text-decoration: none;
  padding-block: .35rem;
  border-bottom: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
  white-space: nowrap;
}
.nav a:hover, .nav a.is-active { color: var(--ink); border-bottom-color: var(--sand-deep); }

.head-actions { display: flex; align-items: center; gap: 1rem; }
.head-tel {
  font-size: .85rem; font-weight: 600; color: var(--ink);
  text-decoration: none; white-space: nowrap;
}
.burger { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; }
.burger-box { display: block; width: 22px; }
.burger-box i {
  display: block; height: 1.5px; background: var(--ink); margin: 5px 0;
  transition: transform .3s var(--ease), opacity .2s var(--ease);
}
.burger[aria-expanded="true"] i:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger[aria-expanded="true"] i:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] i:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; isolation: isolate; overflow: hidden; }
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 58%; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(100deg, rgba(255,255,255,.97) 0%, rgba(255,255,255,.92) 32%,
                    rgba(255,255,255,.55) 55%, rgba(255,255,255,.08) 78%);
}
.hero-inner {
  padding-block: clamp(5rem, 13vw, 10.5rem);
  max-width: var(--wrap);
}
.hero h1 {
  font-size: clamp(2.4rem, 1.4rem + 4.4vw, 4.6rem);
  max-width: 15ch;
  margin-bottom: .5em;
}
.lede {
  font-size: clamp(1.05rem, 1rem + .35vw, 1.25rem);
  max-width: 40ch;
  color: var(--ink-soft);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 2.25rem; }
.hero-cta .btn-ghost { background: rgba(255,255,255,.75); }

/* --------------------------------------------------------------- pillars */
.pillars { background: var(--ink); color: rgba(255,255,255,.72); }
.pillar-grid {
  display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  background: rgba(255,255,255,.12);
  border-inline: 1px solid rgba(255,255,255,.12);
}
.pillar { background: var(--ink); padding: clamp(1.75rem, 3.5vw, 2.75rem) clamp(1.25rem, 2.5vw, 2rem); }
.pillar h2 {
  font-size: 1.2rem; color: #fff; margin-bottom: .35rem;
  letter-spacing: 0;
}
.pillar p { margin: 0; font-size: .9rem; color: rgba(255,255,255,.62); }

/* ----------------------------------------------------------------- split */
.split {
  display: grid; gap: clamp(2rem, 5vw, 4.5rem);
  grid-template-columns: 1fr;
  align-items: center;
}
.split-copy p { max-width: 52ch; }
.split-media img { border-radius: var(--radius); box-shadow: 0 30px 60px -40px rgba(18,58,74,.5); }

.ticks { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: .55rem; }
.ticks li { position: relative; padding-left: 1.6rem; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--sand-deep);
}
.section-ink .ticks li::before { background: var(--sand); }
.address { font-family: var(--serif); font-size: 1.1rem; color: var(--ink); }

/* --------------------------------------------------------------- mosaic */
/* Even grid rather than a mosaic: nine photographs divide into three
   columns exactly, so no row is left with a hole in it. */
.mosaic {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: 62vw;
  gap: .75rem;
}
.tile { min-width: 0; }
.tile-btn {
  display: block; width: 100%; height: 100%; padding: 0;
  border: 0; background: var(--line-soft); cursor: zoom-in;
  border-radius: var(--radius); overflow: hidden; position: relative;
}
.tile-btn img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s var(--ease), filter .4s var(--ease);
}
.tile-btn:hover img { transform: scale(1.045); filter: saturate(1.06); }

/* ------------------------------------------------------------ floorplans */
/* The tab bar only does something once JS is running, so it only exists
   once JS is running. Without it every panel stays on the page, separated
   by a rule — no plan becomes unreachable. */
.plan-tabs { display: none; }
.js .plan-tabs {
  display: flex; flex-wrap: wrap; gap: .5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

/* A class rule beats the user-agent's [hidden] { display: none }, so the
   panel display value has to opt back out explicitly or every plan renders
   at once. */
.js .plan-panel[hidden] { display: none; }

/* Fallback separation between the stacked panels. */
.plan-panel + .plan-panel {
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-top: clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--line);
}
.js .plan-panel + .plan-panel { margin-top: 0; padding-top: 0; border-top: 0; }
.plan-tab {
  background: none; border: 0; cursor: pointer;
  padding: .85rem 1.25rem;
  font-size: .85rem; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.plan-tab:hover { color: var(--ink); }
.plan-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.plan-panel { display: grid; gap: clamp(2rem, 4vw, 3.5rem); grid-template-columns: 1fr; }
.plan-figure { min-width: 0; }
.plan-zoom {
  display: block; width: 100%; padding: 1rem;
  background: var(--cream); border: 1px solid var(--line);
  border-radius: var(--radius); cursor: zoom-in; position: relative;
}
.plan-zoom img { width: 100%; height: auto; }
.plan-zoom-hint {
  position: absolute; right: 1rem; bottom: 1rem;
  background: var(--ink); color: #fff;
  font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .4rem .75rem; border-radius: 2px;
  opacity: 0; transition: opacity .25s var(--ease);
}
.plan-zoom:hover .plan-zoom-hint, .plan-zoom:focus-visible .plan-zoom-hint { opacity: 1; }

.plan-detail h3 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); }
.plan-summary { max-width: 46ch; }
.plan-spec {
  margin: 1.75rem 0; padding: 1.25rem 0;
  border-block: 1px solid var(--line-soft);
  display: grid; gap: .75rem;
}
.plan-spec > div { display: flex; gap: 1rem; align-items: baseline; }
.plan-spec dt {
  flex: 0 0 6.5rem; font-size: .72rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.plan-spec dd { margin: 0; color: var(--ink); }

.chips { list-style: none; margin: 0 0 2rem; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.chips li {
  font-size: .78rem; padding: .35rem .7rem;
  background: var(--cream); border: 1px solid var(--line-soft);
  border-radius: 100px; color: var(--ink-soft);
}
.chips-inverse li {
  background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16);
  color: rgba(255,255,255,.85);
}
.plan-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; }
.link-dl { font-size: .85rem; font-weight: 600; color: var(--ink); }

/* -------------------------------------------------------------- features */
.feature-grid {
  display: grid; gap: clamp(2rem, 4vw, 3.5rem);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.feature-col h3 {
  font-size: .78rem; letter-spacing: .16em; text-transform: uppercase;
  font-family: var(--sans); font-weight: 700; color: var(--sand);
  padding-bottom: .9rem; margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.16);
}
.feature-col .ticks { margin-top: 0; gap: .7rem; font-size: .93rem; }
.optional {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid rgba(255,255,255,.16);
}
.optional h3 { font-size: 1.1rem; margin-bottom: 1.1rem; }

/* ---------------------------------------------------------------- form */
.inquire-grid { display: grid; gap: clamp(2.5rem, 5vw, 4.5rem); grid-template-columns: 1fr; }
.contact-list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .9rem; }
.contact-list li {
  display: flex; gap: 1rem; align-items: baseline;
  padding-bottom: .9rem; border-bottom: 1px solid rgba(255,255,255,.12);
}
.contact-list span {
  flex: 0 0 5.5rem; font-size: .7rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--sand);
}
.contact-list a { color: #fff; text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }

.inquire-form {
  background: var(--paper);
  padding: clamp(1.75rem, 3.5vw, 2.75rem);
  border-radius: var(--radius);
  box-shadow: 0 40px 80px -50px rgba(0,0,0,.6);
}
.row-2 { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
.field { margin: 0 0 1.15rem; display: grid; gap: .4rem; }
.field label { font-size: .78rem; font-weight: 600; letter-spacing: .04em; color: var(--ink); }
.field abbr { color: #A8442F; text-decoration: none; }
.field input, .field select, .field textarea {
  font: inherit; font-size: .95rem;
  color: var(--ink); background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .7rem .85rem;
  width: 100%;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.field textarea { resize: vertical; min-height: 6rem; }
.field input:focus, .field select:focus, .field textarea:focus {
  background: var(--paper); border-color: var(--ink);
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #A8442F; }
.field-check { display: flex; gap: .65rem; align-items: flex-start; }
.field-check input { width: auto; margin-top: .28rem; flex: 0 0 auto; }
.field-check label { font-weight: 400; font-size: .85rem; color: var(--ink-soft); line-height: 1.5; }
.field-error { color: #A8442F; font-size: .78rem; }

/* honeypot — off-screen rather than display:none, which some bots skip */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-actions { margin: 1.5rem 0 0; }
.form-status { margin: 1rem 0 0; font-size: .9rem; min-height: 1.4em; }
.form-status.is-ok { color: #1E6A4F; }
.form-status.is-err { color: #A8442F; }
[data-submit][disabled] { opacity: .6; cursor: progress; }

/* confirmation panel, shown in place of the form once it sends */
.form-done { text-align: center; padding-block: clamp(1rem, 3vw, 2.5rem); outline: none; color: var(--ink-soft); }
.form-done-icon { color: #1E6A4F; margin: 0 auto 1.25rem; }
.form-done .form-done-title { color: var(--ink); font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); margin-bottom: .5rem; }
.form-done p { max-width: 34ch; margin-inline: auto; }
.form-done .fineprint { margin-top: .75rem; }
.form-done .btn-ghost { color: var(--ink); border-color: var(--line); }
.form-done .btn-ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .form-done:not([hidden]) { animation: form-done-in .45s var(--ease) both; }
  .form-done:not([hidden]) .form-done-icon path { stroke-dasharray: 32; animation: form-done-tick .5s .25s var(--ease) both; }
}
@keyframes form-done-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes form-done-tick { from { stroke-dashoffset: 32; } to { stroke-dashoffset: 0; } }
.inquire-form .fineprint { margin-top: 1rem; }

/* --------------------------------------------------------------- footer */
.site-foot { background: var(--ink-deep); color: rgba(255,255,255,.55); padding-block: clamp(3rem, 6vw, 5rem); }
.foot-inner { display: grid; gap: 2.5rem; }
.foot-brand img { width: 220px; }
.foot-tag { margin: 1rem 0 0; font-size: .85rem; color: var(--sand); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.foot-nav a { color: rgba(255,255,255,.75); text-decoration: none; font-size: .85rem; }
.foot-nav a:hover { color: #fff; text-decoration: underline; }
.foot-legal p { margin: 0 0 .75rem; font-size: .78rem; line-height: 1.6; max-width: 60ch; }
.foot-copy { color: rgba(255,255,255,.4); }

/* ------------------------------------------------------------- lightbox */
.lightbox { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; }
.lightbox[hidden] { display: none; }
.lb-backdrop { position: absolute; inset: 0; background: rgba(8,26,33,.94); cursor: zoom-out; }
.lb-figure {
  position: relative; margin: 0; max-width: min(94vw, 1500px); max-height: 88vh;
  display: flex; flex-direction: column; gap: .9rem; align-items: center;
}
.lb-figure img {
  max-width: 100%; max-height: 78vh; width: auto; object-fit: contain;
  background: #fff; border-radius: var(--radius);
}
.lb-figure figcaption {
  color: rgba(255,255,255,.72); font-size: .85rem; text-align: center; max-width: 60ch;
}
.lb-btn {
  position: absolute; z-index: 2;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22);
  color: #fff; cursor: pointer; border-radius: 50%;
  width: 46px; height: 46px; line-height: 1; font-size: 1.5rem;
  display: grid; place-items: center;
  transition: background .2s var(--ease);
}
.lb-btn:hover { background: rgba(255,255,255,.22); }
.lb-close { top: 1.25rem; right: 1.25rem; font-size: 1.35rem; }
.lb-prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1.25rem; top: 50%; transform: translateY(-50%); }
.lightbox.is-single .lb-prev, .lightbox.is-single .lb-next { display: none; }
body.lb-open { overflow: hidden; }

/* --------------------------------------------------------------- reveal */
/* Gated behind .js, which an inline script in <head> sets. If the script
   file fails to load the content simply stays visible rather than
   disappearing behind an animation that will never run. */
.js .reveal { opacity: 0; transform: translateY(18px); }
.js .reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.js .reveal.is-static { opacity: 1; transform: none; }

/* ------------------------------------------------------------ breakpoints */
@media (min-width: 700px) {
  .row-2 { grid-template-columns: 1fr 1fr; }
  .mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 32vw; }
  .foot-inner { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  .mosaic { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 21vw; }
  .split { grid-template-columns: 1fr 1fr; }
  .split-reverse .split-copy { order: 2; }
  .plan-panel { grid-template-columns: 1.35fr 1fr; align-items: start; }
  .inquire-grid { grid-template-columns: 1fr 1.15fr; align-items: start; }
  .foot-inner { grid-template-columns: 1.1fr 1fr 1.4fr; }
}

@media (max-width: 979px) {
  .nav {
    position: fixed; inset: 76px 0 auto; z-index: 80;
    flex-direction: column; gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line-soft);
    box-shadow: 0 24px 40px -30px rgba(18,58,74,.6);
    padding: .5rem 1.25rem 1.25rem;
    transform: translateY(-12px);
    opacity: 0; visibility: hidden;
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: .9rem 0; font-size: .95rem; border-bottom: 1px solid var(--line-soft); }
  .nav a:last-child { border-bottom: 0; }
  .burger { display: block; order: 3; }
  .head-actions { margin-left: auto; }
}

@media (max-width: 560px) {
  /* Below this the logo, a CTA and the burger are all that fit.
     The phone number goes; the CTA never does — it's the whole point. */
  .head-tel { display: none; }
  .mosaic { grid-auto-rows: 68vw; gap: .5rem; }
  .hero::after {
    background: linear-gradient(180deg, rgba(255,255,255,.96) 0%,
                rgba(255,255,255,.9) 45%, rgba(255,255,255,.55) 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-head, .burger, .lightbox, .hero-cta, .inquire-form, .foot-nav { display: none !important; }
  body { color: #000; }
  .section { padding-block: 1.5rem; }
}
