/* ═══ CLEARVIEW — Premium motion layer ═══ */

:root {
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

/* Scroll progress — GPU scaleX (no layout thrash) */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 200;
  background: linear-gradient(90deg, var(--sky-500), var(--meadow-400), var(--sky-400));
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.45);
  pointer-events: none;
  transform: scaleX(var(--scroll-progress, 0));
  transform-origin: left center;
  will-change: transform;
}

/* ═══ EPIC LOAD SPLASH ═══ */
.loader-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 120% 80% at 50% 30%, #1a3a5c 0%, #0a1628 45%, #050d18 100%);
  overflow: hidden;
  pointer-events: all;
}

.loader-splash__flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.35), transparent 55%);
  opacity: 0;
  animation: loaderFlash 2.2s var(--ease-smooth) forwards;
}

@keyframes loaderFlash {
  0%,
  8% {
    opacity: 0;
    transform: scale(0.5);
  }
  18% {
    opacity: 1;
    transform: scale(1.2);
  }
  35% {
    opacity: 0.4;
    transform: scale(1.5);
  }
  100% {
    opacity: 0;
    transform: scale(2);
  }
}

.loader-splash__grid {
  position: absolute;
  inset: -50%;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: loaderGridSpin 8s linear infinite;
  opacity: 0.5;
}

@keyframes loaderGridSpin {
  to {
    transform: rotate(8deg) scale(1.05);
  }
}

.loader-splash__rings {
  position: absolute;
  width: min(420px, 90vw);
  height: min(420px, 90vw);
  pointer-events: none;
}

.loader-splash__rings span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.5);
  opacity: 0;
  animation: loaderRingBurst 2s var(--ease-out-expo) forwards;
}

.loader-splash__rings span:nth-child(1) {
  animation-delay: 0.1s;
}
.loader-splash__rings span:nth-child(2) {
  animation-delay: 0.22s;
  border-color: rgba(74, 222, 128, 0.45);
}
.loader-splash__rings span:nth-child(3) {
  animation-delay: 0.34s;
}
.loader-splash__rings span:nth-child(4) {
  animation-delay: 0.46s;
  border-color: rgba(255, 255, 255, 0.25);
}

@keyframes loaderRingBurst {
  0% {
    transform: scale(0.15);
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.loader-splash__logo {
  position: relative;
  z-index: 2;
  width: min(120px, 28vw);
  height: auto;
  opacity: 0;
  transform: scale(0.2) rotate(-25deg);
  animation: loaderLogoIn 1.1s var(--ease-spring) 0.35s forwards;
  filter: drop-shadow(0 0 40px rgba(56, 189, 248, 0.5));
}

@keyframes loaderLogoIn {
  0% {
    opacity: 0;
    transform: scale(0.2) rotate(-25deg);
  }
  55% {
    opacity: 1;
    transform: scale(1.12) rotate(6deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.loader-splash__brand {
  position: relative;
  z-index: 2;
  margin: 1.25rem 0 0;
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: 0.28em;
  color: #fff;
  opacity: 0;
  transform: translateY(24px);
  animation: loaderTextIn 0.7s var(--ease-smooth) 0.85s forwards;
}

.loader-splash__tag {
  position: relative;
  z-index: 2;
  margin: 0.35rem 0 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(186, 230, 253, 0.85);
  opacity: 0;
  transform: translateY(16px);
  animation: loaderTextIn 0.7s var(--ease-smooth) 1s forwards;
}

@keyframes loaderTextIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.loader-splash__bar {
  position: relative;
  z-index: 2;
  width: min(220px, 60vw);
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  opacity: 0;
  animation: loaderTextIn 0.5s var(--ease-smooth) 1.1s forwards;
}

.loader-splash__bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sky-500), var(--meadow-400));
  animation: loaderBarFill 1s var(--ease-smooth) 1.2s forwards;
}

@keyframes loaderBarFill {
  to {
    width: 100%;
  }
}

.loader-splash.is-exiting {
  animation: loaderExit 0.85s var(--ease-smooth) forwards;
}

@keyframes loaderExit {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  40% {
    opacity: 1;
    transform: scale(1.04);
  }
  100% {
    opacity: 0;
    transform: scale(1.15);
    visibility: hidden;
  }
}

/* ─── Hero entrance (runs on load, no scroll needed) ─── */
.hero__content > * {
  opacity: 0;
  transform: translate3d(0, 40px, 0);
}

body.is-ready .hero__content > * {
  animation: heroEnter 0.85s var(--ease-smooth) forwards;
}

body.is-ready .hero__content > *:nth-child(1) {
  animation-delay: 0.15s;
}
body.is-ready .hero__content > *:nth-child(2) {
  animation-delay: 0.28s;
}
body.is-ready .hero__content > *:nth-child(3) {
  animation-delay: 0.4s;
}
body.is-ready .hero__content > *:nth-child(4) {
  animation-delay: 0.52s;
}
body.is-ready .hero__content > *:nth-child(5) {
  animation-delay: 0.64s;
}

@keyframes heroEnter {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.hero__visual {
  opacity: 0;
  transform: translate3d(0, 50px, 0) scale(0.92);
}

body.is-ready .hero__visual {
  animation: heroVisualIn 1s var(--ease-smooth) 0.35s forwards;
}

@keyframes heroVisualIn {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

/* Gradient headline */
.text-gradient {
  background: linear-gradient(135deg, #ffffff 0%, #bae6fd 45%, #4ade80 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero {
  contain: layout style;
}

.hero__bg,
.hero-particles,
.hero__aurora {
  transform: translateZ(0);
}

/* Hero layout upgrade */
.hero__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  width: 100%;
}

@media (max-width: 960px) {
  .hero__layout {
    grid-template-columns: 1fr;
  }

  .hero__visual {
    order: -1;
    max-width: 320px;
    margin: 0 auto;
  }
}

.hero__content {
  max-width: none;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.25rem) !important;
  line-height: 1.05 !important;
}

/* Floating logo card */
.hero-showcase {
  position: relative;
  padding: 2rem;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: showcaseFloat 6s ease-in-out infinite;
}

@keyframes showcaseFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-14px) rotate(0.5deg);
  }
}

.hero-showcase img {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.25));
}

.hero-showcase__ring {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  border: 1px solid rgba(56, 189, 248, 0.25);
  animation: ringPulse 4s ease-in-out infinite;
}

.hero-showcase__ring--2 {
  inset: -40px;
  animation-delay: -2s;
  border-color: rgba(74, 222, 128, 0.2);
}

@keyframes ringPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

/* Particles */
.hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  animation: particleDrift linear infinite;
}

@keyframes particleDrift {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-20vh) scale(1);
    opacity: 0;
  }
}

/* Aurora overlay */
.hero__aurora {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(56, 189, 248, 0.35), transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(74, 222, 128, 0.2), transparent 45%),
    radial-gradient(ellipse 50% 30% at 60% 80%, rgba(99, 102, 241, 0.15), transparent 40%);
  animation: auroraShift 14s ease-in-out infinite alternate;
}

@keyframes auroraShift {
  0% {
    opacity: 0.7;
    transform: scale(1) rotate(0deg);
  }
  100% {
    opacity: 1;
    transform: scale(1.1) rotate(3deg);
  }
}

/* Stronger orbs */
.hero__orb {
  opacity: 0.65 !important;
  animation: floatOrb 8s ease-in-out infinite !important;
}

/* Marquee band */
.marquee-band {
  overflow: hidden;
  background: linear-gradient(90deg, var(--navy-950), var(--navy-800), var(--navy-950));
  border-block: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1rem 0;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
}

.marquee-track span {
  flex-shrink: 0;
  padding: 0 2.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
}

.marquee-track span::before {
  content: "✦";
  margin-right: 2.5rem;
  color: var(--sky-400);
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Scroll reveals — dramatic */
[data-reveal] {
  opacity: 0 !important;
  transform: translate3d(0, 36px, 0) scale(0.98) !important;
  transition:
    opacity 0.65s var(--ease-smooth),
    transform 0.65s var(--ease-smooth) !important;
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1 !important;
  transform: translate3d(0, 0, 0) scale(1) !important;
  will-change: auto;
}

[data-reveal-delay="1"] {
  transition-delay: 0.1s !important;
}
[data-reveal-delay="2"] {
  transition-delay: 0.2s !important;
}
[data-reveal-delay="3"] {
  transition-delay: 0.3s !important;
}

/* Stagger children */
[data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.7s var(--ease-smooth),
    transform 0.7s var(--ease-smooth);
}

[data-reveal-stagger].is-visible > *:nth-child(1) {
  transition-delay: 0.05s;
}
[data-reveal-stagger].is-visible > *:nth-child(2) {
  transition-delay: 0.15s;
}
[data-reveal-stagger].is-visible > *:nth-child(3) {
  transition-delay: 0.25s;
}

[data-reveal-stagger].is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal-stagger].is-visible [data-reveal] {
  opacity: 1 !important;
  transform: translate3d(0, 0, 0) scale(1) !important;
}

/* Cards — 3D hover + glow */
.glass-card,
.service-card,
.testimonial-card {
  transition:
    transform 0.5s var(--ease-spring),
    box-shadow 0.5s var(--ease-smooth),
    border-color 0.4s !important;
}

.glass-card:hover,
.service-card:hover,
.testimonial-card:hover {
  transform: translateY(-12px) scale(1.02) !important;
  box-shadow:
    0 32px 80px rgba(14, 165, 233, 0.18),
    0 0 0 1px rgba(56, 189, 248, 0.2) !important;
}

.service-card__icon,
.about-card__icon {
  transition: transform 0.5s var(--ease-spring);
}

.service-card:hover .service-card__icon,
.glass-card:hover .about-card__icon {
  transform: scale(1.12) rotate(-4deg);
}

/* Buttons — shimmer + lift */
.btn {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.45s var(--ease-spring),
    box-shadow 0.45s var(--ease-smooth) !important;
}

.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s var(--ease-smooth);
}

.btn:hover::after {
  left: 140%;
}

.btn:hover {
  transform: translateY(-4px) scale(1.03) !important;
}

.btn--primary:hover,
.btn--sky:hover {
  box-shadow: 0 20px 50px rgba(14, 165, 233, 0.45) !important;
}

/* Nav link underline */
.nav-desktop a:not(.btn) {
  position: relative;
}

.nav-desktop a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--sky-500), var(--meadow-400));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-smooth);
}

.nav-desktop a:not(.btn):hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Section titles */
.section-title {
  font-size: clamp(2rem, 4vw, 3rem) !important;
}

.eyebrow {
  animation: eyebrowPulse 3s ease-in-out infinite;
}

@keyframes eyebrowPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.65;
  }
}

/* Inner page hero */
.page-hero {
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% -20%, rgba(56, 189, 248, 0.25), transparent);
  animation: auroraShift 10s ease-in-out infinite alternate;
}

.page-hero .container {
  position: relative;
  z-index: 1;
}

body.is-ready .page-hero h1,
body.is-ready .page-hero p,
body.is-ready .page-hero .eyebrow {
  animation: heroEnter 0.9s var(--ease-smooth) backwards;
}

body.is-ready .page-hero .eyebrow {
  animation-delay: 0.1s;
}
body.is-ready .page-hero h1 {
  animation-delay: 0.2s;
}
body.is-ready .page-hero p {
  animation-delay: 0.35s;
}

/* CTA band pulse */
.cta-band {
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg, transparent, rgba(56, 189, 248, 0.15), transparent, rgba(74, 222, 128, 0.1), transparent);
  animation: ctaSpin 8s linear infinite;
}

@keyframes ctaSpin {
  to {
    transform: rotate(360deg);
  }
}

.cta-band > * {
  position: relative;
  z-index: 1;
}

/* Map section pop */
.map-section {
  transform: scale(0.98);
  transition: transform 0.8s var(--ease-smooth), box-shadow 0.8s;
}

.map-section.is-visible {
  transform: scale(1);
  box-shadow: 0 40px 100px rgba(10, 22, 40, 0.2) !important;
}

/* Header entrance */
.site-header {
  transform: translateY(-100%);
  transition: transform 0.8s var(--ease-smooth), background 0.45s, box-shadow 0.45s !important;
}

body.is-ready .site-header {
  transform: translateY(0);
}

/* Section backgrounds */
.section--mesh {
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(14, 165, 233, 0.06), transparent 50%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(34, 197, 94, 0.05), transparent 50%),
    var(--cream-50);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--meadow-400);
  box-shadow: 0 0 12px var(--meadow-400);
  animation: pulseDot 2s ease-in-out infinite;
  flex-shrink: 0;
}

.hero__badge {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
}

@keyframes pulseDot {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.65;
  }
}

.hero-btn-ghost {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.hero-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  border-color: rgba(255, 255, 255, 0.55) !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .hero__content > *,
  .hero__visual {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .scroll-progress,
  .loader-splash,
  .hero-particles {
    display: none !important;
  }

  body.is-ready .loader-splash {
    display: none !important;
  }
}
