@font-face {
  font-family: 'Messapia';
  src: url(messapia-bold.woff2);
}

/* Animations */
@keyframes show {
  0% {
    opacity: 0;
    transform: translate(0, 24px) scale(0.95);
    clip-path: polygon(0% 0%, 100% 0, 100% 0, 0% 0%);
  }

  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
    clip-path: polygon(0% 0%, 100% 0, 100% 100%, 0% 100%);
  }
}

@keyframes intro-box {
  0% {
    background-color: #fff;
  }
  
  100% {
    background-color: transparent;
  }
}

@keyframes grow-box {
  0% {
    opacity: 0;
  }
  
  20% {
    opacity: 1;
  }
  
  40% {
    width: 360px;
    height: 200px;
  }
  
  100% {
    width: 100%;
    height: 100%;
    border-color: transparent;
  }
}

body {
  font-family: Messapia;
  font-size: 16px;
  line-height: 1.5;

  background-color: #ffffff;
  color: #000;
}

section {
  height: 100vh;

  display: flex;
  align-items: center;
  justify-content: center;

  background-color: #ffc031;

  position: -webkit-sticky;
  position: sticky;
  top: 0;
}

.white-text {
  color: white;
}

section.alga-bg {
  background-color: #ffc031;
}

section.cowboy-bg {
  background-color: #cdf449;
}

section.icarus-bg {
  background-color: #f5ffab;
}

section.knife-bg {
  background-color: #18004b;
}

section.oceania-bg {
  background-color: #105a49;
}

section.pierrot-bg {
  background-color: #fea4ff;
}

section.swimmer-bg {
  background-color: #bcf2f0;
}
section.sword-bg {
  background-color: #bab6c6;
}

figure {
  position: absolute;
  padding: 120px;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  text-align: center;
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
  perspective: 800px;
}

figure div {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

figure img {
  max-height: 100%;
}

figcaption.top {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translate(-50%, 0);
  pointer-events: none;
}

figcaption.bottom {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translate(-50%, 0);
  pointer-events: none;
}

.small h1 {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

h1 {
  font-size: 40px;
  line-height: 1;
}

div.intro {
  display: none;
}

/* for accessibility */
/* if user doesn't have system-wide preferences, then show animations */
@media (prefers-reduced-motion: no-preference) {
  section.in-view img {
    animation: show 3s both cubic-bezier(0.68, -0.55, 0.27, 1.55);
  }

  div.intro {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    
    position: fixed;
    top: 0;
    left: 0;
    
    z-index: 10;
    
    width: 100%;
    height: 100%;
    
    background-color: white;
    pointer-events: none;
    animation: intro-box 1s 4s both;
  }
  
  div.intro div.box {
    width: 360px ;
    height: 200px;
    border: 1px solid black;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
    animation: grow-box 3s 2s both;
  }
  
  div.intro div.column {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
  }
}

/* scroll-jack */
@media (prefers-reduced-motion: no-preference) and (min-width: 900px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  main {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
  }

  section {
    scroll-snap-align: start;
  }
}

@media (max-width: 600px) {
  figcaption.bottom h1 {
    font-size: 24px;
  }
  figure {
    padding: 48px;
  }
}
