@font-face {
  font-family: 'Standard';
  src: url('fonts/standard-book-webfont.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --h: 100vh;
  --img: calc(var(--h) * 0.5);
  --m: max(24px, 5vw);
  --blur: 1200px;
  --bg: #ffffff;
  --fg: #000000;
}

@supports (height: 100dvh) {
  :root {
    --h: 100dvh;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

html,
body {
  height: var(--h);
  overflow: hidden;
}

body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) var(--img) minmax(0, 1fr);
  align-items: center;
  text-align: center;
  font-family: "Arial", sans-serif;
  font-size: 21px;
  line-height: 1.2;
  background: var(--bg);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  text-wrap: balance;
}

#project {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  padding: 0 var(--m);
}

#name.open #project {
  display: none;
}

#name {
  grid-row: 1;
  position: relative;
  z-index: 3;
  padding: 0 var(--m);
  pointer-events: none;
}

#stage {
  grid-row: 2;
  height: var(--img);
  display: flex;
  justify-content: center;
}

#title {
  grid-row: 3;
  align-self: center;
  justify-self: center;
  max-width: min(50vw, calc(100vw - 2 * var(--m)));
  pointer-events: none;
}

#stage img,
#stage video {
  height: var(--img);
  width: auto;
  max-width: calc(100vw - 2 * var(--m));
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* menu */
#toggle,
#menu a {
  pointer-events: auto;
  cursor: pointer;
}

#toggle {
  display: inline-block;
}

#menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
}

#menu a {
  display: table;
  margin: 16px auto 0;
  color: inherit;
  text-decoration: none;
}

#menu,
#full {
  display: none;
}

#name.open #menu {
  display: block;
}

#name.open #full {
  display: inline;
}

#name.open #short {
  display: none;
}

@media (hover: hover) {

  #toggle:hover,
  #menu a:hover {
    opacity: 0.5;
  }

  #menu a.plain {
    cursor: default;
  }

  #menu a.plain:hover {
    opacity: 1;
  }
}

/* two click halves, 50% each */
.arrow {
  position: fixed;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: 1;
  cursor: none;
}

#prev {
  left: 0;
}

#next {
  left: 50%;
}

/* text that follows the mouse, same font and size as the page */
#label {
  display: none;
  position: fixed;
  z-index: 4;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  pointer-events: none;
}

#label.on {
  display: block;
}

#name.open~#label {
  display: none;
}

/* touch screens: no cursor, so no label */
@media (hover: none) {
  #label {
    display: none !important;
  }

  .arrow {
    cursor: auto;
  }
}

#name.open~#stage,
#name.open~#title {
  filter: blur(var(--blur));
}

#name.open~#stage,
#name.open~.arrow {
  pointer-events: none;
}

.hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }
}

/* caption links: clickable above the prev/next halves */
#title a {
  color: inherit;
  text-decoration: none;
  pointer-events: auto;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

@media (hover: hover) {
  #title a:hover {
    opacity: 0.5;
  }
}

/* menu open: the blurred caption link isn't clickable */
#name.open~#title a {
  pointer-events: none;
}