﻿/* -------------------------------- 

File#: _1_parallax-image
Title: Parallax Image
Descr: Figure element with images floating in a 3D space
Usage: codyhouse.co/license

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

* {
  font: inherit;
  margin: 0;
  padding: 0;
  border: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: hsl(0, 0%, 100%);
  font-family: system-ui, sans-serif;
  color: hsl(230, 7%, 23%);
  font-size: 1.125rem; /* 18px */
  line-height: 1.4;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  color: hsl(230, 13%, 9%);
  font-weight: 700;
}

h1 {
  font-size: 2.5rem; /* 40px */
}

h2 {
  font-size: 2.125rem; /* 34px */
}

h3 {
  font-size: 1.75rem; /* 28px */
}

h4 {
  font-size: 1.375rem; /* 22px */
}

ol, ul, menu {
  list-style: none;
}

button, input, textarea, select {
  background-color: transparent;
  border-radius: 0;
  color: inherit;
  line-height: inherit;
  -webkit-appearance: none;
          appearance: none;
}

textarea {
  resize: vertical;
  overflow: auto;
  vertical-align: top;
}

a {
  color: hsl(250, 84%, 54%);
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* img, video, svg {
  display: block;
  max-width: 100%;
} */

/* -------------------------------- 

Component 

-------------------------------- */

.parallax {
  overflow: hidden;
  perspective: 4000px;
  opacity: 0; /* hide image while it is initialized in JS */
}

.parallax--loaded {
  opacity: 1;
}

.parallax__wrapper {
  position: relative;
  transform-style: preserve-3d;
  transform: translateZ(0);
  will-change: transform;
  transition: transform 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.parallax__item {
  display: block;
  width: 100%;
}

.parallax__item:not(:first-of-type) {
  position: absolute;
  top: 0;
  left: 0;
}