/* === Header === */
.navbar {
  position: sticky;
  top: 0;
  width: 100%;
  background: var(--color-bg);
  z-index: 1000;
  border-bottom: 1px solid rgba(0, 247, 255, 0.08);
  transition: background 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.navbar.scrolled {
  background: rgba(11, 13, 16, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 28px rgba(0, 247, 255, 0.07);
  border-bottom-color: rgba(0, 247, 255, 0.16);
}

/* === Layout Container === */
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
}

/* === Branding === */
.logo {
  flex: 0 0 auto;
}

.animated-logo {
  max-height: 54px;
  height: auto;
  width: auto;
  display: block;
  opacity: 0;
  animation: logoSlideIn 0.5s ease 0.05s forwards;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.logo:hover .animated-logo {
  transform: scale(1.06);
  filter: drop-shadow(0 0 10px rgba(0, 247, 255, 0.35));
}

@keyframes logoSlideIn {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* === Desktop Navigation === */
.nav-links {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.nav-links ul {
  list-style: none;
  display: flex;
  gap: clamp(0.6rem, 2vw, 2.2rem);
  padding: 0;
  margin: 0;
}

.nav-links ul li {
  opacity: 0;
  animation: navItemIn 0.4s ease forwards;
}
.nav-links ul li:nth-child(1) { animation-delay: 0.08s; }
.nav-links ul li:nth-child(2) { animation-delay: 0.14s; }
.nav-links ul li:nth-child(3) { animation-delay: 0.20s; }
.nav-links ul li:nth-child(4) { animation-delay: 0.26s; }
.nav-links ul li:nth-child(5) { animation-delay: 0.32s; }
.nav-links ul li:nth-child(6) { animation-delay: 0.38s; }
.nav-links ul li:nth-child(7) { animation-delay: 0.44s; }

@keyframes navItemIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-link {
  color: var(--color-light);
  text-decoration: none;
  position: relative;
  font-weight: 600;
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  white-space: nowrap;
  padding: 0.5rem 0;
  transition: color 0.25s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background: var(--color-accent);
  border-radius: 2px;
  transition: width 0.28s ease;
}

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

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

.nav-link.active {
  color: var(--color-accent);
}

.nav-link.active::after {
  width: 100%;
  box-shadow: 0 0 8px rgba(0, 247, 255, 0.45);
}

/* === Language Switcher === */
.lang-switcher-container {
  position: relative;
  display: inline-block;
  margin-left: auto;
  margin-right: 0.5rem;
  z-index: 1001;
  opacity: 0;
  animation: langToggleFadeIn 0.4s ease 0.35s forwards;
}

@keyframes langToggleFadeIn {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.lang-switcher-toggle {
  background: transparent;
  border: 1px solid rgba(0, 247, 255, 0.18);
  color: var(--color-light);
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.lang-switcher-toggle:hover {
  background: rgba(0, 247, 255, 0.08);
  border-color: rgba(0, 247, 255, 0.35);
  color: var(--color-accent);
}

.lang-switcher-toggle::after {
  content: "▾";
  font-size: 0.75rem;
  transition: transform 0.25s ease;
  display: inline-block;
}

.lang-switcher-toggle.active {
  color: var(--color-accent);
  border-color: rgba(0, 247, 255, 0.35);
}

.lang-switcher-toggle.active::after {
  transform: rotate(180deg);
}

.lang-switcher {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--color-secondary);
  border-radius: var(--border-radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 247, 255, 0.14);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 110px;
  z-index: 1002;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

.lang-switcher.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.lang {
  padding: 0.45rem 0.9rem;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--color-light);
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.88rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.lang:hover {
  background: rgba(0, 247, 255, 0.1);
  color: var(--color-accent);
}

.lang.active {
  color: var(--color-accent);
  background: rgba(0, 247, 255, 0.12);
  font-weight: 700;
}

/* === Burger Button (Mobile) === */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid rgba(0, 247, 255, 0.18);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  padding: 0;
  z-index: 999;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.burger:hover {
  border-color: rgba(0, 247, 255, 0.4);
  background: rgba(0, 247, 255, 0.06);
}

.burger-line {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--color-light);
  border-radius: 2px;
  position: absolute;
  transition: transform 0.28s ease, opacity 0.2s ease, top 0.28s ease, background 0.25s ease;
}

.top-line    { top: 11px; }
.middle-line { top: 17px; }
.bottom-line { top: 23px; }

.burger.active .burger-line  { background: var(--color-accent); }
.burger.active .top-line     { transform: rotate(45deg);  top: 17px; }
.burger.active .middle-line  { opacity: 0; transform: scaleX(0); }
.burger.active .bottom-line  { transform: rotate(-45deg); top: 17px; }

/* === Mobile Backdrop === */
.mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  /* Must be above navbar (z-index:1000) so navbar backdrop-filter
     doesn't swallow the backdrop into its compositing layer */
  z-index: 1010;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s ease, visibility 0.32s;
}

.mobile-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* === Drawer === */
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100vh;
  background: #0d1017;
  border-left: 1px solid rgba(0, 247, 255, 0.1);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.5);
  /* Above navbar (z-index:1000) AND above backdrop (z-index:1010) */
  z-index: 1020;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  transform: translateX(100%);
  /* visibility: hidden removes the element from hit-testing and layout
     and—unlike overflow:hidden—actually hides fixed-position elements
     from contributing to scroll width. Delayed to wait for slide-out. */
  visibility: hidden;
  pointer-events: none;
  transition:
    transform 0.36s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 0.36s;
}

.mobile-menu.active {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  transition:
    transform 0.36s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 0s;
}

/* Drawer header */
.mm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.mm-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--color-text);
  letter-spacing: 0.6px;
}

.mm-close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--color-light);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}

.mm-close:hover {
  background: rgba(0, 247, 255, 0.1);
  border-color: rgba(0, 247, 255, 0.35);
  color: var(--color-accent);
}

/* Section label */
.mm-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--color-light);
  opacity: 0.38;
  margin-bottom: 0.5rem;
}

/* Nav */
.mm-nav {
  padding: 1.4rem 1.4rem 0.8rem;
  flex-shrink: 0;
}

.mm-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.mm-nav .nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-light);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: color 0.22s, padding-left 0.22s;
}

.mm-nav .nav-link:hover,
.mm-nav .nav-link.active {
  color: var(--color-accent);
  padding-left: 0.5rem;
}

/* Stagger animation for nav items */
.mm-nav ul li {
  opacity: 0;
  transform: translateX(14px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-menu.active .mm-nav ul li:nth-child(1) { opacity: 1; transform: translateX(0); transition-delay: 0.07s; }
.mobile-menu.active .mm-nav ul li:nth-child(2) { opacity: 1; transform: translateX(0); transition-delay: 0.11s; }
.mobile-menu.active .mm-nav ul li:nth-child(3) { opacity: 1; transform: translateX(0); transition-delay: 0.15s; }
.mobile-menu.active .mm-nav ul li:nth-child(4) { opacity: 1; transform: translateX(0); transition-delay: 0.19s; }
.mobile-menu.active .mm-nav ul li:nth-child(5) { opacity: 1; transform: translateX(0); transition-delay: 0.23s; }
.mobile-menu.active .mm-nav ul li:nth-child(6) { opacity: 1; transform: translateX(0); transition-delay: 0.27s; }
.mobile-menu.active .mm-nav ul li:nth-child(7) { opacity: 1; transform: translateX(0); transition-delay: 0.31s; }

/* CTA */
.mm-cta-wrap {
  padding: 1.2rem 1.4rem 0.4rem;
  flex-shrink: 0;
}

.mm-cta {
  display: block;
  padding: 0.82rem 1.5rem;
  background: var(--color-accent);
  color: #000;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.92rem;
  text-align: center;
  text-decoration: none;
  transition: transform 0.22s, box-shadow 0.22s, background 0.22s;
}

.mm-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 247, 255, 0.3);
  background: #1bfeff;
}

/* Language */
.mm-langs {
  padding: 1.2rem 1.4rem 0.8rem;
  flex-shrink: 0;
}

.mm-lang-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.mm-lang-pills .lang {
  padding: 0.32rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--color-light);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.mm-lang-pills .lang:hover {
  background: rgba(0, 247, 255, 0.08);
  border-color: rgba(0, 247, 255, 0.3);
  color: var(--color-accent);
}

.mm-lang-pills .lang.active {
  background: rgba(0, 247, 255, 0.12);
  border-color: rgba(0, 247, 255, 0.4);
  color: var(--color-accent);
  font-weight: 700;
}

/* Footer */
.mm-footer {
  margin-top: auto;
  padding: 1.2rem 1.4rem 1.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.mm-socials {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.mm-social {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.mm-social:hover {
  background: rgba(0, 247, 255, 0.1);
  border-color: rgba(0, 247, 255, 0.3);
  transform: translateY(-2px);
}

.mm-social img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: brightness(0.9);
}

.mm-copy {
  font-size: 0.72rem;
  color: var(--color-light);
  opacity: 0.3;
}
