/* ==========================================================================
   Aloha Pool Leak Detection — design system
   Palette extracted EXACTLY from the original logo artwork
   (_source/Untitled_Artwork-1-1.png, pixel histogram — do not approximate):
     ink            #000000   (ALOHA letterforms)
     gray           #545454   (pool coping / letter bevels)
     pool cyan      #01cfff   (pool water primary fill)
     aqua light     #22f0fd   (water highlights)
     hibiscus pink  #ff2973   (plumeria petals / sunset)
     deep pink      #f90a5f   (petal shading)
     sun yellow     #fde61c   (flower center / sun)
     sunset magenta #d600dc   (sunset sky inside the "A")
   Derived-for-contrast shades are labeled DERIVED below — they exist only to
   meet WCAG AA where the raw brand hues are too light for text on white.
   ========================================================================== */

:root {
  /* Brand tokens (exact) */
  --brand-primary: #01cfff;
  --brand-primary-light: #22f0fd;
  --brand-secondary: #ff2973;
  --brand-secondary-deep: #f90a5f;
  --brand-accent: #fde61c;
  --brand-magenta: #d600dc;
  --ink: #000000;
  --gray: #545454;
  --surface: #ffffff;

  /* DERIVED (same hue family, darkened for AA text contrast on white) */
  --cyan-ink: #007b99;      /* derived from #01cfff, hue 191° */
  --pink-ink: #d1004b;      /* derived from #f90a5f */

  /* Neutrals */
  --surface-alt: #f4fbfd;   /* faint pool-water tint for alternating bands */
  --line: #e6eef1;
  --text: #1a1a1a;
  --text-soft: var(--gray);

  /* Signature sunset gradient (all exact brand hues) */
  --sunset: linear-gradient(90deg, #01cfff 0%, #d600dc 38%, #ff2973 66%, #fde61c 100%);

  /* Type scale — fluid, one scale everywhere */
  --font: system-ui, -apple-system, "Segoe UI Variable Display", "Segoe UI",
          Roboto, Helvetica, Arial, sans-serif;
  --fs-900: clamp(2.1rem, 4.6vw + 1rem, 3.4rem);
  --fs-800: clamp(1.7rem, 2.8vw + .85rem, 2.4rem);
  --fs-700: clamp(1.35rem, 1.6vw + .8rem, 1.75rem);
  --fs-600: 1.25rem;
  --fs-500: 1.125rem;
  --fs-400: 1rem;
  --fs-300: .875rem;

  /* 8pt spacing grid */
  --sp-1: .5rem;  --sp-2: 1rem;  --sp-3: 1.5rem; --sp-4: 2rem;
  --sp-5: 3rem;   --sp-6: 4rem;  --sp-7: 5rem;   --sp-8: 6rem;

  /* Radii + elevation */
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-pill: 999px;
  --shadow-1: 0 1px 3px rgba(0,20,30,.08), 0 1px 2px rgba(0,20,30,.05);
  --shadow-2: 0 6px 20px rgba(0,20,30,.10), 0 2px 6px rgba(0,20,30,.06);
  --shadow-3: 0 18px 48px rgba(0,20,30,.16), 0 6px 16px rgba(0,20,30,.08);

  /* Motion language — one curve, two durations */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --dur-micro: 200ms;
  --dur-enter: 550ms;

  --header-h: 72px;
  --callbar-h: 64px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-400);
  line-height: 1.6;
  color: var(--text);
  background: var(--surface);
}
img, picture, video, iframe { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.15; color: var(--ink); margin: 0 0 var(--sp-2); letter-spacing: -.02em; }
h1 { font-size: var(--fs-900); font-weight: 800; }
h2 { font-size: var(--fs-800); font-weight: 800; }
h3 { font-size: var(--fs-600); font-weight: 700; }
p { margin: 0 0 var(--sp-2); }
a { color: var(--cyan-ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible {
  outline: 3px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: 4px;
}
::selection { background: var(--brand-primary); color: var(--ink); }

.container { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.section { padding-block: clamp(var(--sp-5), 7vw, var(--sp-8)); }
.section--alt { background: var(--surface-alt); }
.section--ink { background: var(--ink); color: #fff; }
.section--ink h2, .section--ink h3 { color: #fff; }

/* Eyebrow label above section headings */
.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: var(--fs-300); font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gray); margin-bottom: var(--sp-2);
}
.eyebrow::before {
  content: ""; width: 34px; height: 4px; border-radius: 2px;
  background: var(--sunset);
}
.section--ink .eyebrow { color: #b9b9b9; }

.lede { font-size: var(--fs-500); color: var(--text-soft); max-width: 62ch; }
.center { text-align: center; }
.center .lede { margin-inline: auto; }
.center .eyebrow { justify-content: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font: inherit; font-weight: 700; font-size: 1.17rem; /* ≥18.66px bold = WCAG "large" */
  padding: .8em 1.5em; border-radius: var(--r-pill);
  border: 2px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform var(--dur-micro) var(--ease),
              box-shadow var(--dur-micro) var(--ease),
              background-color var(--dur-micro) var(--ease),
              color var(--dur-micro) var(--ease);
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: var(--shadow-1); }

.btn--call { background: var(--ink); color: #fff; }
.btn--call:hover { background: #1c1c1c; color: #fff; }
.btn--call svg { color: var(--brand-primary); }

.btn--quote { background: var(--brand-secondary-deep); color: #fff; }
.btn--quote:hover { background: var(--pink-ink); color: #fff; }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.section--ink .btn--ghost { color: #fff; border-color: #fff; }
.section--ink .btn--ghost:hover { background: #fff; color: var(--ink); }

.btn--sm { font-size: 1rem; padding: .55em 1.1em; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: box-shadow var(--dur-micro) var(--ease),
              border-color var(--dur-micro) var(--ease);
}
.site-header.is-scrolled { box-shadow: var(--shadow-1); border-color: var(--line); }
.header-topline {
  background: var(--ink); color: #fff;
  font-size: var(--fs-300); text-align: center; padding: .35rem 1rem;
}
.header-topline a { color: var(--brand-primary); font-weight: 700; text-decoration: none; }
.header-topline .pin { color: var(--brand-accent); }
.header-bar {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: var(--header-h);
  transition: min-height var(--dur-micro) var(--ease);
}
.is-scrolled .header-bar { min-height: 60px; }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img { width: clamp(132px, 16vw, 168px); height: auto; }

.nav { display: flex; align-items: center; gap: var(--sp-3); margin-left: auto; }
.nav a.nav-link {
  position: relative; color: var(--ink); text-decoration: none;
  font-weight: 600; font-size: var(--fs-300); padding: .3rem 0;
}
.nav a.nav-link::after {
  content: ""; position: absolute; inset-inline: 0; bottom: -2px; height: 3px;
  border-radius: 2px; background: var(--sunset);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-micro) var(--ease);
}
.nav a.nav-link:hover::after, .nav a.nav-link[aria-current="page"]::after { transform: scaleX(1); }

.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 0; padding: .5rem; cursor: pointer;
}
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after {
  content: ""; display: block; width: 26px; height: 3px; border-radius: 2px;
  background: var(--ink); position: relative;
  transition: transform var(--dur-micro) var(--ease), opacity var(--dur-micro) var(--ease);
}
.nav-toggle .bars::before { position: absolute; top: -8px; }
.nav-toggle .bars::after { position: absolute; top: 8px; }
.nav-toggle[aria-expanded="true"] .bars { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::before { transform: rotate(90deg); top: 0; }
.nav-toggle[aria-expanded="true"] .bars::after { opacity: 0; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-2); padding: var(--sp-2);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a.nav-link { padding: .85rem .5rem; font-size: var(--fs-500); border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: var(--sp-2); }
  .nav .header-phone { display: none; } /* phone lives in the sticky call bar on mobile */
}

/* ---------- Hero ---------- */
.hero { overflow: hidden; }
.hero-grid {
  display: grid; gap: var(--sp-5); align-items: center;
  grid-template-columns: 1.05fr .95fr;
  padding-block: clamp(var(--sp-4), 5vw, var(--sp-7));
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: var(--sp-4); } }
.hero h1 { margin-bottom: var(--sp-2); }
.hero h1 .accent {
  background: var(--sunset);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero .lede { margin-bottom: var(--sp-3); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.hero-media { position: relative; }
.hero-media img {
  width: 100%; height: auto; border-radius: var(--r-lg); box-shadow: var(--shadow-3);
}
.hero-media::after {
  content: ""; position: absolute; inset: auto -8% -10% 55%;
  height: 10px; border-radius: 6px; background: var(--sunset);
  filter: blur(1px); opacity: .85;
}

/* Trust chips (hero) + trust bar */
.trust-chips { display: flex; flex-wrap: wrap; gap: .5rem .75rem; list-style: none; padding: 0; margin: 0 0 var(--sp-3); }
.trust-chips li {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: var(--fs-300); font-weight: 600; color: var(--ink);
  background: var(--surface-alt); border: 1px solid var(--line);
  padding: .35rem .8rem; border-radius: var(--r-pill);
}
.trust-chips .star { color: var(--brand-secondary-deep); }

.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3);
  text-align: center;
}
@media (max-width: 700px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat b {
  display: block; font-size: var(--fs-800); font-weight: 800; color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
/* NOTE: direct-child selector on purpose — the big number inside <b> also
   contains spans (count-up targets, the ★ and / accents) that must keep the
   large size. Only the label span below the number is small. */
.stat > span { font-size: var(--fs-300); color: var(--text-soft); font-weight: 600; }
.section--ink .stat b { color: #fff; }
.section--ink .stat b .u { color: var(--brand-primary); }
.section--ink .stat > span { color: #b9b9b9; }

/* ---------- Cards / grids ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-1);
  transition: transform var(--dur-micro) var(--ease), box-shadow var(--dur-micro) var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.card-body { padding: var(--sp-3); }
.card > picture img, .card > img { border-radius: var(--r-md) var(--r-md) 0 0; width: 100%; height: 230px; object-fit: cover; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); align-items: center; }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .grid-4 { grid-template-columns: 1fr; } }

/* Numbered process steps */
.step { position: relative; }
.step .step-num {
  position: absolute; top: -18px; left: var(--sp-3);
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: #fff; font-weight: 800; font-size: 1.15rem;
  box-shadow: 0 0 0 4px var(--surface), var(--shadow-1);
}
.step .card-body { padding-top: var(--sp-4); }

/* ---------- Reviews ---------- */
.reviews-headline {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .9rem;
  justify-content: center; margin-bottom: var(--sp-4);
}
.reviews-headline .score { font-size: var(--fs-800); font-weight: 800; color: var(--ink); }
.reviews-headline .stars { color: var(--brand-secondary-deep); font-size: var(--fs-600); letter-spacing: .1em; }
.review-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
@media (max-width: 900px) { .review-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .review-grid { grid-template-columns: 1fr; } }
.review-card { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-3); }
.review-card .stars { color: var(--brand-secondary-deep); letter-spacing: .12em; font-size: var(--fs-300); }
.review-card blockquote { margin: 0; font-size: var(--fs-400); color: var(--text); }
.review-card footer {
  display: flex; align-items: center; gap: .6rem; margin-top: auto;
  font-weight: 700; font-size: var(--fs-300); color: var(--ink);
}
.review-card footer img { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 1px solid var(--line); }
.review-card .src { font-weight: 500; color: var(--text-soft); }
.google-attrib { text-align: center; font-size: var(--fs-300); color: var(--text-soft); margin-top: var(--sp-3); }

/* ---------- Checklist / differentiators ----------
   NOTE: li must NOT be a flex/grid container — its mixed text + <em>/<strong>
   children would become separate anonymous flex items and reorder on wrap.
   The tick is absolutely positioned instead. */
.tick-list { list-style: none; padding: 0; margin: 0 0 var(--sp-3); display: grid; gap: var(--sp-2); }
.tick-list li { position: relative; padding-left: 2.5rem; font-size: var(--fs-500); }
.tick-list .tick {
  position: absolute; left: 0; top: .15em;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-primary); color: var(--ink); font-weight: 800; font-size: .85rem;
}

/* Cropping helper: show the bottom of a tall image inside fixed-height card
   media (e.g. the hydrophone shot, whose sensor sits at the bottom) */
.crop-bottom { object-position: center 88% !important; }

/* Portrait photos in side-by-side layouts: crop instead of towering */
.portrait-crop {
  width: 100%; height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover; object-position: 50% 12%;
  border-radius: var(--r-lg); box-shadow: var(--shadow-2);
}

/* ---------- FAQ ---------- */
.faq { max-width: 780px; margin-inline: auto; }
.faq details {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); margin-bottom: var(--sp-1);
  transition: box-shadow var(--dur-micro) var(--ease);
}
.faq details[open] { box-shadow: var(--shadow-1); }
.faq summary {
  cursor: pointer; font-weight: 700; font-size: var(--fs-500);
  padding: var(--sp-2) var(--sp-3); list-style: none; position: relative;
  color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: var(--sp-3); top: 50%;
  transform: translateY(-50%); font-size: 1.4rem; font-weight: 600; color: var(--cyan-ink);
  transition: transform var(--dur-micro) var(--ease);
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq .faq-a { padding: 0 var(--sp-3) var(--sp-3); color: var(--text-soft); }

/* ---------- Forms ---------- */
.quote-form { display: grid; gap: var(--sp-2); }
.quote-form label { font-weight: 700; font-size: var(--fs-300); color: var(--ink); }
.quote-form input, .quote-form textarea {
  font: inherit; width: 100%; padding: .75rem 1rem;
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  transition: border-color var(--dur-micro) var(--ease);
}
.quote-form input:focus, .quote-form textarea:focus { border-color: var(--brand-primary); outline: none; }
.form-note { font-size: var(--fs-300); color: var(--text-soft); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #d5d5d5; font-size: var(--fs-300); }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--brand-primary); }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: var(--sp-4);
  padding-block: var(--sp-6) var(--sp-4);
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { color: #fff; font-size: var(--fs-400); margin-bottom: var(--sp-2); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.footer-brand img { width: 150px; margin-bottom: var(--sp-2); background: #fff; border-radius: var(--r-sm); padding: .5rem; }
.footer-towns { columns: 2; column-gap: var(--sp-3); }
.footer-legal {
  border-top: 1px solid #2a2a2a; padding-block: var(--sp-3);
  display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: space-between;
  color: #8a8a8a;
}
.footer-rule { height: 5px; background: var(--sunset); }

/* ---------- Sticky mobile call bar ---------- */
.callbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 70;
  display: none; grid-template-columns: 1.4fr 1fr; gap: 2px;
  background: var(--ink);
  padding-bottom: env(safe-area-inset-bottom);
}
.callbar a {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: var(--callbar-h);
  font-weight: 800; font-size: 1.05rem; text-decoration: none;
}
.callbar .cb-call { background: var(--ink); color: #fff; }
.callbar .cb-call svg { color: var(--brand-primary); }
.callbar .cb-quote { background: var(--brand-secondary-deep); color: #fff; }
@media (max-width: 900px) {
  .callbar { display: grid; }
  body { padding-bottom: calc(var(--callbar-h) + env(safe-area-inset-bottom)); }
}

/* ---------- Video embed (16:9, zero CLS) ---------- */
.video-frame {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-2);
  background: var(--ink);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Motion: scroll reveals (progressive enhancement) ----------
   Content is default-visible. Only when JS is present (html.js) do elements
   start hidden — so no-JS users, crawlers, and AI bots always see everything. */
html.js .reveal { opacity: 0; transform: translateY(16px); }
html.js .reveal.in {
  opacity: 1; transform: none;
  transition: opacity var(--dur-enter) var(--ease), transform var(--dur-enter) var(--ease);
}
html.js .reveal-stagger > * { opacity: 0; transform: translateY(16px); }
html.js .reveal-stagger.in > * {
  opacity: 1; transform: none;
  transition: opacity var(--dur-enter) var(--ease), transform var(--dur-enter) var(--ease);
}
html.js .reveal-stagger.in > :nth-child(2) { transition-delay: 90ms; }
html.js .reveal-stagger.in > :nth-child(3) { transition-delay: 180ms; }
html.js .reveal-stagger.in > :nth-child(4) { transition-delay: 270ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal, html.js .reveal-stagger > * { opacity: 1 !important; transform: none !important; transition: none !important; }
  .btn, .card, .nav a.nav-link::after { transition: none !important; }
  .btn:hover, .card:hover { transform: none; }
}

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.text-soft { color: var(--text-soft); }
