:root {
  color-scheme: dark;
  --ink: #fff8ed;
  --muted: rgba(255, 248, 237, .72);
  --fine: rgba(255, 248, 237, .42);
  --paper: #f5f1e8;
  --charcoal: #11100e;
  --gold: #d8b46a;
  --star-sky: url("https://unpkg.com/three-globe/example/img/night-sky.png");
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--charcoal);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

.site-shell {
  width: 100%;
  min-width: 320px;
  overflow-x: hidden;
  background: #050507 var(--star-sky);
  background-position: center;
  background-size: cover;
}

.hero {
  --hero-gutter: 22px;
  --hero-header-height: max(55px, calc(45px + env(safe-area-inset-top)));
  position: relative;
  z-index: 2;
  min-height: 94dvh;
  padding: 0 var(--hero-gutter) max(24px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: var(--hero-header-height) 1fr auto;
  isolation: isolate;
  overflow: visible;
}

.hero-image,
.hero-shade {
  position: absolute;
  top: var(--hero-header-height);
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: calc(100% - var(--hero-header-height));
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 74%, rgba(0, 0, 0, .42) 88%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 74%, rgba(0, 0, 0, .42) 88%, rgba(0, 0, 0, 0) 100%);
}

.hero-image {
  object-fit: cover;
  object-position: 28% center;
  z-index: -3;
}

.hero-shade {
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .46) 0%, rgba(0, 0, 0, .08) 28%, rgba(0, 0, 0, .22) 58%, rgba(0, 0, 0, .8) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, .76) 0%, rgba(0, 0, 0, .24) 58%, rgba(0, 0, 0, .08) 100%);
}

.hero-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: calc(100% + (var(--hero-gutter) * 2));
  min-height: var(--hero-header-height);
  margin-inline: calc(var(--hero-gutter) * -1);
  padding: max(8px, env(safe-area-inset-top)) var(--hero-gutter) 8px;
  background: #000;
  color: rgba(255, 248, 237, .9);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hero-nav,
.hero-content,
.hero-footer {
  position: relative;
  z-index: 5;
}

.brand,
.edition {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.edition {
  color: var(--muted);
  letter-spacing: .02em;
  text-align: right;
  text-transform: none;
}

.hero-content {
  align-self: center;
  justify-self: center;
  width: 100%;
  padding-top: 48px;
  text-align: center;
}

.archive-number {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 {
  margin: 0 auto;
  max-width: 330px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 58px;
  line-height: .9;
  font-weight: 400;
  letter-spacing: 0;
  text-wrap: balance;
}

h1 span {
  display: inline;
  font-variant-numeric: lining-nums tabular-nums;
}

.hero-kicker,
.still-counting {
  margin: 0;
  color: rgba(255, 248, 237, .78);
  font-size: 12px;
  letter-spacing: .14em;
  line-height: 1.5;
  text-transform: uppercase;
}

.hero-kicker {
  margin-bottom: 12px;
}

.still-counting {
  margin-top: 14px;
  color: var(--gold);
}

.hero-footer {
  display: grid;
  gap: 0;
}

.scroll-cue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  width: 44px;
  justify-self: center;
  color: rgba(255, 248, 237, .88);
}

.scroll-cue span {
  color: var(--gold);
  font-size: 19px;
  line-height: 1;
  animation: arrowDown 1.45s ease-in-out infinite;
}

@keyframes arrowDown {
  0%, 100% {
    opacity: .58;
    transform: translateY(-3px);
  }

  50% {
    opacity: 1;
    transform: translateY(4px);
  }
}

.memory-map {
  position: relative;
  z-index: 1;
  min-height: calc(132dvh + 32px);
  margin-top: -32px;
  padding: 66px 22px 118px;
  background: transparent;
  color: var(--ink);
  overflow: hidden;
}

.memory-map::before {
  content: "";
  position: absolute;
  top: -72px;
  left: 0;
  right: 0;
  z-index: 0;
  height: 170px;
  background: linear-gradient(180deg, rgba(5, 5, 7, 0) 0%, rgba(5, 5, 7, .22) 52%, rgba(5, 5, 7, 0) 100%);
  pointer-events: none;
}

.section-heading,
.globe-stage {
  position: relative;
}

.section-heading {
  z-index: 5;
}

.section-heading p {
  margin: 0;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.globe-stage {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  touch-action: none;
}

.globe-stage.is-focusing #memoryGlobe canvas {
  filter: saturate(1.1) contrast(1.06);
  transition: filter 800ms ease;
}

#memoryGlobe {
  position: absolute;
  inset: 0;
  background: transparent;
  touch-action: none;
}

#memoryGlobe canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none !important;
}

.globe-hit {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  pointer-events: auto !important;
  transform: translate(-50%, -50%);
  touch-action: none;
}

.globe-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 0;
  margin: 0;
  color: rgba(255, 248, 237, .48);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  transform: translate(-50%, -50%);
}

.globe-ready .globe-loading {
  display: none;
}

.next-destination {
  position: relative;
  z-index: 5;
  margin: 0 auto;
  margin-top: calc(100dvh - 142px);
  width: min(100%, 390px);
  display: grid;
  gap: 12px;
  color: var(--ink);
}

.next-destination-form {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 12px;
}

.next-destination-label {
  min-width: 0;
  display: flex;
  flex: 1 1 auto;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
  color: rgba(255, 248, 237, .82);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: 0;
}

.next-destination-copy {
  flex: 0 0 auto;
  white-space: nowrap;
}

.next-destination-input {
  min-width: 0;
  width: 116px;
  padding: 0 2px 5px;
  border: 0;
  border-bottom: 1px solid rgba(216, 180, 106, .72);
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: center;
}

.next-destination-input::placeholder {
  color: rgba(255, 248, 237, .34);
}

.next-destination-input:focus {
  border-bottom-color: rgba(255, 248, 237, .9);
}

.next-destination-submit {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(216, 180, 106, .42);
  border-radius: 999px;
  background: rgba(5, 5, 7, .28);
  color: var(--gold);
  font: 11px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.next-destination-status {
  min-height: 15px;
  margin: 0;
  color: rgba(255, 248, 237, .54);
  font-size: 11px;
  letter-spacing: .08em;
  line-height: 1.35;
  text-align: center;
  text-transform: uppercase;
}

.private-screening {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  margin-top: -88px;
  padding: 132px 18px max(34px, calc(env(safe-area-inset-bottom) + 28px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  background: transparent;
  color: var(--ink);
  isolation: isolate;
  overflow: hidden;
}

.private-screening::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .34) 15%, rgba(0, 0, 0, .86) 34%, rgba(0, 0, 0, .62) 70%, #050507 100%),
    linear-gradient(90deg, rgba(0, 0, 0, .78), rgba(0, 0, 0, .22), rgba(0, 0, 0, .78));
}

.screening-heading {
  align-self: start;
  transform: translateY(-18px);
}

.screening-copy {
  align-self: end;
  text-align: center;
}

.screening-copy p {
  margin: 0;
  color: rgba(255, 248, 237, .84);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 27px;
  line-height: 1.05;
  letter-spacing: 0;
}

.screen-frame {
  position: relative;
  align-self: start;
  width: min(94%, 390px);
  margin: 0 auto;
  padding: 6px;
  border: 1px solid rgba(216, 180, 106, .34);
  border-radius: 4px;
  overflow: hidden;
  perspective: 900px;
  background:
    linear-gradient(180deg, rgba(255, 248, 237, .075), rgba(255, 248, 237, .016)),
    rgba(8, 8, 8, .34);
  box-shadow:
    0 28px 88px rgba(0, 0, 0, .48),
    inset 0 0 0 1px rgba(255, 248, 237, .08);
}

.screen-frame::before {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: 1;
  border: 1px solid rgba(255, 248, 237, .1);
  pointer-events: none;
}

.screen-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.screen-toggle:focus-visible + .screen-envelope {
  outline: 1px solid rgba(255, 248, 237, .72);
  outline-offset: -6px;
}

.screen-envelope {
  position: absolute;
  inset: 6px;
  z-index: 3;
  display: grid;
  place-items: center;
  border-radius: 2px;
  background:
    radial-gradient(circle at 50% 48%, rgba(216, 180, 106, .16), rgba(216, 180, 106, 0) 34%),
    radial-gradient(circle at 50% 120%, rgba(255, 248, 237, .08), rgba(255, 248, 237, 0) 46%),
    linear-gradient(180deg, rgba(15, 14, 13, .98), rgba(4, 4, 4, .98));
  cursor: pointer;
  overflow: hidden;
  transform-origin: center;
  transition:
    opacity 500ms ease 880ms,
    visibility 0ms linear 1380ms;
}

.screen-envelope::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 248, 237, .08), rgba(255, 248, 237, 0) 28%),
    linear-gradient(90deg, rgba(0, 0, 0, .5), rgba(0, 0, 0, 0), rgba(0, 0, 0, .42));
  pointer-events: none;
}

.envelope-card {
  position: relative;
  width: min(92%, 342px);
  aspect-ratio: 1.62 / 1;
  pointer-events: none;
  transform: translateY(-10px);
  transform-style: preserve-3d;
  transition:
    opacity 460ms ease 820ms,
    transform 760ms cubic-bezier(.22, 1, .36, 1);
}

.envelope-shadow,
.envelope-back,
.envelope-letter,
.envelope-front,
.envelope-left,
.envelope-right,
.envelope-seal,
.envelope-flap {
  position: absolute;
  pointer-events: none;
}

.envelope-shadow {
  left: 8%;
  right: 8%;
  bottom: -11%;
  height: 24%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0) 68%);
}

.envelope-back {
  inset: 8% 0 0;
  z-index: 1;
  border: 1px solid rgba(216, 180, 106, .28);
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(42, 36, 27, .98), rgba(15, 13, 11, .98));
  box-shadow:
    0 22px 42px rgba(0, 0, 0, .5),
    inset 0 0 0 1px rgba(255, 248, 237, .06);
}

.envelope-letter {
  left: 12%;
  right: 12%;
  top: 13%;
  z-index: 2;
  height: 54%;
  border: 1px solid rgba(216, 180, 106, .26);
  border-radius: 1px;
  background:
    linear-gradient(180deg, rgba(255, 248, 237, .72), rgba(221, 199, 151, .26)),
    rgba(216, 180, 106, .28);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .32);
  opacity: .92;
  transform: translateY(28%);
  transition:
    opacity 520ms ease,
    transform 780ms cubic-bezier(.22, 1, .36, 1);
}

.envelope-letter::before,
.envelope-letter::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  height: 1px;
  background: rgba(255, 248, 237, .22);
}

.envelope-letter::before {
  top: 36%;
}

.envelope-letter::after {
  top: 52%;
}

.envelope-front {
  inset: 8% 0 0;
  z-index: 4;
  border: 1px solid rgba(216, 180, 106, .34);
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(36, 31, 24, .98), rgba(9, 8, 7, .98));
  clip-path: polygon(0 42%, 50% 84%, 100% 42%, 100% 100%, 0 100%);
  box-shadow:
    inset 0 -1px 0 rgba(255, 248, 237, .08),
    inset 0 0 0 1px rgba(255, 248, 237, .04);
}

.envelope-left,
.envelope-right {
  top: 8%;
  bottom: 0;
  z-index: 3;
  width: 52%;
  border-bottom: 1px solid rgba(216, 180, 106, .24);
  background:
    linear-gradient(180deg, rgba(216, 180, 106, .16), rgba(216, 180, 106, .03)),
    linear-gradient(180deg, rgba(24, 21, 17, .98), rgba(10, 9, 8, .98));
}

.envelope-left {
  left: 0;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.envelope-right {
  right: 0;
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

.envelope-flap {
  left: 0;
  right: 0;
  top: 8%;
  z-index: 5;
  height: 62%;
  background:
    linear-gradient(180deg, rgba(54, 44, 30, .98), rgba(18, 15, 12, .98));
  clip-path: polygon(0 0, 100% 0, 50% 88%);
  transform: rotateX(0deg);
  transform-origin: top center;
  transition:
    opacity 360ms ease 620ms,
    transform 720ms cubic-bezier(.22, 1, .36, 1);
}

.envelope-seal {
  left: 50%;
  top: 57%;
  z-index: 6;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 248, 237, .22);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 34%, rgba(255, 248, 237, .52), rgba(255, 248, 237, 0) 26%),
    linear-gradient(145deg, rgba(216, 180, 106, .94), rgba(101, 74, 33, .98));
  box-shadow:
    0 0 22px rgba(216, 180, 106, .2),
    0 6px 16px rgba(0, 0, 0, .42);
  transform: translate(-50%, -50%);
  transition:
    opacity 360ms ease 480ms,
    transform 520ms cubic-bezier(.22, 1, .36, 1) 360ms;
}

.envelope-seal::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(19, 15, 10, .36);
  border-radius: 50%;
}

.screen-toggle:not(:checked) ~ .screening-video {
  opacity: 0;
  pointer-events: none;
  transform: scale(.985);
}

.screen-toggle:checked + .screen-envelope {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.screen-frame.is-open .screen-envelope {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.screen-toggle:checked + .screen-envelope .envelope-flap {
  opacity: 0;
  transform: rotateX(180deg);
}

.screen-frame.is-open .envelope-flap {
  opacity: 0;
  transform: rotateX(180deg);
}

.screen-toggle:checked + .screen-envelope .envelope-letter {
  opacity: 0;
  transform: translateY(-28%);
}

.screen-frame.is-open .envelope-letter {
  opacity: 0;
  transform: translateY(-28%);
}

.screen-toggle:checked + .screen-envelope .envelope-card,
.screen-frame.is-open .envelope-card {
  opacity: 0;
  transform: translateY(-12px) scale(1.015);
}

.screen-toggle:checked + .screen-envelope .envelope-seal,
.screen-frame.is-open .envelope-seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(.72);
}

.screening-video {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 2px;
  background: #000;
  object-fit: contain;
  opacity: 1;
  transform: scale(1);
  transition:
    opacity 520ms ease 620ms,
    transform 720ms cubic-bezier(.22, 1, .36, 1) 520ms;
}

.screen-frame.is-open .screening-video {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.place-gallery[hidden] {
  display: none;
}

.place-gallery {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: max(62px, calc(env(safe-area-inset-top) + 54px)) 16px max(24px, calc(env(safe-area-inset-bottom) + 24px));
  background: transparent;
  backdrop-filter: none;
  color: var(--ink);
  animation: galleryReveal 520ms cubic-bezier(.22, 1, .36, 1) both;
}

.gallery-panel {
  position: relative;
  width: min(100%, 404px);
  height: min(74dvh, 650px);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 12px;
  border: 1px solid rgba(216, 180, 106, .34);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255, 248, 237, .08), rgba(255, 248, 237, .018)),
    rgba(8, 8, 8, .18);
  box-shadow:
    0 28px 88px rgba(0, 0, 0, .46),
    inset 0 0 0 1px rgba(255, 248, 237, .08);
  touch-action: pan-y;
}

.gallery-panel::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 1;
  border: 1px solid rgba(255, 248, 237, .1);
  pointer-events: none;
}

.gallery-close {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: 16px;
  z-index: 21;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.gallery-close::before,
.gallery-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 1px;
  background: rgba(255, 248, 237, .9);
  transform-origin: center;
}

.gallery-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.gallery-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.gallery-photo {
  position: absolute;
  inset: 12px;
  z-index: 0;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  object-fit: contain;
  opacity: 0;
  transform: scale(.985);
  background: transparent;
  transition:
    opacity 520ms ease,
    transform 820ms cubic-bezier(.22, 1, .36, 1);
}

.gallery-photo.is-active,
.gallery-photo.is-incoming {
  opacity: 1;
  transform: scale(1);
}

.gallery-photo.is-active {
  z-index: 1;
}

.gallery-photo.is-incoming {
  z-index: 2;
}

body.gallery-open {
  overflow: hidden;
}

@media (max-width: 360px) {
  .hero {
    --hero-gutter: 18px;
  }

  h1 {
    font-size: 52px;
  }

  .edition {
    max-width: 110px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scroll-cue span {
    animation: none;
  }

  .place-gallery {
    animation: none;
  }

  .gallery-photo {
    transition: none;
  }

  .screen-envelope,
  .envelope-flap,
  .envelope-letter,
  .screening-video {
    transition: none;
  }
}

@keyframes galleryReveal {
  from {
    opacity: 0;
    transform: scale(1.015);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}
