/* West Pool Services — site styles
   Brand: Deep Gulf #0A3542 · Tide #12718C · Pool Light #4FC3D9 · Sunset #F0803C · Sand #F4EDE3
   Type: Archivo (display) · IBM Plex Sans (body) · IBM Plex Mono (readings) */

html { scroll-behavior: smooth; }
body { margin: 0; font-family: 'IBM Plex Sans', -apple-system, 'Segoe UI', sans-serif; background: #061F28; }
a { color: #4FC3D9; }
a:hover { color: #FFFFFF; }

/* Liquid glass */
.glass {
  position: relative;
  background: linear-gradient(135deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.05) 45%, rgba(255,255,255,0.08) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), inset 0 -1px 0 rgba(255,255,255,0.06), 0 30px 80px -20px rgba(0,0,0,0.55);
  overflow: hidden;
  overflow: clip;   /* clips like hidden, but focus or scripts can't scroll the contents out of place */
  transition: transform .6s cubic-bezier(.2,.8,.2,1), border-color .6s, box-shadow .6s;
}
.glass::after {
  content: "";
  position: absolute; top: -50%; left: -60%;
  width: 40%; height: 200%;
  background: linear-gradient(100deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.16) 50%, rgba(255,255,255,0) 100%);
  transform: translateX(0) rotate(14deg);
  animation: sheen 7s ease-in-out infinite;
  will-change: transform;
  pointer-events: none;
}
.glass.slow::after { animation-duration: 11s; animation-delay: 1.5s; }
.lift:hover { transform: translateY(-6px); border-color: rgba(79,195,217,0.55); box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 40px 90px -24px rgba(18,113,140,0.65); }
/* Moves with transform (GPU) instead of `left`: 500% of its own 40% width = 200% of the card. */
@keyframes sheen { 0%, 55% { transform: translateX(0) rotate(14deg); } 100% { transform: translateX(500%) rotate(14deg); } }

/* Hero water: slow liquid ripple.
   .ripple = SVG-filter fallback; .water-canvas = WebGL version (js/main.js). */
.ripple { filter: url(#wps-liquid); animation: breathe 18s ease-in-out infinite alternate; transform-origin: 60% 70%; }
.water-source { opacity: 0; }
.water-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transform-origin: 60% 70%; animation: breathe 18s ease-in-out infinite alternate; will-change: transform; }
@keyframes breathe { from { transform: scale(1.04); } to { transform: scale(1.12) translate(-1.5%, -1%); } }

/* Moving review cards: skip the live backdrop blur (it would be recomputed every frame) */
.marquee .glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: linear-gradient(135deg, rgba(255,255,255,0.13) 0%, rgba(255,255,255,0.07) 45%, rgba(255,255,255,0.09) 100%), rgba(10,53,66,0.55); }

/* Drifting light behind the glass */
.blob { position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none; will-change: transform; }
.b1 { animation: drift1 16s ease-in-out infinite alternate; }
.b2 { animation: drift2 20s ease-in-out infinite alternate; }
.b3 { animation: drift3 24s ease-in-out infinite alternate; }
@keyframes drift1 { from { transform: translate(0,0) scale(1); } to { transform: translate(120px, 60px) scale(1.25); } }
@keyframes drift2 { from { transform: translate(0,0) scale(1.1); } to { transform: translate(-140px, -40px) scale(0.9); } }
@keyframes drift3 { from { transform: translate(0,0); } to { transform: translate(80px, -90px) scale(1.2); } }

/* Waves that slide with scroll */
.wave-band { position: absolute; left: 0; right: 0; height: 120px; pointer-events: none; overflow: hidden; }
.wave-band svg { position: absolute; bottom: 0; left: 0; width: 200%; height: 100%; will-change: transform; }

/* Reviews slider */
.marquee { position: relative; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%); }
.track { display: flex; gap: 20px; width: max-content; animation: slide 60s linear infinite; padding: 10px 0 30px; }
.marquee:hover .track { animation-play-state: paused; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(calc(-50% - 10px)); } }

.rise { animation: rise 1.1s cubic-bezier(.2,.8,.2,1) both; }
.d1 { animation-delay: .15s; } .d2 { animation-delay: .3s; } .d3 { animation-delay: .45s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

.btn-sun { transition: transform .3s, box-shadow .3s; }
.btn-sun:hover { color: #0A3542; transform: translateY(-2px); box-shadow: 0 14px 40px -10px rgba(240,128,60,0.8); }
.btn-ghost:hover { color: #FFFFFF; background: rgba(255,255,255,0.16); }
.field { width: 100%; box-sizing: border-box; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.22); border-radius: 14px; padding: 14px 16px; font: 500 16px 'IBM Plex Sans', sans-serif; color: #FFFFFF; }
.field::placeholder { color: rgba(191,212,219,0.75); }
.field:focus { outline: 2px solid #4FC3D9; outline-offset: 2px; }

/* Quote form status message */
.form-status { grid-column: 1 / -1; margin: 0; padding: 14px 16px; border-radius: 14px; font-size: 15px; line-height: 1.5; color: #FFFFFF; background: rgba(79,195,217,0.14); border: 1px solid rgba(79,195,217,0.45); }
.form-status.is-error { background: rgba(240,128,60,0.14); border-color: rgba(240,128,60,0.6); }
.form-status a { color: #FFFFFF; font-weight: 600; }
.quote-form button[disabled] { opacity: .7; cursor: progress; }
.field:user-invalid { border-color: rgba(240,128,60,0.8); }

/* EN / ES language switch (js/i18n.js). In the bar on desktop, inside the burger menu on phones. */
.lang-toggle { display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.22); background: rgba(255,255,255,0.08); cursor: pointer; font: 600 13px 'Archivo', sans-serif; letter-spacing: 0.06em; color: #BFD4DB; }
.lang-toggle span { padding: 7px 11px; border-radius: 999px; transition: background .2s, color .2s; }
.lang-toggle span.is-active { background: #4FC3D9; color: #061F28; }
.lang-toggle:hover span:not(.is-active) { color: #FFFFFF; }
.lang-toggle:focus-visible { outline: 2px solid #4FC3D9; outline-offset: 2px; }
.lang-toggle-menu { display: none; }
@media (max-width: 860px) {
  .lang-toggle-bar { display: none; }
  .lang-toggle-menu { display: inline-flex; align-self: flex-start; margin: 14px 0 8px; font-size: 15px; }
}

/* Header nav — full links on desktop, burger menu on phones */
.site-nav { position: relative; z-index: 2; margin: 24px auto 0; width: calc(100% - 48px); max-width: 1240px; box-sizing: border-box; border-radius: 999px; padding: 10px 10px 10px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; }
.nav-logo { display: flex; align-items: center; }
.nav-links { display: flex; align-items: center; gap: 28px; margin-left: auto; font-size: 15px; font-weight: 500; }
.nav-links a { color: #DCE9ED; text-decoration: none; }
.nav-links a:hover { color: #FFFFFF; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-cta { background: #F0803C; color: #0A3542; text-decoration: none; font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 15px; padding: 14px 24px; border-radius: 999px; white-space: nowrap; }
.nav-toggle { display: none; width: 46px; height: 46px; flex: none; border-radius: 50%; border: 1px solid rgba(255,255,255,0.22); background: rgba(255,255,255,0.08); cursor: pointer; padding: 0; position: relative; }
.nav-toggle span { position: absolute; left: 14px; width: 18px; height: 2px; border-radius: 2px; background: #FFFFFF; transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .2s; }
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 22px; }
.nav-toggle span:nth-child(3) { top: 28px; }
.nav-toggle:focus-visible { outline: 2px solid #4FC3D9; outline-offset: 2px; }
.site-nav.is-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.site-nav.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-nav.is-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .site-nav { width: calc(100% - 32px); margin-top: 16px; padding: 8px 8px 8px 18px; border-radius: 30px; gap: 0 10px; }
  .nav-logo svg { width: 112px; height: 34px; }
  .nav-cta { font-size: 14px; padding: 12px 16px; }
  .nav-toggle { display: block; }
  .nav-links { display: none; order: 3; flex-basis: 100%; margin: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 10px 6px 0; }
  .nav-links a { padding: 15px 0; font-size: 17px; border-top: 1px solid rgba(255,255,255,0.12); }
  .site-nav.is-open .nav-links { display: flex; animation: menu-in .35s cubic-bezier(.2,.8,.2,1) both; }
}

/* Phones: services cards in one sideways row.
   Default = swipeable row with snapping (also the reduced-motion version).
   .is-linked (set by js/main.js) = row pins on screen and slides as you scroll down. */
.services-sticky { display: flex; flex-direction: column; gap: 56px; }
@media (max-width: 700px) {
  .services-sticky { gap: 28px; }
  .services-intro { gap: 14px !important; }
  .services-grid { display: flex !important; gap: 14px !important; margin: 0 -24px; padding: 4px 24px 8px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 24px; scrollbar-width: none; }
  .services-grid::-webkit-scrollbar { display: none; }
  .services-grid > * { flex: 0 0 min(78vw, 320px); min-height: 300px !important; scroll-snap-align: start; }
  .services-scroller.is-linked .services-sticky { position: sticky; overflow: hidden; margin: 0 -24px; padding: 4px 24px 8px; }
  /* width stays auto: Safari sizes a max-content flex row by its unwrapped text, which made the slide run long */
  .services-scroller.is-linked .services-grid { overflow: visible; margin: 0; padding: 0; scroll-snap-type: none; will-change: transform; }
  /* Moving cards skip the live backdrop blur, like the reviews strip */
  .services-scroller.is-linked .glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: linear-gradient(135deg, rgba(255,255,255,0.13) 0%, rgba(255,255,255,0.07) 45%, rgba(255,255,255,0.09) 100%), rgba(10,53,66,0.55); }
  .services-scroller.is-linked .services-progress { display: block; }
  .services-cta-solo { min-height: 0 !important; gap: 18px !important; }
}
/* Short phones: drop the intro sentence while pinned so heading + cards fit on screen */
@media (max-width: 700px) and (max-height: 740px) {
  .services-scroller.is-linked .services-intro p { display: none; }
}
.services-progress { display: none; height: 3px; margin-top: 18px; border-radius: 3px; background: rgba(255,255,255,0.14); overflow: hidden; }
.services-progress span { display: block; height: 100%; width: 100%; background: #4FC3D9; transform-origin: left center; transform: scaleX(0); }

/* Phones: "Our services include" strip becomes a stacked card, quote form goes single-column.
   !important is needed to beat the inline layout styles in index.html. */
@media (max-width: 600px) {
  .services-strip { border-radius: 26px !important; padding: 22px 20px !important; flex-direction: column; align-items: flex-start !important; gap: 14px !important; }
  .services-strip ul { gap: 8px !important; }
  .services-strip li { padding: 10px 16px !important; font-size: 15px !important; }
  .quote-form { grid-template-columns: minmax(0, 1fr) !important; padding: 26px 22px !important; gap: 16px !important; }
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .glass::after, .ripple, .water-canvas, .blob, .rise, .track, .site-nav.is-open .nav-links { animation: none !important; }
  .nav-toggle span, .lang-toggle span { transition: none; }
  .marquee { overflow-x: auto; }
}
