/*  Navbar Core Structure*/
.navbar-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  z-index: 99950; /* Absolute highest clickable overlay action controls */
  pointer-events: none; /* Let clicks pass through empty spaces */
  mix-blend-mode: difference; /* Smart color inversion over dark vs light screens */
}

.navbar {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2%; /* Exactly 3% left and right padding */
  pointer-events: auto; /* Re-enable pointer events for links/buttons */
  transition: background-color 0.4s ease;
}

.navbar-logo {
  font-family: "DM Sans", var(--font-primary);
  font-weight: 400;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9960;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  z-index: 9960;
}

/* Contact Us Button Actions */
.contact-btn {
  font-family: "DM Sans", var(--font-primary);
  font-weight: 400;
  font-size: 0.80rem;
  letter-spacing: 0.05em;
  color: var(--color-text);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.4rem 1.2rem;
  border-radius: 0px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 0;
  transition:
    color 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    gap 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-btn span {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-btn .btn-arrow {
  width: 0;
  opacity: 0;
  transform: translate3d(-6px, 0, 0);
  transition:
    width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-btn:hover {
  background-color: var(--color-text);
  color: var(--color-bg) !important;
  border-color: var(--color-text);
  gap: 8px; /* Expand gap on hover */
}

.contact-btn:hover .btn-arrow {
  width: 10px;
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Morphing Hamburger Button */
.hamburger-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  pointer-events: auto;
  outline: none;
}

.hamburger-btn .menu-text {
  font-family: "DM Sans", var(--font-primary);
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: var(--color-text);
  transition: color 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.hamburger-btn .hamburger-icon {
  width: 28px;
  height: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.hamburger-btn .bar {
  width: 100%;
  height: 2px;
  background-color: var(--color-text);
  display: block;
  transition:
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center;
}

/* Hamburger Morphing Keyframes (morphs to a clean "X") */

.hamburger-btn.is-active .bar-1 {
  transform: translate3d(0, 9px, 0) rotate(45deg);
}

.hamburger-btn.is-active .bar-2 {
  transform: scaleX(0);
  opacity: 0;
}

.hamburger-btn.is-active .bar-3 {
  transform: translate3d(0, -9px, 0) rotate(-45deg);
}

/* Slide-Out Menu Curtain Panel */
.menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 40%; /* 40% of viewport width on desktop */
  height: 100vh;
  background-color: #ffffff; /* Pure white background */
  z-index: 99900; /* Directly below active navbar but above page content */
  box-shadow: none; /* No shadow */
  border-radius: 0px; /* No border-radius */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 90px 6% 6% 6%; /* Increased top padding to clear header links */
  pointer-events: none;
  overflow-y: auto;

  /* Animation: slide & fade in like a curtain */
  transform: translate3d(100%, 0, 0);
  opacity: 0;
  transition:
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-panel.is-open {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  pointer-events: auto;
}

/* 
   Changed height to min-height to prevent clipping of footer details 
   on smaller vertical viewports. Allows the parent container to scroll naturally.
*/
.menu-panel-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  box-sizing: border-box;
}

/* Menu Links Styling */
.menu-links {
  display: flex;
  flex-direction: column;
  gap: 1rem; /* Generous spacing between items */
  margin: 0;
}

.menu-link {
  font-family: "DM Sans", var(--font-primary);
  font-weight: 500;
  font-size: 2rem; /* Desktop: exactly 2rem */
  color: #000000;
  text-decoration: none;
  text-align: left;
  width: fit-content;
  transform: translate3d(0, 0, 0);
  opacity: 0.9;
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Micro-interaction: slide on hover */
.menu-link:hover {
  opacity: 1;
  color: #000000;
}

/* Panel Footer Configuration */
.menu-panel-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 4vh;
  margin-top: 0; /* Handled by space-between distribution */
}

/* Label headers inside panel */
.footer-label {
  font-family: "DM Sans", var(--font-primary);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: #888888;
  text-transform: uppercase;
  display: block;
  margin-bottom: 1.5rem;
}

/* Social links list */
.social-links {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "DM Sans", var(--font-primary);
  font-weight: 500;
  font-size: 0.95rem;
  color: #444444;
  text-decoration: none;
  transition: color 0.3s ease;
}

.social-link:hover {
  color: #000000;
}

.social-icon {
  stroke-width: 1.5px;
  transition: transform 0.3s ease;
}

.social-link:hover .social-icon {
  transform: scale(1.1);
}

/* Contact Details Block */
.contact-details {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  justify-content: flex-start;
}

.footer-contact-link {
  font-family: "DM Sans", var(--font-primary);
  font-weight: 500;
  font-size: 0.95rem;
  color: #444444;
  text-decoration: none;
  transition: color 0.3s ease;
  width: fit-content;
}

.footer-contact-link:hover {
  color: #000000;
}

.contact-details .location {
  font-family: "DM Sans", var(--font-primary);
  font-weight: 500;
  font-size: 0.95rem;
  color: #888888;
  margin-top: 0.2rem;
}

/* Clean micro scrollbar for panel overflow */
.menu-panel::-webkit-scrollbar {
  width: 4px;
}
.menu-panel::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.08);
}

/* Dynamic Backdrop Blur Overlay (replaces main container blur to prevent rendering flashes) */
.menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.05); /* very soft dimming layer */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 99800; /* sits between main page and menu panel (above page contents) */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

body.menu-open .menu-backdrop {
  opacity: 1;
  pointer-events: auto;
}



/* Mobile Responsiveness (Screen sizes <= 768px) */
@media screen and (max-width: 768px) {
  /* Disable backdrop blur on mobile screens to optimize GPU performance */
  body.menu-open .menu-backdrop {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background-color: rgba(0, 0, 0, 0.35) !important; /* simple alpha fallback overlay */
  }

  .navbar {
    padding: 0 6%;
  }
  .navbar-actions {
    gap: 1.2rem;
  }

  /* Hide contact button on mobile screen to prevent layout clutter */
  .contact-btn {
    display: none;
  }

  /* Mobile slide-down curtain full-screen panel */
  .menu-panel {
    width: 100% !important;
    left: 0;
    top: 0;
    height: 100vh;
    padding: 120px 8% 8% 8%;

    /* Transition: slide down from top instead of slide right */
    transform: translate3d(0, -100%, 0);
    transition:
      transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
      opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .menu-panel.is-open {
    transform: translate3d(0, 0, 0);
  }

  /* 
     Staggered Link Entrance Animations:
     Set initial hidden states when closed, and apply staggered transition-delays 
     only when .is-open is active so that links immediately hide on exit.
  */
  .menu-panel:not(.is-open) .menu-link {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }

  .menu-links {
    gap: 1.5rem;
    margin-bottom: 4vh;
  }

  .menu-link {
    font-size: 1.5rem; /* Mobile: exactly 1.5rem */
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .menu-panel.is-open .menu-link:nth-child(1) {
    transition-delay: 0.35s;
  }
  .menu-panel.is-open .menu-link:nth-child(2) {
    transition-delay: 0.42s;
  }
  .menu-panel.is-open .menu-link:nth-child(3) {
    transition-delay: 0.49s;
  }
  .menu-panel.is-open .menu-link:nth-child(4) {
    transition-delay: 0.56s;
  }

  /* Staggered Footer Entrance Animation */
  .menu-panel:not(.is-open) .menu-panel-footer {
    opacity: 0;
    transform: translate3d(0, 15px, 0);
  }

  .menu-panel-footer {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-top: 3vh;
    margin-top: auto;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .menu-panel.is-open .menu-panel-footer {
    transition-delay: 0.62s;
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }

  .contact-details {
    justify-content: flex-start;
    margin-top: 0.5rem;
  }

  .footer-label {
    margin-bottom: 0.8rem;
  }
}

/* ==========================================================================
   Entrance Loader & Volumetric Blur Overlay
   ========================================================================== */
.entrance-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(13, 13, 14, 0.75); /* Pure obsidian charcoal with opacity overlay */
    backdrop-filter: blur(20px); /* Soft volumetric blur to show hero base */
    -webkit-backdrop-filter: blur(20px);
    z-index: 99999; /* Positioned on top of custom cursors & menus */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    will-change: opacity, backdrop-filter, background-color;
}

.entrance-loader.fade-out {
    opacity: 0;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    pointer-events: none; /* Let user clicks reach the content */
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
    will-change: opacity, transform;
}

.loader-brand {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: clamp(2.5rem, 3vw, 3rem);
    font-weight: 400;
    letter-spacing: -0.03em;
    opacity: 0;
    transform: translate3d(0, 20px, 0);
    animation: loader-reveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    
    /* Text stroke and gradient fill clipping */
    background: linear-gradient(to top, #ffffff var(--loader-fill, 0%), rgba(255, 255, 255, 0.15) var(--loader-fill, 0%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.loader-percentage {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: #8c8c94;
    letter-spacing: 0.05em;
    opacity: 0;
    transform: translate3d(0, 10px, 0);
    animation: loader-reveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

@keyframes loader-reveal {
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Initial entrance states for unblur reveal */
.navbar-wrapper,
.hero-headline,
.hero-description,
.cta-card,
.hero-video-bg,
.hero-bottom-left {
    opacity: 0;
    filter: blur(15px);
    will-change: opacity, filter;
}
