/* =====================================================================
   رُهام — سیستم طراحی نسخه ۲
   رنگ: مرکب شب + نعنایی/آبی آسمانی | فونت: Vazirmatn + JetBrains Mono
   ===================================================================== */
:root {
  --bg: #090c14; --bg-2: #0d1220; --surface: #111828; --surface-2: #171f33;
  --line: #232d45; --line-2: #2f3b58;
  --text: #e8edf6; --muted: #93a0ba;
  --accent: #62f2a8; --accent-2: #58c4ff;
  --danger: #ff6b7d; --warn: #ffc46b;
  --on-accent: #06120c;
  --font: 'Vazirmatn', Tahoma, 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --r-lg: 20px; --r-md: 14px; --r-sm: 10px;
  --ease: cubic-bezier(.22,.8,.3,1);
  --glow: rgba(98, 242, 168, .45);
  --glow: color-mix(in srgb, var(--accent) 45%, transparent);
  --tint: rgba(98, 242, 168, .1);
  --tint: color-mix(in srgb, var(--accent) 10%, transparent);
}
[data-theme="light"] {
  --bg: #f4f6fb; --bg-2: #eaeef6; --surface: #ffffff; --surface-2: #f0f3f9;
  --line: #dbe1ee; --line-2: #c6cfe2; --text: #0e1424; --muted: #55627d; --on-accent: #04130b;
}
[data-theme="light"] .tech-ico[style*="#f7df1e"], [data-theme="light"] .tech-ico[style*="#e6edf3"], [data-theme="light"] .tech-ico[style*="#fcc624"] { filter: brightness(.7) saturate(1.3); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.8; min-height: 100vh; overflow-x: hidden; text-rendering: optimizeLegibility; }
img, svg, canvas { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-2); }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, textarea, select { font: inherit; color: inherit; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--on-accent); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.text-center { text-align: center; }
.accent { color: var(--accent); }
.tech-ico { color: var(--c, var(--accent)); }
[hidden] { display: none !important; }

/* ---------- پس‌زمینه ---------- */
.site-bg { display: none; position: fixed; inset: 0; z-index: -1; background-image: var(--bg-d); background-size: cover; background-position: var(--bg-pos, center); opacity: var(--bg-opacity, 1); filter: blur(var(--bg-blur, 0)); }
@media (max-width: 820px) { .site-bg { background-image: var(--bg-m, var(--bg-d)); } }
html.ios .site-bg { background-image: var(--bg-i, var(--bg-m, var(--bg-d))); }

/* ---------- چیدمان ---------- */
.container { width: min(1180px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(820px, 100% - 40px); }
.section { padding: 88px 0; }
.page-top { padding-top: 56px; }
.section-band { background: var(--bg-2); border-block: 1px solid var(--line); }
.section-header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 44px; }
.section-tag { color: var(--accent); font-size: .95rem; order: 2; margin-inline-start: auto; }
.section-title { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800; line-height: 1.3; }
.link-more { font-size: .92rem; width: 100%; order: 3; }
.empty { color: var(--muted); padding: 32px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r-md); }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- دکمه‌ها و کنترل‌ها ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 22px; border-radius: 999px; font-weight: 600; font-size: .95rem; border: 1px solid transparent; transition: transform .2s var(--ease), background .2s, border-color .2s, color .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-2); color: var(--on-accent); }
.btn-outline { border-color: var(--line-2); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 7px 16px; font-size: .85rem; }
.btn-lg { padding: 14px 30px; font-size: 1rem; }
.btn-block { width: 100%; }
.round { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--text); transition: border-color .2s, color .2s, background .2s; font-size: 1rem; }
.round:hover { border-color: var(--accent); color: var(--accent); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 18px; border: 1px solid; font-size: .94rem; }
.alert-success { background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); }
.alert-error { background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }

.form { display: grid; gap: 16px; }
.form label, .date-field { display: grid; gap: 6px; font-size: .9rem; color: var(--muted); }
.form label > span, .date-field legend { font-weight: 500; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form input:not([type=checkbox]):not([type=file]), .form textarea, .form select, .filter-bar input, .filter-bar select, .date-row select {
  width: 100%; padding: 12px 14px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-sm); transition: border-color .2s, box-shadow .2s;
}
.form input[type=file] { padding: 10px; background: var(--bg); border: 1px dashed var(--line-2); border-radius: var(--r-sm); color: var(--muted); }
.form input:focus, .form textarea:focus, .form select:focus, .filter-bar input:focus, .filter-bar select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint); }
.date-field { border: 0; } .date-row { display: grid; grid-template-columns: 1fr 1.6fr 1.2fr; gap: 10px; }
.form-card h2 { font-size: 1.15rem; margin-bottom: 18px; }
.form-card + .form-card { margin-top: 24px; }

/* ---------- نوار بالا ---------- */
.topbar { position: sticky; top: 0; z-index: 900; padding-top: calc(env(safe-area-inset-top) + 12px); pointer-events: none; }
.topbar-in { display: flex; align-items: center; gap: 16px; width: min(1240px, 100% - 32px); margin-inline: auto; height: 68px; padding-inline: 10px; background: rgba(9,12,20,.86); background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 14px 34px rgba(0,0,0,.28); pointer-events: auto; transition: box-shadow .3s, border-color .3s; }
[data-theme="light"] .topbar-in { background: rgba(244,246,251,.88); }
.brand { display: inline-flex; align-items: center; gap: 2px; font-weight: 800; font-size: 1.45rem; color: var(--text); direction: ltr; }
.brand:hover { color: var(--text); }
.brand .br { color: var(--accent); font-family: var(--mono); }
.brand-name { direction: rtl; }
.topnav { display: flex; gap: 4px; margin-inline: auto; }
.topnav a { padding: 8px 16px; border-radius: 999px; color: var(--muted); font-size: .95rem; transition: color .2s, background .2s; }
.topnav a:hover { color: var(--text); }
.topnav a.active { color: var(--accent); background: var(--tint); }
.tools { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.topnav + .tools { margin-inline-start: 0; }
.tools-sep { width: 1px; height: 26px; background: var(--line); margin-inline: 4px; }
.avatar-btn img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--accent); object-fit: cover; }

.palette-wrap { position: relative; }
.pop { position: absolute; top: calc(100% + 10px); inset-inline-start: 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 14px; min-width: 190px; box-shadow: 0 18px 50px rgba(0,0,0,.4); z-index: 20; }
.pop-title { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 10px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border-radius: 50%; background: var(--s); border: 2px solid transparent; outline: 1px solid var(--line-2); outline-offset: 2px; transition: transform .2s; }
.swatch:hover { transform: scale(1.12); } .swatch.on { border-color: var(--bg); outline: 2px solid var(--s); }


@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }
@media (max-width: 920px) { .topnav, .desk-only { display: none !important; } .tools { order: -1; margin-inline-start: 0; } .brand { margin-inline-start: auto; } }
@media (max-width: 920px) { body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); } }

/* حالت تمرکز */
html.focus .topbar, html.focus .site-footer, html.focus .bottom-nav { display: none; }
.exit-focus { position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 950; padding: 10px 18px; background: var(--surface); border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.4); font-size: .9rem; }

/* ---------- لودرها ---------- */
.global-loader { position: fixed; inset: 0; background: var(--bg); z-index: 9990; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .25s; }
.global-loader.active { opacity: 1; pointer-events: auto; }
.spinner { width: 44px; height: 44px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.boot { display: none; }
html.booting .boot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; position: fixed; inset: 0; z-index: 10000; background: #04060b; animation: bootOut .01s 8s forwards; }
html.booting .boot.leaving { opacity: 0; transition: opacity .45s; pointer-events: none; }
@keyframes bootOut { to { opacity: 0; visibility: hidden; pointer-events: none; } }
.term { width: min(94vw, 660px); background: #0b101c; border: 1px solid #25304a; border-radius: 12px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(98,242,168,.06); }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: #101728; border-bottom: 1px solid #25304a; direction: ltr; }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; } .term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-title { margin-inline-start: 12px; font: 12px var(--mono); color: #6f7d99; }
.term-body { margin: 0; padding: 18px 20px; min-height: 270px; font: 13.5px/1.75 var(--mono); color: #b8c4dc; white-space: pre-wrap; text-align: left; }
.term-body .ok { color: #62f2a8; } .term-body .wait { color: #ffc46b; } .term-body .dim { color: #5d6b88; } .term-body .pr { color: #58c4ff; }
.term-body .cur { display: inline-block; width: 8px; height: 15px; background: #62f2a8; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
.boot-hint { font-size: 11.5px; color: #4d5a76; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 64px 0 80px; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 56px 56px; opacity: .35; mask-image: radial-gradient(70% 60% at 30% 30%, #000, transparent 75%); -webkit-mask-image: radial-gradient(70% 60% at 30% 30%, #000, transparent 75%); pointer-events: none; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.prompt { color: var(--muted); font-size: .95rem; margin-bottom: 14px; } .prompt span { color: var(--accent); }
.hero-title { font-size: clamp(3.2rem, 10vw, 6.2rem); font-weight: 900; line-height: 1.05; letter-spacing: -.01em; margin-bottom: 10px; }
.hero-sub { font-size: clamp(1.1rem, 2.6vw, 1.45rem); font-weight: 500; margin-bottom: 14px; }
.hero-role { color: var(--accent); font-size: .98rem; min-height: 1.8em; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.role-pre { color: var(--muted); }
.caret { width: 8px; height: 1.1em; background: var(--accent); animation: blink 1s steps(1) infinite; }
.hero-bio { color: var(--muted); max-width: 54ch; margin-bottom: 30px; font-size: 1.04rem; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-visual { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.stage-frame { position: relative; width: min(300px, 72vw); aspect-ratio: 1; display: grid; place-items: center; flex: none; }
.stage-frame::before, .stage-frame::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 1px dashed var(--line-2); opacity: .55; }
.stage-frame::before { animation: spin 50s linear infinite; }
.stage-frame::after { inset: 14px; border-style: solid; border-color: var(--line); animation: spin 38s linear infinite reverse; }
.stage-ring { position: absolute; inset: -10px; border-radius: 50%; background: radial-gradient(closest-side, var(--tint), transparent 72%); pointer-events: none; }
.three-stage { position: relative; width: 78%; height: 78%; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 14%, var(--bg-2)), var(--bg-2) 70%); box-shadow: inset 0 0 0 1px var(--line-2), 0 20px 48px rgba(0,0,0,.35); }
.three-stage canvas { width: 100% !important; height: 100% !important; }
.stage-fallback { position: absolute; inset: 0; margin: auto; width: 56%; max-width: 160px; fill: none; stroke: var(--accent); stroke-width: .8; opacity: .55; animation: spin 40s linear infinite; }
.three-stage.ready .stage-fallback { display: none; }
.gh-card { width: min(360px, 100%); background: rgba(17,24,40,.92); background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.35); animation: cardIn .6s var(--ease) both; }
.gh-header { display: flex; align-items: center; gap: 14px; }
.gh-header img { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--accent); }
.gh-header h3 { font-size: 1.02rem; line-height: 1.3; } .gh-username { color: var(--muted); font-size: .85rem; font-family: var(--mono); direction: ltr; text-align: right; }
.gh-bio { margin: 12px 0; font-size: .88rem; color: var(--muted); }
.gh-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.gh-stats div { text-align: center; font-size: .75rem; color: var(--muted); background: var(--bg); border-radius: var(--r-sm); padding: 8px 4px; }
.gh-stats span { display: block; font-size: 1.1rem; font-weight: 700; color: var(--text); font-family: var(--mono); }
.gh-link { display: block; text-align: center; padding: 9px; border-radius: var(--r-sm); background: var(--tint); font-size: .9rem; }
.gh-link:hover { background: var(--accent); color: var(--on-accent); }
.gh-loading { color: var(--muted); font-size: .9rem; text-align: center; padding: 8px; }
.dots::after { content: ''; animation: dots 1.4s steps(4) infinite; } @keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
@media (max-width: 920px) { .hero { padding: 36px 0 56px; } .hero-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- فعالیت‌های اخیر ---------- */
.now-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.now-card { display: flex; gap: 16px; align-items: flex-start; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); transition: transform .35s var(--ease), border-color .35s, box-shadow .35s; }
.now-card:hover { transform: translateY(-5px); border-color: var(--line); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: 0 18px 40px rgba(0,0,0,.22); }
.now-card:hover .icon-tile { transform: scale(1.12) rotate(-6deg); }
.icon-tile { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--tint); color: var(--accent); font-size: 1.15rem; transition: transform .35s var(--ease); }
.now-card h3 { font-size: 1rem; margin-bottom: 4px; } .now-card p { font-size: .9rem; }

/* ---------- سفر من: مسیر منحنی ---------- */
.journey { position: relative; }
.journey-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.j-track { fill: none; stroke: var(--line-2); stroke-width: 2; stroke-dasharray: 2 9; stroke-linecap: round; }
.j-draw { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; filter: drop-shadow(0 0 7px var(--glow)); }
.j-head { fill: var(--accent); filter: drop-shadow(0 0 10px var(--accent)); opacity: 0; }
.journey.ready .j-head { opacity: 1; }
.j-list { position: relative; display: flex; flex-direction: column; gap: 56px; padding-block: 10px; }
.j-item { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 18px; }
.j-node { position: relative; z-index: 1; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font-size: 1.25rem; color: var(--muted); background: var(--bg-2); border: 2px solid var(--line-2); transition: border-color .4s, color .4s, box-shadow .4s, transform .5s var(--ease); }
.j-item:nth-child(odd) .j-node { transform: translateX(10px); } .j-item:nth-child(even) .j-node { transform: translateX(-10px); }
.j-item.on .j-node { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 6px var(--tint), 0 0 26px var(--glow); }
.j-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; transition: opacity .6s var(--ease), transform .6s var(--ease), border-color .4s; }
.j-item.on .j-card { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.j-chapter { display: inline-block; font-size: .78rem; color: var(--accent); margin-bottom: 6px; }
.j-card h3 { font-size: 1.2rem; line-height: 1.4; }
.j-desc { font-weight: 500; margin-top: 2px; } .j-story { margin-top: 10px; font-size: .92rem; line-height: 1.95; }
html.js .journey.ready .j-card { opacity: 0; transform: translateX(-26px); }
html.js .journey.ready .j-item.on .j-card { opacity: 1; transform: none; }
html.js .journey.ready .j-item:not(.on) .j-node { transform: scale(.85); opacity: .6; }
@media (min-width: 880px) {
  .j-list { gap: 40px; }
  .j-item { grid-template-columns: 1fr 96px 1fr; gap: 0; }
  .j-node { grid-column: 2; grid-row: 1; justify-self: center; width: 68px; height: 68px; }
  .j-item:nth-child(odd) .j-node { transform: translateX(34px); } .j-item:nth-child(even) .j-node { transform: translateX(-34px); }
  .j-item:nth-child(odd) .j-card { grid-column: 1; margin-inline-end: 32px; } .j-item:nth-child(even) .j-card { grid-column: 3; margin-inline-start: 32px; }
  html.js .journey.ready .j-item:nth-child(odd) .j-card { transform: translateX(40px); } html.js .journey.ready .j-item:nth-child(even) .j-card { transform: translateX(-40px); }
  html.js .journey.ready .j-item.on .j-card { transform: none; }
  html.js .journey.ready .j-item:nth-child(odd):not(.on) .j-node { transform: translateX(34px) scale(.85); } html.js .journey.ready .j-item:nth-child(even):not(.on) .j-node { transform: translateX(-34px) scale(.85); }
}

/* ---------- مهارت‌ها ---------- */
.skills-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.radar-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; }
.radar svg { width: 100%; height: auto; direction: ltr; }
.radar .ring { fill: none; stroke: var(--line); stroke-width: 1; } .radar .axis { stroke: var(--line); stroke-width: 1; }
.radar .area { fill: var(--accent); fill-opacity: .16; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.radar .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.radar text { fill: var(--text); font: 13px var(--font); }
.skill-bars { display: grid; gap: 22px; padding-top: 6px; }
.skill-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.skill-name { display: inline-flex; align-items: center; gap: 10px; font-size: 1.12rem; font-weight: 500; direction: ltr; }
.skill-name .tech-ico { font-size: 1.35rem; }
.skill-level { color: var(--accent); font-size: 1.05rem; }
.skill-track { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.skill-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width 1.3s var(--ease); }
.skill-row.in .skill-fill { width: var(--w); }
html:not(.js) .skill-fill { width: var(--w); }
@media (max-width: 880px) { .skills-layout { grid-template-columns: 1fr; } }

/* ---------- پروژه‌ها ---------- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 22px; }
.project-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; transition: border-color .3s, transform .35s var(--ease), box-shadow .35s; }
.project-card:hover { border-color: var(--accent); transform: translateY(-6px); box-shadow: 0 22px 46px rgba(0,0,0,.28); }
.project-thumb { display: block; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.project-card:hover .project-thumb img { transform: scale(1.04); }
.thumb-ph { display: grid; place-items: center; height: 100%; background: radial-gradient(circle at 30% 20%, var(--tint), transparent 60%), var(--surface-2); }
.project-body { display: flex; flex-direction: column; gap: 8px; padding: 20px; flex: 1; }
.project-meta { display: flex; align-items: center; gap: 12px; font-size: .78rem; color: var(--muted); }
.project-body h3 { font-size: 1.12rem; line-height: 1.5; } .project-body h3 a { color: var(--text); } .project-body h3 a:hover { color: var(--accent); }
.project-body p { font-size: .92rem; flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; font-size: .8rem; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; direction: ltr; }
.chips-lg .chip { font-size: .9rem; padding: 6px 14px; }
.filter-bar { display: grid; grid-template-columns: 1fr 220px auto; gap: 12px; margin-bottom: 32px; }
.filter-input { position: relative; display: block; } .filter-input i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); } .filter-input input { padding-inline-start: 40px !important; }
@media (max-width: 700px) { .filter-bar { grid-template-columns: 1fr; } }

/* ---------- صفحه پروژه + مرورگر ریپو ---------- */
.link-back { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); margin-bottom: 26px; font-size: .92rem; }
.pd-head h1 { font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.25; margin: 8px 0; }
.lead { font-size: 1.1rem; max-width: 70ch; }
.pd-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 28px; }
.pd-cover { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); margin-bottom: 24px; } .pd-cover img { width: 100%; }
.prose { margin: 28px 0; max-width: 75ch; color: var(--text); }
.repo { margin-top: 40px; display: grid; gap: 20px; }
.repo-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stat-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: .86rem; }
.stat-pill i { color: var(--accent); } .stat-pill b { font-family: var(--mono); font-weight: 600; }
.lang-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-2); direction: ltr; }
.lang-bar span { display: block; height: 100%; }
.lang-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: .82rem; color: var(--muted); direction: ltr; }
.lang-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 6px; }
.repo-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.repo-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .9rem; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-family: var(--mono); font-size: .86rem; }
.crumbs button { color: var(--accent); padding: 2px 6px; border-radius: 6px; } .crumbs button:hover { background: var(--tint); } .crumbs .sep { color: var(--muted); } .crumbs .cur { color: var(--text); padding: 2px 6px; }
.repo-ref { font-size: .8rem; color: var(--muted); padding: 3px 10px; border: 1px solid var(--line-2); border-radius: 999px; }
.repo-commit { display: flex; gap: 12px; align-items: center; padding: 10px 16px; font-size: .85rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.repo-commit b { color: var(--text); font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: left; }
.file-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 11px 16px; border-bottom: 1px solid var(--line); text-align: start; transition: background .15s; direction: ltr; }
.file-row:last-child { border-bottom: 0; } .file-row:hover { background: var(--surface-2); }
.file-row i { width: 18px; text-align: center; color: var(--muted); } .file-row.dir i { color: var(--accent-2); }
.file-row .fname { flex: 1; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; } .file-row .fsize { font-size: .76rem; color: var(--muted); font-family: var(--mono); }
.file-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .85rem; direction: ltr; }
.file-head .acts { display: flex; gap: 8px; } .file-head .btn { padding: 4px 12px; font-size: .78rem; }
.code { margin: 0; overflow: auto; max-height: 640px; padding: 14px 0; font: 13px/1.65 var(--mono); direction: ltr; text-align: left; background: var(--bg); tab-size: 4; counter-reset: ln; }
.code .ln { display: block; padding: 0 16px 0 0; white-space: pre; min-width: max-content; } .code .ln::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 52px; padding-right: 14px; margin-right: 14px; text-align: right; color: var(--muted); opacity: .55; border-right: 1px solid var(--line); user-select: none; }
.tk-c { color: #6b7a99; font-style: italic; } .tk-s { color: #8fdca8; } .tk-n { color: #ffc46b; } .tk-k { color: #c8a4ff; }
.file-note { padding: 28px; text-align: center; color: var(--muted); } .file-img { padding: 20px; display: grid; place-items: center; background: var(--bg); } .file-img img { max-height: 520px; object-fit: contain; }
.markdown { padding: 24px 28px; direction: ltr; text-align: left; line-height: 1.75; overflow-wrap: anywhere; }
.markdown h1, .markdown h2 { padding-bottom: .3em; border-bottom: 1px solid var(--line); margin: 1.4em 0 .7em; } .markdown h1 { font-size: 1.7rem; } .markdown h2 { font-size: 1.35rem; } .markdown h3 { font-size: 1.12rem; margin: 1.2em 0 .5em; }
.markdown p, .markdown ul, .markdown ol, .markdown pre, .markdown table, .markdown blockquote { margin-bottom: 1em; }
.markdown ul { list-style: disc; padding-left: 1.6em; } .markdown ol { list-style: decimal; padding-left: 1.6em; }
.markdown code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: .15em .4em; border-radius: 6px; }
.markdown pre { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; overflow: auto; } .markdown pre code { background: none; padding: 0; }
.markdown img { max-width: 100%; display: inline-block; border-radius: 6px; } .markdown blockquote { border-left: 3px solid var(--line-2); padding-left: 14px; color: var(--muted); }
.markdown table { border-collapse: collapse; display: block; overflow: auto; } .markdown th, .markdown td { border: 1px solid var(--line); padding: 6px 12px; } .markdown a { text-decoration: underline; text-underline-offset: 3px; }
.markdown .anchor { display: none; }

/* ---------- FAQ ---------- */
.faq-list { display: grid; gap: 12px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); transition: border-color .2s; }
.faq-item.open { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.faq-q { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; padding: 18px 22px; text-align: start; font-weight: 600; }
.faq-q i { color: var(--accent); transition: transform .3s var(--ease); } .faq-item.open .faq-q i { transform: rotate(45deg); }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); } .faq-a > div { overflow: hidden; } .faq-a p { padding: 0 22px 20px; color: var(--muted); }
.faq-item.open .faq-a { grid-template-rows: 1fr; }

.cta-band { background: radial-gradient(60% 120% at 80% 0%, var(--tint), transparent), var(--bg-2); border-top: 1px solid var(--line); }
.cta-in { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; } .cta-in .section-title { margin-bottom: 6px; }

/* ---------- احراز هویت / پروفایل / تماس ---------- */
.auth-page { min-height: 70vh; display: grid; place-items: center; }
.auth-card { width: min(440px, 100%); } .auth-card h1 { font-size: 1.5rem; margin-bottom: 22px; } .auth-alt { margin-top: 20px; text-align: center; color: var(--muted); font-size: .92rem; }
.profile-head { display: flex; align-items: center; gap: 22px; margin-bottom: 28px; flex-wrap: wrap; } .profile-head h1 { font-size: 1.7rem; line-height: 1.3; }
.profile-head-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.alert-preview { background: rgba(88,196,255,.12); background: color-mix(in srgb, var(--accent-2) 12%, transparent); border: 1px solid rgba(88,196,255,.4); border: 1px solid color-mix(in srgb, var(--accent-2) 40%, transparent); color: var(--accent-2); display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 20px; font-size: .92rem; }
.alert-preview a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; margin-inline-start: auto; }
.profile-avatar { width: 88px; height: 88px; border-radius: 50%; border: 3px solid var(--accent); object-fit: cover; }
.contact-wrap { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; align-items: start; } .contact-info .section-title { margin: 8px 0 14px; }
.contact-list { margin-top: 26px; display: grid; gap: 14px; } .contact-list li { display: flex; align-items: center; gap: 14px; } .contact-list i { width: 40px; height: 40px; display: grid; place-items: center; background: var(--tint); color: var(--accent); border-radius: 12px; }
@media (max-width: 880px) { .contact-wrap { grid-template-columns: 1fr; gap: 28px; } .form-row { grid-template-columns: 1fr; } }
.error-page { min-height: 62vh; display: grid; place-items: center; } .err-code { font-size: clamp(5rem, 22vw, 11rem); font-weight: 600; line-height: 1; color: var(--accent); opacity: .9; margin-bottom: 8px; } .error-page .btn { margin-top: 22px; }

/* ---------- انجمن ---------- */
.chat-container { display: grid; grid-template-columns: 260px 1fr; gap: 20px; height: min(72vh, 720px); min-height: 480px; }
.chat-side h3 { font-size: .95rem; margin-bottom: 14px; } .online-list { display: grid; gap: 10px; font-size: .92rem; } .online-list li { display: flex; align-items: center; gap: 10px; } .online-list li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.chat-main { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; background: var(--surface-2); border-bottom: 1px solid var(--line); } .chat-head h2 { font-size: 1.05rem; } .status { font-size: .82rem; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); display: inline-block; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; flex-direction: column; max-width: min(78%, 520px); gap: 4px; }
.msg.own { align-self: flex-start; } .msg:not(.own) { align-self: flex-end; }
.msg-name { font-size: .76rem; color: var(--muted); padding-inline: 6px; }
.msg-bubble { background: var(--surface-2); padding: 10px 16px; border-radius: 16px 16px 16px 4px; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.own .msg-bubble { background: var(--accent); color: var(--on-accent); border-radius: 16px 16px 4px 16px; }
.msg-time { font-size: .7rem; color: var(--muted); padding-inline: 6px; }
.chat-form { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); background: var(--surface-2); } .chat-form input { flex: 1; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); } .chat-form input:focus { outline: none; border-color: var(--accent); }
@media (max-width: 800px) { .chat-container { grid-template-columns: 1fr; } .chat-side { display: none; } }

/* ---------- اتاق کار ---------- */
.ws { position: relative; }
.ws-stage { position: relative; height: calc(100svh - 77px); min-height: 520px; overflow: hidden; background: radial-gradient(80% 70% at 50% 40%, #131b30, #070a12); touch-action: none; }
.ws-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; } .ws-stage canvas:active { cursor: grabbing; }
.ws-title { position: absolute; top: 22px; inset-inline-start: 24px; pointer-events: none; color: #e8edf6; } .ws-title h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.2; }
.ws-hud { position: absolute; top: 22px; inset-inline-end: 22px; display: grid; gap: 10px; }
.ws-hud .round { background: rgba(17,24,40,.8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #e8edf6; border-color: #2f3b58; } .ws-hud .round.on { color: var(--accent); border-color: var(--accent); }
.ws-hint { position: absolute; bottom: 18px; inset-inline: 18px; margin-inline: auto; width: fit-content; max-width: calc(100% - 36px); padding: 8px 18px; background: rgba(17,24,40,.8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid #2f3b58; border-radius: 999px; color: #93a0ba; font-size: .82rem; text-align: center; pointer-events: none; }
.ws-hint i { color: var(--accent); margin-inline-end: 6px; }
.ws-panel { position: absolute; bottom: 70px; inset-inline-start: 24px; width: min(380px, calc(100% - 48px)); max-height: 58%; overflow: auto; background: rgba(17,24,40,.94); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid #2f3b58; border-radius: var(--r-lg); padding: 22px; color: #e8edf6; animation: drop .3s var(--ease); }
.ws-panel h2 { font-size: 1.15rem; margin-bottom: 10px; padding-inline-end: 44px; } .ws-panel p { color: #a9b5cd; font-size: .92rem; margin-bottom: 10px; }
.ws-panel .panel-close { position: absolute; top: 14px; inset-inline-end: 14px; width: 34px; height: 34px; background: transparent; color: #e8edf6; border-color: #2f3b58; }
.ws-panel ul { display: grid; gap: 8px; } .ws-panel li a, .ws-panel li > span { display: flex; justify-content: space-between; gap: 10px; padding: 9px 14px; background: #0d1220; border: 1px solid #25304a; border-radius: var(--r-sm); color: #e8edf6; font-size: .9rem; } .ws-panel li a:hover { border-color: var(--accent); color: var(--accent); }
.ws-loading { position: absolute; inset: 0; display: grid; place-items: center; background: #070a12; color: #93a0ba; transition: opacity .5s; } .ws-loading.gone { opacity: 0; pointer-events: none; }
@media (max-width: 700px) { .ws-panel { inset-inline: 12px; width: auto; bottom: 64px; } .ws-hint { font-size: .74rem; } }

/* ---------- فوتر ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 48px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 32px; align-items: start; } .footer-brand p { margin-top: 8px; font-size: .92rem; }
.footer-links { display: grid; gap: 6px; } .footer-links a { color: var(--muted); font-size: .92rem; } .footer-links a:hover { color: var(--accent); }
.footer-social { display: flex; gap: 10px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; }
.footer-bottom .credit-mark { color: var(--accent-2); font-weight: 700; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }

.toast { position: fixed; bottom: 24px; inset-inline: 0; margin-inline: auto; width: fit-content; max-width: 90vw; padding: 12px 22px; background: var(--surface); border: 1px solid var(--accent); border-radius: 999px; z-index: 9000; opacity: 0; transform: translateY(20px); pointer-events: none; transition: .3s; } .toast.show { opacity: 1; transform: none; }

/* ---------- ظاهر شدن ملایم (فقط برای چند عنصر) ---------- */
html.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0ms); }
html.js .reveal.revealed, html.reveal-all .reveal { opacity: 1; transform: none; }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.reveal-stagger > .reveal:nth-child(1) { --d: 0ms; } .reveal-stagger > .reveal:nth-child(2) { --d: 70ms; } .reveal-stagger > .reveal:nth-child(3) { --d: 140ms; }
.reveal-stagger > .reveal:nth-child(4) { --d: 210ms; } .reveal-stagger > .reveal:nth-child(5) { --d: 280ms; } .reveal-stagger > .reveal:nth-child(6) { --d: 350ms; }
.reveal-stagger > .reveal:nth-child(n+7) { --d: 420ms; }
html.reveal-all .journey.ready .j-card { opacity: 1 !important; transform: none !important; }
html.reveal-all .skill-fill { width: var(--w); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- ناوبار شناور پایین (موبایل) ----------
   نکته مهم: ماسکِ «چاله» فقط روی لایه پس‌زمینه (bn-backdrop) اعمال می‌شود، نه روی خود ناوبار؛
   در غیر این صورت آیکون فعال که داخل همان ناحیه قرار می‌گیرد هم توسط ماسک پاک می‌شود (باگ قبلی). */
.bottom-nav {
  position: fixed; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 950; display: none; align-items: center; justify-content: space-around;
  height: 64px; padding-inline: 4px; isolation: isolate;
}
.bn-backdrop {
  position: absolute; inset: 0; z-index: 0; border-radius: 999px; pointer-events: none;
  background: rgba(17,24,40,.94); background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line-2); box-shadow: 0 18px 44px rgba(0,0,0,.4);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  -webkit-mask-image: radial-gradient(circle 25px at var(--nx, -999px) -2px, transparent 24px, black 26px);
  mask-image: radial-gradient(circle 25px at var(--nx, -999px) -2px, transparent 24px, black 26px);
  transition: background .3s;
}
[data-theme="light"] .bn-backdrop { background: rgba(255,255,255,.92); }
.bn-item { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; color: var(--muted); font-size: .66rem; padding: 4px 2px; border-radius: 18px; transition: color .35s var(--ease), transform .4s var(--ease); }
.bn-ico { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; font-size: 1.05rem; transition: background .4s var(--ease), color .4s, transform .4s var(--ease), box-shadow .4s; }
.bn-label { transition: opacity .2s, transform .2s; white-space: nowrap; }
.bn-item.active { color: var(--accent); transform: translateY(-25px); animation: bnPop .5s var(--ease); }
.bn-item.active .bn-ico {
  background: var(--accent); color: var(--on-accent); transform: scale(1.06);
  box-shadow: 0 10px 22px var(--glow), 0 0 0 5px var(--bg), 0 0 0 8px var(--line-2);
}
.bn-item.active .bn-label { opacity: 0; transform: translateY(4px); position: absolute; pointer-events: none; }
/* دکمه «خانه» در مرکز ناوبار — همیشه کمی برجسته‌تر، مثل یک دکمه اصلی شناور */
.bn-home .bn-ico { width: 46px; height: 46px; font-size: 1.18rem; background: var(--surface-2); box-shadow: 0 0 0 5px var(--bg); transform: translateY(-6px); }
.bn-home:not(.active) { color: var(--text); }
.bn-home.active .bn-ico { transform: translateY(-6px) scale(1.08); }
@keyframes bnPop { 0% { transform: translateY(0) scale(.85); } 60% { transform: translateY(-29px) scale(1.08); } 100% { transform: translateY(-25px) scale(1); } }
@media (max-width: 920px) { .bottom-nav { display: flex; } }
@media (prefers-reduced-motion: reduce) { .bn-item.active { animation: none; } }
