/* ============================================
   MAGNIFITIA — Custom Styles (Premium Aesthetic)
   ============================================ */

/* ----- CSS Custom Properties (Design Tokens) ----- */
:root {
  --brand-500: #22c55e;
  --brand-400: #4ade80;
  --forest-900: #064e3b;
  --forest-950: #022c22;
  --transition-fast: 200ms;
  --transition-normal: 300ms;
  --transition-slow: 500ms;
  --header-height: 5rem;
}

/* ----- Bento Dynamic Icon Animations ----- */
@keyframes bentoFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
}

@keyframes bentoRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes bentoTrend {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-3px) scale(1.05); }
}

@keyframes bentoPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.25); }
  50% { transform: scale(1.04); box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
}

@keyframes bentoCoin {
  0%, 100% { transform: rotateY(0deg); }
  50% { transform: rotateY(180deg); }
}

.animate-bento-float { animation: bentoFloat 4s ease-in-out infinite; }
.animate-bento-rotate { animation: bentoRotate 12s linear infinite; }
.animate-bento-trend { animation: bentoTrend 2.5s ease-in-out infinite; }
.animate-bento-pulse { animation: bentoPulse 2.5s ease-in-out infinite; }
.animate-bento-coin { animation: bentoCoin 3.5s ease-in-out infinite; }

/* ----- Premium Glassmorphism Navigation ----- */
.glass-nav {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

/* ----- Abstract Hero Natural Mesh Overlay (More Elegant) ----- */
.hero-bg-overlay {
  background-color: #022c22;
  background-image:
    radial-gradient(at 0% 0%, rgba(34, 197, 94, 0.15) 0px, transparent 60%),
    radial-gradient(at 100% 0%, rgba(6, 95, 70, 0.3) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(2, 44, 34, 0.98) 0px, transparent 60%),
    linear-gradient(to bottom, rgba(2, 44, 34, 0.7), rgba(2, 44, 34, 0.9)),
    url('https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?auto=format&fit=crop&w=1920&q=80');
  background-size: cover;
  background-position: center;
  background-blend-mode: overlay, normal, normal, normal, normal;
}

/* ----- Premium Button Hover State (Glow) ----- */
.btn-glow {
  position: relative;
  z-index: 1;
}
.btn-glow::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  background: inherit;
  filter: blur(12px);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.4s ease;
}
.btn-glow:hover::before {
  opacity: 0.6;
}

/* ----- Scroll-Reveal Animations ----- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUpSubtle {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-hero-1 { animation: fadeInUpSubtle 1s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-hero-2 { animation: fadeInUpSubtle 1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards; opacity: 0; }
.animate-hero-3 { animation: fadeInUpSubtle 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards; opacity: 0; }
.animate-hero-4 { animation: fadeInUpSubtle 1s cubic-bezier(0.16, 1, 0.3, 1) 0.45s forwards; opacity: 0; }

.reveal-section {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-section.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-section.revealed .reveal-child {
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.reveal-section.revealed .reveal-child:nth-child(1) { animation-delay: 0.05s; }
.reveal-section.revealed .reveal-child:nth-child(2) { animation-delay: 0.15s; }
.reveal-section.revealed .reveal-child:nth-child(3) { animation-delay: 0.25s; }
.reveal-section.revealed .reveal-child:nth-child(4) { animation-delay: 0.35s; }
.reveal-section.revealed .reveal-child:nth-child(5) { animation-delay: 0.45s; }
.reveal-section.revealed .reveal-child:nth-child(6) { animation-delay: 0.55s; }

/* ----- Modal Transition States ----- */
.modal-overlay {
  opacity: 0;
  transition: opacity var(--transition-normal) ease;
}
.modal-overlay.active { opacity: 1; }

.modal-drawer {
  transform: translateX(100%);
  transition: transform var(--transition-normal) cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-drawer.active { transform: translateX(0); }

/* ----- Form Submission States ----- */
.form-btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}
.form-btn-loading .btn-text { visibility: hidden; }
.form-btn-loading .btn-spinner { display: flex; }

.btn-spinner {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-spinner svg {
  width: 22px;
  height: 22px;
  animation: spin 0.8s linear infinite;
}

/* ----- Smooth Scroll Offset for Sticky Header ----- */
html {
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

/* ----- Print Styles ----- */
@media print {
  .glass-nav,
  #navMenuOverlay {
    display: none !important;
  }
  .hero-bg-overlay {
    background-image: none;
    background-color: #064e3b;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
