/*
 * Doomnation Editorial v0.10 masthead and navigation system.
 * The large masthead carries the brand at rest. The compact wordmark enters
 * only after the navigation reaches its sticky position.
 */

:root {
  --masthead-max: 1540px;
  --masthead-edge: clamp(24px, 4.2vw, 70px);
  --nav-height: 78px;
  --nav-height-sticky: 68px;
}

.container--wide {
  width: min(calc(100% - (var(--masthead-edge) * 2)), var(--masthead-max));
}

/* Utility strip */
.utility-bar {
  position: relative;
  z-index: 10;
  background: #050506;
  border-bottom: 1px solid rgba(192, 132, 220, .22);
}

.utility-inner {
  min-height: 38px;
  color: #9a948d;
  font-size: .61rem;
  font-weight: 850;
  letter-spacing: .17em;
}

.utility-inner > span {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.utility-inner > span::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--purple-light);
  box-shadow: 0 0 16px rgba(192, 132, 220, .48);
}

.utility-links {
  gap: clamp(17px, 2vw, 30px);
}

/* Editorial masthead */
.masthead {
  position: relative;
  min-height: clamp(405px, 31vw, 520px);
  display: grid;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(48px, 4.5vw, 76px) 0;
  background:
    radial-gradient(circle at 86% 15%, rgba(111, 44, 145, .42), transparent 32%),
    radial-gradient(circle at 26% 88%, rgba(111, 44, 145, .14), transparent 31%),
    linear-gradient(110deg, #08080a 0%, #09080c 55%, #140b1a 100%);
}

.masthead::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  opacity: .36;
  background:
    repeating-radial-gradient(
      ellipse at 39% 105%,
      transparent 0 48px,
      rgba(192, 132, 220, .13) 49px 50px,
      transparent 51px 96px
    );
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 74%, transparent 92%);
  mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 74%, transparent 92%);
}

.masthead::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: .18;
  background:
    repeating-linear-gradient(112deg, transparent 0 68px, rgba(255, 255, 255, .04) 68px 69px),
    linear-gradient(90deg, rgba(0, 0, 0, .14), transparent 42%, rgba(111, 44, 145, .08));
}

.masthead-signal {
  position: absolute;
  left: 17%;
  bottom: -6px;
  z-index: -1;
  width: min(55vw, 820px);
  height: 118px;
  opacity: .3;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 5px,
    rgba(111, 44, 145, .9) 5px 7px,
    transparent 7px 12px
  );
  clip-path: polygon(
    0 88%, 4% 82%, 8% 91%, 12% 70%, 16% 86%, 20% 54%, 24% 79%, 28% 34%,
    32% 76%, 36% 18%, 40% 65%, 44% 43%, 48% 72%, 52% 26%, 56% 61%, 60% 39%,
    64% 80%, 68% 50%, 72% 88%, 76% 68%, 80% 92%, 84% 78%, 88% 95%, 92% 84%,
    96% 94%, 100% 88%, 100% 100%, 0 100%
  );
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 13%, #000 86%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 13%, #000 86%, transparent 100%);
}

.masthead-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(350px, 25vw, 420px);
  align-items: center;
  gap: clamp(48px, 5.2vw, 88px);
}

.wordmark-link {
  display: block;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.wordmark {
  width: 100%;
  margin: 0;
  color: #f2eee8;
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(5.55rem, 8.85vw, 9.4rem);
  font-weight: 700;
  font-kerning: normal;
  letter-spacing: -.073em;
  line-height: 1;
  text-transform: uppercase;
  text-wrap: nowrap;
}

.wordmark__doom,
.wordmark__radio {
  display: block;
  white-space: nowrap;
}

.wordmark__doom {
  line-height: .72;
}

.wordmark__radio {
  width: fit-content;
  margin-top: .025em;
  color: var(--purple-light);
  font-size: .79em;
  letter-spacing: -.065em;
  line-height: .72;
  text-shadow: 0 0 34px rgba(111, 44, 145, .12);
}

.positioning {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  justify-self: end;
  margin: 0;
  padding: clamp(30px, 2.65vw, 42px);
  color: #f4efe9;
  border: 1px solid rgba(229, 201, 240, .31);
  border-left: 3px solid var(--purple-light);
  background:
    radial-gradient(circle at 100% 0, rgba(111, 44, 145, .2), transparent 52%),
    rgba(15, 12, 18, .92);
  box-shadow: 0 22px 64px rgba(0, 0, 0, .35);
  backdrop-filter: blur(8px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.positioning-kicker {
  display: block;
  margin: 0 0 20px;
  padding: 0 0 18px;
  color: var(--purple-pale);
  border-bottom: 1px solid rgba(229, 201, 240, .17);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .145em;
  line-height: 1.25;
  text-transform: uppercase;
}

.positioning p {
  margin: 0;
  max-width: 31ch;
  color: #f3eee8;
  font-family: var(--sans);
  font-size: clamp(1.08rem, 1.28vw, 1.3rem);
  font-weight: 560;
  letter-spacing: -.012em;
  line-height: 1.56;
  text-wrap: pretty;
}

.masthead--compact {
  min-height: clamp(275px, 24vw, 360px);
  padding: clamp(38px, 4vw, 58px) 0;
}

.masthead--compact .masthead-grid {
  grid-template-columns: minmax(0, 1fr) clamp(315px, 24vw, 370px);
}

.masthead--compact .wordmark {
  font-size: clamp(4.55rem, 7.25vw, 7.25rem);
}

.masthead--compact .positioning {
  min-height: 0;
  padding: 27px 30px 29px;
}

.masthead--compact .positioning p {
  font-size: clamp(1rem, 1.08vw, 1.1rem);
}

/* Sticky navigation. The compact logo is collapsed until JS marks the bar as sticky. */
.nav-anchor {
  display: block;
  height: 0;
  pointer-events: none;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 2000;
  background: rgba(6, 6, 8, .97);
  border-top: 1px solid rgba(255, 255, 255, .13);
  border-bottom: 1px solid rgba(192, 132, 220, .28);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  backdrop-filter: blur(18px);
  transition: background .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.site-nav.is-condensed {
  background: rgba(6, 6, 8, .985);
  border-bottom-color: rgba(192, 132, 220, .4);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .34);
}

.nav-inner {
  min-height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: 0;
  transition: min-height .22s ease;
}

.site-nav.is-condensed .nav-inner {
  min-height: var(--nav-height-sticky);
}

.nav-mark {
  width: 0;
  max-width: 0;
  min-width: 0;
  display: grid;
  flex: 0 0 auto;
  align-content: center;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  margin-right: 0;
  color: #f2eee8;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.34rem;
  font-weight: 700;
  letter-spacing: -.065em;
  line-height: .92;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateX(-12px);
  pointer-events: none;
  transition:
    width .24s ease,
    max-width .24s ease,
    margin-right .24s ease,
    opacity .16s ease,
    transform .24s ease,
    visibility 0s linear .24s;
}

.site-nav.is-condensed .nav-mark {
  width: clamp(155px, 13.5vw, 205px);
  max-width: clamp(155px, 13.5vw, 205px);
  visibility: visible;
  opacity: 1;
  margin-right: clamp(24px, 3vw, 48px);
  transform: none;
  pointer-events: auto;
  transition:
    width .24s ease,
    max-width .24s ease,
    margin-right .24s ease,
    opacity .2s ease .06s,
    transform .24s ease,
    visibility 0s;
}

.nav-mark__doom,
.nav-mark__radio {
  display: block;
}

.nav-mark .nav-mark__doom {
  color: #f2eee8;
}

.nav-mark .nav-mark__radio {
  margin-top: -1px;
  color: var(--purple-light);
}

.nav-prompt {
  display: none;
}

.primary-nav {
  min-width: 0;
  flex: 1 1 auto;
}

.primary-nav > ul,
.primary-nav .menu {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(23px, 2.35vw, 40px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link,
.nav-trigger,
.primary-nav .menu > li > a {
  min-height: var(--nav-height);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d8d2cc;
  font-family: var(--sans);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .105em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: color .16s ease, min-height .22s ease;
}

.site-nav.is-condensed .nav-link,
.site-nav.is-condensed .nav-trigger,
.site-nav.is-condensed .primary-nav .menu > li > a {
  min-height: var(--nav-height-sticky);
}

.nav-link:hover,
.nav-trigger:hover,
.primary-nav .menu > li > a:hover,
.primary-nav .menu > li.current-menu-item > a,
.primary-nav .menu > li.current-menu-ancestor > a,
.nav-item:focus-within > .nav-trigger {
  color: #fff;
}

.nav-link--drone,
.nav-drone > a {
  color: var(--purple-pale) !important;
}

.nav-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  margin-left: clamp(23px, 2.6vw, 44px);
  padding-left: clamp(20px, 2.2vw, 36px);
  border-left: 1px solid rgba(255, 255, 255, .2);
}

.icon-button {
  width: 46px;
  height: 46px;
  border-color: transparent;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}

.icon-button:hover {
  color: var(--purple-pale);
  border-color: rgba(192, 132, 220, .32);
  background: rgba(111, 44, 145, .1);
}

.listen-button {
  min-height: 46px;
  padding: 0 19px;
  border-color: rgba(192, 132, 220, .74);
  background: rgba(111, 44, 145, .08);
  font-size: .68rem;
  letter-spacing: .105em;
  transition: background .16s ease, border-color .16s ease;
}

.listen-button:hover {
  background: rgba(111, 44, 145, .22);
  border-color: var(--purple-light);
}

.site-nav.is-condensed .icon-button {
  width: 42px;
  height: 42px;
}

.site-nav.is-condensed .listen-button {
  min-height: 42px;
}

/* Intermediate desktop widths */
@media (max-width: 1240px) {
  .masthead-grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 350px);
    gap: clamp(36px, 4vw, 54px);
  }

  .wordmark {
    font-size: clamp(5.15rem, 8.4vw, 6.9rem);
  }

  .positioning {
    min-height: 230px;
    padding: 30px;
  }

  .primary-nav > ul,
  .primary-nav .menu {
    gap: clamp(17px, 1.75vw, 25px);
  }

  .nav-link,
  .nav-trigger,
  .primary-nav .menu > li > a {
    font-size: .66rem;
    letter-spacing: .085em;
  }

  .site-nav.is-condensed .nav-mark {
    width: 158px;
    max-width: 158px;
    margin-right: 24px;
  }

  .nav-actions {
    margin-left: 22px;
    padding-left: 18px;
  }
}

@media (max-width: 1020px) and (min-width: 901px) {
  .container--wide {
    width: min(calc(100% - 42px), var(--masthead-max));
  }

  .masthead-grid {
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 32px;
  }

  .wordmark {
    font-size: clamp(4.72rem, 8.05vw, 5.25rem);
  }

  .positioning {
    min-height: 215px;
    padding: 26px;
  }

  .positioning p {
    font-size: 1rem;
  }

  .site-nav.is-condensed .nav-mark {
    width: 136px;
    max-width: 136px;
    margin-right: 18px;
    font-size: 1rem;
  }

  .primary-nav > ul,
  .primary-nav .menu {
    gap: 14px;
  }

  .nav-link,
  .nav-trigger,
  .primary-nav .menu > li > a {
    font-size: .61rem;
    letter-spacing: .065em;
  }

  .nav-actions {
    gap: 6px;
    margin-left: 14px;
    padding-left: 12px;
  }

  .listen-button {
    padding: 0 12px;
    font-size: .61rem;
  }
}

/* Tablet and mobile */
@media (max-width: 900px) {
  :root {
    --masthead-edge: 22px;
    --nav-height: 66px;
    --nav-height-sticky: 62px;
  }

  .masthead,
  .masthead--compact {
    min-height: 0;
    padding: 48px 0 54px;
  }

  .masthead-grid,
  .masthead--compact .masthead-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 38px;
  }

  .wordmark,
  .masthead--compact .wordmark {
    font-size: clamp(4rem, 11.2vw, 6.25rem);
  }

  .positioning,
  .masthead--compact .positioning {
    width: min(700px, 100%);
    min-height: 0;
    justify-self: end;
    padding: 28px 30px 30px;
  }

  .positioning p,
  .masthead--compact .positioning p {
    max-width: 42ch;
    font-size: 1.08rem;
  }

  .masthead-signal {
    left: 8%;
    width: 84vw;
    opacity: .22;
  }

  .nav-inner {
    min-height: var(--nav-height);
    display: flex;
    flex-wrap: wrap;
  }

  .nav-prompt {
    display: inline-flex;
    align-items: center;
    color: #bdb6af;
    font-size: .64rem;
    font-weight: 900;
    letter-spacing: .15em;
    text-transform: uppercase;
    transition: opacity .16s ease, width .22s ease;
  }

  .site-nav.is-condensed .nav-prompt {
    width: 0;
    overflow: hidden;
    opacity: 0;
  }

  .site-nav.is-condensed .nav-mark {
    width: 148px;
    max-width: 148px;
    margin-right: 0;
    font-size: 1.06rem;
  }

  .menu-button {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, .2);
    background: transparent;
    color: #fff;
    cursor: pointer;
  }

  .primary-nav {
    width: 100%;
    flex: 0 0 100%;
    order: 3;
    display: none;
    padding: 4px 0 14px;
  }

  .primary-nav.is-open {
    display: block;
  }

  .primary-nav > ul,
  .primary-nav .menu {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
  }

  .nav-link,
  .nav-trigger,
  .primary-nav .menu > li > a,
  .site-nav.is-condensed .nav-link,
  .site-nav.is-condensed .nav-trigger,
  .site-nav.is-condensed .primary-nav .menu > li > a {
    width: 100%;
    min-height: 50px;
    justify-content: space-between;
    font-size: .7rem;
  }

  .nav-actions {
    display: none;
  }
}

@media (max-width: 680px) {
  :root {
    --masthead-edge: 15px;
  }

  .utility-inner {
    min-height: 34px;
    font-size: .53rem;
    letter-spacing: .115em;
  }

  .utility-inner > span {
    gap: 8px;
  }

  .utility-links {
    gap: 0;
  }

  .utility-links a:not(:last-child) {
    display: none;
  }

  .masthead,
  .masthead--compact {
    padding: 38px 0 42px;
  }

  .masthead-grid,
  .masthead--compact .masthead-grid {
    gap: 30px;
  }

  .wordmark,
  .masthead--compact .wordmark {
    font-size: clamp(2.35rem, 11.4vw, 4.55rem);
    letter-spacing: -.068em;
  }

  .wordmark__radio {
    font-size: .8em;
  }

  .positioning,
  .masthead--compact .positioning {
    padding: 24px 23px 26px;
    border-left-width: 2px;
  }

  .positioning-kicker {
    margin-bottom: 16px;
    padding-bottom: 15px;
    font-size: .65rem;
  }

  .positioning p,
  .masthead--compact .positioning p {
    font-size: 1rem;
    line-height: 1.5;
  }

  .masthead-signal {
    height: 80px;
  }

  .site-nav.is-condensed .nav-mark {
    width: 132px;
    max-width: 132px;
    font-size: .95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav,
  .nav-inner,
  .nav-mark,
  .nav-prompt,
  .nav-link,
  .nav-trigger,
  .primary-nav .menu > li > a {
    transition: none !important;
  }
}

/* Mobile navigation QA: keep search reachable while preserving a compact bar. */
@media (max-width: 900px) {
  .nav-actions {
    display: flex;
    margin-left: auto;
    padding-left: 0;
    border-left: 0;
    gap: 8px;
  }
  .nav-actions .listen-button { display: none; }
  .nav-actions .icon-button { width: 44px; height: 44px; }
  .menu-button { margin-left: 8px; }
}

