/* Prevent background scroll */
body.menu-open {
  overflow: hidden;
  height: 100vh;
  /* background: black; */
}

.nav-links a,
.search-box input,
.mobile-search input,
.search-box input::placeholder {
  font-family: "Inter", sans-serif;
  font-style: normal;
  font-weight: 100;
  font-size: clamp(11px, 1vw, 15px);
  letter-spacing: clamp(1px, 0.2vw, 2px);
  line-height: 16px;
  color: #ffffff;
}

/* HERO SECTION */
.hero-new {
  position: relative;
  height: 100vh;
  overflow: hidden;
  z-index: 100000;
  /* background: black; */
}

/* Video */
.hero-new-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: -2;
}

/* Dark overlay for readability */
.hero-new::after {
  content: "";
  position: absolute;
  inset: 0;
  /* background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.65) 0%,
    rgba(0, 0, 0, 0.35) 40%,
    rgba(0, 0, 0, 0.15) 100%
  ); */
  z-index: -1;
}

/* Navbar now transparent */
.navbar-new {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999999;
  padding: 18px 60px;

  background: linear-gradient(to bottom,
      rgba(0, 0, 0, 0.65) 0%,
      rgba(0, 0, 0, 0.35) 40%,
      rgba(0, 0, 0, 0.15) 100%);

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

  /* border-bottom: 1px solid rgba(255, 255, 255, 0.05); */
}

@media (max-width: 992px) {
  .navbar-new {
    padding: 20px;
  }
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img {
  width: clamp(163px, 12vw, 240px);
}

/* Links */
.nav-links {
  display: flex;
  gap: 38px;
  /* margin-top: 20px; */
}

@media (max-width: 1300px) {

  /* .navbar-new {
    padding: 10px 50px;
  } */
  .nav-links {
    gap: 16px;
  }

  .nav-links a {
    font-size: 11px !important;
  }
}

.nav-links a {
  text-decoration: none;
  color: #e4ddd3;
  font-size: 14px;
  letter-spacing: 2px;
  transition: 0.3s;
}

.nav-links a:hover {
  color: #ffffff;
}

/* Search Box */
.search-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  padding: 10px 18px;
  border-radius: 2px;
  width: 240px;

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  /* border: 1px solid rgba(255, 255, 255, 0.1); */
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #e4ddd3;
  font-size: clamp(11px, 0.9vw, 14px);
  letter-spacing: clamp(0.5px, 0.15vw, 1.5px);
  width: 100%;
}

.search-box input::placeholder {
  color: #e4ddd3;
  font-size: clamp(11px, 0.9vw, 14px);
  letter-spacing: clamp(0.5px, 0.15vw, 1.5px);
}

/* Search Box */
.mobile-search {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  padding: 10px 18px;
  border-radius: 2px;
  /* width: 240px; */

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  /* border: 1px solid rgba(255, 255, 255, 0.1); */
}

.mobile-search input {
  background: transparent;
  border: none;
  outline: none;
  color: #e4ddd3;
  font-size: clamp(15px, 0.9vw, 14px);
  letter-spacing: clamp(0.5px, 0.15vw, 1.5px);
  width: 100%;
}

.mobile-search input::placeholder {
  color: #e4ddd3;
  font-size: clamp(15px, 0.9vw, 14px);
  letter-spacing: clamp(0.5px, 0.15vw, 1.5px);
}

/* Search Icon */
.search-icon {
  width: 18px;
  height: 18px;
  stroke: #e4ddd3;
  stroke-width: 2;
  fill: none;
  margin-right: 10px;
}

/* Parent MUST be relative */
.nav-wrapper {
  position: relative;
  z-index: 999999;
  isolation: isolate;
}

/* ================= PANEL ================= */
.mega-panel {
  position: absolute;
  top: 90%;
  left: 0;
  width: 100%;
  z-index: 99995;
  display: none;
  /* margin-top: clamp(3%, 12vw, 4.5%); */
}

.mega-panel.open {
  display: block;
}

/* ================= CARD CONTAINER ================= */
.mega-inner {
  width: 92%;
  margin: 20px auto 0;
  background: rgba(20, 16, 12, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 18px;
  padding: 40px 50px;
  display: flex;
  height: 500px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
  animation: slideDown 0.3s ease;
  color: white;
}

/* ================= MENUS ================= */
.mega-menu {
  width: auto;
  margin-right: 60px;
  padding: 40px 0;
  z-index: 2;
}

#communityMenu a {
  display: block;
  cursor: pointer;
  font-size: clamp(13px, 1vw, 17px);
  letter-spacing: clamp(1px, 0.2vw, 2px);
  margin-bottom: 40px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 100;
  position: relative;
  /* IMPORTANT for underline */
  width: fit-content;
}

/* #communityMenu a.active {
  font-weight: 600;
} */

.mega-menu p {
  font-size: clamp(13px, 1vw, 17px);
  letter-spacing: clamp(1px, 0.2vw, 2px);
  margin-bottom: 22px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 300;
  position: relative;
  /* IMPORTANT for underline */
  width: fit-content;
}

/* underline animation */
.mega-menu p::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  height: 1px;
  width: 0%;
  background: white;
  transition: width 0.35s ease;
}

.mega-menu p:hover {
  transform: translateX(6px);
}

.mega-menu p:hover::after {
  width: 100%;
}

.mega-menu p.active {
  font-weight: 700;
}

/* Elegant underline animation */
#mega-menu p::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 1px;
  width: 0%;
  background: white;
  transition: width 0.35s ease;
}

/* Hover effect */
#mega-menu p:hover {
  color: white;
  transform: translateX(6px);
}

#mega-menu p:hover::after {
  width: 100%;
}

/* ================= MENU ANIMATIONS ================= */
#projectMenu,
#subprojectMenu {
  opacity: 0;
  transform: translateX(20px);
  max-width: 0;
  margin-right: 0;
  overflow: hidden;
  transition: all 0.4s ease;
}

#projectMenu.show {
  opacity: 1;
  transform: translateX(0);
  width: auto;
  max-width: none;
  margin-right: 60px;
  overflow: visible;
}

#subprojectMenu.show {
  opacity: 1;
  transform: translateX(0);
  width: auto;
  max-width: none;
  margin-right: 60px;
  overflow: visible;
}

/* ================= IMAGE SYSTEM ================= */
.mega-image {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  overflow: hidden;
  transition: flex 0.5s cubic-bezier(0.4, 0, 0.2, 1), padding 0.5s ease;
}

/* Full image (default) */
.mega-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Shrink state when sub menu opens */
.mega-image.shrink {
  flex: 1;
}

.mega-image.shrink img {
  width: 100%;
  height: 100%;
  max-width: 550px;
}

/* ================= ANIMATION ================= */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= SUBPROJECT (3rd COLUMN) ================= */
#subprojectMenu {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding-top: 43px;
}

/* Links reset */
#subprojectMenu a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 17px;
  letter-spacing: 1.5px;
  font-weight: 400;
  position: relative;
  transition: all 0.3s ease;
  width: fit-content;
}

/* Elegant underline animation */
#subprojectMenu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 1px;
  width: 0%;
  background: white;
  transition: width 0.35s ease;
}

/* Hover effect */
#subprojectMenu a:hover {
  color: white;
  transform: translateX(6px);
}

#subprojectMenu a:hover::after {
  width: 100%;
}

/* ================= SMALL ABOUT PANEL ================= */
.about-panel {
  position: absolute;
  top: 90%;
  /* left: 27%; */
  width: 320px;
  z-index: 99995;
  display: none;
  /* margin-top: clamp(4%, 12vw, 4.5%); */
}

.about-panel.open {
  display: block;
}

.about-inner {
  margin-top: 20px;
  background: rgba(20, 16, 12, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 18px;
  padding: 30px 35px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
  animation: slideDown 0.3s ease;
}

.about-inner a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  letter-spacing: 2px;
  position: relative;
  transition: all 0.3s ease;
  width: fit-content;
}

/* underline animation */
.about-inner a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 1px;
  width: 0%;
  background: white;
  transition: width 0.35s ease;
}

.about-inner a:hover {
  color: white;
  transform: translateX(6px);
}

.about-inner a:hover::after {
  width: 100%;
}

/* HIDE MOBILE THINGS ON DESKTOP */
.menu-toggle,
.mobile-menu {
  display: none;
}

/* ================= MOBILE ================= */
@media (max-width: 992px) {

  .nav-links,
  .search-box {
    display: none;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
  }

  .menu-toggle span {
    width: 24px;
    height: 2px;
    background: white;
  }

  /* FULL SCREEN PANEL */
  .mobile-menu {
    position: fixed;
    inset: 0;
    background: rgba(20, 16, 12, 0.25);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 999999;
    padding: 30px;

    transform: translateX(100%);
    transition: 0.4s ease;

    display: flex;
    flex-direction: column;
    color: #fff;

    /* 🔥 KEY FIX */
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .mobile-menu.open {
    transform: translateX(0);
  }

  .mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .mobile-logo {
    font-size: 36px;
    font-family: "Times New Roman", serif;
    letter-spacing: 6px;
  }

  .close-menu {
    font-size: 26px;
    cursor: pointer;
  }

  .mobile-links {
    margin-top: 100px;
    display: flex;
    flex-direction: column;
    gap: 28px;
  }

  .mobile-links a,
  .mobile-expand {
    font-size: 14px;
    letter-spacing: 2px;
    text-decoration: none;
    color: #f6f6f6;
  }

  .mobile-expand {
    display: flex;
    justify-content: space-between;
    cursor: pointer;
  }

  .mobile-sub {
    display: none;
    padding-left: 10px;
    flex-direction: column;
    gap: 14px;
  }

  .mobile-sub a {
    font-size: 14px;
    color: #f9f9f9;
  }

  .mobile-sub.open {
    display: flex;
  }

  .mobile-search {
    margin-top: auto;
    margin-bottom: 20px;
    background: #7c7c7c;
    color: white;
    border: none;
    padding: 16px;
    font-size: 16px;
    font-weight: 100;
    letter-spacing: 2px;
    border-radius: 0px;
  }
}

/* MOBILE ACCORDION */
.mob-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 0;
}

.mob-header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  letter-spacing: 2px;
  cursor: pointer;
  color: #fff;
}

.mob-header span {
  font-size: 18px;
}

.mob-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s ease, opacity 0.3s ease;
  opacity: 0;
  padding-left: 12px;
}

.mob-content.open {
  max-height: 500px;
  /* large enough */
  opacity: 1;
  margin-top: 10px;
}

.mob-link {
  display: block;
  padding: 8px 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
}

.mob-link:hover {
  color: white;
  transform: translateX(4px);
}

.search-box {
  position: relative;
}

/* Suggestions Panel */
.search-suggestions {
  position: absolute;
  top: 120%;
  left: 0;
  width: 100%;
  background: rgba(20, 16, 12, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 0px;
  padding: 12px 0;
  display: none;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 200;
  animation: fadeInSearch 0.25s ease;
  margin-top: 17px;
}

.search-suggestions.show {
  display: flex;
}

.search-item {
  padding: 18px 20px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  letter-spacing: 1.2px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  transform: translateX(6px);
}

/* Hide nav links when searching */
.mobile-links.search-active>*:not(.mobile-search-results) {
  display: none;
}

/* Search result container */
.mobile-search-results {
  display: none;
  flex-direction: column;
  gap: 18px;
  margin-top: 40px;
}

@media (max-width: 992px) {
  .mobile-search-results {
    height: 50vh;
    overflow: scroll;
  }
}

.mobile-search-results.show {
  display: flex;
}

/* Style search result items */
.mobile-search-results .search-item {
  font-size: 15px;
  letter-spacing: 2px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes fadeInSearch {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-search {
  position: relative;
}

/* MOBILE SEARCH SUGGESTIONS FIX */

/* ================= MOBILE SEARCH SUGGESTIONS FINAL FIX ================= */

.mobile-search .search-suggestions {
  display: none;
}

.mobile-search .search-suggestions.show {
  display: flex;
  flex-direction: column;
}

/* When in search mode */
.mobile-menu.search-mode .search-suggestions {
  position: fixed;
  top: 50px;
  /* below search bar */
  left: 0;
  width: 100%;
  height: calc(100vh - 80px);
  padding: 10px 20px 40px;
  overflow-y: auto;
  background: rgba(20, 16, 12, 0.86);
  backdrop-filter: blur(16px);
  z-index: 999999;
}

/* ================= MOBILE SEARCH ACTIVE MODE ================= */

.mobile-menu.search-mode .mobile-links {
  display: none;
}

.mobile-menu.search-mode .mobile-search {
  position: fixed;
  top: 12%;
  left: 0;
  width: 100%;
  padding: 18px 20px;
  background: rgba(20, 16, 12, 0.75);
  backdrop-filter: blur(18px);
  z-index: 10000;
}

.mobile-menu.search-mode .mobile-search-results,
.mobile-menu.search-mode .search-suggestions {
  display: flex !important;
  position: fixed;
  top: 55px;
  left: 0;
  width: 100%;
  padding: 0 20px;
  height: calc(100vh - 100px);
  overflow-y: auto;
  flex-direction: column;
  z-index: 999999;
}

.mobile-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.search-back {
  display: none;
  font-size: 22px;
  cursor: pointer;
  color: white;
}

.mobile-menu.search-mode .search-back {
  display: block;
}

.mobile-menu.search-mode .mobile-search input {
  font-size: 18px;
}

.mega-panel,
.about-panel {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s ease;
}

.mega-panel.open,
.about-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}