.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 100;
  transition: background-color var(--transition-base), backdrop-filter var(--transition-base), border-bottom var(--transition-base), box-shadow var(--transition-base);
  border-bottom: 1px solid transparent;
}

.header.scrolled {
  background-color: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.header-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-links {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  position: relative;
  padding-bottom: 2px;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background-image: var(--gradient-accent);
  transition: width var(--transition-fast);
}

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

.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  z-index: 101;
}

.mobile-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background-color: var(--text-primary);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.footer {
  padding: var(--space-md) 0 var(--space-sm);
  border-top: 1px solid var(--glass-border);
  background-color: var(--surface-color);
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background-image: var(--gradient-accent);
  opacity: 0.45;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.footer-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-name {
  font-style: italic;
  font-weight: 600;
  background-image: var(--gradient-accent);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.back-to-top {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--accent-color);
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.back-to-top:hover {
  transform: translateY(-5px);
  background-color: var(--surface-color);
  border-color: var(--accent-color);
  box-shadow: var(--shadow-glow);
}

@media (max-width: 860px) {
  .mobile-toggle {
    display: flex;
  }

  .header {
    height: 64px;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: var(--surface-color);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    padding: var(--space-lg);
    transition: right var(--transition-base);
    border-left: 1px solid var(--glass-border);
    box-shadow: -10px 0 40px rgba(0,0,0,0.5);
  }

  .nav-links.open {
    right: 0;
  }

  .nav-links .theme-toggle {
    margin-left: 0;
    margin-top: var(--space-md);
  }
}

body.menu-open {
  overflow: hidden;
}

@media (max-width: 600px) {
  .footer-container {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
}
