.nav-themed {
  --nav-frame: url('assets/impact-metal-frame-nine-slice.webp');
  --nav-stone: linear-gradient(180deg, #252720, #191b16 45%, #14150f);
  --nav-red: linear-gradient(#742b22, #481710 72%, #32120d);
}

.nav-themed .nav-button {
  color: #f4e5bd;
}

.nav-themed .nav-button.active,
.nav-themed .nav-button:hover {
  color: var(--yellow);
}

.nav-themed .nav-button[data-destination="download"] {
  min-height: 46px;
  padding-inline: 15px;
  border: 8px solid #433521;
  border-image: var(--nav-frame) 66 70 / 8px / 0 stretch;
  background: var(--nav-red);
  color: var(--yellow);
  box-shadow: inset 0 -6px 10px #0006;
}

@media (min-width: 861px) {
  .nav-themed .header-inner {
    max-width: 1570px;
    height: 84px;
    margin-top: 29px;
    padding: 0 17px 0 174px;
    border: 0;
    background: none;
    box-shadow: none;
  }

  .nav-themed .brand {
    left: 14px;
    top: -19px;
    width: 152px;
    height: 120px;
  }

  .nav-themed .brand img {
    position: relative;
    width: 100%;
    height: 100%;
  }

  .nav-themed .site-nav {
    width: auto;
    margin-inline-start: auto;
    gap: clamp(5px, 1.1vw, 18px);
  }

  .nav-themed .nav-button {
    min-height: 44px;
    padding-inline: clamp(10px, 1vw, 17px);
    font-size: 24px;
  }

  /* The same riveted frame as the gameplay panels, across the whole rail. */
  .nav-forged .header-inner {
    border: 13px solid #302c22;
    border-image: var(--nav-frame) 66 70 / 13px / 0 stretch;
    background: var(--nav-stone);
    box-shadow: 0 8px 18px #000a;
  }

  .nav-forged .brand { left: 6px; top: -31px; }
  .nav-forged .nav-button.active { box-shadow: inset 0 -2px #af8d42; }

  /* A framed crest and a separate set of links leave the courtyard visible. */
  .nav-gatehouse .brand { left: 0; top: -8px; height: 100px; }
  .nav-gatehouse .brand::before {
    content: '';
    position: absolute;
    inset: 9px -8px 7px;
    border: 10px solid #362a1c;
    border-image: var(--nav-frame) 66 70 / 10px / 0 stretch;
    background: radial-gradient(ellipse at 50% 25%, #692922, #24130f 76%);
  }

  .nav-gatehouse .header-inner { padding-right: 0; }
  .nav-gatehouse .site-nav {
    gap: 0;
    padding: 0 5px;
    border: 10px solid #302c22;
    border-image: var(--nav-frame) 66 70 / 10px / 0 stretch;
    background: var(--nav-stone);
    box-shadow: 0 7px 17px #0009;
  }

  .nav-gatehouse .nav-button { min-height: 47px; padding-inline: 20px; }
  .nav-gatehouse .nav-button:not([data-destination="download"]) { border-inline-end: 1px solid #ad90504d; }
  .nav-gatehouse .nav-button.active { background: #cfad561c; box-shadow: inset 0 -2px #af8d42; }
  .nav-gatehouse .nav-button[data-destination="download"] { margin-inline-start: 6px; }

  /* The section-divider beam supports an open rail with gold underlines. */
  .nav-rampart .header-inner {
    align-items: flex-end;
    padding-bottom: 15px;
    background: linear-gradient(0deg, #10120fe8, #10120f4d 72%, transparent);
  }

  .nav-rampart .header-inner::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 15px;
    border: 0 16px solid transparent;
    border-image: url('assets/impact-metal-divider-strip.webp') 0 95 fill / 0 16px / 0 stretch;
    pointer-events: none;
  }

  .nav-rampart .brand { left: 6px; top: -29px; height: 118px; }
  .nav-rampart .nav-button.active { box-shadow: none; text-decoration: underline #c8a252 2px; text-underline-offset: 6px; }

  .nav-parchment .header-inner {
    border: 11px solid #392b1b;
    border-image: var(--nav-frame) 66 70 / 11px / 0 stretch;
    background:
      linear-gradient(90deg, #281b13 0 126px, #49301c 158px, transparent 205px),
      var(--nav-paper);
    box-shadow: 0 7px 17px #0009;
  }

  .nav-parchment .brand { left: 4px; top: -30px; }
  .nav-parchment .site-nav { gap: clamp(7px, 1.2vw, 18px); }
}

@media (max-width: 860px) {
  .nav-themed .header-inner { align-items: center; padding: 0 10px 0 115px; }
  .nav-themed .brand { left: 0; top: -3px; transform: none; width: 108px; height: 80px; }
  .nav-themed .brand img { width: 108px; height: 80px; }
  .nav-themed .site-nav {
    top: 70px;
    border: 10px solid #302c22;
    border-image: var(--nav-frame) 66 70 / 10px / 0 stretch;
    background: var(--nav-stone);
  }
  .nav-themed .nav-button:not([data-destination="download"]) { border: 1px solid #b191514d; background: #1d2019; }
  .nav-themed .nav-button.active { background: #41351d; }
  .nav-forged .header-inner {
    border: 9px solid #302c22;
    border-image: var(--nav-frame) 66 70 / 9px / 0 stretch;
    background: var(--nav-stone);
    box-shadow: 0 5px 12px #0009;
  }
  .nav-forged .brand { left: -4px; top: -11px; }
  .nav-forged .menu-toggle { min-height: 44px; }
  .nav-forged .site-nav { top: 67px; inset-inline: -9px; width: auto; }
  .nav-gatehouse .menu-toggle { background: var(--nav-red); }
  .nav-rampart .site-nav { background: linear-gradient(#23261d, #11130f); }
  .nav-parchment .site-nav { background: var(--nav-paper); }
  .nav-parchment .menu-toggle { background: var(--nav-red); }
}

.nav-parchment {
  --nav-paper:
    repeating-linear-gradient(106deg, #57331907 0 1px, transparent 1px 5px),
    radial-gradient(ellipse at 58% 45%, #f3dfa9, #d8b575 74%, #bd9358);
}

.nav-parchment .nav-button:not([data-destination="download"]) {
  color: #352116;
  text-shadow: 0 1px #fff0ca;
}

.nav-parchment .nav-button:not([data-destination="download"]):hover,
.nav-parchment .nav-button.active {
  color: #5c2119;
  background: #ffedba45;
  box-shadow: inset 0 -2px #7d3024;
}

.nav-parchment .nav-button:focus-visible {
  outline-color: #612a1c;
  outline-offset: 2px;
}

@media (max-width: 860px) {
  .nav-parchment .nav-button:not([data-destination="download"]) {
    border-color: #81562a65;
    background: #f5e1af70;
  }
}

/* The supplied logo has an opaque black canvas. Trim its empty corners
   at render time so the crest can sit over the courtyard and rail. */
.nav-alt-logo .brand {
  display: grid;
  place-items: center;
}

.nav-alt-logo .brand img {
  height: auto;
  clip-path: polygon(
    50% 0%, 54% 5%, 55% 9%, 64% 10%, 74% 16%, 81% 25%, 86% 36%,
    94% 36%, 100% 33%, 100% 69%, 80% 69%, 76% 80%, 68% 90%,
    56% 95%, 50% 100%, 44% 95%, 34% 93%, 25% 84%, 20% 69%,
    0% 69%, 0% 36%, 16% 36%, 20% 38%, 23% 26%, 32% 16%,
    39% 11%, 45% 9%, 46% 5%
  );
}
