/* Pool Care+ marketing site, shared styles */

:root {
  --brand-blue: #1e489d;
  --brand-teal: #6bc0c0;
  --text-dark: #1a2733;
  --text-muted: #5a6b78;
  --bg-light: #f7fafc;
  --border-light: #e2e8ec;
  --focus-ring: #ffb703;
  --radius: 14px;
  --max-width: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-dark);
  line-height: 1.55;
  background: #fff;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--brand-blue);
}

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

/* Skip link: first focusable element, visually hidden until focused */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 100;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 12px 20px;
  background: #fff;
  color: var(--brand-blue);
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* Focus visibility: custom, high-contrast against gradient/photo backgrounds */
a:focus-visible,
button:focus-visible,
.badge-link:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Header + hero */
.site-header {
  position: relative;
  background: linear-gradient(120deg, var(--brand-blue) 0%, var(--brand-teal) 100%);
  padding-bottom: 64px;
  overflow: hidden;
}

/* Scrim: guarantees text contrast regardless of where it sits on the gradient
   (raw white text on the teal end of the gradient measures ~1.8:1, fails WCAG AA) */
.header-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 20, 40, 0.35) 0%, rgba(10, 20, 40, 0.15) 60%, rgba(10, 20, 40, 0) 100%);
  pointer-events: none;
}

.nav-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  min-height: 44px;
}

.brand img {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 14px;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-radius: 8px;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.15);
}

.hero {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 0;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
}

.hero h1 {
  color: #fff;
  font-size: clamp(2.1rem, 4.5vw, 3rem);
  margin: 0 0 12px;
  line-height: 1.1;
}

.hero-tagline {
  color: #fff;
  font-size: 1.15rem;
  margin: 0 0 28px;
  max-width: 42ch;
  opacity: 0.95;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: var(--brand-blue);
  font-weight: 700;
  text-decoration: none;
  padding: 14px 26px;
  border-radius: 999px;
  min-height: 44px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.hero-cta:hover {
  transform: translateY(-1px);
}

.hero-image img {
  border-radius: 24px;
  box-shadow: 0 20px 48px rgba(10, 20, 40, 0.35);
  margin: 0 auto;
  max-width: 280px;
}

/* Wave divider under the header, matching the in-app wavy motif.
   The app animates this by shifting a fixed-amplitude sine wave's phase linearly
   over an 18s loop (see WaveHeader.kt / WaveHeader.swift). This is mathematically identical
   to sliding a tileable wave pattern sideways at a constant speed, so the path below
   repeats exactly every 480px and the animation just translates by one tile. */
.wave-divider {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 5760px;
  height: 40px;
  display: block;
  animation: wave-scroll 18s linear infinite;
}

@keyframes wave-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-480px);
  }
}

/* Feature sections */
.features {
  padding: 72px 0 24px;
}

.section-heading {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}

.section-heading h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.section-heading p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 40px 24px;
}

.feature-row:nth-child(even) .feature-copy {
  order: 2;
}

.feature-image {
  display: flex;
  justify-content: center;
}

.feature-image img {
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(10, 20, 40, 0.12);
  max-width: 260px;
}

.feature-copy h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 1.5rem;
  margin: 0 0 10px;
}

.tier-badge {
  display: inline-block;
  background: var(--brand-teal);
  color: #08333a;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  vertical-align: middle;
}

.feature-copy p {
  color: var(--text-muted);
  font-size: 1.02rem;
}

/* Pricing */
.pricing {
  background: var(--bg-light);
  padding: 72px 0;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.pricing-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
}

.pricing-card.featured {
  border: 2px solid var(--brand-teal);
  position: relative;
}

.pricing-card .most-popular {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #08333a;
  background: var(--brand-teal);
  border-radius: 999px;
  padding: 4px 10px;
  margin: -40px auto 16px;
  width: fit-content;
}

.pricing-card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.price-monthly {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--brand-blue);
}

.price-annual {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 4px 0 16px;
}

.pricing-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.pricing-card li {
  padding: 6px 0;
}

/* Download CTA */
.download {
  padding: 72px 0;
  text-align: center;
}

.badge-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.badge-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  min-height: 52px;
  border-radius: 10px;
  background: #14151a;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  position: relative;
}

.badge-link.coming-soon {
  opacity: 0.55;
  pointer-events: none;
  cursor: default;
}

.coming-soon-label {
  display: inline-block;
  margin-top: 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Need help block */
.need-help {
  background: var(--bg-light);
  padding: 48px 0;
  text-align: center;
}

.need-help h2 {
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.need-help p {
  color: var(--text-muted);
  max-width: 52ch;
  margin: 0 auto 8px;
}

.need-help a {
  font-weight: 600;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-light);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.footer-links a:hover {
  color: var(--brand-blue);
}

.footer-copyright {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Legal / static content pages */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.legal-page h1 {
  font-size: 2rem;
  margin-bottom: 4px;
}

.legal-updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 40px;
}

.legal-page h2 {
  font-size: 1.3rem;
  margin-top: 40px;
}

.legal-page p,
.legal-page li {
  color: var(--text-dark);
  font-size: 1rem;
}

.legal-page .placeholder {
  background: #fff3cd;
  border: 1px solid #ffe08a;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.back-home {
  display: inline-block;
  margin-bottom: 24px;
  font-weight: 600;
  text-decoration: none;
}

/* Responsive */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 32px;
  }

  .hero-tagline {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-image {
    order: -1;
  }

  .feature-row {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .feature-row:nth-child(even) .feature-copy {
    order: 0;
  }

  .feature-copy h3 {
    justify-content: center;
  }

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

  .nav-links {
    gap: 2px;
  }

  .nav-links a {
    padding: 10px 8px;
    font-size: 0.85rem;
  }
}

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

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    row-gap: 4px;
  }

  .brand {
    font-size: 1.05rem;
    white-space: nowrap;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
  }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-cta:hover {
    transform: none;
  }

  .wave-divider {
    animation: none;
  }
}
