/* ========================================
   The Rustic Barn Boutique — Custom Styles
   Premium Dark Luxury Theme
   ======================================== */

/* Base & Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
}

::selection {
  background: rgba(212, 168, 75, 0.3);
  color: #fdfcfa;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0a120a;
}
::-webkit-scrollbar-thumb {
  background: rgba(212, 168, 75, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 168, 75, 0.5);
}

/* Navbar */
#navbar {
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  background: transparent;
}

#navbar.scrolled {
  background: rgba(5, 10, 5, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(212, 168, 75, 0.1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #d4a84b, transparent);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 80%;
}

/* Hero Orbs */
.hero-orb {
  will-change: transform;
}

.orb-1 {
  animation: float1 8s ease-in-out infinite;
}
.orb-2 {
  animation: float2 10s ease-in-out infinite;
}
.orb-3 {
  animation: float3 12s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes float2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-40px, 30px) scale(1.08); }
  66% { transform: translate(25px, -15px) scale(0.92); }
}

@keyframes float3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  33% { transform: translate(-48%, -52%) scale(1.06); }
  66% { transform: translate(-52%, -48%) scale(0.94); }
}

/* Mobile Menu */
#mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

#mobile-menu.closed {
  opacity: 0;
  pointer-events: none;
}

.mobile-link {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

#mobile-menu.open .mobile-link {
  opacity: 1;
  transform: translateY(0);
}

#mobile-menu.open .mobile-link:nth-child(1) { transition-delay: 0.05s; }
#mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(5) { transition-delay: 0.25s; }

/* Hamburger Animation */
#menu-btn.active #bar1 {
  transform: rotate(45deg) translate(4px, 4px);
}
#menu-btn.active #bar2 {
  opacity: 0;
  transform: scaleX(0);
}
#menu-btn.active #bar3 {
  transform: rotate(-45deg) translate(4px, -4px);
  width: 1.5rem;
}

/* Reveal Animations */
.reveal-up,
.reveal-left,
.reveal-right {
  /* Default state: visible (progressive enhancement) */
}

.reveal-up.revealed,
.reveal-left.revealed,
.reveal-right.revealed {
  /* JS adds this class for animation */
}

@media (prefers-reduced-motion: no-preference) {
  .reveal-up {
    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-up.revealed {
    opacity: 1;
    transform: translateY(0);
  }

  .reveal-left {
    opacity: 0;
    transform: translateX(-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-left.revealed {
    opacity: 1;
    transform: translateX(0);
  }

  .reveal-right {
    opacity: 0;
    transform: translateX(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-right.revealed {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Collection cards - ensure content is always visible without JS */
.collection-card {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .collection-card .card-desc {
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
}

/* Form styling */
input:focus,
textarea:focus {
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: rgba(203, 166, 110, 0.2);
}

/* Gold shimmer effect on hover for CTA buttons */
button:hover,
a:hover {
  cursor: pointer;
}

/* Ensure all text has proper contrast */
.text-cream-300\/60,
.text-cream-400\/50,
.text-cream-400\/40,
.text-cream-500\/30,
.text-cream-500\/20 {
  /* These are Tailwind opacity utilities layered on cream colors */
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid rgba(212, 168, 75, 0.6);
  outline-offset: 2px;
}

/* Smooth image loading */
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Print styles */
@media print {
  #navbar,
  #contact-form,
  .hero-orb {
    display: none !important;
  }
  body {
    background: white !important;
    color: black !important;
  }
}
