/* ==================================
   Header Main Stylesheet
================================== */

header {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 50;
  background-color: var(--atf-trans);
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  flex-wrap: nowrap;
  padding: 1rem;
}

/* Main Menu Container */
.h-m-nav {
  position: relative;
  width: 95%;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  transition:
    padding 0.4s ease,
    border 0.4s ease,
    background-color 0.4s ease;
}

/* Base Nav Layering */
.h-m-nav > * {
  position: relative;
  z-index: 2;
}

/* === Nav | Branding & Layout === */
.c-logo,
.c-btn {
  width: 20%;
}

.c-logo {
  text-align: start;
}

.site-logo {
  display: flex;
}

.site-logo img {
  width: 160px;
  height: auto;
  aspect-ratio: 16 / 5;
  object-fit: cover;
  transition: width 0.3s ease;
}

.site-logo-m {
  display: none;
}

/* === Nav | Central Navigation === */
.c-nav {
  position: relative;
  max-width: 60%;
  width: fit-content;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  flex-direction: row;
  gap: 1.2rem;
  padding: 0.3rem 0.5rem;
  border-radius: 100rem;
  background-color: transparent;
}

/* Top Unscrolled Pill Pseudo Background */
.c-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid var(--atf-border);
  background-color: var(--atf-semi-black);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: -1;
  transition:
    opacity 0.3s ease,
    border 0.3s ease;
}

.c-nav a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--atf-white);
  font-weight: 300;
  font-size: 1.05rem;
  position: relative;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    color 0.3s ease,
    font-size 0.3s ease;
  padding: 0.2rem 1rem;
  border: solid 1px transparent;
}

.c-nav a:focus,
.c-nav a:focus-visible {
  outline: none;
}

.c-nav a.active,
.c-nav a:hover {
  box-shadow: var(--atf-box-shadow);
  border: solid 1px var(--atf-border);
  border-radius: 100rem;
}

/* ==================================
   CTA Button & Hover Effects
================================== */

.c-ham {
  display: none;
}

.c-btn {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
}

.c-btn a {
  position: relative;
  display: inline-block;
  overflow: hidden;
  transition: all 0.4s ease;
  color: var(--atf-OffWhite);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 300;
  background: linear-gradient(
    200deg,
    var(--atf-darkest-blue-v2) 0%,
    var(--atf-accent) 100%
  );
  padding: 0.5rem 1.5rem;
  border-radius: 2rem;
}

.c-btn a:hover {
  background: linear-gradient(
    135deg,
    var(--atf-accent) 0%,
    var(--atf-darkest-blue-v2) 100%
  );
}

.c-btn a::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 15%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    var(--atf-semi-OffWhite),
    transparent
  );
  transform: skewX(-25deg);
  transition: left 0.6s ease;
}

.c-btn a:hover::before {
  left: 200%;
}

/* ==================================
   Header Scrolled States (Nested Blur Fixed)
================================== */

/* Header Scrolled Base Container */
header.scrolled .h-m-nav {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid var(--atf-border);
  padding: 0.45rem 1.5rem;
  border-radius: 1rem;
  background: transparent;
  isolation: auto;
  margin-top: 0;
  animation: slideDown 0.4s ease;
}

/* Background Blur Layer for Scrolled Header */
header.scrolled .h-m-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-color: var(--atf-semi-black);
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  z-index: -1;
  transform: translateZ(0); /* Force GPU Rendering */
}

@keyframes slideDown {
  from {
    transform: translateX(-50%) translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* Hide central pill's background in scrolled state */
header.scrolled .c-nav::before {
  opacity: 0;
  border: none;
}

header.scrolled .c-nav {
  padding: 0 !important;
}

header.scrolled .c-nav a {
  font-size: 1rem;
}

header.scrolled .c-btn a {
  font-size: 0.9rem;
  padding: 0.5rem 1.2rem;
}
header.scrolled .c-btn a:hover {
  font-size: 0.95rem;
}

header.scrolled .site-logo img {
  width: 140px;
}

/* ==================================
   Media Queries
================================== */

@media (max-width: 886px) {
  .site-logo img {
    width: 120px;
  }

  .c-nav a {
    font-size: 0.9rem;
  }

  .c-btn a {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
  }

  header.scrolled .c-nav a {
    font-size: 0.9rem;
  }

  header.scrolled .c-btn a {
    font-size: 0.85rem;
    padding: 0.6rem 1.2rem;
  }

  header.scrolled .site-logo img {
    width: 110px;
  }
}

@media (max-width: 750px) {
  .c-logo {
    width: 10%;
  }

  .site-logo {
    display: none;
  }

  .site-logo-m {
    display: flex;
  }

  .site-logo-m img {
    width: 40px;
    border-radius: 10px;
    object-fit: cover;
  }

  .c-nav {
    display: none;
  }

  .c-btn {
    width: 80%;
  }

  .c-ham {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    border: 1px solid var(--atf-border);
    border-radius: 100rem;
    background-color: transparent;
    color: var(--atf-OffWhite);
    padding: 5px;
    height: 32px;
    width: 40px;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.3s ease;
  }

  .c-ham:focus,
  .c-ham:focus-visible {
    outline: none;
  }

  .c-ham:hover {
    border-color: var(--atf-accent);
  }
}
