/* =========================
   1. HEADER BASE
========================= */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 95px;
  z-index: 51;

  background: rgba(15, 76, 92, 0.95);
  backdrop-filter: blur(8px);

  transition:
    height 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.4s ease,
    backdrop-filter 0.4s ease;
}

.header.scrolled {
  height: 85px;
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}


/* =========================
   2. HEADER LAYOUT
========================= */

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  width: 100%;
  height: 100%;
}


/* =========================
   3. LOGO
========================= */

.logo {
  position: absolute;
  left: 75px;
  top: 0;
  z-index: 60;
}

.logo.intro {
  opacity: 0;
  transform: translateY(-40px) scale(0.95);
}

.logo.intro-active {
  animation: logoIntro 0.9s ease forwards;
}

.logo img {
  position: relative;
  height: 250px;
  top: 50px;

  transition:
    height 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    top 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    left 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease;
}

.header.scrolled .logo img {
  height: 90px;
  top: 0;
  left: 100px;
  opacity: 1;
}


/* =========================
   4. NAVIGATION
========================= */

.nav {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  gap: 35px;
  flex-wrap: nowrap;
}

/* Intro Animation */

.nav.intro {
  opacity: 0;
  transform: translate(-50%, calc(-50% + 20px));
}

.nav.intro-active {
  animation: navIntro 0.9s ease forwards;
}

/* Links */

.nav a {
  font-family: 'Playfair Display', serif;
  font-size: 0.95em;
  font-weight: 400;
  letter-spacing: 2px;

  position: relative;
  opacity: 0.9;
  transition: opacity 0.3s ease;

  white-space: nowrap;
  text-transform: uppercase;
}


/* =========================
   5. COLOR SYSTEM
========================= */

.nav a,
.header-icons a {
  color: #ffffff;
}

.header.scrolled .nav a,
.header.scrolled .header-icons a {
  color: #0f3d3e;
}


/* =========================
   6. NAV HOVER EFFECT
========================= */

.nav a::after,
.nav a::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0%;
  height: 1px;
  background: currentColor;
}

.nav a::after {
  bottom: -6px;
  opacity: 0.9;
  transition: width 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

.nav a::before {
  bottom: -7px;
  opacity: 0.25;
  filter: blur(0.6px);
  transition: width 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

/* Hover */

.nav a:hover {
  opacity: 1;
}

.nav a:hover::after,
.nav a:hover::before {
  width: 100%;
}

/* Reset */

.nav a:not(:hover):not(.active)::after,
.nav a:not(:hover):not(.active)::before {
  width: 0%;
  opacity: 0;
}

/* Active */

.nav a.active {
  opacity: 1;
  color: var(--accent);
}

.nav a.active::after,
.nav a.active::before {
  width: 100%;
  opacity: 1;
}


/* =========================
   7. ICONS
========================= */

.header-icons {
  position: absolute;
  right: 100px;
  display: flex;
  gap: 26px;
}

/* Intro Animation */

.header-icons.intro a {
  opacity: 0;
  transform: translateY(8px);
}

.header-icons.intro-active a {
  animation: headerIconFade 0.8s ease forwards;
}

.header-icons.intro-active a:nth-child(1) { animation-delay: 0.2s; }
.header-icons.intro-active a:nth-child(2) { animation-delay: 0.35s; }
.header-icons.intro-active a:nth-child(3) { animation-delay: 0.5s; }

/* Base */

.header-icons a {
  font-size: 22px;
  transition: opacity 0.25s ease;
}

.header-icons a i {
  transition: all 0.25s ease;
}


/* =========================
   8. ICON HOVER
========================= */

.header:not(.scrolled) .header-icons a:hover i {
  color: #ffffff;
  text-shadow:
    0 0 3px rgba(255,255,255,1),
    0 0 8px rgba(255,255,255,1),
    0 0 18px rgba(255,255,255,0.9),
    0 0 32px rgba(255,255,255,0.7);
}

.header.scrolled .header-icons a:hover i {
  color: var(--accent);
  text-shadow: none;
}

.header-icons a:hover i {
  transform: translateY(-2px) scale(1.15);
  filter: brightness(1.1);
}


/* =========================
   9. ANIMATIONS
========================= */

@keyframes logoIntro {
  0% { opacity: 0; transform: translateY(-60px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes navIntro {
  0% { opacity: 0; transform: translate(-50%, calc(-50% + 30px)); }
  100% { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes headerIconFade {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 0.85; transform: translateY(0); }
}


/* =========================
   10. RESPONSIVE
========================= */




/* =========================
   MOBILE NAVIGATION
========================= */

.burger-menu {
  display: none;
  position: absolute;
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 999;
}

.burger-menu span {
  display: block;
  width: 28px;
  height: 2px;
  margin: 6px auto;
  background: #ffffff;
  transition: all 0.35s ease;
}

.header.scrolled .burger-menu span {
  background: #0f3d3e;
}

.burger-menu.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.burger-menu.active span:nth-child(2) {
  opacity: 0;
}

.burger-menu.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1100px) {

  .header {
    height: 85px;
  }

  .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
  }

  .logo {
    position: relative;
    left: 0;
    top: 0;
  }

  .logo img {
    height: 120px;
    top: 10px;
  }

  .header.scrolled .logo img {
    height: 90px;
    top: 0;
    left: 0;
  }

  .burger-menu {
    display: block;
  }

  .nav {
    position: fixed;
    top: 85px;
    left: 0;
    transform: none;

    width: 100%;
    height: auto;
    min-height: 400px;
    max-height: calc(70vh - 20px);

    background: rgba(15, 76, 92, 0.98);
    backdrop-filter: blur(10px);

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;

    padding-top: 50px;
    gap: 28px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: all 0.35s ease;
    z-index: 998;
  }

  .nav.mobile-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav a {
    font-size: 1.1rem;
    letter-spacing: 2px;
    color: #ffffff !important;
  }

  .header-icons {
    display: none;
  }

  body.menu-open {
    overflow: hidden;
  }
}


@media (max-width: 768px) {

  .header {
    height: 80px;
  }

  .logo img {
    height: 100px;
    top: 8px;
  }

  .header.scrolled .logo img {
    height: 75px;
  }

  .nav {
    top: 80px;
    height: auto;
    min-height: 360px;
    max-height: calc(65vh - 20px);

    padding-top: 30px;
    padding-bottom: 30px;

    gap: 22px;
  }

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


@media (max-width: 480px) {

  .header-inner {
    padding: 0 16px;
  }

  .logo img {
    height: 90px;
  }

  .header.scrolled .logo img {
    height: 70px;
  }

  .nav a {
    font-size: 1rem;
    letter-spacing: 2px;
    color: #ffffff !important;
  }
}



/* =========================
   MOBILE FIXES
========================= */

@media (max-width: 1100px) {

  .header {
    z-index: 5000;
  }

  .burger-menu {
    z-index: 6000;
  }

  .nav {
    z-index: 5500;
    overflow-y: auto;
  }

}
