@font-face {
  font-family: "Vazirmatn";
  src: local("Vazirmatn");
  font-display: swap;
}

:root {
  --deep-navy: #020b14;
  --navy: #061e36;
  --navy-2: #082844;

  --metal-light: #f2f5f7;
  --metal-soft: #d8dde1;
  --metal-mid: #8f9aa3;
  --metal-dark: #3b444c;

  --red: #d50012;
  --red-soft: #ff2636;

  --white: #f7f9fa;
  --black: #000000;

  --safe-x: clamp(22px, 4vw, 90px);
  --logo-width: clamp(280px, 54vw, 980px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  background: var(--deep-navy);
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  background: var(--deep-navy);
  color: var(--white);
  font-family:
    "Vazirmatn",
    "IRANSansX",
    "Dana",
    "Segoe UI",
    Tahoma,
    Arial,
    sans-serif;
  overflow-x: hidden;
}

body::selection {
  background: rgba(213, 0, 18, 0.85);
  color: #fff;
}

.alucas-index {
  position: relative;
  width: 100%;
  min-height: 100svh;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.12), transparent 0 15%, transparent 38%),
    radial-gradient(circle at 50% 45%, rgba(18, 88, 135, 0.25), transparent 0 22%, transparent 50%),
    linear-gradient(145deg, #01070d 0%, #03111f 34%, #061e36 58%, #020b14 100%);
}

.alucas-index::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -4;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size:
    clamp(58px, 5vw, 120px) clamp(58px, 5vw, 120px),
    clamp(58px, 5vw, 120px) clamp(58px, 5vw, 120px);
  mask-image: radial-gradient(circle at center, black 0%, black 38%, transparent 78%);
  opacity: 0.42;
}

.alucas-index::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background:
    radial-gradient(circle at center, transparent 0 48%, rgba(0,0,0,0.38) 100%),
    linear-gradient(180deg, rgba(255,255,255,0.035), transparent 26%, transparent 74%, rgba(0,0,0,0.3));
}

.particle-canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.62;
  pointer-events: none;
}

.ambient {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(30px);
  transform: translate3d(0,0,0);
  z-index: -3;
}

.ambient-one {
  width: clamp(260px, 32vw, 760px);
  height: clamp(260px, 32vw, 760px);
  top: 9%;
  left: 8%;
  background: radial-gradient(circle, rgba(22, 104, 158, 0.22), transparent 68%);
  animation: ambientDriftOne 18s ease-in-out infinite alternate;
}

.ambient-two {
  width: clamp(220px, 28vw, 620px);
  height: clamp(220px, 28vw, 620px);
  right: 6%;
  bottom: 10%;
  background: radial-gradient(circle, rgba(213, 0, 18, 0.11), transparent 70%);
  animation: ambientDriftTwo 22s ease-in-out infinite alternate;
}

.ambient-three {
  width: clamp(240px, 35vw, 840px);
  height: clamp(240px, 35vw, 840px);
  left: 50%;
  top: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.105), transparent 62%);
  transform: translate(-50%, -50%);
  animation: ambientPulse 9s ease-in-out infinite;
}

.hero {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100svh;
  padding: clamp(34px, 5vh, 90px) var(--safe-x);
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 3;
  display: grid;
  justify-items: center;
  align-content: center;
  width: min(100%, 1440px);
  min-height: 74svh;
  transform-style: preserve-3d;
  perspective: 1400px;
}

.profile-field {
  position: absolute;
  inset: -8%;
  z-index: 0;
  opacity: 0.75;
  pointer-events: none;
  transform: translate3d(0,0,0);
}

.profile-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  vector-effect: non-scaling-stroke;
}

.profile-svg-a path {
  stroke: rgba(216, 221, 225, 0.12);
  stroke-width: 1.15;
  stroke-dasharray: 8 18;
  animation: lineFlow 16s linear infinite;
}

.profile-svg-b {
  opacity: 0.28;
  transform: rotate(-7deg) scale(1.18);
}

.profile-svg-b path {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

/* =========================
   PREMIUM WHITE LOGO STAGE
   (لوگو حتما داخل کادر سفید است)
   ========================= */

.logo-stage {
  position: relative;
  display: flex;         /* تغییر به flex برای تراز مقتدرانه در مرکز */
  justify-content: center;
  align-items: center;

  width: var(--logo-width);
  max-width: calc(100vw - var(--safe-x) * 2);
  
  /* نسبت ابعاد استاندارد کادر سفید در دسکتاپ */
  aspect-ratio: 3.25 / 1;

  /* خودِ کادر سفید */
  background:
    linear-gradient(145deg, #ffffff 0%, #f6f8fa 35%, #e9eef2 62%, #ffffff 100%);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 22px;

  /* مهم: جلوگیری از خروج هرگونه المان یا سایه از کادر سفید */
  overflow: hidden;

  box-shadow:
    0 30px 90px rgba(0,0,0,0.35),
    0 6px 16px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.85);

  transform-style: preserve-3d;
  will-change: transform, opacity;
  animation: panelBreath 7s ease-in-out infinite;
}

/* هاله بیرونی */
.logo-stage::before {
  content: "";
  position: absolute;
  inset: -42% -14%;
  z-index: -2;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.55), transparent 35%),
    radial-gradient(circle at 40% 55%, rgba(30,120,180,0.28), transparent 62%),
    radial-gradient(circle at 60% 45%, rgba(213,0,18,0.14), transparent 70%);
  filter: blur(44px);
  opacity: .55;
  animation: haloPulse 6s ease-in-out infinite;
}

/* خط دور لوکس */
.logo-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  pointer-events: none;
  background:
    linear-gradient(
      120deg,
      rgba(255,255,255,.75),
      transparent 35%,
      rgba(213,0,18,.18),
      transparent 75%,
      rgba(30,120,180,.22)
    );
  opacity: .22;
  mix-blend-mode: overlay;
}

.logo-glow {
  position: absolute;
  inset: -25%;
  z-index: 0;
  background:
    conic-gradient(
      from 180deg,
      transparent,
      rgba(0,0,0,0.06),
      transparent,
      rgba(213,0,18,0.12),
      transparent,
      rgba(30,120,180,0.14),
      transparent
    );
  filter: blur(26px);
  opacity: 0.55;
  animation: subtleRotate 20s linear infinite;
}

/* محفظه لوگو - محدودسازی ۱۰۰٪ بر اساس ارتفاع و عرض والد */
.logo-picture {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;

  /* حل مشکل سرریز: ابعاد وابسته به کادر والد است و هرگز از کادر سفید بزرگتر نخواهد شد */
  width: 100%;
  height: 100%;
  max-width: 45%;    /* در حالت دسکتاپ حداکثر ۴۵ درصد عرض کادر را می‌گیرد */
  max-height: 80%;   /* حداکثر ۸۰ درصد ارتفاع کادر سفید را می‌گیرد تا از بالا و پایین فاصله ایمن داشته باشد */

  /* افکت سایه هوشمند */
  filter:
    drop-shadow(0 14px 24px rgba(0,0,0,0.22))
    drop-shadow(0 0 18px rgba(255,255,255,0.25));
  transform: translateZ(40px);
}

/* خودِ تصویر لوگو */
.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain; /* مهم‌ترین ویژگی: حفظ تناسب مربع تصویر بدون تغییر شکل یا برش */
  user-select: none;
  -webkit-user-drag: none;
  image-rendering: auto;
}

/* بهینه‌سازی کادر سفید برای دستگاه‌های موبایل */
@media (max-width: 768px) {
  .logo-stage {
    /* تغییر هوشمند نسبت ابعاد در موبایل برای جلوگیری از ریز شدن بیش از حد لوگو مربعی شما */
    aspect-ratio: 2.2 / 1; 
    border-radius: 18px;
  }
  .logo-picture {
    max-width: 75%;   /* در موبایل اجازه می‌دهیم فضای بیشتری از عرض کادر سفید را اشغال کند */
    max-height: 85%;  /* مهار کامل ارتفاع جهت عدم خروج از بالا و پایین */
  }
}

/* Shine روی لوگو (اگر logo-mask.png داشته باشی روی خود شکل لوگو می‌نشیند) */
.logo-mask-shine {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(
      105deg,
      transparent 0%,
      transparent 34%,
      rgba(255,255,255,0.08) 40%,
      rgba(255,255,255,0.92) 48%,
      rgba(255,255,255,0.18) 55%,
      transparent 64%,
      transparent 100%
    );
  background-size: 260% 100%;
  background-position: 150% 50%;

  -webkit-mask-image: url("assets/logo-mask.png");
  mask-image: url("assets/logo-mask.png");

  -webkit-mask-size: contain;
  mask-size: contain;

  -webkit-mask-position: center;
  mask-position: center;

  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;

  mix-blend-mode: screen;
  opacity: 0;
}


/* اسکن لاین داخل کادر سفید */
.scan-line {
  position: absolute;
  left: -12%;
  right: -12%;
  top: 50%;
  z-index: 5;
  height: 1px;
  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(0,0,0,0.10),
      rgba(255,255,255,0.75),
      rgba(213,0,18,0.35),
      rgba(0,0,0,0.12),
      transparent
    );
  box-shadow:
    0 0 18px rgba(255,255,255,0.28),
    0 0 36px rgba(213,0,18,0.12);
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0;
}

/* پالس قرمز داخل کادر (خیلی ملایم) */
.red-pulse {
  position: absolute;
  right: 6%;
  top: 12%;
  width: clamp(46px, 8vw, 160px);
  height: clamp(46px, 8vw, 160px);
  z-index: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(213,0,18,0.22), transparent 68%);
  filter: blur(20px);
  opacity: 0;
  mix-blend-mode: multiply;
}

.brand-copy {
  position: relative;
  z-index: 4;
  margin-top: clamp(28px, 4.4vh, 58px);
  display: grid;
  justify-items: center;
  gap: clamp(8px, 1.1vh, 16px);
  text-align: center;
  transform: translateZ(38px);
}

.persian-title {
  margin: 0;
  color: rgba(247, 249, 250, 0.96);
  font-size: clamp(1.05rem, 1.55vw, 2.2rem);
  font-weight: 500;
  line-height: 1.85;
  letter-spacing: -0.025em;
  text-wrap: balance;
  text-shadow:
    0 1px 0 rgba(255,255,255,0.08),
    0 18px 42px rgba(0,0,0,0.42);
}

.english-title {
  margin: 0;
  color: rgba(216, 221, 225, 0.72);
  font-family: "Montserrat", "Inter", "Segoe UI", Arial, sans-serif;
  font-size: clamp(0.62rem, 0.78vw, 1.05rem);
  font-weight: 600;
  letter-spacing: clamp(0.18em, 0.52vw, 0.42em);
  line-height: 1.4;
  text-transform: uppercase;
}

.english-title::before,
.english-title::after {
  content: "";
  display: inline-block;
  width: clamp(22px, 4vw, 82px);
  height: 1px;
  margin: 0 clamp(10px, 1.4vw, 22px);
  vertical-align: middle;
  background: linear-gradient(90deg, transparent, rgba(216,221,225,0.56), transparent);
}

.bottom-signature {
  position: absolute;
  z-index: 3;
  left: var(--safe-x);
  right: var(--safe-x);
  bottom: clamp(18px, 3vh, 42px);
  display: flex;
  justify-content: center;
  pointer-events: none;
  opacity: 0.58;
}

.bottom-signature span {
  color: rgba(216, 221, 225, 0.5);
  font-family: "Montserrat", "Inter", "Segoe UI", Arial, sans-serif;
  font-size: clamp(0.55rem, 0.64vw, 0.82rem);
  font-weight: 500;
  letter-spacing: clamp(0.2em, 0.42vw, 0.38em);
  text-transform: uppercase;
}

/* Animations */
@keyframes subtleRotate {
  from { transform: rotate(0deg) scale(1); }
  to { transform: rotate(360deg) scale(1); }
}

@keyframes lineFlow {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -260; }
}

@keyframes ambientDriftOne {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(4%, 3%, 0) scale(1.08); }
}

@keyframes ambientDriftTwo {
  from { transform: translate3d(2%, 2%, 0) scale(1); }
  to { transform: translate3d(-4%, -3%, 0) scale(1.1); }
}

@keyframes ambientPulse {
  0%, 100% {
    opacity: 0.48;
    transform: translate(-50%, -50%) scale(0.96);
  }
  50% {
    opacity: 0.82;
    transform: translate(-50%, -50%) scale(1.06);
  }
}

/* NEW: premium panel breathing */
@keyframes panelBreath {
  0%, 100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-6px) scale(1.01);
  }
}

/* NEW: halo pulse */
@keyframes haloPulse {
  0%, 100% { opacity: .55; transform: scale(.96); }
  50% { opacity: .82; transform: scale(1.05); }
}

/* Responsive */
@media (min-width: 1800px) {
  :root { --logo-width: min(52vw, 1180px); }
  .hero-inner { width: min(82vw, 1800px); }
}

@media (min-width: 2600px) {
  :root { --logo-width: min(48vw, 1520px); }
  .persian-title { font-size: clamp(1.8rem, 1.25vw, 3rem); }
  .english-title { font-size: clamp(0.9rem, 0.55vw, 1.35rem); }
}

@media (max-width: 900px) {
  :root { --logo-width: clamp(270px, 82vw, 720px); }
  .hero-inner { min-height: 78svh; }
  .brand-copy { margin-top: clamp(24px, 4vh, 44px); }
  .english-title::before,
  .english-title::after {
    width: clamp(16px, 6vw, 42px);
    margin: 0 clamp(6px, 1.5vw, 12px);
  }
}

@media (max-width: 520px) {
  :root {
    --safe-x: 20px;
    --logo-width: min(88vw, 420px);
  }

  .hero {
    padding-top: 42px;
    padding-bottom: 52px;
  }

  .logo-stage {
    aspect-ratio: 3.05 / 1;
    border-radius: 18px;
  }

  .persian-title {
    max-width: 92vw;
    font-size: clamp(0.94rem, 4vw, 1.1rem);
    line-height: 1.9;
  }

  .english-title {
    max-width: 92vw;
    font-size: 0.58rem;
    letter-spacing: 0.18em;
  }

  .english-title::before,
  .english-title::after {
    display: none;
  }

  .bottom-signature span {
    font-size: 0.48rem;
    letter-spacing: 0.18em;
  }
}

@media (max-width: 360px) {
  :root {
    --safe-x: 16px;
    --logo-width: min(90vw, 320px);
  }

  .persian-title { font-size: 0.88rem; }
  .english-title { font-size: 0.52rem; }
}

@media (orientation: landscape) and (max-height: 560px) {
  .hero { padding-top: 18px; padding-bottom: 18px; }
  .hero-inner { min-height: 86svh; }
  .brand-copy { margin-top: 18px; }
  .bottom-signature { display: none; }
  :root { --logo-width: min(50vw, 560px); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  .particle-canvas { opacity: 0.2; }
}
