:root {
  --preloader-color: #487eb0;
  --preloader-panel-border: #33577a;
  --preloader-panel-bg: rgba(0, 0, 0, 0.20);
  --preloader-text: #afbbcc;

  --orb-dark: #1e3f57;
  --orb-mid: #3c617d;
  --orb-light: #6bb2cd;
  --orb-glow: #6bb2cd;

  --preloader-z: 99999;
}

* {
  box-sizing: border-box;
}

html.is-preloading,
html.is-preloading body {
  overflow: hidden;
  height: 100%;
  overscroll-behavior: none;
}

#slc-preloader-mount {
  position: fixed;
  inset: 0;
  z-index: var(--preloader-z);
  background: var(--preloader-color);
}

#slc-preloader-mount:empty::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.24);
  border-top-color: rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  translate: -50% -50%;
  animation: slc-preloader-bootstrap-spin 0.8s linear infinite;
}

@keyframes slc-preloader-bootstrap-spin {
  to { transform: rotate(360deg); }
}

body {
  margin: 0;
}

/* =========================================================
   پوشش اصلی و SVG مثلث‌ها
   ========================================================= */
#preloader {
  position: fixed;
  inset: 0;
  z-index: var(--preloader-z);
  margin: 0;
  padding: 0;
  overflow: hidden;
  direction: ltr;
  pointer-events: auto;
  visibility: visible;
}

#preloader.is-finished {
  display: none;
  pointer-events: none;
}

#preloader .preloader-polygons {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

#preloader .polygon {
  fill: var(--preloader-color) !important;
  stroke: var(--preloader-color) !important;
  stroke-width: 1;
  fill-opacity: 1;
  stroke-opacity: 1;
  shape-rendering: geometricPrecision;
}

/* polygon-hidden در سورس اصلی رفتار CSS نداشت.
   کلاس را حفظ کرده‌ایم چون بخشی از SVG اصلی است. */
#preloader .polygon-hidden {
}

/* =========================================================
   پنل مرکزی
   ========================================================= */
#Subpreloader {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 380px;
  height: 390px;
  margin: 0;
  padding: 0;
  direction: ltr;
  color: rgba(255, 192, 0, 0.99);
  font-family: Verdana, Arial, Tahoma, sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  background: var(--preloader-panel-bg);
  border: 6px solid var(--preloader-panel-border);
  border-radius: 6px;
  box-shadow:
    0 0 5px rgba(255, 255, 255, 0.25),
    inset 0 0 5px rgba(255, 255, 255, 0.15);
  translate: -50% -50%;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}

.loader-animation-image {
  position: relative;
  width: 300px;
  height: 300px;
  margin-inline: auto;
  top: 10px;
  direction: ltr;
}

.loader-animation-image svg.preloader {
  width: 292px;
  height: 292px;
}

/* =========================================================
   کره اصلی (در این نسخه استفاده نمی‌شود؛ چرخ جایگزین شده است)
   ========================================================= */
.Dotloader {
  position: relative;
  top: 10px;
  width: 200px;
  height: 200px;
  margin-inline: auto;
  border-radius: 50%;
  background:
    linear-gradient(var(--orb-dark), transparent),
    linear-gradient(90deg, var(--orb-mid), transparent),
    linear-gradient(-90deg, var(--orb-light), transparent);
  background-blend-mode: screen;
  box-shadow: 0 0 50px 0 var(--orb-glow);
  isolation: isolate;
  transform-origin: 50% 50%;
  will-change: transform, filter;
}

/* سایه زیر کره */
.Dotloader::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  bottom: -55px;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: rgba(177, 196, 202, 0.30);
  box-shadow: 0 0 50px 20px rgba(177, 196, 202, 0.30);
  transform: scaleX(0.70) scaleY(0.10);
  transform-origin: 50% 100%;
}

/* نقطه نور */
.DotloaderSpec {
  position: absolute;
  top: 50%;
  right: 50%;
  width: 1px;
  height: 1px;
  border-radius: 20px;
  background: rgba(172, 224, 241, 0.40);
  box-shadow: 0 0 35px 20px rgba(172, 224, 241, 0.40);
  transform: rotateZ(30deg) translateY(-65px) scaleY(0.75);
}

/* سایه داخلی */
.Dotloadeshadow {
  position: absolute;
  top: 50%;
  right: 50%;
  width: 10px;
  height: 10px;
  border-radius: 20px;
  background: rgba(30, 63, 87, 0.10);
  box-shadow: 0 0 30px 20px rgba(30, 63, 87, 0.10);
  transform: rotateZ(-140deg) translateY(-70px) scaleY(0.50);
}

/* =========================================================
   حباب‌های داخل و اطراف کره
   ========================================================= */
.dot {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  opacity: 0;
  border-radius: 50%;
  background:
    linear-gradient(rgba(255, 255, 255, 0.60), transparent),
    linear-gradient(90deg, var(--orb-mid), transparent),
    linear-gradient(-90deg, var(--orb-light), transparent);
  background-blend-mode: screen;
  animation: dot5 3s cubic-bezier(.8, .1, .9, .5) infinite;
  will-change: transform, opacity;
}

.dot:nth-child(1) { margin-left: -80px; bottom: 34px; animation-name: dot1; animation-delay: 750ms; }
.dot:nth-child(2) { margin-left: -63px; bottom: 18px; animation-name: dot2; animation-delay: 1750ms; }
.dot:nth-child(3) { margin-left: -50px; bottom: 10px; animation-name: dot3; animation-delay: 250ms; }
.dot:nth-child(4) { margin-left: -27px; bottom: 2px;  animation-name: dot4; animation-delay: 1500ms; }
.dot:nth-child(5) { margin-left: -10px; bottom: 0;    animation-name: dot5; animation-delay: 0ms; }
.dot:nth-child(6) { margin-left: 8px;   bottom: 3px;  animation-name: dot6; animation-delay: 1000ms; }
.dot:nth-child(7) { margin-left: 30px;  bottom: 10px; animation-name: dot7; animation-delay: 2000ms; }
.dot:nth-child(8) { margin-left: 42px;  bottom: 19px; animation-name: dot8; animation-delay: 500ms; }
.dot:nth-child(9) { margin-left: 60px;  bottom: 34px; animation-name: dot9; animation-delay: 1250ms; }

@keyframes dot1 {
  0% { transform: translateY(0) scale(.1); opacity: 0; animation-timing-function: cubic-bezier(.39,.13,.71,.6); }
  50% { transform: translateY(-60px) scale(.3); opacity: .4; animation-timing-function: cubic-bezier(.29,.4,.69,.68); }
  100% { transform: translateY(-120px) scale(.1); opacity: 0; }
}

@keyframes dot2 {
  0% { transform: translateY(0) scale(.2); opacity: 0; animation-timing-function: cubic-bezier(.39,.13,.71,.6); }
  50% { transform: translateY(-70px) scale(.4); opacity: .9; animation-timing-function: cubic-bezier(.29,.4,.69,.68); }
  100% { transform: translateY(-140px) scale(.2); opacity: 0; }
}

@keyframes dot3 {
  0% { transform: translateY(0) scale(.2); opacity: 0; animation-timing-function: cubic-bezier(.39,.13,.71,.6); }
  50% { transform: translateY(-80px) scale(.5); opacity: .8; animation-timing-function: cubic-bezier(.29,.4,.69,.68); }
  100% { transform: translateY(-160px) scale(.2); opacity: 0; }
}

@keyframes dot4 {
  0% { transform: translateY(0) scale(.1); opacity: 0; animation-timing-function: cubic-bezier(.39,.13,.71,.6); }
  50% { transform: translateY(-90px) scale(.3); opacity: .5; animation-timing-function: cubic-bezier(.29,.4,.69,.68); }
  100% { transform: translateY(-180px) scale(.1); opacity: 0; }
}

@keyframes dot5 {
  0% { transform: translateY(0) scale(.3); opacity: 0; animation-timing-function: cubic-bezier(.39,.13,.71,.6); }
  50% { transform: translateY(-90px) scale(.5); opacity: .85; animation-timing-function: cubic-bezier(.29,.4,.69,.68); }
  100% { transform: translateY(-180px) scale(.3); opacity: 0; }
}

@keyframes dot6 {
  0% { transform: translateY(0) scale(.2); opacity: 0; animation-timing-function: cubic-bezier(.39,.13,.71,.6); }
  50% { transform: translateY(-60px) scale(.4); opacity: .8; animation-timing-function: cubic-bezier(.29,.4,.69,.68); }
  100% { transform: translateY(-120px) scale(.2); opacity: 0; }
}

@keyframes dot7 {
  0% { transform: translateY(0) scale(.1); opacity: 0; animation-timing-function: cubic-bezier(.39,.13,.71,.6); }
  50% { transform: translateY(-75px) scale(.3); opacity: .6; animation-timing-function: cubic-bezier(.29,.4,.69,.68); }
  100% { transform: translateY(-150px) scale(.1); opacity: 0; }
}

@keyframes dot8 {
  0% { transform: translateY(0) scale(.2); opacity: 0; animation-timing-function: cubic-bezier(.39,.13,.71,.6); }
  50% { transform: translateY(-50px) scale(.5); opacity: .8; animation-timing-function: cubic-bezier(.29,.4,.69,.68); }
  100% { transform: translateY(-100px) scale(.2); opacity: 0; }
}

@keyframes dot9 {
  0% { transform: translateY(0) scale(.1); opacity: 0; animation-timing-function: cubic-bezier(.39,.13,.71,.6); }
  50% { transform: translateY(-60px) scale(.3); opacity: .5; animation-timing-function: cubic-bezier(.29,.4,.69,.68); }
  100% { transform: translateY(-120px) scale(.1); opacity: 0; }
}


/* =========================================================
   چرخ قطار جایگزین کره
   ========================================================= */
.train-wheel-wrap {
  position: absolute;
  isolation: isolate;
  top: 5px;
  left: 50%;
  width: 292px;
  height: 292px;
  transform: translateX(-50%);
  pointer-events: none;
}

.loader-animation-image > .train-wheel-wrap > svg.train-wheel-svg {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;

  /*
   * قطر فلزی واقعی SVG برابر 524 واحد از viewBox هفتصدوبیست‌واحدی است.
   * در نمایش 375px، قطر قابل‌مشاهده چرخ تقریباً 273px می‌شود.
   */
  width: 340px;
  height: 340px;
  max-width: none;

  transform: translate(-50%, -50%);
  z-index: 1;
  overflow: visible;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.12));
}

.train-wheel-svg #groundShadow {
  opacity: .26;
}

.train-wheel-svg #wheelAssembly,
.train-wheel-svg #wheelCore,
.train-wheel-svg #specularFast,
.train-wheel-svg #specularSlow,
.train-wheel-svg #hubPulse,
.train-wheel-svg #groundShadow {
  will-change: transform, opacity;
}

/* =========================================================
   سامانه ذرات صنعتی: غبار نرم، جرقه فلزی و درخشش لبه
   ========================================================= */
.particle-system {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dust-layer,
.spark-layer {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.dust-layer {
  z-index: 0;
}

.spark-layer {
  z-index: 2;
}

/* ذرات گرد، آرام و بسیار کم‌رنگ؛ پشت چرخ حرکت می‌کنند */
.dust-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 3px;
  opacity: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle,
      rgba(255,255,255,.98) 0 18%,
      rgba(186, 231, 249, .78) 34%,
      rgba(110, 184, 218, .22) 66%,
      rgba(110, 184, 218, 0) 100%);
  box-shadow:
    0 0 7px rgba(164, 224, 250, .30),
    0 0 2px rgba(255,255,255,.42);
  will-change: transform, opacity;
}

/* جرقه‌های کشیده؛ از لبه چرخ و در مسیر مماسی پرتاب می‌شوند */
.metal-spark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  opacity: 0;
  border-radius: 999px;
  transform-origin: 0 50%;
  background:
    linear-gradient(90deg,
      rgba(255,255,255,0) 0%,
      rgba(228, 248, 255, .24) 14%,
      rgba(255,255,255,.98) 44%,
      rgba(233, 250, 255, .96) 56%,
      rgba(159, 220, 247, .68) 76%,
      rgba(112, 183, 218, 0) 100%);
  box-shadow:
    0 0 9px rgba(204, 241, 255, .42),
    0 0 3px rgba(255,255,255,.72);
  will-change: transform, opacity, width;
}

/* درخشش کوتاه روی محیط فلزی */
.rim-glint {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  opacity: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(247, 253, 255, .98);
  box-shadow:
    0 0 7px rgba(255,255,255,.86),
    0 0 16px rgba(160, 221, 247,.50);
  will-change: transform, opacity;
}

.rim-glint::before,
.rim-glint::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background:
    linear-gradient(90deg,
      rgba(255,255,255,0),
      rgba(255,255,255,.9),
      rgba(255,255,255,0));
  transform: translate(-50%, -50%);
}

.rim-glint::before {
  width: 17px;
  height: 1px;
}

.rim-glint::after {
  width: 1px;
  height: 17px;
}

/* =========================================================
   سه حلقه SVG اطراف کره
   ========================================================= */
#preloader-container {
  position: absolute;
  top: 5px;
  left: 50%;
  width: 292px;
  height: 292px;
  transform: translateX(-50%);
  pointer-events: none;
}

#preloader-container svg {
  width: 292px;
  height: 292px;
  overflow: visible !important;
}

svg.preloader circle {
  fill: none;
  stroke-linecap: round;
  stroke-dashoffset: 0;
  will-change: stroke-dashoffset;
}

/* =========================================================
   حروف LOADING
   ========================================================= */
#load {
  position: absolute;
  right: 24px;
  bottom: 18px;
  left: 24px;
  height: 46px;
  overflow: hidden;
  direction: ltr;
}

#load div {
  position: absolute;
  right: 0;
  bottom: 4px;
  width: 20px;
  height: 36px;
  margin-left: -4px;
  opacity: 0;
  color: var(--preloader-text);
  font-family: Helvetica, Arial, sans-serif;
  transform: rotate(180deg) translateZ(0);
  backface-visibility: hidden;
  animation: loadermessegemove 2s linear infinite;
  will-change: right, transform, opacity;
}

#load div:nth-child(2) { animation-delay: .2s; }
#load div:nth-child(3) { animation-delay: .4s; }
#load div:nth-child(4) { animation-delay: .6s; }
#load div:nth-child(5) { animation-delay: .8s; }
#load div:nth-child(6) { animation-delay: 1s; }
#load div:nth-child(7) { animation-delay: 1.2s; }

@keyframes loadermessegemove {
  0% {
    right: 0;
    opacity: 0;
    transform: rotate(180deg);
  }
  35% {
    right: 41%;
    opacity: 1;
    transform: rotate(0);
  }
  65% {
    right: 59%;
    opacity: 1;
    transform: rotate(0);
  }
  100% {
    right: 100%;
    opacity: 0;
    transform: rotate(-180deg);
  }
}

/* =========================================================
   محتوای نمایشی زیر پریلودر
   ========================================================= */
.demo-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 24px;
  color: #eff8ff;
  font-family: Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at 22% 20%, rgba(70, 157, 203, .35), transparent 34%),
    radial-gradient(circle at 78% 70%, rgba(25, 102, 145, .28), transparent 38%),
    linear-gradient(135deg, #071b27, #0b3447 58%, #102433);
}

.demo-card {
  width: min(900px, 100%);
  padding: clamp(30px, 6vw, 76px);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 30px;
  background: rgba(7, 27, 39, .55);
  box-shadow: 0 35px 100px rgba(0, 0, 0, .35);
  backdrop-filter: blur(18px);
}

.demo-card small {
  display: block;
  margin-bottom: 18px;
  color: #8fc9e1;
  letter-spacing: .18em;
  direction: ltr;
}

.demo-card h1 {
  margin: 0 0 22px;
  font-size: clamp(38px, 7vw, 90px);
  line-height: 1;
}

.demo-card p {
  max-width: 62ch;
  margin: 0;
  color: rgba(239, 248, 255, .75);
  font-size: clamp(16px, 2vw, 21px);
  line-height: 2;
}

.replay-button {
  margin-top: 28px;
  padding: 12px 20px;
  color: #eff8ff;
  font: inherit;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.replay-button:hover {
  background: rgba(255, 255, 255, .14);
}

@media (max-width: 560px) {
  #Subpreloader {
    width: min(380px, calc(100vw - 24px));
    height: 390px;
    scale: .84;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dot,
  .dust-particle,
  .metal-spark,
  .rim-glint,
  #load div {
    animation: none !important;
  }
}
