@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  html {
    scroll-behavior: auto; /* Using Lenis for smooth scroll */
  }

  body {
    @apply bg-brand-dark text-white font-sans antialiased;
    overflow-x: hidden;
  }

  h1, h2, h3, h4, h5, h6 {
    @apply font-display;
  }

  /* Improve text rendering */
  * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

@layer components {
  .btn-primary {
    @apply inline-flex items-center justify-center px-8 py-4 text-base font-semibold uppercase tracking-wider text-brand-dark bg-brand-gold hover:bg-brand-gold-light transition-all duration-300;
  }

  .btn-secondary {
    @apply inline-flex items-center justify-center px-8 py-4 text-base font-semibold uppercase tracking-wider text-white border-2 border-white hover:bg-white hover:text-brand-dark transition-all duration-300;
  }

  .section-padding {
    @apply py-20 md:py-32 px-6 md:px-12;
  }

  .container-narrow {
    @apply max-w-5xl mx-auto px-6;
  }

  .container-wide {
    @apply max-w-7xl mx-auto px-6 md:px-12;
  }

  .text-gradient {
    @apply bg-gradient-to-r from-brand-gold to-brand-gold-light bg-clip-text text-transparent;
  }

  /* Premium glass effect */
  .glass {
    @apply bg-white/5 backdrop-blur-xl border border-white/10;
  }

  /* Magnetic hover effect indicator */
  [data-cursor-hover] {
    cursor: none;
  }
}

@layer utilities {
  .text-balance {
    text-wrap: balance;
  }

  .perspective-1000 {
    perspective: 1000px;
  }

  .preserve-3d {
    transform-style: preserve-3d;
  }
}

/* Custom scrollbar - minimal */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  @apply bg-brand-dark;
}

::-webkit-scrollbar-thumb {
  @apply bg-brand-gold/30 rounded-full;
}

::-webkit-scrollbar-thumb:hover {
  @apply bg-brand-gold/50;
}

/* Selection */
::selection {
  @apply bg-brand-gold/30 text-white;
}

/* Lenis smooth scroll adjustments */
html.lenis {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

/* Loading animation for page */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Grain animation */
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -10%); }
  20% { transform: translate(-15%, 5%); }
  30% { transform: translate(7%, -25%); }
  40% { transform: translate(-5%, 25%); }
  50% { transform: translate(-15%, 10%); }
  60% { transform: translate(15%, 0%); }
  70% { transform: translate(0%, 15%); }
  80% { transform: translate(3%, 35%); }
  90% { transform: translate(-10%, 10%); }
}

/* Focus states for accessibility */
button:focus-visible,
a:focus-visible {
  @apply outline-none ring-2 ring-brand-gold ring-offset-2 ring-offset-brand-dark;
}

/* Reduced motion preferences */
@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;
  }
}
