@import url("https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@300;400;500;600;700&family=Lora:wght@400;500;600;700&display=swap");

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Lora", serif !important;
}

p {
  font-family: "Josefin Sans", sans-serif !important;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

/* Ultra-smooth ambient background layer */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: -28vmax;
  pointer-events: none;
  z-index: -1;
  will-change: transform, opacity;
  transform: translate3d(0, 0, 0);
}

body::before {
  background:
    radial-gradient(
      circle at 12% 18%,
      rgba(134, 218, 247, 0.36),
      transparent 34%
    ),
    radial-gradient(circle at 84% 26%, rgba(8, 107, 149, 0.2), transparent 36%),
    radial-gradient(
      circle at 76% 82%,
      rgba(58, 179, 217, 0.18),
      transparent 38%
    ),
    linear-gradient(130deg, #edf6fb 0%, #f7fafc 52%, #eef7fb 100%);
  animation: ambient-drift-a 24s ease-in-out infinite alternate;
}

body::after {
  background:
    radial-gradient(circle at 22% 78%, rgba(9, 99, 140, 0.14), transparent 36%),
    radial-gradient(
      circle at 88% 68%,
      rgba(121, 211, 241, 0.24),
      transparent 30%
    );
  opacity: 0.6;
  animation: ambient-drift-b 34s ease-in-out infinite alternate;
}

/* Early loader guard so content does not flash before loader appears */
html.site-loading-init body {
  overflow: hidden;
}

html.site-loading-init body > * {
  visibility: hidden;
}

body.site-loading {
  overflow: hidden !important;
}

body.site-loading > *:not(#siteLoader) {
  visibility: hidden;
}

html.site-loading-init #siteLoader,
body.site-loading #siteLoader {
  visibility: visible !important;
}

.site-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(
      circle at 15% 20%,
      rgba(109, 219, 255, 0.28),
      transparent 36%
    ),
    radial-gradient(
      circle at 86% 78%,
      rgba(10, 125, 175, 0.22),
      transparent 42%
    ),
    linear-gradient(140deg, #062236 0%, #0c4360 55%, #062a3f 100%);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.45s ease,
    visibility 0.45s ease;
}

.site-loader.is-visible {
  opacity: 1;
  visibility: visible;
}

.site-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.site-loader__panel {
  width: min(92vw, 430px);
  padding: 28px 24px 24px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(3, 24, 36, 0.58);
  backdrop-filter: blur(8px);
  text-align: center;
  color: #ecf8ff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.site-loader__brand {
  width: 110px;
  height: 110px;
  margin: 0 auto 14px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.site-loader__orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: #ffffff;
  border-right-color: #69ddff;
  animation: loader-spin 0.95s linear infinite;
}

.site-loader__logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.28));
  animation: loader-logo-pulse 1.6s ease-in-out infinite;
}

.site-loader__title {
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.site-loader__bars {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 7px;
  height: 32px;
  margin: 14px 0 8px;
}

.site-loader__bars span {
  width: 7px;
  height: var(--h, 14px);
  border-radius: 999px;
  background: linear-gradient(180deg, #92ebff 0%, #2bc4f2 100%);
  box-shadow: 0 0 12px rgba(146, 235, 255, 0.45);
  transform-origin: bottom center;
  animation: loader-bars 1s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

.site-loader__text {
  margin: 0;
  font-size: 0.93rem;
  color: rgba(236, 248, 255, 0.88);
}

@keyframes loader-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes loader-logo-pulse {
  0%,
  100% {
    transform: scale(0.95);
  }

  50% {
    transform: scale(1.03);
  }
}

@keyframes loader-bars {
  0%,
  100% {
    opacity: 0.45;
    transform: scaleY(0.52);
  }

  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes ambient-drift-a {
  0% {
    transform: translate3d(-1.8%, -1.2%, 0) scale(1);
  }

  50% {
    transform: translate3d(1.4%, 0.9%, 0) scale(1.035);
  }

  100% {
    transform: translate3d(2.1%, 1.5%, 0) scale(1.06);
  }
}

@keyframes ambient-drift-b {
  0% {
    transform: translate3d(1.2%, 1.8%, 0) scale(1);
    opacity: 0.5;
  }

  50% {
    transform: translate3d(-1%, -1.4%, 0) scale(1.04);
    opacity: 0.7;
  }

  100% {
    transform: translate3d(-2%, -2.2%, 0) scale(1.08);
    opacity: 0.55;
  }
}

/* Keep UI interactions smooth without changing layout */
a,
button,
.btn-primary,
.menu a,
.dropdown-menu a {
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    opacity 0.2s ease,
    transform 0.2s ease;
}

/* Hide broken/empty image placeholders safely */
img[src=""],
img:not([src]) {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .site-loader {
    transition-duration: 0.001ms !important;
  }

  body::before,
  body::after {
    animation: none !important;
  }
}
