/* ==========================================================
   Project 03 — WordPress Tools & Plugins
   رنگ: آبی الکتریک
   ========================================================== */

@import url('/_core/fonts.css');


*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #04060f;
  color: #ffffff;
  font-family: 'Vazirmatn', 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html[dir="ltr"] body { font-family: 'Inter', system-ui, sans-serif; }

img, svg, canvas { display: block; max-width: 100%; }


:root {
  --bg: #04060f;
  --text: #ffffff;
  --text-dim: #9aa8c0;
  --text-muted: #5a6580;
  --blue: #4a9eff;
  --blue-bright: #6bb2ff;
  --blue-glow: rgba(74, 158, 255, 0.45);
  --blue-soft: rgba(74, 158, 255, 0.1);
  --line: rgba(74, 158, 255, 0.15);
  --line-soft: rgba(255, 255, 255, 0.06);
}


/* ---------- Layout ---------- */
.project {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ---------- پس‌زمینه ---------- */
.project-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-grid {
  position: absolute;
  inset: -1px;
  background-image:
    linear-gradient(rgba(74, 158, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 158, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 25%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 25%, transparent 72%);
}

.bg-glow {
  position: absolute;
  top: 50%;
  inset-inline-end: 15%;
  transform: translateY(-50%);
  width: 800px;
  height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 158, 255, 0.08) 0%, transparent 62%);
  filter: blur(50px);
  pointer-events: none;
  animation: bgGlowFloat 15s ease-in-out infinite;
}

@keyframes bgGlowFloat {
  0%, 100% { transform: translateY(-50%) scale(1); }
  50%      { transform: translateY(-52%) scale(1.07); }
}


/* ---------- Grid دو ستونه ---------- */
.project-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1440px;
  padding: 0 clamp(24px, 5vw, 80px);
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(400px, 1.3fr);
  gap: clamp(40px, 6vw, 90px);
  align-items: center;
}


/* ==========================================================
   ستون متن
   ========================================================== */
.project-text {
  display: flex;
  flex-direction: column;
  animation: textEnter 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes textEnter {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.project-num {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  color: var(--blue);
  opacity: 0.75;
  margin-bottom: 32px;
}

.project-label {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-bottom: 24px;
  width: fit-content;
}

.project-title {
  font-size: clamp(1.9rem, 4.5vw, 3.4rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
}

html[dir="rtl"] .project-title { line-height: 1.22; }

.title-line-2 {
  color: var(--blue);
  text-shadow: 0 0 40px var(--blue-glow);
}

.project-desc {
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  line-height: 1.85;
  color: var(--text-dim);
  margin-bottom: 28px;
  max-width: 520px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}

.tag {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: all 0.3s ease;
}

.tag:hover {
  color: var(--blue);
  border-color: rgba(74, 158, 255, 0.4);
  background: var(--blue-soft);
}


/* ---------- آمار 09+ ---------- */
.project-stat {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.05), rgba(74, 158, 255, 0.01));
  width: fit-content;
  animation: statEnter 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

@keyframes statEnter {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stat-num {
  font-family: 'Inter', sans-serif;
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--blue);
  line-height: 1;
  letter-spacing: -0.04em;
  text-shadow: 0 0 30px var(--blue-glow);
}

.stat-plus {
  font-size: 1.8rem;
  vertical-align: top;
  opacity: 0.8;
  margin-inline-start: 1px;
}

.stat-label {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-dim);
  max-width: 160px;
}


/* ==========================================================
   ستون بصری — منظومه WP
   ========================================================== */
.project-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 70vh;
  animation: visualEnter 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes visualEnter {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}


/* ---------- صحنه مداری ---------- */
.orbit-scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ---------- حلقه‌های تزئینی ---------- */
.ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px dashed rgba(74, 158, 255, 0.14);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.ring-1 {
  width: calc(20 * vmin);
  height: calc(20 * vmin);
  animation: ringSpin 40s linear infinite;
}

.ring-2 {
  width: calc(32 * vmin);
  height: calc(32 * vmin);
  border-style: dotted;
  border-color: rgba(74, 158, 255, 0.1);
  animation: ringSpin 60s linear infinite reverse;
}

.ring-3 {
  width: calc(44 * vmin);
  height: calc(44 * vmin);
  border-color: rgba(74, 158, 255, 0.06);
  animation: ringSpin 90s linear infinite;
}

@keyframes ringSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}


/* ---------- مرکز WP ---------- */
.wp-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(72px, 9vmin, 110px);
  height: clamp(72px, 9vmin, 110px);
  z-index: 3;
}

.wp-halo {
  position: absolute;
  inset: -60%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--blue-glow) 0%, transparent 55%);
  filter: blur(20px);
  animation: wpHalo 4s ease-in-out infinite;
}

@keyframes wpHalo {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 0.9;  transform: scale(1.15); }
}

.wp-ring {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px solid rgba(74, 158, 255, 0.35);
  animation: wpRingPulse 3s ease-out infinite;
}

.wp-ring::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px solid rgba(74, 158, 255, 0.15);
  animation: wpRingPulse 3s ease-out infinite 1.5s;
}

@keyframes wpRingPulse {
  0%   { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}

.wp-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(74, 158, 255, 0.25), transparent 60%),
    linear-gradient(135deg, #0a1428, #0e1e3a);
  border: 1px solid rgba(74, 158, 255, 0.5);
  box-shadow:
    0 0 0 4px rgba(74, 158, 255, 0.06),
    0 0 40px rgba(74, 158, 255, 0.3),
    inset 0 0 30px rgba(74, 158, 255, 0.15);
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.4rem, 2.6vmin, 2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--blue-bright);
  text-shadow: 0 0 24px var(--blue);
  animation: wpTextFloat 6s ease-in-out infinite;
}

@keyframes wpTextFloat {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.03); }
}


/* ==========================================================
   پلاگین‌ها
   ========================================================== */
.plugin {
  position: absolute;
  top: 50%;
  left: 50%;

  --radius: 0;
  --angle: 0deg;

  transform: translate(-50%, -50%)
             rotate(var(--angle))
             translateX(var(--radius))
             rotate(calc(-1 * var(--angle)));

  z-index: 2;
  pointer-events: auto;
}

/* شعاع بر اساس مدار */
.plugin[data-orbit="1"] { --radius: calc(10 * vmin); }
.plugin[data-orbit="2"] { --radius: calc(16 * vmin); }
.plugin[data-orbit="3"] { --radius: calc(22 * vmin); }

/* زاویه */
.plugin[data-angle="0"]   { --angle: 0deg; }
.plugin[data-angle="30"]  { --angle: 30deg; }
.plugin[data-angle="60"]  { --angle: 60deg; }
.plugin[data-angle="120"] { --angle: 120deg; }
.plugin[data-angle="150"] { --angle: 150deg; }
.plugin[data-angle="180"] { --angle: 180deg; }
.plugin[data-angle="240"] { --angle: 240deg; }
.plugin[data-angle="270"] { --angle: 270deg; }
.plugin[data-angle="300"] { --angle: 300deg; }


/* ---------- آیکون پلاگین ---------- */
.plugin-icon {
  width: clamp(38px, 5vmin, 56px);
  height: clamp(38px, 5vmin, 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(20, 30, 55, 0.9), rgba(12, 20, 40, 0.9));
  border: 1px solid rgba(74, 158, 255, 0.25);
  color: var(--text-dim);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  animation: pluginFloat 6s ease-in-out infinite;
}

.plugin-icon svg {
  width: 50%;
  height: 50%;
  transition: color 0.3s ease;
}

/* تاخیر تصادفی برای هر پلاگین */
.plugin:nth-child(4n) .plugin-icon { animation-delay: -1.5s; }
.plugin:nth-child(4n+1) .plugin-icon { animation-delay: -3s; }
.plugin:nth-child(4n+2) .plugin-icon { animation-delay: -4.5s; }

@keyframes pluginFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}


/* ---------- حالت فعال ---------- */
.plugin.is-active .plugin-icon {
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.25), rgba(74, 158, 255, 0.1));
  border-color: var(--blue);
  color: var(--blue-bright);
  box-shadow:
    0 0 0 4px rgba(74, 158, 255, 0.08),
    0 0 30px var(--blue-glow);
  transform: translateY(-4px) scale(1.08);
}

.plugin.is-active .plugin-icon::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 18px;
  border: 1px solid rgba(74, 158, 255, 0.4);
  animation: pluginPulse 1.6s ease-out infinite;
}

@keyframes pluginPulse {
  0%   { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}


/* ---------- برچسب نام پلاگین ---------- */
.plugin-name {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(10, 20, 40, 0.95);
  border: 1px solid rgba(74, 158, 255, 0.4);
  color: var(--blue-bright);
  font-family: 'Inter', 'Vazirmatn', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.plugin.is-active .plugin-name {
  opacity: 1;
  transform: translateX(-50%) translateY(4px);
}


/* ==========================================================
   نشان شناور
   ========================================================== */
.float-badge {
  position: absolute;
  top: 20px;
  inset-inline-end: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(10, 20, 40, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(74, 158, 255, 0.3);
  font-family: 'Inter', 'Vazirmatn', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--blue-bright);
  z-index: 4;
  animation: floatBadge 5s ease-in-out infinite;
}

@keyframes floatBadge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

.fb-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 10px var(--blue);
  animation: fbDotPulse 1.8s ease-in-out infinite;
}

@keyframes fbDotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.3); opacity: 0.7; }
}


/* ==========================================================
   ریسپانسیو
   ========================================================== */

@media (max-width: 1024px) {
  .project-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 40px clamp(20px, 5vw, 60px);
    max-height: 100vh;
    overflow-y: auto;
  }
  .project-visual {
    order: 2;
    aspect-ratio: 1 / 1;
    max-height: 60vh;
    margin: 0 auto;
    max-width: 500px;
    width: 100%;
  }
  .project-text { order: 1; }
}

@media (max-width: 640px) {
  .project-inner { padding: 24px 20px; gap: 28px; }
  .project-num { margin-bottom: 20px; font-size: 0.75rem; }
  .project-label { font-size: 0.6rem; padding: 5px 10px; margin-bottom: 16px; letter-spacing: 0.15em; }
  .project-title { margin-bottom: 18px; }
  .project-desc { font-size: 0.88rem; margin-bottom: 22px; }
  .tag { font-size: 0.65rem; padding: 4px 10px; }
  .project-tags { margin-bottom: 28px; }
  .project-stat { padding: 14px 18px; gap: 14px; }
  .stat-num { font-size: 2rem; }
  .stat-plus { font-size: 1.4rem; }
  .stat-label { font-size: 0.75rem; }
  .plugin-name { font-size: 0.62rem; padding: 3px 8px; margin-top: 8px; }
  .ring-2, .ring-3 { display: none; }
  .float-badge { top: 12px; inset-inline-end: 12px; font-size: 0.65rem; padding: 6px 10px; }
}

@media (max-height: 620px) and (min-width: 1025px) {
  .project-title { font-size: clamp(1.5rem, 3.5vw, 2.4rem); }
  .project-desc { font-size: 0.85rem; }
  .project-stat { padding: 14px 18px; }
  .stat-num { font-size: 2rem; }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}