/* ============================================
   SPoT Coffee — Dash's Klein
   Custom Styles
   ============================================ */

/* --- Base & Utilities --- */
html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

::selection {
  background: rgba(200, 148, 74, 0.3);
  color: #FDF8F0;
}

/* --- Scroll Reveal (progressive enhancement) --- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .reveal.revealed {
    opacity: 1;
    transform: translateY(0);
  }

  .reveal:nth-child(2) { transition-delay: 0.1s; }
  .reveal:nth-child(3) { transition-delay: 0.2s; }
  .reveal:nth-child(4) { transition-delay: 0.3s; }
}

/* --- Floating Cards Animation --- */
@media (prefers-reduced-motion: no-preference) {
  .floating-card-1 {
    animation: float1 6s ease-in-out infinite;
  }

  .floating-card-2 {
    animation: float2 7s ease-in-out infinite;
  }

  .floating-card-3 {
    animation: float3 5s ease-in-out infinite;
  }
}

@keyframes float1 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}

@keyframes float2 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-16px) rotate(-1deg); }
}

@keyframes float3 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(0.5deg); }
}

/* --- Navbar Transition --- */
#navbar.scrolled {
  background: rgba(5, 15, 11, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(212, 165, 116, 0.1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

#navbar.scrolled .menu-line {
  background: #FDF8F0;
}

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

#mobile-menu.open .mobile-link {
  animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Hamburger Animation --- */
.menu-btn.active .menu-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-btn.active .menu-line:nth-child(2) {
  opacity: 0;
}

.menu-btn.active .menu-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
  width: 1.25rem;
}

/* --- Menu Card Hover --- */
.group:hover .group-hover\:scale-110 {
  transform: scale(1.1);
}

/* --- Button Focus States --- */
a:focus-visible, button:focus-visible {
  outline: 2px solid #D4A574;
  outline-offset: 2px;
  border-radius: 0.5rem;
}

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

::-webkit-scrollbar-track {
  background: #050f0b;
}

::-webkit-scrollbar-thumb {
  background: rgba(212, 165, 116, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 165, 116, 0.5);
}

/* --- Image Loading --- */
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
  .floating-card-1,
  .floating-card-2,
  .floating-card-3 {
    display: none;
  }
}
