:root {
  --blue: #0052ff;
  --blue-deep: #0038b8;
  --navy: #050f19;
  --gold: #d4af37;
  --gold-soft: #f2e3b3;
  --white: #ffffff;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: Fraunces, "Times New Roman", serif;
  --font-body: Manrope, system-ui, sans-serif;
  --fs-hero: clamp(92px, 18vw, 248px);
  --fs-display: clamp(64px, 13vw, 168px);
  --fs-title: clamp(44px, 7.2vw, 92px);
  --fs-body: 1.125rem;
  --fs-ui: 0.75rem;
  --lh-display: 0.84;
  --lh-title: 1.02;
  --lh-body: 1.55;
  --track-ui: 0.16em;
}

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

html,
body {
  margin: 0;
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--blue);
}

.skip:focus {
  top: 16px;
}

/* Preloader */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: var(--navy);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}

.preloader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-inner {
  text-align: center;
}

.preloader-inner img {
  width: 88px;
  margin: 0 auto 28px;
}

.preloader-count {
  font-family: var(--font-body);
  letter-spacing: var(--track-ui);
  font-size: var(--fs-ui);
  font-weight: 500;
  color: var(--gold);
}

.preloader-line {
  width: 140px;
  height: 1px;
  margin: 16px auto 0;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.preloader-line span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--blue);
}

/* Nav */

.nav {
  position: fixed;
  top: 20px;
  left: 50%;
  z-index: 40;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 28px;
  height: 48px;
  padding: 0 18px 0 14px;
  background: rgba(5, 15, 25, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px) saturate(140%);
  border-radius: 999px;
  transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
}

.nav.is-away {
  transform: translateX(-50%) translateY(-80px);
  opacity: 0;
}

.nav-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.nav-mark img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.nav-links {
  display: flex;
  gap: 18px;
  font-family: var(--font-body);
  font-size: var(--fs-ui);
  font-weight: 500;
  letter-spacing: var(--track-ui);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.nav-links a:hover {
  color: var(--white);
}

/* Hero */

.hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  will-change: transform;
}

.hero-bg {
  inset: -12% 0;
  background-image: url("../img/bg/hero.jpg");
}

.hero-fog {
  background:
    linear-gradient(180deg, rgba(5, 15, 25, 0.15) 0%, transparent 30%, rgba(5, 15, 25, 0.2) 70%, var(--navy) 100%),
    radial-gradient(ellipse at 50% 80%, rgba(0, 82, 255, 0.18), transparent 55%);
  pointer-events: none;
}

.hero-title {
  position: absolute;
  top: 11vh;
  left: 0;
  right: 0;
  z-index: 2;
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: var(--fs-hero);
  line-height: var(--lh-display);
  letter-spacing: -0.045em;
  color: var(--gold-soft);
  pointer-events: none;
}

.hero-title span {
  display: block;
  margin-top: 0.04em;
  font-style: italic;
  font-weight: 400;
  font-size: 0.34em;
  letter-spacing: -0.03em;
  color: var(--gold);
}

.hero-cat {
  position: absolute;
  left: 50%;
  bottom: 4vh;
  z-index: 3;
  width: min(520px, 70vw);
  transform: translateX(-50%);
  filter: drop-shadow(0 30px 40px rgba(5, 15, 25, 0.45));
  pointer-events: none;
}

.hero-coin {
  position: absolute;
  z-index: 4;
  width: clamp(48px, 6vw, 84px);
  filter: drop-shadow(0 10px 18px rgba(5, 15, 25, 0.4));
}

.hero-coin.l {
  left: 10vw;
  top: 42%;
}

.hero-coin.r {
  right: 11vw;
  top: 56%;
}

.scroll-hint {
  position: absolute;
  bottom: 22px;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: var(--fs-ui);
  font-weight: 500;
  letter-spacing: var(--track-ui);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

/* Lore */

.lore {
  position: relative;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 120px 8vw;
  overflow: hidden;
}

.lore-bg {
  position: absolute;
  inset: -16% 0;
  background: url("../img/bg/lore.jpg") center / cover no-repeat;
  will-change: transform;
}

.lore-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(5, 15, 25, 0.82) 0%, rgba(5, 15, 25, 0.38) 100%);
}

.lore-mist {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse at 50% 40%, rgba(0, 82, 255, 0.16), transparent 50%),
    linear-gradient(180deg, rgba(5, 15, 25, 0.35), transparent 40%, rgba(5, 15, 25, 0.55));
  pointer-events: none;
}

.lore-panel {
  position: relative;
  z-index: 2;
  max-width: 18em;
}

.lore h2 {
  margin: 0 0 28px;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: var(--fs-title);
  line-height: var(--lh-title);
  letter-spacing: -0.035em;
}

.lore h2 .w {
  display: inline-block;
}

.lore p {
  margin: 0;
  max-width: 34em;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: rgba(255, 255, 255, 0.82);
}

.display {
  margin: 0;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: -0.045em;
}

/* Descent through clouds */

.descent {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.descent-bg {
  position: absolute;
  inset: -18% 0;
  z-index: 0;
  background: url("../img/bg/clouds.jpg") center / cover no-repeat;
  will-change: transform;
}

.descent-title {
  position: absolute;
  top: 7vh;
  left: 0;
  right: 0;
  z-index: 4;
  text-align: center;
  pointer-events: none;
}

.descent-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding-top: 8vh;
  pointer-events: none;
}

.descent-video {
  display: block;
  width: min(760px, 78vw);
  aspect-ratio: 736 / 400;
  height: auto;
  object-fit: cover;
  background: #050f19;
  border-radius: 16px;
  outline: 1px solid rgba(242, 227, 179, 0.42);
  outline-offset: 0;
  box-shadow: 0 28px 48px rgba(5, 15, 25, 0.55);
  will-change: transform;
}

.descent-fog {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: radial-gradient(ellipse at 50% 60%, transparent 20%, rgba(5, 15, 25, 0.35) 80%);
  pointer-events: none;
}

/* Horizontal memes */

.journey {
  position: relative;
  overflow: hidden;
  background: var(--navy);
}

.journey-title {
  position: absolute;
  top: 7vh;
  left: 8vw;
  z-index: 3;
  pointer-events: none;
}

.journey-track {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 100vh;
  padding: 0 10vw;
  width: max-content;
}

.journey-track figure {
  margin: 0;
  flex: none;
  width: min(52vw, 620px);
  transform: scale(0.84);
  opacity: 0.38;
  transform-origin: center center;
  will-change: transform, opacity;
}

.journey-track figure.is-focus {
  transform: scale(1);
  opacity: 1;
}

.journey-track img {
  width: 100%;
  height: 68vh;
  object-fit: cover;
}

/* Stickers */

.archive {
  position: relative;
  min-height: 110vh;
  overflow: hidden;
  padding: 12vh 6vw 16vh;
}

.archive-bg {
  position: absolute;
  inset: -12% 0;
  background: url("../img/bg/void.jpg") center / cover no-repeat;
}

.archive .display {
  position: relative;
  z-index: 2;
  margin: 0 0 7vh;
}

.float-field {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 36px 18px;
  align-items: center;
  justify-items: center;
}

.float-field img {
  width: min(168px, 16vw);
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.35));
}

.float-field img:nth-child(odd) {
  transform: rotate(-6deg);
}

.float-field img:nth-child(even) {
  transform: rotate(5deg);
}

/* Ending seal */

.ending {
  position: relative;
  height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.ending-bg {
  position: absolute;
  inset: -12% 0;
  background: url("../img/bg/void.jpg") center / cover no-repeat;
}

.ending-fog {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 55%, rgba(0, 82, 255, 0.18), rgba(5, 15, 25, 0.55) 62%);
}

.ending-lockup {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  text-align: center;
  padding: 0 8vw;
}

.ending-seal {
  width: min(120px, 22vw);
  margin-bottom: 28px;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.45));
  will-change: transform, opacity;
}

.ending-title {
  max-width: 9em;
}

.ending-links {
  display: flex;
  gap: 28px;
  margin-top: 36px;
  font-family: var(--font-body);
  font-size: var(--fs-ui);
  font-weight: 500;
  letter-spacing: var(--track-ui);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.ending-links a:hover {
  color: var(--white);
}

/* Footer */

.foot {
  padding: 28px 8vw 40px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-body);
  font-size: var(--fs-ui);
  font-weight: 500;
  letter-spacing: var(--track-ui);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.foot a:hover {
  color: var(--white);
}

.lost {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 20px;
}

.lost img {
  width: 72px;
  margin: 0 auto 20px;
}

.lost h1 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: var(--fs-title);
  line-height: var(--lh-title);
  letter-spacing: -0.035em;
  margin: 0 0 12px;
}

.lost p {
  color: rgba(255, 255, 255, 0.65);
}

.lost a {
  display: inline-block;
  margin-top: 20px;
  border-bottom: 1px solid var(--gold);
}

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

@media (max-width: 800px) {
  .nav {
    gap: 12px;
    padding: 0 12px 0 10px;
  }

  .nav-mark span,
  .nav-mark {
    font-size: 1rem;
  }

  .nav-links {
    gap: 12px;
  }

  .hero-title {
    top: 10vh;
  }

  .lore-panel {
    max-width: none;
  }

  .journey-title {
    left: 22px;
  }

  .hero-cat {
    width: min(420px, 88vw);
    bottom: 8vh;
  }

  .hero-coin {
    width: 44px;
  }

  .lore {
    padding: 88px 22px;
  }

  .descent-video {
    width: min(760px, 88vw);
  }

  .journey-track figure {
    width: 78vw;
  }

  .journey-track img {
    height: 56vh;
  }

  .float-field {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 12px;
  }

  .float-field img {
    width: min(168px, 38vw);
  }

  .foot {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .preloader {
    animation: none !important;
    transition: none !important;
  }

  .descent-video {
    display: none;
  }
}
