/* ===== Base & Utilities ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  overflow-x: hidden;
}

::selection {
  background: rgba(245, 158, 11, 0.3);
  color: #faf5ff;
}

/* ===== Scroll Reveal ===== */
.reveal-up {
  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 {
  opacity: 0;
  transform: translateX(-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-right {
  opacity: 0;
  transform: translateX(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-up.visible,
.reveal-left.visible,
.reveal-right.visible {
  opacity: 1;
  transform: translate(0, 0);
}

/* ===== Hero Image Animation ===== */
.hero-img {
  animation: heroZoom 20s ease-in-out infinite alternate;
}

@keyframes heroZoom {
  from { transform: scale(1.05); }
  to { transform: scale(1.15); }
}

.hero-content {
  animation: heroFadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ===== Scroll Line ===== */
.scroll-line {
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; height: 48px; }
  50% { opacity: 1; height: 64px; }
}

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

#navbar.scrolled {
  background: rgba(13, 8, 20, 0.85);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(139, 92, 246, 0.1);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  transition: width 0.3s ease;
  border-radius: 1px;
}

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

/* ===== Mobile Menu ===== */
.mobile-link {
  position: relative;
}

/* ===== Menu Tabs ===== */
.menu-tab {
  display: inline-flex;
  align-items: center;
  padding: 10px 24px;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: 'Inter', system-ui, sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent;
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: #d8b4fe;
}

.menu-tab:hover {
  border-color: rgba(251, 191, 36, 0.4);
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.05);
}

.menu-tab.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: transparent;
  color: #130b1f;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}

/* ===== Menu Panels ===== */
.menu-panel {
  animation: panelFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

#backToTop.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#backToTop:hover {
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
}

/* ===== Decorative Divider ===== */
section::before {
  content: '';
  display: block;
}

/* ===== Image Hover Effects ===== */
.rounded-2xl.overflow-hidden {
  position: relative;
}

.rounded-2xl.overflow-hidden::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 1px solid rgba(139, 92, 246, 0.1);
  pointer-events: none;
  transition: border-color 0.3s ease;
}

.rounded-2xl.overflow-hidden:hover::after {
  border-color: rgba(251, 191, 36, 0.2);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2.75rem;
  }

  #navbar {
    background: rgba(13, 8, 20, 0.9);
    backdrop-filter: blur(20px);
  }
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 70px;
  }

  .hero-content h1 {
    font-size: 2.25rem;
  }
}

/* ===== Focus Styles ===== */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #fbbf24;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal-up,
  .reveal-left,
  .reveal-right {
    opacity: 1;
    transform: none;
  }
}
