/* Design tokens */
:root {
    --bg: #0b0f14;
    --surface: rgba(255,255,255,0.06);
    --text: #e6edf3;
    --muted: #a9b1bb;
    --brand: #4f9cff;
    --brand-2: #8a5cff;
    --ok: #19c37d;
    --warn: #f39c12;
    --danger: #ff4d4f;
    --radius: 16px;
    --gap: 24px;
    --blur: 14px;
    --shadow: 0 10px 30px rgba(0,0,0,0.35);
    --border: 1px solid rgba(255,255,255,0.12);
  }
  
  :root.light {
    --bg: #f6f8fa;
    --surface: rgba(0,0,0,0.04);
    --text: #0b0f14;
    --muted: #4b5563;
    --brand: #1f6feb;
    --brand-2: #7c3aed;
    --shadow: 0 8px 28px rgba(2,6,23,0.12);
    --border: 1px solid rgba(2,6,23,0.08);
  }
  
  * { box-sizing: border-box; }
  html, body { height: 100%; }
  body {
    margin: 0;
    font-family: "Vazirmatn", system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
  }
  
  /* Background systems */
  .bg-grid {
    position: fixed; inset: 0; z-index: -3;
    background-image:
      linear-gradient(to right, rgba(255,255,255,0.06) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 36px 36px, 36px 36px;
    mask-image: radial-gradient(ellipse at center, black 60%, transparent 100%);
  }
  
  .bg-mesh {
    position: fixed; inset: -20% -10% 0 -10%; z-index: -4;
    background: radial-gradient(60% 60% at 70% 30%, rgba(79,156,255,0.25), transparent 60%),
                radial-gradient(50% 50% at 30% 70%, rgba(138,92,255,0.18), transparent 60%);
    filter: blur(40px);
    animation: mesh-move 18s ease-in-out infinite alternate;
  }
  @keyframes mesh-move {
    from { transform: translateY(-10px) scale(1); }
    to   { transform: translateY(10px) scale(1.05); }
  }
  
  /* Utilities */
  .glass { background: var(--surface); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
  .blur { backdrop-filter: saturate(150%) blur(var(--blur)); -webkit-backdrop-filter: saturate(150%) blur(var(--blur)); }
  .section { padding: 88px min(5vw, 48px); position: relative; }
  .section-head { margin-bottom: 28px; }
  .section-head h2 { display: inline-flex; align-items: center; gap: 12px; font-size: clamp(1.2rem, 1rem + 1.2vw, 1.8rem); margin: 0 0 8px; }
  .section-head p { margin: 0; color: var(--muted); }
  
  /* Header */
  .site-header {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px; margin: 14px; border-radius: calc(var(--radius) + 6px);
  }
  .profile { display: flex; align-items: center; gap: 12px; }
  .logo-circle {
    width: 56px; height: 56px; border-radius: 50%; overflow: hidden; position: relative;
    border: 2px solid transparent;
    background:
      linear-gradient(var(--bg), var(--bg)) padding-box,
      conic-gradient(from 180deg, var(--brand), var(--brand-2), var(--brand)) border-box;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.08), 0 8px 24px rgba(79,156,255,0.25);
    transition: transform .35s ease, box-shadow .35s ease;
  }
  .logo-circle:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 0 0 3px rgba(255,255,255,0.14), 0 16px 36px rgba(138,92,255,0.28); }
  .logo-circle img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
  .brand { display: grid; }
  .alias { font-weight: 800; letter-spacing: 0.3px; }
  .role { font-size: 0.9rem; color: var(--muted); }
  
  .main-nav { display: flex; gap: 10px; }
  .nav-btn {
    width: 44px; height: 44px; display: inline-grid; place-items: center;
    border-radius: 12px; color: var(--text); position: relative; isolation: isolate;
    transition: transform .2s ease, color .2s ease, background .2s ease;
  }
  .nav-btn:hover { background: rgba(255,255,255,0.08); color: var(--brand); transform: translateY(-2px); }
  .nav-btn::after {
    content: attr(data-tooltip); position: absolute; bottom: -40px; opacity: 0; pointer-events: none;
    background: rgba(0,0,0,0.7); color: white; padding: 6px 10px; border-radius: 10px; font-size: 12px;
    transform: translateY(6px); transition: .25s ease;
  }
  .nav-btn:hover::after { opacity: 1; transform: translateY(0); }
  
  .actions { display: flex; gap: 8px; }
  .icon-btn {
    width: 44px; height: 44px; border-radius: 12px; display: inline-grid; place-items: center;
    color: var(--text); background: rgba(255,255,255,0.06); border: var(--border);
    transition: transform .2s ease, color .2s ease, background .2s ease;
  }
  .icon-btn:hover { color: var(--brand); background: rgba(255,255,255,0.1); transform: translateY(-2px); }
  
  /* Hero */
  .hero { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: var(--gap); align-items: center; }
  .title { font-size: clamp(1.6rem, 1.2rem + 2.2vw, 3rem); margin: 0 0 10px; }
  .subtitle { color: var(--muted); margin: 0 0 22px; max-width: 50ch; }
  .gradient-text { background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
  .btn { border-radius: 12px; padding: 12px 16px; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; text-decoration: none; }
  .btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: white; box-shadow: var(--shadow); }
  .btn.primary:hover { filter: saturate(115%); transform: translateY(-1px); }
  .btn.ghost { border: var(--border); color: var(--text); background: rgba(255,255,255,0.04); }
  .btn.ghost:hover { border-color: transparent; background: rgba(255,255,255,0.08); }
  
  .stats { display: grid; grid-template-columns: repeat(3, minmax(120px,1fr)); gap: 12px; margin-top: 22px; }
  .stat { padding: 14px; border-radius: 14px; background: rgba(255,255,255,0.04); border: var(--border); text-align: center; }
  .stat .num { font-weight: 800; font-size: 1.6rem; background: linear-gradient(90deg, var(--brand), var(--ok)); -webkit-background-clip: text; color: transparent; }
  .stat .label { color: var(--muted); font-size: .9rem; }
  
  /* Hero art */
  .hero-art { position: relative; height: 320px; }
  .orbit { position: absolute; inset: 0; display: grid; place-items: center; }
  .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 12px var(--brand); animation: orbit 12s linear infinite; }
  .dot:nth-child(2){ background: var(--brand-2); animation-duration: 16s; transform-origin: 140px 0; }
  .dot:nth-child(3){ background: var(--ok); animation-duration: 20s; transform-origin: -160px 0; }
  @keyframes orbit { from { transform: rotate(0deg) translateX(120px) rotate(0); } to { transform: rotate(360deg) translateX(120px) rotate(-360deg); } }
  .rings::before, .rings::after {
    content: ""; position: absolute; inset: 50% auto auto 50%; transform: translate(-50%,-50%);
    width: 260px; height: 260px; border-radius: 50%;
    border: 2px dashed rgba(255,255,255,0.15);
    animation: pulse 4s ease-in-out infinite;
  }
  .rings::after { width: 340px; height: 340px; animation-delay: 1s; }
  @keyframes pulse { 0%,100%{ opacity:.5; } 50% { opacity:1; } }
  
  /* Cards & grids */
  .grid { display: grid; gap: var(--gap); }
  .grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .card { padding: 20px; border-radius: var(--radius); background: rgba(255,255,255,0.05); border: var(--border); box-shadow: var(--shadow); }
  .card h3 { margin-top: 0; }
  .checklist { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
  .checklist li { color: var(--text); }
  .checklist i { color: var(--ok); margin-left: 6px; }
  .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
  .chip { padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,0.06); border: var(--border); font-size: 0.9rem; }
  
  /* Skills */
  .skills { display: grid; gap: 14px; }
  .skill { background: rgba(255,255,255,0.04); border: var(--border); border-radius: 12px; padding: 14px; }
  .skill-head { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 8px; }
  .bar { height: 10px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; }
  .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 999px; transform-origin: right; animation: grow 1.4s ease forwards; width: 0; }
  @keyframes grow { to { width: var(--w, 100%); } }
  
  /* Projects */
  .project .thumb { border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; }
  .project .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.6,.2,1); }
  .project .content { padding-top: 12px; }
  .project .tags { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); }
  .project:hover .thumb img { transform: scale(1.06); }
  
  /* Blog */
  .post .link { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); text-decoration: none; }
  .post .link:hover { filter: saturate(120%); }
  
  /* Form */
  .form .field { position: relative; margin-bottom: 14px; }
  .form input, .form textarea {
    width: 100%; padding: 14px 12px; border-radius: 12px; color: var(--text);
    border: var(--border); background: rgba(255,255,255,0.04); outline: none; transition: border .2s ease, box-shadow .2s ease, background .2s;
  }
  .form input:focus, .form textarea:focus { border-color: transparent; box-shadow: 0 0 0 3px rgba(79,156,255,0.35); background: rgba(255,255,255,0.06); }
  .form label {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none;
    transition: .2s ease; background: transparent; padding: 0 6px;
  }
  .form input:not(:placeholder-shown) + label,
  .form input:focus + label,
  .form textarea:not(:placeholder-shown) + label,
  .form textarea:focus + label { top: -8px; font-size: 12px; color: var(--brand); background: var(--bg); border-radius: 8px; }
  .form-note { color: var(--muted); margin-top: 8px; min-height: 1.2em; }
  .w-100 { width: 100%; }
  
  /* Footer */
  .site-footer { text-align: center; color: var(--muted); padding: 40px 16px; }
  
  /* Reveal on scroll */
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
  .reveal.show { opacity: 1; transform: translateY(0); }
  
  /* 3D tilt */
  .tilt { transform-style: preserve-3d; will-change: transform; transition: transform .18s ease; }
  .tilt:hover { transform: perspective(800px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateZ(4px); }
  
  /* Theme transitions */
  :root, :root.light { transition: background-color .4s ease, color .4s ease; }
  
  /* Focus visible */
  :focus-visible { outline: 3px solid rgba(79,156,255,0.6); outline-offset: 2px; border-radius: 10px; }
  
  /* Reduced motion */
  @media (prefers-reduced-motion: reduce) {
    .reveal, .tilt, .hero-art, .bg-mesh, .dot, .rings::before, .rings::after { animation: none !important; transition: none !important; }
  }
  
  /* Responsive */
  @media (max-width: 1024px) {
    .hero { grid-template-columns: 1fr; }
    .hero-art { order: -1; height: 260px; margin-bottom: 8px; }
  }
  @media (max-width: 768px) {
    .grid.two { grid-template-columns: 1fr; }
    .grid.three { grid-template-columns: 1fr; }
    .site-header { margin: 10px; padding: 10px 12px; }
    .logo-circle { width: 52px; height: 52px; }
    .nav-btn, .icon-btn { width: 42px; height: 42px; }
  }
  /* جلوگیری از انتخاب متن و منوی لمس طولانی */
html, body {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
  }
  
  /* اجازه انتخاب برای ورودی‌ها، تکست‌اریاها و هر چیزی با کلاس selectable */
  input, textarea, .selectable {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
  }
  
  /* جلوگیری از درگ تصاویر/لینک‌ها */
  img, a {
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: auto; /* اجازه کلیک، ولی نه درگ */
  }
  
  /* جلوگیری از پرینت (Ctrl+P) یا Print Preview */
  @media print {
    body { display: none !important; }
  }
  

  /* Footer logos */
.subs-logos {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  align-items: center;
  justify-items: center;
}

.subs-logo {
  width: 100%;
  max-width: 180px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border: var(--border);
  border-radius: 12px;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
  position: relative;
  isolation: isolate;
}

:root.light .subs-logo {
  background: rgba(0,0,0,0.04);
}

.subs-logo img {
  max-height: 34px;
  max-width: 80%;
  filter: grayscale(100%) contrast(0.9) brightness(0.95);
  opacity: 0.85;
  transition: filter .25s ease, opacity .25s ease, transform .25s ease;
  pointer-events: none;
}

.subs-logo:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}

.subs-logo:hover img {
  filter: none;
  opacity: 1;
}

/* Tooltip کوچک از data-tooltip */
.subs-logo::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -36px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
:root.light .subs-logo::after {
  background: rgba(0,0,0,0.85);
}
.subs-logo:hover::after { opacity: 1; transform: translateY(0); }

/* بهینه‌سازی موبایل */
@media (max-width: 520px) {
  .subs-logo { height: 56px; }
  .subs-logo img { max-height: 28px; }
}

/* ====== کد اصلی تو ====== */
/* Design tokens */
:root {
  --bg: #0b0f14;
  --surface: rgba(255,255,255,0.06);
  --text: #e6edf3;
  --muted: #a9b1bb;
  --brand: #4f9cff;
  --brand-2: #8a5cff;
  --ok: #19c37d;
  --warn: #f39c12;
  --danger: #ff4d4f;
  --radius: 16px;
  --gap: 24px;
  --blur: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --border: 1px solid rgba(255,255,255,0.12);
}
/* حالت روشن */
:root.light {
  --bg: #f6f8fa;
  --surface: rgba(0,0,0,0.04);
  --text: #0b0f14;
  --muted: #4b5563;
  --brand: #1f6feb;
  --brand-2: #7c3aed;
  --shadow: 0 8px 28px rgba(2,6,23,0.12);
  --border: 1px solid rgba(2,6,23,0.08);
}

/* استایل‌های عمومی */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Vazirmatn", system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* ... بقیه کد اصلی بدون تغییر ... */

/* ====== واکنش‌گرایی پیشرفته ====== */
@media (max-width: 1200px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { order: -1; height: 280px; margin-bottom: 20px; }
}

@media (max-width: 992px) {
  .grid.three { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .site-header { flex-wrap: wrap; gap: 12px; }
}

@media (max-width: 768px) {
  .grid.two, .grid.three, .stats { grid-template-columns: 1fr; }
  .hero { text-align: center; }
  .cta { justify-content: center; }
  .site-header { margin: 8px; padding: 8px 12px; }
  .logo-circle { width: 50px; height: 50px; }
  .nav-btn, .icon-btn { width: 40px; height: 40px; }
}

@media (max-width: 576px) {
  .title { font-size: 1.4rem; }
  .subtitle { font-size: 0.9rem; }
  .btn { padding: 10px 14px; font-size: 0.9rem; }
  .stats .num { font-size: 1.3rem; }
  .subs-logos { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 400px) {
  .title { font-size: 1.2rem; }
  .btn { width: 100%; justify-content: center; }
  .hero-art { height: 200px; }
}
