:root {
  --scm-green: #1b5e3a;
  --scm-green-2: #2e7d52;
  --scm-gold: #d4af37;
  --scm-cream: #fbf7ee;
}

html.scm-loader-active,
html.scm-loader-active body {
  overflow: hidden;
}

#sarmayech-page-loader.is-active ~ * {
  visibility: hidden;
}

#sarmayech-page-loader {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

#sarmayech-page-loader.is-active,
html.scm-show-loader #sarmayech-page-loader {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#sarmayech-page-loader.is-leaving {
  opacity: 0;
  visibility: hidden;
}

.scm-welcome-bg {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      125deg,
      rgba(255, 255, 255, 0.35) 0 2px,
      transparent 2px 14px
    ),
    radial-gradient(circle at 18% 12%, rgba(212, 175, 55, 0.22), transparent 42%),
    radial-gradient(circle at 82% 88%, rgba(27, 94, 58, 0.18), transparent 45%),
    linear-gradient(145deg, #fbf7ee 0%, #eef6ef 38%, #f5ecd4 72%, #fbf7ee 100%);
}

.scm-loader-panel {
  position: relative;
  z-index: 2;
  width: min(92vw, 340px);
  padding: 1.75rem 1.25rem 1.35rem;
  text-align: center;
}

.scm-draw-stage {
  position: relative;
  width: min(68vw, 200px);
  margin: 0 auto 1rem;
  aspect-ratio: 1;
}

.scm-logo-picture {
  display: block;
  width: 100%;
  height: 100%;
}

.scm-brand-mark--icon {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 22%;
  border: 2px solid rgba(212, 175, 55, 0.55);
  background: linear-gradient(145deg, #f5d78b, #c9922f);
  color: #1a3242;
  font-size: clamp(3rem, 14vw, 4.5rem);
  box-shadow: 0 12px 36px rgba(168, 116, 36, 0.28);
  opacity: 0;
  transform: scale(0.94);
  clip-path: inset(0 0 0 100%);
  -webkit-clip-path: inset(0 0 0 100%);
}

.scm-draw-stage.is-drawing .scm-brand-mark--icon {
  animation:
    scm-logo-reveal 1.35s cubic-bezier(0.42, 0, 0.18, 1) forwards,
    scm-logo-pop 0.55s cubic-bezier(0.34, 1.25, 0.64, 1) 1.05s forwards;
}

.scm-brand-mark {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.94);
  filter: saturate(0.35) brightness(1.08);
  clip-path: inset(0 0 0 100%);
  -webkit-clip-path: inset(0 0 0 100%);
}

.scm-draw-shine {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.55), transparent 58%);
  opacity: 0;
  pointer-events: none;
}

.scm-draw-stage.is-drawing .scm-brand-mark {
  animation:
    scm-logo-reveal 1.35s cubic-bezier(0.42, 0, 0.18, 1) forwards,
    scm-logo-pop 0.55s cubic-bezier(0.34, 1.25, 0.64, 1) 1.05s forwards;
}

.scm-draw-stage.is-drawing .scm-draw-shine {
  animation: scm-shine-in 0.65s ease 1.1s forwards;
}

@keyframes scm-logo-reveal {
  0% {
    opacity: 0;
    clip-path: inset(0 0 0 100%);
    -webkit-clip-path: inset(0 0 0 100%);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    -webkit-clip-path: inset(0 0 0 0);
    filter: saturate(1) brightness(1);
  }
}

@keyframes scm-logo-pop {
  to {
    transform: scale(1);
  }
}

@keyframes scm-shine-in {
  to {
    opacity: 0.85;
  }
}

.scm-brand-name {
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--scm-green);
  letter-spacing: -0.02em;
}

.scm-brand-en {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a7340;
}

.scm-caption {
  margin-top: 0.65rem;
  font-size: 0.88rem;
  color: #5f6d78;
  font-weight: 600;
}

.scm-progress {
  margin: 0.85rem auto 0;
  width: min(240px, 80%);
  height: 5px;
  border-radius: 999px;
  background: rgba(27, 94, 58, 0.12);
  overflow: hidden;
}

.scm-progress-fill {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--scm-green-2), var(--scm-gold));
  transform: scaleX(0);
  transform-origin: right center;
}

#sarmayech-page-loader.is-active .scm-progress-fill {
  animation: scm-progress-fill-once 1.35s cubic-bezier(0.35, 0, 0.15, 1) forwards;
}

@keyframes scm-progress-fill-once {
  0% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  html.scm-show-loader body > *:not(#sarmayech-page-loader) {
    visibility: visible;
  }

  .scm-mark-fallback {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .scm-mark-svg {
    display: none;
  }

  .scm-stroke,
  .scm-progress-fill {
    animation: none !important;
  }

  .scm-stroke {
    stroke-dashoffset: 0;
  }

  .scm-mark-fill {
    opacity: 1;
  }
}
