/* Crystal West Cleaning — Coastal Fresh design system.
   Single stylesheet for index.html, functions/[[path]].js pages, and legal pages.
   Breakpoints: 920px and 640px ONLY. */

/* ============================================================
   1. Tokens
   ============================================================ */
:root {
  --ink: #0B2239;        /* headings, body text, dark sections */
  --pacific: #1B6F8F;    /* links, secondary buttons, focus rings */
  --pacific-deep: #14566F;
  --seafoam: #DDF1EE;    /* tinted sections, result panels */
  --sand: #F7F3EC;       /* warm alternating section backgrounds */
  --coral: #F4845F;      /* THE accent: primary CTAs only */
  --brand-blue: #0077C4; /* Crystal West GMB logo blue */
  --coral-deep: #E06A44;
  --white: #FFFFFF;
  --ink-rgb: 11, 34, 57;
  --pacific-rgb: 27, 111, 143;
  --coral-rgb: 244, 132, 95;
  --max-width: 1200px;
  --container: min(var(--max-width), calc(100% - 2rem));
  --gutter: clamp(1rem, 4vw, 1.75rem);
  --section-gap: clamp(2rem, 5.5vw, 3.4rem);
  --radius: 0.9rem;
  --radius-pill: 999px;
  --shadow-soft: 0 16px 42px rgba(var(--ink-rgb), 0.08);
  --shadow-lift: 0 22px 54px rgba(var(--ink-rgb), 0.12);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ============================================================
   2. Base
   ============================================================ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;               /* iteration 2: denser layout supersedes the 17px spec */
  line-height: 1.55;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  color: var(--ink);
  font-weight: 600;
  margin: 0 0 0.45em;
}
h1 { font-size: clamp(1.75rem, 4.4vw, 2.7rem); }
h2 { font-size: clamp(1.35rem, 2.9vw, 1.85rem); }
h3 { font-size: 1.1rem; }
a { color: var(--pacific); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
/* Solid ring: the 50%-alpha pacific ring composites to ~2.2:1 on white and
   fails WCAG 1.4.11; solid pacific is 5.6:1 on white, 4.8:1 on seafoam. */
:focus-visible { outline: 3px solid var(--pacific); outline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(var(--pacific-rgb), 0.22); }

/* ============================================================
   3. Layout utilities
   ============================================================ */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-gap); }
.section-sand { background: var(--sand); }
.section-foam { background: var(--seafoam); }
.section-ink  { background: var(--ink); color: #EAF2F6; }
.section-ink h2, .section-ink h3 { color: var(--white); }
.section-ink .eyebrow { color: #9CC4D4; }
.section-ink .section-intro { color: rgba(234, 242, 246, 0.82); }
.section-ink a:not([class]) { color: #BFE0EA; }
.section-ink :focus-visible,
.cta-banner :focus-visible,
.announcement-bar :focus-visible,
footer :focus-visible { outline-color: #BFE0EA; }
/* The CTA banner's form is a WHITE card (see .cta-banner-form) — the light
   ring above is ~1.4:1 there, so restore the solid pacific ring inside it. */
.cta-banner-form :focus-visible { outline-color: var(--pacific); }

/* ============================================================
   4. Buttons
   ============================================================ */
.btn, .cta-primary, .cta-secondary, .service-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; padding: 0.55rem 1.25rem;
  border-radius: var(--radius-pill); font-weight: 600; font-family: var(--font-body);
  font-size: 1rem; line-height: 1.25; text-align: center;
  border: 2px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease,
              transform 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover, .btn:focus-visible,
.cta-primary:hover, .cta-primary:focus-visible,
.cta-secondary:hover, .cta-secondary:focus-visible,
.service-button:hover, .service-button:focus-visible { text-decoration: none; }
/* AA note: white on --coral is ~2.5:1 (fails); ink on --coral is ~6.3:1 and
   ~4.8:1 on the --coral-deep hover — the coral stays vivid, the text passes. */
.btn-primary, .cta-primary, .service-button.primary {
  background: var(--coral);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(var(--coral-rgb), 0.35);
}
.btn-primary:hover, .cta-primary:hover, .service-button.primary:hover {
  background: var(--coral-deep);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(var(--coral-rgb), 0.4);
}
.btn-primary:active, .cta-primary:active, .service-button.primary:active { transform: none; }
.btn-outline, .cta-secondary, .service-button.secondary {
  border-color: var(--pacific);
  color: var(--pacific-deep);
  background: transparent;
}
.btn-outline:hover, .cta-secondary:hover, .service-button.secondary:hover {
  background: rgba(var(--pacific-rgb), 0.08);
}
.section-ink .btn-outline, .section-ink .cta-secondary,
.cta-banner .btn-outline, .cta-banner .cta-secondary {
  border-color: #9CC4D4;
  color: #EAF2F6;
}
.section-ink .btn-outline:hover, .section-ink .cta-secondary:hover,
.cta-banner .btn-outline:hover, .cta-banner .cta-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}
.btn-small { min-height: 40px; padding: 0.45rem 1.1rem; font-size: 0.92rem; }
.service-button { width: 100%; }

/* ============================================================
   5. Cards (shared card language)
   ============================================================ */
.feature-card, .detail-card, .trust-card, .service-card, .checklist-card,
.areas-card, .hub-card, .service-sidebar-card, .mini-link-card, .testimonial,
.legal-card, .highlight, .gallery-card, .step {
  background: var(--white);
  border: 1px solid rgba(var(--pacific-rgb), 0.14);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: clamp(0.9rem, 2.2vw, 1.4rem);
}
/* Pacific keyline dash on the headline cards (coral is reserved for primary CTAs) */
.feature-card, .service-card, .checklist-card, .hub-card { position: relative; overflow: hidden; }
.feature-card::before, .service-card::before, .checklist-card::before, .hub-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: clamp(0.9rem, 2.2vw, 1.4rem);
  width: 2.75rem;
  height: 4px;
  border-radius: 0 0 6px 6px;
  background: var(--pacific);
}
.feature-card h3, .detail-card h3, .trust-card h3, .highlight h3, .areas-card h3,
.step h3, .service-card h3, .checklist-card h3, .gallery-feature-copy h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}
.feature-card p, .detail-card p, .trust-card p, .highlight p,
.areas-card p, .step p {
  margin: 0;
  font-size: 0.97rem;
  color: rgba(var(--ink-rgb), 0.82);
}
.card-body { margin-top: 0.5rem; }
.card-body p { margin: 0 0 0.5rem; }
.card-body ul { margin: 0.4rem 0 0; padding-left: 1.15rem; }
.card-body li + li { margin-top: 0.3rem; }
.card-body li::marker { color: var(--pacific); }
.service-card-link {
  display: inline-block;
  margin-top: 0.9rem;
  font-weight: 600;
  color: var(--pacific-deep);
}

/* ============================================================
   6. Waves & decoration
   ============================================================ */
.wave { display: block; width: 100%; height: clamp(18px, 4vw, 40px); }
.wave-flip { transform: scaleY(-1); }
.icon {
  display: block;
  width: 1.9rem;
  height: 1.9rem;
  stroke: currentColor;
  fill: none;
  color: var(--pacific);
  margin: 0 0 0.5rem;
}
.eyebrow {
  font: 600 0.8rem/1 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pacific);
  margin: 0 0 0.3rem;
}

/* ============================================================
   7. Header / nav / announcement / sticky CTA (920px collapse)
   ============================================================ */
.announcement-bar {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.85rem;
  line-height: 1.45;
  padding: 0.3rem 0;
}
.announcement-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);  /* match .container's content inset */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 1.2rem;
}
.announcement-bar a { color: var(--white); font-weight: 600; }
.announcement-group { display: flex; align-items: center; flex-wrap: wrap; gap: 0.3rem 0.8rem; }

header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid rgba(var(--pacific-rgb), 0.14);
}
.topbar {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);  /* match .container's content inset */
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding-block: 0.45rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover, .brand:focus-visible { text-decoration: none; color: var(--pacific-deep); }
.brand-mark { width: 2rem; height: 2rem; flex: none; color: var(--brand-blue); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0.6rem;
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle:hover { color: var(--pacific-deep); background: rgba(var(--pacific-rgb), 0.08); }
/* Label stays in the DOM for screen readers (JS swaps Menu/Close) but is
   visually hidden — the trigger is icon-only. */
.nav-toggle-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.nav-toggle-icon {
  position: relative;
  display: inline-block;
  width: 1.3rem;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.nav-toggle-icon::before, .nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, top 0.2s ease;
}
.nav-toggle-icon::before { top: -6px; }
.nav-toggle-icon::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after { top: 0; transform: rotate(-45deg); }

#primary-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.1rem 0.35rem;
}
#primary-nav a {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.45rem 0.5rem;
  border-radius: 0.5rem;
}
#primary-nav a:hover, #primary-nav a:focus-visible {
  color: var(--pacific-deep);
  text-decoration: underline;
  text-decoration-color: var(--pacific);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
/* Desktop: groups dissolve into the flat inline link row; the labels and the
   sheet's Book CTA exist only for the mobile dropdown. */
.nav-group { display: contents; }
.nav-group-label { display: none; }
.nav-cta { display: none; }

/* Function-page header nav (no JS, never collapses) */
.fn-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
}
.fn-nav a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.2rem;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
}
.fn-nav a:not(.btn):hover, .fn-nav a:not(.btn):focus-visible { color: var(--pacific-deep); }

/* Sticky mobile CTA bar — revealed ≤920px via .is-visible (scroll JS) */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: none;
  gap: 0.65rem;
  padding: 0.6rem var(--gutter) calc(0.6rem + env(safe-area-inset-bottom, 0px));
  background: var(--white);
  border-top: 1px solid rgba(var(--pacific-rgb), 0.12);
  box-shadow: 0 -12px 32px rgba(var(--ink-rgb), 0.14);
  transform: translateY(110%);
  transition: transform 0.25s ease;
}
.sticky-cta.is-visible { transform: none; }
.sticky-cta a { flex: 1 1 50%; }

/* ============================================================
   8. Heroes — homepage .hero, .service-hero, .legal-hero
   (light morning gradient replaces the old dark-green heroes)
   ============================================================ */
.hero, .service-hero, .legal-hero {
  position: relative;
  background: linear-gradient(165deg, var(--seafoam) 0%, var(--white) 55%, var(--sand) 100%);
  color: var(--ink);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(330px, 0.88fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "text contact" "side contact";
  gap: 1.05rem clamp(1.4rem, 3vw, 2.4rem);
  align-items: start;
  padding-block: clamp(1.55rem, 4.2vw, 3rem) clamp(0.85rem, 2.1vw, 1.55rem);
}
.hero-text { grid-area: text; max-width: 640px; }
.hero-side { grid-area: side; min-width: 0; }
.hero-text h1 { margin: 0.35rem 0 0.7rem; }
.hero-text > p {
  margin: 0;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: rgba(var(--ink-rgb), 0.8);
  max-width: 56ch;
}
.hero-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }
.badge, .estimate-pill, .service-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--white);
  border: 1px solid rgba(var(--pacific-rgb), 0.28);
  border-radius: var(--radius-pill);
  padding: 0.32rem 0.8rem;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--pacific-deep);
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.hero-art { width: min(100%, 320px); margin-top: clamp(1rem, 3vw, 1.7rem); }

/* Hero contact / lead-form card */
.hero-contact {
  grid-area: contact;
  background: var(--white);
  border: 1px solid rgba(var(--pacific-rgb), 0.16);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: clamp(1rem, 2.4vw, 1.4rem);
}
.hero-contact h2 { font-size: 1.3rem; margin: 0 0 0.4rem; }
.hero-contact > p { margin: 0 0 0.75rem; font-size: 0.95rem; color: rgba(var(--ink-rgb), 0.78); }
.contact-item { display: flex; flex-direction: column; gap: 0.1rem; margin-bottom: 0.5rem; }
.contact-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), 0.68);
}
.contact-item a { font-weight: 600; color: var(--pacific-deep); }
.hero-contact-ctas { display: grid; gap: 0.6rem; margin-top: 0.6rem; }
.hero-contact .cta-primary, .hero-contact .cta-secondary { width: 100%; }

/* Inquiry forms (hero + CTA banner) */
.inquiry-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(var(--pacific-rgb), 0.3);
}
.inquiry-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inquiry-field { display: grid; gap: 0.3rem; }
.inquiry-field--full { grid-column: 1 / -1; }
.inquiry-field label, .estimate-field label { font-size: 0.84rem; font-weight: 600; color: var(--ink); }
.inquiry-field input, .inquiry-field select, .inquiry-field textarea,
.estimate-field input, .estimate-field select {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.8rem;
  border: 1px solid rgba(var(--pacific-rgb), 0.32);
  border-radius: 0.65rem;
  background: var(--white);
  color: var(--ink);
}
.inquiry-field input:focus-visible, .inquiry-field select:focus-visible,
.inquiry-field textarea:focus-visible, .estimate-field input:focus-visible,
.estimate-field select:focus-visible {
  border-color: var(--pacific);
  outline-offset: 0;
}
.inquiry-field textarea { min-height: 88px; resize: vertical; }
.inquiry-form > .cta-primary { width: 100%; margin-top: 0.9rem; }
.form-note { margin: 0.65rem 0 0; font-size: 0.84rem; color: rgba(var(--ink-rgb), 0.72); }

/* Collapsed-form affordance: summary reads as a compact outline button.
   Desktop JS opens these on load; phones start collapsed. */
.quote-toggle { margin-top: 0.9rem; }
.quote-toggle > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 1.1rem;
  border: 2px solid var(--pacific);
  border-radius: var(--radius-pill);
  color: var(--pacific-deep);
  background: transparent;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
}
.quote-toggle > summary::-webkit-details-marker { display: none; }
.quote-toggle > summary::after {
  content: "+";
  flex: none;
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--pacific);
  transition: transform 0.2s ease;
}
.quote-toggle[open] > summary::after { transform: rotate(45deg); }
.quote-toggle > summary:hover { background: rgba(var(--pacific-rgb), 0.08); }
.cta-banner .quote-toggle { margin-top: 1.1rem; }
.cta-banner .quote-toggle > summary { border-color: #9CC4D4; color: #EAF2F6; }
.cta-banner .quote-toggle > summary::after { color: #9CC4D4; }
.cta-banner .quote-toggle > summary:hover { background: rgba(255, 255, 255, 0.1); }
.quote-toggle .inquiry-form { margin-top: 0.75rem; }
.quote-toggle .cta-banner-form { margin-top: 0.9rem; }

/* Function-page heroes: recolor every old dark-hero child for light bg */
.service-hero-inner, .legal-hero-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: clamp(1.7rem, 4.2vw, 2.8rem) var(--gutter) clamp(1.1rem, 2.8vw, 1.8rem);
}
.service-hero h1, .legal-hero h1 { margin: 0.4rem 0 0.6rem; }
.service-hero-inner p:not(.eyebrow), .legal-hero-inner p:not(.eyebrow) {
  margin: 0;
  max-width: 64ch;
  font-size: 1.08rem;
  color: rgba(var(--ink-rgb), 0.8);
}
.eyebrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--pacific-deep);
}
.service-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }

/* ============================================================
   9. Homepage sections
   ============================================================ */
.section-intro {
  max-width: 68ch;
  margin: 0 0 1.4rem;
  font-size: 1.02rem;
  color: rgba(var(--ink-rgb), 0.78);
}

/* Estimate calculator */
.estimate-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);  /* match .container's content inset */
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(1.2rem, 3vw, 2rem);
  align-items: start;
}
.estimate-copy h2 { margin-top: 0; }
.estimate-copy p { color: rgba(var(--ink-rgb), 0.8); max-width: 56ch; }
.estimate-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }
.estimate-form {
  background: var(--white);
  border: 1px solid rgba(var(--pacific-rgb), 0.14);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: clamp(1rem, 2.4vw, 1.5rem);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}
.estimate-field { display: grid; gap: 0.32rem; align-content: start; }
.estimate-addons { display: grid; gap: 0.4rem; margin-top: 0.2rem; }
.estimate-addon-label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(var(--ink-rgb), 0.85);
  cursor: pointer;
}
.estimate-addon-label input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.18rem;
  flex: none;
  accent-color: var(--pacific);
}
.estimate-result {
  grid-column: 1 / -1;
  background: var(--seafoam);
  border-radius: calc(var(--radius) - 0.3rem);
  padding: 0.9rem 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 0.9rem;
}
.estimate-mini { display: grid; gap: 0.15rem; }
.estimate-mini strong {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), 0.68);
}
.estimate-mini span {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.2vw, 1.65rem);
  font-weight: 600;
  color: var(--pacific-deep);
}
.estimate-note { grid-column: 1 / -1; margin: 0; font-size: 0.84rem; color: rgba(var(--ink-rgb), 0.72); }
.estimate-cta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.7rem; }
.estimate-cta a { flex: 1 1 200px; }

/* Feature / detail / trust / highlight grids */
.feature-grid, .detail-grid, .trust-grid, .highlight-list {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.trust-grid { margin-top: 1.05rem; }

/* Metrics band */
.metrics {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-top: 1.2rem;
}
.metric {
  background: var(--seafoam);
  border-radius: var(--radius);
  padding: 0.95rem 1.1rem;
  display: grid;
  gap: 0.2rem;
}
.metric strong {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.5vw, 1.9rem);
  font-weight: 600;
  line-height: 1.05;
  color: var(--pacific-deep);
}
.metric span { font-size: 0.88rem; color: rgba(var(--ink-rgb), 0.75); }

/* Homepage services grid (function pages override under .service-main) */
.service-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Areas — a normal band, washed by its .section-sand class (iteration 4:
   was foam, which merged with the adjacent #green foam band) */
.areas-inner {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin-top: 1.1rem;
}
.areas-list, .gallery-feature-list { margin: 0.5rem 0 0; padding-left: 1.15rem; }
.areas-list li + li, .gallery-feature-list li + li { margin-top: 0.3rem; }
.areas-list li::marker, .gallery-feature-list li::marker { color: var(--pacific); }
.areas-note { margin: 0.6rem 0 0; font-size: 0.9rem; color: rgba(var(--ink-rgb), 0.72); }

.mini-link-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 1.1rem;
}
.mini-link-card {
  display: grid;
  gap: 0.2rem;
  padding: 0.95rem 1.15rem;
  border-radius: 0.9rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.mini-link-card strong {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), 0.68);
}
.mini-link-card a { font-weight: 600; color: var(--pacific-deep); }
.mini-link-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(var(--pacific-rgb), 0.4);
}

/* Process — step numbers in normal flow, no overhang */
.process-steps {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.step { background: var(--sand); border-color: rgba(var(--ink-rgb), 0.08); box-shadow: none; }
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--pacific);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

/* Checklist */
.checklist-grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Gallery */
.gallery-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(1rem, 2.4vw, 1.6rem);
  align-items: center;
  background: var(--white);
  border: 1px solid rgba(var(--pacific-rgb), 0.14);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: clamp(0.85rem, 2vw, 1.3rem);
  margin-bottom: 0.9rem;
}
.gallery-feature img { width: 100%; border-radius: calc(var(--radius) - 0.35rem); }
.gallery-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
/* Large-cards row followed by the small-thumb row */
.gallery-grid + .gallery-grid { margin-top: 0.85rem; }
.gallery-card { margin: 0; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.gallery-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery-card figcaption { padding: 0.6rem 0.95rem 0.8rem; font-size: 0.88rem; color: rgba(var(--ink-rgb), 0.75); }

/* Testimonials */
.testimonials {
  display: grid;
  gap: 0.9rem;
  /* min(280px, 100%): at 320px CSS width (WCAG 1.4.10 reflow / 400% zoom)
     the container's content box is ~256px — a hard 280px floor forces
     page-wide horizontal scroll. */
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}
.testimonial { margin: 0; font-size: 0.98rem; color: rgba(var(--ink-rgb), 0.85); }
.testimonial::before {
  content: "\201C";
  display: block;
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 0.6;
  margin-bottom: 0.6rem;
  color: var(--pacific);  /* decorative ornament */
}
.testimonial cite {
  display: block;
  margin-top: 0.7rem;
  font-style: normal;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--pacific-deep);
}

/* FAQ — native details, restyled */
.faq { display: grid; gap: 0.6rem; max-width: 860px; }
.faq-item {
  background: var(--white);
  border: 1px solid rgba(var(--pacific-rgb), 0.14);
  border-radius: 0.9rem;
  box-shadow: var(--shadow-soft);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 44px;
  padding: 0.7rem 1.1rem;
  font-weight: 600;
  border-radius: 0.9rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  flex: none;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--pacific);
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item > p { margin: 0; padding: 0 1.1rem 0.9rem; color: rgba(var(--ink-rgb), 0.82); }

/* CTA banner — the one dark moment (with the footer) */
.cta-banner { position: relative; background: var(--ink); color: #EAF2F6; }
.cta-banner h2 { color: var(--white); }
.cta-banner-inner {
  max-width: min(880px, var(--container));
  margin-inline: auto;
  padding-inline: var(--gutter);  /* match .container's content inset */
  text-align: center;
}
.cta-banner-inner > p { max-width: 60ch; margin: 0 auto; color: rgba(234, 242, 246, 0.85); }
.cta-banner-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.05rem;
}
.cta-banner-form {
  margin-top: 1.3rem;
  padding: clamp(1rem, 2.4vw, 1.5rem);
  border-top: 0;
  background: var(--white);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  text-align: left;
}

/* Footer (homepage + legal pages + .service-footer) */
footer { background: var(--ink); color: rgba(234, 242, 246, 0.88); }
footer a { color: var(--white); font-weight: 600; }
footer h2, footer h3, footer h4 { color: var(--white); }
.footer-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);  /* match .container's content inset */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: clamp(1.1rem, 3vw, 1.9rem);
  padding-block: clamp(1.5rem, 3.75vw, 2.25rem) clamp(1.05rem, 2.25vw, 1.5rem);
}
.footer-inner p { margin: 0.2rem 0; font-size: 0.95rem; color: rgba(234, 242, 246, 0.82); }
.footer-heading {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9CC4D4;
  margin: 0 0 0.7rem;
}
footer .brand-mark { width: 2.25rem; height: 2.25rem; margin-bottom: 0.6rem; color: var(--seafoam); }
.footer-bottom {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);  /* match .container's content inset */
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding-block: 0.85rem 1.05rem;
  font-size: 0.85rem;
  color: rgba(234, 242, 246, 0.75);
}

/* ============================================================
   10. Function pages (.service-grid grid-areas, hub, legal)
   ============================================================ */
.service-main {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);  /* match .container's content inset */
  padding-block: clamp(1.3rem, 3.5vw, 2.2rem) clamp(1.8rem, 4.5vw, 3rem);
}
.service-main .service-grid {
  display: grid; gap: 1rem;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  grid-template-areas: "copy book" "copy rest";
  align-items: start;
}
.service-copy { grid-area: copy; min-width: 0; }
.service-book { grid-area: book; display: grid; gap: 1rem; align-content: start; }
.service-rest { grid-area: rest; display: grid; gap: 1rem; align-content: start; }
.service-book .service-sidebar-card { border-top: 4px solid var(--pacific); box-shadow: var(--shadow-lift); }

.service-card h2 { font-size: 1.25rem; margin: 1.2rem 0 0.5rem; }
.service-card h2:first-child { margin-top: 0; }
.service-sidebar-card h2 { font-size: 1.08rem; margin: 0 0 0.5rem; }
.service-sidebar-card p { margin: 0 0 0.4rem; font-size: 0.95rem; color: rgba(var(--ink-rgb), 0.82); }
.service-points, .service-checklist, .service-links, .hub-links {
  margin: 0.5rem 0 0;
  padding-left: 1.15rem;
}
.service-points li + li, .service-checklist li + li,
.service-links li + li, .hub-links li + li { margin-top: 0.3rem; }
.service-points li::marker, .service-checklist li::marker,
.service-links li::marker, .hub-links li::marker { color: var(--pacific); }
.service-links a, .hub-links a { font-weight: 600; }
.service-cta-stack { display: grid; gap: 0.65rem; margin-top: 0.85rem; }

/* Hub page */
.hub-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.hub-card {
  display: grid;
  gap: 0.5rem;
  align-content: start;
  padding: clamp(0.9rem, 2.2vw, 1.4rem);
}
.hub-card h2 { font-size: 1.1rem; margin: 0; }
.hub-card p { margin: 0; font-size: 0.94rem; color: rgba(var(--ink-rgb), 0.8); }
.hub-city-suffix { color: rgba(var(--ink-rgb), 0.72); }
.hub-section-gap { margin-bottom: 1rem; }
.hub-cta-gap { margin-top: 1rem; }

/* Legal pages (function-rendered + static) */
.legal-card {
  width: min(860px, calc(100% - 2rem));
  margin: clamp(1.2rem, 3vw, 1.9rem) auto clamp(1.8rem, 4.5vw, 2.7rem);
  padding: clamp(1.1rem, 3vw, 1.8rem);
}
.legal-card h2 { font-size: 1.2rem; margin: 1.2rem 0 0.45rem; }
.legal-card ul { margin: 0.5rem 0 0.9rem; padding-left: 1.15rem; }
.legal-card li + li { margin-top: 0.3rem; }
.legal-card li::marker { color: var(--pacific); }
.effective { margin: 0 0 0.9rem; font-size: 0.92rem; font-weight: 600; color: rgba(var(--ink-rgb), 0.72); }
.sms-box {
  background: rgba(var(--pacific-rgb), 0.06);
  border: 1px solid rgba(var(--pacific-rgb), 0.22);
  border-radius: 0.9rem;
  padding: 1.05rem 1.2rem;
  margin-top: 0.7rem;
}
.sms-box p { margin: 0.45rem 0; font-size: 0.95rem; }
.cross-link { margin: 1.6rem 0 0; font-weight: 600; }
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 1.05rem;
  border: 1.5px solid rgba(var(--pacific-rgb), 0.35);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--pacific-deep);
  font-weight: 600;
  font-size: 0.92rem;
}
.back-link:hover, .back-link:focus-visible { background: var(--seafoam); text-decoration: none; }

/* Function-page footer (.footer-slim: same slim two-span treatment for the
   legal pages, whose footers don't need the homepage's 4-column grid) */
.service-footer { background: var(--ink); }
.service-footer-inner,
.footer-slim {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);  /* match .container's content inset */
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.2rem;
  padding-block: 1.2rem;
  font-size: 0.92rem;
}

/* ============================================================
   11. Tablet / mobile
   ============================================================ */
@media (max-width: 920px) {
  /* Room for the sticky CTA bar — scoped so only pages that actually have
     the bar (the homepage) reserve space; function/legal pages don't get a
     blank band under their ink footers. */
  /* Bar is ~64px tall (44px button + 2×0.6rem padding + border): 5rem clears it. */
  body:has(.sticky-cta) { padding-bottom: 5rem; }
  /* Engines without :has() can't scope the clearance — reserve it on every
     page instead (small dead space under function-page footers is fine). */
  @supports not (selector(:has(*))) {
    body { padding-bottom: 5rem; }
  }

  /* Brand and hamburger share one row — the old labeled pill used to wrap
     onto a second row and double the header height. */
  .topbar { flex-wrap: nowrap; }
  .brand { white-space: nowrap; }
  .nav-toggle { display: inline-flex; }
  #primary-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 40;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    background: var(--white);
    border-bottom: 1px solid rgba(var(--pacific-rgb), 0.16);
    box-shadow: var(--shadow-lift);
    padding: 0.4rem var(--gutter) 0.9rem;
    /* Keep every link reachable: cap the sheet at the space below the sticky
       header (100% = header height) minus the sticky CTA bar's 5rem, and
       scroll inside the sheet (short landscape viewports trap links otherwise). */
    max-height: calc(100vh - 100% - 5rem);
    max-height: calc(100dvh - 100% - 5rem);
    overflow-y: auto;
  }
  #primary-nav.is-open { display: flex; }
  .nav-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 0.5rem;
  }
  .nav-group-label {
    display: block;
    grid-column: 1 / -1;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(var(--ink-rgb), 0.55);
  }
  #primary-nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.35rem 0.6rem;
    font-size: 0.95rem;
    border-radius: 0.5rem;
  }
  #primary-nav a:hover, #primary-nav a:focus-visible {
    background: rgba(var(--pacific-rgb), 0.08);
  }
  #primary-nav .nav-cta {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    margin: 0.7rem 0 0;
  }

  .sticky-cta { display: flex; }

  /* Two-panel hero: copy on the left, art + CTAs on the right, contact card
     full-width below — the first screen reads as one dense panel. */
  .hero-inner {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    grid-template-rows: auto auto;
    grid-template-areas: "text side" "contact contact";
    gap: 0.75rem;
    padding-top: clamp(1.25rem, 3.5vw, 1.8rem);
  }
  .hero-side { display: flex; flex-direction: column; gap: 0.6rem; }
  .hero-art { order: -1; width: min(100%, 150px); margin: 0 auto; }
  .hero-ctas { flex-direction: column; gap: 0.5rem; }
  .hero-ctas > .btn { width: 100%; font-size: 0.95rem; padding-inline: 0.6rem; }
  .hero-text h1 { margin-top: 0.2rem; }
  .hero-text > p { font-size: 0.95rem; }
  .hero-badges { gap: 0.4rem; margin-top: 0.6rem; }
  .hero-contact { padding: 0.9rem; }
  .hero-contact h2 { font-size: 1.15rem; }
  .hero-contact > p { font-size: 0.875rem; margin-bottom: 0.55rem; }
  .contact-item {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.15rem 0.45rem;
    margin-bottom: 0.35rem;
  }
  .hero-contact-ctas { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .hero-contact .cta-primary, .hero-contact .cta-secondary { font-size: 0.92rem; padding-inline: 0.6rem; }
  .estimate-inner { grid-template-columns: 1fr; }
  .gallery-feature { grid-template-columns: 1fr; }

  /* Sidebar-first on mobile: booking card above the long copy */
  .service-main .service-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "book" "copy" "rest";
  }
}

/* ============================================================
   12. Phone refinements
   ============================================================ */
@media (max-width: 640px) {
  :root { --section-gap: 1.5rem; }
  body { font-size: 0.95rem; line-height: 1.5; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  .section-intro { margin-bottom: 0.75rem; font-size: 0.92rem; }
  .wave { height: 14px; }

  .announcement-bar { font-size: 0.7rem; padding: 0.2rem 0; }
  .announcement-group > span,
  .announcement-inner > span:first-child { display: none; }

  .topbar { padding-block: 0.45rem; }
  /* Fluid: the nowrap brand + 44px hamburger must fit a 320px viewport. */
  .brand { font-size: clamp(0.98rem, 4.8vw, 1.15rem); }
  .fn-nav { gap: 0.25rem 0.9rem; }

  .hero-inner { padding-block: 1.25rem 0.9rem; }

  .inquiry-grid { grid-template-columns: 1fr; }

  /* 2-up phone grids — only the short, glanceable tiles; the text-heavy
     card sets are swipe rails now (see .rail at the end of this block). */
  .mini-link-grid, .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }
  .hero-badges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; }
  .badge { padding: 0.28rem 0.5rem; font-size: 0.7rem; justify-content: center; text-align: center; }
  .feature-card, .detail-card, .trust-card, .service-card, .checklist-card,
  .mini-link-card, .highlight, .step, .hub-card, .metric { padding: 0.75rem; }
  .feature-card, .detail-card, .trust-card, .service-card, .checklist-card,
  .mini-link-card, .highlight, .step, .hub-card { overflow-wrap: anywhere; }
  .feature-card p, .detail-card p, .trust-card p, .highlight p, .step p,
  .hub-card p, .card-body p { font-size: 0.875rem; }
  .feature-card h3, .detail-card h3, .trust-card h3, .highlight h3, .step h3,
  .service-card h3, .checklist-card h3 { font-size: 0.95rem; }
  .hub-card h2 { font-size: 0.95rem; }
  .card-body ul, .hub-links, .areas-list, .gallery-feature-list { font-size: 0.85rem; padding-left: 1rem; }
  .card-body li + li, .hub-links li + li { margin-top: 0.2rem; }
  .mini-link-card { padding: 0.6rem 0.7rem; }
  .mini-link-card a { font-size: 0.875rem; }
  .service-card-link { margin-top: 0.6rem; font-size: 0.875rem; }
  .step-number { width: 1.8rem; height: 1.8rem; font-size: 0.95rem; margin-bottom: 0.4rem; }
  .metric strong { font-size: 1.35rem; }
  .metric span { font-size: 0.8rem; }
  .icon { width: 1.6rem; height: 1.6rem; }

  /* Density: full-bleed gallery thumbs waste a phone screen — go 2-up. */
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-card figcaption { font-size: 0.8rem; padding: 0.45rem 0.6rem 0.6rem; }

  .hero-ctas > .btn { flex: 1 1 100%; }
  .btn, .cta-primary, .cta-secondary, .service-button { padding: 0.55rem 1.25rem; }
  .btn-small { padding: 0.45rem 1rem; }

  /* Estimate form: pair the short-label fields, keep the result tight. */
  .estimate-form { padding: 0.85rem; gap: 0.6rem 0.7rem; }
  .estimate-form > .estimate-field-full { grid-column: 1 / -1; }
  .estimate-addons { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
  .estimate-addon-label { font-size: 0.85rem; }
  .estimate-result { padding: 0.7rem 0.8rem; gap: 0.5rem 0.7rem; }
  .estimate-mini span { font-size: 1.25rem; }
  .estimate-cta a { flex: 1 1 calc(50% - 0.35rem); }

  .sticky-cta { gap: 0.5rem; padding: 0.45rem 0.9rem calc(0.45rem + env(safe-area-inset-bottom, 0px)); }
  /* Bar is ~59px on phones (44px button + 2×0.45rem padding + border). */
  body:has(.sticky-cta) { padding-bottom: 3.9rem; }

  .service-hero-inner, .legal-hero-inner { padding: 1.1rem var(--gutter) 0.8rem; }
  .service-hero-inner p:not(.eyebrow), .legal-hero-inner p:not(.eyebrow) { font-size: 0.95rem; }
  .service-main { padding-block: 1rem 1.5rem; }
  .service-sidebar-card { padding: 0.8rem; }

  .footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    padding-block: 1.2rem 0.9rem;
  }
  .footer-inner p { font-size: 0.85rem; overflow-wrap: anywhere; }
  .footer-bottom { flex-direction: column; align-items: flex-start; padding-block: 0.7rem 0.85rem; font-size: 0.8rem; }

  /* Swipe rails: text-heavy card sets scroll sideways, one readable card at
     a time with the next card peeking past the screen edge. The negative
     inline margins bleed the rail through the container gutter so cards run
     to the viewport edge; the bottom padding keeps card drop shadows inside
     the scroll clip, and the negative bottom margin gives that space back to
     the section rhythm. */
  .rail {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(76vw, 330px);
    gap: 0.7rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(-1 * var(--gutter));
    margin-bottom: -1.1rem;
    padding: 0.25rem var(--gutter) 1.6rem;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .rail::-webkit-scrollbar { display: none; }
  .rail > * { scroll-snap-align: start; padding: 1rem; }
  /* Restore comfortable reading sizes inside rail cards (the 2-up shrink
     rules above hit the same selectors and lose these later ties). */
  .rail h2, .rail h3 { font-size: 1.05rem; }
  .rail p { font-size: 0.92rem; }
  .rail .card-body ul, .rail .hub-links { font-size: 0.9rem; padding-left: 1.1rem; }
  .rail .step-number { width: 2.1rem; height: 2.1rem; font-size: 1.05rem; margin-bottom: 0.5rem; }
}

/* Not a breakpoint: motion preference */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .cta-primary, .cta-secondary, .service-button, .mini-link-card,
  .sticky-cta, .faq-item summary::after, .quote-toggle > summary::after,
  .nav-toggle-icon::before, .nav-toggle-icon::after { transition: none; }
}
