/* ============================================
   Pud's Cup Of Mud — Custom Styles
   ============================================ */

/* Base & Typography */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
}

::selection {
  background-color: #7B1928;
  color: #FFF8F0;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #FFF8F0;
}
::-webkit-scrollbar-thumb {
  background: #7B1928;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #641522;
}

/* ============================================
   Navigation
   ============================================ */
#navbar {
  background: transparent;
  transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
  background: rgba(255, 248, 240, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(123, 25, 40, 0.08);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #7B1928;
  transition: width 0.3s ease;
}

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

.nav-link:hover {
  color: #7B1928 !important;
}

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

#mobile-menu.open .mobile-nav-link {
  animation: slideIn 0.4s ease forwards;
  opacity: 0;
}

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

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

.menu-line {
  transition: all 0.3s ease;
}

#menu-toggle.active .menu-line:nth-child(1) {
  transform: rotate(45deg) translate(3px, 3px);
}
#menu-toggle.active .menu-line:nth-child(2) {
  opacity: 0;
}
#menu-toggle.active .menu-line:nth-child(3) {
  transform: rotate(-45deg) translate(3px, -3px);
  width: 1.25rem;
}

/* ============================================
   Buttons
   ============================================ */
.btn-primary {
  background: #7B1928;
  color: #FFF8F0;
  border: 2px solid #7B1928;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,248,240,0.15), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  background: #641522;
  border-color: #641522;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(123, 25, 40, 0.3);
  color: #FFF8F0;
}

.btn-secondary {
  background: transparent;
  color: #7B1928;
  border: 2px solid #7B1928;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: #7B1928;
  color: #FFF8F0;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(123, 25, 40, 0.2);
}

/* ============================================
   Hero Section
   ============================================ */
.hero-pattern {
  background-image: radial-gradient(circle at 2px 2px, #7B1928 1px, transparent 0);
  background-size: 40px 40px;
}

/* ============================================
   Product Cards
   ============================================ */
.product-card {
  transition: transform 0.4s ease, box-shadow 0.4s ease, background 0.4s ease;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.product-pattern {
  background-image: 
    radial-gradient(circle at 25% 25%, #F5E6D3 1px, transparent 1px),
    radial-gradient(circle at 75% 75%, #F5E6D3 1px, transparent 1px);
  background-size: 60px 60px;
}

.contact-pattern {
  background-image: radial-gradient(circle at 2px 2px, #F5E6D3 1px, transparent 0);
  background-size: 32px 32px;
}

/* ============================================
   Reveal Animations
   ============================================ */
.reveal-up,
.reveal-left,
.reveal-right,
.reveal-scale {
  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-left {
  transform: translateX(-40px);
}

.reveal-right {
  transform: translateX(40px);
}

.reveal-scale {
  transform: scale(0.95);
}

.reveal-up.visible,
.reveal-left.visible,
.reveal-right.visible,
.reveal-scale.visible {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* ============================================
   Back to Top
   ============================================ */
#back-to-top {
  transition: opacity 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
}

#back-to-top.visible {
  opacity: 1;
  pointer-events: all;
}

#back-to-top:hover {
  box-shadow: 0 8px 25px rgba(123, 25, 40, 0.4);
}

/* ============================================
   Form Styles
   ============================================ */
input:focus,
textarea:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(123, 25, 40, 0.1);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .font-serif {
    word-spacing: -0.02em;
  }
}

@media (max-width: 640px) {
  #hero h1 {
    font-size: 2.75rem;
  }
}
