/*
  IGST portal.

  A diptych: MU's sunset world on the left, WYD's lich-light on the right, joined by one seam.
  Each world keeps its own colour (sun for MU, lich violet for WYD); the portal itself stays in
  deep indigo and moonlight so neither game's site is copied.
*/

:root {
  --ink: #191630;
  --ink-2: #221e3d;
  --ink-3: #2d2850;
  --moon: #eeeaf6;
  --haze: #aaa5c2;
  --sun: #f2b24c;
  --sun-deep: #c9771e;
  --lich: #ac8cff;
  --spectre: #82e6ff;

  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: "Instrument Sans", "Segoe UI", sans-serif;

  --gutter: clamp(1rem, 4vw, 3rem);
  --measure: 76rem;
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--moon);
  font: 400 1.0625rem/1.6 var(--body);
  overflow-x: clip;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0.005em;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--moon);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--moon);
  color: var(--ink);
}

.skip:focus {
  top: 1rem;
}

/* ---- Top bar ------------------------------------------------------------------------------ */

.bar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem var(--gutter);
}

.mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

/* The team mark: MU's sun meeting WYD's lich-light, the same seam as the hero. */
.mark-glyph {
  font: 900 2.1rem/1 var(--display);
  letter-spacing: 0.02em;
  background: linear-gradient(100deg, var(--sun) 0 46%, var(--moon) 50%, var(--lich) 54% 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mark-name {
  font-size: 0.78rem;
  line-height: 1.15;
  color: var(--haze);
}

.bar nav {
  display: flex;
  gap: 1.5rem;
  font-weight: 500;
  font-size: 0.95rem;
}

.bar nav a {
  text-decoration: none;
  color: var(--moon);
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.7);
}

.bar nav a:hover {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

/* ---- The diptych -------------------------------------------------------------------------- */

.diptych {
  position: relative;
  display: flex;
  min-height: max(40rem, min(100svh, 62rem));
  background: var(--ink);
  overflow: clip;
}

.headline {
  position: absolute;
  z-index: 5;
  top: clamp(5.5rem, 13vh, 8rem);
  left: 50%;
  translate: -50% 0;
  width: min(44rem, calc(100% - 2 * var(--gutter)));
  text-align: center;
  pointer-events: none;
}

/* A pool of night behind the words, so they read over either world. */
.headline::before {
  content: "";
  position: absolute;
  inset: -3rem -6rem;
  z-index: -1;
  background: radial-gradient(closest-side, rgb(25 22 48 / 0.85), rgb(25 22 48 / 0.55) 60%, transparent);
}

.headline h1 span {
  display: block;
}

.headline h1 {
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 900;
  text-shadow: 0 4px 30px rgb(10 8 24 / 0.75);
}

.headline p {
  max-width: 36rem;
  margin: 1rem auto 0;
  font-size: 1.12rem;
  color: var(--moon);
  text-shadow: 0 1px 12px rgb(10 8 24 / 0.95);
}

.world {
  position: relative;
  isolation: isolate;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  transition: flex-grow 700ms cubic-bezier(0.22, 0.8, 0.25, 1);
}

/* Point at a world, or tab into it, and it opens up. */
.diptych:has(.world-mu:hover, .world-mu:focus-within) .world-mu,
.diptych:has(.world-wyd:hover, .world-wyd:focus-within) .world-wyd {
  flex-grow: 1.45;
}

.world-art {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* A dark sky over the headline and a floor under the words, on both halves. */
.world::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.world-mu .world-art {
  object-position: 78% 40%;
}

.world-mu::after {
  background:
    linear-gradient(to bottom, rgb(25 22 48 / 0.85), rgb(25 22 48 / 0.15) 38%, transparent 50%),
    linear-gradient(to top, rgb(25 22 48 / 0.97) 4%, rgb(25 22 48 / 0.55) 34%, transparent 58%),
    linear-gradient(to right, rgb(25 22 48 / 0.55), transparent 55%);
}

.world-wyd {
  background: #1a1238;
}

.world-wyd .world-art {
  opacity: 0.55;
  mix-blend-mode: luminosity;
}

.world-wyd::after {
  background:
    radial-gradient(45% 55% at 30% 52%, rgb(130 230 255 / 0.18), transparent 70%),
    linear-gradient(to bottom, rgb(25 22 48 / 0.85), rgb(25 22 48 / 0.1) 40%, transparent 50%),
    linear-gradient(to top, rgb(25 22 48 / 0.97) 4%, rgb(25 22 48 / 0.5) 34%, transparent 58%),
    linear-gradient(to left, rgb(25 22 48 / 0.5), rgb(70 40 140 / 0.35) 60%, transparent);
}

.wyd-lich {
  position: absolute;
  z-index: -2;
  left: clamp(-4rem, -2vw, 0rem);
  bottom: 0;
  height: 70%;
  width: auto;
  max-width: none;
  filter: drop-shadow(0 0 40px rgb(130 230 255 / 0.25));
}

.world-copy {
  display: grid;
  gap: 1rem;
  width: 100%;
  max-width: 30rem;
  padding: 0 var(--gutter) clamp(2.5rem, 7vh, 4.5rem);
}

.world-wyd .world-copy {
  margin-left: auto;
  justify-items: end;
  text-align: right;
}

.world h2 {
  font-size: clamp(1.9rem, 3.2vw, 2.7rem);
  text-shadow: 0 2px 16px rgb(10 8 24 / 0.9);
}

.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  font-size: 0.95rem;
  color: var(--haze);
}

.world-wyd .facts {
  justify-content: flex-end;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}

.status::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

.status-live {
  color: #8ff0b5;
}

.status-live::before {
  background: #5fe398;
  box-shadow: 0 0 0 3px rgb(95 227 152 / 0.25);
}

.status-dev {
  color: var(--sun);
}

.status-dev::before {
  background: var(--sun);
  box-shadow: 0 0 0 3px rgb(242 178 76 / 0.25);
}

/* Calls to action: solid in the world's own colour. */
.go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  margin-top: 0.4rem;
  padding: 0.6rem 1.6rem;
  font: 800 1.2rem/1 var(--display);
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 2px;
  transition: filter 160ms ease, translate 160ms ease;
}

.go:hover {
  filter: brightness(1.12);
  translate: 0 -1px;
}

.go-mu {
  color: #2b1704;
  background: linear-gradient(to bottom, #ffd27f, var(--sun) 45%, var(--sun-deep));
  box-shadow: 0 10px 30px rgb(242 178 76 / 0.25);
}

.go-wyd {
  color: #160c33;
  background: linear-gradient(to bottom, #d9c9ff, var(--lich) 45%, #7a58e6);
  box-shadow: 0 10px 30px rgb(172 140 255 / 0.3);
}

/* The MU International emblem, as it appears on the MU site. */
.mu-emblem {
  position: relative;
  display: grid;
  place-items: center;
  width: min(19rem, 70vw);
  aspect-ratio: 1005 / 442;
  margin-left: -1rem;
}

.mu-plate,
.mu-tribal {
  position: absolute;
  inset: 0;
  background: center / contain no-repeat;
}

.mu-plate {
  inset: 12% 0;
  background-image: url("/assets/mu-plate.webp");
}

.mu-tribal {
  background-image: url("/assets/mu-tribal.webp");
  filter: drop-shadow(0 0 14px rgb(242 178 76 / 0.35));
}

.mu-words {
  position: relative;
  display: grid;
  justify-items: center;
  margin-top: -2%;
  font-family: "Grenze Gotisch", serif;
  font-size: 0.55rem;
  line-height: 0.8;
}

.mu-mu {
  font-size: 7.4em;
  font-weight: 800;
  background: linear-gradient(to bottom, #fff3cf, #fde7a6 22%, #e9c46a 48%, #7a5220 66%, #e9c46a 84%, #fff0c0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 rgb(40 22 4 / 0.9));
}

.mu-intl {
  margin-top: 0.15em;
  font-size: 1.85em;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #dfe9ff;
  text-shadow: 0 0 10px rgb(111 179 255 / 0.85), 0 2px 2px rgb(0 0 0 / 0.9);
}

.wyd-logo {
  width: min(15rem, 60vw);
  height: auto;
  margin-right: -0.5rem;
  filter: drop-shadow(0 6px 20px rgb(0 0 0 / 0.6));
}

/* The seam between the worlds: sun light running into lich light, with the team's gem on it. */
.seam {
  position: relative;
  z-index: 4;
  flex: none;
  width: 0;
}

.seam::before {
  content: "";
  position: absolute;
  inset: 0 -1px;
  background: linear-gradient(to bottom, transparent, var(--sun) 25%, var(--moon) 50%, var(--lich) 75%, transparent);
  box-shadow: 0 0 18px rgb(238 234 246 / 0.45);
  transform-origin: top;
  animation: seam 1.4s 0.2s cubic-bezier(0.22, 0.8, 0.25, 1) both;
}

.seam-gem {
  position: absolute;
  top: 58%;
  left: 50%;
  width: 0.9rem;
  height: 0.9rem;
  translate: -50% -50%;
  rotate: 45deg;
  background: linear-gradient(135deg, var(--sun) 0 50%, var(--lich) 50% 100%);
  outline: 2px solid var(--moon);
  outline-offset: 3px;
  box-shadow: 0 0 24px rgb(238 234 246 / 0.6);
}

@keyframes seam {
  from {
    scale: 1 0;
    opacity: 0;
  }
}

/* ---- Story -------------------------------------------------------------------------------- */

.story {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(5rem, 11vw, 9rem) var(--gutter);
}

.story-copy {
  display: grid;
  gap: 1.15rem;
  align-content: start;
  max-width: 38rem;
}

.story-copy h2 {
  font-size: clamp(2.6rem, 5.5vw, 4.4rem);
  margin-bottom: 0.6rem;
}

.story-copy h2 span {
  display: block;
}

.story-copy p {
  color: #d6d1e6;
}

.story-copy .lede {
  font-size: 1.28rem;
  line-height: 1.5;
  color: var(--moon);
}

.mu-ink {
  color: var(--sun);
}

.wyd-ink {
  color: var(--lich);
}

/* How we got here: a real sequence, so a line runs down through it. */
.path {
  list-style: none;
  margin: 0;
  padding: 0.6rem 0 0 1.6rem;
  border-left: 1px solid var(--ink-3);
  display: grid;
  gap: 2.2rem;
  align-content: start;
}

.path li {
  position: relative;
  display: grid;
  gap: 0.3rem;
}

.path li::before {
  content: "";
  position: absolute;
  left: calc(-1.6rem - 0.35rem);
  top: 0.35rem;
  width: 0.7rem;
  height: 0.7rem;
  rotate: 45deg;
  background: var(--ink);
  border: 1px solid var(--haze);
}

.path .path-wyd::before {
  background: var(--lich);
  border-color: var(--lich);
  box-shadow: 0 0 14px rgb(172 140 255 / 0.6);
}

.path .path-mu::before {
  background: var(--sun);
  border-color: var(--sun);
  box-shadow: 0 0 14px rgb(242 178 76 / 0.6);
}

.when {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--haze);
}

.path-wyd .when {
  color: var(--lich);
}

.path-mu .when {
  color: var(--sun);
}

.path h3 {
  font-size: 1.85rem;
}

.path p:last-child {
  color: var(--haze);
}

/* ---- Pick your world ---------------------------------------------------------------------- */

.next {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(4rem, 9vw, 7rem);
}

.next h2 {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  margin-bottom: 1.5rem;
}

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

.door {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  gap: 0.5rem;
  align-content: end;
  min-height: 15rem;
  padding: 1.75rem;
  text-decoration: none;
  border: 1px solid var(--ink-3);
  background: var(--ink-2);
}

.door::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: center / cover no-repeat;
  opacity: 0.35;
  transition: opacity 300ms ease, scale 600ms ease;
}

.door-mu::before {
  background-image: linear-gradient(to top, var(--ink-2) 15%, transparent), url("/assets/mu-world.webp");
  background-position: 0 0, 70% 40%;
}

.door-wyd::before {
  background:
    linear-gradient(to top, var(--ink-2) 15%, transparent 70%),
    url("/assets/wyd-lich.webp") right 8% top 0.5rem / auto 120% no-repeat,
    radial-gradient(50% 80% at 80% 30%, rgb(130 230 255 / 0.35), transparent 70%),
    linear-gradient(to left, #3b2580, var(--ink-2));
}

.door:hover::before {
  opacity: 0.55;
  scale: 1.03;
}

.door-mu:hover {
  border-color: var(--sun);
}

.door-wyd:hover {
  border-color: var(--lich);
}

.door-name {
  font: 800 2.2rem/1 var(--display);
}

.door-mu .door-name {
  color: var(--sun);
}

.door-wyd .door-name {
  color: var(--lich);
}

.door-line {
  max-width: 30rem;
  color: var(--moon);
}

.door-host {
  font-size: 0.9rem;
  color: var(--haze);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.community {
  margin-top: 1.5rem;
  color: var(--haze);
}

.community a {
  color: var(--moon);
}

/* ---- Footer ------------------------------------------------------------------------------- */

.foot {
  display: grid;
  gap: 0.6rem;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
  border-top: 1px solid var(--ink-3);
  color: var(--haze);
}

.foot-mark {
  margin-right: 0.4rem;
  font: 900 1.3rem/1 var(--display);
  color: var(--moon);
}

.foot-legal {
  max-width: 60rem;
  font-size: 0.85rem;
}

/* ---- Smaller screens ---------------------------------------------------------------------- */

@media (max-width: 900px) {
  .bar nav a:not(:first-child) {
    display: none;
  }
  .diptych {
    flex-direction: column;
    min-height: 0;
  }
  .headline {
    position: relative;
    top: auto;
    left: auto;
    translate: none;
    width: auto;
    padding: 6.5rem var(--gutter) 2.5rem;
    text-align: left;
  }
  .headline p {
    margin-left: 0;
  }
  .world {
    min-height: 34rem;
  }
  .world-mu .world-art {
    object-position: 82% 40%;
  }
  .mu-emblem {
    margin-left: -0.5rem;
  }
  .world-wyd .world-copy {
    margin-left: 0;
    justify-items: start;
    text-align: left;
  }
  .world-wyd .facts {
    justify-content: flex-start;
  }
  .wyd-lich {
    left: auto;
    right: -3rem;
    top: 1rem;
    bottom: auto;
    height: 70%;
  }
  .seam {
    width: auto;
    height: 0;
  }
  .seam::before {
    inset: -1px 0;
    background: linear-gradient(to right, transparent, var(--sun) 25%, var(--moon) 50%, var(--lich) 75%, transparent);
    transform-origin: left;
    animation-name: seam-x;
  }
  .seam-gem {
    top: 50%;
  }
  .story {
    grid-template-columns: 1fr;
  }
  .doors {
    grid-template-columns: 1fr;
  }
}

@keyframes seam-x {
  from {
    scale: 0 1;
    opacity: 0;
  }
}

@media (max-width: 480px) {
  .mark-name {
    display: none;
  }
  .world {
    min-height: 32rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- 404 ---------------------------------------------------------------------------------- */

.lost {
  display: grid;
  gap: 1.25rem;
  align-content: center;
  justify-items: start;
  min-height: 100svh;
  max-width: 40rem;
  margin: 0 auto;
  padding: 3rem var(--gutter);
}

.lost h1 {
  font-size: clamp(2.6rem, 7vw, 4.2rem);
}

.lost p {
  color: var(--haze);
}

.lost-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
