/* ******* */
/* *** FONTS */
/* ******* */
@font-face {
  font-display: swap;
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/Lato/lato-v24-latin-regular.eot');
  src: url('../fonts/Lato/lato-v24-latin-regular.eot?#iefix') format('embedded-opentype'),
       url('../fonts/Lato/lato-v24-latin-regular.woff2') format('woff2'),
       url('../fonts/Lato/lato-v24-latin-regular.woff') format('woff'),
       url('../fonts/Lato/lato-v24-latin-regular.ttf') format('truetype'),
       url('../fonts/Lato/lato-v24-latin-regular.svg#Lato') format('svg');
}

@font-face {
  font-display: swap;
  font-family: 'Lobster Two';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/LobsterTwo/lobster-two-v20-latin-700.eot');
  src: url('../fonts/LobsterTwo/lobster-two-v20-latin-700.eot?#iefix') format('embedded-opentype'),
       url('../fonts/LobsterTwo/lobster-two-v20-latin-700.woff2') format('woff2'),
       url('../fonts/LobsterTwo/lobster-two-v20-latin-700.woff') format('woff'),
       url('../fonts/LobsterTwo/lobster-two-v20-latin-700.ttf') format('truetype'),
       url('../fonts/LobsterTwo/lobster-two-v20-latin-700.svg#LobsterTwo') format('svg');
}

@font-face {
  font-display: swap;
  font-family: 'Barlow Condensed';
  font-style: italic;
  font-weight: 800;
  src: url('../fonts/BarlowCondensed/barlow-condensed-v12-latin-800italic.eot');
  src: url('../fonts/BarlowCondensed/barlow-condensed-v12-latin-800italic.eot?#iefix') format('embedded-opentype'),
       url('../fonts/BarlowCondensed/barlow-condensed-v12-latin-800italic.woff2') format('woff2'),
       url('../fonts/BarlowCondensed/barlow-condensed-v12-latin-800italic.woff') format('woff'),
       url('../fonts/BarlowCondensed/barlow-condensed-v12-latin-800italic.ttf') format('truetype'),
       url('../fonts/BarlowCondensed/barlow-condensed-v12-latin-800italic.svg#BarlowCondensed') format('svg');
}

/* ******* */
/* *** BASE */
/* ******* */
html {
  height: -webkit-fill-available;
}

body {
  font-family: var(--font-family);
  color: var(--color-text-primary);
  font-weight: var(--font-weight);
  font-size: var(--font-size);
  letter-spacing: var(--font-spacing);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  max-height: 100%;
  background: var(--bg-body);
  display: flex;
  flex-direction: column;
}

* {
  box-sizing: border-box;
}

.overlay {
  position: relative;
}

.overlay::after {
  content: '';
  background: linear-gradient(var(--bg-overlay));
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 10;
  width: 100%;
  height: 100%;
}

.videoBg {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  object-fit: cover;
  filter: blur(var(--app-bg-video-blur));
}

.header, .main, .footer {
  background: var(--bg-content);
  width: 100%;
}



/* ******* */
/* *** PRELOADER */
/* ******* */
.preloader {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-preloader);
  z-index: 1000;
  opacity: 0;
  pointer-events: auto;
  transition: all 1s 1s;
  z-index: -1;
}

.preloader.active {
  opacity: 1;
  z-index: 1000;
}

.preloader__wrapper {
  position: relative;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  width: fit-content;
  height: fit-content;
}

.heart {
  position: absolute;
  top: 12px;
  width: 25px;
}

.heart-1 {
  left: 5px;
  animation: heart-1-scale;
  animation-duration: 1.5s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

.heart-2 {
  right: 5px;
  animation: heart-2-scale;
  animation-duration: 1.5s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

.preloader__text {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font-weight: 700;
  clip-path: inset(0 2ch 0 0);
  animation: dots 1s steps(3) infinite;
  color: var(--color-preloader-dots);
  font-size: var(--font-preloader-dots-size);
  font-family: serif;
}



/* ******* */
/* *** HEADER */
/* ******* */
.header {
  padding: 16px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-logo);
  font-weight: 700;
  font-size: var(--font-logo-size);
  letter-spacing: var(--font-logo-spacing);
}

.top img {
  display: block;
  width: var(--app-direct-icon-size);
  height: var(--app-direct-icon-size);
  object-fit: contain;
}

.stories {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
}

.story {
  border-radius: 50%;
  position: relative;
}

.story:nth-child(1n + 5) {
  display: none;
}

.story::before, 
.story::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.story::before {
  background: linear-gradient(45deg, var(--bg-stories-border));
}

.story::after {
  background: var(--bg-stories);
  transform: scale(0.96);
}

.story img {
  position: relative;
  z-index: 10;
  transform: scale(0.96);
}

.user {
  position: relative;
  background: var(--bg-add-story);
  border-radius: 50%;
}

.user::after {
  content: '+';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-add-story-icon);
  color: var(--color-add-story-icon);
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1;
  font-weight: bold;
}

.stories img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.story, .user {
  width: var(--app-story-and-user-round-size);
  height: auto;
}



/* ******* */
/* *** MAIN */
/* ******* */
.main {
  border-top: 1px solid var(--color-stories-bottom-border);
}

.info {
  padding: 8px 16px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: var(--app-avatar-size);
  height: var(--app-avatar-size);
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-add-story);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;  
}

.more {
  margin-left: auto;
}

.more img {
  display: block;
}

.media {
  height: var(--app-media-block-height);
  background-size: cover;
  background-repeat: no-repeat;
}

.video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 10;
}




/* ******* */
/* *** FOOTER */
/* ******* */
.footer {
  padding: 32px 16px 16px;
  flex-grow: 1;
}

.tools {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.item {
  margin-right: 16px;
}

.item:last-child {
  margin-right: 0;
  margin-left: auto;
}

.caption {
  position: absolute;
  bottom: var(--app-primary-button-bottom-offset);
  left: 50%;
  z-index: 100;
  transform: translateX(-50%);
  width: 270px;
  max-width: calc(100% - (16px * 2));
  opacity: 0;
  -webkit-animation: fade-in-bottom 0.4s linear .3s forwards;
  animation: fade-in-bottom 0.4s linear .3s forwards;
}

.caption .btn {
  display: block;
  color: var(--color-text-primary-btn);
  text-decoration: none;
  text-align: center;
  text-transform: uppercase;
  font-family: var(--font-primary);
  font-style: italic;
  font-weight: 800;
  font-size: var(--font-primary-btn-size);
  letter-spacing: 2px;
  background: linear-gradient(to right, var(--bg-primary-btn));
  border-bottom: 2px solid #fff;
  border-radius: 36px;
  padding: 6px 14px 10px;
  text-shadow: -1.5px 1.5px 0px var(--color-shadow-primary-btn);
  animation: pulse var(--app-pulse-animation-speed) alternate-reverse .7s infinite;
  word-break: break-word;
  hyphens: auto;
}

.caption a+a {
  color: var(--color-text-secondary);
  font-weight: 700;
  margin-top: 12px;
  display: block;
  text-align: center;
}





/* ******* */
/* *** ANIMATIONS */
/* ******* */
@keyframes pulse {
  0% {
    transform: scale(1)
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes fade-in-bottom {
  0% {
    transform: translate(-50%, 50px);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

@keyframes heart-1-scale {
  0% {
    transform: scale(100%);
  }
  50% {
    transform: scale(130%);
  }
  100% {
    transform: scale(70%);
  }
}

@keyframes heart-2-scale {
  0% {
    transform: scale(100%);
  }
  50% {
    transform: scale(70%);
  }
  100% {
    transform: scale(130%);
  }
}

@keyframes dots {
  to {
    clip-path: inset(0 -1ch 0 0);
  }
}





/* ******* */
/* *** RESPONSIVE */
/* ******* */
@media screen and (min-width: 640px) {  
  .main, .header, .footer {
    max-width: var(--app-width);
    margin: 0 auto;
  }
  
  .story:nth-child(1n + 5) {
    display: block;
  }
}
