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

body {
  overflow-x: hidden;
}

::selection {
  background: #f9c5cf;
  color: #5c1f2b;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #FDF8F5;
}
::-webkit-scrollbar-thumb {
  background: #f497a8;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #d43f5c;
}

/* ─── Header ─── */
#site-header {
  background: rgba(253, 248, 245, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(244, 151, 168, 0.15);
  transition: box-shadow 0.4s ease, background 0.4s ease;
}

#site-header.scrolled {
  background: rgba(253, 248, 245, 0.95);
  box-shadow: 0 1px 20px rgba(123, 45, 59, 0.06);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 1.5px;
  background: #7B2D3B;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

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

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

#mobile-menu.closed {
  opacity: 0;
  pointer-events: none;
}

.menu-line {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ─── Hero ─── */
.hero-eyebrow {
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.2s;
}

.hero-title {
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.4s;
}

.hero-subtitle {
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.6s;
}

.hero-cta {
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.8s;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, #f497a8, transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(0.7); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ─── Buttons ─── */
.btn-primary, .btn-secondary {
  position: relative;
  overflow: hidden;
}

.btn-primary::before, .btn-secondary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary:hover::before, .btn-secondary:hover::before {
  opacity: 1;
}

/* ─── Section Eyebrow ─── */
.section-eyebrow {
  letter-spacing: 0.2em;
}

/* ─── Reveal Animations ─── */
.reveal-up,
.reveal-left,
.reveal-right {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-up {
  transform: translateY(40px);
}

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

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

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

/* ─── Card Group Stagger ─── */
.card-group {
  transition-delay: 0ms;
}

.card-group:nth-child(2) { transition-delay: 100ms; }
.card-group:nth-child(3) { transition-delay: 200ms; }

/* ─── Decorative Dots ─── */
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.4; }
  50% { transform: translateY(-12px) scale(1.1); opacity: 0.7; }
}

/* ─── Form ─── */
input:focus, textarea:focus {
  border-color: #f497a8 !important;
  box-shadow: 0 0 0 3px rgba(244, 151, 168, 0.2) !important;
}

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

/* ─── Keyframes ─── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .hero-title {
    font-size: 3.25rem;
  }

  #space .card-group {
    transition-delay: 0ms !important;
  }
}

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