/* ============================================================
   SparkClean Services — Custom styles
   Everything Tailwind utilities can't express cleanly:
   animations, interactive widgets, and a11y affordances.
   ============================================================ */

:root {
  --brand-500: #1E6FEC;
  --brand-600: #1257C9;
  --brand-900: #0B2545;
  --mint-500: #0FA968;
  --header-h: 76px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(30, 111, 236, 0.18);
  color: var(--brand-900);
}

/* ---------- Accessibility ---------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  background: var(--brand-900);
  color: #fff;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 1rem;
}

:focus-visible {
  outline: 3px solid var(--brand-500);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Signature: gradient word + clean-sweep swoosh ---------- */

.text-sweep {
  background: linear-gradient(120deg, #4A93F5 0%, #35C98A 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.swoosh {
  position: relative;
  white-space: nowrap;
}
.swoosh::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: -0.18em;
  height: 0.32em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M3 15 Q 60 4 120 9 T 197 7' fill='none' stroke='%230FA968' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}

/* ---------- Glassmorphism (used sparingly) ---------- */

.glass {
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.glass-dark {
  background: rgba(11, 37, 69, 0.55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* ---------- Scroll-reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.reveal-left  { transform: translateX(-36px); }
.reveal.reveal-right { transform: translateX(36px); }
.reveal.reveal-scale { transform: scale(0.92); }
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* Stagger children: parent gets .reveal-group, children inherit delay */
.reveal-group > .reveal:nth-child(1) { transition-delay: 0s; }
.reveal-group > .reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal-group > .reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal-group > .reveal:nth-child(4) { transition-delay: 0.3s; }
.reveal-group > .reveal:nth-child(5) { transition-delay: 0.4s; }
.reveal-group > .reveal:nth-child(6) { transition-delay: 0.5s; }

/* ---------- Buttons: ripple + lift ---------- */

.btn-ripple {
  position: relative;
  overflow: hidden;
  transform: translateZ(0); /* clip ripple on Safari */
}
.btn-ripple .ripple {
  position: absolute;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.45);
  transform: scale(0);
  animation: ripple 0.6s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

.hover-lift {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.hover-lift:hover {
  transform: translateY(-6px);
}

/* ---------- Header behavior ---------- */

#site-header .header-inner {
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}
#site-header.is-scrolled .header-inner {
  box-shadow: 0 8px 30px rgba(11, 37, 69, 0.1);
}

/* Desktop dropdown */
.nav-dropdown {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
.nav-item:hover > .nav-dropdown,
.nav-item:focus-within > .nav-dropdown,
.nav-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Mobile menu panel */
#mobile-menu {
  transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}
#mobile-menu.is-open {
  max-height: 90vh;
  opacity: 1;
  overflow-y: auto;
}

/* Active page link */
.nav-link[aria-current="page"] {
  color: var(--brand-600);
}
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}
.nav-link {
  position: relative;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.35rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-500), var(--mint-500));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-link:hover::after {
  transform: scaleX(1);
}

/* ---------- Trusted-by marquee ---------- */

.marquee-mask {
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
}
.marquee-mask:hover .marquee-track {
  animation-play-state: paused;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Before / After slider ---------- */

.ba-slider {
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.ba-slider img {
  pointer-events: none;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ba-after {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 50%);
}
.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: #fff;
  box-shadow: 0 0 20px rgba(11, 37, 69, 0.45);
  transform: translateX(-50%);
  pointer-events: none;
}
.ba-handle-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 9999px;
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--brand-600);
  box-shadow: 0 8px 24px rgba(11, 37, 69, 0.35);
}
.ba-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  margin: 0;
}
.ba-label {
  position: absolute;
  top: 1rem;
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(11, 37, 69, 0.65);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

/* ---------- FAQ accordion ---------- */

.accordion-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.accordion-panel > div {
  overflow: hidden;
}
.accordion-item[data-open="true"] .accordion-panel {
  grid-template-rows: 1fr;
}
.accordion-item .accordion-icon {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.accordion-item[data-open="true"] .accordion-icon {
  transform: rotate(45deg);
}

/* ---------- Masonry gallery + lightbox ---------- */

.masonry {
  columns: 1;
  column-gap: 1.25rem;
}
@media (min-width: 640px)  { .masonry { columns: 2; } }
@media (min-width: 1024px) { .masonry { columns: 3; } }
.masonry > * {
  break-inside: avoid;
  margin-bottom: 1.25rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 18, 36, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 2rem;
}
.lightbox.is-open {
  display: flex;
}
.lightbox img {
  max-width: min(1100px, 92vw);
  max-height: 82vh;
  border-radius: 1rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

/* ---------- Forms ---------- */

.field-input {
  width: 100%;
  border-radius: 0.875rem;
  border: 1.5px solid #E2E8F0;
  background: #fff;
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
  color: #0B2545;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field-input::placeholder { color: #94A3B8; }
.field-input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(30, 111, 236, 0.14);
}
.field-input[aria-invalid="true"] {
  border-color: #E11D48;
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.1);
}
.field-error {
  display: none;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #E11D48;
}
.field-error.is-visible { display: block; }

/* Button loading spinner */
.btn-spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 9999px;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Floating action buttons ---------- */

.fab {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}
.fab:hover { transform: translateY(-4px) scale(1.04); }

#back-to-top {
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
#back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Chat panel */
#chat-panel {
  transform-origin: bottom right;
  transform: scale(0.9);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.3s;
}
#chat-panel.is-open {
  transform: scale(1);
  opacity: 1;
  visibility: visible;
}

/* Cookie banner */
#cookie-banner {
  transform: translateY(120%);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
#cookie-banner.is-visible {
  transform: translateY(0);
}

/* ---------- Timeline (About page) ---------- */

.timeline {
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-500), var(--mint-500));
}
@media (min-width: 768px) {
  .timeline::before { left: 50%; transform: translateX(-50%); }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
