/* =====================================================
   JC INTRO LOADER — کپی دقیق از فایل مرجع
   فقط class names با prefix jcl- برای جلوگیری از تداخل
   ===================================================== */

#jcLoader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity .6s ease, visibility .6s ease;
}

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

/* ── wrapper ── */
.jc-loader-wrap {
  --c: #f7971d;
  position: relative;
  width: 14em;
  height: 10em;
  font-size: 16px;
  /* مهم: box-sizing مرجع border-box هست */
  box-sizing: border-box;
}

.jc-loader-wrap * {
  box-sizing: border-box;
}


/* =========================
   REC
========================= */

.jcl-ph1 {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  animation: jcl-ph1 3.3s ease 1 forwards;
  z-index: 50;
  overflow: visible;
}

.jcl-record {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2em;
  height: 2em;
  background: var(--c);
  border-radius: 999px;
  animation: jcl-blink 1s step-end 1;
  transform: translate(-3.5em, -50%);
  z-index: 51;
}

.jcl-record-text {
  position: absolute;
  color: var(--c);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 2.2em;
  font-weight: 700;
  left: 50%;
  top: 50%;
  transform: translate(-0.5em, -50%);
  width: 2em;
  height: auto;
  line-height: 1;
  z-index: 52;
  white-space: nowrap;
}

@keyframes jcl-blink {
  50% { opacity: 0; }
  75% { opacity: 1; }
}

@keyframes jcl-ph1 {
  0%          { opacity: 1; translate: 0 0; }
  25.5%       { translate: 0 0; }
  30%         { opacity: 1; translate: 0 3em; }
  30.1%, 100% { opacity: 0; translate: 0 3em; }
}


/* =========================
   LAPTOP
========================= */

.jcl-ph2 {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -4em);
  width: 11em;
  height: 7em;
  perspective: 150px;
  perspective-origin: 50% 0%;
  transform-style: preserve-3d;
  animation: jcl-ph2 3.3s ease-in-out 1 forwards;
  z-index: 5;
}

@keyframes jcl-ph2 {
  0%, 15%     { translate: 0 4em; }
  0%, 29%     { opacity: 0; }
  30%         { opacity: 1; }
  40%         { translate: 0 0; }
  50%         { translate: 0 0.5em; opacity: 1; }
  50.1%, 100% { opacity: 0; }
}

.jcl-laptop-b {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0.5em;
  background: var(--c);
  border-bottom-left-radius: 2em;
  border-bottom-right-radius: 2em;
  animation: jcl-ph2b 3.3s ease 1 forwards;
}

.jcl-laptop-t {
  margin: 0 1.25em;
  color: var(--c);
  transform-origin: 50% 100%;
  animation: jcl-ph2t 3.3s ease 1 forwards;
}

@keyframes jcl-ph2t {
  0%, 29%  { transform: rotateX(-10deg); }
  0%, 41.9%{ stroke-dasharray: unset; }
  42%      { transform: rotateX(4deg); stroke-dasharray: 0 0 100; }
  50%      { transform: rotateX(-20deg); stroke-dasharray: 0 50 0 100; }
}

@keyframes jcl-ph2b {
  42% { scale: 1 1; }
  50% { scale: 0 1; }
}


/* =========================
   FINAL ICON
   دقیقاً مثل فایل مرجع — بدون box-sizing تغییر
========================= */

.jcl-icon {
  position: absolute;
  width: 4em;
  height: 4em;
  background: var(--c);
  border-radius: 999px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transform-origin: center;
  animation: jcl-icon 3.3s ease-in-out 1 forwards;
  isolation: isolate;
  border-color: var(--c);
  border-style: solid;
  z-index: 10;
}

@keyframes jcl-icon {
  0%, 15%  { translate: 0 4.5em; width: 0; height: 0; }
  0%, 29%  { opacity: 0; }
  30%      { opacity: 1; }
  40%      { translate: 0 -0.75em; width: 4em; height: 4em; }
  50%      { translate: 0 0; opacity: 1; background: var(--c); }
  50.1%    { border-width: 2em; background: black; }
  65%      { width: 4em; height: 4em; transform: translate(-50%, -50%); border-width: 4px; opacity: 1; }
  80%      { width: 4em; height: 4em; translate: 0 0; transform: translate(-50%, -50%); border-width: 4px; background: black; opacity: 1; }
  85%      { opacity: 0.5; }
  88%      { opacity: 0.2; }
  91%      { opacity: 0; }
  100%     { width: 4em; height: 4em; translate: 0 0; transform: translate(-50%, -50%); opacity: 0; }
}

.jcl-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border: 0.8em solid black;
  box-sizing: border-box;
  border-left-color: transparent !important;
  border-bottom-color: transparent !important;
  transform: translate(-50%, 2.5em) rotate(-45deg);
  transform-origin: center;
  animation: jcl-iconb 3.3s ease-in-out 1 forwards;
  z-index: 1;
}

@keyframes jcl-iconb {
  20%       { transform: translate(-50%, 2.5em) rotate(-45deg); }
  50%       { transform: translate(-50%, -25%) rotate(-45deg); border-color: black; }
  65%, 100% { transform: translateY(0) scale(1) scaleX(1.5) translate(-60%, -50%) rotate(45deg); border-color: var(--c); }
}

.jcl-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: black;
  width: 1em;
  height: 2em;
  box-sizing: border-box;
  animation: jcl-icona 3.3s ease-in-out 1 forwards;
}

@keyframes jcl-icona {
  20%       { transform: translate(-50%, 2.5em); }
  50%       { transform: translate(-50%, 0.4em); }
  65%, 100% { transform: translate(-50%, 2.5em); }
}


/* =========================
   BRAND TEXT
========================= */

.jcl-brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  color: white;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 2em;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  z-index: 30;
  pointer-events: none;
  direction: ltr;
  unicode-bidi: isolate;
}

.jcl-brand .jcl-ui { padding: 0 4px; }

.jcl-brand .jcl-hub {
  background: #f7971d;
  color: black;
  padding: 0 4px;
  border-radius: 6px;
}

#jcl-jagh,
#jcl-city {
  display: inline-flex;
}

.jcl-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.35em) scale(0.92);
  filter: blur(6px);
  animation: jcl-charIn 420ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes jcl-charIn {
  0%   { opacity: 0; transform: translateY(0.35em) scale(0.92); filter: blur(6px); }
  55%  { opacity: 1; transform: translateY(-0.04em) scale(1.015); filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
