/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 1000;

  background: linear-gradient(90deg, rgba(80, 80, 80, 0.45), rgba(130, 130, 130, 0.45));
  backdrop-filter: saturate(100%) blur(10px);
  -webkit-backdrop-filter: saturate(100%) blur(10px);

  border-bottom: 2px solid rgba(150, 150, 150, 0.4);
  box-shadow: 0 4px 12px rgba(70, 70, 70, 0.12);

  padding: 0.6rem 0;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;

  display: flex;
  justify-content: center;
  align-items: center;
  will-change: backdrop-filter, background-color, box-shadow;
}

/* Header on scroll */
header.scrolled {
  background: linear-gradient(90deg, rgba(50, 50, 50, 0.7), rgba(100, 100, 100, 0.7));
  border-color: rgba(100, 100, 100, 0.7);
  box-shadow: 0 6px 22px rgba(100, 100, 100, 0.25);
  transform: translateZ(0);
}

/* Inner header */
.header__inner {
  width: 100%;
  max-width: 1300px;
  height: 4.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  user-select: none;
  position: relative;
}

/* Logo */
.logo img {
  max-height: 3.6rem;
  border-radius: 50px;
  filter: grayscale(100%) brightness(85%);
  transition: filter 0.3s ease, box-shadow 0.35s ease;
}

.logo:hover,
.logo:focus {
  filter: none;
  transform: none;
  outline: none;
  box-shadow: none;
}


/* Navigation */
nav {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  padding: 1.1rem 2rem;
  transition: padding 0.3s ease;
  font-weight: 600;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  position: relative;
  z-index: 10;
  flex-wrap: nowrap;
  will-change: padding, gap;
}

/* Navigation links */
nav a {
  position: relative;
  text-decoration: none;
  color: #ddd;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  padding: 0.3rem 0;
  border-bottom: 3px solid transparent;
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.25s ease, text-shadow 0.3s ease;
  user-select: none;
  cursor: pointer;
  outline-offset: 3px;
}

/* Glow on hover/focus */
nav a::before {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 6px rgba(255 255 255 / 0.15);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: 4px;
}

nav a:hover,
nav a:focus {
  color: #aaa;
  border-bottom-color: #aaa;
  outline: none;
  transform: scale(1.12);
  text-shadow: 0 0 6px rgba(170, 170, 170, 0.6);
}

nav a:active {
  transform: scale(1.1);
  transition: transform 0.1s ease;
}

/* Underline animation */
nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, #aaa, transparent);
  border-radius: 3px;
  transform: translateX(-50%);
  transition: width 0.3s ease;
  opacity: 0.6;
  pointer-events: none;
}

nav a:hover::after,
nav a:focus::after {
  width: 65%;
  opacity: 1;
}

/* Focus visible */
nav a:focus-visible {
  outline: none;
  box-shadow: 0 0 12px #aaa7;
  border-radius: 5px;
  background: rgba(170, 170, 170, 0.12);
  transition: background 0.3s ease, box-shadow 0.4s ease;
}
