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

body {
  overflow-x: hidden;
}

::selection {
  background: rgba(255, 107, 91, 0.2);
  color: #16171C;
}

/* ── Blob Animations ── */
@keyframes blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -50px) scale(1.1); }
  50% { transform: translate(-20px, 20px) scale(0.9); }
  75% { transform: translate(20px, 50px) scale(1.05); }
}

.animate-blob {
  animation: blob 7s ease-in-out infinite;
}

.animation-delay-2000 {
  animation-delay: 2s;
}

.animation-delay-4000 {
  animation-delay: 4s;
}

/* ── Float Animation ── */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

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

.animation-delay-2000 {
  animation-delay: 2s;
}

/* ── Header Scroll State ── */
#header.scrolled {
  background: rgba(255, 249, 245, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06), 0 4px 20px rgba(0,0,0,0.04);
}

#header.scrolled .nav-link {
  color: #464754;
}

#header.scrolled .nav-link:hover {
  color: #FF6B6B;
}

#header.scrolled .logo-text {
  color: #16171C;
}

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

/* Hamburger animation */
#bar1.open {
  transform: translateY(4px) rotate(45deg);
}

#bar2.open {
  opacity: 0;
  transform: scaleX(0);
}

#bar3.open {
  transform: translateY(-4px) rotate(-45deg);
}

/* ── Scroll Reveal ── */
.scroll-reveal {
  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);
}

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

.scroll-reveal.revealed:nth-child(2) { transition-delay: 100ms; }
.scroll-reveal.revealed:nth-child(3) { transition-delay: 200ms; }
.scroll-reveal.revealed:nth-child(4) { transition-delay: 300ms; }

/* ── Hero Elements Animation ── */
.hero-elem {
  opacity: 0;
  transform: translateY(30px);
  animation: heroReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-elem:nth-child(1) { animation-delay: 0.1s; }
.hero-elem:nth-child(2) { animation-delay: 0.25s; }
.hero-elem:nth-child(3) { animation-delay: 0.4s; }
.hero-elem:nth-child(4) { animation-delay: 0.55s; }
.hero-elem:nth-child(5) { animation-delay: 0.7s; }

@keyframes heroReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Nav Links ── */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, #FF6B6B, #B070FF);
  border-radius: 1px;
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

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

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

::-webkit-scrollbar-track {
  background: #FFF9F5;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #FFB8AD, #DDC9FF);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #FF8A7E, #C8A3FF);
}

/* ── Input autofill override ── */
input:-webkit-autofill,
textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px rgba(255,255,255,0.1) inset !important;
  -webkit-text-fill-color: #fff !important;
}

/* ── Focus visible ── */
*:focus-visible {
  outline: 2px solid #FF6B6B;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Responsive tweaks ── */
@media (max-width: 640px) {
  .hero-elem {
    animation-duration: 0.6s;
  }
}
