/* =========================================================
   Vista – Personal Theme (Crimson edition)
   Light / Dark · RTL / LTR (logical properties everywhere)
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg: #F6F3F4;
  --grid: rgba(155, 27, 58, .045);
  --surface: #FFFFFF;
  --surface-2: #F3EEF0;
  --ink: #1D1519;
  --muted: #6E6368;
  --faint: #73676D;          /* ≥ 4.5:1 on every light surface */
  --line: #ECE3E7;

  --primary: #9B1B3A;          /* زرشکی */
  --primary-strong: #7A1230;
  --primary-soft: #F9EAEE;
  --primary-line: #EAC5CF;
  --on-primary: #FFFFFF;
  --gold: #D99A1E;
  --champagne: #E7C995;
  --ok: #1E9A68;

  --shadow: 0 1px 2px rgba(70, 20, 35, .04), 0 10px 28px -16px rgba(70, 20, 35, .18);
  --shadow-lg: 0 2px 4px rgba(70, 20, 35, .05), 0 24px 48px -24px rgba(70, 20, 35, .28);

  --r-xl: 26px;
  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 9px;
  --pill: 999px;

  --font: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --container: 1080px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #130D10;
  --grid: rgba(214, 69, 106, .055);
  --surface: #1C1418;
  --surface-2: #261B20;
  --ink: #F5EDF0;
  --muted: #B6A8AF;
  --faint: #9A8C93;          /* ≥ 4.5:1 on dark surfaces */
  --line: #31242A;

  --primary: #CF3F63;
  --primary-strong: #E35C7E;
  --primary-soft: rgba(207, 63, 99, .14);
  --primary-line: rgba(207, 63, 99, .38);

  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -16px rgba(0, 0, 0, .7);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 48px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 96px 96px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .3s, color .3s;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; inset-inline-start: 16px; top: -60px; z-index: 100;
  background: var(--primary); color: var(--on-primary);
  padding: 8px 16px; border-radius: var(--r-sm); transition: top .2s;
}
.skip:focus { top: 12px; }

.container { width: min(100% - 32px, var(--container)); margin-inline: auto; }
main { overflow-x: clip; }
.vista-blocks { padding-block-end: 10px; }
.vista-canvas { padding-block-start: 10px; }

/* icons */
.i {
  width: 1.15em; height: 1.15em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.flag { width: 20px; height: 14px; border-radius: 3px; overflow: hidden; flex: none; }
[dir="rtl"] .flip { transform: scaleX(-1); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  height: 46px; padding-inline: 26px;
  border-radius: var(--r-md); border: 1.5px solid transparent;
  font-weight: 700; font-size: 14px; white-space: nowrap;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s var(--ease), box-shadow .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 8px 20px -10px var(--primary); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-outline { border-color: var(--primary-line); color: var(--primary); background: var(--surface); }
.btn-outline:hover { background: var(--primary-soft); border-color: var(--primary); }
.btn-ghost { border-color: var(--line); background: var(--surface); color: var(--ink); }
.btn-ghost:hover { border-color: var(--primary-line); color: var(--primary); }
.btn-light { background: #fff; color: var(--primary); }
.btn-light:hover { background: #FBEFF2; }
.btn-glass { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.3); }
.btn-glass:hover { background: rgba(255,255,255,.22); }
.btn-sm { height: 38px; padding-inline: 16px; font-size: 13px; border-radius: 11px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  transition: color .2s, border-color .2s, background-color .2s;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary-line); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--primary); font-weight: 700; font-size: 13px;
}
.link-arrow .i { transition: transform .2s var(--ease); }
.link-arrow:hover .i { transform: translateX(3px); }
[dir="rtl"] .link-arrow:hover .i { transform: scaleX(-1) translateX(3px); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: var(--pill);
  font-size: 11.5px; line-height: 1.9; white-space: nowrap;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.chip-primary { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-line); font-weight: 700; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; padding-block: 14px; }
.navbar {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  height: 64px; padding-inline: 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.brand { display: grid; place-items: center; color: var(--primary); }
.brand .logo { width: 34px; height: 34px; }
.brand .logo-img { width: auto; height: auto; max-height: 40px; max-width: 100px; object-fit: contain; }
.site-footer .brand .logo-img { max-height: 56px; max-width: 200px; margin-inline: auto; }
.menu { display: flex; align-items: center; gap: 4px; margin-inline: auto; }
.menu a, .menu .dd-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 36px; padding-inline: 14px; border-radius: var(--pill);
  font-size: 14px; color: var(--muted);
  transition: color .2s, background-color .2s;
}
.menu a:hover, .menu .dd-btn:hover { color: var(--ink); }
/* Labels never break onto two lines; items keep their natural width. */
.menu > li { flex: none; }
.menu a, .menu .dd-btn, .dd a { white-space: nowrap; }
/* Narrower desktops: tighter items, and the phone button shows only its icon. */
@media (min-width: 961px) and (max-width: 1110px) {
  .menu { gap: 0; }
  .menu a, .menu .dd-btn { padding-inline: 10px; font-size: 13.5px; }
  .menu .has-link .dd-row > .dd-link { padding-inline-end: 2px; }
  .menu .has-link .dd-row > .dd-toggle { padding-inline: 2px 8px; }
  .dl-label { display: none; }
  .btn-dl { width: 38px; padding: 0; justify-content: center; }
}
.menu [aria-current="page"], .menu .is-current { background: var(--primary-soft); color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-toggle { display: none; }

.has-dd { position: relative; }
.dd-btn .chev { width: 14px; height: 14px; transition: transform .2s; }
.has-dd.open .chev { transform: rotate(180deg); }
.dd {
  position: absolute; top: calc(100% + 10px); inset-inline-start: 0; min-width: 190px;
  padding: 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s, transform .18s var(--ease), visibility .18s;
}
.has-dd.open .dd { opacity: 1; visibility: visible; transform: none; }
.dd::before { content: ""; position: absolute; inset-inline: 0; bottom: 100%; height: 12px; } /* hover bridge */
.dd li + li { margin-block-start: 4px; }
.dd a, .dd button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  height: auto; padding: 9px 12px; border-radius: 9px;
  font-size: 14px; color: var(--ink); text-align: start;
}
.dd a:hover, .dd button:hover, .dd [aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
/* Parent with its own page: link + arrow button */
.has-link .dd-row { display: inline-flex; align-items: center; border-radius: var(--pill); transition: background-color .2s; }
.menu .has-link .dd-row > .dd-link { padding-inline-end: 4px; background: none; }
.menu .has-link .dd-row > .dd-toggle { padding-inline: 4px 12px; background: none; }
.menu .has-link .dd-row.is-current { background: var(--primary-soft); }
.menu .has-link .dd-row.is-current > * { color: var(--primary); }
.lang-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding-inline: 12px; border-radius: var(--pill);
  border: 1px solid var(--line); background: var(--surface); font-size: 13px;
}
.lang .dd { inset-inline-start: auto; inset-inline-end: 0; min-width: 140px; }

@media (hover: none) {
  .menu a:hover:not([aria-current="page"]), .menu .dd-btn:hover:not(.is-current) { background: none; color: var(--muted); }
  .dd a:hover:not([aria-current="page"]) { background: none; color: var(--ink); }
  .menu .dd a:hover:not([aria-current="page"]) { color: var(--muted); }
}

/* ---------- Section heads ---------- */
.section { padding-block: 36px; }
.sec-head { margin-block-end: 18px; }
.sec-head .kicker {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--primary);
}
.sec-head .kicker::after { content: ""; width: 34px; height: 2px; border-radius: 2px; background: var(--primary); }
.sec-head h2 { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.sec-head.center { text-align: center; }
.sec-head.center .kicker { justify-content: center; }
.sec-head.center .kicker::before { content: ""; width: 34px; height: 2px; border-radius: 2px; background: var(--primary); }
.sec-head.big h2 { font-size: clamp(20px, 2.4vw, 26px); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
}

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 40px;
  padding-block: 70px 60px; position: relative;
}
.hero::before {
  content: ""; position: absolute; inset-inline-end: -4%; top: 6%;
  width: 520px; height: 520px; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, var(--primary-soft), transparent);
}
.hello { font-weight: 700; font-size: 14px; margin-block-end: 6px; }
.hero-name {
  font-size: clamp(34px, 5vw, 54px); font-weight: 800; line-height: 1.15;
  letter-spacing: -.02em;
}
.hero-role {
  display: flex; align-items: center; min-height: 1.6em;
  margin-block: 14px 18px; font-size: clamp(18px, 2vw, 22px); font-weight: 800; color: var(--primary);
}
.caret { width: 2px; height: 1.1em; margin-inline-start: 3px; background: currentColor; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-bio { max-width: 52ch; color: var(--muted); font-size: 15px; line-height: 2; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-block: 18px 28px; font-size: 13px; color: var(--muted); }
.hero-meta li { display: flex; align-items: center; gap: 6px; }
.hero-meta .i { color: var(--primary); }
.hero-meta .star { color: var(--gold); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-visual { position: relative; justify-self: center; width: min(100%, 340px); aspect-ratio: 1; }
.avatar-ring {
  position: absolute; inset: 0; border-radius: 50%; padding: 14px;
  background: conic-gradient(from 200deg, var(--primary), #E7879F, var(--primary-soft) 55%, var(--primary) 100%);
}
.avatar-ring::after {
  content: ""; position: absolute; inset: -16px; border-radius: 50%;
  border: 1.5px dashed var(--primary-line);
  animation: spin 40s linear infinite;
}
.avatar-ring img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  border: 6px solid var(--surface);
}
.orbit-dot {
  position: absolute; top: -22px; left: 50%; width: 10px; height: 10px; margin-left: -5px;
  border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 5px var(--primary-soft);
}
@keyframes spin { to { transform: rotate(360deg); } }
.float-badge {
  position: absolute; display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  line-height: 1.25;
}
.float-badge b { display: block; color: var(--primary); font-size: 15px; font-weight: 800; }
.float-badge small { display: block; color: var(--faint); font-size: 10.5px; }
.float-badge .i { width: 22px; height: 22px; color: var(--primary); }
.float-badge .gold { color: var(--gold); }
.fb-1 { top: 6%; inset-inline-end: -6%; }
.fb-2 { top: 34%; inset-inline-start: -12%; }
.fb-3 { bottom: 4%; inset-inline-end: -2%; }

/* single load moment */
.hero-text > *, .hero-visual { animation: rise .8s var(--ease) both; }
.hero-text > :nth-child(2) { animation-delay: .06s; }
.hero-text > :nth-child(3) { animation-delay: .12s; }
.hero-text > :nth-child(4) { animation-delay: .18s; }
.hero-text > :nth-child(5) { animation-delay: .24s; }
.hero-text > :nth-child(6) { animation-delay: .3s; }
.hero-visual { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.skill { padding: 20px 12px 16px; text-align: center; transition: border-color .2s, transform .2s var(--ease); }
.skill:hover { border-color: var(--primary-line); transform: translateY(-2px); }
.skill-ico {
  display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 10px;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
}
.skill-ico .i { width: 24px; height: 24px; }
.skill h3 { font-size: 13px; font-weight: 700; margin-block-end: 6px; }

/* ---------- Experience ---------- */
.stack { display: grid; gap: 14px; }
.exp { padding: 24px; }
.exp-head { display: flex; align-items: flex-start; gap: 14px; }
.box-ico {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 12px; background: var(--primary-soft); color: var(--primary);
  border: 1px solid var(--primary-line);
}
.box-ico .i { width: 22px; height: 22px; }
.exp-head h3 { font-size: 15px; font-weight: 800; line-height: 1.5; }
.exp-head .org { color: var(--primary); font-size: 12.5px; }
.exp-when { margin-inline-start: auto; display: grid; justify-items: end; gap: 6px; }
.exp p { margin-block: 14px 12px; color: var(--muted); font-size: 13.5px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.wins { margin-block-start: 14px; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.wins li { display: flex; align-items: center; gap: 8px; }
.wins .i { color: var(--primary); }

/* ---------- Project cards ---------- */
.proj { padding: 10px; display: flex; flex-direction: column; }
.thumb { position: relative; overflow: hidden; border-radius: var(--r-md); aspect-ratio: 1; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.proj:hover .thumb img, .post:hover .thumb img { transform: scale(1.04); }
.thumb .cat {
  position: absolute; top: 12px; inset-inline-end: 12px;
  padding: 3px 12px; border-radius: var(--pill); font-size: 11.5px; font-weight: 700;
  color: #fff; background: rgba(20, 8, 12, .4); border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.proj-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 8px 6px; }
.proj-foot h3 { font-size: 14px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.go {
  display: grid; place-items: center; width: 42px; height: 42px; flex: none;
  border-radius: 50%; background: var(--surface-2); color: var(--ink);
  transition: background-color .2s, color .2s;
}
.proj:hover .go { background: var(--primary); color: var(--on-primary); }
.stretched::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.proj, .post { position: relative; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* ---------- Slider (scroll-snap, no library) ---------- */
.slider { position: relative; }
.slider-track {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: calc((100% - 36px) / 3);
  gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; padding-block: 4px 12px; overscroll-behavior-x: contain;
}
.slider-track::-webkit-scrollbar { display: none; }
.slider-track > * { scroll-snap-align: start; }
.slide-btn {
  position: absolute; top: 40%; z-index: 3;
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 50%; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.slide-btn:hover { color: var(--primary); }
.slide-btn.prev { inset-inline-start: -10px; }
.slide-btn.next { inset-inline-end: -10px; }

/* ---------- Education ---------- */
.edu { display: flex; align-items: center; gap: 18px; padding: 22px 24px; }
.edu .box-ico { width: 50px; height: 50px; }
.edu-body { flex: 1; min-width: 0; }
.edu h3 { font-size: 14.5px; font-weight: 800; }
.edu .org { display: flex; align-items: center; gap: 6px; color: var(--primary); font-size: 12.5px; }
.edu p { color: var(--muted); font-size: 12.5px; margin-block-start: 2px; }
.edu-when { display: grid; justify-items: center; gap: 6px; font-size: 11px; color: var(--faint); }
.edu-when span { display: flex; align-items: center; gap: 5px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
.stat { position: relative; overflow: hidden; padding: 26px; min-height: 210px; }
.stat .ico { color: var(--primary); }
.stat .ico .i { width: 26px; height: 26px; }
.stat .stat-num { display: flex; align-items: flex-start; gap: 4px; margin-block: 16px 2px; font-size: 44px; font-weight: 800; line-height: 1; color: var(--primary); }
.stat-num sup { font-size: 20px; line-height: 1; }
.stat h3 { font-size: 13px; font-weight: 800; }
.stat p { font-size: 12px; color: var(--faint); }
.stat-feature {
  background: linear-gradient(145deg, var(--primary), var(--primary-strong));
  color: #fff; border-color: transparent;
}
[data-theme="dark"] .stat-feature { background: linear-gradient(145deg, #8E1936, #5E0F24); }
.stat-feature .ico, .stat.stat-feature .stat-num { color: #fff; }
.stat-feature p { color: rgba(255,255,255,.7); }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 36px; margin-block-start: 18px; }
.bars span { flex: 1; border-radius: 3px 3px 0 0; background: rgba(255,255,255,.22); }
.stat-glow { position: absolute; inset-inline-end: -60px; bottom: -60px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(closest-side, var(--primary-soft), transparent); }

/* ---------- Social ---------- */
.social { display: flex; align-items: center; gap: 12px; padding: 14px 16px; transition: border-color .2s; }
.social:hover { border-color: var(--primary-line); }
.social .box-ico { width: 36px; height: 36px; border-radius: 10px; }
.social .box-ico .i { width: 18px; height: 18px; }
.social b { display: block; font-size: 13px; line-height: 1.4; }
.social small { display: block; font-size: 11.5px; color: var(--muted); }

/* ---------- CTA ---------- */
.cta {
  position: relative; overflow: hidden; text-align: center;
  padding: 56px 24px; border-radius: var(--r-xl); color: #fff;
  background:
    radial-gradient(600px 240px at 85% -10%, rgba(255,255,255,.14), transparent 60%),
    linear-gradient(135deg, #A11E3F, #6E0F29);
}
.cta::before {
  content: ""; position: absolute; inset: 0; opacity: .35;
  background-image: radial-gradient(rgba(255,255,255,.25) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 80%);
}
.cta > * { position: relative; }
.cta .kicker-sm { font-size: 12px; opacity: .75; }
.cta h2 { font-size: clamp(22px, 3vw, 32px); font-weight: 800; margin-block: 8px 10px; }
.cta p { opacity: .85; font-size: 14px; }
.cta .row { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-block-start: 26px; }

/* ---------- Post cards ---------- */
.post { overflow: hidden; display: flex; flex-direction: column; }
.post .thumb { border-radius: 0; aspect-ratio: 16 / 9; }
.post .thumb .cat { top: auto; bottom: 12px; inset-inline-end: auto; inset-inline-start: 12px; background: var(--primary); border-color: transparent; }
.post-body { padding: 16px 20px 18px; display: flex; flex-direction: column; flex: 1; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 11.5px; color: var(--faint); }
.meta > * + *::before { content: ""; display: inline-block; width: 1px; height: 10px; margin-inline-end: 12px; background: var(--line); vertical-align: middle; }
.post h3 { font-size: 15px; font-weight: 800; line-height: 1.6; margin-block: 8px 6px; }
.post p {
  color: var(--muted); font-size: 13px; line-height: 1.9;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-foot { display: flex; align-items: center; justify-content: space-between; margin-block-start: auto; padding-block-start: 16px; }
.post-foot .link-arrow { position: relative; z-index: 2; }
.post-foot .chip .i { color: var(--primary); width: 13px; height: 13px; }

/* ---------- Marquee (hero ribbon + client strip) ---------- */
.marquee { overflow: hidden; --dur: 40s; }
.marquee-track { display: flex; width: max-content; animation: marquee var(--dur) linear infinite; }
[dir="rtl"] .marquee-track { animation-name: marquee-rtl; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track { animation-play-state: paused; }
.marquee-list { display: flex; align-items: center; flex: none; }
.marquee-list li { display: flex; align-items: center; white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes marquee-rtl { to { transform: translateX(50%); } }

.band-wrap { overflow: hidden; padding-block: 26px 60px; margin-block-end: -20px; }
.band {
  width: 110%; margin-inline-start: -5%;
  transform: rotate(-2deg) translateZ(0);
  will-change: transform; backface-visibility: hidden; -webkit-backface-visibility: hidden; outline: 1px solid transparent;
  background: linear-gradient(90deg, var(--primary), #B32A4E 50%, var(--primary));
  color: var(--champagne);
  border-bottom: 9px solid #5E0F24;
}
.band li { padding: 17px 36px; font-size: 16px; font-weight: 700; border-inline-start: 1px solid rgba(246, 228, 196, .28); }
[data-theme="dark"] .band { background: linear-gradient(90deg, #8E1936, #A8284A 50%, #8E1936); border-bottom-color: #3E0816; }

/* ---------- Footer ---------- */
.site-footer { margin-block-start: 70px; color: #F3E6EA; }

.fx {
  overflow: hidden; padding-block-start: 56px;
  background:
    radial-gradient(800px 380px at 90% -10%, rgba(255, 255, 255, .08), transparent 60%),
    linear-gradient(115deg, #5C0F28, #2D0713 72%);
}
[data-theme="dark"] .fx { background: radial-gradient(800px 380px at 90% -10%, rgba(255,255,255,.05), transparent 60%), linear-gradient(115deg, #3D0A1B, #15040A 72%); }
.fx-grid.container { width: min(100% - 32px, 1240px); }
.fx-grid {
  display: grid; column-gap: 44px; row-gap: 28px;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .62fr) minmax(0, .78fr) 290px;
  grid-template-areas: "bio quick services card" "bottom bottom bottom card";
}
.fx-bio { grid-area: bio; }
.fx-quick { grid-area: quick; }
.fx-services { grid-area: services; }
.fx-card { grid-area: card; }
.fx-bottom { grid-area: bottom; }
.fx .fx-title { font-size: 18px; font-weight: 800; line-height: 1.5; color: #fff; }
html[lang="en"] .fx-sub { display: none; }
.fx-sub { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--champagne); line-height: 1.4; }
.fx-brand { display: flex; align-items: center; gap: 12px; }
.fx-logo { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .08); color: var(--champagne); }
.fx-logo .logo { width: 26px; height: 26px; }
.fx-logo:has(.logo-img) { width: auto; height: auto; min-height: 46px; padding: 8px 12px; border-radius: 14px; }
.fx-logo .logo-img { width: auto; height: auto; max-height: 34px; max-width: 140px; object-fit: contain; }
.fx-text { max-width: 46ch; margin-block: 18px 24px; font-size: 14px; line-height: 2.2; color: rgba(243, 230, 234, .78); }
.fx-btn {
  display: inline-flex; align-items: center; height: 46px; padding-inline: 28px;
  border-radius: var(--pill); background: var(--champagne); color: #3A0816; font-weight: 800; font-size: 14px;
  transition: background-color .2s;
}
.fx-btn:hover { background: #EBD2A8; }
.fx .foot-links { display: grid; justify-items: start; gap: 12px; margin-block-start: 22px; font-size: 14px; color: rgba(243, 230, 234, .8); }
.fx .foot-links a:hover { color: var(--champagne); }
.fx-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  margin-block-start: 14px; padding: 36px 24px 48px;
  border-radius: 200px 200px 0 0; color: #3A0816;
  background: linear-gradient(180deg, #E4C697, #BF9459);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, .12);
}
.fx-card .fx-title { margin-block-start: 14px; font-size: 24px; color: #3A0816; white-space: nowrap; }
.fx-card .fx-sub { color: #3A0816; }
.fx-art { width: 230px; height: auto; margin-block-start: -64px; filter: drop-shadow(0 16px 14px rgba(58, 8, 22, .35)); }
.fx-card-btn {
  display: inline-flex; align-items: center; height: 46px; margin-block-start: 20px; padding-inline: 28px;
  border-radius: var(--pill); background: #fff; color: #3A0816; font-weight: 700; font-size: 14px; white-space: nowrap;
  box-shadow: 0 10px 24px -12px rgba(58, 8, 22, .6); transition: transform .2s var(--ease);
}
.fx-card-btn:hover { transform: translateY(-2px); }
.fx-bottom {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  padding-block: 22px 28px; border-top: 1px dashed rgba(243, 230, 234, .25);
  font-size: 13px; color: rgba(243, 230, 234, .7);
}
.foot-social { display: flex; flex-wrap: wrap; gap: 8px; }
.fx .foot-social a {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255, 255, 255, .08); color: rgba(243, 230, 234, .85); transition: color .2s, background-color .2s;
}
.fx .foot-social a:hover { color: #3A0816; background: var(--champagne); }
.fx :focus-visible { outline-color: var(--champagne); }

@media (max-width: 960px) {
  .fx-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "bio bio" "quick services" "card card" "bottom bottom"; }
  .fx-card { margin-block-start: 40px; border-radius: 28px; padding: 32px 24px; }
  .band li { padding: 14px 26px; font-size: 14px; }
}
@media (max-width: 640px) {
  /* The two link lists stay side by side: shorter footer, easier to scan. */
  .fx-grid { column-gap: 20px; }
  .fx .foot-links { gap: 10px; margin-block-start: 16px; font-size: 13.5px; }
  .fx-quick .fx-title, .fx-services .fx-title { font-size: 16.5px; }
  .fx-bottom { justify-content: center; text-align: center; }
}
@media (max-width: 340px) {
  .fx-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "bio" "quick" "services" "card" "bottom"; }
}

/* ---------- SEO read-more box ---------- */
[data-lang="en"] { display: none; }
html[lang="en"] [data-lang="en"] { display: block; }
html[lang="en"] [data-lang="fa"] { display: none; }
.seo-box { margin-block-start: 64px; }
.seo-box-card { padding: 28px 32px 22px; }
.seo-box-title {
  font-size: 18px; font-weight: 800; line-height: 1.6; margin-block-end: 14px;
  padding-inline-start: 12px; border-inline-start: 3px solid var(--primary);
}
.seo-box-body {
  position: relative; overflow: hidden; max-height: 180px;
  color: var(--muted); font-size: 14px; line-height: 2.1;
  transition: max-height .45s var(--ease);
}
.seo-box-body::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 90px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--surface)); transition: opacity .3s;
}
.seo-box-card.is-open .seo-box-body::after, .seo-box-card.is-short .seo-box-body::after { opacity: 0; }
.seo-box-card.is-short .seo-box-body { max-height: none; }
.seo-box-body > * + * { margin-block-start: 12px; }
.seo-box-body :is(h2, h3, h4) { color: var(--ink); font-weight: 800; line-height: 1.6; margin-block-start: 22px; }
.seo-box-body h2 { font-size: 17px; } .seo-box-body h3 { font-size: 15.5px; } .seo-box-body h4 { font-size: 14.5px; }
.seo-box-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.seo-box-body strong { color: var(--ink); }
.seo-box-body :is(ul, ol) { padding-inline-start: 22px; list-style: revert; }
.seo-box-body img { border-radius: var(--r-md); height: auto; }
.seo-box-body table { width: 100%; border-collapse: collapse; font-size: 13px; }
.seo-box-body :is(td, th) { border: 1px solid var(--line); padding: 6px 10px; }
.seo-box-toggle {
  display: flex; align-items: center; gap: 6px; margin: 16px auto 0; padding: 8px 20px;
  border-radius: var(--pill); border: 1px solid var(--primary-line); background: var(--primary-soft);
  color: var(--primary); font-weight: 700; font-size: 13px; transition: background-color .2s;
}
.seo-box-toggle:hover { background: var(--surface); }
.seo-box-toggle .i { width: 14px; height: 14px; transition: transform .25s; }
.seo-box-card.is-open .seo-box-toggle .i { transform: rotate(180deg); }
.seo-box-card.is-short .seo-box-toggle { display: none; }
@media (max-width: 640px) { .seo-box-card { padding: 22px 18px 18px; } }

/* ---------- Inner page head ---------- */
.page-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-block: 6px 22px; }
.page-head .box-ico { width: 44px; height: 44px; }
.page-title { font-size: 16px; font-weight: 800; padding-inline-start: 10px; border-inline-start: 2px solid var(--primary); line-height: 1.3; }
.page-sub { font-size: 12px; color: var(--faint); padding-inline-start: 12px; }
.page-head .end { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12px; color: var(--faint); }
.crumbs a:hover { color: var(--primary); }
.crumbs [aria-current] { color: var(--ink); font-weight: 500; }
.crumbs .i { width: 11px; height: 11px; }
[dir="rtl"] .crumbs .i { transform: scaleX(-1); }

/* ---------- Services ---------- */
.service { padding: 30px; }
.service .box-ico { width: 52px; height: 52px; border-radius: 14px; margin-block-end: 22px; }
.service .box-ico .i { width: 24px; height: 24px; }
.service h3 { font-size: 17px; font-weight: 800; margin-block-end: 8px; }
.service p { color: var(--muted); font-size: 13.5px; line-height: 2; margin-block-end: 18px; }

.pricing { align-items: stretch; }
.price { padding: 28px 24px; display: flex; flex-direction: column; position: relative; }
.price h3 { font-size: 19px; font-weight: 800; }
.price-amt { display: flex; align-items: baseline; justify-content: space-between; margin-block-start: 18px; }
.price-amt b { font-size: 30px; font-weight: 800; color: var(--primary); line-height: 1; }
.price-amt > span { font-size: 12px; color: var(--faint); }
.price .per { font-size: 12px; color: var(--faint); padding-block-end: 16px; border-bottom: 1px solid var(--line); }
.features { display: grid; gap: 8px; margin-block: 18px 22px; font-size: 13.5px; }
.features li { display: flex; align-items: center; gap: 8px; }
.features .i { color: var(--primary); width: 15px; height: 15px; }
.features .off { color: var(--faint); }
.features .off .i { color: var(--faint); }
.price .note { margin-block-start: 14px; text-align: center; font-size: 12px; color: var(--faint); }
.price .btn { margin-block-start: auto; }
.price.featured { border: 1.5px solid var(--primary); border-top-width: 5px; box-shadow: var(--shadow-lg); transform: translateY(-6px); }
.ribbon {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 2px 12px; border-radius: 8px; font-size: 11.5px; font-weight: 700;
  background: var(--primary); color: var(--on-primary);
}
.ribbon .i { width: 12px; height: 12px; }

/* testimonials */
.testi .slider-track { grid-auto-columns: calc((100% - 36px) / 3); padding-block: 20px; scroll-snap-type: x mandatory; }
.testi .slider-track > * { scroll-snap-align: center; }
.quote {
  margin: 0; padding: 28px; transition: opacity .35s, transform .35s var(--ease), border-color .35s, filter .35s;
  opacity: .45; transform: scale(.94); filter: saturate(.4);
}
.quote.is-active { opacity: 1; transform: none; filter: none; border-color: var(--primary-line); }
.quote > .i { width: 26px; height: 26px; color: var(--primary-line); }
.quote blockquote { margin: 14px 0 20px; color: var(--muted); font-size: 14px; line-height: 2.1; }
.who { display: flex; align-items: center; gap: 12px; }
.who img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--primary-line); }
.who b { display: block; font-size: 14px; line-height: 1.4; }
.who small { display: block; font-size: 12px; color: var(--faint); }
.stars { margin-inline-start: auto; display: flex; gap: 2px; color: var(--gold); }
.stars .i { width: 13px; height: 13px; }
.dots { display: flex; justify-content: center; gap: 6px; margin-block-start: 12px; }
.dots button { width: 8px; height: 8px; border-radius: 8px; background: var(--line); transition: width .25s var(--ease), background-color .25s; }
.dots button[aria-current="true"] { width: 26px; background: var(--primary); }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding-block: 30px 10px; }
.contact-lead { color: var(--muted); max-width: 46ch; margin-block: 8px 26px; }
.contact-list li { display: flex; gap: 16px; align-items: flex-start; padding-block: 18px; border-bottom: 1px solid var(--line); }
.contact-list li:last-child { border-bottom: 0; }
.contact-list .i { width: 30px; height: 30px; color: var(--primary); }
.contact-list b { display: block; color: var(--primary); font-size: 15px; }
.contact-list a:hover { color: var(--primary); }
.form { padding: 30px; display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; }
.field label .req { color: var(--primary); }
.input {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border-radius: var(--r-md); border: 1.5px solid transparent;
  background: var(--surface-2); transition: border-color .2s, background-color .2s;
}
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
textarea.input { min-height: 130px; resize: vertical; }
.field.error .input { border-color: #D93A3A; }
.field .err { font-size: 12px; color: #D93A3A; min-height: 0; }
.field .err { line-height: 1.7; }
.field .err:empty { display: none; }
/* Phone and website: digits and Latin text stay left-to-right, but they line up with the other fields. */
.input[type="tel"], .input[data-rule="site"] { direction: ltr; text-align: right; }
.input[type="tel"]::placeholder, .input[data-rule="site"]::placeholder { direction: rtl; text-align: right; }
[dir="ltr"] .input[type="tel"], [dir="ltr"] .input[data-rule="site"] { text-align: left; }
[dir="ltr"] .input[type="tel"]::placeholder, [dir="ltr"] .input[data-rule="site"]::placeholder { direction: ltr; text-align: left; }
/* Error state: attribute + classes so it wins over the per-section input and status colours. */
.field.error .input[aria-invalid="true"] { border-color: #D93A3A; }
.form-status.is-error[role="status"] { color: #D93A3A; }
.is-style-vista-auditbox .field.error .input[aria-invalid="true"],
.vista-calc .field.error .input[aria-invalid="true"] { border-color: #FFD3DB; }
.is-style-vista-auditbox .vista-auditform .form-status.is-error[role="status"],
.vista-calc .vista-auditform .form-status.is-error[role="status"] { color: #FFD3DB; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.form-status { font-size: 13px; color: var(--ok); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.check input { accent-color: var(--primary); width: 16px; height: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- Single portfolio ---------- */
.gallery { overflow: hidden; }
.gallery-main { position: relative; aspect-ratio: 16 / 8.8; background: var(--surface-2); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-main .slide-btn { top: 50%; transform: translateY(-50%); }
.gallery-main .slide-btn.prev { inset-inline-start: 14px; }
.gallery-main .slide-btn.next { inset-inline-end: 14px; }
.counter {
  position: absolute; bottom: 14px; inset-inline-end: 14px;
  padding: 2px 12px; border-radius: var(--pill); font-size: 12px; font-weight: 700;
  color: #fff; background: rgba(20, 8, 12, .6);
}
.thumbs { display: flex; justify-content: center; gap: 10px; padding: 12px; }
.thumbs button { width: 96px; aspect-ratio: 3 / 2; border-radius: 10px; overflow: hidden; border: 2px solid transparent; opacity: .65; transition: opacity .2s, border-color .2s; }
.thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.thumbs button[aria-current="true"] { border-color: var(--primary); opacity: 1; }
.title-bar { padding: 14px 20px; margin-block: 16px; }
.title-bar h1 { font-size: 20px; font-weight: 800; padding-inline-start: 12px; border-inline-start: 2px solid var(--primary); line-height: 1.4; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); }
.fact { display: flex; align-items: center; gap: 12px; padding: 18px 20px; }
.fact + .fact { border-inline-start: 1px solid var(--line); }
.fact small { display: block; font-size: 11px; color: var(--faint); }
.fact b { font-size: 14px; }
.prose { padding: 34px; margin-block: 16px 30px; font-size: 14.5px; line-height: 2.2; color: var(--muted); }
.prose p + p, .prose p + figure, .prose figure + p { margin-block-start: 22px; }
.prose strong { color: var(--ink); }
.prose figure { margin: 26px 0; }
.prose figure img { border-radius: var(--r-md); width: 100%; }
.prose figcaption { font-size: 12px; color: var(--faint); margin-block-start: 8px; text-align: center; }
.small-head { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 800; margin-block: 8px 14px; }
.small-head::before { content: ""; width: 2px; height: 16px; background: var(--primary); }

/* ---------- Case study (portfolio) ---------- */
.case { display: grid; gap: 14px; margin-block: 14px; }
.case-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.case-card, .case-results, .case-quote { padding: 24px 26px; }
.case h2 { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; margin-block-end: 12px; }
.case h2 .i { width: 20px; height: 20px; padding: 8px; box-sizing: content-box; border-radius: 12px; color: var(--primary); background: var(--primary-soft); }
.case-card p { font-size: 14px; line-height: 2.1; color: var(--muted); }
.case-card.is-challenge { border-top: 4px solid #D99A1E; }
.case-card.is-solution { border-top: 4px solid var(--primary); }
.case-stack { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: 14px; }
.case-stack span { padding: 2px 11px; border-radius: 999px; font-size: 12px; direction: ltr; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); }
.case-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.case-metric { padding: 16px; border-radius: 14px; text-align: center; background: var(--surface-2); }
.case-metric .m-label { font-size: 12.5px; color: var(--muted); }
.case-metric .m-values { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin-block: 8px 4px; }
.case-metric .m-before { font-size: 16px; color: var(--faint); text-decoration: line-through; text-decoration-color: rgba(217, 58, 58, .5); }
.case-metric .m-arrow { color: var(--faint); }
[dir="ltr"] .case-metric .m-arrow { transform: scaleX(-1); display: inline-block; }
.case-metric .m-after { font-size: 26px; font-weight: 800; color: var(--primary); }
.case-metric .m-delta { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #1E9A68; background: rgba(30, 154, 104, .12); direction: ltr; }
.case-quote { position: relative; margin: 0; padding-inline-start: 64px; background: linear-gradient(140deg, var(--primary-soft), var(--surface) 70%); }
.case-quote::before { content: ""; position: absolute; inset-inline-start: 24px; top: 24px; width: 26px; height: 26px; background: var(--primary-line); -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222.2%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20fill%3D%22black%22%20stroke%3D%22none%22%20d%3D%22M4%2017.5c0-4%201.5-7.5%205-10l1.2%201.4C8.3%2010.5%207.6%2012%207.5%2013.5H10V19H4zm9.5%200c0-4%201.5-7.5%205-10l1.2%201.4c-1.9%201.6-2.6%203.1-2.7%204.6h2.5V19h-6z%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222.2%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20fill%3D%22black%22%20stroke%3D%22none%22%20d%3D%22M4%2017.5c0-4%201.5-7.5%205-10l1.2%201.4C8.3%2010.5%207.6%2012%207.5%2013.5H10V19H4zm9.5%200c0-4%201.5-7.5%205-10l1.2%201.4c-1.9%201.6-2.6%203.1-2.7%204.6h2.5V19h-6z%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat; }
.case-quote p { font-size: 15px; line-height: 2; color: var(--ink); }
.case-quote cite { display: block; margin-block-start: 8px; font-style: normal; font-size: 12.5px; color: var(--muted); }
.case-visit { text-align: center; }
@media (max-width: 781px) {
  .case-grid, .case-metrics { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Single post ---------- */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 26px; align-items: start; }
.post-side { position: sticky; top: 92px; display: grid; gap: 14px; }
.side-card { padding: 20px 22px; }
.side-card h2 { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 800; margin-block-end: 12px; }
.side-card h2 .i { color: var(--primary); width: 16px; height: 16px; }
.vista-toc { display: grid; gap: 2px; counter-reset: toc; max-height: 60vh; overflow: auto; }
.vista-toc a {
  display: block; padding: 7px 10px; border-radius: 9px; font-size: 13px; line-height: 1.8; color: var(--muted);
  transition: background-color .2s, color .2s;
}
.vista-toc a:hover, .vista-toc a.is-active { background: var(--primary-soft); color: var(--primary); }
.vista-toc .lvl-3 a { padding-inline-start: 24px; font-size: 12.5px; position: relative; }
.vista-toc .lvl-3 a::before { content: ""; position: absolute; inset-inline-start: 12px; top: 50%; width: 6px; height: 1px; background: var(--line); }
.side-posts { display: grid; gap: 12px; }
.side-post { display: flex; align-items: center; gap: 10px; }
.side-post img { width: 58px; height: 46px; border-radius: 9px; object-fit: cover; flex: none; }
.side-post b { display: block; font-size: 12.5px; font-weight: 700; line-height: 1.7; color: var(--ink); }
.side-post small { font-size: 11px; color: var(--faint); }
.side-cta { text-align: center; color: #fff; background: linear-gradient(150deg, #A11E3F, #5F0F27); }
.side-cta h2 { justify-content: center; color: #fff; }
.side-cta p { font-size: 12.5px; color: rgba(255, 255, 255, .8); margin-block-end: 14px; }
.side-cta .btn { width: 100%; background: #fff; color: var(--primary); border-color: #fff; }
.side-cta .num { display: block; direction: ltr; font-size: 17px; font-weight: 800; margin-block-end: 12px; }
@media (max-width: 960px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); }
  .post-side { position: static; margin-block-start: 14px; }
}

.post-head { padding: 20px 24px; margin-block: 6px 16px; }
.post-head .top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.post-head h1 { font-size: clamp(20px, 2.4vw, 26px); font-weight: 800; margin-block: 14px; padding-inline-start: 12px; border-inline-start: 2px solid var(--primary); line-height: 1.5; }
.author-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-block-start: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); }
.author-line .me { display: flex; align-items: center; gap: 10px; }
.author-line img { width: 36px; height: 36px; border-radius: 50%; }
.author-line b { color: var(--ink); font-size: 13px; }
.author-line .who-line { font-size: 12px; color: var(--faint); }
.author-line span { display: inline-flex; align-items: center; gap: 5px; }
.author-line .i { color: var(--primary); width: 14px; height: 14px; }
.cover { border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16 / 9; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.post-article { border-top-left-radius: 0; border-top-right-radius: 0; margin-block-start: -18px; padding-block-start: 44px; }
.share-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-block-start: 30px; padding-block-start: 18px; border-top: 1px solid var(--line); }
.share-row .row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.share-row .icon-btn { width: 34px; height: 34px; }
.author-box { display: flex; gap: 18px; margin-block-start: 24px; padding: 22px 24px; border-inline-end: 3px solid var(--primary); margin-block-end: 30px; }
.author-box img { width: 64px; height: 64px; border-radius: 50%; flex: none; }
.author-box p { font-size: 13px; color: var(--muted); margin-block: 4px 10px; }
.related .post .thumb { aspect-ratio: 16 / 8; }
.comment-form { margin-block-start: 30px; }
.comment-form h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; }
.comment-form h2 .i { color: var(--primary); }

/* ---------- 404 ---------- */
.nf {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: 40px;
  min-height: calc(100vh - 92px); min-height: calc(100svh - 92px); padding-block: 48px 72px;
}
.nf-eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 800; color: var(--primary); }
.nf-eyebrow .nf-sep { width: .9em; height: .9em; opacity: .55; }
[dir="ltr"] .nf-eyebrow .nf-sep { transform: scaleX(-1); }
.nf h1 { font-size: clamp(32px, 4.4vw, 50px); font-weight: 900; line-height: 1.25; margin-block: 18px 12px; }
.nf .nf-text { max-width: 46ch; color: var(--muted); font-size: 16px; line-height: 1.9; }
.nf .row { display: flex; flex-wrap: wrap; gap: 14px; margin-block-start: 38px; }
.nf-btn { height: 54px; min-width: 190px; padding-inline: 26px; font-size: 15px; justify-content: center; }
.i.fill { fill: currentColor; stroke: none; }

/* The 404 artwork: two thin rings, an arc, the code with a gold ring on its zero, two notes. */
.nf-art { position: relative; aspect-ratio: 1; width: min(100%, 470px); justify-self: center; display: grid; place-items: center; }
.nf-ring { position: absolute; border-radius: 50%; border: 1.5px solid var(--primary-line); }
.nf-ring-1 { inset: 0; }
.nf-ring-2 { inset: 9%; opacity: .6; }
.nf-arc {
  position: absolute; inset: 12% -7% auto; aspect-ratio: 2.3; border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  border: 2px solid var(--primary-line); border-bottom: 0;
  -webkit-mask-image: linear-gradient(#000 30%, transparent 62%); mask-image: linear-gradient(#000 30%, transparent 62%);
}
.nf-dot { position: absolute; width: 14px; height: 14px; border-radius: 50%; }
.nf-dot-1 { background: var(--primary); inset-block-start: 4%; inset-inline-end: 4%; }
.nf-dot-2 { background: var(--gold); inset-block-end: 9%; inset-inline-start: 7%; }
.nf-code {
  position: relative; display: flex; align-items: center; margin: 0;
  font-size: clamp(110px, 13vw, 176px); font-weight: 900; line-height: 1; letter-spacing: -.02em;
  color: var(--primary); font-family: "Vazirmatn", "Segoe UI", system-ui, sans-serif; user-select: none;
}
.nf-zero { position: relative; }
.nf-zero::after {
  content: ""; position: absolute; width: .8em; aspect-ratio: 1; left: 50%; top: 58%;
  transform: translate(-50%, -50%); border-radius: 50%; border: .065em solid var(--gold);
}
.nf-bubble {
  position: absolute; display: flex; align-items: center; gap: 8px; margin: 0; padding: 13px 20px;
  font-size: 13.5px; color: var(--muted); white-space: nowrap;
  background: var(--surface); border: 1px solid var(--primary-line); border-radius: 18px; box-shadow: var(--shadow);
}
.nf-bubble .i { color: var(--primary); }
.nf-bubble-1 { inset-block-start: 1%; inset-inline-start: -8%; }
.nf-bubble-2 { inset-block-end: 3%; inset-inline-end: -12%; }
@media (prefers-reduced-motion: no-preference) {
  .nf-bubble { animation: nf-float 5s ease-in-out infinite; }
  .nf-bubble-2 { animation-delay: -2.5s; }
}
@keyframes nf-float { 50% { transform: translateY(-6px); } }
[data-theme="dark"] .nf-ring, [data-theme="dark"] .nf-arc { border-color: rgba(207, 63, 99, .3); }
@media (max-width: 900px) {
  .nf { grid-template-columns: 1fr; gap: 16px; padding-block: 28px 56px; text-align: center; }
  .nf-copy { order: 2; display: flex; flex-direction: column; align-items: center; }
  .nf .row { justify-content: center; margin-block-start: 28px; }
  .nf-art { width: min(82%, 360px); }
  .nf-bubble-1 { inset-inline-start: -6%; }
  .nf-bubble-2 { inset-inline-end: -6%; }
}
@media (max-width: 480px) {
  .nf-btn { flex: 1 1 100%; }
  .nf-bubble { padding: 9px 14px; font-size: 12px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav-toggle { display: inline-grid; }
  .menu {
    position: absolute; top: calc(100% + 8px); inset-inline: 0;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 10px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .2s, transform .2s var(--ease), visibility .2s;
  }
  .navbar.menu-open .menu { opacity: 1; visibility: visible; transform: none; }
  .menu a, .menu .dd-btn { width: 100%; justify-content: space-between; border-radius: 10px; height: 42px; }
  .menu .dd {
    position: static; box-shadow: none; border: 0; display: none; opacity: 1; visibility: visible; transform: none;
    min-width: 0; margin: 2px 0 8px; margin-inline-start: 16px; padding: 2px 0; padding-inline-start: 10px;
    border-inline-start: 2px solid var(--line); border-radius: 0; background: none;
  }
  .menu .dd::before { display: none; }
  .menu .has-dd.open .dd { display: block; }
  .menu .dd li + li { margin-block-start: 2px; }
  .menu .dd a { height: 40px; padding-inline: 12px; font-size: 13.5px; color: var(--muted); }
  .menu .dd [aria-current="page"] { color: var(--primary); background: var(--primary-soft); }
  .menu .has-link .dd-row { display: flex; width: 100%; border-radius: 10px; }
  .menu .has-link .dd-row > .dd-link { flex: 1; width: auto; }
  .menu .has-link .dd-row > .dd-toggle { flex: none; width: 46px; justify-content: center; padding: 0; }
  .nav-actions { margin-inline-start: auto; }
  .hero { grid-template-columns: 1fr; text-align: start; padding-block: 40px; gap: 60px; }
  .hero-visual { order: -1; width: min(78%, 300px); }
  .skills { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .slider-track, .testi .slider-track { grid-auto-columns: calc((100% - 18px) / 2); }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-feature { grid-column: 1 / -1; }
  .contact { grid-template-columns: 1fr; }
  .price.featured { transform: none; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .dl-label, .lang-label { display: none; }
  .btn-dl { width: 38px; padding: 0; }
  .navbar { padding-inline: 12px; gap: 8px; }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-4, .two, .facts { grid-template-columns: 1fr; }
  .fact + .fact { border-inline-start: 0; border-top: 1px solid var(--line); }
  .slider-track, .testi .slider-track { grid-auto-columns: 86%; }
  .slide-btn.prev { inset-inline-start: 4px; }
  .slide-btn.next { inset-inline-end: 4px; }
  .exp-head { flex-wrap: wrap; }
  .exp-when { margin-inline-start: 54px; justify-items: start; grid-auto-flow: column; }
  .edu { flex-wrap: wrap; }
  .edu-when { grid-auto-flow: column; }
  .stats { grid-template-columns: 1fr; }
  .page-head { flex-wrap: wrap; }
  .page-head .end { margin-inline-start: 0; width: 100%; justify-content: space-between; }
  .prose { padding: 22px; }
  .author-box { flex-direction: column; }
  .foot-bottom { justify-content: center; text-align: center; }
  .fb-2 { inset-inline-start: -6%; }
}

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

/* dark-mode button contrast (white text ≥ 4.5:1) */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .ribbon,
[data-theme="dark"] .post .thumb .cat { background: #B42F55; }
[data-theme="dark"] .btn-primary:hover { background: #C63A62; }

/* ---------- WordPress ---------- */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; inset-inline-start: -9999px; }
.form-status .is-error { color: #D93A3A; }
.empty { padding: 28px; text-align: center; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.post-article.no-cover { margin-block-start: 0; padding-block-start: 34px; border-radius: var(--r-lg); }

.prose h2, .prose h3, .prose h4 { color: var(--ink); line-height: 1.6; margin-block: 30px 10px; }
.prose h2 { font-size: 20px; } .prose h3 { font-size: 17px; }
.prose ul, .prose ol { padding-inline-start: 22px; margin-block: 16px; list-style: revert; }
.prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { margin: 22px 0; padding: 14px 20px; border-inline-start: 3px solid var(--primary); background: var(--primary-soft); border-radius: var(--r-sm); color: var(--ink); }
.prose img { border-radius: var(--r-md); }
.prose pre { direction: ltr; text-align: left; overflow-x: auto; padding: 16px; border-radius: var(--r-md); background: var(--surface-2); font-size: 13px; }
.prose > * + * { margin-block-start: 18px; }
.alignleft { float: left; margin: 6px 20px 12px 0; }
.alignright { float: right; margin: 6px 0 12px 20px; }
.aligncenter { margin-inline: auto; }
.wp-caption-text, .wp-element-caption { font-size: 12px; color: var(--faint); text-align: center; }

.pagination { margin-block-start: 28px; }
.pagination .nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.pagination .page-numbers {
  display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding-inline: 10px;
  border-radius: 11px; background: var(--surface); border: 1px solid var(--line); font-size: 14px;
}
.pagination .page-numbers.current { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pagination a.page-numbers:hover { border-color: var(--primary-line); color: var(--primary); }

.comment-list { list-style: none; padding: 0; display: grid; gap: 14px; margin-block: 14px 26px; }
.comment-list .children { list-style: none; padding: 0; display: grid; gap: 14px; margin-block-start: 14px; margin-inline-start: 42px; }
.comment-list .comment { position: relative; }
/* line that connects a reply to the comment it answers */
.comment-list .children > .comment::before {
  content: ""; position: absolute; inset-inline-start: -24px; top: -34px; width: 22px; height: 66px;
  border-inline-start: 2px solid var(--primary-line); border-bottom: 2px solid var(--primary-line);
  border-end-start-radius: 14px;
}
.comment-body {
  position: relative; padding: 22px 24px 18px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.comment-body::before {
  content: ""; position: absolute; inset-block: 18px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--primary-line);
}
.bypostauthor > .comment-body::before { background: var(--primary); }
.bypostauthor > .comment-body { border-color: var(--primary-line); }
.comment-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.comment-author { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 700; color: var(--ink); }
.comment-author .avatar {
  width: 42px; height: 42px; border-radius: 50%; padding: 2px;
  background: conic-gradient(from 200deg, var(--primary), #E7879F, var(--primary-soft) 60%, var(--primary));
}
.comment-author .says { display: none; }
.bypostauthor > .comment-body .fn::after {
  content: "نویسنده"; margin-inline-start: 8px; padding: 1px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  color: var(--primary); background: var(--primary-soft); border: 1px solid var(--primary-line);
}
html[lang="en"] .bypostauthor > .comment-body .fn::after { content: "Author"; }
.comment-metadata {
  margin-inline-start: auto; padding: 2px 10px; border-radius: 999px;
  font-size: 11px; color: var(--muted); background: var(--surface-2);
}
.comment-metadata a { color: inherit; }
.comment-metadata .edit-link { margin-inline-start: 8px; }
.comment-content { margin-block: 12px 10px; font-size: 13.5px; line-height: 2.1; color: var(--muted); }
.comment-content p + p { margin-block-start: 10px; }
.comment-awaiting-moderation { display: block; margin-block-start: 8px; font-size: 12px; color: var(--gold); }
.reply a {
  display: inline-flex; align-items: center; padding: 5px 14px; border-radius: var(--pill);
  font-size: 12px; font-weight: 700; color: var(--primary); background: var(--primary-soft);
  border: 1px solid var(--primary-line); transition: background-color .2s;
}
.reply a:hover { background: var(--surface); }
@media (max-width: 640px) {
  .comment-list .children { margin-inline-start: 24px; }
  .comment-list .children > .comment::before { inset-inline-start: -16px; width: 14px; }
  .comment-body { padding: 18px 18px 16px; }
}
.comment-reply-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; margin-block-end: 14px; }
.comment-reply-title .i { color: var(--primary); }
.comment-reply-title small { margin-inline-start: auto; font-size: 12px; }
.comment-form-inner { display: grid; gap: 14px; }
.logged-in-as { font-size: 13px; color: var(--muted); }
.logged-in-as a { color: var(--primary); }

/* ===== floating mobile call button =====
 * Printed in the footer of every page (archives too), so it lives here and not in blocks.css. */
.vista-fab { display: none; }
@media (max-width: 781px) {
  .vista-fab {
    position: fixed; inset-inline: 14px; bottom: 14px; z-index: 40;
    display: flex; align-items: center; justify-content: center; gap: 8px; height: 52px; border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: var(--on-primary);
    font-weight: 800; font-size: 15px; text-decoration: none;
    box-shadow: 0 14px 30px -12px rgba(94, 15, 36, .75);
  }
  .vista-fab .i { width: 20px; height: 20px; }
  .vista-fab:active { transform: translateY(1px); }
  body { padding-block-end: 78px; }
}
@media (prefers-reduced-motion: no-preference) {
  .vista-fab { animation: fab-in .4s var(--ease) both .6s; }
}
@keyframes fab-in { from { opacity: 0; transform: translateY(14px); } }
