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

body {
  overflow-x: hidden;
}

::selection {
  background: color-mix(in srgb, #0d9488 30%, transparent);
  color: #0f172a;
}

/* ===== NAVBAR ===== */
#navbar {
  background: transparent;
  transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

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

.nav-logo-text {
  transition: color 0.4s ease;
}

#navbar.scrolled .nav-logo-text {
  color: #f8fafc;
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: #5eead4;
  transition: width 0.25s ease, left 0.25s ease;
  border-radius: 1px;
}

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

/* ===== MOBILE MENU ===== */
.mobile-nav-link {
  position: relative;
  padding-left: 0;
}

.mobile-nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 100%;
  background: color-mix(in srgb, #0d9488 10%, transparent);
  border-radius: 8px;
  transition: width 0.2s ease;
}

.mobile-nav-link:hover::before {
  width: calc(100% + 16px);
  left: -8px;
}

#mobile-menu {
  animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== FLOATING ANIMATIONS ===== */
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

@keyframes float-delay {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-16px) scale(1.03); }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-float-delay {
  animation: float-delay 7s ease-in-out infinite 1.5s;
}

/* ===== SCROLL REVEAL ===== */
.scroll-reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Staggered delays for grid children */
.scroll-reveal:nth-child(1) { transition-delay: 0.05s; }
.scroll-reveal:nth-child(2) { transition-delay: 0.12s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.19s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.26s; }
.scroll-reveal:nth-child(5) { transition-delay: 0.33s; }
.scroll-reveal:nth-child(6) { transition-delay: 0.40s; }

/* ===== PRODUCT CARDS ===== */
.group:hover .group-hover\:scale-105 {
  transform: scale(1.05);
}

/* ===== BUTTONS ===== */
a, button {
  -webkit-tap-highlight-color: transparent;
}

/* ===== FORM ===== */
input:focus, textarea:focus {
  background: #fff;
  border-color: #0d9488;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .font-display {
    font-size: clamp(2rem, 8vw, 3rem);
  }
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .scroll-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .animate-float,
  .animate-float-delay {
    animation: none;
  }
}
