/* ===== Shared header (all pages) ===== */

/* ----- Header ----- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding: 26px 0;
  transition: padding 0.4s var(--ease), background 0.4s var(--ease), backdrop-filter 0.4s;
  animation: headerIn 1s var(--ease) 0.2s both;
}
.header.is-scrolled {
  padding: 14px 0;
  background: rgba(11, 11, 12, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; }

.header__logo img {
  height: 38px;
  width: auto;
  filter: invert(1); /* black logo -> white on dark */
}

.nav { display: flex; align-items: center; gap: 40px; }
.nav__list { display: flex; gap: 34px; list-style: none; }
.nav__link {
  position: relative;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.82);
  padding: 6px 0;
  transition: color 0.3s;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 2px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.nav__link:hover, .nav__link.is-active { color: var(--white); }
.nav__link:hover::after, .nav__link.is-active::after { transform: scaleX(1); transform-origin: left; }

.nav__cta {
  padding: 10px 22px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  font-size: 15px;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s;
}
.nav__cta:hover { background: var(--green); border-color: var(--green); color: var(--black); }

.burger { display: none; width: 34px; height: 24px; position: relative; z-index: 110; }
.burger span {
  position: absolute; left: 0; width: 100%; height: 2px; background: var(--white);
  transition: transform 0.4s var(--ease), opacity 0.3s, top 0.4s var(--ease);
}
.burger span:nth-child(1) { top: 3px; }
.burger span:nth-child(2) { top: 11px; }
.burger span:nth-child(3) { top: 19px; }
.burger.is-open span:nth-child(1) { top: 11px; transform: rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { top: 11px; transform: rotate(-45deg); }

@keyframes headerIn { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: none; } }

@media (max-width: 960px) {
  .burger { display: block; }
  .header__logo { position: relative; z-index: 110; }

  /* While the menu is open the header must not have a transform or backdrop-filter:
     either one traps the fixed overlay inside the header's own box. */
  .header.menu-open {
    animation: none;
    transform: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: transparent;
    border-bottom-color: transparent;
  }

  .nav {
    position: fixed;
    inset: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 105;
    flex-direction: column;
    justify-content: center;
    gap: 44px;
    padding: 100px var(--gutter) 48px;
    background:
      radial-gradient(circle at 85% 15%, rgba(47, 91, 255, 0.28), transparent 45%),
      radial-gradient(circle at 10% 90%, rgba(46, 232, 111, 0.18), transparent 45%),
      #0b0b0c;
    opacity: 0;
    visibility: hidden;
    overflow-y: auto;
    transition: opacity 0.4s var(--ease), visibility 0.4s;
  }
  .nav.is-open { opacity: 1; visibility: visible; }

  .nav__list { flex-direction: column; align-items: center; gap: 18px; }
  .nav__list li {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  }
  .nav.is-open .nav__list li { opacity: 1; transform: none; }
  .nav.is-open .nav__list li:nth-child(1) { transition-delay: 0.08s; }
  .nav.is-open .nav__list li:nth-child(2) { transition-delay: 0.14s; }
  .nav.is-open .nav__list li:nth-child(3) { transition-delay: 0.2s; }
  .nav.is-open .nav__list li:nth-child(4) { transition-delay: 0.26s; }

  .nav__link {
    font-family: var(--font-display);
    font-size: clamp(38px, 11vw, 56px);
    line-height: 1.05;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
  }
  .nav__link::after { height: 3px; bottom: 0; }
  .nav__link.is-active { color: var(--green); }

  .nav__cta {
    padding: 14px 34px;
    font-size: 16px;
    font-weight: 600;
    background: var(--green);
    border-color: var(--green);
    color: var(--black);
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s var(--ease) 0.32s, transform 0.5s var(--ease) 0.32s, background 0.3s, color 0.3s;
  }
  .nav.is-open .nav__cta { opacity: 1; transform: none; }
  .nav__cta.is-active { color: var(--black); }
}

@media (max-width: 560px) {
  .header__logo img { height: 30px; }
}

/* ----- Light pages (About, etc.) ----- */
.header--light .header__logo img { filter: none; }
.header--light .nav__link { color: rgba(20, 20, 22, 0.75); }
.header--light .nav__link:hover, .header--light .nav__link.is-active { color: var(--blue); }
.header--light .nav__link::after { background: var(--blue); }
.header--light .nav__cta { border-color: rgba(20, 20, 22, 0.5); color: var(--ink); }
.header--light .nav__cta:hover { background: var(--blue); border-color: var(--blue); color: var(--white); }
.header--light .burger span { background: var(--ink); }
.header--light.is-scrolled { background: rgba(236, 236, 236, 0.8); border-bottom-color: rgba(20, 20, 22, 0.1); }
@media (max-width: 960px) {
  .header--light .nav {
    background:
      radial-gradient(circle at 85% 15%, rgba(47, 91, 255, 0.16), transparent 45%),
      radial-gradient(circle at 10% 90%, rgba(46, 232, 111, 0.14), transparent 45%),
      #ececec;
  }
  .header--light .nav__link { color: var(--ink); }
  .header--light .nav__link.is-active { color: var(--blue); }
  .header--light .nav__cta { background: var(--blue); border-color: var(--blue); color: var(--white); }
}
