/* ========================================
   Zooberg MD — Custom Styles
   ======================================== */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #faf9f6;
}
::-webkit-scrollbar-thumb {
  background: #d4cdc0;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #b8ada0;
}

/* Selection color */
::selection {
  background: #f2b9ad;
  color: #4d2622;
}

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

/* Navbar transition */
#navbar {
  transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
  background-color: rgba(254, 254, 254, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

/* Nav link underline animation */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: #C1665B;
  transition: width 0.3s ease;
}
.nav-link:hover::after {
  width: 100%;
}

/* Mobile menu */
#mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}
.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) {
  width: 20px;
  transform: rotate(-45deg) translate(3px, -3px);
}

/* Mobile link animation */
.mobile-link {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 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; }

/* Scroll reveal — progressive enhancement, only when JS runs */
@media (prefers-reduced-motion: no-preference) {
  .scroll-reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* Image hover zoom */
.group:hover img {
  transform: scale(1.03);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.group img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Floating cards */
.absolute > div {
  animation: float 6s ease-in-out infinite;
}
.absolute > div:nth-child(2) {
  animation-delay: -2s;
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

/* Focus styles */
input:focus, textarea:focus, button:focus {
  outline: none;
}

/* Button ripple effect */
button {
  position: relative;
  overflow: hidden;
}
