/* miladrajabi.com — یک ستون باریک وسط صفحه، گرید چشمک‌زن بالای هیرو، داک شناور پایین.
   سیاه و سفید؛ نارنجی لوگو فقط برای تأکیدهای کوچک. */
@font-face { font-family: "Estedad"; src: url(/assets/fonts/estedad.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist"; src: url(/assets/fonts/geist-latin.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(/assets/fonts/geist-mono-latin.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #0a0a0b;
  --muted: #66666e;
  --line: #e7e7ea;
  --soft: #f4f4f5;
  --card: #ffffff;
  --accent: #f26a0f;
  --accent-2: #ffb020;
  --grid: 10, 10, 11;
  --cal0: #ededf0; --cal1: #fed7aa; --cal2: #fb923c; --cal3: #ea580c; --cal4: #9a3412;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 28px -14px rgba(0,0,0,.16);
  --f-fa: "Estedad", Tahoma, sans-serif;
  --f-en: "Geist", "Estedad", ui-sans-serif, system-ui, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --f-body: var(--f-fa);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #09090b; --fg: #f4f4f5; --muted: #a0a0a8; --line: #232327; --soft: #141417; --card: #0e0e11;
  --accent: #ff8a2a; --accent-2: #ffc04d; --grid: 244, 244, 245;
  --cal0: #18181b; --cal1: #4a2410; --cal2: #9a3f12; --cal3: #ea6a1c; --cal4: #ffb36b;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -14px rgba(0,0,0,.7);
} }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09090b; --fg: #f4f4f5; --muted: #a0a0a8; --line: #232327; --soft: #141417; --card: #0e0e11;
  --accent: #ff8a2a; --accent-2: #ffc04d; --grid: 244, 244, 245;
  --cal0: #18181b; --cal1: #4a2410; --cal2: #9a3f12; --cal3: #ea6a1c; --cal4: #ffb36b;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -14px rgba(0,0,0,.7);
}
html[lang="en"] { --f-body: var(--f-en); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 15.5px; line-height: 1.95; -webkit-font-smoothing: antialiased; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
/* عوض شدن تم: دایره‌ای از دکمه‌ی داک باز می‌شود (View Transitions در site.js) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html[lang="en"] body { line-height: 1.7; }
::selection { background: var(--accent); color: #fff; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* لوگوی روشن/تیره بسته به تم */
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}

.page { position: relative; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-top: env(safe-area-inset-top, 0px); padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
.col { max-width: 680px; margin: 0 auto; }
#flicker { position: absolute; inset: 0 0 auto; width: 100%; height: 280px; pointer-events: none; -webkit-mask-image: linear-gradient(to bottom, #000, rgba(0,0,0,.55) 45%, transparent); mask-image: linear-gradient(to bottom, #000, rgba(0,0,0,.55) 45%, transparent); }

/* ورود نرم با بلور */
.bf { animation: blurFade .7s cubic-bezier(.21,.6,.35,1) both; animation-delay: calc(var(--d, 0) * 90ms + 80ms); }
.reveal.in { animation: blurFade .7s cubic-bezier(.21,.6,.35,1) both; }
@keyframes blurFade { from { opacity: 0; filter: blur(8px); transform: translateY(-8px); } }

/* hero */
.hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding-top: 120px; }
.hero-text { min-width: 0; }
.hero h1 { font-weight: 800; font-size: clamp(36px, 7vw, 54px); line-height: 1.35; letter-spacing: -.01em; }
html[lang="en"] .hero h1 { letter-spacing: -.035em; line-height: 1.1; }
.hero h1 .w { display: inline-block; animation: blurFade .7s cubic-bezier(.21,.6,.35,1) both; animation-delay: calc(var(--i) * 110ms + 100ms); }
.hero .sub { color: var(--muted); font-size: clamp(16px, 2.4vw, 19px); margin-top: 10px; max-width: 40ch; }
.highlights { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.highlights li { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; line-height: 1.8; padding: 2px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); white-space: nowrap; }
.highlights li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-2), var(--accent)); }

/* حلقه‌ی چرخان دور لوگو */
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.avatar { position: relative; width: 124px; height: 124px; border-radius: 50%; flex: none; padding: 3px; isolation: isolate; background: var(--line); }
.avatar::before, .avatar::after { content: ""; position: absolute; border-radius: 50%; animation: ring 4.5s linear infinite; pointer-events: none; }
.avatar::before { inset: 0; z-index: -1; background: conic-gradient(from var(--ang), transparent 0deg, var(--accent) 80deg, var(--accent-2) 130deg, transparent 180deg, transparent 220deg, var(--accent) 300deg, var(--accent-2) 340deg, transparent 360deg); }
.avatar::after { inset: -12px; z-index: -2; background: conic-gradient(from var(--ang), transparent, color-mix(in srgb, var(--accent) 40%, transparent) 110deg, transparent 180deg, color-mix(in srgb, var(--accent-2) 30%, transparent) 290deg, transparent); filter: blur(16px); }
@keyframes ring { to { --ang: 360deg; } }
.avatar img { position: relative; width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--bg); object-fit: cover; }
@media (max-width: 560px) {
  .hero { flex-direction: column-reverse; align-items: center; text-align: center; gap: 22px; padding-top: 72px; }
  .hero .sub { margin-inline: auto; }
  .highlights { justify-content: center; }
  .avatar { width: 104px; height: 104px; }
}

section { margin-top: 64px; }
.h2 { font-weight: 800; font-size: 20px; margin-bottom: 10px; }
.about-body { display: grid; gap: 12px; color: var(--muted); }
.about-body b { color: var(--fg); font-weight: 650; }

/* نوار مهارت‌ها */
.marquee { display: grid; gap: 10px; overflow: hidden; direction: ltr; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.track { display: flex; width: max-content; animation: mq 46s linear infinite; }
.track.rev { animation-direction: reverse; animation-duration: 54s; }
.set { display: flex; gap: 8px; padding-right: 8px; }
.marquee:hover .track { animation-play-state: paused; }
@keyframes mq { to { transform: translateX(-50%); } }
.badge { display: inline-flex; align-items: center; font: 500 13px/1.6 var(--f-en); padding: 4px 11px; border-radius: 7px; background: var(--fg); color: var(--bg); white-space: nowrap; }
.track.rev .badge { background: var(--soft); color: var(--fg); border: 1px solid var(--line); }

/* سرتیتر وسط‌چین بخش‌ها */
.intro { text-align: center; display: grid; justify-items: center; gap: 12px; margin-bottom: 36px; }
.pill { font-size: 13px; font-weight: 600; line-height: 1.7; background: var(--fg); color: var(--bg); padding: 2px 12px; border-radius: 8px; }
.intro h2 { font-weight: 800; font-size: clamp(28px, 5vw, 42px); line-height: 1.35; letter-spacing: -.01em; }
html[lang="en"] .intro h2 { letter-spacing: -.03em; line-height: 1.15; }
.intro p { color: var(--muted); max-width: 46ch; font-size: 16.5px; }

/* پروژه‌ها */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.proj-dots { display: none; }
.proj { border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .3s, transform .3s cubic-bezier(.21,.6,.35,1); min-width: 0; }
.proj:hover, .proj.on { box-shadow: var(--shadow); transform: translateY(-2px); }
.proj-vis { position: relative; height: 140px; border-bottom: 1px solid var(--line); background: var(--soft); display: grid; place-items: center; overflow: hidden; isolation: isolate; }
.proj-vis canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%); mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%); }
.mark { display: inline-flex; align-items: center; gap: 6px; font: 500 14px var(--f-mono); direction: ltr; padding: 5px 12px; border-radius: 8px; background: color-mix(in srgb, var(--bg) 82%, transparent); border: 1px solid var(--line); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: transform .4s cubic-bezier(.21,.6,.35,1); max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mark svg { width: 13px; height: 13px; fill: currentColor; flex: none; }
.proj:hover .mark, .proj.on .mark { transform: scale(1.06); }
.proj-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.proj-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.proj h3 { font: 600 16px/1.5 var(--f-en); direction: ltr; }
.state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.state i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.16); }
.s-dev i { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.16); }
.s-private i, .s-internal i { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.s-oss i { background: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,.16); }
.s-off i { background: var(--muted); box-shadow: none; }
.proj p { color: var(--muted); font-size: 14px; line-height: 1.85; }
html[lang="en"] .proj p { line-height: 1.6; }
.is-off .proj-vis { filter: grayscale(1); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.tag { font: 500 11px/1.7 var(--f-en); padding: 0 7px; border-radius: 5px; background: var(--soft); border: 1px solid var(--line); color: var(--muted); }
.plinks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.plink { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; line-height: 1.9; padding: 1px 10px; border-radius: 7px; background: var(--fg); color: var(--bg); transition: opacity .2s; }
.plink:hover { opacity: .82; }
.plink svg { width: 12px; height: 12px; fill: currentColor; }

/* موبایل: پروژه‌ها اسلایدر افقی */
@media (max-width: 620px) {
  .projects { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84%; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; margin-inline: -16px; padding: 4px 16px 8px; scroll-padding-inline: 16px; scrollbar-width: none; }
  .projects::-webkit-scrollbar { display: none; }
  .proj { scroll-snap-align: start; }
  .proj:hover, .proj.on { transform: none; }
  .proj-vis { height: 96px; }
  .proj p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .proj-dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
  .proj-dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--line); transition: width .3s, background-color .3s; }
  .proj-dots i.on { width: 18px; background: var(--fg); }
}

/* گیت‌هاب */
.gh-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 14px; }
.gh-head .h2 { margin: 0; }
.gh-head span { color: var(--muted); font-size: 14px; }
.gh-head b { color: var(--fg); font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-scroll { overflow-x: auto; direction: ltr; padding-bottom: 4px; scrollbar-width: thin; }
.cal { position: relative; display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 10px); grid-auto-columns: 10px; gap: 2.5px; width: max-content; margin-inline: auto; overflow: hidden; isolation: isolate; }
.cal i { position: relative; border-radius: 2px; background: var(--cal0); }
.cal i.pad { visibility: hidden; }
.cal i[data-l="1"] { background: var(--cal1); } .cal i[data-l="2"] { background: var(--cal2); } .cal i[data-l="3"] { background: var(--cal3); } .cal i[data-l="4"] { background: var(--cal4); }
.cal.wave i { animation: cell .6s ease-out both; animation-delay: calc(var(--c) * 10ms); }
@keyframes cell { from { opacity: 0; } }
/* نوار نور دائمی روی کل نقشه: یک لایه که فقط جابه‌جا می‌شود، اندازه‌ی هیچ خانه‌ای عوض نمی‌شود و اسکرول تکان نمی‌خورد */
.cal::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, transparent 38%, color-mix(in srgb, var(--accent-2) 85%, transparent) 50%, transparent 62%); mix-blend-mode: overlay; transform: translateX(-100%); }
.cal.wave::after { animation: sweep 6s cubic-bezier(.45, 0, .55, 1) 1s infinite; }
.cal:not(.run)::after, .cal:not(.run) i.now::after { animation-play-state: paused; }
@keyframes sweep { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
/* امروز: قاب ثابت و چشمک داخل خانه */
.cal i.now { outline: 1.5px solid var(--accent); outline-offset: 1px; }
.cal i.now::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--accent-2); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0; } }
.gh-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.gh-foot a { border-bottom: 1px solid var(--line); font-family: var(--f-mono); }
.gh-foot a:hover { color: var(--fg); border-color: var(--fg); }

/* تماس */
.contact { position: relative; text-align: center; padding-block: 56px 8px; overflow: hidden; isolation: isolate; }
.contact .intro { margin: 0; }
.ripple { position: absolute; inset: 0; z-index: -1; pointer-events: none; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 45%, transparent 88%); mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 45%, transparent 88%); }
.ripple span { position: absolute; left: 50%; top: 40%; width: calc(180px + var(--k) * 90px); height: calc(180px + var(--k) * 90px); opacity: calc(1 - var(--k) * .12); border-radius: 50%; border: 1px solid var(--line); background: color-mix(in srgb, var(--fg) 2.5%, transparent); transform: translate(-50%, -50%); animation: rip 3.4s ease-in-out infinite; animation-delay: calc(var(--k) * 90ms); }
.ripple span:first-child { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
@keyframes rip { 0%,100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(.92); } }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 10px; font: 600 14.5px var(--f-body); border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; transition: transform .2s, box-shadow .2s; max-width: 100%; }
.btn:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.btn svg { width: 17px; height: 17px; fill: currentColor; flex: none; }
.btn .ltr { font: 500 13px var(--f-mono); overflow: hidden; text-overflow: ellipsis; }
.btn.primary { position: relative; overflow: hidden; background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, color-mix(in srgb, var(--accent-2) 45%, transparent) 50%, transparent 65%); transform: translateX(-100%); animation: shine 3.5s 1.5s ease-in-out infinite; }
@keyframes shine { 0% { transform: translateX(-100%); } 40%,100% { transform: translateX(100%); } }
.note { color: var(--muted); font-size: 13px; margin-top: 14px; min-height: 1.6em; }

footer { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 56px; }

/* ۴۰۴ */
.nf { min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding-top: 80px; }
.nf .logo-img { width: 180px; height: auto; }
.nf h1 { font-size: 26px; font-weight: 800; }
.nf p { color: var(--muted); }

/* داک پایین */
.dock-wrap { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); pointer-events: none; z-index: 40; }
.dock-wrap::before { content: ""; position: absolute; inset: auto 0 0; height: 120px; background: linear-gradient(to top, var(--bg) 20%, transparent); pointer-events: none; z-index: -1; }
.dock { pointer-events: auto; display: flex; align-items: flex-end; gap: 2px; height: 58px; padding: 7px 8px; border-radius: 18px; background: color-mix(in srgb, var(--bg) 80%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); direction: ltr; max-width: 100%; }
.dock .it { position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--fg); background: transparent; border: 0; padding: 0; cursor: pointer; flex: none; transition: background-color .2s; font: 700 13px var(--f-en); }
.dock .lang[lang="fa"] { font-family: var(--f-fa); font-size: 14px; }
.dock .it:hover { background: var(--soft); }
.dock .it svg { width: 19px; height: 19px; fill: currentColor; }
.dock .it > span:not(.tip) { display: grid; place-items: center; }
.dock .sep { width: 1px; align-self: stretch; background: var(--line); margin: 4px 3px; }
.dock .tip { position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translate(-50%, 4px); background: var(--fg); color: var(--bg); font: 500 12px/1.8 var(--f-body); padding: 1px 10px; border-radius: 7px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
@media (hover: hover) { .dock .it:hover .tip { opacity: 1; transform: translate(-50%, 0); } }
.dock .it:focus-visible .tip { opacity: 1; transform: translate(-50%, 0); }
.i-moon { display: none !important; }
:root[data-dark] .i-moon { display: grid !important; }
:root[data-dark] .i-sun { display: none !important; }
@media (max-width: 420px) {
  .dock .it { width: 36px; height: 36px; }
  .dock .it svg { width: 17px; height: 17px; }
  .dock { height: 52px; padding: 7px 6px; }
  .dock .sep { margin: 4px 1px; }
}

#sparks { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 100; }

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