body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: #21201f;
  opacity: 1;
  animation: mchn-page-reveal 2500ms cubic-bezier(0.16, 1, 0.3, 1) 120ms forwards;
}

body.is-page-exiting::before {
  visibility: visible;
  pointer-events: auto;
  animation: mchn-page-exit 1000ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.is-page-loaded:not(.is-page-exiting)::before {
  opacity: 0;
  visibility: hidden;
  animation: none;
}

@keyframes mchn-page-reveal {
  0% {
    opacity: 1;
    visibility: visible;
  }

  33.333% {
    opacity: 0.25;
    visibility: visible;
  }

  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes mchn-page-exit {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.site-mark-link {
  position: fixed;
  z-index: 20;
  top: calc(clamp(52px, 4.9vw, 62px) / 2);
  left: clamp(14px, 2.6vw, 40px);
  width: clamp(78px, 5.8vw, 104px);
  aspect-ratio: 16 / 9;
  display: block;
  height: auto;
  max-width: none;
  margin: 0;
  transform: translateY(-50%);
}

.site-mark {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.9;
}

.site-nav {
  position: fixed;
  z-index: 19;
  top: 0;
  left: 0;
  right: 0;
  min-height: clamp(52px, 4.9vw, 62px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(12px, 1.7vw, 22px);
  padding: 0 clamp(14px, 2.5vw, 38px) 0 clamp(110px, 12vw, 172px);
  border-bottom: 1px solid rgba(241, 238, 232, 0.12);
  background: linear-gradient(180deg, rgba(5, 5, 5, 0.72), rgba(5, 5, 5, 0.18));
  backdrop-filter: blur(9px);
  color: rgba(241, 238, 232, 0.68);
  font-family: var(--font-body, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  font-size: clamp(0.74rem, 0.82vw, 0.9rem);
  font-weight: 850;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.site-nav a,
.site-nav span {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav .site-nav-shop {
  display: inline-flex !important;
  position: relative;
  align-items: center;
  justify-content: center;
  min-width: 3.5em;
}

.site-nav .site-nav-shop__sale {
  display: inline-flex !important;
  position: absolute;
  top: -0.95em;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d94526;
  font-size: 0.56em;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0.06em;
  pointer-events: none;
}

.site-nav a {
  transition: color 180ms ease, opacity 180ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav span[aria-current="page"] {
  color: var(--smoke, #f9f5f2);
}

.site-nav a:focus-visible {
  outline: 1px solid rgba(241, 238, 232, 0.42);
  outline-offset: 6px;
}

/* WCAG 2.4.7 — universal visible focus indicator. !important restores a visible
   ring on the many components that set `outline: none`. Brand red meets 3:1 against
   both the dark and the light (cream) section backgrounds. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #d94526 !important;
  outline-offset: 2px !important;
}

/* WCAG 2.4.1 — skip link: visually hidden until focused. */
.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 1000;
  padding: 10px 16px;
  background: #f9f5f2;
  color: #14120d;
  font-family: var(--font-body, system-ui), sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  text-decoration: none;
  border-radius: 2px;
  transition: top 140ms ease;
}
.skip-link:focus {
  top: 8px;
}

/* Join: filled white button so the primary action stands out in the nav.
   Targets both Join href forms (#plans on entity pages, /pages/forge/ elsewhere). */
.site-nav > a[href="#plans"],
.site-nav > a[href="/pages/forge/"] {
  padding: 0.6em 1.15em;
  margin-left: 0.25em;
  border-radius: 2px;
  background: #F9F5F2;
  color: #21201f;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.site-nav > a[href="#plans"]:hover,
.site-nav > a[href="#plans"]:focus-visible,
.site-nav > a[href="/pages/forge/"]:hover,
.site-nav > a[href="/pages/forge/"]:focus-visible {
  background: rgba(255, 255, 255, 0.86);
  color: #21201f;
  transform: translateY(-1px);
}

.site-nav-toggle {
  display: none;
}

.site-footer {
  position: relative;
  z-index: 2;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(4, minmax(120px, 0.55fr));
  gap: clamp(22px, 3vw, 54px);
  padding: clamp(36px, 5vw, 74px) clamp(24px, 6vw, 92px);
  border-top: 1px solid rgba(241, 238, 232, 0.14);
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.96), #21201f),
    radial-gradient(circle at 50% 0%, rgba(241, 238, 232, 0.08), transparent 44%);
  color: rgba(241, 238, 232, 0.72);
  font-family: var(--font-body, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}

.site-footer__brand {
  max-width: 360px;
}

.site-footer__mark {
  display: block;
  width: clamp(86px, 7vw, 118px);
  height: auto;
  margin-bottom: 18px;
}

.site-footer__lead {
  margin: 0;
  color: rgba(241, 238, 232, 0.78);
  font-size: clamp(0.88rem, 0.92vw, 1rem);
  line-height: 1.55;
}

.site-footer__group {
  display: grid;
  align-content: start;
  gap: 10px;
}

.site-footer__title {
  margin: 0 0 4px;
  color: var(--smoke, #f9f5f2);
  font-size: clamp(0.64rem, 0.68vw, 0.76rem);
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.site-footer a,
.site-footer__meta {
  color: rgba(241, 238, 232, 0.62);
  font-size: clamp(0.78rem, 0.82vw, 0.9rem);
  line-height: 1.45;
  text-decoration: none;
}

.site-footer a {
  width: fit-content;
  transition: color 180ms ease;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--smoke, #f9f5f2);
}

.site-footer__bottom {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-top: clamp(18px, 2.4vw, 28px);
  border-top: 1px solid rgba(241, 238, 232, 0.1);
  color: rgba(241, 238, 232, 0.44);
  font-size: 0.72rem;
  line-height: 1.4;
}

.site-footer__bottom span {
  display: block;
}

/* Spartan watermark: large decorative mark anchored to the right edge, spanning
   the footer height, behind the content. */
.site-footer__watermark {
  position: absolute;
  right: clamp(-24px, 0.5vw, 8px);
  top: 50%;
  transform: translateY(-50%);
  height: clamp(320px, 132%, 520px);
  width: auto;
  opacity: 0.08;
  z-index: -1;
  pointer-events: none;
  user-select: none;
}
/* Stacked footer: a footer-height mark would dwarf it, so shrink to a small
   corner watermark instead. */
@media (max-width: 760px) {
  .site-footer__watermark {
    top: auto;
    bottom: clamp(10px, 3vw, 26px);
    transform: none;
    height: auto;
    width: clamp(96px, 26vw, 150px);
    opacity: 0.08;
  }
}

@media (max-width: 1024px) {
  .site-mark-link {
    top: 28px;
    left: 14px;
    width: 86px;
  }

  .site-nav {
    min-height: 56px;
    align-items: flex-end;
    justify-content: flex-start;
    flex-direction: column;
    gap: 0;
    padding: 7px 12px;
    font-size: 0.82rem;
    letter-spacing: 0.14em;
  }

  .site-nav > a,
  .site-nav > span:not(.site-nav-toggle__bar) {
    display: none;
  }

  .site-nav > .site-nav-shop {
    display: none !important;
  }

  .site-nav.is-open {
    background: rgba(5, 5, 5, 0.94);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
  }

  .site-nav.is-open > a,
  .site-nav.is-open > span:not(.site-nav-toggle__bar) {
    display: flex;
    width: min(260px, calc(100vw - 28px));
    min-height: 44px;
    align-items: center;
    justify-content: flex-end;
    border-top: 1px solid rgba(241, 238, 232, 0.1);
  }

  .site-nav.is-open > .site-nav-shop {
    display: flex !important;
    justify-content: flex-end;
  }

  .site-nav.is-open > a:first-of-type,
  .site-nav.is-open > span:first-of-type {
    margin-top: 8px;
  }

  /* Join is a filled button - keep it compact (shrink to its label) instead of
     stretching to the full 260px row, which makes it look oversized on mobile. */
  .site-nav.is-open > a[href="#plans"],
  .site-nav.is-open > a[href="/pages/forge/"] {
    width: auto;
    min-height: 44px;
    margin-top: 12px;
    padding: 0.7em 1.7em;
    border-top: 0;
    justify-content: center;
  }

  .site-nav-toggle {
    position: relative;
    width: 46px;
    height: 46px;
    display: inline-grid;
    place-items: center;
    align-self: flex-end;
    border: 1px solid rgba(241, 238, 232, 0.22);
    border-radius: 0;
    background: rgba(5, 5, 5, 0.38);
    color: var(--smoke, #f9f5f2);
    cursor: pointer;
  }

  .site-nav-toggle__bar,
  .site-nav-toggle::before,
  .site-nav-toggle::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    transform: translate(-50%, -50%);
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .site-nav-toggle::before {
    transform: translate(-50%, calc(-50% - 7px));
  }

  .site-nav-toggle::after {
    transform: translate(-50%, calc(-50% + 7px));
  }

  .site-nav.is-open .site-nav-toggle::before {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .site-nav.is-open .site-nav-toggle__bar {
    opacity: 0;
  }

  .site-nav.is-open .site-nav-toggle::after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  .site-nav .site-nav-shop__sale {
    top: -0.72em;
    font-size: 0.62em;
  }

  .site-nav.is-open .site-nav-shop__sale {
    top: 0.45em;
    right: 0;
    left: auto;
    transform: none;
  }
}

@media (max-width: 760px) {
  .site-footer {
    grid-template-columns: 1fr 1fr;
    padding: 34px 22px;
  }

  .site-footer__brand,
  .site-footer__bottom {
    grid-column: 1 / -1;
  }

  .site-footer__bottom {
    display: grid;
    gap: 8px;
  }
}

@media (max-width: 380px) {
  .site-mark-link {
    width: 78px;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation-duration: 1ms;
    animation-delay: 0ms;
  }

  body.is-page-exiting::before {
    animation-duration: 1ms;
  }
}

/* ---- Systems dropdown ---- */
.site-nav-systems { position: relative; display: inline-flex; align-items: center; }
.site-nav-systems__toggle {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer; text-transform: uppercase; letter-spacing: inherit; line-height: 1;
  display: inline-flex; align-items: center; gap: 0.45em; white-space: nowrap;
  transition: color 180ms ease;
}
.site-nav-systems:hover .site-nav-systems__toggle,
.site-nav-systems:focus-within .site-nav-systems__toggle,
.site-nav-systems__toggle:hover,
.site-nav-systems__toggle:focus-visible { color: var(--smoke, #f9f5f2); }
.site-nav-systems__toggle:focus-visible { outline: 1px solid rgba(241, 238, 232, 0.42); outline-offset: 6px; }
.site-nav-systems__caret { font-size: 0.8em; transition: transform 180ms ease; }
.site-nav-systems:hover .site-nav-systems__caret,
.site-nav-systems:focus-within .site-nav-systems__caret,
.site-nav-systems.is-open .site-nav-systems__caret { transform: rotate(180deg); }

.site-nav-systems__menu {
  position: absolute; top: calc(100% + 10px); right: 0;
  min-width: 190px; display: flex; flex-direction: column; padding: 6px;
  background: rgba(8, 8, 8, 0.96);
  border: 1px solid rgba(241, 238, 232, 0.14);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 0s linear 160ms;
  z-index: 21;
}
.site-nav-systems:hover .site-nav-systems__menu,
.site-nav-systems:focus-within .site-nav-systems__menu,
.site-nav-systems.is-open .site-nav-systems__menu {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity 160ms ease, transform 160ms ease;
}
.site-nav-systems__menu a {
  display: flex; align-items: center; justify-content: flex-end; gap: 0.6em;
  padding: 0.6em 0.9em; white-space: nowrap;
  color: rgba(241, 238, 232, 0.7);
}
.site-nav-systems__menu a:hover,
.site-nav-systems__menu a:focus-visible { color: var(--smoke, #f9f5f2); background: rgba(241, 238, 232, 0.08); }
.site-nav-systems__logo { width: 18px; height: 18px; object-fit: contain; flex: none; }

@media (max-width: 1024px) {
  .site-nav > .site-nav-systems { display: none; }
  .site-nav.is-open > .site-nav-systems {
    display: flex; flex-direction: column; align-items: flex-end;
    width: min(260px, calc(100vw - 28px));
    border-top: 1px solid rgba(241, 238, 232, 0.1);
  }
  .site-nav.is-open .site-nav-systems__toggle { width: 100%; justify-content: flex-end; min-height: 44px; }
  .site-nav-systems__menu {
    position: static; min-width: 0; width: 100%;
    background: none; border: 0; backdrop-filter: none; box-shadow: none; padding: 0;
    transform: none; transition: none; display: none;
  }
  .site-nav.is-open .site-nav-systems.is-open .site-nav-systems__menu { display: flex; }
  .site-nav-systems__menu a { padding: 0.5em 0; min-height: 44px; display: flex; align-items: center; justify-content: flex-end; }
}
