/*--------------------------------------------------*
 * Base styles
 *--------------------------------------------------*/

:root {
  --base-unit: 1rem;
  --base-font-size: 100%;
  --active-opacity: 0.75;
  --transition-duration: 0.2s;

  --navbar-height: calc(5 * var(--base-unit));
  --socialbar-height: calc(3 * var(--base-unit));

  --fg-color: #ffffff;
  --bg-color: #191919;
  --tint-threshold: 0.4;

  --fade-in-delay-offset: 0.2s;
  --fade-in-duration: 0.5s;
}

html,
body {
  height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;

  user-select: none;
  word-break: normal;

  font-family: "Montserrat", sans-serif;
  font-size: var(--base-font-size);
  color: var(--fg-color);

  background: linear-gradient(
      rgba(0, 0, 0, var(--tint-threshold)),
      rgba(0, 0, 0, var(--tint-threshold))
    ),
    url("../images/house-on-fire-blur.jpg") no-repeat center center fixed;
  background-size: cover;
  overflow: auto;
}

a {
  text-decoration: none;
  color: var(--bg-color);
}

/*--------------------------------------------------*
 * Global layout styles
 *--------------------------------------------------*/

header,
main,
footer {
  width: 100%;
}

header {
  flex: 0 0;
  background-color: var(--fg-color);
}

header,
main {
  margin-bottom: calc(4 * var(--base-unit));
}

main {
  flex: 1 1;

  display: flex;
  flex-direction: column;
  align-items: center;
}

footer {
  flex: 0 0;
  display: flex;
  justify-content: center;
  align-items: center;

  padding-bottom: calc(var(--socialbar-height) + 2 * var(--base-unit));
}

.content {
  width: 90vw;
}

/*--------------------------------------------------*
 * Navigation / Social
 *--------------------------------------------------*/

.nav {
  display: flex;
  justify-content: center;
}

.navbar,
.socialbar {
  display: flex;
  justify-content: space-around;
  align-items: center;

  list-style: none;

  width: 100%;
  margin: 0;
  padding: 0;
}

.navbar {
  height: var(--navbar-height);
}

.social {
  display: flex;
  justify-content: center;
  margin-top: auto;

  width: 100%;
}

.socialbar {
  position: fixed;
  left: 0;
  bottom: 0;

  height: var(--socialbar-height);
  background-color: var(--bg-color);
  z-index: 1;
}

.navbar__item,
.socialbar__item {
  text-transform: uppercase;
}

.navbar__item {
  font-size: calc(1.5 * var(--base-unit));
}

.socialbar__item {
  font-size: calc(2 * var(--base-unit));
}

.navbar__item a {
  color: var(--bg-color);
}

.socialbar__item a {
  color: var(--fg-color);
  transition: color var(--transition-duration) ease;
}

.socialbar__item a:hover {
  color: rgba(255, 255, 255, var(--active-opacity));
}

/*--------------------------------------------------*
 * Content
 *--------------------------------------------------*/

.video-wrapper {
  position: relative;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.image-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-scale:nth-child(2n) {
  width: calc(50% - 2.5vw);;
  margin-right: 2.5vw;
}

.image-scale:nth-child(2n+3) {
  width: calc(50% - 2.5vw);
  margin-left: 2.5vw;
}

.image-scale:first-child .download {
  font-size: 100%;
}

.download {
  display: block;
  margin: var(--base-unit) 0;
  padding: var(--base-unit) calc(1.5 * var(--base-unit));
  border-radius: 10000px;
  font-size: calc(1 * var(--base-font-size));
  text-align: center;
  text-transform: uppercase;

  background-color: var(--fg-color);

  color: var(--bg-color);
  transition: transform var(--transition-duration) ease-out;
}

.download:hover {
  transform: scale(1.1);
}

.download-image:hover {
  transform: scale(1.05);
}

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

.content > *:not(:last-child) {
  margin-bottom: calc(2 * var(--base-unit));
}

.heading-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.heading-wrapper a {
  color: white;
}

.mail-icon {
  transform: translate(0, 0.0625rem);
}

/*--------------------------------------------------*
 * Media queries
 *--------------------------------------------------*/

@media (min-width: 35rem) {
  :root {
    --base-font-size: 150%;
  }

  .navbar,
  .socialbar,
  .content {
    max-width: 50rem;
  }

  .socialbar {
    position: unset;
    width: 100%;
    margin: calc(4 * var(--base-unit)) 0 calc(2 * var(--base-unit)) 0;
    background-color: unset;
  }

  .download {
    margin: calc(2 * var(--base-unit)) 0;
  }
  
  .image-scale:nth-child(2n) {
    width: calc(50% - var(--base-unit));
    margin-right: var(--base-unit);
  }

  .image-scale:nth-child(2n+3) {
    width: calc(50% - var(--base-unit));
    margin-left: var(--base-unit);
  }
  
  footer {
    padding-bottom: calc(2 * var(--base-unit));
  }
}

/*--------------------------------------------------*
 * Utility styles
 *--------------------------------------------------*/

.fade-in {
  animation: fade-in var(--fade-in-duration) ease-out;
  animation-fill-mode: both;
}

.fade-in:nth-child(0) {
  animation-delay: calc(1 * var(--fade-in-delay-offset));
}
.fade-in:nth-child(1) {
  animation-delay: calc(2 * var(--fade-in-delay-offset));
}
.fade-in:nth-child(2) {
  animation-delay: calc(3 * var(--fade-in-delay-offset));
}
.fade-in:nth-child(3) {
  animation-delay: calc(4 * var(--fade-in-delay-offset));
}
.fade-in:nth-child(4) {
  animation-delay: calc(5 * var(--fade-in-delay-offset));
}
.fade-in:nth-child(5) {
  animation-delay: calc(6 * var(--fade-in-delay-offset));
}
.fade-in:nth-child(6) {
  animation-delay: calc(7 * var(--fade-in-delay-offset));
}
.fade-in:nth-child(7) {
  animation-delay: calc(8 * var(--fade-in-delay-offset));
}
.fade-in:nth-child(8) {
  animation-delay: calc(9 * var(--fade-in-delay-offset));
}
.fade-in:nth-child(9) {
  animation-delay: calc(10 * var(--fade-in-delay-offset));
}
.fade-in:nth-child(10) {
  animation-delay: calc(11 * var(--fade-in-delay-offset));
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  
  to {
    opacity: 1;
  }
}

.underline {
  position: relative;
}

.underline::before {
  content: "";
  position: absolute;
  bottom: -0.125rem;
  left: 50%;
  width: 100%;
  height: 0.125rem;
  opacity: 0;
  background-color: black;
  transform-origin: center;
  transform: translate(-50%, 0) scaleX(0);
  transition: all var(--transition-duration) ease-out;
}

.underline:hover::before,
.underline--active::before {
  transform: translate(-50%, 0) scaleX(1);
  opacity: 1;
}

.flex-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}