/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

/* Custom properties */
:root {
  --coral: #E07A5F;
  --coral-light: #fbcfb9;
  --charcoal: #3D405B;
  --charcoal-dark: #1e1f2b;
  --cream: #FEFCFA;
}

/* Scroll reveal base — progressive enhancement, hidden by default */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal:nth-child(4) { transition-delay: 0.24s; }
.reveal:nth-child(5) { transition-delay: 0.32s; }

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .beer-card,
  .event-card,
  .floating-card-1,
  .floating-card-2,
  .floating-card-3,
  .floating-card-4 {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

/* Floating card animations */
@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 5.5s ease-in-out infinite;
  }
  .floating-card-4 {
    animation: float4 6.5s ease-in-out infinite;
  }
}

@keyframes float1 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(0.5deg); }
}
@keyframes float2 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(-0.5deg); }
}
@keyframes float3 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(0.5deg); }
}
@keyframes float4 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(-0.5deg); }
}

/* Beer cards */
.beer-card {
  transform: translateY(0);
}
.beer-card:hover {
  transform: translateY(-4px);
}

/* Event cards */
.event-card {
  transform: translateY(0);
}
.event-card:hover {
  transform: translateY(-4px);
}

/* Header scroll state */
#site-header.scrolled {
  background: rgba(254, 252, 250, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(61, 64, 91, 0.08), 0 4px 20px rgba(61, 64, 91, 0.06);
}

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

/* Nav link underline animation */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--coral);
  border-radius: 1px;
  transition: width 0.25s ease, left 0.25s ease;
}
.nav-link:hover::after {
  width: calc(100% - 16px);
  left: 8px;
}

/* Mobile nav links */
.mobile-nav-link {
  position: relative;
}

/* Smooth focus styles */
:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Selection */
::selection {
  background: rgba(224, 122, 95, 0.2);
  color: var(--charcoal);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--cream);
}
::-webkit-scrollbar-thumb {
  background: var(--charcoal);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--coral);
}

/* Reduced motion for floating cards */
@media (prefers-reduced-motion: reduce) {
  .floating-card-1,
  .floating-card-2,
  .floating-card-3,
  .floating-card-4 {
    animation: none;
  }
}
