/*===============================================================
  CONCISE ELECTROMECHANICAL — AWWWARDS-LEVEL NAV SYSTEM
  Premium Responsive Navigation | Desktop + Mobile
================================================================*/

:root {
  --header-height: 80px;
  --nav-dark: #02015a;
  --nav-dark-light: rgba(2, 1, 90, 0.85);
  --nav-accent: #ff4006;
  --nav-white: #ffffff;
  --nav-z: 10000;
  --nav-easing: cubic-bezier(0.77, 0, 0.175, 1);
}

/* Mobile: taller header for better visibility */
@media screen and (max-width: 1118px) {
  :root {
    --header-height: 72px;
  }
}

/* ─── HEADER SHELL ──────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(2, 1, 90, 0.06);
  z-index: var(--nav-z);
  transition: background 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.header.sticky {
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 4px 30px rgba(2, 1, 90, 0.08);
  border-bottom-color: rgba(2, 1, 90, 0.1);
}

/* ─── NAV INNER ─────────────────────────────────────────────── */
.nav {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ─── LOGO ──────────────────────────────────────────────────── */
.nav__logo {
  display: inline-flex;
  align-items: center;
  z-index: calc(var(--nav-z) + 2);
  position: relative;
}

.nav__logo img {
  height: 80px;
  width: auto;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Bigger logo on mobile */
@media screen and (max-width: 1118px) {
  .nav__logo img {
    height: 38px;
    max-width: 180px;
    object-fit: contain;
  }
}

@media screen and (max-width: 480px) {
  .nav__logo img {
    height: 32px;
    max-width: 150px;
  }
}

.nav__logo:hover img {
  opacity: 0.85;
  transform: translateY(-2px);
}

/* ─── NAV DATA (logo + toggle wrapper) ─────────────────────── */
.nav__data {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
}

/* ─── HAMBURGER TOGGLE ──────────────────────────────────────── */
.nav__toggle {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--nav-dark);
  border-radius: 14px;
  z-index: calc(var(--nav-z) + 2);
  transition: background 0.3s ease, transform 0.3s ease;
  flex-shrink: 0;
}

.nav__toggle:hover {
  background: var(--nav-accent);
  transform: scale(1.05);
}

.nav__burger,
.nav__close {
  position: absolute;
  inset: 0;
  margin: auto;
  width: max-content;
  height: max-content;
  font-size: 1.6rem;
  color: var(--nav-white);
  cursor: pointer;
  transition: opacity 0.25s ease, transform 0.4s var(--nav-easing);
}

.nav__close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}

/* Toggle active states */
.show-icon .nav__burger {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}

.show-icon .nav__close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ─── NAV MENU — MOBILE (< 1118px) ─────────────────────────── */
@media screen and (max-width: 1118px) {
  .nav__toggle {
    display: flex;
  }

  /* Fullscreen overlay panel */
  .nav__menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--nav-dark);
    z-index: calc(var(--nav-z) + 1);

    /* Hidden state */
    opacity: 0;
    pointer-events: none;
    clip-path: ellipse(0% 0% at 98% 4%);
    transition: clip-path 0.75s var(--nav-easing), opacity 0.2s ease;

    /* Layout — list aligns to the TOP */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: calc(var(--header-height) + 30px) 48px 60px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Animated mesh background inside menu */
  .nav__menu::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
      radial-gradient(circle at 5% 5%, rgba(255, 64, 6, 0.18) 0%, transparent 45%),
      radial-gradient(circle at 95% 95%, rgba(255, 64, 6, 0.1) 0%, transparent 45%),
      radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: auto, auto, 40px 40px;
    pointer-events: none;
  }

  /* Decorative large number */
  .nav__menu::after {
    content: 'CE';
    position: absolute;
    bottom: -30px;
    right: -10px;
    font-family: 'Oswald Variablefont Wght', sans-serif;
    font-size: 200px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.025);
    pointer-events: none;
    letter-spacing: -5px;
    line-height: 1;
    text-transform: uppercase;
  }

  /* OPEN STATE */
  .show-menu.nav__menu {
    opacity: 1;
    pointer-events: auto;
    clip-path: ellipse(170% 170% at 98% 4%);
  }

  /* ── List ── */
  .nav__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    position: relative;
    z-index: 2;
  }

  /* ── Individual Link Items ── */
  .nav__list>li {
    border-bottom: 2px solid rgba(255, 255, 255, 0.07);
    overflow: hidden;
  }

  .nav__list>li:first-child {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
  }

  /* ── Stagger animation for links ── */
  .nav__list>li:nth-child(1) .nav__link {
    transition-delay: 0.05s;
  }

  .nav__list>li:nth-child(2) .nav__link {
    transition-delay: 0.10s;
  }

  .nav__list>li:nth-child(3) .nav__link {
    transition-delay: 0.15s;
  }

  .nav__list>li:nth-child(4) .nav__link {
    transition-delay: 0.20s;
  }

  .nav__list>li:nth-child(5) .nav__link {
    transition-delay: 0.25s;
  }

  /* ── Links ── */
  .nav__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 20px 0;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Oswald Variablefont Wght', sans-serif;
    font-size: clamp(28px, 6vw, 48px);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    line-height: 1;
    text-decoration: none;
    position: relative;
    transition:
      color 0.4s ease,
      transform 0.4s var(--nav-easing),
      letter-spacing 0.4s ease;

    /* Slide-in animation */
    transform: translateY(30px);
  }

  /* When menu is shown, slide links in */
  .show-menu~* .nav__link,
  .show-menu .nav__link {
    transform: translateY(0);
  }

  /* Hover state */
  .nav__link:hover {
    color: var(--nav-white);
    letter-spacing: 1px;
  }

  /* Arrow icon on each link */
  .nav__link::after {
    content: '↗';
    font-size: 20px;
    color: var(--nav-accent);
    opacity: 0;
    transform: translate(-10px, 10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-family: sans-serif;
  }

  .nav__link:hover::after {
    opacity: 1;
    transform: translate(0, 0);
  }

  /* Active / current page link */
  .nav__link.active-page {
    color: var(--nav-white);
  }

  /* Orange line indicator on active */
  .nav__link.active-page::before {
    content: '';
    position: absolute;
    left: -48px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--nav-accent);
    border-radius: 0 4px 4px 0;
  }

  /* ── Contact CTA at bottom ── */
  .nav__btn {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-top: 40px;
    padding: 16px 32px;
    background: var(--nav-accent);
    color: var(--nav-white);
    font-family: 'Oswald Variablefont Wght', sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 50px;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 2;
  }

  .nav__btn:hover {
    background: #fff;
    color: var(--nav-dark);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(255, 64, 6, 0.3);
  }

  /* Social strip at bottom */
  .nav__social {
    display: flex;
    gap: 20px;
    margin-top: 24px;
    position: relative;
    z-index: 2;
  }

  .nav__social a {
    color: rgba(255, 255, 255, 0.35);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    transition: color 0.3s ease;
  }

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

/* ─── NAV MENU — DESKTOP (≥ 1118px) ────────────────────────── */
@media screen and (min-width: 1118px) {
  .nav__toggle {
    display: none;
  }

  .nav__data {
    width: auto;
    gap: 0;
  }

  /* Menu is always visible on desktop */
  .nav__menu {
    display: flex;
    align-items: center;
    height: 100%;
  }

  .nav__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    column-gap: 36px;
    height: 100%;
  }

  .nav__list>li {
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
  }

  /* Desktop link */
  .nav__link {
    color: var(--nav-dark);
    font-family: 'Oswald Variablefont Wght', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-decoration: none;
    position: relative;
    padding: 6px 0;
    height: 100%;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
  }

  /* Animated underline */
  .nav__link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--nav-accent);
    transition: width 0.35s var(--nav-easing);
  }

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

  .nav__link:hover::before,
  .nav__link.active-page::before {
    width: 100%;
  }

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

  /* Desktop contact button */
  .nav__btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 30px;
    padding: 12px 26px;
    background: var(--nav-dark);
    color: var(--nav-white);
    font-family: 'Oswald Variablefont Wght', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 50px;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    white-space: nowrap;
  }

  .nav__btn:hover {
    background: var(--nav-accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 64, 6, 0.3);
  }

  .nav__social {
    display: none;
  }
}

/*===============================================================
  DROPDOWN — MOBILE (inside overlay)
================================================================*/
.dropdown__item {
  cursor: pointer;
  width: 100%;
}

.dropdown__arrow {
  font-size: 1.1rem;
  color: var(--nav-accent);
  transition: transform 0.4s ease;
  margin-left: 8px;
}

.dropdown__item.active-dropdown .dropdown__arrow {
  transform: rotate(180deg);
}

.dropdown__menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s ease-out;
}

.dropdown__item.active-dropdown .dropdown__menu {
  max-height: 600px;
  transition: max-height 0.45s ease-in;
}

.dropdown__link,
.dropdown__sublink {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 12px 20px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 1px;
  text-decoration: none;
  transition: color 0.3s ease, padding 0.3s ease;
  text-transform: uppercase;
}

.dropdown__link:hover,
.dropdown__sublink:hover {
  color: var(--nav-accent);
  padding-left: 28px;
}

.dropdown__link i,
.dropdown__sublink i {
  font-size: 1rem;
  color: var(--nav-accent);
}

/*===============================================================
  DROPDOWN — DESKTOP
================================================================*/
@media screen and (min-width: 1118px) {
  .dropdown__item {
    position: relative;
  }

  .dropdown__menu {
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    min-width: 220px;
    background: var(--nav-dark);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(2, 1, 90, 0.3);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0s, opacity 0.25s ease, top 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .dropdown__item:hover .dropdown__menu {
    max-height: 1000px;
    opacity: 1;
    pointer-events: auto;
    top: 100%;
    transition: max-height 0.4s ease-in, opacity 0.25s ease, top 0.3s ease;
  }

  .dropdown__item:hover .dropdown__arrow {
    transform: rotate(180deg);
  }

  .dropdown__link,
  .dropdown__sublink {
    padding: 14px 20px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
  }

  .dropdown__link:last-child,
  .dropdown__sublink:last-child {
    border-bottom: none;
  }

  .dropdown__link:hover,
  .dropdown__sublink:hover {
    background: rgba(255, 64, 6, 0.12);
    color: var(--nav-white);
    padding-left: 26px;
  }

  /* Submenu */
  .dropdown__subitem {
    position: relative;
  }

  .dropdown__submenu {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 200px;
    background: var(--nav-dark);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(2, 1, 90, 0.3);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .dropdown__subitem:hover>.dropdown__submenu {
    max-height: 600px;
    opacity: 1;
    pointer-events: auto;
  }

  .dropdown__add {
    margin-left: auto;
    font-size: 0.9rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
  }

  .dropdown__subitem:hover .dropdown__add {
    opacity: 1;
    color: var(--nav-accent);
  }
}

/*===============================================================
  SCROLLBAR HIDDEN FOR MOBILE MENU
================================================================*/
.nav__menu::-webkit-scrollbar {
  width: 0;
}

/*===============================================================
  BODY SCROLL LOCK (applied via JS when menu is open)
================================================================*/
body.nav-open {
  overflow: hidden;
}