/* ══════════════════════════════════════════════════════════
   NON-CRITICAL CSS – Loaded asynchronously after first paint
   Animations, component classes, scrollbar, decorative styles
   ══════════════════════════════════════════════════════════ */

@keyframes orbit {
  0% {
    transform: rotate(0deg) translateY(calc(var(--radius) * 1px)) rotate(0deg);
  }
  100% {
    transform: rotate(360deg) translateY(calc(var(--radius) * 1px)) rotate(-360deg);
  }
}

/* ══════════════════════════════════════════════════════════
   COMPONENT CLASSES – Reusable design patterns
   ══════════════════════════════════════════════════════════ */

/* Glass morphism surface */
.glass {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

/* Gradient text (brand blue) */
.text-gradient {
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Accent glow effect */
.glow-accent {
  box-shadow: 0 0 30px 10px var(--accent-glow);
}

/* Legacy alias */
.glow-blue {
  box-shadow: 0 0 30px 10px var(--accent-glow);
}

/* Shimmer animation */
@keyframes shimmer {
  0% {
    transform: skewX(-30deg) translateX(-150%);
  }
  100% {
    transform: skewX(-30deg) translateX(150%);
  }
}

.animate-shimmer {
  animation: shimmer 2s infinite ease-in-out;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-muted);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--surface-hover);
}

/* Entrance Staggering */
.tile-wrapper {
  opacity: 0;
  animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 {
  animation-delay: 0s;
}

.delay-2 {
  animation-delay: 0.3s;
}

.delay-3 {
  animation-delay: 0.6s;
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(60px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Idle Float Animations (Desynced Phases) */
.float-1 {
  animation: floatA 4.2s ease-in-out infinite alternate;
}

.float-2 {
  animation: floatB 3.8s ease-in-out infinite alternate;
}

.float-3 {
  animation: floatC 4.5s ease-in-out infinite alternate;
}

@keyframes floatA {
  0% {
    transform: translateY(0px);
  }
  100% {
    transform: translateY(-12px);
  }
}

@keyframes floatB {
  0% {
    transform: translateY(-5px);
  }
  100% {
    transform: translateY(-15px);
  }
}

@keyframes floatC {
  0% {
    transform: translateY(2px);
  }
  100% {
    transform: translateY(-10px);
  }
}

/* Fiber Optic Data Flow */
.data-flow-neutral {
  stroke-dasharray: 8 16;
  animation: dataFlowNeutral 1.5s linear infinite;
}

.data-flow-active {
  stroke-dasharray: 10 20;
  animation: dataFlowActive 1s linear infinite;
}

@keyframes dataFlowNeutral {
  to {
    stroke-dashoffset: -24;
  }
}

@keyframes dataFlowActive {
  to {
    stroke-dashoffset: -30;
  }
}

/* Active Tile Pulse */
.pulse-glow {
  animation: pulse 2.5s ease-in-out infinite alternate;
}

@keyframes pulse {
  0% {
    opacity: 0.2;
  }
  100% {
    opacity: 0.8;
  }
}

/* Scan Line Sweep */
.scan-line {
  animation: scanSweep 5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes scanSweep {
  0%,
  20% {
    transform: skewX(-45deg) translateX(- 250px);
  }
  80%,
  100% {
    transform: skewX(-45deg) translateX(250px);
  }
}

/* Icon Rotation */
.spin-icon {
  transform-origin: center;
  animation: spin 20s linear infinite;
}

/* EKG Pulse Line */
.ekg-pulse {
  animation: ekgPulse 1.8s ease-in-out infinite;
}

@keyframes ekgPulse {
  0% {
    stroke-dashoffset: 80;
    opacity: 0.6;
  }
  50% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  100% {
    stroke-dashoffset: -80;
    opacity: 0.6;
  }
}

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

/* FloatingWhatsApp entrance */
@keyframes floatWhatsAppIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.animate-float-whatsapp {
  animation: floatWhatsAppIn 0.7s cubic-bezier(0.01, 0.989, 0.476, 0.912) 2s forwards;
  transform: scale(0); opacity: 0;
}

/* Background slats entrance */
@keyframes slatIn {
  0% { opacity: 0; transform: scaleY(1.1) translateX(50px) skewX(-25deg); }
  100% { opacity: 1; transform: scaleY(1) translateX(0) skewX(-25deg); }
}
.slat-in {
  opacity: 0;
  animation: slatIn 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* CompassRose wave pulses */
@keyframes compassWavePulse {
  0%, 100% { opacity: 0.05; transform: scale(1); }
  50% { opacity: 0.15; transform: scale(1.05); }
}
.compass-wave {
  opacity: 0.05;
  animation: compassWavePulse 3s ease-in-out infinite;
}

/* CompassRose needle spin */
@keyframes compassSpin {
  100% { transform: rotate(360deg); }
}
.compass-spin {
  animation: compassSpin 20s linear infinite;
}

/* CompassRose node pulse */
@keyframes compassNodePulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}
.compass-node-pulse {
  animation: compassNodePulse 2s ease-in-out infinite;
}

/* LightPillarLight beam animation */
@keyframes pillarBeamBase {
  0%, 100% { opacity: calc(var(--pillar-opacity, 0.4) * 0.3); transform: scaleX(0.8) translateX(-50%); }
  50% { opacity: calc(var(--pillar-opacity, 0.4) * 0.6); transform: scaleX(1.1) translateX(-50%); }
}
.pillar-beam-base {
  opacity: calc(var(--pillar-opacity, 0.4) * 0.5);
  animation: pillarBeamBase 6s ease-in-out infinite;
}

@keyframes pillarBeamCentral {
  0%, 100% { opacity: calc(var(--pillar-opacity, 0.4) * 0.7); transform: scaleX(1) translateX(-50%); }
  50% { opacity: calc(var(--pillar-opacity, 0.4) * 1); transform: scaleX(1.3) translateX(-50%); }
}
.pillar-beam-central {
  animation: pillarBeamCentral 4.2s ease-in-out infinite;
}

/* === Button scale-in animation === */
@keyframes btnScaleIn {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.btn-animate-in {
  animation: btnScaleIn 0.3s ease-out both;
}

/* === Navbar scroll-pin animation === */
.nav-scroll-pinned {
  transform: translateY(10px) scaleX(0.95);
  border-radius: 7px;
  box-shadow: 0 20px 60px -15px rgba(0,0,0,0.5);
  background-color: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(24px);
}
.nav-scroll-unpinned {
  transform: translateY(0) scaleX(1);
  border-radius: 0;
  box-shadow: none;
  background-color: transparent;
  border: 1px solid transparent;
}

/* === DesktopMenu staggered entrance === */
@keyframes menuItemEntrance {
  0% { opacity: 0; transform: translateY(-10px) skewX(5deg); }
  100% { opacity: 1; transform: translateY(0) skewX(0deg); }
}
.menu-item-in {
  opacity: 0;
  animation: menuItemEntrance 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* === Mobile backdrop fade === */
.mobile-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.mobile-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* === Mobile drawer slide === */
.mobile-drawer {
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}
.mobile-drawer.open {
  transform: translateX(0);
}
.mobile-drawer.closing {
  transform: translateX(100%);
}

/* === Mobile menu item staggered entrance === */
@keyframes mobileMenuItemIn {
  0% { opacity: 0; transform: translateX(12px); }
  100% { opacity: 1; transform: translateX(0); }
}
.mobile-item-in {
  opacity: 0;
  animation: mobileMenuItemIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Base Typography */
.label {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-anchor: middle;
  dominant-baseline: middle;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
