@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Newsreader:opsz,wght@6..72,300..500&display=swap");

:root {
  --paper: #050505;
  --ink: #f3f3f3;
  --soft-ink: rgba(243, 243, 243, 0.76);
  --ghost: rgba(243, 243, 243, 0.08);
  --frame: rgba(243, 243, 243, 0.35);
}

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

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body {
  color: var(--ink);
  font-family: "Newsreader", serif;
  font-size: 16px;
  font-weight: 400;
  font-variation-settings: "opsz" 24, "wght" 400;
  background: #000000;
}

#app,
#viewport {
  width: 100%;
  height: 100%;
}

#viewport {
  position: fixed;
  inset: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transform-origin: 50% 50%;
  opacity: 1;
  transition: opacity 320ms ease;
}

#viewport.dragging {
  cursor: grabbing;
}

#viewport.tile-drag-layer {
  z-index: 70;
}

#world {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  opacity: 1;
  filter: blur(0);
  transition:
    opacity 820ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 820ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.intro-preload #world {
  opacity: 0;
  filter: blur(9px);
}

body.intro-preload .diptych-tile img {
  opacity: 0;
  filter: blur(9px);
}

body.mode-diptych #viewport {
  opacity: 0;
  pointer-events: none;
}

.chunk {
  position: absolute;
  left: 0;
  top: 0;
  width: 2200px;
  height: 2200px;
}

.tile {
  position: absolute;
  padding: 0;
  appearance: none;
  border: 0;
  overflow: hidden;
  background: #101010;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  transition:
    left 820ms cubic-bezier(0.24, 0.8, 0.22, 1),
    top 820ms cubic-bezier(0.24, 0.8, 0.22, 1),
    transform 180ms ease,
    opacity 360ms ease;
}

#world.has-hover-focus .tile {
  opacity: 0.25;
}

#world.has-hover-focus .tile.is-hover-active,
#world.has-hover-focus .tile.is-dragging {
  opacity: 1;
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 0;
  pointer-events: none;
}

.tile:focus-visible {
  outline: 2px solid #f2f2f2;
  outline-offset: 2px;
}

.tile.is-dragging {
  z-index: 80;
  transition: transform 200ms cubic-bezier(0.22, 0.8, 0.28, 1);
}

.tile img,
.tile video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  image-rendering: auto;
  image-rendering: high-quality;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.tile-placeholder {
  width: 100%;
  height: 100%;
  background: #6f6f6f;
  pointer-events: none;
}

.tile-caption {
  display: none;
}

.hud {
  position: fixed;
  z-index: 30;
  pointer-events: none;
}

.hud p {
  margin: 0;
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  font-weight: 400;
  font-variation-settings: normal;
}

.hud-top {
  top: 18px;
  right: 22px;
  padding: 0;
  border: 0;
  background: transparent;
}

.hud-top p {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hud-top p + p {
  margin-top: 0.18rem;
}

.view-toggle {
  position: fixed;
  top: 18px;
  left: 22px;
  z-index: 38;
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.view-toggle-btn {
  border: 0;
  background: transparent;
  color: #f3f3f3;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.64rem;
  font-weight: 400;
  font-variation-settings: normal;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0;
  cursor: pointer;
  opacity: 0.58;
}

.view-toggle-btn + .view-toggle-btn::before {
  content: "/";
  display: inline-block;
  margin: 0 0.35rem 0 0.3rem;
  color: rgba(243, 243, 243, 0.8);
  opacity: 1;
}

.view-toggle-btn.is-active {
  opacity: 1;
}

.hover-location {
  position: fixed;
  left: 50vw;
  top: 50vh;
  z-index: 39;
  margin: 0;
  max-width: min(42vw, 460px);
  color: #ffffff;
  font-family: "Newsreader", serif;
  font-size: 15px;
  font-weight: 400;
  font-variation-settings: "opsz" 24, "wght" 400;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-transform: none;
  mix-blend-mode: normal;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 8px)) scale(0.985);
  transform-origin: 50% 100%;
  will-change: left, top, opacity, transform;
  transition:
    opacity 220ms ease,
    transform 240ms cubic-bezier(0.2, 0.75, 0.2, 1),
    letter-spacing 300ms ease;
}

.hover-location.is-visible {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 14px)) scale(1);
}

.hover-location.is-typing {
  letter-spacing: 0.016em;
}

.title-overlay {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 36;
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: 16px;
  font-weight: 400;
  font-variation-settings: "opsz" 24, "wght" 400;
  line-height: 1;
  letter-spacing: 0;
  text-transform: lowercase;
  color: #ffffff;
  mix-blend-mode: difference;
  pointer-events: none;
  white-space: nowrap;
  text-align: center;
}

.title-overlay-top {
  top: 12px;
}

.title-overlay-bottom {
  bottom: 12px;
}

.diptych-stage {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  gap: 0;
  opacity: 0;
  pointer-events: none;
  touch-action: none;
  transition: opacity 320ms ease;
}

body.mode-diptych .diptych-stage {
  opacity: 1;
  pointer-events: auto;
}

.diptych-stage.is-switching {
  opacity: 0.2;
}

.diptych-tile {
  flex: 1 1 50%;
  width: 50vw;
  height: 100vh;
  padding: 0;
  border: 0;
  margin: 0;
  border-radius: 0;
  background: #111111;
  overflow: hidden;
  appearance: none;
  box-shadow: none;
  cursor: pointer;
}

.diptych-tile img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 1;
  filter: none;
  transition:
    opacity 480ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 480ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.diptych-stage.is-fading .diptych-tile img {
  opacity: 0.58;
  filter: saturate(0.94) contrast(0.98);
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.75);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

body.lightbox-open .photo-lightbox {
  opacity: 1;
  pointer-events: auto;
}

.photo-lightbox-stage {
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.1rem;
}

#photo-lightbox-image {
  max-width: calc(100vw - 2.2rem);
  max-height: calc(100vh - 4.3rem);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.photo-lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 121;
  appearance: none;
  border: 0;
  background: transparent;
  color: #f3f3f3;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  font-weight: 400;
  font-variation-settings: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.38);
}

.photo-lightbox-tech {
  position: fixed;
  top: 18px;
  left: 22px;
  z-index: 121;
  margin: 0;
  color: #f3f3f3;
  font-family: "Newsreader", serif;
  font-size: 12px;
  font-weight: 400;
  font-variation-settings: "opsz" 24, "wght" 400;
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: none;
  white-space: pre-line;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.38);
  pointer-events: none;
}

#grain {
  display: none;
}

#frame {
  display: none;
}

@media (max-width: 760px) {
  .hud-top {
    top: 12px;
    right: 12px;
    max-width: calc(100vw - 24px);
  }

  .view-toggle {
    top: 12px;
    left: 12px;
  }

  .hover-location {
    display: none;
  }

  .view-toggle-btn {
    font-size: 0.6rem;
    padding: 0;
  }

  .title-overlay {
    font-size: 16px;
  }

  .title-overlay-top {
    display: none;
  }

  .diptych-stage {
    flex-direction: column;
  }

  .diptych-tile {
    flex: 0 0 50vh;
    width: 100vw;
    height: 50vh;
  }

  .photo-lightbox-close {
    top: 12px;
    right: 12px;
  }

  .photo-lightbox-tech {
    top: 12px;
    left: 12px;
    font-size: 12px;
  }

  .photo-lightbox-stage {
    padding: 0.7rem;
  }

  #photo-lightbox-image {
    max-width: calc(100vw - 1.4rem);
    max-height: calc(100vh - 3.5rem);
  }

  #frame {
    display: none;
  }
}

@media (hover: none), (pointer: coarse) {
  .hover-location {
    display: none;
  }
}
