/* Fonts */
@font-face {
  font-family: Silka;
  src: url(/assets/fonts/Silka-Regular.otf);
}

@font-face {
  font-family: Silka-Bold;
  src: url(/assets/fonts/Silka-Bold.ttf);
}

/* Vaiables */
:root {
  --clr-navbar: #161616;
  --clr-headings: #212b36;
  --clr-paragraph: #637381;
  --clr-white: #ffffff;
  --clr-body: #f9fbfd;
  --border-radius: 8px;
  --box-shadow: rgba(30, 30, 30, 0.03);
  --transition: 600ms;
  --pading-inline: 1em;
}

/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

::selection {
  background-color: var(--clr-navbar);
  color: var(--clr-white);
}

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

/* Default headings style */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--clr-headings, #000);
}

h1,
h3,
h4 {
  font-family: Silka-Bold;
}

p {
  color: var(--clr-paragraph, #000);
  font-size: 0.9rem;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul {
  list-style: none;
}

/* Set core root defaults */
html {
  scroll-behavior: smooth;
}

/* Set core body defaults */
body {
  text-rendering: optimizeSpeed;
  line-height: 1.5;
  font-family: Silka;
  background-color: var(--clr-body);
}

html,
body {
  position: relative;
  overflow-x: hidden;
  overflow-y: hidden;
}

/* A elements that don't have a class get default styles */
a {
  text-decoration: none;
  color: inherit;
}

.link {
  text-decoration: underline;
  opacity: 0.8;
  transition: opacity var(--transition, 350ms) ease;
}

.link:hover {
  opacity: 1;
}

.hover {
  transition: opacity var(--transition, 350ms) ease;
}

.hover:hover {
  opacity: 0.8;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
  object-fit: cover;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

.flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

section {
  width: 100%;
  padding: 4em var(--pading-inline, 1em);
}

/* Pre loader styling */
.loader {
  width: 100%;
  height: 100vh;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: var(--clr-navbar, #000);
  color: var(--clr-white, #fff);
  z-index: 800;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity var(--transition, 350ms) ease,
    visibility var(--transition, 350ms) ease;
}

.loader.active {
  opacity: 0;
  visibility: hidden;
}

.loader span {
  position: absolute;
  bottom: 20px;
  font-size: 0.9rem;
}

.loader img {
  width: 4rem;
  animation: loader-animation 800ms ease infinite alternate;
  transition: transform var(--transition, 350ms) 350ms ease;
}

.loader.active img {
  transform: scale(10);
}

@keyframes loader-animation {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.animate {
  opacity: 0;
  transition: transform var(--transition, 350ms) ease,
    opacity var(--transition, 350ms) ease;
}

.animate.animate__top {
  transform: translateY(50px);
}

.animate.animate__left {
  transform: translateY(50px);
}

.animate.animate__right {
  transform: translateY(50px);
}

.animate__active {
  transform: translateY(0);
  opacity: 1;
}

.animate__active.animate__top {
  transform: translateY(0);
}

.animate__active.animate__left {
  transform: translateY(0);
}

.animate__active.animate__right {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .animate {
    opacity: 0;
    transition: transform var(--transition, 350ms) ease,
      opacity var(--transition, 350ms) ease;
  }

  .animate.animate__top {
    transform: translateY(50px);
  }

  .animate.animate__left {
    transform: translateX(-50px);
  }

  .animate.animate__right {
    transform: translateX(50px);
  }

  .animate__active {
    transform: translateY(0);
    opacity: 1;
  }

  .animate__active.animate__top {
    transform: translateY(0);
  }

  .animate__active.animate__left {
    transform: translateX(0);
  }

  .animate__active.animate__right {
    transform: translateX(0);
  }
}

/* To top arrow styling */
.to-top {
  width: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: fixed;
  bottom: 10px;
  right: 10px;
  cursor: pointer;
  transform: translateY(4px);
  opacity: 0;
  transition: transform var(--transition, 350ms) ease,
    opacity var(--transition, 350ms) ease;
}

.to-top.active {
  transform: translateY(0px);
  opacity: 1;
}

.to-top:hover {
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
