#loader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 700;
  background: transparent;
  pointer-events: none;
}

.portfolio-editor #portfolio_page {
  position: relative;
}

.portfolio-editor #portfolio_page #loader {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#loader::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.356);
  pointer-events: none;
  -webkit-backdrop-filter: blur(100px);
  backdrop-filter: blur(100px);
  transition: opacity 360ms ease, background 360ms ease;
}

.night #loader::before,
body.night #loader::before {
  background: rgba(0,0,0,0.12);
}

#loader.loader-hidden::before {
  opacity: 0;
}

.ark-loader {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ark-circles {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ark-circle {
  position: absolute;
  border-radius: var(--portfolios-border-radius-full);
  background-color: var(--portfolios-text-main-color);
  color: var(--portfolios-text-main-color, #222);
  opacity: 0;
  transform-origin: center center;
  animation: ark-circle-anim 4s cubic-bezier(0.2, 0.6, 0.2, 1) infinite;
}

.ark-circle-1 {
  width: 30px;
  height: 30px;
  animation-delay: 0s;
}

.ark-circle-2 {
  width: 60px;
  height: 60px;
  animation-delay: 0.75s;
}

.ark-circle-3 {
  width: 90px;
  height: 90px;
  animation-delay: 1.5s;
}

.ark-circle-4 {
  width: 120px;
  height: 120px;
  animation-delay: 2.25s;
}

@keyframes ark-circle-anim {
  0% {
    opacity: 0;
    transform: scale(0.2) rotate(0deg);
    filter: blur(0);
  }

  50% {
    opacity: 0.35;
    transform: scale(1.03) rotate(1deg);
    filter: blur(0.4px);
  }

  100% {
    opacity: 0;
    transform: scale(1.15) rotate(0deg);
    filter: blur(0);
  }
}

.sr-only {
  position: absolute;
  left: -9999px;
}

#loader.loader-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Hide page content until assets are ready to avoid layout shift */
html:not(.ark-page-ready) #portfolio_page,
html:not(.ark-page-ready) .page-content {
  opacity: 0;
  visibility: hidden;
  transition: opacity 320ms ease, visibility 0s linear 320ms;
}

/* Reveal when ready */
html.ark-page-ready #portfolio_page,
html.ark-page-ready .page-content {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

@media (max-width: 600px) {
  .ark-circles {
    width: 90px;
    height: 90px;
  }
  
  .ark-circle-1 {
    width: 22px;
    height: 22px;
  }
  
  .ark-circle-2 {
    width: 45px;
    height: 45px;
  }
  
  .ark-circle-3 {
    width: 68px;
    height: 68px;
  }
  
  .ark-circle-4 {
    width: 90px;
    height: 90px;
  }
}
