:root {
  /* Navbar height (already increased previously) */
  --nav-height: 130px;
  --nav-width: 1673px;
  --nav-font-family: "Urbanist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --color-primary: #FFFFFF;
  --color-secondary-1: #633EB2;
  --color-secondary-2: #272E67;
  --color-secondary-3: #A697E0;
  --color-bg-dark: #050816;

  --glass-border: rgba(166, 151, 224, 0.85);
  --glass-bg: rgba(8, 11, 28, 0.55);
  --glass-shadow: 0 18px 45px rgba(5, 10, 22, 0.9);

  /* ✅ MOBILE NAV SAFE PADDING */
  --mobile-overlay-pad: 16px;
}

/* Fixed navbar wrapper:
   - At top: fully transparent (no tint, no blur, no shadow).
   - On scroll: blurred + transparent glass background.
*/
.nav-outer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  pointer-events: none;

  background: transparent;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  border-bottom: 1px solid transparent;
  box-shadow: none;
  transition:
    background 0.25s ease-out,
    backdrop-filter 0.25s ease-out,
    -webkit-backdrop-filter 0.25s ease-out,
    box-shadow 0.25s ease-out;
}

/* ✅ Allow overlay to receive clicks ONLY when menu open (mobile) */
.nav-outer.mobile-menu-open {
  pointer-events: auto;
}

/* ✅ JS will add .is-mobile */
.nav-outer.is-mobile {
  pointer-events: auto;
  z-index: 9999;
}

.nav-shell {
  max-width: var(--nav-width);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  pointer-events: auto;

  box-sizing: border-box;
}

.nav-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  font-family: var(--nav-font-family);
  color: var(--color-primary);
}

/* Left section */
.nav-left {
  display: flex;
  align-items: center;
  height: 100%;
}

.nav-left-spacer {
  width: 0px;
  height: 1px;
}

.nav-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 150px;
  height: 150px;
  margin-left: -23px;
}

.nav-logo {
  width: 150px;
  height: 150px;
  object-fit: contain;
}

/* Center section */
.nav-center {
  display: flex;
  align-items: center;
  height: 100%;
  margin-left: 419px;
}

.nav-links-glass {
  width: 525px;
  height: 45px;
  border-radius: 35px;
  border: 0.8px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 35px;
  padding: 0 20px;
  white-space: nowrap;
}

.nav-link {
  font-family: var(--nav-font-family);
  font-weight: 600;
  font-size: 18px;
  color: var(--color-primary);
  text-decoration: none;
  position: relative;
  transition: opacity 0.15s ease-out, transform 0.15s ease-out;
  opacity: 0.85;
}

.nav-link:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.nav-link-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-secondary-1), var(--color-secondary-3));
}

/* Right section */
.nav-right {
  display: flex;
  align-items: center;
  margin-left: 405px;
}

.nav-contact-btn {
  width: 175px;
  height: 45px;
  border-radius: 35px;
  border: 1px solid var(--glass-border);
  background: radial-gradient(circle at top left, rgba(255,255,255,0.12), transparent 55%),
              linear-gradient(135deg, rgba(99,62,178,0.88), rgba(39,46,103,0.95));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--glass-shadow);

  font-family: var(--nav-font-family);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition:
    transform 0.16s ease-out,
    box-shadow 0.16s ease-out,
    filter 0.16s ease-out;
}

.nav-contact-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 55px rgba(5, 10, 22, 1);
  filter: brightness(1.03);
}

/* On scroll */
.nav-outer.navbar-scrolled {
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.10) 0%, transparent 55%),
    linear-gradient(135deg, rgba(3, 6, 18, 0.40), rgba(9, 13, 30, 0.40));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid transparent;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.65);
}

/* ============================================================
   ✅ BURGER BASE (styles exist globally; only shown in mobile)
   ============================================================ */
.nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-burger-bars {
  width: 34px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 7px;
}

.nav-burger-bar {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.nav-burger-bar.bar-1 { width: 18px; }
.nav-burger-bar.bar-2 { width: 30px; }
.nav-burger-bar.bar-3 { width: 24px; }

/* ============================================================
   ✅ MOBILE OVERLAY STYLES (GLOBAL) — FIXED HEIGHT HANDLING
   ============================================================ */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: auto;

  /* ✅ Use dynamic viewport height (prevents cut-off) */
  height: 100vh;
  height: 100dvh;

  padding:
    calc(var(--mobile-overlay-pad) + env(safe-area-inset-top))
    var(--mobile-overlay-pad)
    calc(var(--mobile-overlay-pad) + env(safe-area-inset-bottom))
    var(--mobile-overlay-pad);

  box-sizing: border-box;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease-out, visibility 0.22s ease-out;
}

.mobile-nav-overlay[hidden] {
  display: none !important;
}

.mobile-nav-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ✅ Compute available height inside overlay padding */
.mobile-nav-overlay {
  --overlay-usable-h: calc(
    100dvh
    - (2 * var(--mobile-overlay-pad))
    - env(safe-area-inset-top)
    - env(safe-area-inset-bottom)
  );
}

/* Outer nav tab */
.mobile-nav-panel {
  width: min(430px, 100%);

  /* ✅ Never exceed usable screen height */
  max-height: var(--overlay-usable-h);

  /* ✅ Target height = 735 but clamp to usable */
  height: min(735px, var(--overlay-usable-h));

  border-radius: 30px;
  background: linear-gradient(135deg, #02070C 0%, #633EB2 100%);
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;

  transform: translateY(14px) scale(0.985);
  transition: transform 0.22s ease-out;
}

.mobile-nav-overlay.is-open .mobile-nav-panel {
  transform: translateY(0px) scale(1);
}

/* Inner box */
.mobile-nav-box {
  width: min(370px, calc(100% - 60px));

  /* ✅ Keep inner box fully visible; allow scrolling inside */
  max-height: calc(100% - 60px);
  height: min(660px, calc(100% - 60px));

  border-radius: 10px;
  border: 0.8px solid #A697E0;

  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  position: relative;
  overflow: hidden;

  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Close button */
.mobile-nav-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 12px;

  border: 1px solid rgba(166, 151, 224, 0.55);
  background: rgba(0, 0, 0, 0.20);
  color: #FFFFFF;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  -webkit-tap-highlight-color: transparent;

  transition: transform 0.15s ease-out, filter 0.15s ease-out;
}

.mobile-nav-close:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

/* ✅ Links area scrolls if needed (short devices) */
.mobile-nav-links {
  width: 100%;
  height: 100%;

  display: flex;
  flex-direction: column;
  align-items: center;

  padding-top: 113px;
  padding-bottom: 28px;

  box-sizing: border-box;

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Links */
.mobile-nav-link {
  font-family: var(--nav-font-family);
  font-size: 20px;
  font-weight: 600;
  color: #FFFFFF;
  text-decoration: none;
  text-align: center;
  opacity: 0.95;
  transition: transform 0.15s ease-out, opacity 0.15s ease-out;
}

/* 60px spacing */
.mobile-nav-link + .mobile-nav-link {
  margin-top: 60px;
}

.mobile-nav-link:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.mobile-nav-link.is-active {
  font-weight: 800;
  opacity: 1;
}

/* CTA */
.mobile-nav-cta {
  margin-top: 107px;

  width: min(260px, 78%);
  height: 52px;
  border-radius: 35px;

  border: 1px solid rgba(166, 151, 224, 0.85);
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.12), transparent 55%),
    linear-gradient(135deg, rgba(99,62,178,0.88), rgba(39,46,103,0.95));

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  box-shadow: 0 18px 45px rgba(5, 10, 22, 0.85);

  font-family: var(--nav-font-family);
  font-size: 17px;
  font-weight: 600;
  color: #FFFFFF;
  text-decoration: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  transition: transform 0.16s ease-out, filter 0.16s ease-out;
}

.mobile-nav-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

/* Lock scroll when menu open */
body.mobile-nav-lock {
  overflow: hidden;
  touch-action: none;
}

/* ============================================================
   ✅ JS MOBILE MODE OVERRIDES (when .is-mobile is applied)
   ============================================================ */
.nav-outer.is-mobile .nav-center {
  display: none !important;
}

.nav-outer.is-mobile .nav-links-glass {
  display: none !important;
}

.nav-outer.is-mobile .nav-contact-btn {
  display: none !important;
}

.nav-outer.is-mobile .nav-right {
  margin-left: auto;
  gap: 12px;
}

.nav-outer.is-mobile .nav-burger {
  display: inline-flex !important;
}

.nav-outer.is-mobile .nav-shell {
  max-width: 100%;
  padding: 0 14px;
}

.nav-outer.is-mobile .nav-inner {
  justify-content: space-between;
}

.nav-outer.is-mobile .nav-logo-wrap {
  width: clamp(104px, 22vw, 132px);
  height: clamp(104px, 22vw, 132px);
  margin-left: 0;
}

.nav-outer.is-mobile .nav-logo {
  width: 100%;
  height: 100%;
}

/* ============================================================
   ✅ Laptop + Tablet (LANDSCAPE) ONLY (UPDATED)
   - More RIGHT spacing for the button
   - Do NOT change logo left spacing behavior (keep as original)
   - Do NOT affect desktop (>1440) or mobile (<=768)
   ============================================================ */

/* ✅ Laptop (landscape-ish / smaller desktop) */
@media (max-width: 1440px) and (min-width: 1025px) {
  .nav-shell {
    padding: 0 52px; /* ✅ MORE right spacing (and left too, but logo spacing untouched) */
  }

  .nav-inner {
    justify-content: space-between;
  }

  .nav-left {
    flex: 0 0 auto;
  }

  .nav-right {
    flex: 0 0 auto;
    margin-left: 0;
  }

  .nav-center {
    margin-left: 0;
    position: absolute;
    left: 50%;
    top: 0;
    height: 100%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ✅ KEEP logo behavior as original (no extra left spacer changes) */
  .nav-left-spacer {
    width: 0px;
  }

  .nav-logo-wrap {
    width: 132px;
    height: 132px;
    margin-left: -23px;
  }

  .nav-logo {
    width: 132px;
    height: 132px;
  }

  /* ✅ Smaller "box" + text */
  .nav-links-glass {
    width: 480px;
    height: 42px;
    gap: 28px;
    padding: 0 18px;
  }

  .nav-link {
    font-size: 16px;
  }

  /* ✅ Smaller button */
  .nav-contact-btn {
    width: 160px;
    height: 42px;
    font-size: 16px;
  }
}

/* ✅ Tablet (landscape) */
@media (max-width: 1024px) and (min-width: 769px) {
  :root {
    --nav-height: 104px; /* was 130px */
  }

  .nav-shell {
    padding: 0 46px; /* ✅ MORE right spacing (and left too, but logo spacing untouched) */
  }

  .nav-inner {
    justify-content: space-between;
  }

  .nav-center {
    margin-left: 0;
    position: absolute;
    left: 50%;
    top: 0;
    height: 100%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ✅ KEEP logo behavior as original (no extra left spacer changes) */
  .nav-left-spacer {
    width: 0px;
  }

  .nav-logo-wrap {
    width: 118px;
    height: 118px;
    margin-left: -23px;
  }

  .nav-logo {
    width: 118px;
    height: 118px;
  }

  .nav-links-glass {
    width: 420px;
    height: 40px;
    gap: 22px;
    padding: 0 16px;
  }

  .nav-link {
    font-size: 15px;
  }

  .nav-right {
    margin-left: 0;
  }

  .nav-contact-btn {
    width: 145px;
    height: 40px;
    font-size: 15px;
  }
}

/* ============================================================
   ✅ Mobile + Tablet (portrait)
   (UNCHANGED)
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --nav-height: 92px; /* was 130px */
  }

  .nav-outer.is-mobile .nav-shell {
    padding: 0 12px;
  }

  .nav-outer.is-mobile .nav-logo-wrap {
    width: clamp(88px, 20vw, 112px);  /* smaller than before */
    height: clamp(88px, 20vw, 112px);
  }

  .nav-burger {
    width: 48px;
    height: 48px;
  }

  .nav-burger-bars {
    width: 30px;
    gap: 6px;
  }

  .nav-burger-bar {
    height: 3px;
  }

  .nav-burger-bar.bar-1 { width: 16px; }
  .nav-burger-bar.bar-2 { width: 28px; }
  .nav-burger-bar bar-3 { width: 22px; }
}
