:root {
  --portal-ink: #0c1119;
  --portal-panel: #141c28;
  --portal-panel-soft: #192433;
  --portal-line: rgba(161, 181, 207, .16);
  --portal-gold: #e4b567;
  --portal-cyan: #5fd0cf;
  --portal-text: #edf3fb;
  --portal-muted: #9aa9bc;
}

.md-grid:has(.wiki-home) {
  max-width: 90rem;
}

.md-content__inner:has(.wiki-home) {
  padding-top: 1.25rem;
}

.md-content__inner:has(.wiki-home) > h1 {
  display: none;
}

.wiki-home,
.wiki-home *,
.wiki-home *::before,
.wiki-home *::after {
  box-sizing: border-box;
}

.wiki-home {
  color: var(--portal-text);
}

.portal-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(26rem, .8fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  overflow: hidden;
  min-height: 26rem;
  padding: clamp(2rem, 5vw, 4.25rem);
  border: 1px solid var(--portal-line);
  border-radius: 1rem;
  background:
    radial-gradient(circle at 82% 20%, rgba(95, 208, 207, .15), transparent 26rem),
    radial-gradient(circle at 5% 120%, rgba(228, 181, 103, .17), transparent 28rem),
    linear-gradient(135deg, #182332 0%, #0d141e 74%);
  box-shadow: 0 1.5rem 3.8rem rgba(0, 0, 0, .22);
}

.portal-hero::after {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
  background-size: 32px 32px;
  content: "";
  pointer-events: none;
  mask-image: linear-gradient(90deg, transparent, #000 56%);
}

.portal-hero__copy,
.portal-facts {
  position: relative;
  z-index: 1;
}

.md-typeset .portal-hero h1 {
  max-width: 44rem;
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 4vw, 3.65rem);
  font-weight: 780;
  line-height: 1.02;
  letter-spacing: -.045em;
}

.md-typeset .portal-hero__copy > p {
  max-width: 40rem;
  margin: 1rem 0 0;
  color: #b7c3d2;
  font-size: .82rem;
  line-height: 1.68;
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  margin-top: 1.35rem;
}

.md-typeset .portal-button {
  display: inline-flex;
  min-height: 2.45rem;
  align-items: center;
  justify-content: center;
  padding: .55rem .9rem;
  color: var(--portal-text);
  border: 1px solid rgba(161, 181, 207, .28);
  border-radius: .35rem;
  background: rgba(17, 26, 38, .8);
  font-size: .67rem;
  font-weight: 800;
  text-decoration: none;
  transition: border-color .16s ease, transform .16s ease, background .16s ease;
}

.md-typeset .portal-button:hover {
  color: #fff;
  border-color: rgba(228, 181, 103, .58);
  transform: translateY(-1px);
}

.md-typeset .portal-button--primary {
  color: #111823;
  border-color: var(--portal-gold);
  background: linear-gradient(135deg, #f0ca88, #c58d46);
  box-shadow: 0 .55rem 1.25rem rgba(197, 141, 70, .16);
}

.md-typeset .portal-button--primary:hover {
  color: #111823;
  background: linear-gradient(135deg, #f7d99e, #d19a53);
}

.md-typeset .portal-text-link {
  padding: .45rem .35rem;
  color: #b9c6d6;
  font-size: .65rem;
  font-weight: 700;
  text-decoration: none;
}

.md-typeset .portal-text-link:hover {
  color: var(--portal-gold);
}

.portal-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(95, 208, 207, .2);
  border-radius: .7rem;
  background: rgba(7, 13, 20, .56);
  box-shadow: 0 1rem 2.4rem rgba(0, 0, 0, .2);
}

.portal-facts div {
  display: grid;
  min-height: 5.2rem;
  align-content: center;
  padding: .8rem 1rem;
  border-right: 1px solid var(--portal-line);
  border-bottom: 1px solid var(--portal-line);
}

.portal-facts div:nth-child(2n) {
  border-right: 0;
}

.portal-facts div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.portal-facts strong {
  color: #f7d79f;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.portal-facts span {
  margin-top: .08rem;
  color: var(--portal-muted);
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.portal-section {
  margin-top: 3.2rem;
}

.portal-section__heading {
  margin-bottom: 1rem;
}

.md-typeset .portal-section__heading h2 {
  margin: 0;
  color: var(--portal-text);
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  font-weight: 760;
  letter-spacing: -.025em;
}

.md-typeset .portal-section__heading > p:last-child {
  margin: .25rem 0 0;
  color: var(--portal-muted);
  font-size: .7rem;
}

.portal-task-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
}

.md-typeset .portal-task {
  position: relative;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  min-height: 7rem;
  overflow: hidden;
  padding: 1rem;
  color: var(--portal-text);
  border: 1px solid var(--portal-line);
  border-radius: .65rem;
  background: linear-gradient(145deg, rgba(25, 36, 51, .92), rgba(13, 20, 30, .97));
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease;
}

.md-typeset .portal-task::after {
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--portal-gold), transparent);
  content: "";
  opacity: 0;
  transition: opacity .16s ease;
}

.md-typeset .portal-task:hover {
  color: var(--portal-text);
  border-color: rgba(228, 181, 103, .46);
  transform: translateY(-2px);
}

.md-typeset .portal-task:hover::after {
  opacity: 1;
}

.portal-task img {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
  filter: drop-shadow(0 .35rem .65rem rgba(0, 0, 0, .38));
}

.portal-task > span {
  display: grid;
  gap: .2rem;
  min-width: 0;
}

.portal-task strong {
  color: #f4f7fb;
  font-size: .76rem;
}

.portal-task small {
  color: var(--portal-muted);
  font-size: .62rem;
  line-height: 1.45;
}

.portal-task > i {
  align-self: start;
  color: rgba(228, 181, 103, .5);
  font-size: .54rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .08em;
}

.portal-start-flow {
  margin-top: 3.2rem;
  scroll-margin-top: 5rem;
}

.portal-start-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.portal-start-card {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: .8rem;
  min-height: 9rem;
  padding: 1.15rem;
  border: 1px solid var(--portal-line);
  border-radius: .65rem;
  background:
    radial-gradient(circle at 0 100%, rgba(228, 181, 103, .07), transparent 16rem),
    #111925;
}

.portal-start-card__number {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  color: var(--portal-gold);
  border: 1px solid rgba(228, 181, 103, .38);
  border-radius: 50%;
  background: rgba(5, 10, 16, .28);
  font-size: .68rem;
  font-weight: 800;
}

.portal-start-card > div {
  min-width: 0;
}

.md-typeset .portal-start-card h3 {
  margin: .15rem 0 0;
  color: var(--portal-text);
  font-size: .83rem;
}

.md-typeset .portal-start-card p {
  margin: .35rem 0 0;
  color: var(--portal-muted);
  font-size: .64rem;
  line-height: 1.5;
}

.md-typeset .portal-inline-action {
  display: inline-flex;
  margin-top: .75rem;
  color: #f2cc8d;
  font-size: .62rem;
  font-weight: 800;
  text-decoration: none;
}

.md-typeset .portal-inline-action:hover {
  color: #ffe2af;
}

.portal-downloads {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .4rem;
  margin-top: .75rem;
}

.portal-download {
  display: grid;
  gap: .1rem;
  min-height: 3.15rem;
  align-content: center;
  padding: .55rem .65rem;
  border: 1px solid rgba(95, 208, 207, .24);
  border-radius: .38rem;
  background: rgba(5, 10, 16, .28);
}

.portal-download strong {
  color: var(--portal-text);
  font-size: .61rem;
}

.portal-download small {
  color: var(--portal-muted);
  font-size: .5rem;
}

.portal-download--pending {
  cursor: not-allowed;
  opacity: .62;
}

.portal-change-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}

.md-typeset .portal-change-card {
  display: flex;
  min-height: 11rem;
  flex-direction: column;
  padding: 1.25rem;
  color: var(--portal-text);
  border: 1px solid var(--portal-line);
  border-radius: .65rem;
  background: linear-gradient(145deg, rgba(25, 36, 51, .92), rgba(13, 20, 30, .97));
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease;
}

.md-typeset .portal-change-card--current {
  border-color: rgba(95, 208, 207, .25);
  background:
    radial-gradient(circle at 100% 0, rgba(95, 208, 207, .09), transparent 18rem),
    linear-gradient(145deg, rgba(25, 36, 51, .92), rgba(13, 20, 30, .97));
}

.md-typeset .portal-change-card:hover {
  color: var(--portal-text);
  border-color: rgba(228, 181, 103, .48);
  transform: translateY(-2px);
}

.portal-change-card > span {
  color: var(--portal-gold);
  font-size: .54rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.portal-change-card > strong {
  margin-top: .55rem;
  color: #f4f7fb;
  font-size: .88rem;
}

.md-typeset .portal-change-card > p {
  max-width: 34rem;
  margin: .45rem 0 .9rem;
  color: var(--portal-muted);
  font-size: .64rem;
  line-height: 1.55;
}

.portal-change-card > i {
  margin-top: auto;
  color: #c8d3df;
  font-size: .58rem;
  font-style: normal;
  font-weight: 700;
}

.portal-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
  margin-top: 3.2rem;
  scroll-margin-top: 5rem;
}

.portal-start,
.portal-updates {
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--portal-line);
  border-radius: .75rem;
  background: #111925;
}

.portal-start {
  background:
    radial-gradient(circle at 0 100%, rgba(228, 181, 103, .09), transparent 18rem),
    #111925;
}

.portal-steps {
  display: grid;
  gap: .45rem;
  margin: 0 0 1.2rem !important;
  padding: 0 !important;
  list-style: none !important;
}

.portal-steps li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: .65rem;
  align-items: center;
  min-height: 3.45rem;
  padding: .5rem .6rem;
  border: 1px solid rgba(161, 181, 207, .12);
  border-radius: .38rem;
  background: rgba(4, 9, 15, .22);
}

.portal-steps li > span {
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  color: var(--portal-gold);
  border: 1px solid rgba(228, 181, 103, .34);
  border-radius: 50%;
  font-size: .62rem;
  font-weight: 800;
}

.portal-steps li > div {
  display: grid;
  gap: .08rem;
}

.portal-steps strong {
  color: var(--portal-text);
  font-size: .7rem;
}

.portal-steps small {
  color: var(--portal-muted);
  font-size: .6rem;
  line-height: 1.4;
}

.portal-updates {
  display: flex;
  flex-direction: column;
}

.md-typeset .portal-updates > a:not(.portal-updates__all) {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr) auto;
  gap: .7rem;
  align-items: center;
  min-height: 4.3rem;
  padding: .65rem 0;
  color: var(--portal-text);
  border-bottom: 1px solid var(--portal-line);
  text-decoration: none;
}

.portal-updates > a > span {
  color: var(--portal-gold);
  font-size: .55rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.portal-updates > a > strong {
  font-size: .68rem;
  line-height: 1.45;
}

.portal-updates > a > i {
  color: var(--portal-gold);
  font-style: normal;
  opacity: .5;
}

.md-typeset .portal-updates__all {
  margin-top: auto;
  padding-top: 1rem;
  color: #c9d4e1;
  font-size: .62rem;
  font-weight: 700;
  text-decoration: none;
}

.portal-destinations {
  display: grid;
  grid-template-columns: minmax(15rem, 1.2fr) repeat(3, minmax(10rem, .8fr));
  align-items: stretch;
  overflow: hidden;
  margin-top: 3.2rem;
  border: 1px solid var(--portal-line);
  border-radius: .7rem;
  background: linear-gradient(135deg, #172130, #0e151f);
}

.portal-destinations > div,
.md-typeset .portal-destinations > a {
  padding: 1.15rem 1.25rem;
  border-right: 1px solid var(--portal-line);
}

.portal-destinations > *:last-child {
  border-right: 0 !important;
}

.md-typeset .portal-destinations h2 {
  margin: 0;
  color: var(--portal-text);
  font-size: 1rem;
}

.md-typeset .portal-destinations > a {
  display: grid;
  align-content: center;
  gap: .18rem;
  color: var(--portal-text);
  text-decoration: none;
}

.md-typeset .portal-destinations > a:hover {
  background: rgba(228, 181, 103, .06);
}

.portal-destinations a strong {
  color: #f3f6fa;
  font-size: .72rem;
}

.portal-destinations a small {
  color: var(--portal-muted);
  font-size: .58rem;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .portal-hero {
    grid-template-columns: minmax(0, 1fr) minmax(21rem, .75fr);
    gap: 2rem;
  }

  .portal-task-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-destinations {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .portal-destinations > div {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 1px solid var(--portal-line);
  }
}

@media (max-width: 720px) {
  .portal-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 1.5rem 1.1rem;
    border-radius: .75rem;
  }

  .md-typeset .portal-hero h1 {
    font-size: 2rem;
  }

  .portal-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .portal-facts div {
    min-height: 4.4rem;
    border-right: 1px solid var(--portal-line);
    border-bottom: 1px solid var(--portal-line);
  }

  .portal-facts div:nth-child(2n) {
    border-right: 1px solid var(--portal-line);
  }

  .portal-facts div:nth-child(3n) {
    border-right: 0;
  }

  .portal-facts div:nth-last-child(-n + 3) {
    border-bottom: 0;
  }

  .portal-split,
  .portal-start-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .md-content__inner:has(.wiki-home) {
    padding-top: .75rem;
  }

  .md-typeset .portal-hero h1 {
    font-size: 1.72rem;
  }

  .portal-actions {
    align-items: stretch;
  }

  .portal-actions .portal-button {
    flex: 1 1 100%;
  }

  .portal-actions .portal-text-link {
    text-align: center;
  }

  .portal-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-facts div:nth-child(3n) {
    border-right: 1px solid var(--portal-line);
  }

  .portal-facts div:nth-child(2n) {
    border-right: 0;
  }

  .portal-facts div:nth-last-child(-n + 3) {
    border-bottom: 1px solid var(--portal-line);
  }

  .portal-facts div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .portal-task-grid,
  .portal-change-grid {
    grid-template-columns: 1fr;
  }

  .portal-section,
  .portal-start-flow,
  .portal-split,
  .portal-destinations {
    margin-top: 2.2rem;
  }

  .md-typeset .portal-updates > a:not(.portal-updates__all) {
    grid-template-columns: 4rem minmax(0, 1fr) auto;
  }

  .portal-destinations {
    grid-template-columns: 1fr;
  }

  .portal-destinations > div {
    grid-column: auto;
  }

  .md-typeset .portal-destinations > a {
    border-right: 0;
    border-bottom: 1px solid var(--portal-line);
  }

  .portal-downloads {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-button,
  .portal-task,
  .portal-change-card {
    transition: none !important;
  }
}
