/* ==========================================================================
   HEADER.CSS — Sticky Header, Navigation & Mobile Menu
   ========================================================================== */

/* ---------- Header ---------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: var(--z-sticky);
  transition: all var(--transition-base);
  border-bottom: 1px solid transparent;
}

.header.scrolled {
  background: var(--bg-header-scroll);
  border-bottom-color: var(--border-color);
  box-shadow: var(--shadow-sm);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* ---------- Logo ---------- */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  z-index: calc(var(--z-sticky) + 1);
}

.logo__icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  color: #ffffff;
}

.logo__icon svg {
  width: 22px;
  height: 22px;
}

.logo__text {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.logo__text span {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Desktop Navigation ---------- */
.nav {
  display: none;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav__link {
  position: relative;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
  border-radius: var(--radius-md);
}

.nav__link:hover,
.nav__link.active {
  color: var(--color-primary);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 20px;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: transform var(--transition-base);
}

.nav__link:hover::after,
.nav__link.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* ---------- Header Actions ---------- */
.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Theme Toggle */
.theme-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  background: var(--bg-section-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  padding: 2px;
}

.theme-toggle:hover {
  border-color: var(--color-primary);
}

.theme-toggle__thumb {
  width: 20px;
  height: 20px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-base);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

[data-theme="dark"] .theme-toggle__thumb {
  transform: translateX(22px);
}

.theme-toggle__thumb svg {
  width: 12px;
  height: 12px;
  color: #ffffff;
}

.theme-toggle__sun,
.theme-toggle__moon {
  display: flex;
}

[data-theme="dark"] .theme-toggle__sun {
  display: none;
}

.theme-toggle__moon {
  display: none;
}

[data-theme="dark"] .theme-toggle__moon {
  display: flex;
}

/* Hire Me Button — hidden on mobile */
.header__cta {
  display: none;
}

/* ---------- Mobile Hamburger ---------- */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  z-index: calc(var(--z-sticky) + 2);
  padding: 0;
  background: none;
  border: none;
}

.hamburger__line {
  display: block;
  width: 100%;
  height: 2.5px;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  transform-origin: center;
}

.hamburger.active .hamburger__line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .hamburger__line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.active .hamburger__line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---------- Mobile Menu ---------- */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(85vw, 380px);
  height: 100vh;
  height: 100dvh;
  background: var(--bg-body);
  z-index: var(--z-sticky);
  padding: calc(var(--header-height) + var(--space-8)) var(--space-8) var(--space-8);
  transition: right var(--transition-slow);
  overflow-y: auto;
  box-shadow: -10px 0 30px rgba(0,0,0,0.1);
}

.mobile-menu.open {
  right: 0;
}

.mobile-menu__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: calc(var(--z-sticky) - 1);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.mobile-menu__overlay.visible {
  opacity: 1;
  visibility: visible;
}

.mobile-menu__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.mobile-menu__link {
  display: block;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-lg);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.mobile-menu__link:hover,
.mobile-menu__link.active {
  background: rgba(var(--color-primary-rgb), 0.08);
  color: var(--color-primary);
}

.mobile-menu__cta {
  margin-top: var(--space-6);
  width: 100%;
  justify-content: center;
}

.mobile-menu__social {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-color);
}

.mobile-menu__social a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  background: var(--bg-section);
  transition: all var(--transition-fast);
}

.mobile-menu__social a:hover {
  background: var(--gradient-primary);
  color: #ffffff;
}

.mobile-menu__social svg {
  width: 18px;
  height: 18px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (min-width: 1024px) {
  .nav {
    display: block;
  }

  .hamburger {
    display: none;
  }

  .mobile-menu,
  .mobile-menu__overlay {
    display: none !important;
  }

  .header__cta {
    display: inline-flex;
  }
}
