/* SHADOW X AI — cinematic full-page entry loader */

:root {
  --e-bg: #03050a;
  --e-ink: #f4f7fb;
  --e-muted: rgba(180, 198, 220, 0.65);
  --e-cyan: #45d0ff;
  --e-teal: #36d4ae;
  --e-amber: #e4b44a;
  --e-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body, .entry-body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  margin: 0;
  background: var(--e-bg);
  color: var(--e-ink);
  font-family: Vazirmatn, Inter, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

html[lang="en"] .entry-body {
  font-family: Inter, Vazirmatn, "Segoe UI", system-ui, sans-serif;
}

.entry {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(16px, var(--safe-t))
    max(16px, var(--safe-r))
    max(16px, var(--safe-b))
    max(16px, var(--safe-l));
  opacity: 0;
  transition: opacity 0.55s var(--e-ease), filter 0.55s ease, transform 0.55s var(--e-ease);
  z-index: 9999;
}

.entry.is-ready { opacity: 1; }

.entry.is-hiding {
  opacity: 0;
  filter: blur(12px) brightness(1.15);
  transform: scale(1.04);
  pointer-events: none;
}

/* ═══════════ Cinematic background ═══════════ */
.entry__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, #0a1628 0%, transparent 55%),
    radial-gradient(ellipse 80% 60% at 80% 100%, #0c1810 0%, transparent 45%),
    var(--e-bg);
}

.entry__aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  will-change: transform, opacity;
}

.entry__aurora--a {
  width: min(78vw, 620px);
  height: min(78vw, 620px);
  top: 42%;
  left: 50%;
  translate: -50% -55%;
  background: radial-gradient(circle, rgba(69, 208, 255, 0.42) 0%, rgba(69, 208, 255, 0.08) 42%, transparent 70%);
  animation: eAuroraA 14s ease-in-out infinite alternate;
}

.entry__aurora--b {
  width: min(55vw, 440px);
  height: min(55vw, 440px);
  bottom: -12%;
  inset-inline-end: -8%;
  background: radial-gradient(circle, rgba(228, 180, 74, 0.32) 0%, transparent 68%);
  animation: eAuroraB 18s ease-in-out infinite alternate;
}

.entry__aurora--c {
  width: min(48vw, 380px);
  height: min(48vw, 380px);
  top: 8%;
  inset-inline-start: -10%;
  background: radial-gradient(circle, rgba(54, 212, 174, 0.28) 0%, transparent 68%);
  animation: eAuroraC 16s ease-in-out infinite alternate;
}

@keyframes eAuroraA {
  0%   { transform: scale(1) translate(0, 0); opacity: 0.7; }
  50%  { transform: scale(1.12) translate(2%, -3%); opacity: 1; }
  100% { transform: scale(1.05) translate(-2%, 2%); opacity: 0.8; }
}

@keyframes eAuroraB {
  0%   { transform: translate(0, 0) scale(1); opacity: 0.55; }
  100% { transform: translate(-6%, -8%) scale(1.18); opacity: 0.85; }
}

@keyframes eAuroraC {
  0%   { transform: translate(0, 0) scale(1); opacity: 0.5; }
  100% { transform: translate(8%, 6%) scale(1.15); opacity: 0.8; }
}

.entry__horizon {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: min(90vw, 900px);
  height: 2px;
  translate: -50% 0;
  background: linear-gradient(90deg, transparent, rgba(69, 208, 255, 0.55), rgba(228, 180, 74, 0.4), transparent);
  box-shadow:
    0 0 24px rgba(69, 208, 255, 0.45),
    0 0 60px rgba(69, 208, 255, 0.2);
  animation: eHorizon 4s ease-in-out infinite alternate;
  opacity: 0.7;
}

.entry__horizon::before {
  content: "";
  position: absolute;
  inset: -40px -10% auto;
  height: 80px;
  background: radial-gradient(ellipse at center, rgba(69, 208, 255, 0.18), transparent 70%);
}

@keyframes eHorizon {
  from { opacity: 0.4; filter: blur(0.5px); }
  to { opacity: 0.85; filter: blur(0); }
}

.entry__beam {
  position: absolute;
  top: -20%;
  width: 2px;
  height: 140%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(69, 208, 255, 0.0) 20%,
    rgba(69, 208, 255, 0.35) 50%,
    rgba(255, 255, 255, 0.15) 52%,
    rgba(69, 208, 255, 0.0) 80%,
    transparent 100%
  );
  filter: blur(1px);
  opacity: 0.35;
  animation: eBeam 9s linear infinite;
}

.entry__beam--1 {
  left: 22%;
  animation-duration: 11s;
}

.entry__beam--2 {
  right: 28%;
  width: 1.5px;
  animation-duration: 14s;
  animation-delay: -4s;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(228, 180, 74, 0.25) 45%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent
  );
}

@keyframes eBeam {
  0%   { transform: translateY(-8%) rotate(8deg); opacity: 0.15; }
  40%  { opacity: 0.4; }
  100% { transform: translateY(8%) rotate(8deg); opacity: 0.15; }
}

.entry__mesh {
  position: absolute;
  inset: -10%;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 65% 55% at 50% 45%, #000 5%, transparent 72%);
  animation: eMeshDrift 28s linear infinite;
}

@keyframes eMeshDrift {
  from { transform: translateY(0); }
  to { transform: translateY(48px); }
}

.entry__scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  opacity: 0.5;
  pointer-events: none;
}

.entry__scan::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 28%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(69, 208, 255, 0.06),
    transparent
  );
  animation: eScanSweep 5.5s ease-in-out infinite;
}

@keyframes eScanSweep {
  0%   { top: -30%; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* Floating dust particles */
.entry__dust {
  position: absolute;
  inset: 0;
}

.entry__dust i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 8px rgba(69, 208, 255, 0.6);
  opacity: 0;
  animation: eDust 12s linear infinite;
}

.entry__dust i:nth-child(1)  { left: 8%;  top: 70%; animation-delay: 0s;    animation-duration: 11s; }
.entry__dust i:nth-child(2)  { left: 18%; top: 85%; animation-delay: -2s;   animation-duration: 14s; width: 2px; height: 2px; }
.entry__dust i:nth-child(3)  { left: 28%; top: 60%; animation-delay: -4s;   animation-duration: 10s; }
.entry__dust i:nth-child(4)  { left: 38%; top: 90%; animation-delay: -1s;   animation-duration: 13s; }
.entry__dust i:nth-child(5)  { left: 48%; top: 75%; animation-delay: -6s;   animation-duration: 15s; width: 4px; height: 4px; }
.entry__dust i:nth-child(6)  { left: 58%; top: 88%; animation-delay: -3s;   animation-duration: 12s; }
.entry__dust i:nth-child(7)  { left: 68%; top: 65%; animation-delay: -7s;   animation-duration: 11s; }
.entry__dust i:nth-child(8)  { left: 78%; top: 80%; animation-delay: -5s;   animation-duration: 16s; width: 2px; height: 2px; }
.entry__dust i:nth-child(9)  { left: 88%; top: 70%; animation-delay: -8s;   animation-duration: 13s; }
.entry__dust i:nth-child(10) { left: 12%; top: 55%; animation-delay: -9s;   animation-duration: 14s; }
.entry__dust i:nth-child(11) { left: 22%; top: 40%; animation-delay: -2.5s; animation-duration: 17s; width: 2px; height: 2px; }
.entry__dust i:nth-child(12) { left: 72%; top: 45%; animation-delay: -4.5s; animation-duration: 12s; }
.entry__dust i:nth-child(13) { left: 42%; top: 35%; animation-delay: -1.5s; animation-duration: 15s; }
.entry__dust i:nth-child(14) { left: 85%; top: 50%; animation-delay: -6.5s; animation-duration: 11s; }
.entry__dust i:nth-child(15) { left: 55%; top: 28%; animation-delay: -3.5s; animation-duration: 18s; width: 2px; height: 2px; }
.entry__dust i:nth-child(16) { left: 33%; top: 22%; animation-delay: -8.5s; animation-duration: 13s; }
.entry__dust i:nth-child(17) { left: 63%; top: 18%; animation-delay: -0.8s; animation-duration: 16s; }
.entry__dust i:nth-child(18) { left: 93%; top: 38%; animation-delay: -5.2s; animation-duration: 14s; }

@keyframes eDust {
  0%   { transform: translateY(0) scale(0.6); opacity: 0; }
  12%  { opacity: 0.85; }
  70%  { opacity: 0.5; }
  100% { transform: translateY(-70vh) scale(1); opacity: 0; }
}

.entry__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 48%, transparent 20%, rgba(3, 5, 10, 0.55) 75%, rgba(3, 5, 10, 0.92) 100%);
}

/* Lang */
.entry__lang {
  position: absolute;
  top: max(14px, var(--safe-t));
  inset-inline-end: max(14px, var(--safe-r));
  z-index: 5;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
  animation: eFadeDown 0.7s var(--e-ease) 0.2s both;
}

@keyframes eFadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}

.entry__lang-btn {
  min-width: 42px;
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  padding: 6px 12px;
  background: transparent;
  color: var(--e-muted);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.entry__lang-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.entry__lang-btn.is-active {
  color: #061018;
  background: linear-gradient(135deg, var(--e-cyan), var(--e-teal));
  box-shadow: 0 6px 18px rgba(69, 208, 255, 0.3);
}

/* Center */
.entry__center {
  position: relative;
  z-index: 2;
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0 auto;
}

.entry__boot,
.entry__load {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.entry__load[hidden],
.entry__boot[hidden] { display: none !important; }

.entry.is-loading .entry__load {
  animation: eIn 0.65s var(--e-ease) both;
}

@keyframes eIn {
  from { opacity: 0; transform: translateY(20px) scale(0.94); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* Logo + orbits */
.entry__logo-wrap {
  position: relative;
  width: clamp(128px, 34vw, 180px);
  height: clamp(128px, 34vw, 180px);
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
}

.entry__logo-wrap--pulse {
  animation: eBeat 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.entry__orbit {
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  border: 1px dashed rgba(69, 208, 255, 0.35);
  animation: eOrbitSpin 10s linear infinite;
}

.entry__orbit--2 {
  inset: -16%;
  border-style: solid;
  border-color: rgba(228, 180, 74, 0.22);
  border-top-color: transparent;
  border-left-color: transparent;
  animation-duration: 7s;
  animation-direction: reverse;
}

.entry__orbit::before,
.entry__orbit--2::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  top: 0;
  left: 50%;
  translate: -50% -50%;
  background: var(--e-cyan);
  box-shadow: 0 0 12px rgba(69, 208, 255, 0.9);
}

.entry__orbit--2::after {
  background: var(--e-amber);
  box-shadow: 0 0 12px rgba(228, 180, 74, 0.9);
  top: auto;
  bottom: 0;
  translate: -50% 50%;
}

@keyframes eOrbitSpin {
  to { transform: rotate(360deg); }
}

.entry__logo,
.entry__logo-fb {
  width: 72%;
  height: 72%;
  object-fit: contain;
  border-radius: 24px;
  display: block;
  position: relative;
  z-index: 2;
  background: rgba(8, 14, 24, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(69, 208, 255, 0.08),
    0 0 40px rgba(69, 208, 255, 0.12);
}

.entry__logo-fb {
  display: grid;
  place-items: center;
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  font-weight: 900;
  color: #fff;
  background: linear-gradient(145deg, #0d2030, #134048);
}

.entry__logo-fb[hidden] { display: none !important; }

.entry__ripple {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(69, 208, 255, 0.5);
  opacity: 0;
  animation: eRipple 1.2s ease-out infinite;
}

.entry__ripple--2 {
  animation-delay: 0.2s;
  border-color: rgba(228, 180, 74, 0.45);
}

.entry__ripple--3 {
  animation-delay: 0.4s;
  border-color: rgba(54, 212, 174, 0.4);
}

@keyframes eBeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.08); }
  28% { transform: scale(1); }
  42% { transform: scale(1.12); }
  58% { transform: scale(1); }
}

@keyframes eRipple {
  0% { opacity: 0.7; transform: scale(0.72); }
  100% { opacity: 0; transform: scale(1.45); }
}

.entry__brand {
  font-size: clamp(0.95rem, 3.5vw, 1.25rem);
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(244, 247, 251, 0.92);
  animation: eBrandGlow 1.2s ease-in-out infinite;
  text-shadow: 0 0 24px rgba(69, 208, 255, 0.25);
}

@keyframes eBrandGlow {
  0%, 100% { opacity: 0.65; letter-spacing: 0.2em; }
  40% { opacity: 1; letter-spacing: 0.24em; }
}

/* Ring progress */
.entry__logo-wrap--ring { margin-bottom: 24px; }

.entry__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  z-index: 1;
  filter: drop-shadow(0 0 8px rgba(69, 208, 255, 0.35));
}

.entry__ring-bg,
.entry__ring-fg {
  fill: none;
  stroke-width: 3.5;
}

.entry__ring-bg { stroke: rgba(255, 255, 255, 0.08); }

.entry__ring-fg {
  stroke: var(--e-cyan);
  stroke-linecap: round;
}

.entry.is-done .entry__ring-fg { stroke: var(--e-teal); }

.entry__logo-wrap--ring .entry__logo,
.entry__logo-wrap--ring .entry__logo-fb {
  width: 64%;
  height: 64%;
}

.entry__eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--e-cyan);
  margin-bottom: 8px;
  animation: eRiseSoft 0.5s var(--e-ease) 0.05s both;
}

.entry__title {
  font-size: clamp(1.65rem, 6vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 8px;
  background: linear-gradient(105deg, #fff 8%, #c6efff 45%, #ffe2a0 92%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: eTitleShine 4s ease-in-out infinite, eRiseSoft 0.55s var(--e-ease) 0.1s both;
}

@keyframes eTitleShine {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

@keyframes eRiseSoft {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.entry__msg {
  color: rgba(220, 230, 244, 0.82);
  font-weight: 600;
  font-size: clamp(0.9rem, 3.2vw, 1rem);
  margin-bottom: 18px;
  max-width: 34ch;
  animation: eRiseSoft 0.55s var(--e-ease) 0.16s both;
}

.entry__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
  width: 100%;
  animation: eRiseSoft 0.55s var(--e-ease) 0.22s both;
}

.entry__meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  font-size: 12px;
  max-width: 100%;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.entry__meta span:hover {
  border-color: rgba(69, 208, 255, 0.25);
  background: rgba(69, 208, 255, 0.06);
}

.entry__meta b {
  color: var(--e-muted);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.entry__meta strong {
  color: #eef3f9;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.entry__bar-wrap {
  width: min(360px, 100%);
  animation: eRiseSoft 0.55s var(--e-ease) 0.28s both;
}

.entry__bar-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--e-muted);
}

.entry__pct {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, var(--e-cyan), var(--e-teal), var(--e-amber));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: eTitleShine 3s linear infinite;
}

.entry__bar {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}

.entry__bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8a4a, var(--e-amber), var(--e-teal), var(--e-cyan), #ff8a4a);
  background-size: 220% 100%;
  animation: eShift 1.8s linear infinite;
  transition: width 0.08s linear;
  position: relative;
  box-shadow: 0 0 16px rgba(69, 208, 255, 0.35);
}

.entry__bar-fill::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: 36px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55));
}

.entry.is-done .entry__bar-fill {
  animation: none;
  background: linear-gradient(90deg, var(--e-teal), var(--e-cyan));
  box-shadow: 0 0 22px rgba(54, 212, 174, 0.45);
}

@keyframes eShift {
  from { background-position: 0% 50%; }
  to { background-position: 220% 50%; }
}

.entry__hint {
  margin-top: 11px;
  font-size: 13px;
  color: var(--e-muted);
  min-height: 1.3em;
  transition: color 0.25s ease;
}

.entry.is-done .entry__hint { color: var(--e-teal); }

@media (max-width: 480px) {
  .entry {
    padding:
      max(12px, var(--safe-t))
      max(12px, var(--safe-r))
      max(12px, var(--safe-b))
      max(12px, var(--safe-l));
  }
  .entry__center { width: 100%; }
  .entry__meta span { flex: 1 1 auto; justify-content: center; }
  .entry__meta strong { max-width: 110px; }
  .entry__dust i:nth-child(n+11) { display: none; }
  .entry__beam { opacity: 0.2; }
}

@media (max-height: 500px) {
  .entry {
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .entry__center { margin-block: auto; padding-block: 8px; }
  .entry__logo-wrap { width: 88px; height: 88px; margin-bottom: 10px; }
  .entry__horizon { bottom: 8%; }
  .entry__title { font-size: 1.35rem; }
  .entry__msg { margin-bottom: 10px; }
  .entry__meta { margin-bottom: 12px; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .entry__aurora,
  .entry__horizon,
  .entry__beam,
  .entry__mesh,
  .entry__scan::after,
  .entry__dust i,
  .entry__logo-wrap--pulse,
  .entry__orbit,
  .entry__ripple,
  .entry__brand,
  .entry__title,
  .entry__pct,
  .entry__bar-fill,
  .entry__lang,
  .entry.is-loading .entry__load,
  .entry__eyebrow,
  .entry__msg,
  .entry__meta,
  .entry__bar-wrap {
    animation: none !important;
  }
  .entry { opacity: 1; }
}
