:root {
  --white: #ffffff;
  --navy: #0f2748;
  --navy-deep: #091a31;
  --sky: #3aa0ff;
  --sky-dark: #126fc6;
  --mist: #f2f7fc;
  --ink: #172033;
  --muted: #5c6878;
  --line: #dce4ed;
  --font-heading: "Plus Jakarta Sans", Arial, sans-serif;
  --font-body: "Lora", Georgia, serif;
  --container: 76rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --section-space: clamp(4.5rem, 9vw, 8rem);
  --radius: 0.75rem;
  --shadow: 0 1.25rem 3.5rem rgba(15, 39, 72, 0.14);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 20rem;
  overflow-x: hidden;
  overflow-x: clip; /* avoid body becoming a scroll container (Safari scroll clamp) */
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.7;
}
body.nav-open { overflow: hidden; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
p, h1, h2, h3, figure, blockquote { margin-top: 0; }
h1, h2, h3 {
  font-family: var(--font-heading);
  line-height: 1.08;
  letter-spacing: -0.035em;
}
h1 { margin-bottom: 1.25rem; font-size: clamp(2.45rem, 7vw, 5.4rem); }
h2 { margin-bottom: 1.25rem; font-size: clamp(2rem, 5vw, 3.7rem); }
h3 { margin-bottom: 0.55rem; font-size: 1.35rem; }
::selection { background: var(--sky); color: var(--navy-deep); }
:focus-visible { outline: 3px solid var(--sky-dark); outline-offset: 4px; }

.skip-link {
  position: fixed; top: 0.75rem; left: 0.75rem; z-index: 1000;
  padding: 0.75rem 1rem; background: var(--navy); color: var(--white);
  font-family: var(--font-heading); font-weight: 700; text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }
.container { width: min(calc(100% - (var(--gutter) * 2)), var(--container)); margin-inline: auto; }
.section { padding-block: var(--section-space); }
.eyebrow {
  margin-bottom: 0.85rem; color: var(--sky-dark); font-family: var(--font-heading);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.site-header {
  position: relative; z-index: 100; border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.97);
}
.nav-shell {
  display: flex; align-items: center; justify-content: space-between;
  width: min(calc(100% - (var(--gutter) * 2)), var(--container));
  min-height: 4.75rem; margin-inline: auto;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.65rem;
  color: var(--navy); font-family: var(--font-heading); font-size: 0.9rem;
  font-weight: 700; letter-spacing: -0.02em; text-decoration: none;
}
.brand b { display: block; color: var(--muted); font-size: 0.61rem; letter-spacing: 0.09em; text-transform: uppercase; }
.brand-mark {
  display: grid; width: 2.15rem; height: 2.15rem; place-items: center;
  border-radius: 0.38rem; background: var(--navy); color: var(--white);
}
.nav-toggle {
  display: grid; width: 2.75rem; height: 2.75rem; padding: 0; place-content: center;
  gap: 0.3rem; border: 0; background: transparent; color: var(--navy); cursor: pointer;
}
.nav-toggle span { width: 1.45rem; height: 2px; background: currentColor; transition: transform 180ms ease, opacity 180ms ease; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(0.42rem) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-0.42rem) rotate(-45deg); }
.primary-nav {
  position: fixed; inset: 4.75rem 0 0; display: none; align-content: start;
  padding: 2.25rem var(--gutter); background: var(--white);
}
.primary-nav.is-open { display: grid; }
.primary-nav a {
  padding: 0.9rem 0; border-bottom: 1px solid var(--line);
  font-family: var(--font-heading); font-size: 1.2rem; font-weight: 600; text-decoration: none;
}
.primary-nav .phone-link { margin-top: 1rem; border: 0; color: var(--sky-dark); }

.hero { position: relative; display: grid; background: var(--navy-deep); }
.hero-image { width: 100%; height: clamp(24rem, 66svh, 47rem); object-fit: cover; object-position: 58% center; }
.hero-card {
  position: relative; z-index: 2; width: 100%; padding: 1.75rem var(--gutter) 2rem;
  background: var(--white); box-shadow: var(--shadow);
}
.hero-card > p:not(.eyebrow) { max-width: 38rem; margin-bottom: 1.65rem; color: var(--muted); }
.button-row { display: flex; flex-direction: column; gap: 0.75rem; }
.button {
  display: inline-flex; min-height: 3rem; align-items: center; justify-content: center;
  padding: 0.78rem 1.2rem; border: 2px solid var(--navy); border-radius: 0.35rem;
  font-family: var(--font-heading); font-size: 0.82rem; font-weight: 700;
  text-align: center; text-decoration: none; cursor: pointer;
}
.button--primary { background: var(--navy); color: var(--white); }
.button--primary:hover { border-color: var(--sky-dark); background: var(--sky-dark); }
.button--secondary { background: transparent; color: var(--navy); }
.button--secondary:hover { background: var(--mist); }

.section-heading { display: grid; gap: 0.5rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-heading h2 { max-width: 44rem; margin-bottom: 0; }
.section-heading > p { max-width: 34rem; margin-bottom: 0; color: var(--muted); }
.listing-grid, .team-grid, .testimonial-grid, .contact-grid { display: grid; gap: 1rem; }
.listing-card {
  display: flex; min-width: 0; height: 100%; flex-direction: column;
  overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
}
.listing-image-wrap { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--mist); }
.listing-image-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: center 54%; transition: transform 450ms ease; }
.listing-image-wrap--interior img { object-position: 52% 48%; }
.listing-image-wrap--estate img { object-position: 45% 50%; }
.listing-card:hover img { transform: scale(1.025); }
.price-chip {
  position: absolute; left: 0.85rem; bottom: 0.85rem; padding: 0.42rem 0.68rem;
  border-radius: 999px; background: var(--white); color: var(--navy);
  font-family: var(--font-heading); font-size: 0.73rem; font-weight: 700; box-shadow: 0 0.35rem 1rem rgba(0,0,0,0.14);
}
.listing-body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; padding: 1.35rem; }
.listing-location, .role {
  margin-bottom: 0.45rem; color: var(--sky-dark); font-family: var(--font-heading);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
.listing-details { margin-bottom: 0.85rem; color: var(--navy); font-family: var(--font-heading); font-size: 0.74rem; font-weight: 600; }
.listing-body > p:last-of-type { margin-bottom: 1.4rem; color: var(--muted); font-size: 0.93rem; }
.card-link { margin-top: auto; color: var(--navy); font-family: var(--font-heading); font-size: 0.82rem; font-weight: 700; text-underline-offset: 0.3rem; }

.stats-band { padding-block: 3.75rem; background: var(--navy); color: var(--white); }
.stats-grid { display: grid; gap: 2.25rem; text-align: center; }
.stat { display: grid; gap: 0.3rem; }
.stat strong { font-family: var(--font-heading); font-size: clamp(2.4rem, 8vw, 4.5rem); line-height: 1; letter-spacing: -0.055em; }
.stat > span { color: #bed4ec; font-size: 0.86rem; }
.stat-unit { color: var(--sky); }

.team-section { background: var(--mist); }
.team-card {
  display: grid; height: 100%; grid-template-columns: minmax(7rem, 36%) 1fr; overflow: hidden;
  border-radius: var(--radius); background: var(--white); box-shadow: 0 0.9rem 2rem rgba(15,39,72,0.07);
}
.team-card > div:last-child { align-self: center; padding: 1.25rem; }
.team-card p:last-child { margin-bottom: 0; color: var(--muted); font-size: 0.88rem; }
.css-portrait { position: relative; min-height: 13rem; overflow: hidden; background: #b7d7f4; }
.css-portrait::before {
  position: absolute; top: 2.1rem; left: 50%; width: 4.6rem; height: 5.2rem;
  border-radius: 48% 48% 45% 45%; background: #d59a76; content: ""; transform: translateX(-50%);
}
.css-portrait::after {
  position: absolute; bottom: -2rem; left: 50%; width: 10.5rem; height: 8rem;
  border-radius: 48% 48% 0 0; background: var(--navy); content: ""; transform: translateX(-50%);
}
.css-portrait span {
  position: absolute; z-index: 2; top: 1.45rem; left: 50%; width: 5.1rem; height: 2.7rem;
  border-radius: 52% 55% 30% 30%; background: #3d2b26; transform: translateX(-50%) rotate(-4deg);
}
.css-portrait--two { background: #d7e4ef; }
.css-portrait--two::before { background: #8c5b45; }
.css-portrait--two::after { background: #365f83; }
.css-portrait--two span { height: 2rem; background: #1f1b1a; }
.css-portrait--three { background: #cbe3dd; }
.css-portrait--three::before { background: #c98262; }
.css-portrait--three::after { background: #0f504e; }
.css-portrait--three span { width: 5.5rem; height: 5.9rem; border-radius: 50% 50% 35% 35%; background: #2d1f1c; }

.testimonials-section { border-bottom: 1px solid var(--line); }
.narrow-title { max-width: 42rem; }
.quote-card {
  display: flex; height: 100%; flex-direction: column; justify-content: space-between;
  margin: 0; padding: clamp(1.5rem, 4vw, 2.5rem); border-left: 4px solid var(--sky); background: var(--mist);
}
.quote-card blockquote { margin-bottom: 2rem; font-size: clamp(1.08rem, 2vw, 1.35rem); line-height: 1.65; }
.quote-card figcaption { font-family: var(--font-heading); font-size: 0.8rem; font-weight: 700; }
.quote-card figcaption span { display: block; margin-top: 0.25rem; color: var(--muted); font-family: var(--font-body); font-weight: 400; }

.contact-section { background: #eaf3fb; }
.contact-grid { align-items: stretch; }
.contact-form-panel, .office-card { min-width: 0; height: 100%; padding: clamp(1.5rem, 4vw, 3rem); }
.contact-form-panel { background: var(--white); }
.contact-form-panel h2, .office-card h2 { font-size: clamp(2rem, 5vw, 3rem); }
form { display: grid; gap: 1rem; }
.field-row { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.35rem; }
label { color: var(--navy); font-family: var(--font-heading); font-size: 0.76rem; font-weight: 700; }
input, select, textarea {
  width: 100%; min-width: 0; border: 1px solid #aebccc; border-radius: 0.25rem;
  background: var(--white); color: var(--ink); padding: 0.72rem 0.8rem;
}
textarea { resize: vertical; }
.contact-form-panel .button { justify-self: start; }
.form-status { min-height: 1.7em; margin: 0; color: #256a3d; font-size: 0.85rem; }
.office-card {
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--navy); color: var(--white);
}
.office-card .eyebrow { color: #77bbff; }
.office-card address { color: #d2e1f0; font-style: normal; }
.office-links { display: grid; gap: 0.55rem; margin-top: 3rem; }
.office-links a { font-family: var(--font-heading); font-weight: 600; overflow-wrap: anywhere; }
.office-links p { margin: 0; color: #adc6df; }
.site-footer { padding-block: 1.5rem; background: var(--navy-deep); color: var(--white); }
.footer-inner { display: flex; flex-direction: column; gap: 1rem; }
.brand--footer { color: var(--white); }
.brand--footer b, .site-footer p { color: #adc6df; }
.site-footer p { margin: 0; font-size: 0.78rem; }

.motion-ready .reveal { opacity: 0; transform: translateY(1.5rem); transition: opacity 650ms ease, transform 650ms ease; transition-delay: calc(var(--delay, 0) * 90ms); }
.motion-ready .reveal.is-visible { opacity: 1; transform: none; }

@media (min-width: 40rem) {
  .button-row { flex-direction: row; }
  .button { width: auto; }
  .listing-grid, .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat + .stat { border-left: 1px solid rgba(255,255,255,0.2); }
  .testimonial-grid, .contact-grid, .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { flex-direction: row; align-items: center; justify-content: space-between; }
}

@media (min-width: 58rem) {
  .site-header { position: sticky; top: 0; }
  .nav-toggle { display: none; }
  .primary-nav { position: static; display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2rem); padding: 0; background: transparent; }
  .primary-nav a { padding: 0; border: 0; font-size: 0.76rem; }
  .primary-nav .phone-link { margin: 0 0 0 0.5rem; padding: 0.68rem 0.9rem; border-radius: 0.3rem; background: var(--navy); color: var(--white); }
  .hero { min-height: calc(100svh - 4.75rem); }
  .hero-image { height: calc(100svh - 4.75rem); min-height: 40rem; }
  .hero::after { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(3,16,32,0.35), transparent 55%); content: ""; }
  .hero-card { position: absolute; bottom: 2.5rem; left: max(var(--gutter), calc((100% - var(--container)) / 2)); width: min(40rem, calc(100% - (var(--gutter) * 2))); padding: 2.5rem; }
  .hero-card h1 { font-size: clamp(3rem, 5vw, 4.6rem); }
  .section-heading { grid-template-columns: minmax(0, 1.2fr) minmax(16rem, 0.6fr); align-items: end; justify-content: space-between; }
  .listing-grid, .team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .team-card { display: flex; flex-direction: column; }
  .css-portrait { min-height: 20rem; }
  .team-card > div:last-child { flex: 1; align-self: auto; }
  .contact-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* Standard: back-to-top button with scroll-progress ring */
.btt-button {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 900;
  width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(17, 17, 17, 0.85); cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  display: grid; place-items: center;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.btt-button.btt-visible { opacity: 1; visibility: visible; transform: none; }
.btt-button:focus-visible { outline: 3px solid #3aa0ff; outline-offset: 3px; }
.btt-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.btt-ring circle { fill: none; stroke-width: 3; }
.btt-ring-track { stroke: rgba(255, 255, 255, 0.22); }
.btt-ring-fill { stroke: #3aa0ff; stroke-dasharray: 125.66; stroke-dashoffset: 125.66; stroke-linecap: round; }
.btt-arrow { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) { .btt-button { transition: none; } }
