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

File#: _1_back-to-top
Title: Back to top
Descr: Component that triggers scroll-y to the top of the page
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%;
}

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

Icons 

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

.cd-icon {
  --size: 1em;
  font-size: var(--size);
  height: 1em;
  width: 1em;
  display: inline-block;
  color: inherit;
  fill: currentColor;
  line-height: 1;
  flex-shrink: 0;
  max-width: initial;
}

.cd-icon use { /* SVG symbols - enable icon color corrections */
  color: inherit;
  fill: currentColor;
}

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

Component 

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

.back-to-top {
  --size: 50px;
  width: var(--size);
  height: var(--size);
  display: flex;
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  z-index: 10;
  border-radius: 50%;
  background-color: hsla(230, 13%, 9%, 0.9);
  visibility: hidden;
  opacity: 0;
  transition: 0.2s;
}

.back-to-top:hover {
  background-color: hsl(230, 13%, 9%);
}

.back-to-top .cd-icon {
  --size: 20px;
  display: block;
  margin: auto;
  color: hsl(0, 0%, 100%);
}

.back-to-top--is-visible {
  visibility: visible;
  opacity: 1;
}