/* ================================================================
   ALIREZA ABIRI — PORTFOLIO STYLES
   ================================================================ */

/* ================= THEME TOKENS ================= */
:root {
  --bg: #05070f;
  --bg-soft: #080c18;
  --surface: rgba(18, 24, 44, 0.55);
  --surface-2: rgba(28, 36, 64, 0.45);
  --border: rgba(120, 160, 255, 0.14);
  --border-2: rgba(120, 160, 255, 0.3);
  --text: #eaf0ff;
  --text-2: #a9b4d0;
  --text-3: #6b7699;
  --accent: #4f8dff;
  --accent-2: #7b5cff;
  --accent-3: #38e1d6;
  --accent-glow: rgba(79, 141, 255, 0.5);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --radius: 20px;
  --radius-sm: 12px;
  --font: "Vazirmatn", "Tahoma", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "SF Mono", "Consolas", "Monaco", "Menlo", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  --bg: #f5f7fd;
  --bg-soft: #e9eef9;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-2: rgba(255, 255, 255, 0.62);
  --border: rgba(60, 100, 200, 0.16);
  --border-2: rgba(60, 100, 200, 0.32);
  --text: #0a1229;
  --text-2: #3d4d75;
  --text-3: #6b7699;
  --accent: #2563eb;
  --accent-2: #6d3ef0;
  --accent-3: #0891b2;
  --accent-glow: rgba(37, 99, 235, 0.32);
  --shadow: 0 20px 60px rgba(30, 50, 100, 0.12);
}

/* ================= RESET ================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 90px;
  overflow-x: hidden;
  width: 100%;
  overflow-anchor: none;
}
@supports (overflow: clip) {
  html { overflow-x: clip; }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-weight: 400;
  overflow-x: hidden;
  width: 100%;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
  cursor: none;
  overflow-anchor: none;
}
@supports (overflow: clip) {
  body { overflow-x: clip; }
}

@media (hover: none), (pointer: coarse) {
  body, a, button, input, textarea { cursor: auto; }
  .cursor { display: none !important; }
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; background: none; color: inherit; cursor: none; }
ul { list-style: none; }
::selection { background: var(--accent); color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent), var(--accent-2));
  border-radius: 10px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: min(1240px, 92%);
  margin-inline: auto;
  min-width: 0;
}

/* ================= BACKGROUND ================= */
#bgCanvas { position: fixed; inset: 0; z-index: -3; pointer-events: none; }

.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 75%);
  opacity: 0.5;
}

.bg-glow { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
.glow { position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.35; }
.glow-1 { width: 500px; height: 500px; background: var(--accent); top: -180px; right: -120px; animation: float1 18s ease-in-out infinite; }
.glow-2 { width: 420px; height: 420px; background: var(--accent-2); bottom: -140px; left: -100px; animation: float2 22s ease-in-out infinite; }
.glow-3 { width: 340px; height: 340px; background: var(--accent-3); top: 45%; left: 40%; opacity: 0.15; animation: float3 26s ease-in-out infinite; }
@keyframes float1 { 50% { transform: translate(-40px, 60px) scale(1.1); } }
@keyframes float2 { 50% { transform: translate(60px, -40px) scale(1.15); } }
@keyframes float3 { 50% { transform: translate(-50px, -30px) scale(0.9); } }

/* ================= CURSOR ================= */
.cursor {
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  border-radius: 50%;
}
.cursor--dot {
  width: 6px; height: 6px;
  background: var(--accent-3);
  box-shadow: 0 0 12px var(--accent-3);
  transform: translate(-50%, -50%);
}
.cursor--ring {
  width: 38px; height: 38px;
  border: 1.5px solid var(--border-2);
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--ease), height 0.25s var(--ease), border-color 0.25s;
}
.cursor--glow {
  width: 220px; height: 220px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
  transform: translate(-50%, -50%);
  opacity: 0.5;
  filter: blur(20px);
}
.cursor--ring.is-hover { width: 60px; height: 60px; border-color: var(--accent); }
.cursor--ring.is-click { width: 24px; height: 24px; }

/* ================= LOADER ================= */
.loader {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--bg);
  display: grid; place-items: center;
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__inner { display: grid; place-items: center; gap: 22px; }
.loader__ring {
  width: 64px; height: 64px; border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader__brand {
  font-size: 1.05rem; font-weight: 800;
  letter-spacing: 0.35em;
  color: var(--text-2);
  font-family: var(--font-mono);
}
.loader__brand span { color: var(--accent); }
.loader__track {
  width: 180px; height: 3px;
  background: var(--border);
  border-radius: 3px; overflow: hidden;
}
.loader__track i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  animation: loadbar 1.6s var(--ease) forwards;
}
@keyframes loadbar { to { width: 100%; } }

/* ================= PROGRESS ================= */
.progress {
  position: fixed; top: 0; right: 0;
  height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  z-index: 999;
  box-shadow: 0 0 12px var(--accent);
  transition: width 0.1s linear;
}
[dir="ltr"] .progress { right: auto; left: 0; }

/* ================= HEADER ================= */
.header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: padding 0.4s var(--ease), background 0.4s var(--ease);
}
.header.is-scrolled {
  padding: 10px 0;
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.header__inner {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex; flex-direction: column;
  line-height: 1.25;
  flex-shrink: 0;
}
.brand b { font-size: 1.02rem; font-weight: 800; }
.brand small { font-size: 0.7rem; color: var(--text-3); }

.nav {
  position: relative;
  display: flex; gap: 2px;
  padding: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.nav__link {
  position: relative;
  z-index: 2;
  padding: 8px 16px;
  font-size: 0.88rem;
  color: var(--text-2);
  border-radius: 999px;
  transition: color 0.3s var(--ease);
  white-space: nowrap;
}
.nav__link:hover { color: var(--text); }
.nav__link.is-active { color: var(--text); }

.nav__pill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--accent) 30%, transparent),
    color-mix(in oklab, var(--accent-2) 30%, transparent));
  border: 1px solid var(--border-2);
  z-index: 1;
  pointer-events: none;
  transition: transform 0.4s var(--ease), width 0.4s var(--ease);
  will-change: transform, width;
}

.header__actions { display: flex; align-items: center; gap: 8px; }

.ico-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-2);
  transition: all 0.3s var(--ease);
}
.ico-btn:hover {
  color: var(--text);
  border-color: var(--border-2);
  transform: translateY(-2px);
}
.ico-btn svg { width: 18px; height: 18px; }

.i-sun { display: none; }
[data-theme="light"] .i-sun { display: block; }
[data-theme="light"] .i-moon { display: none; }

.lang-btn {
  height: 40px; padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--text-2);
  transition: all 0.3s var(--ease);
  font-family: var(--font-mono);
}
.lang-btn:hover {
  color: var(--text);
  border-color: var(--border-2);
  transform: translateY(-2px);
}

/* ============ MENU BUTTON (همبرگر) ============ */
.menu-btn {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  width: 40px;
  height: 40px;
}
.menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  transform-origin: center;
}
.menu-btn.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.is-open span:nth-child(2) { opacity: 0; }
.menu-btn.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ================= MOBILE NAV ================= */
.mobile-nav {
  position: fixed; inset: 0; z-index: 999;
  background: color-mix(in oklab, var(--bg) 94%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: grid; place-items: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}
.mobile-nav.is-open { opacity: 1; visibility: visible; }
.mobile-nav nav { display: flex; flex-direction: column; gap: 16px; text-align: center; }
.mobile-nav a {
  font-size: 1.5rem; font-weight: 700;
  color: var(--text-2);
  transition: color 0.25s;
  padding: 8px 20px;
}
.mobile-nav a:hover { color: var(--accent); }

/* ================= SECTION ================= */
.section { padding: 110px 0; position: relative; }

.sec-head {
  margin-bottom: 60px;
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
}
.sec-head__kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent-3);
  text-transform: uppercase;
  margin-bottom: 16px;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.sec-head__kicker::before {
  content: "";
  width: 14px; height: 2px;
  background: var(--accent-3);
  border-radius: 2px;
}
.sec-head__title {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--text) 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sec-head__sub { color: var(--text-2); font-size: 1rem; }

/* ================= GLASS ================= */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.glass::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 40%);
  pointer-events: none;
}

/* ================= REVEAL ================= */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.94rem;
  transition: all 0.35s var(--ease);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  font-family: inherit;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px var(--accent-glow);
}
.btn--primary::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  opacity: 0;
  transition: opacity 0.35s;
}
.btn--primary > * { position: relative; z-index: 1; }
.btn--primary:hover::after { opacity: 1; }
.btn--primary:hover { transform: translateY(-3px); box-shadow: 0 16px 40px var(--accent-glow); }

.btn--ghost {
  color: var(--text);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.btn--ghost:hover {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 12%, transparent);
  transform: translateY(-3px);
}

/* ================= HERO ================= */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex; align-items: center;
  padding-top: 130px;
  padding-bottom: 90px;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  align-items: center;
}

.badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-2);
  margin-bottom: 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.badge__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-3);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(56, 225, 214, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(56, 225, 214, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 225, 214, 0); }
}

.hero__name {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.grad {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 50%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% auto;
}

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 20px;
  letter-spacing: 0.01em;
}

.hero__typed {
  display: flex; align-items: center; gap: 6px;
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 600;
  margin-bottom: 26px;
  height: 1.8em;              /* ← ارتفاع ثابت، نه min-height */
  overflow: hidden;           /* ← اگه متن بلندتر شد، کادر بزرگ نشه */
}
.typed { color: var(--accent-3); font-weight: 800; }
.typed__caret {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  background: var(--accent-3);
  animation: blink 1s steps(2) infinite;
  vertical-align: middle;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__desc {
  font-size: 1.02rem;
  color: var(--text-2);
  margin-bottom: 34px;
  max-width: 560px;
  line-height: 2;
}

.hero__cta {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-bottom: 48px;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat b {
  font-size: 1.7rem; font-weight: 900; line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat span { font-size: 0.78rem; color: var(--text-3); }

/* ============ HERO VISUAL ============ */
.hero__visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 500px;
  overflow: clip;
}
@supports not (overflow: clip) {
  .hero__visual { overflow: hidden; }
}

.orb {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
}
.orb__ring {
  position: absolute;
  width: 380px; height: 380px;
  border: 1px solid var(--border-2);
  border-radius: 50%;
  animation: spin 24s linear infinite;
}
.orb__ring::before {
  content: "";
  position: absolute;
  top: -4px; left: 50%;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 16px var(--accent-3);
}
.orb__ring--2 {
  width: 480px; height: 480px;
  border-style: dashed;
  animation: spin 40s linear infinite reverse;
  opacity: 0.5;
}
.orb__ring--2::before { background: var(--accent-2); box-shadow: 0 0 16px var(--accent-2); }
.orb__ring--3 {
  width: 300px; height: 300px;
  animation: spin 16s linear infinite;
  opacity: 0.7;
}

.terminal {
  position: relative;
  z-index: 1;
  width: 100%; max-width: 480px;
  border-radius: 16px;
  background: rgba(8, 12, 24, 0.88);
  border: 1px solid var(--border-2);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 0 40px -10px var(--accent-glow);
  overflow: hidden;
  font-family: var(--font-mono);
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
}
[data-theme="light"] .terminal { background: rgba(12, 20, 40, 0.94); }

.terminal__bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  direction: ltr;
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot--r { background: #ff5f57; }
.dot--y { background: #febc2e; }
.dot--g { background: #28c840; }
.terminal__title {
  margin-left: auto;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-mono);
}

.terminal__body {
  padding: 18px 20px;
  font-size: 0.8rem;
  line-height: 1.9;
  color: #c8d3ee;
  font-family: var(--font-mono);
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
}
.t-line { white-space: pre; margin: 0; }
.t-gap { height: 0.9em; }
.t-indent { padding-left: 1.4em; }
.t-prompt { color: #38e1d6; }
.t-cmd { color: #38e1d6; }
.t-out { color: #a9b4d0; }
.t-key { color: #7b5cff; }
.t-str { color: #4ade80; }
.t-brace { color: #ffb86b; }
.t-cursor {
  animation: blink 1s steps(2) infinite;
  color: #38e1d6;
}

.scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
}
.scroll-hint__mouse {
  width: 22px; height: 34px;
  border: 1.5px solid var(--text-3);
  border-radius: 12px;
  display: grid; justify-items: center;
  padding-top: 6px;
}
.scroll-hint__mouse i {
  display: block;
  width: 3px; height: 6px;
  background: var(--text-3);
  border-radius: 2px;
  animation: wheel 1.6s infinite;
}
@keyframes wheel {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(10px); opacity: 0; }
}

/* ================= ABOUT ================= */
.about__grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 40px;
  align-items: start;
}

.about__side {
  padding: 40px 30px;
  text-align: center;
  position: sticky;
  top: 100px;
}
.about__avatar {
  width: 130px; height: 130px;
  margin: 0 auto 22px;
  position: relative;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 900;
  font-size: 2.2rem;
  color: #fff;
  letter-spacing: 0.05em;
  box-shadow: 0 20px 50px var(--accent-glow);
  font-family: var(--font-mono);
}
.about__ring {
  position: absolute;
  inset: -10px;
  border: 1.5px dashed var(--border-2);
  border-radius: 50%;
  animation: spin 20s linear infinite;
}
.about__side h3 {
  font-size: 1.3rem; font-weight: 800;
  margin-bottom: 6px;
}
.about__role { color: var(--text-3); font-size: 0.85rem; margin-bottom: 22px; }
.about__chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  padding: 5px 12px;
  font-size: 0.72rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.about__body p {
  color: var(--text-2);
  margin-bottom: 18px;
  line-height: 2.05;
  font-size: 1rem;
}

.about__facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 30px;
}
.about__facts li {
  display: flex; gap: 14px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.3s var(--ease), border-color 0.3s;
}
.about__facts li:hover {
  transform: translateY(-3px);
  border-color: var(--border-2);
}
.about__ico { font-size: 1.4rem; flex-shrink: 0; }
.about__facts li div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.about__facts b { font-size: 0.82rem; color: var(--text); font-weight: 700; }
.about__facts span { font-size: 0.82rem; color: var(--text-3); }

/* ================= SKILLS ================= */
.skills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  margin-bottom: 40px;
}
.skill { padding: 28px; }
.skill__head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.skill__ico {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  font-size: 1.4rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.skill__head h3 { font-size: 1.05rem; font-weight: 700; }

.bars { display: flex; flex-direction: column; gap: 16px; }
.bar__top {
  display: flex; justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-2);
  margin-bottom: 6px;
}
.bar__top b { color: var(--accent-3); font-weight: 700; font-size: 0.78rem; }
.bar > i {
  display: block;
  height: 5px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.bar > i::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  border-radius: 5px;
  transition: width 1.4s var(--ease);
  box-shadow: 0 0 12px var(--accent-glow);
}
.bar.is-in > i::after { width: var(--w); }

.tags { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tag {
  padding: 8px 16px;
  font-size: 0.82rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all 0.3s var(--ease);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-family: var(--font-mono);
}
.tag:hover {
  color: var(--text);
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  transform: translateY(-2px);
}

/* ================= TIMELINE ================= */
.timeline { position: relative; padding-inline-start: 40px; }
.timeline::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  inset-inline-start: 10px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--border-2) 10%, var(--border-2) 90%, transparent);
}
.tl-item { position: relative; padding-bottom: 28px; }
.tl-dot {
  position: absolute;
  inset-inline-start: -36px;
  top: 24px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 15%, transparent), 0 0 20px var(--accent-glow);
  transition: all 0.4s var(--ease);
}
.tl-item:hover .tl-dot { background: var(--accent); transform: scale(1.2); }
.tl-card {
  padding: 26px 28px;
  transition: transform 0.4s var(--ease), border-color 0.3s;
}
.tl-card:hover { border-color: var(--border-2); }
[dir="rtl"] .tl-card:hover { transform: translateX(-4px); }
[dir="ltr"] .tl-card:hover { transform: translateX(4px); }
.tl-date {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-3);
  padding: 4px 10px;
  border-radius: 6px;
  background: color-mix(in oklab, var(--accent-3) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent-3) 25%, transparent);
  margin-bottom: 12px;
}
.tl-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.tl-card h4 { font-size: 0.85rem; font-weight: 600; color: var(--text-3); margin-bottom: 12px; }
.tl-card p { font-size: 0.92rem; color: var(--text-2); line-height: 1.95; }

/* ================= PROJECTS ================= */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center;
  margin-bottom: 40px;
}
.filter {
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-2);
  transition: all 0.35s var(--ease);
  font-family: inherit;
}
.filter:hover { color: var(--text); border-color: var(--border-2); }
.filter.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 10px 24px var(--accent-glow);
}

.projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.project {
  padding: 26px;
  display: flex; flex-direction: column; gap: 14px;
  transition: transform 0.4s var(--ease), border-color 0.3s, box-shadow 0.4s;
}
.project:hover {
  transform: translateY(-6px);
  border-color: var(--border-2);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4), 0 0 40px var(--accent-glow);
}
/* ============ کارت پروژه لینک‌دار ============ */
.project--link {
  cursor: none;
  position: relative;
}
.project--link:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4), 0 0 40px var(--accent-glow);
}
.project--link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.project__arrow {
  position: absolute;
  top: 20px;
  inset-inline-end: 20px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
  font-size: 1rem;
  font-weight: 700;
  transition: all 0.3s var(--ease);
  pointer-events: none;
}
.project--link:hover .project__arrow {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  transform: translate(3px, -3px);
}
.project__ico {
  width: 54px; height: 54px;
  display: grid; place-items: center;
  font-size: 1.6rem;
  border-radius: 14px;
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--accent) 20%, transparent),
    color-mix(in oklab, var(--accent-2) 20%, transparent));
  border: 1px solid var(--border-2);
}
.project h3 { font-size: 1.08rem; font-weight: 700; }
.project p { font-size: 0.88rem; color: var(--text-2); line-height: 1.9; flex: 1; }
.project__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.project__tags span {
  font-size: 0.68rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
  font-family: var(--font-mono);
}

/* ================= SERVICES ================= */
.services {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.srv { padding: 30px 24px; text-align: center; }
.srv__ico {
  display: inline-grid; place-items: center;
  width: 56px; height: 56px;
  font-size: 1.6rem;
  border-radius: 16px;
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--accent) 18%, transparent),
    color-mix(in oklab, var(--accent-2) 18%, transparent));
  border: 1px solid var(--border-2);
  margin-bottom: 18px;
}
.srv h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }
.srv p { font-size: 0.88rem; color: var(--text-2); line-height: 1.9; }

/* ================= CONTACT ================= */
.contact {
  padding: 70px 50px;
  text-align: center;
  position: relative;
}
.contact__glow {
  position: absolute;
  top: -50%; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  opacity: 0.4;
  pointer-events: none;
  filter: blur(60px);
}
.contact__title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 12px;
  position: relative;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.contact__sub {
  color: var(--text-2);
  max-width: 560px;
  margin: 0 auto 40px;
  position: relative;
  line-height: 2;
}
.contact__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 900px;
  margin: 0 auto 36px;
  position: relative;
}
.contact__card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 24px 20px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.35s var(--ease);
  text-align: center;
}
.contact__card:hover {
  border-color: var(--border-2);
  transform: translateY(-4px);
  background: color-mix(in oklab, var(--accent) 8%, transparent);
}
.contact__ico { font-size: 1.6rem; }
.contact__card b {
  font-size: 0.78rem;
  color: var(--text-3);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.contact__card span:last-child {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 600;
  word-break: break-all;
}

.contact__socials {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  margin-bottom: 36px;
  position: relative;
}
.social {
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-2);
  transition: all 0.35s var(--ease);
  font-family: var(--font-mono);
}
.social:hover {
  color: var(--text);
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  transform: translateY(-3px);
}

.contact__cvs {
  display: flex; gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

/* ================= FOOTER ================= */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer__brand { display: flex; flex-direction: column; gap: 2px; }
.footer__brand b { font-size: 0.98rem; font-weight: 800; }
.footer__brand small { font-size: 0.72rem; color: var(--text-3); }
.footer__copy {
  display: flex; gap: 16px;
  font-size: 0.8rem;
  color: var(--text-3);
  flex-wrap: wrap;
}

/* ================= TO TOP ================= */
.to-top {
  position: fixed;
  bottom: 30px;
  inset-inline-end: 30px;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 12px 30px var(--accent-glow);
  opacity: 0; visibility: hidden;
  transform: translateY(20px);
  transition: all 0.4s var(--ease);
  z-index: 900;
}
.to-top.is-show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { transform: translateY(-4px); }
.to-top svg { width: 20px; height: 20px; }

/* ================================================================
   PRINT — CV
   ================================================================ */
.cv { display: none; }

@media print {
  @page { margin: 12mm 10mm; size: A4; }

  html, body {
    background: #fff !important;
    color: #111 !important;
    cursor: auto !important;
    line-height: 1.7 !important;
    overflow: visible !important;
  }
  body > *:not(.cv) { display: none !important; }

  body.printing-fa #cvFa { display: block !important; }
  body.printing-en #cvEn { display: block !important; }

  .cv {
    font-family: "Vazirmatn", "Tahoma", sans-serif;
    color: #1a1a1a;
    font-size: 11pt;
    max-width: 100%;
  }

  .cv-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 14px 16px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #f0f4ff 0%, #eaf0fb 100%);
    border-radius: 8px;
    border-bottom: 3px solid #1a3b8a;
  }
  .cv-head__main h1 {
    font-size: 22pt; font-weight: 800;
    color: #0a1f4d; line-height: 1.15;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
  }
  .cv-head__role {
    font-size: 10pt; font-weight: 600;
    color: #1a3b8a; line-height: 1.5;
  }
  .cv-head__contact {
    text-align: end;
    font-size: 9pt;
    color: #444;
    line-height: 1.7;
    flex-shrink: 0;
  }
  .cv-head__contact p {
    white-space: nowrap;
    direction: ltr;
    text-align: end;
  }
  .cv--fa .cv-head__contact p { text-align: left; }

  .cv-body { display: grid; gap: 22px; align-items: start; }

  .cv--fa .cv-body { grid-template-columns: 1.7fr 1fr; }
  .cv--fa .cv-main { order: 1; }
  .cv--fa .cv-side { order: 2; }

  .cv--en .cv-body { grid-template-columns: 1fr 1.7fr; }
  .cv--en .cv-side { order: 1; }
  .cv--en .cv-main { order: 2; }

  .cv-sec { margin-bottom: 16px; break-inside: avoid; }
  .cv-sec h2 {
    font-size: 11pt;
    font-weight: 800;
    color: #0a1f4d;
    padding-bottom: 5px;
    margin-bottom: 9px;
    border-bottom: 1.5px solid #c8d0e0;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    break-after: avoid;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .cv-sec h2::before {
    content: "";
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #1a3b8a;
    flex-shrink: 0;
  }
  .cv-sec p {
    font-size: 10pt;
    color: #2a2a2a;
    line-height: 1.75;
    text-align: justify;
  }

  .cv-item { margin-bottom: 12px; break-inside: avoid; }
  .cv-item:last-child { margin-bottom: 0; }
  .cv-item__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 2px;
  }
  .cv-item__head b {
    font-size: 10.5pt;
    font-weight: 700;
    color: #111;
  }
  .cv-item__head span {
    font-size: 8.5pt;
    color: #1a3b8a;
    font-weight: 700;
    white-space: nowrap;
    background: #eaf0fb;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #d0dcf0;
  }
  .cv-item__sub {
    display: block;
    font-size: 9pt;
    color: #1a3b8a;
    font-weight: 600;
    margin-bottom: 4px;
  }
  .cv-item p {
    font-size: 9.5pt;
    color: #333;
    line-height: 1.65;
    text-align: justify;
  }

  .cv-list { list-style: none; padding: 0; margin: 0; }
  .cv-list li {
    font-size: 9.5pt;
    color: #2a2a2a;
    line-height: 1.7;
    padding-inline-start: 14px;
    position: relative;
    margin-bottom: 3px;
  }
  .cv-list li::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0.65em;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #1a3b8a;
  }

  .cv-side {
    background: #f6f8fd;
    border-radius: 6px;
    padding: 14px;
    border-inline-start: 3px solid #1a3b8a;
  }
  .cv-main { padding-inline-start: 4px; }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
  .hero__grid { grid-template-columns: 1fr; gap: 50px; }
  .hero__visual { order: -1; min-height: 380px; }
  .orb__ring { width: 300px; height: 300px; }
  .orb__ring--2 { width: 380px; height: 380px; }
  .orb__ring--3 { width: 240px; height: 240px; }
  .about__grid { grid-template-columns: 1fr; }
  .about__side { position: static; }
  .projects { grid-template-columns: repeat(2, 1fr); }
  .skills { grid-template-columns: 1fr; }
  .services { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .section { padding: 80px 0; }
  .nav { display: none; }
  .menu-btn { display: flex; }
  .hero { padding-top: 100px; padding-bottom: 60px; }
  .hero__stats { grid-template-columns: repeat(2, 1fr); }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .hero__cta .btn { justify-content: center; }
  .contact { padding: 50px 24px; }
  .contact__cards { grid-template-columns: 1fr; }
  .projects { grid-template-columns: 1fr; }
  .services { grid-template-columns: 1fr; }
  .timeline { padding-inline-start: 30px; }
  .tl-dot { inset-inline-start: -26px; }
  .footer__inner { flex-direction: column; text-align: center; }
  .sec-head { margin-bottom: 40px; }
  .about__facts { grid-template-columns: 1fr; }
    .scroll-hint {
    bottom: 14px;
    transform: translateX(-50%) scale(0.9);
  }
}

@media (max-width: 480px) {
  .brand small { display: none; }
  .hero__stats { gap: 14px; }
  .stat b { font-size: 1.4rem; }
  .glow-1, .glow-2 { width: 300px; height: 300px; }
  .contact__cvs { flex-direction: column; }
  .contact__cvs .btn { justify-content: center; width: 100%; }
  .filters { gap: 6px; }
  .filter { padding: 8px 14px; font-size: 0.78rem; }
  .terminal { max-width: 100%; }
  .terminal__body { font-size: 0.7rem; padding: 14px 16px; line-height: 1.8; }
  .hero__visual { min-height: 320px; }
  .orb__ring { width: 240px; height: 240px; }
  .orb__ring--2 { width: 300px; height: 300px; }
  .orb__ring--3 { width: 190px; height: 190px; }
}