/* ========================
Homepage
========================== */

.main {
  background-color: var(--color-light);
  transition: background-color ease calc(var(--animation-speed-slow));
  overflow: hidden;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.js-animate {
  --beats-per-minute: 60; /* default BPM */
  --beat-half: calc(60s / (var(--beats-per-minute) / 2)); /* every 2 beats */
  --beat-whole: calc(60s / (var(--beats-per-minute) / 4)); /* every 4 beats */
}

.song1 {
  --beats-per-minute: 84.6;
  background-color: var(--color1);
  --transform: scale(5) rotate(135deg) translate(-20%, 1%);
}

.song2 {
  --beats-per-minute: 97;
  background-color: var(--color2);
  --transform: scale(10) rotate(45deg) translate(33%, 1%);
}

.song3 {
  --beats-per-minute: 80;
  background-color: var(--color3);
  --transform: scale(7) rotate(90deg) translate(23%, 2%);
}

.song1 .audio-player__button--next::before {
  content: "\002318";
}

.song2 .audio-player__button--next::before {
  content: "\002667";
}

.song3 .audio-player__button--next::before {
  content: "\002766";
}

.js-animate .wordmark-container__wordmark {
  transform: var(--transform);
}

.wordmark-container {
  margin: 0;
  position: relative;
  z-index: 1;
}

.wordmark-container__wordmark {
  width: 100%;
  height: 100vh;
  padding: 2rem;
  padding-top: 0;
  overflow: visible;
  transition: transform ease var(--animation-speed-slow);
}

.wordmark-container__wordmark .no-fill {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke: var(--color-dark);
  stroke-width: 0.5px;
}

.wordmark-container__wordmark .fill {
  fill: var(--color-dark);
}

.audio-player {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 10;
}

.audio-player__song {
  position: absolute;
  left: -9999px;
}

.no-js .audio-player__song {
  position: relative;
  left: auto;
  margin: 1rem;
  margin-right: 0;
}

.audio-player__track-title {
  background-color: var(--color-light);
  position: relative;
  opacity: 0;
}

.js-animate .audio-player__track-title {
  opacity: 1;
}

.no-js .audio-player__track-title {
  display: none;
}

.audio-player__track-title__heading {
  margin: .5rem;
  font-size: 1rem;
}

.audio-player__button {
  margin: 1rem;
  margin-right: 0;
}

.no-js .audio-player__button {
  display: none;
}

.audio-player__button--next {
  display: none;
}

.js-animate .audio-player__button--next {
  display: inline-block;
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1.1); }
  2%, 98% { transform: scale(1); }
}

@keyframes blink {
  0%, 100% { filter: invert(1); }
  5%, 95% { filter: invert(0); }
}

@keyframes draw {
  0% {
    stroke-dasharray: 0 60px;
    stroke-opacity: 1;
  }
  10% {
    stroke-dasharray: 60px 0;
  }
  80% {
    stroke-dasharray: 60px 0;
    stroke-opacity: 1;
  }
  83% {
    stroke-opacity: 0;
  }
  100% {
    stroke-opacity: 0;
  }
}

.js-animate .wordmark-container {
  animation-name: rotate;
  animation-duration: calc(var(--beat-whole) * 16);
  animation-iteration-count: infinite;
  animation-timing-function: linear;
  animation-delay: var(--animation-speed-slow);
}

.js-animate .steve-chab-abstract .s,
.js-animate .steve-chab-abstract .t,
.js-animate .steve-chab-abstract .e,
.js-animate .steve-chab-abstract .v,
.js-animate .steve-chab-abstract .c,
.js-animate .steve-chab-abstract .h,
.js-animate .steve-chab-abstract .a,
.js-animate .steve-chab-abstract .b {
  animation-name: draw;
  animation-duration: 4s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
  stroke-opacity: 1;
  stroke-miterlimit: 10;
  stroke-dasharray: 60px 0;
  stroke-dashoffset: 60px;
}

.js-animate .steve-chab-abstract .s { animation-delay: 0; }
.js-animate .steve-chab-abstract .t { animation-delay: -.1s; }
.js-animate .steve-chab-abstract .e { animation-delay: -.2s; }
.js-animate .steve-chab-abstract .v { animation-delay: -.3s; }
.js-animate .steve-chab-abstract .c { animation-delay: -.4s; }
.js-animate .steve-chab-abstract .h { animation-delay: -.5s; }
.js-animate .steve-chab-abstract .a { animation-delay: -.6s; }
.js-animate .steve-chab-abstract .b { animation-delay: -.7s; }

.js-animate {
  animation-name: blink;
  animation-duration: var(--beat-whole);
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.js-animate .steve-chab-abstract,
.js-animate .steve-chab-grunge {
  opacity: 1;
}

.js-animate .s,
.js-animate .t,
.js-animate .e,
.js-animate .v,
.js-animate .c,
.js-animate .h,
.js-animate .a,
.js-animate .b {
  animation-name: pulse;
  animation-duration: var(--beat-half);
  animation-timing-function: linear; 
  animation-delay: 0s;
  animation-direction: normal;
  animation-iteration-count: infinite;
  animation-fill-mode: none;
  animation-play-state: running;
  transform-origin: 168px 168px;
}

.js-animate .s1,
.js-animate .t2,
.js-animate .e3-1,
.js-animate .v1,
.js-animate .e2-1,
.js-animate .c3,
.js-animate .h1,
.js-animate .a2,
.js-animate .b3 {
  animation-delay: .05s;
}

.js-animate .s2,
.js-animate .t3,
.js-animate .e1-1,
.js-animate .v2,
.js-animate .e3-2,
.js-animate .c1,
.js-animate .h2,
.js-animate .a3,
.js-animate .b1 {
  animation-delay: -.50s;
}
