/* ==========================================================================
   Site header
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 600;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--container-padding);
  pointer-events: none;
  transition: transform var(--transition-medium), height var(--transition-fast);
}

/* Override the bar's own height while the mobile menu is open.
   Remove this rule (or set it back to var(--header-height)) to make
   the bar stay the same height in both states. */
.site-header.nav-open {
  height: 76px;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, var(--header-box-opacity)), rgba(0, 0, 0, 0));
  transition: opacity var(--transition-fast);
}

.page-projects .site-header::before {
  background: none;
}

.page-digital-viz .site-header::before {
  background: none;
}

.site-header--hidden {
  transform: translateY(-100%);
}

.site-header > * {
  pointer-events: auto;
}

.site-header__logo {
  position: relative;
  z-index: 1;
  transform: translateY(2px);
}

.site-header__logo img {
  width: 225px;
  height: auto;
  display: block;
  transition: opacity var(--transition-fast);
}

/* Default (dark header): show light logo, hide dark logo */
.site-header__logo .logo--light { display: block; }
.site-header__logo .logo--dark  { display: none; }

.site-header__logo:hover img {
  opacity: 0.7;
}

/* Light header: show dark logo, hide light logo */
.site-header--on-light .site-header__logo .logo--light { display: none; }
.site-header--on-light .site-header__logo .logo--dark  { display: block; }

/* Nav open: always show light logo */
.site-header.nav-open .site-header__logo .logo--light { display: block; }
.site-header.nav-open .site-header__logo .logo--dark  { display: none; }

.site-nav {
  margin-right: 50px;
}

.site-nav ul {
  display: flex;
  gap: 32px;
}

.site-nav a {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 500;
  text-transform: uppercase;
  color: #d4d4d4;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.site-nav__row-icon {
  display: none;
}

.site-nav__brand {
  display: none;
}

.site-header--on-light .site-nav a {
  color: var(--color-header-on-light);
}

.site-nav a:hover {
  opacity: 0.7;
}

.nav-toggle {
  position: relative;
  z-index: 1;
  display: none;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  color: #d4d4d4;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--transition-fast);
}

.nav-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.site-header--on-light .nav-toggle {
  color: var(--color-header-on-light);
}

.nav-toggle.is-open {
  color: var(--color-text-light);
}

.nav-toggle__icon {
  position: absolute;
  width: 36px;
  height: 36px;
  transition: opacity var(--transition-medium), transform var(--transition-medium);
}

.nav-toggle__icon--close {
  opacity: 0;
  transform: rotate(-90deg);
}

.nav-toggle.is-open .nav-toggle__icon--menu {
  opacity: 0;
  transform: rotate(90deg);
}

.nav-toggle.is-open .nav-toggle__icon--close {
  opacity: 1;
  transform: rotate(0deg);
}

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 590;
  background: rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-medium), visibility var(--transition-medium);
}

.nav-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.site-header.nav-open ~ .back-to-top {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 768px) {
  .site-nav {
    margin-right: 0;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav ul {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    padding: calc(var(--header-height) + 32px) 28px 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin: calc(var(--header-height) + 16px) 0 0;

    /* Dark editorial palette (current). To switch back to the original
       brand-blue gradient, comment out the line below and uncomment
       the two lines under "Blue gradient option". */
    background: var(--color-bg-dark);

    /* Blue gradient option:
    background: rgba(47, 96, 220, 0.9);
    background: linear-gradient(180deg, rgba(47, 96, 220, 0.9) 0%, rgba(27, 143, 235, 0.9) 100%);
    */
  }

  .site-nav.is-open ul {
    display: flex;
  }

  .site-nav.is-open ul li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .site-nav.is-open ul li:last-child {
    border-bottom: 0;
  }

  .site-nav.is-open ul a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    width: 100%;
    padding: 18px 0;
    color: var(--color-text-light);
  }

  /* Accent color on hover/focus. With the dark palette this defaults to
     the lighter blue from the original gradient (#1b8feb) as a brand
     accent; if you switch to the blue gradient background above, you
     may want to change this to var(--color-text-light) or a light gray
     instead, since blue-on-blue would be low contrast. */
  .site-nav.is-open ul a:hover,
  .site-nav.is-open ul a:focus-visible {
    color: #1b8feb;
  }

  .site-nav a {
    font-size: 1.7rem;
    text-align: left;
  }

  .site-nav__row-icon {
    display: block;
    width: 16px;
    height: 16px;
    color: #888;
    flex-shrink: 0;
    margin-left: 16px;
  }

  .site-nav.is-open ul a:hover .site-nav__row-icon,
  .site-nav.is-open ul a:focus-visible .site-nav__row-icon {
    color: currentColor;
  }

  .site-nav__brand {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 590;
    margin: 0;
    padding: 16px 0;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b6b6b;
    background: var(--color-bg-dark);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-medium), visibility var(--transition-medium);
  }

  .site-header.nav-open .site-nav__brand {
    opacity: 1;
    visibility: visible;
  }
}

/* ==========================================================================
   Full-height content sections
   ========================================================================== */

.section {
  padding: calc(var(--header-height) + 48px) 0 64px;
}

.section--full {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--header-height);
  padding-bottom: var(--header-height);
}

.section--dark {
  background: var(--color-bg-dark);
}
