/* Page chrome: header, navigation, search, page heads, home hero, footer. */

/* ---- header ------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid var(--rule);
  overflow-x: clip;
}

/* The blur lives on a pseudo-element: backdrop-filter on the header itself would
   become the containing block for the fixed mobile menu and trap it inside. */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(19, 9, 24, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  padding: 8px 12px;
  background: var(--bone);
  color: var(--night);
  z-index: 60;
}

.skip-link:focus {
  top: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand__mark {
  width: 30px;
  height: 16px;
  flex-shrink: 0;
}

.brand__name {
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

/* ---- navigation -------------------------------------------------------- */

.site-nav {
  margin-left: auto;
}

.site-nav__list {
  display: flex;
  gap: 4px;
}

.nav-group {
  position: relative;
}

.nav-group__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  background: none;
  border: 0;
  color: var(--bone-2);
  font-size: 0.9375rem;
  font-weight: 500;
  position: relative;
}

.nav-group__btn::after {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.6;
  transition: transform 0.2s var(--ease);
}

.nav-group__btn[aria-expanded='true']::after {
  transform: translateY(1px) rotate(225deg);
}

.nav-group__btn:hover,
.nav-group__btn[aria-expanded='true'] {
  color: var(--bone);
}

/* The section you're in is underlined in its stripe color. */
.nav-group__btn.is-current {
  color: var(--bone);
}

.nav-group__btn.is-current::before {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -12px;
  height: 2px;
  background: var(--tone);
}

.nav-group__panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: 240px;
  padding: 6px;
  background: var(--night-2);
  border: 1px solid var(--rule-2);
  border-top: 2px solid var(--tone);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s var(--ease), visibility 0s 0.15s;
}

/* Right-hand groups open leftward so the panel never pushes past the viewport. */
.nav-group:nth-last-child(-n + 2) .nav-group__panel {
  left: auto;
  right: 0;
}

.nav-group__btn[aria-expanded='true'] + .nav-group__panel {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity 0.15s, transform 0.15s var(--ease);
}

.nav-group__panel a {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 10px;
  text-decoration: none;
  color: var(--bone-2);
  border-radius: 2px;
}

.nav-group__panel a:hover,
.nav-group__panel a[aria-current='page'] {
  background: var(--night-3);
  color: var(--bone);
}

.nav-group__count {
  color: var(--dust);
  font-size: var(--step--1);
}

.nav-link a {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  color: var(--bone-2);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.nav-link a:hover,
.nav-link a[aria-current='page'] {
  color: var(--bone);
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  padding: 2px;
  flex-shrink: 0;
}

.lang-switch button {
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--dust);
  font-size: 0.8125rem;
  font-weight: 500;
}

.lang-switch button[aria-pressed='true'] {
  background: var(--bone);
  color: var(--night);
}

.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  margin-right: -8px;
  background: none;
  border: 0;
  place-items: center;
}

.menu-btn__bars,
.menu-btn__bars::before,
.menu-btn__bars::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--bone);
  transition: transform 0.2s var(--ease);
}

.menu-btn__bars {
  position: relative;
}

.menu-btn__bars::before,
.menu-btn__bars::after {
  content: '';
  position: absolute;
  left: 0;
}

.menu-btn__bars::before {
  top: -6px;
}

.menu-btn__bars::after {
  top: 6px;
}

.menu-open .menu-btn__bars {
  background: transparent;
}

.menu-open .menu-btn__bars::before {
  transform: translateY(6px) rotate(45deg);
}

.menu-open .menu-btn__bars::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---- search ------------------------------------------------------------- */

.search {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  color: var(--dust);
  pointer-events: none;
}

.search__input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 38px;
  background: rgba(235, 230, 215, 0.04);
  border: 1px solid var(--rule-2);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.search__input::placeholder {
  color: var(--dust);
}

.search__input:focus {
  border-color: var(--bone-2);
  background: rgba(235, 230, 215, 0.07);
}

.search__input::-webkit-search-cancel-button {
  filter: invert(0.8);
}

.search__results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 320px;
  max-height: min(440px, 70vh);
  overflow-y: auto;
  padding: 6px;
  background: var(--night-2);
  border: 1px solid var(--rule-2);
  z-index: 10;
}

.search__option {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  text-decoration: none;
  border-radius: 2px;
}

.search__option[aria-selected='true'],
.search__option:hover {
  background: var(--night-3);
}

.search__thumb {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--night-3);
  border-radius: 2px;
}

.search__thumb img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.search__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.search__name,
.search__alt {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search__alt,
.search__kind {
  color: var(--dust);
  font-size: var(--step--1);
}

.search__empty {
  padding: 12px;
  color: var(--dust);
}

.is-home .search--header {
  visibility: hidden;
}

/* ---- responsive header ------------------------------------------------ */

@media (max-width: 959px) {
  .menu-btn {
    display: grid;
  }

  .search--header {
    max-width: none;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 0;
    margin: 0;
    padding: 24px var(--gutter) 48px;
    background: var(--night);
    overflow-y: auto;
    display: none;
  }

  .menu-open .site-nav {
    display: block;
  }

  .menu-open {
    overflow: hidden;
  }

  .site-nav__list {
    flex-direction: column;
    gap: 28px;
  }

  .nav-group__btn {
    pointer-events: none;
    height: auto;
    padding: 0 0 8px;
    width: 100%;
    color: var(--dust);
    font-size: var(--step--1);
    border-bottom: 2px solid var(--tone);
  }

  .nav-group__btn::after,
  .nav-group__btn.is-current::before {
    display: none;
  }

  .nav-group__panel {
    position: static;
    visibility: visible;
    opacity: 1;
    transform: none;
    min-width: 0;
    padding: 4px 0 0;
    background: none;
    border: 0;
  }

  .nav-group__panel a,
  .nav-link a {
    padding: 10px 0;
    height: auto;
    font-size: var(--step-1);
    color: var(--bone);
  }

  .nav-group__panel a:hover {
    background: none;
  }
}

@media (max-width: 560px) {
  .site-header__inner {
    gap: 12px;
  }

  .brand .brand__name {
    display: none;
  }

  .search__results {
    position: fixed;
    top: calc(var(--header-h) - 4px);
    left: 8px;
    right: 8px;
    min-width: 0;
  }
}

/* ---- page heads ---------------------------------------------------------- */

.page-head {
  padding-top: clamp(32px, 6vw, 64px);
  padding-bottom: 28px;
  position: relative;
}

.page-head h1 {
  font-size: var(--step-4);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-head__lede {
  margin-top: 12px;
  max-width: 40em;
  color: var(--bone-2);
  font-size: 1.0625rem;
}

.page-head__meta {
  margin-top: 8px;
  color: var(--dust);
  font-size: var(--step--1);
}

/* A hairline in the section's stripe color, starting from the left edge. */
.page-head::after {
  content: '';
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--tone, var(--bone)) 0 80px, var(--rule) 80px);
}

.page-body {
  padding-top: 28px;
  padding-bottom: 96px;
}

/* ---- home hero ------------------------------------------------------------ */

.hero {
  position: relative;
  overflow: hidden;
  min-height: min(640px, 88vh);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  isolation: isolate;
}

/* Halftone dots fading in from the right, like the print texture of the key art. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 72% 45%, rgba(92, 40, 110, 0.45), transparent 55%),
    radial-gradient(rgba(235, 230, 215, 0.13) 1px, transparent 1.4px) 0 0 / 7px 7px;
  -webkit-mask-image: linear-gradient(90deg, transparent 20%, #000 75%);
  mask-image: linear-gradient(90deg, transparent 20%, #000 75%);
}

.hero__stripes {
  position: absolute;
  z-index: -1;
  top: -10%;
  bottom: -10%;
  left: 58%;
  display: flex;
  gap: 8px;
  transform: skewX(24deg);
  transform-origin: top;
}

.hero__stripes span {
  width: clamp(18px, 2.4vw, 30px);
  background: var(--c);
  animation: stripe-in 0.9s var(--ease) both;
  animation-delay: calc(var(--i) * 70ms);
  transform-origin: top;
}

@keyframes stripe-in {
  from {
    transform: scaleY(0);
  }
}

/* The newest store skin, cut out of its Store Update banner by
   scripts/fetch-store-skin.py. The banners show one or two figures from the
   waist up, so whatever the shape, the image fits a fixed box standing on the
   hero's bottom edge. */
.hero__raider {
  position: absolute;
  z-index: -1;
  right: max(var(--gutter), calc((100vw - var(--page)) / 2 - 40px));
  bottom: 0;
  width: min(46vw, 640px);
  height: 88%;
  object-fit: contain;
  object-position: right bottom;
  filter: drop-shadow(-24px 0 48px rgba(19, 9, 24, 0.7));
  pointer-events: none;
}

.hero__content {
  padding-top: 64px;
  padding-bottom: 72px;
}

.hero__title {
  font-size: var(--step-5);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.hero__title span {
  display: block;
  font-weight: 500;
  letter-spacing: 0;
  margin-top: 0.12em;
}

.hero__lede {
  margin-top: 24px;
  max-width: 26em;
  color: var(--bone-2);
  font-size: var(--step-1);
  line-height: 1.5;
}

.search--hero {
  margin-top: 32px;
  max-width: 480px;
}

.search--hero .search__input {
  height: 52px;
  padding-left: 46px;
  font-size: 1.0625rem;
  background: rgba(19, 9, 24, 0.75);
  border-color: rgba(235, 230, 215, 0.3);
}

.search--hero .search__icon {
  left: 16px;
  width: 20px;
  height: 20px;
}

.hero__meta {
  margin-top: 14px;
  color: var(--dust);
  font-size: var(--step--1);
}

@media (max-width: 859px) {
  .hero {
    align-items: flex-end;
    min-height: 0;
  }

  .hero__stripes {
    left: 62%;
  }

  .hero__raider {
    right: 0;
    bottom: auto;
    top: 16px;
    width: min(64vw, 360px);
    height: auto;
    max-height: 320px;
    object-position: right top;
    -webkit-mask-image: linear-gradient(#000 55%, transparent 92%);
    mask-image: linear-gradient(#000 55%, transparent 92%);
  }

  .hero__content {
    padding-top: 220px;
    padding-bottom: 40px;
  }
}

/* ---- footer ------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--night-2);
  padding: 56px 0 32px;
  font-size: 0.9375rem;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 40px;
}

.site-footer__about p {
  margin-top: 14px;
  max-width: 30em;
  color: var(--bone-2);
}

.site-footer__about p.muted {
  color: var(--dust);
  font-size: var(--step--1);
}

.site-footer h2 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dust);
  margin-bottom: 14px;
}

.site-footer__col p {
  font-size: var(--step--1);
  margin-bottom: 10px;
}

.site-footer li + li {
  margin-top: 8px;
}

.site-footer__col a {
  color: var(--bone-2);
  text-decoration: none;
}

.site-footer__col a:hover {
  color: var(--bone);
  text-decoration: underline;
}

.site-footer__legal {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  color: var(--dust);
  font-size: 0.75rem;
  line-height: 1.5;
}

.site-footer__legal summary {
  cursor: pointer;
  width: max-content;
  font-size: var(--step--1);
}

.site-footer__legal p {
  margin-top: 8px;
  max-width: 80em;
}

@media (max-width: 859px) {
  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer__about {
    grid-column: 1 / -1;
  }
}
