/* ============================================================
   KAWAR COMPANY — Custom Styles
   Tailwind CSS handles utilities; this file covers animations
   and special effects that need custom CSS.
   ============================================================ */

/* ─────────────────────────────────────────
   GLOBAL
───────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ─────────────────────────────────────────
   SPLASH SCREEN
───────────────────────────────────────── */
#splash {
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.splash-logo {
  animation: splashPop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}
.splash-title {
  animation: splashFadeUp 0.7s ease-out 0.55s both;
}
.splash-subtitle {
  animation: splashFadeUp 0.7s ease-out 0.75s both;
}
.splash-tagline {
  animation: splashFadeUp 0.7s ease-out 0.9s both;
}
.splash-loader {
  animation: splashFadeUp 0.7s ease-out 1s both;
}

@keyframes splashPop {
  from {
    opacity: 0;
    transform: scale(0.4) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
@keyframes splashFadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading bar fill */
.loading-bar-fill {
  animation: loadFill 2.2s ease-in-out 0.8s both;
  width: 0%;
}
@keyframes loadFill {
  0% {
    width: 0%;
  }
  60% {
    width: 80%;
  }
  100% {
    width: 100%;
  }
}

/* Animated water waves on splash */
.wave-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.wave {
  position: absolute;
  bottom: -60px;
  left: -50%;
  width: 200%;
  height: 220px;
  border-radius: 43%;
  opacity: 0.07;
  animation: waveRotate linear infinite;
}
.wave-1 {
  background: #60a5fa;
  animation-duration: 9s;
}
.wave-2 {
  background: #93c5fd;
  animation-duration: 13s;
  animation-delay: -3s;
  bottom: -80px;
  opacity: 0.05;
}
.wave-3 {
  background: #3b82f6;
  animation-duration: 7s;
  animation-delay: -5s;
  bottom: -40px;
  opacity: 0.04;
}

@keyframes waveRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ─────────────────────────────────────────
   NAVIGATION
───────────────────────────────────────── */
#navbar {
  background: transparent;
}

#navbar.scrolled {
  background: rgba(23, 37, 84, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.35);
}

/* Hamburger bars */
.h-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition:
    transform 0.32s cubic-bezier(0.23, 1, 0.32, 1),
    opacity 0.32s ease;
  transform-origin: center;
}

/* Open state → X */
#menu-btn.is-open .h-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
#menu-btn.is-open .h-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
#menu-btn.is-open .h-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu slide */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─────────────────────────────────────────
   HERO
───────────────────────────────────────── */
.hero-grid-pattern {
  background-image: radial-gradient(
    circle at 1px 1px,
    rgba(255, 255, 255, 0.15) 1px,
    transparent 0
  );
  background-size: 36px 36px;
}

/* Pulsing water rings */
.water-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  animation: ringPulse ease-out infinite;
}
.water-ring-1 {
  width: 380px;
  height: 380px;
  top: 8%;
  right: -5%;
  animation-duration: 5s;
  animation-delay: 0s;
}
.water-ring-2 {
  width: 560px;
  height: 560px;
  bottom: 5%;
  left: -10%;
  animation-duration: 7s;
  animation-delay: 1.5s;
}
.water-ring-3 {
  width: 220px;
  height: 220px;
  top: 45%;
  left: 32%;
  animation-duration: 4.5s;
  animation-delay: 3s;
}

@keyframes ringPulse {
  0% {
    transform: scale(0.75);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* ─────────────────────────────────────────
   SCROLL REVEAL
───────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger helper — set via inline style: animation-delay */
.reveal.delay-1 {
  transition-delay: 0.1s;
}
.reveal.delay-2 {
  transition-delay: 0.2s;
}
.reveal.delay-3 {
  transition-delay: 0.3s;
}
.reveal.delay-4 {
  transition-delay: 0.4s;
}

/* ─────────────────────────────────────────
   BRANDS MARQUEE
───────────────────────────────────────── */
.marquee-wrapper {
  position: relative;
  overflow: hidden;
}
.marquee-wrapper::before,
.marquee-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}
.marquee-wrapper::before {
  left: 0;
  background: linear-gradient(to right, #f9fafb, transparent);
}
.marquee-wrapper::after {
  right: 0;
  background: linear-gradient(to left, #f9fafb, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
}
.marquee-track:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ─────────────────────────────────────────
   SERVICE CARDS
───────────────────────────────────────── */
.service-card {
  transition:
    transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1),
    box-shadow 0.4s ease,
    border-color 0.3s ease;
}
.service-card:hover {
  transform: translateY(-8px);
}

.service-img-wrap {
  overflow: hidden;
}
.service-img-wrap img {
  transition: transform 0.6s ease;
}
.service-card:hover .service-img-wrap img {
  transform: scale(1.07);
}

/* ─────────────────────────────────────────
   PROJECT CARDS
───────────────────────────────────────── */
.project-card {
  transition:
    transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1),
    box-shadow 0.4s ease;
}
.project-card:hover {
  transform: translateY(-8px);
}

.project-img-wrap {
  overflow: hidden;
}
.project-img-wrap img {
  transition: transform 0.6s ease;
}
.project-card:hover .project-img-wrap img {
  transform: scale(1.07);
}

/* ─────────────────────────────────────────
   GALLERY
───────────────────────────────────────── */
.gallery-tab {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
}
.gallery-tab:hover {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}
.gallery-tab.active {
  background: #f97316;
  color: white;
  border-color: #f97316;
}

.gallery-item {
  overflow: hidden;
  cursor: pointer;
  border-radius: 12px;
  transition: transform 0.3s ease;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-item .overlay {
  position: absolute;
  inset: 0;
  background: rgba(23, 37, 84, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}
.gallery-item:hover .overlay {
  background: rgba(23, 37, 84, 0.45);
}
.gallery-item .overlay svg {
  opacity: 0;
  transform: scale(0.7);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}
.gallery-item:hover .overlay svg {
  opacity: 1;
  transform: scale(1);
}

/* ─────────────────────────────────────────
   LIGHTBOX
───────────────────────────────────────── */
#lightbox {
  animation: lbFadeIn 0.2s ease;
}
@keyframes lbFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
#lightbox img {
  transition: opacity 0.2s ease;
}

/* ─────────────────────────────────────────
   CLIENT CARDS
───────────────────────────────────────── */
.client-card {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}
.client-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(30, 58, 138, 0.1);
}

/* ─────────────────────────────────────────
   CONTACT CARDS
───────────────────────────────────────── */
.contact-card {
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}
.contact-card:hover {
  transform: translateY(-2px);
}

/* ─────────────────────────────────────────
   BACK TO TOP
───────────────────────────────────────── */
#back-to-top {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    background 0.2s ease;
  pointer-events: none;
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ─────────────────────────────────────────
   RESPONSIVE TWEAKS
───────────────────────────────────────── */
@media (max-width: 767px) {
  .water-ring-1 {
    width: 220px;
    height: 220px;
  }
  .water-ring-2 {
    width: 320px;
    height: 320px;
  }
  .water-ring-3 {
    display: none;
  }
}

/* Section divider wave shape */
.wave-divider {
  display: block;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}
.wave-divider svg {
  display: block;
  width: 100%;
}
