/* ========== BASE & RESET ========== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========== SCROLL INDICATOR ========== */
.scroll-indicator {
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(8px); opacity: 0.5; }
}

/* ========== NAVBAR SCROLL STATE ========== */
#navbar.scrolled {
  background: rgba(12, 19, 32, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-link {
  position: relative;
}

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

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

.nav-link:hover {
  color: #fff !important;
}

/* ========== MOBILE MENU ========== */
#mobile-menu {
  animation: slideDown 0.3s ease;
}

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

.mobile-link {
  position: relative;
}

.mobile-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 60%;
  background: rgba(94, 234, 212, 0.15);
  border-radius: 6px;
  transition: width 0.2s ease;
}

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

/* ========== HERO REVEAL ========== */
.reveal-hero {
  opacity: 1;
  transform: none;
  animation: heroReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

/* ========== SCROLL REVEAL (below fold) ========== */
.reveal {
  opacity: 1;
  transform: none;
}

.reveal.fade-up {
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Default state: already visible (progressive enhancement) */
.reveal.fade-up {
  opacity: 1;
  transform: translateY(0);
}

/* Only apply hidden state if JS adds the class */
.reveal.fade-up.reveal-hidden {
  opacity: 0;
  transform: translateY(30px);
}

.reveal.fade-up.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== MENU TABS ========== */
.menu-tab {
  background: transparent;
  color: #94a3b8;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.menu-tab.active {
  background: #0d9488;
  color: #fff;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.menu-tab:not(.active):hover {
  background: #f1f5f9;
  color: #1e293b;
}

.menu-content {
  animation: fadeIn 0.4s ease;
}

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

/* ========== BUTTON HOVER EFFECTS ========== */
a[href="#menu"], a[href="#contact"], button[type="submit"] {
  position: relative;
  overflow: hidden;
}

a[href="#menu"]::before,
a[href="#contact"]::before,
button[type="submit"]::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}

a[href="#menu"]:hover::before,
a[href="#contact"]:hover::before,
button[type="submit"]:hover::before {
  width: 300px;
  height: 300px;
}

/* ========== SECTION DIVIDER ========== */
section + section::before {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(13, 148, 136, 0.2), transparent);
  max-width: 600px;
  margin: 0 auto;
}

/* ========== FORM FOCUS STATES ========== */
input:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* ========== ACCESSIBILITY ========== */
@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;
  }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 767px) {
  .font-display {
    font-size: 2.25rem;
    line-height: 1.1;
  }

  #hero h1 {
    font-size: 2.75rem;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  #hero h1 {
    font-size: 4rem;
  }
}

/* ========== SELECTION ========== */
::selection {
  background: rgba(13, 148, 136, 0.2);
  color: #0f172a;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #0f172a;
}

::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #334155;
}
