::view-transition-group(*) {
  animation-duration: 200ms;
  animation-timing-function: cubic-bezier(.8,.05,.24,.91);
}

::view-transition-group(root) {
  animation-name: slide-in;
}

#page::view-transition-old(rain),
#page::view-transition-old(eight-sleep),
#page::view-transition-old(bocci),
#page::view-transition-old(specter) {
  animation-name: home-page-old;
  border-radius: 12px;
  corner-shape: superellipse(1.5);
  overflow: hidden;
  object-fit: cover;
}

#page::view-transition-new(rain),
#page::view-transition-new(eight-sleep),
#page::view-transition-new(bocci), 
#page::view-transition-new(specter) {
  animation-name: home-page-new;
  border-radius: 12px;
  corner-shape: superellipse(1.5);
  overflow: hidden;
  object-fit: cover;
}

#home::view-transition-old(rain),
#home::view-transition-old(eight-sleep), 
#home::view-transition-old(bocci),
#home::view-transition-old(specter) {
  animation-name: home-page-old;
  animation-direction: reverse;
  border-radius: 0px;
  corner-shape: superellipse(1.5);
  overflow: hidden;
  object-fit: cover;
}

#home::view-transition-new(rain),
#home::view-transition-new(eight-sleep),
#home::view-transition-new(bocci),
#home::view-transition-new(specter) {
  animation-name: home-page-new;
  animation-direction: reverse;
  border-radius: 0px;
  corner-shape: superellipse(1.5);
  overflow: hidden;
  object-fit: cover;
}

@keyframes home-page-old {
  0% {
    height: 100vh;
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    height: calc(100vw * 9 / 16);
  }
}

@keyframes home-page-new {
  0% {
    height: 100vh;
  }
  100% {
    height: calc(100vw * 9 / 16);
  }
}

@keyframes slide-in {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  80% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0px);
  }
}

* {
  box-sizing: border-box;
}

#home {
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: black;
  display: flex;
  flex-direction: column;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-smoothing: antialiased;
  backface-visibility: hidden;
}

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

h1, tt {
  font-family: "Inter";
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 21px;
  display: inline-block;
  color: white;
}

#identity {
  position: fixed;
  left: 16px;
  top: 16px;
  right: 50vw;
  z-index: 2;
  mix-blend-mode: difference;
  view-transition-name: identity;
}

#email {
  position: fixed;
  right: 16px;
  top: 16px;
  z-index: 2;
  mix-blend-mode: difference;
  view-transition-name: email;
}

section {
  position: relative;
  scroll-snap-align: start;
  display: flex;
  flex-direction: row;
  cursor: none;

  &[theme="light"] {
    .content {
      background: black;
    }
    .title {
      color: white;
    }
  }
  &[theme="neutral"] {
    .content {
      background: #ccc;
    }
    .title {
      color: #aaa;
    }
  }
  &[theme="dark"] {
    .content {
      background: #eee;
    }
    .title {
      color: black;
    }
  }
}

section .content {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  height: 100vh;
  flex-grow: 1;
  flex-basis: 0;

  .video {
    position: relative;
    width: 100%;
    height: 100%;

    img,
    video {
      position: relative;
      display: block;
      padding: 0;
      border: 0;
      line-height: 0;
      vertical-align: top;
      z-index: 0;
      transition: opacity 0.2s ease-in-out;
      height: calc(100% + 4px);
      width: calc(100% + 4px);
      margin: -2px 0 0 -2px;
      clip-path: inset(1px);
      object-fit: cover;
    }

    video {
      position: absolute;
      inset: 0;
      z-index: 1;
      opacity: 0;
    }
  }

  img {
    width: 100%;
    height: auto;
  }

  .contain {
    img, video {
      object-fit: contain;
    }
  }
}

#page section .content {
  height: calc(100vw * 9 / 16);
  border-radius: 12px;
  corner-shape: superellipse(1.5);
}

#page {
  padding: 16px 12px 12px;
}

#page section {
  padding-top: 12px;
  gap: 12px;
}

section .title {
  position: fixed;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.15s ease;
  z-index: 3;
  text-transform: uppercase;
  text-wrap: nowrap;
}

a {
  tt::before {
    content: "[ "
  }
  tt::after {
    content: " ]"
  }
  &:active {
    tt::before {
      content: " ["
    }
    tt::after {
      content: "] "
    }
  }
}
