/* Sticky header, reel mark + wordmark, primary nav, mobile menu panel. */

.hdr {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg-color) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--border-color) 70%, transparent);
}

.hdr__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-color);

  &:hover {
    color: var(--text-color);
  }
}

.brand__mark {
  width: 40px;
  height: 40px;
  color: var(--accent);
  flex: none;

  & .spokes {
    transform-origin: 20px 20px;
    transition: transform 0.8s var(--ease);
  }
}

.brand:hover .brand__mark .spokes {
  transform: rotate(60deg);
}

.brand__img {
  display: block;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1;

  & b {
    font: 400 1.32rem/1 var(--font-title);
    font-variation-settings: "opsz" 144;
    letter-spacing: -0.01em;

    & i {
      color: var(--accent-hi);
    }
  }

  & span {
    font: 500 0.6rem/1 var(--font-text);
    letter-spacing: 0.42em;
    color: var(--muted-hi);
    margin-top: 5px;
  }
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: 999px;
  padding: 0.6em 1em;
  font: 500 0.9rem var(--font-text);
  cursor: pointer;

  & i {
    width: 16px;
    height: 10px;
    border-top: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
  }
}

/* Mobile: the nav is a dropdown panel under the header. */
.nav {
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border-color);
  padding: 12px var(--gutter) 24px;
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, transform 0.25s var(--ease), visibility 0s 0.25s;
  max-height: calc(100vh - var(--header-h));
  overflow: auto;

  &.open {
    opacity: 1;
    transform: none;
    visibility: visible;
    transition: opacity 0.25s, transform 0.25s var(--ease);
  }
}

.nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;

  & a {
    display: block;
    color: var(--text-soft);
    text-decoration: none;
    font-size: 1.05rem;
    padding: 0.9em 0.4em;
    border-bottom: 1px solid var(--surface-color);
    position: relative;

    &:hover {
      color: var(--text-color);
    }
  }

  & .current-menu-item > a,
  & .current-page-ancestor > a,
  & .current-menu-ancestor > a {
    color: var(--accent-hi);

    /* the "channel LED" */
    &::after {
      content: "";
      position: absolute;
      right: 6px;
      top: 50%;
      width: 5px;
      height: 5px;
      border-radius: 50%;
      background: var(--secondary-hi);
      box-shadow: 0 0 8px var(--secondary-hi);
      transform: translateY(-50%);
    }
  }
}

.nav__cta {
  margin: 16px 0 0;
  justify-content: center;
  padding: 0.75em 1.1em;
}

@media (min-width: 992px) {
  .menu-btn {
    display: none;
  }

  .nav {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    background: none;
    border: 0;
    padding: 0;
    transform: none;
    opacity: 1;
    visibility: visible;
    max-height: none;
    overflow: visible;
  }

  .nav__list {
    flex-direction: row;
    gap: 4px;

    & a {
      font-size: 0.92rem;
      padding: 0.55em 0.75em;
      border-radius: 999px;
      border-bottom: 0;
    }

    & .current-menu-item > a::after,
    & .current-page-ancestor > a::after,
    & .current-menu-ancestor > a::after {
      right: auto;
      left: 50%;
      top: auto;
      bottom: 2px;
      transform: translateX(-50%);
    }
  }

  .nav__cta {
    margin: 0 0 0 10px;
  }
}
