/* ==========================================================================
   The May Group — Design System
   Coastal-professional palette: deep navy + warm sand + verdigris accent.
   ========================================================================== */

:root {
  --navy-900: #0f2438;
  --navy-800: #16324a;
  --navy-700: #1f4460;
  --navy-600: #2c5a7c;
  --sand-100: #faf6ef;
  --sand-200: #f2e9da;
  --sand-300: #e8dac2;
  --gold-300: #e0b872;
  --gold-500: #b8863f;
  --gold-600: #9c6f30;
  --teal-500: #2e7d76;
  --teal-600: #24625c;
  --ink-900: #16202b;
  --ink-700: #3d4a56;
  --ink-500: #667685;
  --white: #ffffff;
  --success: #1e7d4b;
  --error: #b3372c;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(15, 36, 56, 0.08), 0 1px 2px rgba(15, 36, 56, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 36, 56, 0.12);
  --shadow-lg: 0 20px 48px rgba(15, 36, 56, 0.18);
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 6rem;
  --max-width: 1200px;
  --font-serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink-900);
  background: var(--white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.15; margin: 0 0 var(--space-4); color: var(--navy-900); }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }
p { margin: 0 0 var(--space-4); color: var(--ink-700); }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-5); }
.section { padding: var(--space-10) 0; }
.section--tight { padding: var(--space-8) 0; }
.section--navy { background: var(--navy-900); color: var(--sand-100); }
.section--navy h2, .section--navy h3 { color: var(--white); }
.section--navy p { color: var(--sand-200); }
.section--sand { background: var(--sand-100); }
.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.72rem; font-weight: 700; color: var(--gold-600); margin-bottom: var(--space-3);
}
.section--navy .eyebrow { color: var(--gold-500); }
.lede { font-size: 1.15rem; color: var(--ink-500); max-width: 640px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 0.85rem 1.6rem; border-radius: 999px; font-weight: 700; font-size: 0.98rem;
  text-decoration: none; border: 2px solid transparent; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-height: 48px; line-height: 1;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--gold-500); color: var(--navy-900); }
.btn-primary:hover { background: var(--gold-600); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border-color: currentColor; color: var(--navy-900); }
.section--navy .btn-outline { color: var(--white); }
.btn-outline:hover { background: rgba(255,255,255,0.08); }
.btn-block { width: 100%; }
.btn-lg { padding: 1.05rem 2rem; font-size: 1.05rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Utility bar — social links, sits above the sticky nav and scrolls away with the page. */
.topbar { background: var(--navy-900); }
.topbar-inner { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3); padding: 7px var(--space-5); max-width: var(--max-width); margin: 0 auto; }
.topbar-label { color: var(--sand-200); font-size: 0.76rem; font-weight: 600; letter-spacing: 0.02em; }
.social-links { display: flex; align-items: center; gap: var(--space-2); }
.social-links a { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; color: var(--sand-200); transition: color 0.2s ease, background-color 0.2s ease; }
.social-links a:hover { color: var(--white); background: rgba(255,255,255,0.14); }
.social-links svg { width: 14px; height: 14px; fill: currentColor; }
@media (max-width: 480px) { .topbar-label { display: none; } .topbar-inner { justify-content: center; } }

/* Header / Nav */
.site-header {
  /* Note: deliberately no backdrop-filter/transform here — either would make this
     element a "containing block" for the fixed-position mobile .nav-links panel
     below, clipping it to the header's own height instead of the full viewport. */
  position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,0.98);
  border-bottom: 1px solid var(--sand-300);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4) var(--space-5); max-width: var(--max-width); margin: 0 auto; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand-logo { height: 56px; width: auto; }
@media (max-width: 480px) { .brand-logo { height: 46px; } }
.nav-links { display: flex; gap: var(--space-6); list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; font-weight: 600; font-size: 0.94rem; color: var(--ink-700); padding: var(--space-2) 0; border-bottom: 2px solid transparent; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--navy-900); border-color: var(--gold-500); }
.nav-cta { display: flex; align-items: center; gap: var(--space-4); }
.nav-phone { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; text-decoration: none; color: var(--navy-900); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: var(--space-2); }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--navy-900); margin: 5px 0; }

@media (max-width: 880px) {
  .nav-links { position: fixed; top: var(--mobile-nav-top, 72px); right: 0; bottom: 0; left: 0; background: var(--white); flex-direction: column; padding: var(--space-6) var(--space-6); gap: var(--space-5); transform: translateX(100%); transition: transform 0.25s ease; overflow-y: auto; }
  .nav-links.is-open { transform: translateX(0); }
  .nav-toggle { display: block; }
  .nav-phone span.phone-text { display: none; }
}

/* Hero — background-image is set inline per-page (see build.py) rather than via a CSS
   custom property, because relative url() values inside custom properties resolve
   against the stylesheet that consumes them, not the page that defines them; setting
   it inline keeps the relative path resolving correctly against the HTML document. */
.hero {
  position: relative; color: var(--white); background-color: var(--navy-900);
  background-size: cover; background-position: center; background-repeat: no-repeat;
  padding: var(--space-12) 0 var(--space-10);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,36,56,0.55), rgba(15,36,56,0.82));
}
.hero .container { position: relative; z-index: 1; }
.hero .btn-outline { color: var(--white); border-color: rgba(255,255,255,0.85); }
.hero .btn-outline:hover { background: rgba(255,255,255,0.12); }
.hero-inner .eyebrow { color: var(--gold-300); }
.hero-grid { display: grid; grid-template-columns: 1fr 400px; gap: var(--space-10); align-items: start; }
.hero-inner { max-width: 560px; }
.hero h1 { color: var(--white); }
.hero .lede { color: var(--sand-200); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-6); }
.hero-stats { display: flex; flex-wrap: wrap; gap: var(--space-8); margin-top: var(--space-10); border-top: 1px solid rgba(255,255,255,0.25); padding-top: var(--space-6); }
.hero-stat strong { display: block; font-family: var(--font-serif); font-size: 1.8rem; color: var(--gold-500); }
.hero-stat span { font-size: 0.85rem; color: var(--sand-200); }

/* Hero valuation form card — the "instant form" front and center at the top of the
   homepage, in the space to the right of the headline on desktop. */
.hero-form-col { scroll-margin-top: var(--space-8); }
.hero-form-card {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: var(--space-6);
}
.hero-form-card .eyebrow { display: block; }
.hero-form-title { font-size: 1.3rem; margin-bottom: var(--space-5); }
.hero-form-card .lead-form-wrap { box-shadow: none; border: none; border-radius: 0; max-width: none; }
.hero-form-card .lead-form-wrap .lf-progress { margin: 0 calc(var(--space-6) * -1); width: calc(100% + var(--space-6) * 2); }
.hero-form-card .lead-form-wrap .lf-body { padding: var(--space-5) 0 0; }
.hero-form-card .powered-by-tag { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--sand-300); }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-inner { max-width: none; }
  .hero-form-col { margin-top: var(--space-8); }
}

/* Page header (non-home hero) */
.page-header { background: var(--navy-900); color: var(--white); padding: var(--space-10) 0 var(--space-8); }
.page-header h1 { color: var(--white); margin-bottom: var(--space-2); }
.breadcrumb { font-size: 0.85rem; color: var(--sand-300); }
.breadcrumb a { color: var(--sand-300); text-decoration: none; }

/* Grid / Cards */
.grid { display: grid; gap: var(--space-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  overflow: hidden; border: 1px solid var(--sand-300); transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-body { padding: var(--space-5); }
/* height:auto is required here — without it, the img's HTML width/height attributes
   (used for real intrinsic-size layout stability) resolve height before aspect-ratio
   gets a chance to, since only width:100% is otherwise author-overridden. */
.card img { aspect-ratio: 4/3; object-fit: cover; width: 100%; height: auto; }
.team-card img { aspect-ratio: 1/1; object-position: top center; }
.team-card .card-body { padding: var(--space-5); }
.team-card h3 { margin-bottom: 2px; }
.team-card .team-title { display: block; color: var(--teal-600); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--space-3); }
.team-card p { font-size: 0.92rem; }
.team-card .team-contact { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--sand-300); font-size: 0.88rem; color: var(--ink-700); line-height: 1.7; }
.team-card .team-contact a { color: var(--teal-600); font-weight: 600; text-decoration: none; }
.team-card .team-contact a:hover { text-decoration: underline; }
.service-card { padding: var(--space-6); text-align: left; }
.service-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--sand-200); display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-4); font-size: 1.3rem; }

/* Listings */
.listing-card .price { font-family: var(--font-serif); font-size: 1.35rem; color: var(--navy-900); font-weight: 700; }
.listing-meta { display: flex; gap: var(--space-4); color: var(--ink-500); font-size: 0.88rem; margin-top: var(--space-2); }
.listing-tag { display: inline-block; background: var(--teal-500); color: var(--white); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 10px; border-radius: 999px; margin-bottom: var(--space-2); }

.filter-bar { display: flex; flex-wrap: wrap; gap: var(--space-3); background: var(--sand-100); border: 1px solid var(--sand-300); border-radius: var(--radius-md); padding: var(--space-4); margin-bottom: var(--space-6); }
.filter-bar select, .filter-bar input { padding: 0.6rem 0.8rem; border-radius: var(--radius-sm); border: 1px solid var(--sand-300); font-size: 0.92rem; font-family: inherit; background: var(--white); min-height: 44px; }

/* Testimonials */
.quote-card { padding: var(--space-6); }
.quote-card .stars { color: var(--gold-500); letter-spacing: 2px; margin-bottom: var(--space-3); }
.quote-card footer { margin-top: var(--space-4); font-weight: 700; color: var(--navy-900); font-size: 0.9rem; }

/* Forms — standard fallback fields */
label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: var(--space-2); color: var(--navy-900); }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select, textarea {
  width: 100%; padding: 0.9rem 1rem; border: 1.5px solid var(--sand-300); border-radius: var(--radius-sm);
  font-size: 1rem; font-family: inherit; min-height: 48px; background: var(--white); color: var(--ink-900);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal-500); outline-offset: 1px; border-color: var(--teal-500); }
.field { margin-bottom: var(--space-5); }
.field-hint { font-size: 0.82rem; color: var(--ink-500); margin-top: var(--space-1); }

/* Consent checkboxes */
.consent-block { border: 1.5px solid var(--sand-300); border-radius: var(--radius-md); padding: var(--space-5); background: var(--sand-100); margin: var(--space-5) 0; }
.consent-row { display: flex; align-items: flex-start; gap: var(--space-3); }
.consent-row + .consent-row { margin-top: var(--space-4); }
.consent-row input[type="checkbox"] { width: 22px; height: 22px; min-width: 22px; margin-top: 2px; accent-color: var(--teal-500); }
.consent-row label { font-weight: 400; font-size: 0.9rem; color: var(--ink-700); margin: 0; }
.consent-row a { color: var(--teal-600); font-weight: 600; }
.consent-note { font-size: 0.78rem; color: var(--ink-500); margin-top: var(--space-3); }

/* ==========================================================================
   Multi-step "instant" lead form
   ========================================================================== */
.lead-form-wrap {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  border: 1px solid var(--sand-300); overflow: hidden; max-width: 560px;
}
.lead-form-wrap.is-embedded { max-width: none; box-shadow: none; border: none; }
.lf-progress { height: 6px; background: var(--sand-200); }
.lf-progress-bar { height: 100%; background: var(--gold-500); width: 0%; transition: width 0.3s ease; }
.lf-body { padding: var(--space-6); }
.lf-step { display: none; }
.lf-step.is-active { display: block; animation: lfFadeIn 0.25s ease; }
@keyframes lfFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.lf-step h3 { margin-bottom: var(--space-2); }
.lf-step .field { margin-bottom: var(--space-4); }
.lf-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-top: var(--space-4); }
.lf-choice {
  border: 1.5px solid var(--sand-300); border-radius: var(--radius-sm); padding: var(--space-4);
  text-align: center; font-weight: 700; cursor: pointer; background: var(--white); min-height: 48px;
}
.lf-choice:hover { border-color: var(--gold-500); }
.lf-choice[aria-pressed="true"] { border-color: var(--teal-500); background: rgba(46,125,118,0.08); color: var(--teal-600); }
.lf-actions { display: flex; justify-content: space-between; align-items: center; margin-top: var(--space-6); gap: var(--space-3); }
.lf-back { background: none; border: none; color: var(--ink-500); font-weight: 600; cursor: pointer; padding: var(--space-2); min-height: 44px; }
.lf-skip { background: none; border: none; color: var(--ink-500); font-size: 0.85rem; text-decoration: underline; cursor: pointer; margin-top: var(--space-2); }
.lf-error { color: var(--error); font-size: 0.85rem; margin-top: var(--space-2); display: none; }
.lf-error.is-visible { display: block; }
.lf-success { text-align: center; padding: var(--space-6) 0; }
.lf-success .icon { width: 56px; height: 56px; border-radius: 50%; background: var(--teal-500); color: var(--white); display: flex; align-items: center; justify-content: center; margin: 0 auto var(--space-4); font-size: 1.6rem; }
.lf-otp { letter-spacing: 0.4em; font-size: 1.4rem; text-align: center; }
noscript .nf-form { display: block; }

/* CTA banner */
.cta-banner { background: var(--navy-900); color: var(--white); border-radius: var(--radius-lg); padding: var(--space-8); text-align: center; }
.cta-banner h2 { color: var(--white); }
.cta-banner p { color: rgba(255,255,255,0.9); }

/* Footer */
.site-footer { background: var(--navy-900); color: var(--sand-200); padding: var(--space-10) 0 var(--space-6); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: var(--space-8); margin-bottom: var(--space-8); }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-logo { height: 64px; width: auto; margin-bottom: var(--space-4); }
.footer-powered-by { display: inline-flex; align-items: center; gap: 6px; }
.footer-powered-by img { height: 16px; width: auto; opacity: 0.9; }
.site-footer h4 { color: var(--white); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--font-sans); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: var(--space-2); }
.site-footer a { color: var(--sand-200); text-decoration: none; font-size: 0.92rem; }
.site-footer a:hover { color: var(--gold-500); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); padding-top: var(--space-5); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); font-size: 0.8rem; color: var(--sand-300); }

/* Scroll-reveal: hidden state only applies once we know JS is running (html.js,
   set by a tiny inline script in <head>) AND the visitor hasn't asked for reduced
   motion — so a visitor with JS disabled, or if the reveal script fails to load,
   always sees full content immediately. main.js also force-reveals everything
   shortly after load as a second safety net. */
.reveal { opacity: 1; transform: none; }
html.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
}

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--gold-500); color: var(--navy-900); padding: var(--space-3) var(--space-5); z-index: 100; font-weight: 700; text-decoration: none; }
.skip-link:focus { left: var(--space-4); top: var(--space-4); }
.section-head { max-width: 640px; margin: 0 auto var(--space-8); text-align: center; }
.badge-row { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.badge-row span { background: var(--sand-200); color: var(--navy-800); font-size: 0.78rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.powered-by-tag { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--ink-500); margin-top: var(--space-4); }
.powered-by-tag img { height: 20px; width: auto; }
