:root {
  --bg: #e8e8e8;
  --text: #000000;
  --topbar-height: 68px;
  --bottombar-height: 66px;
  --page-padding-x: 16px;
  --page-padding-y: 10px;
  --content-max-width: 1320px;
  --content-max-height: calc(100vh - var(--topbar-height) - var(--bottombar-height) - 24px);
  --single-max-width: 1000px;
  --gap-large: 44px;
  --font: Arial, Helvetica, sans-serif;
  --cursor-size: 32px;
  --gallery-fade-duration: 900ms;
}

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

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
}

img,
video {
  display: block;
  max-width: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

a {
  color: inherit;
}

.site {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: var(--bg);
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: start;
  padding: 12px 16px 0;
  z-index: 20;
}

.topbar__left,
.topbar__center,
.topbar__right {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.topbar__left {
  justify-self: start;
}

.topbar__center {
  justify-self: center;
  text-align: center;
}

.topbar__right {
  justify-self: end;
}

.topbar__link,
.topbar__label {
  text-decoration: none;
  color: var(--text);
}

.topbar__link:hover {
  opacity: 0.68;
}

.viewer {
  position: absolute;
  inset: 0;
}

.stage {
  position: absolute;
  top: var(--topbar-height);
  right: 0;
  bottom: var(--bottombar-height);
  left: 0;
  padding: var(--page-padding-y) var(--page-padding-x);
  overflow: hidden;
}

.stage__inner {
  width: 100%;
  height: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  display: grid;
  place-items: center;
}

.slide {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.slide__grid {
  width: 100%;
  height: 100%;
}

.slide__block {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
}

.slide__media-frame {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: transparent;
}

.slide__image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.slide__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
  background: #000;
}

/* TEXT */
.slide--text .slide__grid {
  display: grid;
  place-items: center;
}

.slide__text-wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.slide__text {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.08;
  font-weight: 800;
}

/* SINGLE */
.slide--single .slide__grid {
  display: grid;
  place-items: center;
}

.slide--single .slide__block {
  max-width: var(--single-max-width);
  max-height: var(--content-max-height);
}

.slide--single .slide__media-frame--image,
.slide--single .slide__gallery-frame {
  width: auto;
  height: auto;
  max-width: min(100%, var(--single-max-width));
  max-height: var(--content-max-height);
}

.slide--single .slide__media-frame--image .slide__image,
.slide--single .slide__gallery-frame .slide__gallery-item-media {
  max-width: min(100%, var(--single-max-width));
  max-height: var(--content-max-height);
}

.slide--single .slide__media-frame--video {
  width: min(100%, var(--single-max-width));
  height: min(var(--content-max-height), 80vh);
}

.slide--single .slide__media-frame--video .slide__video {
  width: 100%;
  height: 100%;
}

/* DUO */
.slide--duo .slide__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap-large);
  align-items: center;
  justify-items: center;
}

.slide--duo .slide__block {
  height: var(--content-max-height);
}

.slide--duo .slide__media-frame--image {
  width: 100%;
  height: 100%;
}

.slide--duo .slide__media-frame--image .slide__image {
  max-width: 100%;
  max-height: 100%;
}

.slide--duo .slide__media-frame--video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

.slide--duo .slide__media-frame--video .slide__video {
  width: 100%;
  height: 100%;
}

/* TEXT + MEDIA */
.slide--text-media .slide__grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: var(--gap-large);
  align-items: center;
  justify-items: center;
}

.slide--text-media .slide__block {
  height: var(--content-max-height);
}

.slide--text-media .slide__media-frame--image {
  width: 100%;
  height: 100%;
}

.slide--text-media .slide__media-frame--image .slide__image {
  max-width: 100%;
  max-height: 100%;
}

.slide--text-media .slide__media-frame--video {
  width: min(100%, 700px);
  height: min(var(--content-max-height), 80vh);
}

.slide--text-media .slide__media-frame--video .slide__video {
  width: 100%;
  height: 100%;
}

/* LANDSCAPE */
.slide--landscape .slide__grid,
.slide--landscape-gallery .slide__grid {
  display: grid;
  place-items: center;
}

.slide--landscape .slide__block,
.slide--landscape-gallery .slide__block {
  width: 100%;
  height: 100%;
}

.slide--landscape .slide__media-frame,
.slide--landscape-gallery .slide__gallery-frame {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: visible;
}

.slide--landscape .slide__image,
.slide--landscape-gallery .slide__gallery-item-media {
  max-width: 100%;
  max-height: 100%;
  transform: scale(1.3);
  transform-origin: center center;
}

/* GALLERY */
.slide__gallery-frame {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.slide__gallery-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.slide__gallery-item {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity var(--gallery-fade-duration) ease;
  pointer-events: none;
}

.slide__gallery-item.is-active {
  opacity: 1;
}

.slide__gallery-item-media {
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* FOOTER */
.bottombar {
  position: fixed;
  inset: auto 0 0 0;
  height: var(--bottombar-height);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: end;
  padding: 0 16px 12px;
  z-index: 20;
  pointer-events: none;
}

.bottombar__left,
.bottombar__center,
.bottombar__right {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottombar__left {
  justify-self: start;
  text-align: left;
}

.bottombar__center {
  justify-self: center;
  text-align: center;
  max-width: 90%;
}

.bottombar__right {
  justify-self: end;
  text-align: right;
}

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

.bottombar__center a:hover {
  opacity: 0.65;
}

/* CURSOR NAV */
.cursor-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--cursor-size);
  height: var(--cursor-size);
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  transform: translate(-50%, -50%);
  transition: opacity 120ms ease;
}

.cursor-nav.is-visible {
  opacity: 1;
}

@media (max-width: 980px) {
  :root {
    --topbar-height: 62px;
    --bottombar-height: 88px;
    --gap-large: 18px;
    --content-max-height: calc(100vh - var(--topbar-height) - var(--bottombar-height) - 20px);
  }

  .topbar {
    grid-template-columns: 1fr 1fr auto;
    padding: 12px 12px 0;
  }

  .topbar__left,
  .topbar__center,
  .topbar__right {
    font-size: 16px;
  }

  .stage {
    padding: 8px 12px;
  }

  .slide--duo .slide__grid,
  .slide--text-media .slide__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .slide--duo .slide__block,
  .slide--text-media .slide__block {
    height: auto;
  }

  .slide--duo .slide__media-frame--image,
  .slide--text-media .slide__media-frame--image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 42vh;
  }

  .slide--duo .slide__media-frame--image .slide__image,
  .slide--text-media .slide__media-frame--image .slide__image {
    max-width: 100%;
    max-height: 42vh;
  }

  .slide--duo .slide__media-frame--video,
  .slide--text-media .slide__media-frame--video {
    width: min(100%, 320px);
    height: 42vh;
  }

  .slide--landscape .slide__image,
  .slide--landscape-gallery .slide__gallery-item-media {
    transform: scale(1.12);
  }

  .slide__text {
    font-size: clamp(22px, 6vw, 34px);
    line-height: 1.1;
  }

  .bottombar {
    grid-template-columns: 1fr;
    gap: 8px;
    height: auto;
    padding: 0 12px 10px;
  }

  .bottombar__left,
  .bottombar__center,
  .bottombar__right {
    justify-self: start;
    text-align: left;
    font-size: 15px;
    white-space: normal;
  }
}

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