/* Shared landing header — pixel-identical to index.html gradient bar + nav */

:root {
  --header-gradient: linear-gradient(to right, #6C31CC, rgb(251, 78, 119));
}

body > header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--header-gradient);
  border-bottom: none;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
  transition:
    transform 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.3s,
    box-shadow 0.38s ease;
  will-change: transform;
}

body > header.header-retracted {
  transform: translateY(-100%);
  box-shadow: none;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  body > header {
    transition-duration: 0.01ms;
  }
}

.header-content {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* No display:block — matches home exactly (avoids vertical misalignment) */
.logo {
  height: 32px;
}

body > header nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

body > header nav a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

body > header nav a:hover {
  color: #fff;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link-icon {
  display: none;
}

.nav-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-shrink: 0;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  flex-shrink: 0;
}

.lang-switch-btn {
  min-width: 2rem;
  padding: 0.28rem 0.45rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  line-height: 1.2;
  transition: background 0.2s, color 0.2s;
}

.lang-switch-btn.is-active {
  background: #fff;
  color: var(--primary, #6c31cc);
}

.lang-switch-btn:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.mobile-menu-toggle {
  display: none;
  position: relative;
  background: var(--bg-secondary, #1e293b);
  border: 1px solid var(--border, #334155);
  width: 36px;
  height: 36px;
  border-radius: 0.5rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text, #f1f5f9);
  flex-direction: column;
  gap: 5px;
  padding: 0;
}

.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
}

body > header .btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  touch-action: manipulation;
}

body > header .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.7);
}

.dark-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
}

.dark-toggle:hover {
  transform: scale(1.1);
}

.dark-toggle svg {
  stroke: currentColor;
  color: inherit;
}

body > header .dark-toggle {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  width: 28px;
  height: 28px;
}

body > header .dark-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

body > header .dark-toggle .icon-svg {
  width: 14px;
  height: 14px;
}

body > header .mobile-menu-toggle {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  width: 36px;
  height: 36px;
  gap: 5px;
}

body > header .mobile-menu-toggle span {
  width: 18px;
}

body > header .mobile-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
}

.icon-svg {
  width: 20px;
  height: 20px;
  fill: none;
}

body.blog-page {
  padding-top: 4.5rem;
}

/* Mobile lang row — mirrors index.html .hero-lang-row */
.blog-lang-row {
  display: none;
  justify-content: center;
  width: 100%;
  margin-bottom: 0.65rem;
}

.lang-switch--hero {
  background: rgba(108, 49, 204, 0.07);
  border-color: var(--border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .lang-switch--hero {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}

.lang-switch--hero .lang-switch-btn {
  color: var(--text-secondary);
}

.lang-switch--hero .lang-switch-btn.is-active {
  background: var(--primary);
  color: #fff;
}

.lang-switch--hero .lang-switch-btn:hover:not(.is-active) {
  background: rgba(108, 49, 204, 0.1);
  color: var(--text);
}

[data-theme="dark"] .lang-switch--hero .lang-switch-btn:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

@media (max-width: 768px) {
  body.blog-page {
    padding-top: 5.25rem;
  }

  .blog-lang-row {
    display: flex;
    margin-bottom: 0;
  }
}

/* ── Mobile — matches home (768px, not 900px) ── */
@media (max-width: 768px) {
  .header-content {
    padding: 1rem;
  }

  .lang-switch--header {
    display: none;
  }

  body > header .nav-actions {
    gap: 0.5rem;
  }

  body > header .nav-actions .btn {
    padding: 0.45rem 0.7rem;
    font-size: 0.8125rem;
  }

  body > header .nav-actions .icon-svg {
    width: 16px;
    height: 16px;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(22, 18, 56, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-top: none;
    border-radius: 0 0 0.9rem 0.9rem;
    box-shadow: 0 14px 34px rgba(2, 8, 23, 0.45);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: 0.5rem 0.75rem 0.75rem;
    gap: 0.2rem;
    display: none;
    z-index: 1100;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.6rem;
    background: transparent;
    border: 1px solid transparent;
    color: #fff;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
  }

  .nav-link-icon {
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    opacity: 0.92;
  }

  .nav-links a:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
  }

  .nav-links a:active {
    background: rgba(255, 255, 255, 0.18);
  }
}
