/* =========================
   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
========================= */

@media (max-width: 1200px) {
  .nav a {
    font-size: 14px;
  }
}