/* ============================================================
   Safewater Pool Care — Stylesheet
   Crisp & premium: deep navy, whites, generous whitespace.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg:          #ffffff;
  --bg-soft:     #f4f7fa;
  --bg-deep:     #0a1f33;
  --ink:         #0a1f33;
  --ink-muted:   #5a6b7c;
  --ink-soft:    #8395a6;
  --line:        #e6ecf1;
  --line-strong: #cdd8e1;
  --accent:      #1b4965;
  --accent-2:    #2a7fa8;
  --accent-soft: #d8e8f0;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(10,31,51,.04), 0 1px 3px rgba(10,31,51,.06);
  --shadow:    0 4px 12px rgba(10,31,51,.06), 0 12px 32px rgba(10,31,51,.08);

  --serif: "Fraunces", "Georgia", "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --maxw:        1180px;
  --maxw-narrow: 820px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--ink); }
button { font-family: inherit; cursor: pointer; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0 0 0.6em;
  /* Auto-balance multi-line headlines so words don't strand on a final line */
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 5.5vw, 4.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem,   3.5vw, 3rem);   }
h3 { font-size: clamp(1.4rem, 1.8vw, 1.75rem);}
h4 { font-size: 1.15rem; font-family: var(--sans); font-weight: 600; letter-spacing: 0; }

p { margin: 0 0 1.1em; color: var(--ink); }
.lede { font-size: clamp(1.125rem, 1.4vw, 1.35rem); line-height: 1.55; color: var(--ink-muted); }
.eyebrow {
  font-family: var(--sans);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: var(--accent);
  margin: 0 0 1.25rem;
  display: inline-block;
}

/* ---------- Layout ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.container-narrow { max-width: var(--maxw-narrow); margin: 0 auto; padding: 0 28px; }
section { padding: clamp(64px, 9vw, 128px) 0; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--bg-deep);
  color: #fff;
}
.btn-primary:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-arrow::after {
  content: "→";
  transition: transform 0.25s ease;
  font-weight: 400;
}
.btn-arrow:hover::after { transform: translateX(4px); }

/* Decorative-only button (e.g. nav-cta visual balance, not a real link) */
span.btn { cursor: default; }
span.btn-primary:hover { background: var(--bg-deep); transform: none; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  max-width: var(--maxw);
  margin: 0 auto;
  gap: 24px;
}

/* Brand area: logo image + license line beneath */
.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-decoration: none;
  color: var(--ink);
  line-height: 1;
}
.brand:hover { color: var(--ink); }
.brand-logo {
  height: 77px;
  width: auto;
  display: block;
  margin: 0;
}
.brand-license {
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
  white-space: nowrap;
}
@media (max-width: 520px) {
  .brand-logo { height: 63px; }
  .brand-license { font-size: 0.6rem; letter-spacing: 0.1em; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  position: relative;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-cta { margin-left: 0.5rem; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 8px;
  color: var(--ink);
}
.nav-toggle svg { width: 24px; height: 24px; }

@media (max-width: 920px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 0 24px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
  }
  .nav-links.open { display: flex; }
  .nav-links li { padding: 0; }
  .nav-links a {
    display: block;
    padding: 14px 28px;
    font-size: 1.05rem;
  }
  .nav-links a.active::after { display: none; }
  .nav-links a.active { color: var(--accent); }
  .nav-cta { margin: 12px 28px 0; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(40px, 6vw, 88px) 0 clamp(64px, 9vw, 120px);
  position: relative;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
.hero h1 { margin-bottom: 0.4em; }
.hero .lede { max-width: 32ch; }
.hero-cta { display: flex; gap: 12px; margin-top: 1.75rem; flex-wrap: wrap; }

.hero-image {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
  background:
    radial-gradient(at 70% 30%, rgba(255,255,255,.35), transparent 50%),
    linear-gradient(135deg, #1b4965 0%, #2a7fa8 50%, #62b6cb 100%);
}
.hero-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.hero-image .photo-hint {
  position: absolute;
  bottom: 18px; left: 18px;
  color: rgba(255,255,255,.78);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  font-style: italic;
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-image { aspect-ratio: 4 / 3; order: -1; }
}

.hero-simple {
  padding: clamp(80px, 10vw, 140px) 0 clamp(48px, 6vw, 80px);
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.hero-simple .lede { max-width: 60ch; margin-left: auto; margin-right: auto; }

/* ---------- Pillars ---------- */
.pillars { background: var(--bg-soft); }
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(28px, 3vw, 48px) clamp(40px, 5vw, 80px);
  margin-top: 3rem;
}
.pillar {
  display: grid;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-strong);
}
.pillar-num {
  font-family: var(--serif);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.pillar h3 { margin: 0; font-family: var(--serif); }
.pillar p { color: var(--ink-muted); margin: 0; }

@media (max-width: 720px) {
  .pillars-grid { grid-template-columns: 1fr; }
}

/* ---------- LSI / Education section ---------- */
.education { background: var(--bg); }
.education-inner {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}
.lsi-visual {
  aspect-ratio: 1 / 1;
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  padding: 32px;
  position: relative;
}
.lsi-visual svg { width: 100%; height: auto; max-width: 420px; }

.callout {
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  padding: 1.5rem 1.75rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.75rem 0;
}
.callout p { margin: 0; color: var(--ink); }
.callout p + p { margin-top: 1rem; }
.callout strong { color: var(--accent); font-weight: 600; }

@media (max-width: 860px) {
  .education-inner { grid-template-columns: 1fr; }
}

/* ---------- Service blocks ---------- */
.service-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  padding: clamp(48px, 6vw, 88px) 0;
}
.service-block + .service-block { border-top: 1px solid var(--line); }
.service-block.reverse .service-text { order: 2; }
.service-block.reverse .service-visual { order: 1; }

.service-visual {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #d8e8f0 0%, #b8ddea 100%);
  position: relative;
  overflow: hidden;
}
.service-visual img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.service-visual.deep {
  background: linear-gradient(135deg, #1b4965 0%, #2a7fa8 100%);
}
.service-visual.warm {
  background: linear-gradient(135deg, #cae9f5 0%, #e8f3f8 100%);
}
.service-visual .photo-hint {
  position: absolute;
  bottom: 14px; left: 16px;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  font-style: italic;
  color: rgba(10,31,51,.55);
}
.service-visual.deep .photo-hint { color: rgba(255,255,255,.7); }

.service-text h2 { font-size: clamp(1.75rem, 2.6vw, 2.25rem); }
.service-text ul { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.service-text ul li {
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: baseline;
}
.service-text ul li::before {
  content: "—";
  color: var(--accent);
  font-weight: 500;
}
.service-text ul li:last-child { border-bottom: 1px solid var(--line); }

@media (max-width: 860px) {
  .service-block,
  .service-block.reverse {
    grid-template-columns: 1fr;
  }
  .service-block.reverse .service-text { order: 2; }
  .service-block.reverse .service-visual { order: 1; }
}

/* ---------- Credentials panel (replaces a service-block visual) ---------- */
.credentials-panel {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, #0a1f33 0%, #1b4965 100%);
  color: #fff;
  padding: clamp(28px, 4vw, 48px);
  display: grid;
  align-content: center;
  gap: 0;
  position: relative;
  overflow: hidden;
}
.credentials-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 75% 15%, rgba(255,255,255,.06), transparent 45%),
    radial-gradient(circle at 20% 90%, rgba(255,255,255,.04), transparent 40%);
  pointer-events: none;
}
.credentials-panel .credentials-eyebrow {
  font-family: var(--sans);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: rgba(255,255,255,.55);
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}
.credentials-panel ul {
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  gap: 0;
  position: relative;
  z-index: 1;
}
.credentials-panel li {
  padding: 1rem 0;
  border-top: 1px solid rgba(255,255,255,.12);
  display: grid;
  gap: 0.15rem;
}
.credentials-panel li:first-child { border-top: 0; padding-top: 0; }
.credentials-panel .cred-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  color: #fff;
  letter-spacing: -0.005em;
}
.credentials-panel .cred-detail {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: rgba(255,255,255,.62);
  letter-spacing: 0.005em;
}
@media (max-width: 860px) {
  .credentials-panel { aspect-ratio: auto; padding: 32px 28px; }
}

/* ---------- Inline explainer (algae + vacuum stories) ---------- */
.explainer {
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 3.5vw, 48px);
  margin: clamp(28px, 4vw, 56px) 0;
}
.explainer h3 {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  margin: 0 0 0.75rem;
  color: var(--ink);
}
.explainer p { color: var(--ink); margin: 0 0 1rem; }
.explainer p:last-child { margin-bottom: 0; }

.explainer.with-image {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(24px, 3vw, 40px);
  align-items: center;
}
@media (max-width: 720px) {
  .explainer.with-image { grid-template-columns: 1fr; }
}

.explainer-photo {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, #1b4965 0%, #2a7fa8 100%);
  position: relative;
}
.explainer-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.explainer-photo .photo-hint {
  position: absolute;
  bottom: 12px; left: 14px;
  color: rgba(255,255,255,.78);
  font-size: 0.72rem;
  font-style: italic;
}
.explainer-caption {
  font-style: italic;
  color: var(--ink-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  margin-top: 0.85rem;
}

/* ---------- Strip / dark-navy block ---------- */
.strip {
  background: var(--bg-deep);
  color: #fff;
  text-align: center;
}
.strip h2, .strip h3 { color: #fff; }
.strip p { color: rgba(255,255,255,.78); }
.strip .container-narrow { padding-top: 8px; padding-bottom: 8px; }
.strip .lede { color: rgba(255,255,255,.85); }

/* ---------- Quiet CTA ---------- */
.quiet-cta {
  text-align: center;
  background: var(--bg-soft);
}
.quiet-cta .lede { max-width: 48ch; margin-left: auto; margin-right: auto; }
.quiet-cta .btn { margin-top: 1.5rem; }

/* ---------- Two-column generic ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
}

/* ---------- Story + portrait (About page) ---------- */
.story-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}
.portrait {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, #1b4965 0%, #2a7fa8 100%);
  position: relative;
  box-shadow: var(--shadow);
}
.portrait img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.portrait .photo-hint {
  position: absolute;
  bottom: 14px; left: 16px;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  font-style: italic;
  color: rgba(255,255,255,.78);
}
.portrait-caption {
  margin-top: 1rem;
  font-size: 0.92rem;
  color: var(--ink-muted);
  line-height: 1.5;
}
.portrait-caption strong {
  color: var(--ink);
  font-weight: 600;
}
@media (max-width: 860px) {
  .story-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 420px; }
}

/* ---------- Principles list ---------- */
.principles {
  margin-top: 2.5rem;
  display: grid;
  gap: 0;
}
.principle {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
}
.principle:last-child { border-bottom: 1px solid var(--line); }
.principle .pn {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  padding-top: 4px;
}
.principle h4 { margin: 0 0 0.4rem; }
.principle p { margin: 0; color: var(--ink-muted); }
@media (max-width: 600px) {
  .principle { grid-template-columns: 1fr; gap: 6px; }
  .principle .pn { font-size: 0.85rem; letter-spacing: 0.1em; padding-top: 0; }
}

/* ---------- On the Industry section (About page) ---------- */
.industry-aside {
  display: grid;
  gap: clamp(28px, 3vw, 40px);
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}
.industry-aside h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
  color: var(--ink);
}
.industry-aside .item {
  display: grid;
  gap: 0.4rem;
}
.industry-aside p { margin: 0; color: var(--ink-muted); }
.industry-aside p strong { color: var(--ink); }
.industry-aside .item.italic p {
  font-style: italic;
  color: var(--ink);
}

/* ---------- Form ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.form { display: grid; gap: 1.1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: 0.4rem; }
.field label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.field input,
.field textarea,
.field select {
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(27,73,101,.1);
}
.field textarea { min-height: 140px; resize: vertical; }
.form .btn { justify-self: flex-start; margin-top: 0.4rem; }

.contact-aside {
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  padding: 2rem;
}
.contact-aside h3 { margin-top: 0; }
.contact-line {
  display: grid;
  gap: 0.2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}
.contact-line:first-of-type { border-top: 0; padding-top: 0; }
.contact-line .label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.contact-line .value { color: var(--ink); font-size: 1.05rem; }
.contact-line a { color: var(--ink); }
.contact-line a:hover { color: var(--accent); }

@media (max-width: 720px) {
  .contact-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-deep);
  color: rgba(255,255,255,.75);
  padding: 64px 0 32px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.site-footer .brand { color: #fff; }
.site-footer .brand-logo {
  height: 98px;
  /* Soft white treatment for the logo on the dark footer. Works because
     the logo png has a transparent background (white pixels removed). */
  filter: brightness(0) invert(1) brightness(0.95);
}
.site-footer .brand-license {
  color: rgba(255,255,255,.55);
  margin-top: 4px;
}
.footer-tag {
  margin-top: 1.25rem;
  color: rgba(255,255,255,.6);
  max-width: 36ch;
  font-size: 0.95rem;
}
.footer-col h4 {
  color: #fff;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.65rem; }
.footer-col a { color: rgba(255,255,255,.7); font-size: 0.95rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 28px;
  font-size: 0.85rem;
  color: rgba(255,255,255,.55);
}

@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
