.loader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #4A342A;
  opacity: 1;
  visibility: visible;
  transition:
    opacity .8s cubic-bezier(.77, 0, .18, 1),
    visibility .8s cubic-bezier(.77, 0, .18, 1);
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* CERCHIO GRANDE */
.loader__ring {
  width: 220px;
  height: 220px;
  border: 1px solid rgba(234, 220, 206, .18);
  border-top-color: #EADCCE;
  border-right-color: rgba(255, 252, 248, .55);
  border-radius: 50%;
  animation: loaderSpin 1.8s linear infinite;
}

/* LOGO CENTRATO NEL CERCHIO */
.loader__logo-wrap {
  position: absolute;
  top: 110px;
  left: 50%;
  width: 170px;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
}

.loader__logo {
  display: block;
  width: 100%;
  height: auto;
  max-width: 170px;
  max-height: 170px;
  object-fit: contain;
  opacity: 0;
  transform: scale(.88);
  animation:
    loaderLogoIn .9s .15s cubic-bezier(.22, 1, .36, 1) forwards;
}

.loader__text {
  margin-top: .25rem;
  font-size: .72rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: #EADCCE;
  opacity: 0;
  animation:
    loaderFadeIn 1s .55s forwards;
}

.loader__progress {
  width: 220px;
  height: 1px;
  overflow: hidden;
  background: rgba(234, 220, 206, .15);
}

.loader__bar {
  width: 0;
  height: 100%;
  background: #EADCCE;
  animation:
    loaderProgress 2.2s cubic-bezier(.77, 0, .18, 1) forwards;
}

body.is-loading {
  overflow: hidden;
}

/* ROTAZIONE CERCHIO */
@keyframes loaderSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ENTRATA LOGO */
@keyframes loaderLogoIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ENTRATA TESTO */
@keyframes loaderFadeIn {
  to {
    opacity: 1;
  }
}

/* BARRA CARICAMENTO */
@keyframes loaderProgress {
  to {
    width: 100%;
  }
}

/* TABLET / MOBILE */
@media (max-width: 767px) {
  .loader__inner {
    gap: 1.75rem;
  }

  .loader__ring {
    width: 180px;
    height: 180px;
  }

  .loader__logo-wrap {
    top: 90px;
    width: 140px;
    height: 140px;
  }

  .loader__logo {
    max-width: 140px;
    max-height: 140px;
  }

  .loader__text {
    font-size: .62rem;
    letter-spacing: .24em;
  }

  .loader__progress {
    width: 180px;
  }
}

/* ACCESSIBILITÀ */
@media (prefers-reduced-motion: reduce) {
  .loader__ring {
    animation-duration: 3s;
  }

  .loader__bar {
    animation: none;
    width: 100%;
  }

  .loader__logo {
    animation: none;
    opacity: 1;
    transform: none;
  }
}