/* Cyclepro Header Styles */

.cp-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(120deg, rgba(5, 7, 10, 0.98), rgba(11, 16, 24, 0.98));
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cp-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}

/* Brand */
.cp-header__brand {
  display: flex;
  align-items: center;
}

.cp-header__logo-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text);
  text-decoration: none;
}

.cp-header__logo-mark {
  position: relative;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: radial-gradient(circle at 0 0, var(--color-primary) 0, transparent 52%),
              radial-gradient(circle at 100% 100%, #00d0ff 0, transparent 54%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 10px 25px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.cp-header__logo-wheel {
  position: absolute;
  bottom: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(3, 7, 18, 0.9);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.1);
  background: radial-gradient(circle at 30% 20%, #fff 0, #9ca3af 20%, #020617 70%);
}

.cp-header__logo-wheel--front {
  right: 4px;
}

.cp-header__logo-wheel--rear {
  left: 4px;
}

.cp-header__brand-text {
  display: flex;
  flex-direction: column;
}

.cp-header__brand-name {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cp-header__brand-tagline {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* Navigation */
.cp-header__nav {
  flex: 1 1 auto;
}

.cp-header__nav-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  list-style: none;
}

.cp-header__nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0;
  font-size: var(--font-size-sm);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-decoration: none;
}

.cp-header__nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.25rem;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary), #00d0ff);
  transition: width var(--transition-normal);
}

.cp-header__nav-link:hover,
.cp-header__nav-link:focus-visible {
  color: var(--color-text);
}

.cp-header__nav-link:hover::after,
.cp-header__nav-link:focus-visible::after {
  width: 100%;
}

.cp-header__nav-item--accent .cp-header__nav-link--accent {
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(40, 160, 255, 0.5);
  background: radial-gradient(circle at top left, rgba(40, 160, 255, 0.16), transparent 56%);
}

.cp-header__nav-item--accent .cp-header__nav-link--accent::after {
  display: none;
}

.cp-header__nav-item--accent .cp-header__nav-link--accent:hover,
.cp-header__nav-item--accent .cp-header__nav-link--accent:focus-visible {
  background: linear-gradient(135deg, var(--color-primary), #00d0ff);
  color: #020617;
  box-shadow: 0 12px 28px rgba(0, 160, 255, 0.35);
}

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

.cp-header__icon-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: var(--color-text-muted);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.7);
  text-decoration: none;
}

.cp-header__icon-link:hover,
.cp-header__icon-link:focus-visible {
  color: var(--color-text);
  border-color: rgba(56, 189, 248, 0.8);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.85);
}

.cp-header__icon {
  font-size: 0.95rem;
}

/* Mobile toggle */
.cp-header__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: radial-gradient(circle at 0 0, rgba(40, 160, 255, 0.2), rgba(15, 23, 42, 0.96));
  color: var(--color-text);
  cursor: pointer;
}

.cp-header__toggle-box {
  position: relative;
  width: 18px;
  height: 14px;
}

.cp-header__toggle-bar {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background-color: var(--color-text);
  transition: transform var(--transition-normal), opacity var(--transition-fast), top var(--transition-normal), bottom var(--transition-normal);
}

.cp-header__toggle-bar--top {
  top: 0;
}

.cp-header__toggle-bar--middle {
  top: 50%;
  transform: translateY(-50%);
}

.cp-header__toggle-bar--bottom {
  bottom: 0;
}

/* Toggle active state */
.cp-header--menu-open .cp-header__toggle-bar--top {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.cp-header--menu-open .cp-header__toggle-bar--middle {
  opacity: 0;
}

.cp-header--menu-open .cp-header__toggle-bar--bottom {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* Mobile layout */
@media (max-width: 768px) {
  .cp-header__inner {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
  }

  .cp-header__toggle {
    display: inline-flex;
  }

  .cp-header__nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background: radial-gradient(circle at top, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.98));
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    transform-origin: top;
    transform: scaleY(1);
  }

  .cp-header__nav-list {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-3) var(--space-4) var(--space-4);
    gap: var(--space-2);
  }

  .cp-header__nav-link {
    width: 100%;
    padding: 0.4rem 0;
  }

  .cp-header__nav-item--accent .cp-header__nav-link--accent {
    width: 100%;
    justify-content: center;
    margin-top: var(--space-1);
  }

  /* Progressive enhancement: JS will add the hidden class when ready */
  .cp-header__nav.cp-header__nav--hidden {
    display: none;
  }

  .cp-header__actions {
    gap: var(--space-1);
  }
}

/* Medium and up */
@media (min-width: 769px) {
  .cp-header__nav {
    margin-inline: auto;
    max-width: 640px;
  }
}

/* Focus styles refinement */
.cp-header__nav-link:focus-visible,
.cp-header__icon-link:focus-visible,
.cp-header__toggle:focus-visible,
.cp-header__logo-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}
