/* Captain Fresh Rinse - shared styles for all pages */

html { scroll-behavior: smooth; scroll-padding-top: 86px; }
body { -webkit-font-smoothing: antialiased; }

/* ---------- Reveal on scroll ---------- */
/* Uses `translate` rather than `transform` so it never fights
   Tailwind's hover:-translate-y-* utilities on the same element. */
.reveal { opacity: 0; translate: 0 26px; transition: opacity .7s cubic-bezier(.22,.8,.3,1), translate .7s cubic-bezier(.22,.8,.3,1); }
.reveal.is-visible { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; translate: none !important; transition: none; }
  .hero-img { animation: none !important; transform: none !important; }
  .anim { opacity: 1 !important; translate: none !important; animation: none !important; }
}

/* ---------- Hero: split navy panel + photo, slide carousel ---------- */

/* Dotted texture on the solid navy side */
.hero-pattern {
  background-image: radial-gradient(rgba(255,255,255,.075) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
}

/* Blend the photo into the navy panel (mobile: vertical, desktop: horizontal) */
.hero-blend-sm {
  background: linear-gradient(0deg, rgba(8,43,76,.96) 10%, rgba(8,43,76,.78) 45%, rgba(8,43,76,.55) 100%);
}
.hero-blend-lg {
  background: linear-gradient(90deg, #082B4C 0%, rgba(8,43,76,.92) 18%, rgba(8,43,76,.45) 48%, rgba(8,43,76,.10) 72%, rgba(8,43,76,.30) 100%);
}

/* Staggered entrance for the hero copy */
.anim { opacity: 0; translate: 0 26px; animation: heroIn .8s cubic-bezier(.22,.8,.3,1) forwards; }
@keyframes heroIn { to { opacity: 1; translate: 0 0; } }

/* Slow Ken Burns push on the hero photo */
.hero-img { animation: slowZoom 16s ease-out forwards; }
@keyframes slowZoom { from { transform: scale(1.1); } to { transform: scale(1); } }

/* ---------- Decorative water spray ---------- */
.spray-line { stroke-dasharray: 6 10; animation: spray 1.4s linear infinite; }
@keyframes spray { to { stroke-dashoffset: -32; } }

/* ---------- Service cards ---------- */
.svc-img { transition: transform .75s cubic-bezier(.22,.8,.3,1); }
.svc-card:hover .svc-img { transform: scale(1.09); }

/* ---------- Image fallback (used if a remote photo fails to load) ---------- */
.img-fallback {
  background-image:
    radial-gradient(circle at 25% 15%, rgba(255,255,255,.22), transparent 55%),
    linear-gradient(135deg, #168DE0 0%, #0866B2 48%, #082B4C 100%);
}
.img-fallback::after {
  content: "";
  position: absolute; inset: 0;
  background-repeat: no-repeat; background-position: center; background-size: 70px 70px;
  opacity: .45;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'><path d='M12 22a5 5 0 0 0 5-5c0-3.5-5-10-5-10S7 13.5 7 17a5 5 0 0 0 5 5z'/></svg>");
}

/* ---------- Nav link underline ---------- */
.nav-link { position: relative; }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: #168DE0; border-radius: 2px; transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }
.nav-link.active { color: #0866B2; }

/* ---------- Mobile menu ---------- */
#mobileMenu { max-height: 0; overflow: hidden; transition: max-height .4s cubic-bezier(.22,.8,.3,1); }
#mobileMenu.open { max-height: 920px; }
/* Bars are 2.5px tall with a 5px gap, so each centre sits 7.5px
   from the next — that is the exact distance the outer bars travel
   to meet in the middle and form the X. */
.burger span { transition: transform .3s ease, opacity .2s ease; }
.burger.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.eyebrow { letter-spacing: .18em; }
::selection { background: #168DE0; color: #fff; }
#scrollBar { transform-origin: left; transform: scaleX(0); }

/* Form field states */
.field.err input, .field.err textarea { border-color: #dc2626 !important; background: #fef2f2; }
.field .msg { display: none; }
.field.err .msg { display: block; }

/* ---------- Mobile nav submenu (Service Areas) ---------- */
.submenu { max-height: 0; overflow: hidden; transition: max-height .35s cubic-bezier(.22,.8,.3,1); }
.submenu.open { max-height: 320px; }
.submenu-toggle.open svg { transform: rotate(180deg); }
