/* ============================================================
   Carolina Water Systems — Marketing site
   Ported from the brand UI kit (ui_kits/marketing) to static CSS.
   ============================================================ */

.wrap { max-width: var(--container-max); margin: 0 auto; padding: 0 32px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px;
  font-family: var(--font-sans); font-size: 15px; font-weight: 600;
  letter-spacing: -0.005em; line-height: 1;
  border-radius: var(--radius-md); border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out),
              filter var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn:active { transform: scale(0.97); }
.btn-lg { height: 54px; padding: 0 28px; font-size: 17px; gap: 10px; }
.btn-primary { background: var(--brand-primary); color: var(--text-on-brand); box-shadow: var(--shadow-brand); }
.btn-secondary { background: var(--surface-card); color: var(--text-strong); border-color: var(--border-default); box-shadow: var(--shadow-xs); }
.btn-ghost { background: transparent; color: var(--brand-primary); }
.btn-deep { background: var(--brand-deep); color: var(--text-on-brand); box-shadow: var(--shadow-md); }
.btn .icon { width: 18px; height: 18px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface-page) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}
.site-header .wrap { height: 72px; display: flex; align-items: center; gap: 32px; }
.site-header .logo { height: 38px; display: block; }
.site-nav { display: flex; gap: 26px; margin-left: 8px; flex: 1; justify-content: flex-end; align-items: center; }
.site-nav a { font-size: 14.5px; font-weight: 500; color: var(--text-body); }
.site-nav a:hover { color: var(--brand-primary); text-decoration: none; }
.site-nav .btn { margin-left: 4px; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text-strong); padding: 8px; margin-left: auto; }

/* ---------- Hero ---------- */
.hero { background: var(--surface-page); overflow: hidden; }
.hero .wrap {
  padding: 72px 32px 88px;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center;
}
.hero h1 { font-size: 60px; line-height: 1.02; letter-spacing: -0.025em; font-weight: 800; color: var(--text-strong); }
.hero p.lede { font-size: 19px; line-height: 1.5; color: var(--text-body); margin-top: 22px; max-width: 480px; }
.hero .actions { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.hero-visual { position: relative; min-height: 480px; overflow: hidden; }
.hero-visual canvas { display: block; }
.hero-glow {
  position: absolute; inset: 8% 12%; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(88,176,214,0.22), transparent 68%);
  filter: blur(8px);
}

/* ---------- Generic section ---------- */
.section { }
.section .wrap { padding: 88px 32px; }
.section-tint { background: var(--surface-tint); }
.section-sunken { background: var(--surface-sunken); }
.section-deep { background: var(--surface-deep); }
.eyebrow { margin-bottom: 14px; }
.title { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-strong); max-width: 620px; }
.title.light { color: #fff; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.card.interactive:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 44px; }
.service-icon {
  width: 50px; height: 50px; border-radius: 14px; background: var(--surface-tint);
  display: flex; align-items: center; justify-content: center; color: var(--brand-primary); margin-bottom: 18px;
}
.service-icon .icon { width: 26px; height: 26px; }
.card h3 { font-size: 18.5px; font-weight: 700; color: var(--text-strong); margin-bottom: 9px; }
.card p { font-size: 14.5px; line-height: 1.5; color: var(--text-muted); }

/* ---------- How it works — water diagnostics ---------- */
.wd-intro { font-size: 16.5px; line-height: 1.55; color: var(--text-body); margin-top: 16px; }
.wd-block { display: grid; gap: 40px; align-items: center; margin-top: 52px; }
#wd-test { grid-template-columns: 1fr 0.92fr; }
#wd-ro { grid-template-columns: 1.25fr 1fr; }
.wd-divider { height: 1px; background: var(--border-subtle); margin: 52px 0; }
.wd-step-eyebrow { font-size: var(--text-xs); font-weight: 700; letter-spacing: var(--ls-caps); text-transform: uppercase; color: var(--brand-accent); margin-bottom: 6px; }
.wd-step-eyebrow.aqua { color: var(--aqua-400); }
.wd-block h3 { font-size: 27px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-strong); margin-bottom: 6px; }
.wd-lede { font-size: 15px; line-height: 1.5; color: var(--text-muted); margin-bottom: 20px; max-width: 400px; }

/* magnifier lens */
.wd-lens-wrap { position: relative; aspect-ratio: 1 / 1; max-width: 460px; width: 100%; margin: 0 auto; }
.wd-sample { position: absolute; top: -6px; left: -10px; width: 92px; height: 124px; border-radius: 12px; z-index: 3; overflow: hidden;
  background: repeating-linear-gradient(135deg, rgba(120,180,210,0.07) 0 12px, rgba(120,180,210,0.015) 12px 26px), var(--surface-sunken);
  box-shadow: inset 0 0 0 1px var(--border-default), var(--shadow-lg); }
.wd-sample .ring { position: absolute; top: 38%; left: 50%; transform: translate(-50%,-50%); width: 30px; height: 30px; border-radius: 50%; border: 2px dashed var(--blue-400); opacity: 0.9; }
.wd-photoslot-label { position: absolute; left: 14px; bottom: 12px; z-index: 6; display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em; color: var(--text-subtle);
  background: rgba(4,16,26,0.55); padding: 5px 9px; border-radius: 7px; }
.wd-photoslot-label .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue-400); }
.wd-connect { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: visible; }
.wd-lens { position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  background: radial-gradient(120% 120% at 35% 25%, #16455F 0%, #0C2C3E 45%, #061A28 100%);
  box-shadow: 0 0 0 7px rgba(166,210,230,0.16), 0 0 0 8px rgba(120,180,210,0.35), inset 0 12px 40px rgba(0,0,0,0.55), 0 30px 60px -20px rgba(4,16,26,0.9); }
.wd-gloss { position: absolute; top: 6%; left: 12%; width: 55%; height: 32%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 30% 30%, rgba(233,243,248,0.22), transparent 70%); }
.wd-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle, transparent 60%, rgba(4,16,26,0.35) 100%); }
.wd-speck { position: absolute; border-radius: 50%; background: rgba(166,210,230,0.4); }
.wd-particle { position: absolute; border-radius: 50%; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-family: var(--font-mono); border: 1.5px solid rgba(255,255,255,0.65);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4); transition: box-shadow .2s, transform .2s; z-index: 4; }
.wd-particle.on { border-color: #fff; transform: scale(1.12); z-index: 5; }
.wd-particle[data-sev="warn"]   { background: radial-gradient(circle at 35% 30%, #E0922F, rgba(224,146,47,0.8) 60%, rgba(224,146,47,0.4)); }
.wd-particle[data-sev="danger"] { background: radial-gradient(circle at 35% 30%, #D14545, rgba(209,69,69,0.8) 60%, rgba(209,69,69,0.4)); }

/* readout list */
.wd-list { display: flex; flex-direction: column; gap: 8px; }
.wd-row { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--border-subtle); transition: background .18s, box-shadow .18s; }
.wd-row .num { flex: none; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-family: var(--font-mono); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.wd-row .meta { flex: 1; min-width: 0; }
.wd-row .nm { font-size: 15px; font-weight: 700; color: var(--text-strong); }
.wd-row .nt { font-size: 12.5px; color: var(--text-muted); }
.wd-row .rd { flex: none; font-family: var(--font-mono); font-size: 14px; font-weight: 600; }
.wd-row.on { background: var(--surface-card); }
.wd-row[data-sev="warn"]   .num { background: #E0922F; }
.wd-row[data-sev="warn"]   .rd  { color: #E0922F; }
.wd-row[data-sev="warn"].on   { box-shadow: inset 0 0 0 1px rgba(224,146,47,0.4); }
.wd-row[data-sev="danger"] .num { background: #D14545; }
.wd-row[data-sev="danger"] .rd  { color: #D14545; }
.wd-row[data-sev="danger"].on { box-shadow: inset 0 0 0 1px rgba(209,69,69,0.4); }

/* RO stage list */
.wd-ro-list { order: 1; }
.wd-stages { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wd-stage { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--border-subtle); transition: background .18s, box-shadow .18s; }
.wd-stage .num { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-tint); color: var(--brand-accent);
  font-family: var(--font-mono); font-weight: 700; font-size: 12.5px; display: flex; align-items: center; justify-content: center; transition: background .18s, color .18s; }
.wd-stage .nm { font-size: 13.5px; font-weight: 700; color: var(--text-strong); line-height: 1.2; }
.wd-stage .rm { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.wd-stage.on { background: var(--surface-card); box-shadow: inset 0 0 0 1px var(--brand-accent); }
.wd-stage.on .num { background: var(--brand-accent); color: #062030; }

/* RO photo slot */
.wd-ro-photo { order: 2; position: relative; aspect-ratio: 4 / 5; border-radius: 20px; overflow: hidden;
  background: repeating-linear-gradient(135deg, rgba(120,180,210,0.07) 0 12px, rgba(120,180,210,0.015) 12px 26px), var(--surface-sunken);
  box-shadow: inset 0 0 0 1px var(--border-subtle), var(--shadow-lg); }
.wd-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 14%; background: rgba(4,16,26,0.4); box-shadow: inset 0 1px 0 var(--border-subtle); }
.wd-manifold { position: absolute; left: 12%; right: 8%; top: 10%; height: 3px; border-radius: 3px; background: rgba(166,210,230,0.22); }
.wd-can { position: absolute; bottom: 14%; width: 38px; transform: translateX(-50%); border-radius: 9px 9px 5px 5px;
  background: linear-gradient(180deg, rgba(120,180,210,0.16), rgba(16,59,83,0.18)); box-shadow: inset 0 0 0 1px var(--border-default); transition: background .2s, box-shadow .2s; }
.wd-can .stripe { position: absolute; top: 4px; left: 5px; width: 7px; bottom: 6px; border-radius: 4px; background: rgba(233,243,248,0.18); }
.wd-can .cap { position: absolute; top: -5px; left: 50%; transform: translateX(-50%); width: 16px; height: 9px; border-radius: 4px; background: rgba(166,210,230,0.4); transition: background .2s; }
.wd-can.on { background: linear-gradient(180deg, rgba(120,180,210,0.42), rgba(40,110,146,0.34)); box-shadow: inset 0 0 0 1.5px var(--brand-accent), 0 0 24px rgba(88,176,214,0.25); }
.wd-can.on .cap { background: var(--brand-accent); }
.wd-pin { position: absolute; transform: translate(-50%,-50%); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; padding: 0; z-index: 4;
  background: rgba(12,44,62,0.85); border: 2px solid var(--brand-accent); color: #fff; font-family: var(--font-mono); font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 10px rgba(0,0,0,0.5); transition: background .18s, color .18s, box-shadow .18s, transform .18s; }
.wd-pin.on { background: var(--brand-accent); color: #062030; border-color: #fff; transform: translate(-50%,-50%) scale(1.15); z-index: 5; box-shadow: 0 0 0 5px rgba(88,176,214,0.25), 0 0 18px rgba(88,176,214,0.7); }
.wd-tag { position: absolute; left: 14px; top: 14px; right: 14px; z-index: 6; display: none; align-items: center; gap: 8px;
  background: rgba(4,16,26,0.78); backdrop-filter: blur(3px); border-radius: 10px; padding: 9px 12px; box-shadow: inset 0 0 0 1px var(--border-default); }
.wd-tag.show { display: flex; }
.wd-tag .spec { font-family: var(--font-mono); font-size: 12px; color: var(--brand-accent); }
.wd-tag .nm { font-size: 13px; font-weight: 700; color: #fff; }

@keyframes cwdPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(88,176,214,0.28), 0 0 14px rgba(88,176,214,0.55); }
  50%      { box-shadow: 0 0 0 9px rgba(88,176,214,0.05), 0 0 22px rgba(88,176,214,0.8); }
}
@media (prefers-reduced-motion: no-preference) {
  .wd-pulse { animation: cwdPulse 1.6s var(--ease-out) infinite; }
}

/* ---------- Testimonials ---------- */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; }
.stars { display: flex; gap: 3px; margin-bottom: 16px; }
.stars .icon { width: 16px; height: 16px; color: var(--amber-500); }
.quote-text { font-size: 16.5px; line-height: 1.55; color: var(--text-strong); font-weight: 500; }
.quote-by { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--blue-100); color: var(--blue-700);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex: none; }
.quote-name { font-size: 14.5px; font-weight: 700; color: var(--text-strong); }
.quote-city { font-size: 13px; color: var(--text-muted); }

/* ---------- CTA ---------- */
.cta { background: var(--surface-deep); position: relative; overflow: hidden; }
.cta .inner { max-width: 1000px; margin: 0 auto; padding: 88px 32px; text-align: center; position: relative; }
.cta img.mark { height: 56px; margin-bottom: 22px; }
.cta h2 { font-size: 46px; font-weight: 800; letter-spacing: -0.025em; color: #fff; line-height: 1.05; }
.cta p { font-size: 18px; color: rgba(255,255,255,0.72); max-width: 480px; margin: 18px auto 0; }
.cta .actions { display: flex; gap: 14px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.cta .btn-ghost { color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: var(--blue-900); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding: 56px 32px 40px; max-width: var(--container-max); margin: 0 auto; }
.site-footer .logo { height: 40px; }
.footer-about { font-size: 14px; color: rgba(255,255,255,0.55); margin-top: 16px; max-width: 240px; line-height: 1.55; }
.footer-col h4 { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue-300); margin-bottom: 16px; }
.footer-col .links { display: flex; flex-direction: column; gap: 11px; }
.footer-col a { font-size: 14px; color: rgba(255,255,255,0.7); }
.footer-col a:hover { color: #fff; }
.footer-bar { border-top: 1px solid rgba(255,255,255,0.1); }
.footer-bar .inner { max-width: var(--container-max); margin: 0 auto; padding: 20px 32px; display: flex; justify-content: space-between; font-size: 13px; color: rgba(255,255,255,0.45); flex-wrap: wrap; gap: 8px; }
.footer-bar a { color: rgba(255,255,255,0.45); }

/* ---------- Quote modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(11,42,61,0.55);
  backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal { width: 500px; max-width: 100%; background: var(--surface-card); border-radius: 24px;
  box-shadow: var(--shadow-xl); overflow: hidden; max-height: 92vh; display: flex; flex-direction: column; }
.modal-head { background: linear-gradient(150deg, #1C5478, #103B53); padding: 26px 28px; position: relative; }
.modal-head img { height: 34px; margin-bottom: 12px; }
.modal-head h3 { font-size: 23px; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.modal-head p { font-size: 14px; color: rgba(255,255,255,0.7); margin-top: 6px; }
.modal-close { position: absolute; top: 18px; right: 18px; background: rgba(255,255,255,0.12); border: none;
  width: 34px; height: 34px; border-radius: 50%; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: rgba(255,255,255,0.22); }
.modal-body { padding: 0; overflow: auto; -webkit-overflow-scrolling: touch; }
.modal-body iframe { width: 100%; border: none; display: block; }
.modal-fallback { padding: 26px 28px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-strong); margin-bottom: 6px; }
.field .control { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px;
  background: var(--surface-card); border: 1.5px solid var(--border-default); border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs); transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.field .control:focus-within { border-color: var(--brand-accent); box-shadow: var(--shadow-focus); }
.field input { flex: 1; border: none; outline: none; background: transparent; font-family: var(--font-sans); font-size: 15px; color: var(--text-body); min-width: 0; }
.field .suffix { font-size: 13px; color: var(--text-muted); font-family: var(--font-mono); }
.field .row { display: flex; gap: 12px; }
.modal-note { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 4px; }
.modal-note span { font-size: 12.5px; color: var(--text-subtle); }
.modal-note .icon { width: 15px; height: 15px; color: var(--text-subtle); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 24px; padding: 48px 24px 56px; }
  .hero h1 { font-size: 44px; }
  .hero-visual { min-height: 340px; order: -1; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  #wd-test, #wd-ro { grid-template-columns: 1fr; gap: 28px; }
  .wd-ro-photo { order: -1; }
  .wd-divider { margin: 36px 0; }
  .quotes { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .title { font-size: 32px; }
  .cta h2 { font-size: 34px; }
  .wrap, .section .wrap { padding-left: 24px; padding-right: 24px; }
  .section .wrap { padding-top: 56px; padding-bottom: 56px; }
  .site-nav { display: none; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column;
    background: var(--surface-page); border-bottom: 1px solid var(--border-subtle); padding: 16px 24px; gap: 16px; align-items: stretch; }
  .site-nav.open { display: flex; }
  .site-nav a { font-size: 16px; }
  .nav-toggle { display: flex; }
}
@media (max-width: 560px) {
  .services-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .wd-stages { grid-template-columns: 1fr; }
  .hero h1 { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
