/* ============================================
   Liquid Glass + Film Grain + Arabesque Effects
   Awwwards-quality animated backgrounds
   ============================================ */

/* --- Animated Arabesque Background Mesh --- */
.hero,
.page-header {
  --blob-1: rgba(192, 215, 139, 0.12);
  --blob-2: rgba(2, 118, 137, 0.18);
  --blob-3: rgba(212, 168, 83, 0.10);
  --blob-4: rgba(28, 117, 126, 0.14);
}

/* Liquid glass morphing blobs */
.liquid-glass {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.liquid-glass__blob {
  position: absolute;
  border-radius: 40% 60% 55% 45% / 55% 40% 60% 45%;
  filter: blur(80px);
  opacity: 0;
  will-change: transform, border-radius;
  animation: blobMorph 18s ease-in-out infinite alternate,
             blobFadeIn 1.5s ease-out forwards;
  mix-blend-mode: screen;
}

.liquid-glass__blob--1 {
  width: 55vw;
  height: 55vw;
  max-width: 700px;
  max-height: 700px;
  background: radial-gradient(circle, var(--blob-1) 0%, transparent 70%);
  top: -15%;
  left: -10%;
  animation-delay: 0s;
  animation-duration: 18s, 1.5s;
}

.liquid-glass__blob--2 {
  width: 45vw;
  height: 45vw;
  max-width: 600px;
  max-height: 600px;
  background: radial-gradient(circle, var(--blob-2) 0%, transparent 70%);
  top: 20%;
  right: -15%;
  animation-delay: -4s;
  animation-duration: 22s, 1.5s;
  border-radius: 55% 45% 50% 50% / 45% 55% 45% 55%;
}

.liquid-glass__blob--3 {
  width: 40vw;
  height: 40vw;
  max-width: 500px;
  max-height: 500px;
  background: radial-gradient(circle, var(--blob-3) 0%, transparent 70%);
  bottom: -10%;
  left: 30%;
  animation-delay: -8s;
  animation-duration: 20s, 1.5s;
  border-radius: 50% 50% 40% 60% / 60% 40% 55% 45%;
}

.liquid-glass__blob--4 {
  width: 35vw;
  height: 35vw;
  max-width: 450px;
  max-height: 450px;
  background: radial-gradient(circle, var(--blob-4) 0%, transparent 70%);
  top: 50%;
  left: -5%;
  animation-delay: -12s;
  animation-duration: 24s, 1.5s;
  border-radius: 60% 40% 45% 55% / 50% 60% 40% 50%;
}

@keyframes blobMorph {
  0% {
    border-radius: 40% 60% 55% 45% / 55% 40% 60% 45%;
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  25% {
    border-radius: 55% 45% 40% 60% / 45% 55% 50% 50%;
    transform: translate(3vw, -2vw) rotate(45deg) scale(1.05);
  }
  50% {
    border-radius: 50% 50% 60% 40% / 60% 40% 55% 45%;
    transform: translate(-2vw, 3vw) rotate(90deg) scale(0.95);
  }
  75% {
    border-radius: 45% 55% 45% 55% / 50% 60% 40% 50%;
    transform: translate(2vw, 1vw) rotate(135deg) scale(1.08);
  }
  100% {
    border-radius: 60% 40% 50% 50% / 40% 55% 45% 55%;
    transform: translate(-1vw, -3vw) rotate(180deg) scale(1);
  }
}

@keyframes blobFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Liquid Glass Reflection Layer --- */
.liquid-glass__reflection {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      125deg,
      transparent 0%,
      rgba(255, 255, 255, 0.02) 25%,
      transparent 30%,
      rgba(255, 255, 255, 0.015) 55%,
      transparent 60%,
      rgba(192, 215, 139, 0.02) 85%,
      transparent 100%
    );
  animation: reflectionShift 12s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes reflectionShift {
  0% {
    background-position: 0% 0%;
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  100% {
    background-position: 100% 100%;
    opacity: 0.6;
  }
}

/* --- Animated Arabesque Pattern Overlay --- */
.arabesque-animated {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.arabesque-animated__layer {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23C0D78B' stroke-width='0.6'%3E%3Cpath d='M60 0 L120 60 L60 120 L0 60Z'/%3E%3Cpath d='M60 15 L105 60 L60 105 L15 60Z'/%3E%3Cpath d='M60 30 L90 60 L60 90 L30 60Z'/%3E%3Ccircle cx='60' cy='60' r='12'/%3E%3Ccircle cx='60' cy='60' r='6'/%3E%3Cpath d='M0 0 L60 60 M120 0 L60 60 M0 120 L60 60 M120 120 L60 60'/%3E%3Cpath d='M60 0 L60 120 M0 60 L120 60'/%3E%3Cpath d='M30 0 Q60 30 90 0 M30 120 Q60 90 90 120 M0 30 Q30 60 0 90 M120 30 Q90 60 120 90'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 120px;
  animation: arabesqueFloat 60s linear infinite;
}

.arabesque-animated__layer--2 {
  opacity: 0.018;
  background-size: 80px 80px;
  animation: arabesqueFloat2 80s linear infinite;
  animation-delay: -20s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23D4A853' stroke-width='0.5'%3E%3Ccircle cx='40' cy='40' r='35'/%3E%3Ccircle cx='40' cy='40' r='25'/%3E%3Ccircle cx='40' cy='40' r='15'/%3E%3Ccircle cx='40' cy='40' r='5'/%3E%3Cpath d='M40 5 L40 75 M5 40 L75 40'/%3E%3Cpath d='M15 15 L65 65 M65 15 L15 65'/%3E%3C/g%3E%3C/svg%3E");
}

@keyframes arabesqueFloat {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    transform: translate(-60px, -60px) rotate(360deg);
  }
}

@keyframes arabesqueFloat2 {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    transform: translate(40px, 40px) rotate(-360deg);
  }
}

/* --- Film Grain Overlay --- */
.film-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9990;
  opacity: 0.035;
  mix-blend-mode: overlay;
  animation: grainShift 0.5s steps(6) infinite;
}

.film-grain canvas {
  width: 100%;
  height: 100%;
}

@keyframes grainShift {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-2%, -3%); }
  20% { transform: translate(3%, 1%); }
  30% { transform: translate(-1%, 3%); }
  40% { transform: translate(2%, -2%); }
  50% { transform: translate(-3%, 1%); }
  60% { transform: translate(1%, -1%); }
  70% { transform: translate(-2%, 2%); }
  80% { transform: translate(3%, -3%); }
  90% { transform: translate(-1%, -2%); }
}

/* --- Animated Gradient Background (hero/page-header enhancement) --- */
.hero {
  background:
    linear-gradient(160deg, #001F2B 0%, #004357 35%, #1C757E 65%, #004357 100%);
  background-size: 200% 200%;
  animation: gradientFlow 16s ease-in-out infinite;
}

.page-header {
  background:
    linear-gradient(160deg, #001F2B 0%, #004357 35%, #1C757E 65%, #004357 100%);
  background-size: 200% 200%;
  animation: gradientFlow 16s ease-in-out infinite;
}

@keyframes gradientFlow {
  0% {
    background-position: 0% 0%;
  }
  25% {
    background-position: 50% 100%;
  }
  50% {
    background-position: 100% 50%;
  }
  75% {
    background-position: 50% 0%;
  }
  100% {
    background-position: 0% 0%;
  }
}

/* --- Sparkle / Shimmer Line Accents --- */
.shimmer-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(192, 215, 139, 0.4) 30%,
    rgba(212, 168, 83, 0.6) 50%,
    rgba(192, 215, 139, 0.4) 70%,
    transparent 100%
  );
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  animation: shimmerGlide 6s ease-in-out infinite;
}

.shimmer-line--1 {
  width: 300px;
  top: 25%;
  left: -300px;
  animation-delay: 0s;
  transform: rotate(-8deg);
}

.shimmer-line--2 {
  width: 200px;
  top: 55%;
  right: -200px;
  animation-delay: -2s;
  transform: rotate(5deg);
}

.shimmer-line--3 {
  width: 250px;
  bottom: 20%;
  left: -250px;
  animation-delay: -4s;
  transform: rotate(-3deg);
}

@keyframes shimmerGlide {
  0% {
    opacity: 0;
    transform: translateX(0) rotate(inherit);
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: translateX(calc(100vw + 300px)) rotate(inherit);
  }
}

/* --- Reduce Motion --- */
@media (prefers-reduced-motion: reduce) {
  .liquid-glass__blob,
  .liquid-glass__reflection,
  .arabesque-animated__layer,
  .film-grain,
  .shimmer-line,
  .hero,
  .page-header {
    animation: none !important;
    transition: none !important;
  }

  .film-grain {
    display: none;
  }
}
