/* ============================================================
   HOMEPAGE — section styles for index.html
   Builds on colors_and_type.css + site.css (nav, hero, profile,
   waterfront, listings, numbers, voices, contact, footer).
   Classes: .hb (buy/sell cards) · .hc (certifications) ·
   .hn (new construction) · .ha (awards) · .hm (markets).
   ============================================================ */

/* ---------- 1 · HERO — text content ---------- */
.hero-h1 { max-width: 12ch; }
.hero-sub { margin-top: 22px; }
.hero-body {
  font-family: var(--font-ui);
  font-size: 17px; line-height: 1.7;
  color: var(--paper);
  max-width: 58ch; margin: 22px 0 0;
  text-shadow: 0 1px 14px rgba(15,22,40,.75), 0 1px 2px rgba(15,22,40,.4);
}

/* ---------- 2 · BUYING AND SELLING — two equal cards ---------- */
.hb { background: var(--paper); padding: 96px 0; }
.hb-inner {
  max-width: var(--page-max); margin: 0 auto; padding: 0 64px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px;
}
.hb-card {
  display: flex; flex-direction: column;
  background: var(--white);
  border: 1px solid var(--navy-line);
  min-width: 0;
}
.hb-media {
  margin: 0; aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--stone);
  border-bottom: 1px solid var(--navy-line);
}
.hb-media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; }
.hb-copy { flex: 1 1 auto; display: flex; flex-direction: column; align-items: flex-start; padding: 44px 48px 48px; }
.hb-h {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(30px, 2.9vw, 44px); line-height: 1.08; letter-spacing: -.018em;
  color: var(--navy); margin: 0 0 18px;
  text-wrap: balance;
}
.hb-p {
  font-family: var(--font-ui);
  font-size: 16.5px; line-height: 1.75; color: var(--ink);
  max-width: 46ch; margin: 0 0 32px;
}
.hb-btn { margin-top: auto; }

/* ---------- 4 · INDUSTRY-LEADING CERTIFICATIONS ---------- */
.hc { background: var(--white); border-top: 1px solid var(--navy-line); padding: 80px 0; }
.hc-inner { max-width: var(--page-max); margin: 0 auto; padding: 0 64px; text-align: center; }
.hc-h {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(28px, 2.8vw, 40px); line-height: 1.1; letter-spacing: -.015em;
  color: var(--navy); margin: 0 0 44px;
}
/* The supplied banner, whole. Never wider than its own 1024px, so it is
   never upscaled; height follows width, so proportions are preserved. */
.hc-banner { display: block; width: 100%; max-width: 1024px; height: auto; margin: 0 auto; }

/* Phone rows (see index.html). Each row is a window onto the banner:
   --x = first source column, --w = source width of the row. All rows use
   the scale of the widest row (380 source px), so every badge renders at
   the same size. */
.hc-rows { display: none; }
.hc-row {
  display: block; overflow: hidden;
  width: calc(var(--w) / 380 * 100%);
  aspect-ratio: var(--w) / 133;
}
.hc-row img {
  display: block; max-width: none; height: auto;
  width: calc(1024 / var(--w) * 100%);
  margin-left: calc(var(--x) / var(--w) * -100%);
}

/* ---------- 7 · NEW CONSTRUCTION & DEVELOPMENT — compact feature ---------- */
.hn { background: var(--paper); border-top: 1px solid var(--navy-line); padding: 96px 0; }
.hn-inner {
  max-width: var(--page-max); margin: 0 auto; padding: 0 64px;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 72px;
  align-items: center;
}
.hn-media {
  margin: 0; aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--stone); border: 1px solid var(--navy-line);
}
.hn-media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.hn-h {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(32px, 3.2vw, 48px); line-height: 1.06; letter-spacing: -.02em;
  color: var(--navy); margin: 0 0 20px;
  text-wrap: balance;
}
.hn-p {
  font-family: var(--font-ui);
  font-size: 16.5px; line-height: 1.75; color: var(--ink);
  max-width: 44ch; margin: 0 0 32px;
}

/* ---------- 8 · A PRACTICE, MEASURED — four figures ---------- */
.stats--4 { grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: 36px; }
.stats--4 .stat-n { font-size: clamp(48px, 5.4vw, 88px); }

/* ---------- 9 · AWARDS & RANKINGS ---------- */
.ha { background: var(--white); padding: 120px 0; }
.ha-inner { max-width: var(--page-max); margin: 0 auto; padding: 0 64px; }
.ha-h {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(36px, 4vw, 60px); line-height: 1.02; letter-spacing: -.02em;
  color: var(--navy); margin: 0 0 56px;
}
.ha-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--navy-line);
  border-left: 1px solid var(--navy-line);
}
.ha-card {
  padding: 36px 36px 40px;
  border-right: 1px solid var(--navy-line);
  border-bottom: 1px solid var(--navy-line);
}
.ha-card h3 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(21px, 1.8vw, 26px); line-height: 1.2;
  color: var(--navy); margin: 0 0 14px;
}
.ha-card p {
  font-family: var(--font-ui);
  font-size: 15px; line-height: 1.7; color: var(--ink); margin: 0;
}

/* ---------- 10 · MARKETS WE SERVE ---------- */
.hm { background: var(--paper); border-top: 1px solid var(--navy-line); padding: 120px 0; }
.hm-inner { max-width: var(--page-max); margin: 0 auto; padding: 0 64px; }
.hm-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px;
  align-items: end; margin-bottom: 56px;
}
.hm-h {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(36px, 4vw, 60px); line-height: 1.02; letter-spacing: -.02em;
  color: var(--navy); margin: 0;
}
.hm-intro {
  font-family: var(--font-voice); font-style: italic; font-weight: 400;
  font-size: clamp(20px, 1.9vw, 25px); line-height: 1.45;
  color: var(--navy); margin: 0; max-width: 40ch;
}
.hm-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 32px;
}
.hm-card { display: flex; flex-direction: column; color: var(--navy); }
.hm-media {
  display: block; aspect-ratio: 3 / 2; overflow: hidden;
  background: var(--stone); border: 1px solid var(--navy-line);
  margin-bottom: 20px;
}
.hm-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1s cubic-bezier(.2,.6,.2,1); }
.hm-card:hover .hm-media img { transform: scale(1.03); }
.hm-name {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(22px, 2vw, 28px); line-height: 1.15;
  margin-bottom: 8px;
}
.hm-cap {
  font-family: var(--font-ui); font-weight: 500;
  font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; line-height: 1.7;
  color: var(--navy); opacity: .72;
}
.hm-card:focus-visible { outline: 1px solid var(--navy); outline-offset: 6px; }

/* ---------- 12 · READY TO BUY, SELL, OR INVEST? — compact two-column ---------- */
.contact { padding: 112px 0; }
.ct-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 80px;
  align-items: stretch;           /* left column matches the form's height */
}

/* Left column */
.ct-lead { display: flex; flex-direction: column; min-width: 0; }
.ct-lead .contact-h {
  font-size: clamp(34px, 3.5vw, 52px);
  line-height: 1.04; max-width: 14ch;
  margin: 18px 0 0;
}
.contact-intro {
  font-family: var(--font-ui);
  font-size: 17px; line-height: 1.75; color: var(--ink);
  max-width: 44ch; margin: 22px 0 0;
}
/* Two compact links side by side; they wrap if the column is narrow */
.cx.ct-links {
  display: flex; flex-wrap: wrap; gap: 10px;
  max-width: none; margin-top: 30px;
}
.cx.ct-links .cx-call,
.cx.ct-links .cx-alt { width: auto; flex: 0 0 auto; }
.cx.ct-links .cx-alt { min-height: 50px; padding: 0 22px; }

/* Decorative photo: takes only the space left beside the form. A zero
   flex basis and an absolutely placed image mean it can never make the
   left column taller than the form; the max-height keeps the crop
   shallow when the form is tall. */
.ct-media {
  position: relative;
  flex: 1 1 0;
  min-height: 150px; max-height: 260px;
  margin: 36px 0 0;
  overflow: hidden;
  background: var(--stone);
  border: 1px solid var(--navy-line);
}
.ct-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 62%;
}

/* Right column — the form, tightened */
.ct-form { min-width: 0; }
.contact-form-h {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(24px, 2vw, 30px); line-height: 1.1;
  color: var(--navy); margin: 0 0 8px;
}
.contact-form-sub {
  font-family: var(--font-ui); font-weight: 500;
  font-size: 10.5px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--navy); opacity: .7; margin: 0 0 26px;
}
.ct-form .form-fields { gap: 18px; }
.ct-form .field-row { gap: 20px; }
.ct-form .field-l { margin-bottom: 4px; }
.ct-form .field input,
.ct-form .field select,
.ct-form .field textarea { padding: 8px 0 10px; }
/* Shorter message box; still drag-to-expand (resize: vertical in site.css) */
.ct-form .field textarea { min-height: 72px; }
.ct-form .form-submit { margin-top: 8px; }
.ct-form .form-consent { margin-top: 10px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .hb-inner, .hc-inner, .hn-inner, .ha-inner, .hm-inner { padding-left: 40px; padding-right: 40px; }
  .hb-copy { padding: 36px 36px 40px; }
  .ha-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats--4 { gap: 24px; }
}

@media (max-width: 860px) {
  .hero-body { font-size: 15.5px; margin-top: 16px; }

  /* Four figures stack, matching the site's existing phone layout */
  .stats--4 { grid-template-columns: minmax(0, 1fr); gap: 0; }

  .hb { padding: 64px 0; }
  .hb-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 0 24px; }
  .hb-copy { padding: 28px 24px 32px; }
  .hb-p { font-size: 16px; margin-bottom: 26px; }

  .hc { padding: 64px 0; }
  .hc-inner { padding: 0 24px; }
  .hc-h { margin-bottom: 32px; }

  .hn { padding: 72px 0; }
  .hn-inner { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 0 24px; }

  .ha { padding: 80px 0; }
  .ha-inner { padding: 0 24px; }
  .ha-h { margin-bottom: 36px; }
  .ha-grid { grid-template-columns: minmax(0, 1fr); }
  .ha-card { padding: 28px 24px 30px; }

  .hm { padding: 80px 0; }
  .hm-inner { padding: 0 24px; }
  .hm-head { grid-template-columns: minmax(0, 1fr); gap: 18px; margin-bottom: 36px; }

  /* Contact: heading, intro and links above the form; no photo */
  .contact { padding: 72px 0; }
  .ct-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .ct-lead .contact-h { font-size: clamp(32px, 8.4vw, 40px); max-width: none; }
  .contact-intro { font-size: 16px; margin-top: 16px; }
  .cx.ct-links { margin-top: 24px; }
  .ct-media { display: none; }
}

@media (max-width: 480px) {
  /* Links stack full width for easy tapping */
  .cx.ct-links { display: grid; grid-template-columns: minmax(0, 1fr); }
  .cx.ct-links .cx-call,
  .cx.ct-links .cx-alt { width: 100%; }
}

@media (max-width: 600px) {
  .hm-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
}

/* Phones: the full banner would shrink its badges to ~40px tall, too
   small to read, so it is shown as three rows of three instead. */
@media (max-width: 640px) {
  .hc-banner { display: none; }
  .hc-rows { display: grid; justify-items: center; gap: 22px; }
}
