@font-face { font-family: Vazirmatn; src: url("/fonts/vazirmatn.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #16120f;
  --card: #1f1a16;
  --card2: #272019;
  --line: #34291f;
  --text: #f3ece4;
  --muted: #b3a798;
  --accent: #f0934a;
  --accent-ink: #1a0f06;
  --radius: 22px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #faf6f1;
    --card: #fff;
    --card2: #f4ece3;
    --line: #e7dccf;
    --text: #231a12;
    --muted: #6d5e4e;
    --accent: #c4621a;
    --accent-ink: #fff;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #faf6f1;
  --card: #fff;
  --card2: #f4ece3;
  --line: #e7dccf;
  --text: #231a12;
  --muted: #6d5e4e;
  --accent: #c4621a;
  --accent-ink: #fff;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: radial-gradient(900px 500px at 70% -10%, rgba(240, 147, 74, 0.12), transparent 60%), var(--bg);
  color: var(--text);
  font: 16px/1.65 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
html[lang="fa"] body { font-family: Vazirmatn, "Noto Sans Arabic", Tahoma, system-ui, sans-serif; line-height: 1.9; }
a { color: inherit; }
.skip { position: absolute; top: 0; inset-inline-start: 12px; transform: translateY(-200%); }
.skip:focus { transform: none; top: 12px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 9; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.layout { max-width: 1120px; margin: 0 auto; padding: 24px 16px 48px; display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.side { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow: auto; scrollbar-width: thin; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.col { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.topbar nav { min-width: 0; }

.profile { text-align: center; }
.avatar { width: 92px; height: 92px; margin: 4px auto 14px; border-radius: 50%; display: block; object-fit: cover; border: 2px solid var(--accent); }
.profile .pname { margin: 0; font-size: 20px; font-weight: 700; }
.badge { display: inline-block; margin: 8px 0 16px; padding: 2px 12px; border-radius: 999px; font-size: 13px; background: var(--card2); color: var(--accent); }
.profile .h5 { margin: 22px 0 10px; text-align: start; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
html[lang="fa"] .profile .h5 { letter-spacing: 0; text-transform: none; font-size: 12px; }
.facts { margin: 0; display: grid; gap: 8px; text-align: start; font-size: 14px; }
.fact { display: flex; justify-content: space-between; gap: 12px; }
.fact dt { color: var(--muted); }
.fact dd { margin: 0; text-align: end; overflow-wrap: anywhere; }
.fact a { text-decoration: none; }
.fact a:hover { color: var(--accent); }
.skillgroup { text-align: start; margin-bottom: 12px; }
.skillgroup .sgt { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; padding: 2px 10px; border-radius: 8px; background: var(--card2); border: 1px solid var(--line); }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; position: sticky; top: 12px; z-index: 5; backdrop-filter: blur(10px); }
.topbar nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.topbar nav a { white-space: nowrap; text-decoration: none; font-size: 14px; color: var(--muted); padding: 0 14px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 999px; }
.topbar nav a:hover { color: var(--text); background: var(--card2); }
.tools { display: flex; gap: 8px; align-items: center; }
.lang, #theme { font: inherit; font-size: 13px; text-decoration: none; color: var(--text); background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.lang { display: inline-flex; align-items: center; min-height: 44px; }
#theme { width: 44px; height: 44px; padding: 0; font-size: 16px; }
.lang:hover, #theme:hover { border-color: var(--accent); }

.hero { padding: 48px 40px; background: radial-gradient(600px 300px at 90% 0, rgba(240, 147, 74, 0.16), transparent 70%), var(--card); }
.kicker { margin: 0 0 14px; font-size: 13px; letter-spacing: 0.14em; color: var(--accent); font-weight: 600; }
html[lang="fa"] .kicker { letter-spacing: 0; font-size: 13px; }
h1 { margin: 0 0 18px; font-size: clamp(30px, 4.6vw, 48px); line-height: 1.12; letter-spacing: -0.02em; }
html[lang="fa"] h1 { line-height: 1.45; letter-spacing: 0; }
.lead { margin: 0 0 28px; max-width: 56ch; color: var(--muted); font-size: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-block; padding: 12px 22px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 15px; background: var(--card2); }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.full { display: block; text-align: center; }

.block h2, .cta h2 { margin: 0 0 14px; font-size: 26px; }
main { display: grid; gap: 28px; }
.block { display: block; }
.prose p { margin: 0 0 14px; }
.prose p:last-child { margin-bottom: 0; }
.pull { font-size: 20px; line-height: 1.5; font-weight: 600; }
.stack { display: grid; gap: 16px; }
.job header { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.job h3, .project h3 { margin: 0; font-size: 18px; }
.job h3 a { text-decoration: none; }
.job h3 a:hover { color: var(--accent); }
.period { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.jobtitle { margin: 0; color: var(--accent); font-weight: 600; }
.sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.job ul { margin: 12px 0 0; padding-inline-start: 20px; }
.job li { margin-bottom: 6px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.project { display: flex; flex-direction: column; gap: 12px; }
.tag { margin: 0; font-size: 13px; color: var(--muted); }
.rows { margin: 0; display: grid; gap: 10px; }
.rows dt { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
html[lang="fa"] .rows dt { letter-spacing: 0; text-transform: none; font-size: 12px; }
.rows dd { margin: 2px 0 0; font-size: 15px; }
.textlink { color: var(--accent); font-weight: 600; text-decoration: none; margin-top: auto; }
.textlink:hover { text-decoration: underline; }
.prose .rows { margin-top: 16px; }
.ph { background: rgba(240, 147, 74, 0.25); color: inherit; border-radius: 4px; padding: 0 4px; outline: 1px dashed var(--accent); }

.cta { text-align: center; padding: 40px 24px; }
.cta p { max-width: 52ch; margin: 0 auto 24px; color: var(--muted); }
.cta .actions { justify-content: center; }
footer { padding-block: 4px 8px; text-align: center; color: var(--muted); font-size: 13px; }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 12px; }
  .side { position: static; max-height: none; overflow: visible; order: 2; }
  .topbar { top: 8px; }
  .hero { padding: 32px 20px; }
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.so { display: block; margin-top: 16px; padding: 12px 14px; text-decoration: none; text-align: start; background: var(--card2); border: 1px solid var(--line); border-radius: 14px; font-size: 13px; }
.so:hover { border-color: var(--accent); }
.so-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.so-name { font-weight: 600; color: var(--accent); white-space: nowrap; }
.so-rep { white-space: nowrap; }
.so-rep { color: var(--muted); }
.so-rep b { color: var(--text); font-size: 16px; }
.so-row { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.medal { display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
.medal::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #b4b8bc; }
.medal.bronze::before { background: #d1a684; }
.so-tag { display: block; margin-top: 8px; color: var(--muted); }

.posts { list-style: none; margin: 0; padding: 0; display: grid; }
.posts li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding-block: 12px; border-top: 1px solid var(--line); }
.posts li:first-child { padding-top: 0; border-top: 0; }
.posts a { text-decoration: none; font-weight: 550; }
.posts a:hover { color: var(--accent); }
.date { color: var(--muted); font-size: 13px; white-space: nowrap; }
.note { color: var(--muted); font-size: 13px; margin: 4px 0 0 !important; }
.posts + .note + .textlink, .posts + .textlink { display: inline-block; margin-top: 16px; }
@media (max-width: 640px) { .posts li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
