/* ==========================================================
   Project 04 — Leecher
   رنگ: بنفش / ماژنتا
   چیدمان: وسط‌چین، پایت‌لاین افقی
   ========================================================== */

@import url('/_core/fonts.css');


*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #08040f;
  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: #08040f;
  --text: #ffffff;
  --text-dim: #a89ab8;
  --text-muted: #6a5a80;
  --violet: #a855f7;
  --violet-bright: #c084fc;
  --violet-deep: #7c3aed;
  --violet-glow: rgba(168, 85, 247, 0.5);
  --violet-soft: rgba(168, 85, 247, 0.1);
  --pink: #ec4899;
  --pink-glow: rgba(236, 72, 153, 0.5);
  --line: rgba(168, 85, 247, 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-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1100px;
  height: 100%;
  padding: clamp(24px, 4vh, 48px) clamp(24px, 4vw, 60px);
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vh, 32px);
  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(168, 85, 247, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}

.bg-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 900px;
  height: 900px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.09) 0%, transparent 60%);
  filter: blur(60px);
  pointer-events: none;
  animation: bgGlowFloat 16s ease-in-out infinite;
}

@keyframes bgGlowFloat {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -53%) scale(1.08); }
}


/* ==========================================================
   هدر متن
   ========================================================== */
.project-head {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: headEnter 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  max-width: 720px;
}

@keyframes headEnter {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.project-num {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.4em;
  color: var(--violet-bright);
  opacity: 0.75;
  margin-bottom: 20px;
}

.project-label {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  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: 22px;
}

.project-title {
  font-family: 'Inter', sans-serif;
  font-size: clamp(2.5rem, 6.5vw, 5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #c084fc 60%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 40px rgba(192, 132, 252, 0.25));
}

.project-desc {
  font-size: clamp(0.9rem, 1.4vw, 1rem);
  line-height: 1.75;
  color: var(--text-dim);
  max-width: 600px;
}


/* ==========================================================
   پایت‌لاین
   ========================================================== */
.pipeline-scene {
  position: relative;
  width: 100%;
  max-width: 950px;
  margin: 0 auto;
  animation: sceneEnter 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

@keyframes sceneEnter {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pipeline-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

/* خطوط */
.pipeline-lines path {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: pipeDraw 1.8s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

.pipeline-lines path:nth-child(1) { animation-delay: 0.5s; }
.pipeline-lines path:nth-child(2) { animation-delay: 0.65s; }
.pipeline-lines path:nth-child(3) { animation-delay: 0.8s; }
.pipeline-lines path:nth-child(4) { animation-delay: 0.95s; }
.pipeline-lines path:nth-child(5) { animation-delay: 1.2s; }

@keyframes pipeDraw {
  to { stroke-dashoffset: 0; }
}


/* ---------- منابع ---------- */
.source {
  color: var(--text-dim);
  transition: color 0.3s ease;
  cursor: pointer;
}

.source-bg {
  fill: rgba(20, 12, 32, 0.85);
  stroke: rgba(168, 85, 247, 0.25);
  stroke-width: 1;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.source:hover .source-bg,
.source.is-active .source-bg {
  stroke: var(--violet-bright);
  fill: rgba(168, 85, 247, 0.1);
  filter: drop-shadow(0 0 12px var(--violet-glow));
}

.source:hover .source-icon,
.source.is-active .source-icon {
  color: var(--violet-bright);
}

.source-icon {
  transition: color 0.3s ease;
}

.source-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  fill: var(--text-muted);
  text-transform: uppercase;
}


/* ---------- هسته ---------- */
.core {
  pointer-events: none;
}

.core-glow {
  animation: coreGlowPulse 3.5s ease-in-out infinite;
}

@keyframes coreGlowPulse {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 0.85; }
}

.core-box {
  filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.4));
  transition: filter 0.3s ease;
}

.core-text {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 900;
  fill: #ffffff;
  letter-spacing: 1.5px;
}

.core-subtext {
  font-family: 'Inter', sans-serif;
  font-size: 8px;
  font-weight: 600;
  fill: rgba(255, 255, 255, 0.65);
  letter-spacing: 1.2px;
}


/* ---------- خروجی ---------- */
.output {
  color: var(--violet-bright);
}

.output-bg {
  fill: rgba(20, 12, 32, 0.85);
  stroke: rgba(168, 85, 247, 0.3);
  stroke-width: 1;
}

.output-progress {
  color: var(--pink);
  animation: progressFill 3.2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  filter: drop-shadow(0 0 8px var(--pink-glow));
}

@keyframes progressFill {
  0%   { stroke-dashoffset: 251.3; }
  60%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

.output-icon {
  filter: drop-shadow(0 0 10px var(--violet-glow));
}


/* ---------- پکت‌ها ---------- */
.packets circle {
  filter: drop-shadow(0 0 6px currentColor);
}


/* ==========================================================
   فوتر
   ========================================================== */
.project-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  animation: headEnter 1s cubic-bezier(0.16, 1, 0.3, 1) 0.9s both;
}

.tag {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--violet-bright);
  padding: 8px 16px;
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 999px;
  background: var(--violet-soft);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tag--accent::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--violet-bright);
  box-shadow: 0 0 8px var(--violet-bright);
  animation: dotPulse 1.8s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.4); opacity: 0.6; }
}

.btn-github {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  font-family: 'Inter', 'Vazirmatn', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-github svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--violet-bright);
  transition: color 0.3s ease;
}

.btn-github:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: var(--violet-bright);
  color: var(--violet-bright);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(168, 85, 247, 0.25);
}

.btn-github:hover svg {
  color: var(--pink);
}

.btn-github .arrow {
  font-family: 'Inter', sans-serif;
  transition: transform 0.3s ease;
  display: inline-block;
}

html[dir="rtl"] .btn-github .arrow {
  transform: rotate(180deg);
}

.btn-github:hover .arrow {
  transform: translateX(4px);
}

html[dir="rtl"] .btn-github:hover .arrow {
  transform: translateX(-4px) rotate(180deg);
}


/* ==========================================================
   ریسپانسیو
   ========================================================== */

@media (max-height: 800px) and (min-width: 1025px) {
  .project-inner { gap: 12px; padding: 20px 40px; }
  .project-num { margin-bottom: 12px; font-size: 0.72rem; }
  .project-label { font-size: 0.6rem; padding: 4px 10px; margin-bottom: 14px; }
  .project-title { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 12px; }
  .project-desc { font-size: 0.85rem; }
  .pipeline-scene { max-width: 780px; }
}

@media (max-width: 900px) {
  .pipeline-scene { max-width: 700px; }
  .source-label { font-size: 9px; }
}

@media (max-width: 640px) {
  .project-inner { padding: 24px 18px; gap: 18px; }
  .project-num { font-size: 0.72rem; letter-spacing: 0.3em; margin-bottom: 12px; }
  .project-label { font-size: 0.55rem; padding: 4px 10px; letter-spacing: 0.15em; margin-bottom: 12px; }
  .project-title { font-size: 2.4rem; margin-bottom: 12px; }
  .project-desc { font-size: 0.82rem; line-height: 1.7; }
  .source-label { display: none; }
  .core-text { font-size: 14px; }
  .core-subtext { font-size: 7px; }
  .project-footer { gap: 10px; }
  .btn-github { padding: 10px 18px; font-size: 0.82rem; }
  .btn-github svg { width: 16px; height: 16px; }
  .tag { font-size: 0.65rem; padding: 6px 12px; }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .pipeline-lines path { stroke-dashoffset: 0; }
  .output-progress { stroke-dashoffset: 0; }
}