/* ═══════════════════════════════════════════════════════════
   HERO.CSS — بخش Hero
   HERO.CSS — Hero section
   
   ساختار:
   - برچسب گوشه بالا چپ + شماره گوشه بالا راست
   - اسم غول پشت عکس + عکس بزرگ وسط
   - نوار پایین با خط جداکننده
   
   فهرست / Table of Contents:
   01. Hero           — قاب اصلی
   02. Background     — پس‌زمینه
   03. Content        — محتوا
   04. Top            — نوار بالا
   05. Center         — وسط (اسم + عکس)
   06. Bottom         — نوار پایین
   07. Parallax       — پارالاکس
   08. Responsive     — موبایل
   09. RTL            — فارسی
   10. Reduced Motion — احترام به کاربر
   ═══════════════════════════════════════════════════════════ */


/* ───────────────────────────────────────────────────────────
   01. HERO — قاب اصلی
   ─────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100svh;
  width: 100%;
  overflow: hidden;
  background: #080808;
  display: flex;
  flex-direction: column;
}

[data-theme="light"] .hero {
  background: #e8f0f2;
}


/* ───────────────────────────────────────────────────────────
   02. BACKGROUND — پس‌زمینه
   ─────────────────────────────────────────────────────────── */

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 80%, rgba(90, 143, 160, 0.06) 0%, transparent 60%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at 50% 50%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 20%, transparent 70%);
  animation: heroGridMove 25s linear infinite;
}

[data-theme="light"] .hero-grid {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
}

@keyframes heroGridMove {
  0%   { background-position: 0 0; }
  100% { background-position: 60px 60px; }
}


/* ───────────────────────────────────────────────────────────
   03. CONTENT — محتوا
   ─────────────────────────────────────────────────────────── */

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100svh;
  padding: 100px 4vw 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}


/* ───────────────────────────────────────────────────────────
   04. TOP — نوار بالا
   ─────────────────────────────────────────────────────────── */

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  position: relative;
  z-index: 10;
  flex-shrink: 0;

  opacity: 0;
  transition: opacity 1s cubic-bezier(.2, .8, .2, 1) 0.2s;
}

body.hero-ready .hero-top {
  opacity: 1;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #ffffff;
  padding-left: 55px;
  position: relative;
  line-height: 1.6;
}

.hero-label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 40px;
  height: 1px;
  background: var(--accent);
}

[data-theme="light"] .hero-label {
  color: #0A0A0A;
}

.hero-index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  text-align: right;
  white-space: nowrap;
}

[data-theme="light"] .hero-index {
  color: rgba(10, 14, 20, 0.55);
}


/* ───────────────────────────────────────────────────────────
   05. CENTER — وسط (اسم + عکس)
   ─────────────────────────────────────────────────────────── */

.hero-center {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 20px 0;
  overflow: hidden;
}

/* ═══ اسم پشت عکس ═══ */
.hero-name {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 0;
  width: 100%;
  max-width: 100%;
  font-family: var(--font-display);
  font-size: clamp(80px, 14vw, 220px);
  font-weight: 900;
  letter-spacing: -0.07em;
  line-height: 0.85;
  text-align: center;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.hero-name .line {
  display: block;
  color: rgba(255, 255, 255, 0.16);
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 1.2s cubic-bezier(.2, .8, .2, 1),
    transform 1.2s cubic-bezier(.2, .8, .2, 1);
  white-space: nowrap;
}

body.hero-ready .hero-name .line:nth-child(1) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s;
}

body.hero-ready .hero-name .line:nth-child(2) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.5s;
}

[data-theme="light"] .hero-name .line {
  color: rgba(10, 14, 20, 0.15);
}

/* ═══ عکس ═══ */
.hero-image {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 900px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 1.4s cubic-bezier(.2, .8, .2, 1) 0.2s,
    transform 1.4s cubic-bezier(.2, .8, .2, 1) 0.2s;
}

body.hero-ready .hero-image {
  opacity: 1;
  transform: translateY(0);
}

.hero-image img {
  width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: contain;
  object-position: center bottom;
  display: block;
  mask-image: linear-gradient(to top, transparent 0%, black 15%);
  -webkit-mask-image: linear-gradient(to top, transparent 0%, black 15%);
}


/* ───────────────────────────────────────────────────────────
   06. BOTTOM — نوار پایین
   ─────────────────────────────────────────────────────────── */

.hero-bottom {
  position: relative;
  z-index: 10;
  flex-shrink: 0;

  border-top: 1px solid rgba(255, 255, 255, 0.1);

  padding: 22px 0 28px;
  margin: 0 4vw;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;

  opacity: 0;
  transition: opacity 1s cubic-bezier(.2, .8, .2, 1) 0.9s;
}

[data-theme="light"] .hero-bottom {
  border-top-color: rgba(10, 14, 20, 0.1);
}

body.hero-ready .hero-bottom {
  opacity: 1;
}

/* ═══ متن معرفی ═══ */
.hero-intro {
  max-width: 520px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

[data-theme="light"] .hero-intro {
  color: rgba(10, 14, 20, 0.65);
}

/* ═══ دکمه اسکرول ═══ */
.hero-scroll {
  display: inline-flex;
  align-items: center;
  gap: 14px;

  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);

  padding: 8px 0;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);

  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;

  transition:
    color 0.35s cubic-bezier(.2, .8, .2, 1),
    border-color 0.35s cubic-bezier(.2, .8, .2, 1),
    gap 0.35s cubic-bezier(.2, .8, .2, 1);
}

.hero-scroll:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  gap: 20px;
}

[data-theme="light"] .hero-scroll {
  color: rgba(10, 14, 20, 0.8);
  border-bottom-color: rgba(10, 14, 20, 0.2);
}

[data-theme="light"] .hero-scroll:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.hero-arrow {
  color: var(--accent);
  font-size: 14px;
  display: inline-block;
  animation: heroBounce 1.8s ease-in-out infinite;
}

@keyframes heroBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}


/* ───────────────────────────────────────────────────────────
   07. PARALLAX — جلوگیری از تعارض با انیمیشن ورود
   ─────────────────────────────────────────────────────────── */

body.hero-ready .hero-name {
  transition:
    opacity 0.4s ease,
    transform 0.1s linear;
  will-change: transform;
}

body.hero-ready .hero-image {
  transition:
    opacity 0.4s ease,
    transform 0.1s linear;
  will-change: transform;
}

.hero-grid,
.hero-label,
.hero-index {
  transition: transform 0.15s linear;
  will-change: transform;
}


/* ───────────────────────────────────────────────────────────
   08. RESPONSIVE — موبایل
   ─────────────────────────────────────────────────────────── */

@media (max-width: 900px) {

  .hero-content {
    padding: 90px 5vw 0;
  }

  .hero-name {
    font-size: 15vw;
  }

  .hero-image {
    max-width: 100vw;
  }

  .hero-image img {
    max-height: 55vh;
  }

  .hero-label {
    font-size: 9px;
    padding-left: 45px;
  }

  .hero-label::before {
    width: 30px;
    top: 8px;
  }

  .hero-index {
    font-size: 9px;
  }

  .hero-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 20px 0 24px;
    margin: 0 5vw;
  }

  .hero-intro {
    font-size: 13px;
    max-width: 100%;
  }

  .hero-scroll {
    font-size: 10px;
  }

  /* ═══ غیرفعال کردن پارالاکس ═══ */
  .hero-name,
  .hero-image,
  .hero-grid,
  .hero-label,
  .hero-index {
    transform: none !important;
    transition: none !important;
  }
}

@media (max-width: 500px) {

  .hero-name {
    font-size: 16vw;
  }

  .hero-image img {
    max-height: 45vh;
  }
}


/* ───────────────────────────────────────────────────────────
   09. RTL — فارسی
   ─────────────────────────────────────────────────────────── */

body.fa .hero-name {
  font-family: var(--font-fa);
  letter-spacing: 0;
  line-height: 1.1;
}


/* ───────────────────────────────────────────────────────────
   10. REDUCED MOTION — احترام به کاربر
   ─────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .hero-grid,
  .hero-image,
  .hero-name .line,
  .hero-top,
  .hero-bottom,
  .hero-arrow,
  .hero-name,
  .hero-label,
  .hero-index {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hero-name .line {
    opacity: 0.16 !important;
  }
}


/* ═══════════════════════════════════════════════════════
   MOBILE FIX — اسم Hero از کادر بیرون نزنه
   ═══════════════════════════════════════════════════════ */

@media (max-width: 900px) {

  /* ═══ قاب اسم — overflow مخفی ═══ */
  .hero-name {
    font-size: 11vw !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 5vw !important;
    overflow: hidden !important;
    left: 0 !important;
    transform: translateY(-50%) !important;   /* فقط عمودی */
    box-sizing: border-box;
  }

  /* ═══ خط‌های اسم ═══ */
  .hero-name .line {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-align: center;
    letter-spacing: -0.05em;
  }
}

@media (max-width: 500px) {

  .hero-name {
    font-size: 10vw !important;
    padding: 0 6vw !important;
  }
}
