/**
 * Bionest Partners Finance - Main Stylesheet
 * Premium Investment Banking Aesthetic
 */

/* ===== CSS VARIABLES ===== */
:root {
  --brand-primary: #0d1138; /* Darker shade for gradients */
  --brand-gold: #d4af37;
  --brand-dark: #171c56; /* Client's logo color */
  --brand-deeper: #080b24; /* Very dark - Footer/Bottom */
  --brand-glow: #8b5cf6;
}

/* ===== BASE STYLES ===== */
* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--brand-dark);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: "Century Gothic", "Questrial", "Montserrat", sans-serif;
}

.font-serif {
  font-family: "Playfair Display", serif;
}

/* ===== KEYFRAME ANIMATIONS ===== */

/* Morphing Blob */
@keyframes morph {
  0%,
  100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  25% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
  50% {
    border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%;
  }
  75% {
    border-radius: 60% 40% 60% 30% / 70% 30% 50% 60%;
  }
}

/* Gradient Animation */
@keyframes gradientFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Pulse Glow */
@keyframes pulseGlow {
  0%,
  100% {
    box-shadow:
      0 0 20px rgba(212, 175, 55, 0.3),
      0 0 40px rgba(212, 175, 55, 0.1);
  }
  50% {
    box-shadow:
      0 0 40px rgba(212, 175, 55, 0.5),
      0 0 80px rgba(212, 175, 55, 0.2);
  }
}

/* Text Shimmer */
@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* Float */
@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  33% {
    transform: translateY(-20px) rotate(2deg);
  }
  66% {
    transform: translateY(-10px) rotate(-1deg);
  }
}

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scale In */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Rotate */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Mesh Grid Animation */
@keyframes meshMove {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }
  25% {
    transform: translateY(-10px) translateX(5px);
  }
  50% {
    transform: translateY(-5px) translateX(-5px);
  }
  75% {
    transform: translateY(-15px) translateX(3px);
  }
}

/* ===== UTILITY CLASSES ===== */

/* Animated Background Gradient */
.bg-animated-gradient {
  background: linear-gradient(-45deg, #0a0a12, #212251, #1a1a3e, #0a0a12);
  background-size: 400% 400%;
  animation: gradientFlow 15s ease infinite;
}

/* Morphing Blob */
.blob {
  animation: morph 8s ease-in-out infinite;
}

/* Shimmer Text */
.text-shimmer {
  background: linear-gradient(
    90deg,
    #d4af37 0%,
    #f5d680 25%,
    #d4af37 50%,
    #f5d680 75%,
    #d4af37 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* Glass Effect - Enhanced */
.glass {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  will-change: transform, opacity;
}

.glass-strong {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  will-change: transform, opacity;
}

/* Neon Glow Button */
.btn-neon {
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-neon::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.6s ease;
}

.btn-neon:hover::before {
  left: 100%;
}

.btn-neon:hover {
  animation: pulseGlow 1.5s ease-in-out infinite;
  transform: translateY(-3px) scale(1.02);
}

/* 3D Card */
.card-3d {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  perspective: 1000px;
}

.card-3d:hover {
  transform: translateY(-15px) rotateX(5deg) rotateY(-5deg);
  box-shadow:
    0 25px 50px -12px rgba(33, 34, 81, 0.4),
    0 0 0 1px rgba(212, 175, 55, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Gradient Border */
.border-gradient {
  position: relative;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.02)
  );
  border-radius: 1rem;
}

.border-gradient::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(212, 175, 55, 0.5),
    rgba(139, 92, 246, 0.3),
    rgba(212, 175, 55, 0.2)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* Animated Line */
.line-animated {
  position: relative;
  overflow: hidden;
}

.line-animated::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--brand-gold),
    transparent
  );
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.line-animated:hover::after {
  transform: translateX(0);
}

/* Mesh Background */
.mesh-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(212, 175, 55, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 175, 55, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: meshMove 20s linear infinite;
  will-change: transform;
}

/* Particle Dots */
.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(212, 175, 55, 0.4);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite;
  will-change: transform;
}

/* ===== SCROLL REVEAL ANIMATIONS ===== */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, opacity;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.85);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.active {
  opacity: 1;
  transform: scale(1);
}

.reveal-rotate {
  opacity: 0;
  transform: translateY(30px) rotate(-3deg);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-rotate.active {
  opacity: 1;
  transform: translateY(0) rotate(0);
}

/* Stagger Children Animation */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-children.active > *:nth-child(1) {
  transition-delay: 0.1s;
  opacity: 1;
  transform: translateY(0);
}
.stagger-children.active > *:nth-child(2) {
  transition-delay: 0.2s;
  opacity: 1;
  transform: translateY(0);
}
.stagger-children.active > *:nth-child(3) {
  transition-delay: 0.3s;
  opacity: 1;
  transform: translateY(0);
}
.stagger-children.active > *:nth-child(4) {
  transition-delay: 0.4s;
  opacity: 1;
  transform: translateY(0);
}
.stagger-children.active > *:nth-child(5) {
  transition-delay: 0.5s;
  opacity: 1;
  transform: translateY(0);
}
.stagger-children.active > *:nth-child(6) {
  transition-delay: 0.6s;
  opacity: 1;
  transform: translateY(0);
}

/* ===== PARALLAX & EFFECTS ===== */

.parallax-section {
  position: relative;
  overflow: hidden;
}

.parallax-bg {
  position: absolute;
  inset: -20%;
  transition: transform 0.1s ease-out;
}

.blur-in {
  opacity: 0;
  filter: blur(10px);
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.blur-in.active {
  opacity: 1;
  filter: blur(0);
}

.count-up {
  display: inline-block;
}

/* Section Divider */
.section-divider {
  position: relative;
}

.section-divider::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 80px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--brand-gold),
    transparent
  );
}

.float-on-scroll {
  transition: transform 0.3s ease-out;
}

/* ===== SWIPER OVERRIDES ===== */

.swiper-pagination-bullet {
  background: rgba(255, 255, 255, 0.3) !important;
  width: 12px !important;
  height: 12px !important;
  transition: all 0.3s ease !important;
}

.swiper-pagination-bullet-active {
  background: var(--brand-gold) !important;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
  transform: scale(1.3);
}

.counter {
  display: inline-block;
}

/* Noise Texture Overlay */
.noise::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
}

/* Glow Ring */
.glow-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.3);
  animation: rotate 30s linear infinite;
}

/* ===== ANIMATION UTILITIES ===== */

.delay-100 {
  animation-delay: 0.1s;
}
.delay-200 {
  animation-delay: 0.2s;
}
.delay-300 {
  animation-delay: 0.3s;
}
.delay-400 {
  animation-delay: 0.4s;
}
.delay-500 {
  animation-delay: 0.5s;
}
.delay-600 {
  animation-delay: 0.6s;
}
.delay-700 {
  animation-delay: 0.7s;
}

.animate-fill {
  animation-fill-mode: forwards;
  opacity: 0;
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

.animate-scale-in {
  animation: scaleIn 0.6s ease-out forwards;
}

/* ===== MOBILE OPTIMIZATIONS ===== */

/* Mobile-first touch target sizing (40px minimum) */
@media (max-width: 768px) {
  /* Reduce decorative animations on mobile for performance */
  .blob,
  .glow-ring,
  .mesh-bg {
    display: none;
  }

  .particles {
    opacity: 0.2;
    display: none; /* Hide particles on mobile for better FPS */
  }

  /* Improved touch targets */
  .btn-neon,
  button,
  .glass-strong a {
    min-height: 44px;
    min-width: 44px;
  }

  /* Mobile typography scaling */
  h1 {
    font-size: clamp(2rem, 8vw, 3.5rem);
    line-height: 1.1;
  }

  h2 {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
  }

  h3 {
    font-size: clamp(1.25rem, 5vw, 1.75rem);
  }

  /* Reduce padding on mobile */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  section {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  /* Mobile hero section */
  .hero-mobile-text {
    font-size: 2.5rem !important;
  }

  /* Mobile card spacing */
  .glass-strong,
  .card-3d {
    padding: 1.5rem;
  }

  /* Smaller badges on mobile */
  .tracking-\[0\.3em\] {
    letter-spacing: 0.15em;
  }

  /* Footer mobile adjustments */
  footer .grid {
    gap: 2rem;
  }

  /* Stats section mobile */
  .counter {
    font-size: 2rem;
  }

  /* Form inputs - better mobile experience */
  input,
  textarea,
  select {
    font-size: 16px; /* Prevents iOS zoom */
    padding: 0.875rem 1rem;
  }

  /* Mobile menu improvements */
  #mobile-menu {
    padding-bottom: 100px; /* Safe area for bottom nav */
  }

  #mobile-menu a {
    padding: 0.75rem 0;
  }

  /* CTA buttons full width on small mobile */
  .btn-neon {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* Reduce blur effects for performance */
  .blur-3xl,
  .blur-\[100px\],
  .blur-\[80px\] {
    filter: blur(40px);
  }

  /* Hide corner decorations on mobile */
  .border-l-2.border-t-2,
  .border-r-2.border-b-2 {
    display: none;
  }
}

/* Small mobile (< 480px) */
@media (max-width: 480px) {
  h1 {
    font-size: clamp(1.75rem, 10vw, 2.5rem);
  }

  .text-shimmer {
    background-size: 300% auto;
  }

  /* Stack CTA buttons vertically */
  .flex-col.sm\:flex-row {
    gap: 0.75rem;
  }

  /* Smaller hero badge */
  .glass-strong.rounded-full {
    padding: 0.5rem 1rem;
  }

  .glass-strong.rounded-full span {
    font-size: 0.625rem;
  }

  /* Compact navigation padding */
  #navbar {
    padding: 0.75rem 0;
  }

  #navbar > div {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Tablet adjustments (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .container {
    max-width: 95%;
  }

  /* Two-column grids stay 2-column on tablet */
  .lg\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Reduce motion for accessibility */
@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;
  }

  .blob,
  .glow-ring,
  .particles {
    animation: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .text-white\/50,
  .text-white\/60,
  .text-white\/70 {
    opacity: 1;
    color: rgba(255, 255, 255, 0.9);
  }

  .border-white\/5,
  .border-white\/10 {
    border-color: rgba(255, 255, 255, 0.4);
  }
}

/* Safe area for notched devices (iPhone X+) */
@supports (padding-top: env(safe-area-inset-top)) {
  #navbar {
    padding-top: calc(1.25rem + env(safe-area-inset-top));
  }

  footer {
    padding-bottom: calc(2.5rem + env(safe-area-inset-bottom));
  }

  #mobile-menu {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }
}

/* ===== ANIMATED MOBILE MENU ===== */

/* Hamburger Icon */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 20px;
  height: 14px;
  cursor: pointer;
}

/* Ensure mobile menu button stays above overlay */
.mobile-menu-btn {
  position: relative;
  z-index: 10003; /* Higher than mobile menu overlay */
}

.hamburger-line {
  display: block;
  height: 2px;
  width: 100%;
  background-color: currentColor;
  border-radius: 2px;
  transition: all 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6);
  transform-origin: center;
}

/* Hamburger → X Animation */
.mobile-menu-btn.active .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Menu Overlay Animation */
.mobile-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  /* Ensure menu is hidden on initial page load */
  display: none;
  /* Optimize for mobile scrolling */
  -webkit-overflow-scrolling: touch;
  /* Account for iOS safe areas */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-menu.active {
  display: flex;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Staggered Menu Items */
.mobile-menu-item {
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transition-delay: calc(var(--item-index, 0) * 0.08s + 0.1s);
}

.mobile-menu.active .mobile-menu-item {
  opacity: 1;
  transform: translateX(0);
}

/* Menu Links Hover Effect */
.mobile-menu-link {
  position: relative;
  display: block;
}

.mobile-menu-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--brand-gold);
  transition: width 0.3s ease;
}

.mobile-menu-link:hover::after {
  width: 100%;
}

/* Glow effect on hamburger when active */
.mobile-menu-btn.active {
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

/* Smooth body lock - Prevent scroll when menu is open */
body.menu-open {
  overflow: hidden;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile */
  touch-action: none; /* Prevent iOS scroll bounce */
  position: fixed; /* Prevent scroll on iOS */
  width: 100%;
}
