/* Header styles for Energonya */

.eg-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(90deg, #050b18 0%, #0c1224 50%, #050b18 100%);
  color: #f9fafb;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  backdrop-filter: blur(16px);
}

.eg-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.eg-header__brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.eg-header__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.eg-header__logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 0.9rem;
  background: radial-gradient(circle at 30% 20%, #4ade80 0, #22c55e 40%, #0ea5e9 75%, #1e293b 100%);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.45), 0 10px 25px rgba(15, 23, 42, 0.9);
}

.eg-header__logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.eg-header__logo-main {
  font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
}

.eg-header__logo-sub {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.7rem;
  color: #9ca3af;
}

/* Navigation */

.eg-header__nav {
  display: flex;
}

.eg-header__nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.eg-header__nav-item {
  position: relative;
}

.eg-header__nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: #e5e7eb;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.eg-header__nav-link::after {
  content: "";
  position: absolute;
  inset: 0.12rem;
  border-radius: inherit;
  border: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.eg-header__nav-link:hover,
.eg-header__nav-link:focus-visible {
  background: radial-gradient(circle at top, rgba(45, 212, 191, 0.18), transparent 60%);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.55);
}

.eg-header__nav-link:focus-visible {
  outline: 2px solid #22c55e;
  outline-offset: 2px;
}

.eg-header__nav-item--highlight .eg-header__nav-link {
  background: linear-gradient(135deg, #22c55e, #0ea5e9);
  color: #020617;
  box-shadow: 0 10px 25px rgba(34, 197, 94, 0.35);
}

.eg-header__nav-item--highlight .eg-header__nav-link:hover,
.eg-header__nav-item--highlight .eg-header__nav-link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(34, 197, 94, 0.45);
}

/* Mobile toggle */

.eg-header__toggle {
  display: none;
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.65);
  background: rgba(15, 23, 42, 0.85);
  cursor: pointer;
  padding: 0;
  justify-content: center;
  align-items: center;
  gap: 0.2rem;
  transition: background-color 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.eg-header__toggle:hover,
.eg-header__toggle:focus-visible {
  background: rgba(15, 23, 42, 1);
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.6);
}

.eg-header__toggle:focus-visible {
  outline: 2px solid #22c55e;
  outline-offset: 3px;
}

.eg-header__toggle-bar {
  width: 1.25rem;
  height: 2px;
  border-radius: 999px;
  background-color: #e5e7eb;
  transition: transform 0.16s ease, opacity 0.16s ease, background-color 0.16s ease;
}

.eg-header__toggle[aria-expanded="true"] .eg-header__toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.eg-header__toggle[aria-expanded="true"] .eg-header__toggle-bar:nth-child(2) {
  opacity: 0;
}

.eg-header__toggle[aria-expanded="true"] .eg-header__toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile layout */

@media (max-width: 768px) {
  .eg-header__inner {
    padding-inline: 1rem;
  }

  .eg-header__toggle {
    display: inline-flex;
    flex-direction: column;
  }

  .eg-header__nav {
    position: absolute;
    inset-inline: 0.75rem;
    top: 100%;
    margin-top: 0.5rem;
    background: rgba(15, 23, 42, 0.98);
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.9);
    transform-origin: top;
    transform: scaleY(1);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  }

  .eg-header__nav-list {
    flex-direction: column;
    align-items: stretch;
    padding: 0.6rem;
  }

  .eg-header__nav-link {
    width: 100%;
    justify-content: flex-start;
    padding-block: 0.7rem;
  }

  .eg-header__nav--closed {
    opacity: 0;
    transform: scaleY(0.9);
    visibility: hidden;
  }
}

/* Desktop layout */

@media (min-width: 769px) {
  .eg-header__nav {
    position: static;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .eg-header__nav-list {
    gap: 0.4rem;
  }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  .eg-header,
  .eg-header * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
