:root {
  --loader-color: #e6c574;
  /* --loader-color: #f00; */
}

html {
  scrollbar-gutter: stable;
}

body.is-loading {
  background: #061c33;
  &:before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100lvh;
    background: inherit;
  }
  .kv {
    opacity: 0;
  }
}

.loader {
  position: fixed;
  top: 0;
  left: 0;
  inset: 0;
  z-index: 9999;
  width: 100%;
  height: 100%;
  background: #061c33;
  &.is-fadeout {
    opacity: 0;
  }
  path {
    fill: var(--loader-color);
  }
  .loader__wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: calc(100% - 40px);
    height: 100%;
    position: absolute;
    top: 0;
    left: 20px;
  }
  .loader__inner {
    width: 120px;
    height: 116px;
    position: relative;
    filter: drop-shadow(0px 0px 0 rgba(255, 255, 255, 0.5));
    pointer-events: none;
    &.is-active {
      animation-name: loaderGlow;
      animation-fill-mode: forwards;
      animation-iteration-count: 1;
    }
  }

  .loader__anniversary {
    position: absolute;
    bottom: -3%;
    left: 13%;
    width: 74%;
    path {
      opacity: 0;
      scale: 0.1;
      transform-origin: left center;
      translate: 0 1rem;
    }
    &.is-show {
      path {
        opacity: 1;
        translate: 0 0;
        scale: 1;
        transition: 0.6s cubic-bezier(0.88, 0, 0.11, 1);
      }
    }
  }

  .loader__name {
    position: absolute;
    right: 9%;
    top: 0;
    width: 40%;
    rotate: -20deg;
    transform-origin: 50% 100%;
    path {
      opacity: 0;
    }
    &.is-show {
      rotate: 0deg;
      transition: 1s 0.3s;
      path {
        opacity: 1;
        transition: 0.6s cubic-bezier(0.88, 0, 0.11, 1);
      }
    }
  }

  .loader__th {
    position: absolute;
    bottom: 12%;
    right: 0;
    width: 17%;
    opacity: 0;
    scale: 0;
    &.is-show {
      scale: 1;
      opacity: 1;
      transition: 0.6s cubic-bezier(0.56, 0.18, 0.2, 1.72);
    }
  }

  .loader__th--path {
    fill: #fff;
  }

  .loader__th--circle {
    fill: var(--loader-color);
    stroke: #fff;
    stroke-miterlimit: 10;
    stroke-width: 0.75px;
  }

  .loader__numbers {
    opacity: 1;
    display: flex;
    justify-content: space-between;
    gap: 4%;
    width: 90%;
    height: 90%;
    margin-left: 2.5%;
    /* translate: 0 -1%; */
    overflow: hidden;
  }

  .loader__place {
    width: 50%;
    height: 100%;
  }

  .loader__place-track {
    width: 100%;
    height: 100%;
  }

  .loader__numbers--each {
    height: 100%;
    flex: 0 0 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    svg {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
  }

  .loader__numbers--path {
    fill: var(--loader-color);
  }
  .loader__skip-button {
    appearance: none;
    border: 0;
    outline: 0;
    color: white;
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-size: 12px;
    background: transparent;
    cursor: pointer;
    letter-spacing: 0.3rem;
    font-family: serif;
    opacity: 0.4;
  }
}

@keyframes loaderGlow {
  0% {
    filter: drop-shadow(0px 0px 0 rgba(255, 255, 255, 0.5));
    animation-timing-function: ease-in;
  }
  10% {
    filter: drop-shadow(0px 0px 0.5rem rgba(255, 255, 255, 0.5));
    animation-timing-function: ease-out;
    will-change: filter;
    transform: translateZ(0);
  }
  40% {
    filter: drop-shadow(0px 0px 0 rgba(255, 255, 255, 0.5));
    animation-timing-function: ease-in;
  }
  60% {
    scale: 1;
    opacity: 1;
  }
  100% {
    scale: 10;
    opacity: 0;
  }
}
