.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  pointer-events: none;
}

.header-inner {
  pointer-events: auto;
  margin-inline: auto;
  width: 100%;
  max-width: 80rem;
  padding: 0 1rem;
  transition: max-width 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    padding 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 768px) {
  .header-inner {
    padding-inline: 1.5rem;
  }
}

.header-inner.scrolled {
  max-width: 52rem;
  padding: 0.75rem 0.75rem 0;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  padding-inline: 0.5rem;
  transition: height 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    border-radius 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-inner.scrolled .navbar {
  height: 3rem;
  border-radius: 1rem;
  padding-left: 1rem;
  padding-right: 0.375rem;
  background: color-mix(in srgb, var(--background) 35%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 2px 16px -6px rgba(0, 0, 0, 0.08),
    inset 0 0 0 0.5px var(--ring);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  overflow: hidden;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.desktop-nav {
  display: none;
  align-items: center;
  gap: 0.125rem;
  margin-left: auto;
}

@media (min-width: 640px) {
  .desktop-nav {
    display: flex;
  }
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.25rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--foreground);
  background: var(--accent);
}

.divider {
  width: 1px;
  height: 1rem;
  margin-inline: 0.5rem;
  background: var(--border);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  color: var(--muted-foreground);
  background: transparent;
  transition: color 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  color: var(--foreground);
  background: var(--accent);
}

.lang-wrap {
  position: relative;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  z-index: 60;
  min-width: 10rem;
  padding: 0.25rem;
  border-radius: 0.5rem;
  background: var(--background);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(-0.25rem);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.lang-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lang-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--foreground);
  font-size: 0.8125rem;
  text-align: left;
}

.lang-menu button:hover {
  background: var(--accent);
}

.lang-check {
  display: none;
  width: 0.875rem;
  height: 0.875rem;
  color: var(--primary);
}

.lang-menu button.selected .lang-check {
  display: block;
}

.theme-toggle svg {
  width: 1rem;
  height: 1rem;
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme='dark'] .theme-toggle .icon-sun {
  display: none;
}

[data-theme='dark'] .theme-toggle .icon-moon {
  display: block;
}

.sign-in {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2rem;
  padding: 0 0.875rem;
  border-radius: 0.5rem;
  background: var(--foreground);
  color: var(--background);
  font-size: 0.75rem;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.sign-in:hover {
  opacity: 0.9;
}

.mobile-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

@media (min-width: 640px) {
  .mobile-actions {
    display: none;
  }
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  color: var(--foreground);
  background: transparent;
}

.menu-toggle:hover {
  background: var(--accent);
}

.menu-icon {
  position: relative;
  width: 1rem;
  height: 1rem;
}

.menu-icon span {
  position: absolute;
  left: 0;
  right: 0;
  display: block;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
  transition: transform 0.3s ease, opacity 0.3s ease, top 0.3s ease;
}

.menu-icon span:nth-child(1) {
  top: 3px;
}

.menu-icon span:nth-child(2) {
  top: 7px;
}

.menu-icon span:nth-child(3) {
  top: 11px;
}

.menu-toggle.open .menu-icon span:nth-child(1) {
  top: 7px;
  transform: rotate(45deg);
}

.menu-toggle.open .menu-icon span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle.open .menu-icon span:nth-child(3) {
  top: 7px;
  transform: rotate(-45deg);
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5rem 2rem 2.5rem;
  background: color-mix(in srgb, var(--background) 98%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .mobile-overlay {
    display: none;
  }
}

.mobile-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-nav .nav-link {
  justify-content: flex-start;
  height: auto;
  padding: 0.75rem 0;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.mobile-overlay .sign-in {
  width: 100%;
  height: 2.75rem;
  font-size: 0.875rem;
}
