/*!
 * ============================================================================
 *  Kingscon Cleaning Services — Custom Stylesheet
 *  A division of Kingscon Engineering (Pvt) Ltd · Jaffna, Sri Lanka
 * ----------------------------------------------------------------------------
 *  Version     : 1.0.0
 *  Build Date  : 2026-07-21
 *  Developed by: Loncey Tech  (https://lonceytech.com/)
 *  Description : Brand-level overrides for Tailwind CDN — animations,
 *                gradients, button system, lightbox, nav, WhatsApp FAB.
 * ============================================================================
 */

/* === Base === */
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }

h1, h2, h3 { letter-spacing: -0.015em; }
.font-display { letter-spacing: -0.01em; }

/* === Scrollbar === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #EEF3F8; }
::-webkit-scrollbar-thumb { background: #2E9AA6; border-radius: 6px; border: 2px solid #EEF3F8; }
::-webkit-scrollbar-thumb:hover { background: #16305C; }

/* === Selection === */
::selection { background: #C9A24B; color: #0E2140; }

/* === Reveal animation === */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s cubic-bezier(.16, 1, .3, 1), transform .8s cubic-bezier(.16, 1, .3, 1);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* === Bubble float === */
@keyframes kc-float {
  0%, 100% { transform: translateY(0) translateX(0); }
  50%      { transform: translateY(-24px) translateX(8px); }
}
.bubble {
  position: absolute;
  border-radius: 9999px;
  background: radial-gradient(circle at 30% 30%, rgba(138, 211, 218, 0.18), rgba(46, 154, 166, 0.04) 60%, transparent 70%);
  animation: kc-float 9s ease-in-out infinite;
  pointer-events: none;
  filter: blur(0.5px);
}
.bubble.b1 { width: 360px; height: 360px; top: -100px; left: -100px; animation-delay: 0s; }
.bubble.b2 { width: 220px; height: 220px; bottom: 80px; right: -60px; animation-delay: 3s; }
.bubble.b3 { width: 180px; height: 180px; top: 38%; left: 8%; animation-delay: 1.5s; }

/* === Section gradients === */
.gradient-hero {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(46, 154, 166, 0.28), transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(201, 162, 75, 0.12), transparent 55%),
    linear-gradient(160deg, #0E2140 0%, #16305C 50%, #1E4A7A 100%);
}
.gradient-vm {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(46, 154, 166, 0.20), transparent 60%),
    linear-gradient(135deg, #0E2140 0%, #16305C 60%, #1E4A7A 100%);
}
.gradient-page-band {
  background: linear-gradient(180deg, #F7FAFC 0%, #EEF3F8 100%);
}

/* Subtle dot pattern */
.dot-pattern {
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* === Service card hover accent === */
.service-card-accent { position: relative; overflow: hidden; }
.service-card-accent::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(46, 154, 166, 0.05), transparent 60%);
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.service-card-accent:hover::before { opacity: 1; }
.service-card-accent::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, #16305C, #2E9AA6, #57BCC6);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s cubic-bezier(.4, 0, .2, 1);
}
.service-card-accent:hover::after { transform: scaleX(1); }

/* === Lightbox === */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(14, 33, 64, 0.94);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 95vw; max-height: 90vh; border-radius: 0.75rem; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.lightbox .lb-close {
  position: absolute; top: 1rem; right: 1rem;
  background: rgba(255, 255, 255, 0.10); color: white;
  width: 44px; height: 44px; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.20);
  transition: background .2s ease;
}
.lightbox .lb-close:hover { background: rgba(255, 255, 255, 0.20); }
.lightbox .lb-prev, .lightbox .lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08); color: white;
  width: 48px; height: 48px; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background .2s ease;
}
.lightbox .lb-prev { left: 1rem; }
.lightbox .lb-next { right: 1rem; }
.lightbox .lb-prev:hover, .lightbox .lb-next:hover { background: rgba(255, 255, 255, 0.18); }
.lightbox .lb-figure { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.lightbox .lb-caption { color: rgba(255, 255, 255, 0.8); font-size: 0.875rem; font-weight: 500; text-align: center; max-width: 90vw; }
@media (max-width: 640px) {
  .lightbox .lb-prev, .lightbox .lb-next { width: 40px; height: 40px; font-size: 1.5rem; }
  .lightbox .lb-prev { left: 0.5rem; }
  .lightbox .lb-next { right: 0.5rem; }
}

/* === Floating WhatsApp button === */
.whatsapp-fab { box-shadow: 0 8px 24px -6px rgba(37, 211, 102, 0.45), 0 4px 8px -2px rgba(0, 0, 0, 0.10); }
.whatsapp-fab:hover { box-shadow: 0 12px 32px -6px rgba(37, 211, 102, 0.55), 0 6px 14px -2px rgba(0, 0, 0, 0.12); }

/* === Sticky nav === */
#site-nav {
  background: linear-gradient(180deg, rgba(14, 33, 64, 0.95) 0%, rgba(22, 48, 92, 0.92) 100%);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid rgba(138, 211, 218, 0.10);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 4px 20px -6px rgba(0, 0, 0, 0.25);
  transition: background .35s ease, box-shadow .35s ease, border-color .35s ease;
}
#site-nav::after {
  content: '';
  position: absolute;
  left: 10%; right: 10%; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(138, 211, 218, 0.35), transparent);
  pointer-events: none; opacity: .7;
}
#site-nav.scrolled {
  background: linear-gradient(180deg, rgba(14, 33, 64, 0.98) 0%, rgba(22, 48, 92, 0.96) 100%);
  border-bottom-color: rgba(138, 211, 218, 0.18);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 10px 32px -10px rgba(0, 0, 0, 0.45);
}
#site-nav.scrolled::after { opacity: 1; }

/* Active nav states (scroll-spy) */
.nav-link.is-active { color: #8AD3DA; background: rgba(255, 255, 255, 0.06); }
.mobile-nav-link.is-active {
  color: #8AD3DA;
  background: rgba(46, 154, 166, 0.14);
  border-left: 2px solid #2E9AA6;
  padding-left: 1rem;
}

/* === Buttons — unified system === */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  min-height: 46px;
  border-radius: 9999px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600; font-size: 0.875rem; line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none;
  overflow: hidden;
  border: 1.5px solid transparent;
  transition: transform .25s cubic-bezier(.16,1,.3,1),
              box-shadow .25s cubic-bezier(.16,1,.3,1),
              background .2s ease, color .2s ease, border-color .2s ease, filter .2s ease;
}
.btn:focus-visible { outline: 2px solid #2E9AA6; outline-offset: 3px; }
.btn:active { transform: translateY(0) !important; filter: brightness(.95); }
.btn i { font-size: 1.1em; line-height: 1; }

.btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%);
  transform: translateX(-110%);
  transition: transform .65s cubic-bezier(.16,1,.3,1);
  pointer-events: none;
}
.btn:hover::before { transform: translateX(110%); }
.btn > * { position: relative; z-index: 1; }

/* PRIMARY — gold */
.btn-primary {
  background: linear-gradient(135deg, #C9A24B 0%, #E3C580 100%);
  color: #16305C;
  box-shadow: 0 6px 18px -6px rgba(201,162,75,.34), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-primary:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 10px 26px -8px rgba(201,162,75,.48), inset 0 1px 0 rgba(255,255,255,.30);
  background: linear-gradient(135deg, #D3AF5A 0%, #EDD293 100%);
}

/* SECONDARY — navy → teal */
.btn-secondary {
  background: linear-gradient(135deg, #16305C 0%, #2E9AA6 100%);
  color: white;
  box-shadow: 0 6px 18px -6px rgba(46,154,166,.34), inset 0 1px 0 rgba(255,255,255,.15);
}
.btn-secondary:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 10px 26px -8px rgba(46,154,166,.48);
  background: linear-gradient(135deg, #1B3A6E 0%, #33A9B5 100%);
}

/* OUTLINE — light text (use on dark bg) */
.btn-outline {
  background: rgba(255,255,255,.02);
  color: white;
  border-color: rgba(255,255,255,.30);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.btn-outline:hover {
  border-color: #8AD3DA; color: #8AD3DA;
  background: rgba(138,211,218,.08);
  transform: translateY(-1.5px);
}

/* OUTLINE-DARK — for light bg */
.btn-outline-dark { background: transparent; color: #16305C; border-color: #16305C; }
.btn-outline-dark:hover {
  background: #16305C; color: white;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px -6px rgba(22,48,92,.30);
}

/* Sizes */
.btn-sm { padding: 0.55rem 1.15rem; min-height: 40px; font-size: 0.8125rem; }
.btn-lg { padding: 0.95rem 2rem; min-height: 54px; font-size: 0.95rem; }

/* Button group (auto-stacks on mobile) */
.btn-group { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: stretch; }
.btn-group.btn-group-center { justify-content: center; }
/* Never shrink a button below its content — wrap to a new line instead of clipping text */
.btn-group > .btn { flex-shrink: 0; }
@media (max-width: 480px) {
  .btn-group { flex-direction: column; width: 100%; max-width: 22rem; margin-inline: auto; }
  .btn-group > .btn { width: 100%; }
}

/* === Mobile polish === */
@media (max-width: 640px) {
  html { scroll-padding-top: 68px; }
  .bubble.b1 { width: 240px; height: 240px; }
  .bubble.b2 { width: 160px; height: 160px; }
  .bubble.b3 { width: 120px; height: 120px; }
}

/* Reduce motion respect */
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
  .bubble { animation: none; }
  * { scroll-behavior: auto !important; }
}
