:root {
  --background-width: 1200px;
  --background-height: 675px;
  --body-width: 950px;
  --border-radius: clamp(2px, calc(100% * 0.0266667), 8px) /
    clamp(2px, calc(100% * calc(0.0266667 * (2 / 3))), 8px);
}

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

h1,
h2,
h3,
p,
ul,
li,
a {
  margin: 0;
  padding: 0;
}

ul,
li,
a {
  color: currentColor;
  text-decoration: none;
  list-style: none;
}

img,
picture,
svg,
video {
  display: block;
  pointer-events: none;
}

body {
  position: relative;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family:
    "GraphikWeb",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #14181c;
}

.scroll-lock {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
}

.backdrop-container {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 0;
  overflow: hidden;
  transform: translate(-50%);
  inline-size: var(--background-width);
  block-size: var(--background-height);
}

.backdropimage {
  position: absolute;
  block-size: 100%;
  inline-size: 100%;
}

.backdropimage-img {
  object-fit: cover;
  object-position: center;
  transition: opacity 0.75s cubic-bezier(0.165, 0.84, 0.44, 1);
  inline-size: 100%;
  block-size: 100%;
}

.backdropmask {
  position: relative;
}

.backdropmask::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 0;
  display: block;
  background-image:
    linear-gradient(
      to right,
      #14181d,
      rgba(20, 24, 29, 0.984) 0.97%,
      rgba(20, 24, 29, 0.945) 2.07833333%,
      rgba(20, 24, 29, 0.882) 3.29666667%,
      rgba(20, 24, 29, 0.804) 4.60166667%,
      rgba(20, 24, 29, 0.71) 5.96666667%,
      rgba(20, 24, 29, 0.608),
      rgba(20, 24, 29, 0.5),
      rgba(20, 24, 29, 0.396) 10.16%,
      rgba(20, 24, 29, 0.294) 11.505%,
      rgba(20, 24, 29, 0.204) 12.78%,
      rgba(20, 24, 29, 0.12) 13.95833333%,
      rgba(20, 24, 29, 0.06) 15.01666667%,
      rgba(20, 24, 29, 0.016) 15.92833333%,
      rgba(20, 24, 29, 0) 16.66666667%,
      rgba(20, 24, 29, 0) 83.33333333%,
      rgba(20, 24, 29, 0.016) 84.07166667%,
      rgba(20, 24, 29, 0.06) 84.98333333%,
      rgba(20, 24, 29, 0.12) 86.04166667%,
      rgba(20, 24, 29, 0.204) 87.22%,
      rgba(20, 24, 29, 0.294) 88.495%,
      rgba(20, 24, 29, 0.396) 89.84%,
      rgba(20, 24, 29, 0.5),
      rgba(20, 24, 29, 0.608),
      rgba(20, 24, 29, 0.71) 94.03333333%,
      rgba(20, 24, 29, 0.804) 95.39833333%,
      rgba(20, 24, 29, 0.882) 96.70333333%,
      rgba(20, 24, 29, 0.945) 97.92166667%,
      rgba(20, 24, 29, 0.984) 99.03%,
      #14181d
    ),
    linear-gradient(
      to top,
      #14181d,
      #14181d 21.48148148%,
      rgba(20, 24, 29, 0.984) 23.63703704%,
      rgba(20, 24, 29, 0.945) 26.1%,
      rgba(20, 24, 29, 0.882) 28.80740741%,
      rgba(20, 24, 29, 0.804) 31.70740741%,
      rgba(20, 24, 29, 0.71) 34.74074074%,
      rgba(20, 24, 29, 0.608),
      rgba(20, 24, 29, 0.5) 40.97407407%,
      rgba(20, 24, 29, 0.396) 44.05925926%,
      rgba(20, 24, 29, 0.294) 47.04814815%,
      rgba(20, 24, 29, 0.204) 49.88148148%,
      rgba(20, 24, 29, 0.12) 52.5%,
      rgba(20, 24, 29, 0.06) 54.85185185%,
      rgba(20, 24, 29, 0.016) 56.87777778%,
      rgba(20, 24, 29, 0) 58.51851852%
    );
  background-repeat: no-repeat;
  transform: translate(-50%);
  pointer-events: none;
  block-size: var(--background-height);
  inline-size: var(--background-width);
}

header {
  position: relative;
  display: flex;
  justify-content: center;
}

.site-header-bg {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  opacity: 0.7;
  background-color: transparent;
  background-image: linear-gradient(
    to bottom,
    #14181c,
    rgba(20, 24, 28, 0.945) 16.56%,
    rgba(20, 24, 28, 0.8) 30.85%,
    rgba(20, 24, 28, 0.608) 43.77%,
    rgba(20, 24, 28, 0.392) 56.23%,
    rgba(20, 24, 28, 0.2) 69.15%,
    rgba(20, 24, 28, 0.055) 83.44%,
    rgba(20, 24, 28, 0)
  );
  background-repeat: repeat-x;
  block-size: 95px;
}

header section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-inline: 16px;
  max-inline-size: var(--body-width);
  inline-size: 100%;
  block-size: 72px;
}

.logo {
  position: relative;
  z-index: 1;
  display: block;
  background: url(https://shoneal.github.io/letterboxd/images/logo-full.svg)
    no-repeat left center / contain;
  inline-size: 273px;
  block-size: 25px;
}

.navigation {
  position: relative;
  z-index: 1;
  font-size: 13px;
  line-height: 17px;
  letter-spacing: 0.07692308em;
  text-transform: uppercase;
}

.has-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 9px 10px 8px;
  color: #d8e0e8;
  font-weight: 700;
  max-inline-size: 300px;
  white-space: nowrap;
}

.icon {
  background: url(https://shoneal.github.io/letterboxd/images/sprite.svg)
    no-repeat;
  background-position: -160px -150px;
  inline-size: 10px;
  block-size: 10px;
}

.subnavigation {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10000;
  display: none;
  border-radius: 3px;
  padding-block-end: 5px;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.35),
    0 0 10px #000;
  background: #89a;
}

.subnavigation li:first-child {
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.subnavigation .has-icon {
  flex-direction: row-reverse;
  color: white;
}

.subnavigation .icon {
  background-position: -160px -170px;
}

.subnavigation li {
  color: #2c3440;
  cursor: pointer;
}

.subnavigation li a:not(.has-icon) {
  position: relative;
  display: block;
  border: none;
  padding: 4px 15px;
  font-weight: 400;
  line-height: 1.38461538;
  text-shadow: rgba(255, 255, 255, 0.1) 0 1px 0;
}

.subnavigation li:hover a:not(.has-icon) {
  color: white;
  text-shadow: rgba(0, 0, 0, 0.05) 0 1px 0;
  background: #678;
}

.subnavigation .selected {
  color: white;
  text-shadow: rgba(0, 0, 0, 0.05) 0 1px 0;
  cursor: default !important;
  pointer-events: none;
}

.subnavigation .selected:hover a:not(.has-icon) {
  background: transparent;
}

main {
  margin-inline: 16px;
  padding-block: 400px 30px;
  min-block-size: 290px;
}

.content-wrap {
  position: relative;
  z-index: 100;
  margin: 0 auto;
  max-inline-size: var(--body-width);
  inline-size: 100%;
}

.backdrop-metadata {
  position: absolute;
  top: 0;
  right: -70px;
  opacity: 0.4;
  color: #9ab;
  font-size: 13px;
  line-height: 1.5;
  transform: translate3D(100%, 0, 0) rotate(-90deg);
  transform-origin: 0 0;
  max-inline-size: 300px;
}

.poster-list {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.poster-item {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: #12161a;
  aspect-ratio: 2/3;
}

.poster-item::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  border-radius: var(--border-radius);
  box-shadow: inset 0 0 0 max(1px, 0.07692308rem) rgba(221, 238, 255, 0.25);
  inline-size: 100%;
  block-size: 100%;
}

.poster-item img {
  border-radius: var(--border-radius);
  color: white;
  font: inherit;
  transition: opacity 0.3333333s cubic-bezier(0.19, 1, 0.22, 1);
  inline-size: 100%;
  aspect-ratio: 2/3;
}

.popup {
  position: fixed;
  inset: 0;
  z-index: 5000;
  visibility: hidden;
  display: none;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.popup.show {
  visibility: visible;
  display: block;
  pointer-events: auto;
}

.modal-popup {
  position: relative;
  z-index: 2;
  block-size: 100%;
  inline-size: 100vw;
}

.modal-popup.fade {
  opacity: 0;
  transition:
    transform 0.25s cubic-bezier(0.19, 1, 0.22, 1),
    opacity 0.25s cubic-bezier(0.19, 1, 0.22, 1);
  transform: scale(0.95);
}

.modal-popup.show {
  opacity: 1;
  transition:
    transform 0.4s cubic-bezier(0.333, 2.25, 0.333, 0.875),
    opacity 0s cubic-bezier(0.19, 1, 0.22, 1);
  transform: none;
}

.modal-body {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 76px 16px;
  inline-size: 100%;
  block-size: 100%;
}

.poster {
  inline-size: auto;
  max-inline-size: 100%;
  max-block-size: 100%;
  aspect-ratio: 2/3;
}

.poster-image {
  object-fit: contain;
  block-size: 100%;
  inline-size: 100%;
}

.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
  background-color: rgba(20, 24, 28, 0.9);
  backdrop-filter: blur(10px);
  inline-size: 100vw;
  block-size: 100vh;
}

@media (hover: hover) and (pointer: fine) and (min-width: 768px) {
  .navigation:hover .subnavigation {
    display: block;
  }
}

@media screen and (max-width: 768px) {
  body {
    padding: 0;
  }

  .backdrop-container {
    top: 40px;
    inline-size: 100%;
    block-size: auto;
  }

  .backdropimage {
    position: relative;
    z-index: 0;
    block-size: auto;
  }

  .backdropmask {
    position: absolute;
    inset: 0;
    z-index: 1;
    block-size: 125%;
    inline-size: 100%;
  }

  .backdropmask::before {
    block-size: 100%;
  }

  .site-header-bg {
    display: none;
  }

  header section {
    margin-inline: 0;
    padding-inline: 16px;
    background: #14181c;
    max-inline-size: 100%;
    block-size: 40px;
  }

  .logo {
    background: url(https://shoneal.github.io/letterboxd/images/logo.svg)
      no-repeat left center / contain;
    inline-size: 42px;
    block-size: 16px;
  }

  main {
    margin-inline: 0;
    padding: 50vw 16px 30px;
  }

  .backdrop-metadata {
    display: none;
  }

  .poster-list {
    grid-template-columns: repeat(4, 1fr);
  }
}
