/* ============ Tokens ============ */
:root {
  --bg: #f6f6fb;
  --bg-2: #ecedf5;
  --surface: rgba(255, 255, 255, 0.7);
  --surface-solid: #ffffff;
  --border: rgba(20, 22, 40, 0.09);
  --border-strong: rgba(20, 22, 40, 0.16);
  --text: #12131c;
  --muted: #5b5e73;
  --faint: #a4a7ba;
  --accent: #6d4aff;
  --accent-2: #0ea5c6;
  --accent-3: #e0467c;
  --grad: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 55%, var(--accent-3) 100%);
  --glow: rgba(109, 74, 255, 0.18);
  --blob-a: #b9a8ff;
  --blob-b: #8ee3f5;
  --blob-c: #ffb3cf;
  --shadow: 0 1px 2px rgba(18, 19, 28, 0.04), 0 12px 32px -12px rgba(18, 19, 28, 0.12);
  --radius: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-body: "Inter Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk Variable", "Inter Variable", system-ui, sans-serif;
  --nav-h: 68px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0b10;
    --bg-2: #11131b;
    --surface: rgba(22, 24, 34, 0.6);
    --surface-solid: #151722;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #eef0f7;
    --muted: #9a9db3;
    --faint: #4c4f63;
    --accent: #8b6dff;
    --accent-2: #22d3ee;
    --accent-3: #f472b6;
    --glow: rgba(139, 109, 255, 0.22);
    --blob-a: #4c2fd6;
    --blob-b: #0a7d96;
    --blob-c: #a3226a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 20px 40px -20px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0b10;
  --bg-2: #11131b;
  --surface: rgba(22, 24, 34, 0.6);
  --surface-solid: #151722;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef0f7;
  --muted: #9a9db3;
  --faint: #4c4f63;
  --accent: #8b6dff;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --glow: rgba(139, 109, 255, 0.22);
  --blob-a: #4c2fd6;
  --blob-b: #0a7d96;
  --blob-c: #a3226a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 20px 40px -20px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

:root[lang="fa"] {
  --font-body: "Vazirmatn Variable", Tahoma, system-ui, sans-serif;
  --font-display: "Vazirmatn Variable", Tahoma, system-ui, sans-serif;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

:root[lang="fa"] body { line-height: 1.9; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

svg {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

[dir="rtl"] svg.flip { transform: scaleX(-1); }

.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: clamp(18px, 5vw, 40px);
}

/* ============ Scroll progress & spotlight ============ */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 100;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--grad);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  box-shadow: 0 0 12px var(--accent);
}
[dir="rtl"] .progress span { transform-origin: right; }

.spotlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.6s;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 45%);
}
.has-pointer .spotlight { opacity: 1; }

main, .footer { position: relative; z-index: 1; }

/* ============ Nav ============ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease), transform 0.5s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom-color: var(--border);
}
.nav.is-hidden { transform: translateY(-100%); }

.nav__inner {
  height: var(--nav-h);
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 32px);
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--grad);
  background-size: 200% 200%;
  animation: gradShift 8s ease infinite;
  color: #fff;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 20px -6px var(--accent);
  transition: transform 0.4s var(--ease);
}
.brand:hover .brand__mark { transform: rotate(-8deg) scale(1.06); }
.brand__name { font-size: 15px; white-space: nowrap; }

.nav__links {
  display: flex;
  gap: 4px;
  margin-inline-start: auto;
}
.nav__links a {
  position: relative;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--muted);
  border-radius: 999px;
  transition: color 0.25s, background-color 0.25s;
}
.nav__links a:hover { color: var(--text); background: var(--border); }
.nav__links a.is-active { color: var(--text); }
.nav__links a.is-active::after {
  content: "";
  position: absolute;
  inset-inline: 14px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

.nav__actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.25s, transform 0.25s var(--ease);
}
.icon-btn:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }

.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}
[data-theme-toggle] svg { animation: spinIn 0.5s var(--ease); }

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding-inline: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.25s, transform 0.25s var(--ease), background-color 0.25s;
}
.chip-btn:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.chip-btn[lang="fa"] { font-family: "Vazirmatn Variable", Tahoma, sans-serif; }
.chip-btn[lang="en"] { font-family: "Inter Variable", system-ui, sans-serif; }

.burger { display: none; }
.burger span {
  position: absolute;
  width: 16px;
  height: 1.8px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.4s var(--ease);
}
.burger { position: relative; }
.burger span:first-child { transform: translateY(-3.5px); }
.burger span:last-child { transform: translateY(3.5px); }
.burger[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }

/* ============ Buttons ============ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding-inline: 24px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.3s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn--primary {
  color: #fff;
  background: var(--grad);
  background-size: 200% 200%;
  animation: gradShift 8s ease infinite;
  box-shadow: 0 10px 30px -10px var(--accent);
}
.btn--primary:hover { box-shadow: 0 16px 40px -12px var(--accent); }
.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.8s var(--ease);
}
.btn--primary:hover::after { transform: translateX(120%); }

.btn--ghost {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.btn--ghost:hover { border-color: var(--accent); }
.btn--ghost svg { transition: transform 0.35s var(--ease); }
.btn--ghost:hover svg.flip { transform: translateX(4px); }
[dir="rtl"] .btn--ghost svg.flip { transform: scaleX(-1); }
[dir="rtl"] .btn--ghost:hover svg.flip { transform: scaleX(-1) translateX(4px); }

/* ============ Hero ============ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-block: calc(var(--nav-h) + 40px) 100px;
  overflow: hidden;
}

.hero__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

.blob {
  position: absolute;
  width: 44vmax;
  height: 44vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  will-change: transform;
}
.blob--1 { background: var(--blob-a); top: -18vmax; inset-inline-start: -10vmax; animation: float1 22s ease-in-out infinite; }
.blob--2 { background: var(--blob-b); top: 10vmax; inset-inline-end: -16vmax; animation: float2 26s ease-in-out infinite; }
.blob--3 { background: var(--blob-c); bottom: -24vmax; inset-inline-start: 26vw; width: 36vmax; height: 36vmax; opacity: 0.4; animation: float3 30s ease-in-out infinite; }

.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  animation: gridPan 40s linear infinite;
}

.hero__content { position: relative; }

.status {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 7px 16px 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 28px;
}
[dir="rtl"] .status { padding: 7px 12px 7px 16px; }
.status svg { width: 14px; height: 14px; }
.status__sep { color: var(--faint); }
.status__dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}
.status__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #22c55e;
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.hero__name {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 9vw, 7rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.25em;
}
:root[lang="fa"] .hero__name { letter-spacing: 0; line-height: 1.3; font-weight: 800; }

.hero__name .word { display: inline-block; overflow: hidden; padding-block: 0.06em; }
.hero__name .word > span {
  display: inline-block;
  background: linear-gradient(180deg, var(--text) 30%, color-mix(in srgb, var(--text) 55%, transparent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.js .hero__name .word > span {
  transform: translateY(110%) rotate(4deg);
  animation: rise 1.1s var(--ease) forwards;
  animation-delay: calc(0.25s + var(--d) * 0.12s);
}

.hero__title {
  margin-top: 18px;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  font-weight: 500;
  background: var(--grad);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradShift 8s ease infinite;
  max-width: 44ch;
}

.hero__rotate {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted);
}

.rotator { position: relative; display: inline-grid; color: var(--text); font-weight: 600; }
.rotator__item {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(0.6em);
  filter: blur(6px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), filter 0.6s var(--ease);
  white-space: nowrap;
}
.rotator__item.is-active { opacity: 1; transform: none; filter: none; }
.rotator__item.is-leaving { opacity: 0; transform: translateY(-0.6em); filter: blur(6px); }
.rotator::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0.05em;
  height: 0.12em;
  border-radius: 2px;
  background: var(--grad);
  opacity: 0.45;
}

.hero__cta { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 14px; }

.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  translate: -50% 0;
  width: 26px;
  height: 42px;
  border: 1.8px solid var(--border-strong);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
  opacity: 0;
  animation: fadeIn 1s 1.6s forwards;
}
.scroll-hint span {
  width: 3px;
  height: 8px;
  border-radius: 2px;
  background: var(--text);
  animation: scrollDot 1.8s var(--ease) infinite;
}

/* ============ Marquee ============ */
.marquee {
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--border);
  background: var(--surface);
  padding-block: 18px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  direction: ltr;
}
.marquee__track {
  display: flex;
  align-items: center;
  gap: 28px;
  width: max-content;
  animation: marquee 40s linear infinite;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.marquee__track i { font-style: normal; color: var(--accent); font-size: 0.8em; }
.marquee:hover .marquee__track { animation-play-state: paused; }

/* ============ Stats ============ */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding-block: 72px 0;
}
.stat {
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.stat__value {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat__label { margin-top: 10px; color: var(--muted); font-size: 14.5px; }

/* ============ Sections ============ */
.section { padding-block: clamp(80px, 12vw, 140px) 0; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
:root[lang="fa"] .kicker { letter-spacing: 0; font-size: 14px; }
.kicker::before {
  content: "";
  width: 28px;
  height: 1.5px;
  background: var(--grad);
}

.h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 48px;
  max-width: 20ch;
}
:root[lang="fa"] .h2 { letter-spacing: 0; line-height: 1.45; }

/* About — scroll-scrubbed text */
.about__text {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.6vw, 2.6rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.02em;
  max-width: none;
}
:root[lang="fa"] .about__text { letter-spacing: 0; line-height: 1.8; }
.js .about__text span {
  opacity: 0.16;
  transition: opacity 0.35s linear;
}
.js .about__text span.is-lit { opacity: 1; }

/* Skills */
.skills { display: flex; flex-wrap: wrap; gap: 12px; }
.skill {
  position: relative;
  padding: 14px 22px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 500;
  font-size: 15.5px;
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.3s;
}
.skill:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.skill span { position: relative; z-index: 1; }

/* Glow-follow effect for cards & chips */
[data-glow]::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s;
  background: radial-gradient(260px circle at var(--gx, 50%) var(--gy, 50%), var(--glow), transparent 70%);
  pointer-events: none;
}
[data-glow]:hover::before { opacity: 1; }

/* Card */
.card {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  padding: clamp(22px, 3vw, 32px);
  transition: transform 0.45s var(--ease), border-color 0.3s;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.card > * { position: relative; }

.pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  white-space: nowrap;
}

/* Timeline */
.timeline {
  position: relative;
  display: grid;
  gap: 28px;
  padding-inline-start: 44px;
}
.timeline__rail {
  position: absolute;
  inset-inline-start: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--border);
}
.timeline__rail span {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), var(--accent-3));
  transform-origin: top;
  transform: scaleY(var(--tp, 0));
  box-shadow: 0 0 14px var(--accent);
}

.job { position: relative; }
.job__dot {
  position: absolute;
  inset-inline-start: -39px;
  top: 30px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--faint);
  transition: border-color 0.5s, box-shadow 0.5s, background-color 0.5s;
  z-index: 1;
}
.job.is-reached .job__dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 20%, transparent), 0 0 18px var(--accent);
}

.job__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.job__title {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.job__company { margin-top: 4px; font-weight: 500; color: var(--accent); }
.job__company span { color: var(--muted); font-weight: 400; }

.job__bullets { display: grid; gap: 10px; color: var(--muted); }
.job__bullets li { position: relative; padding-inline-start: 22px; }
.job__bullets li::before {
  content: "";
  position: absolute;
  inset-inline-start: 2px;
  top: 0.72em;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

/* Education */
.edu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.edu__card h3 {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.35;
}
.edu__card p { margin-top: 6px; color: var(--muted); }
.edu__icon {
  position: absolute !important;
  inset-inline-end: 24px;
  top: 24px;
  width: 40px;
  height: 40px;
  color: var(--accent);
  opacity: 0.35;
  transition: opacity 0.4s, transform 0.5s var(--ease);
}
.edu__card:hover .edu__icon { opacity: 0.9; transform: rotate(-8deg) scale(1.1); }

/* Contact */
.contact { padding-bottom: 40px; }
.contact__card {
  position: relative;
  overflow: hidden;
  text-align: center;
  border-radius: 32px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: clamp(40px, 8vw, 88px) clamp(20px, 5vw, 64px);
  isolation: isolate;
}
.contact__card .kicker { justify-content: center; }
.contact__card .kicker::after {
  content: "";
  width: 28px;
  height: 1.5px;
  background: var(--grad);
}
.contact__glow {
  position: absolute;
  inset: -40%;
  z-index: -1;
  background: conic-gradient(from 0deg, var(--blob-a), var(--blob-b), var(--blob-c), var(--blob-a));
  filter: blur(90px);
  opacity: 0.35;
  animation: spin 18s linear infinite;
}
.contact__heading {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 7vw, 4.6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
}
:root[lang="fa"] .contact__heading { letter-spacing: 0; line-height: 1.4; }
.contact__text {
  margin: 20px auto 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 1.05rem;
}
.contact__email {
  margin-top: 36px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.contact__email a {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: 600;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 2px;
  transition: background-size 0.5s var(--ease);
  word-break: break-all;
}
.contact__email a:hover { background-size: 100% 2px; }
.contact__links {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-block: 32px calc(32px + env(safe-area-inset-bottom, 0px));
  color: var(--muted);
  font-size: 14px;
}
.footer__top { display: inline-flex; align-items: center; gap: 8px; transition: color 0.25s; }
.footer__top:hover { color: var(--text); }
.footer__top svg { transition: transform 0.35s var(--ease); }
.footer__top:hover svg { transform: translateY(-3px); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  z-index: 200;
  translate: -50% 20px;
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease), translate 0.45s var(--ease);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.4);
}
.toast.is-visible { opacity: 1; translate: -50% 0; }

/* ============ Reveal ============ */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(6px);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease),
    filter 0.9s var(--ease);
  transition-delay: calc(var(--d, 0) * 70ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; filter: none; }
.js .hero [data-reveal] { transition-delay: calc(0.3s + var(--d, 0) * 110ms); }

.js .job[data-reveal] { transform: translateX(-32px); }
html.js[dir="rtl"] .job[data-reveal] { transform: translateX(32px); }
.js .job[data-reveal].is-in { transform: none; }
.js .skill[data-reveal] { transform: translateY(18px) scale(0.92); transition-delay: calc(var(--d, 0) * 45ms); }
.js .skill[data-reveal].is-in { transform: none; }
/* keep hover lift working once revealed */
.js .skill[data-reveal].is-in:hover { transform: translateY(-4px); transition-delay: 0s; }
.js .card[data-reveal].is-in:hover { transform: translateY(-3px); transition-delay: 0s; }

/* ============ Keyframes ============ */
@keyframes rise { to { transform: none; } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes gradShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes float1 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(8vmax, 6vmax) scale(1.12); } }
@keyframes float2 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-10vmax, 8vmax) scale(0.9); } }
@keyframes float3 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-6vmax, -8vmax) scale(1.15); } }
@keyframes gridPan { to { background-position: 56px 56px; } }
@keyframes ping { 75%, 100% { transform: scale(2.4); opacity: 0; } }
@keyframes scrollDot { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinIn { from { transform: rotate(-90deg) scale(0.5); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .burger { display: grid; }
  .brand__name { display: none; }
  .nav__links {
    position: fixed;
    inset: calc(var(--nav-h) + env(safe-area-inset-top, 0px)) 12px auto 12px;
    flex-direction: column;
    gap: 2px;
    padding: 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
  }
  .nav__links.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav__links a { padding: 14px 16px; font-size: 16px; border-radius: 12px; }
  .nav__links a.is-active::after { display: none; }
  .nav__links a.is-active { background: var(--border); }
  .nav__actions { margin-inline-start: auto; }
}

@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr; gap: 12px; padding-top: 48px; }
  .stat { display: flex; align-items: center; gap: 18px; padding: 20px 22px; }
  .stat__label { margin-top: 0; }
  .edu { grid-template-columns: 1fr; }
  .timeline { padding-inline-start: 32px; }
  .timeline__rail { inset-inline-start: 6px; }
  .job__dot { inset-inline-start: -32px; top: 26px; }
  .hero__cta .btn { flex: 1 1 auto; justify-content: center; }
  .contact__links .btn { flex: 1 1 100%; justify-content: center; }
  .blob { filter: blur(60px); }
}

@media (max-width: 380px) {
  .chip-btn { padding-inline: 10px; }
}

@media (hover: none) {
  [data-glow]::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .js [data-reveal], .js .hero__name .word > span { opacity: 1; transform: none; filter: none; }
  .js .about__text span { opacity: 1; }
  .marquee__track { animation: none; }
}

@media print {
  .nav, .progress, .spotlight, .hero__bg, .scroll-hint, .marquee, .toast { display: none !important; }
  .js [data-reveal], .js .about__text span { opacity: 1 !important; transform: none !important; filter: none !important; }
}

/* ============ Social links ============ */
.hero__social, .footer__social { display: flex; gap: 10px; flex-wrap: wrap; }
.hero__social { margin-top: 28px; }
.social {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: color 0.25s, border-color 0.25s, transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.social svg { width: 19px; height: 19px; }
.social:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -12px var(--accent);
}
.footer__social .social { width: 38px; height: 38px; border-radius: 12px; }
.footer__social .social svg { width: 17px; height: 17px; }


/* ============ Projects ============ */
.projects { display: grid; gap: 24px; }
.project {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  overflow: hidden;
}
.js .project[data-reveal].is-in,
.js .project[data-reveal].is-in:hover {
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.6s var(--ease), border-color 0.3s, opacity 0.9s var(--ease), filter 0.9s var(--ease);
  transition-delay: 0s;
}
.js .project[data-reveal].is-in.is-tilting { transition: transform 0.12s linear, border-color 0.3s; }
.project::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.project:hover::after { opacity: 1; }

.project__name {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
:root[lang="fa"] .project__name { letter-spacing: 0; line-height: 1.5; }
.project__desc { margin-top: 12px; color: var(--muted); }
.project__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.project__tags li {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.project__link { margin-top: 24px; height: 46px; }
.project__link svg { transition: transform 0.35s var(--ease); }
.project__link:hover svg { transform: translate(3px, -3px); }
[dir="rtl"] .project__link svg { transform: scaleX(-1); }
[dir="rtl"] .project__link:hover svg { transform: scaleX(-1) translate(3px, -3px); }

/* Faux browser preview */
.browser {
  display: block;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: var(--bg-2);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.45);
  transition: transform 0.6s var(--ease);
  direction: ltr;
}
.project:hover .browser { transform: translateY(-6px) scale(1.015); }
.browser__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.browser__bar > span { width: 10px; height: 10px; border-radius: 50%; }
.browser__bar > span:nth-child(1) { background: #ff5f57; }
.browser__bar > span:nth-child(2) { background: #febc2e; }
.browser__bar > span:nth-child(3) { background: #28c840; }
.browser__url {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-inline-start: 10px;
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--border);
  font-size: 12px;
  color: var(--muted);
  font-family: "Inter Variable", system-ui, sans-serif;
}
.browser__url svg { width: 11px; height: 11px; }
.browser__screen {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 58px);
  gap: 10px;
  padding: 14px;
  background:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 55%);
}
.browser__widget {
  position: relative;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
.browser__widget i {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--border-strong);
}
.browser__widget i:nth-child(2) { width: 70%; }
.browser__widget i:nth-child(3) { width: 45%; }
.browser__widget::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.12) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: shimmer 3.2s ease-in-out infinite;
}
.w1 { grid-column: span 2; }
.w2 { grid-column: span 2; grid-row: span 2; }
.w2 svg { width: 100%; height: 100%; stroke: var(--accent-2); stroke-width: 2.2; fill: none; }
.w2 svg path { stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw 2.6s var(--ease) 0.4s infinite alternate; }
.w4 { align-items: center; justify-content: center; }
.w4 b {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 4px solid var(--border-strong);
  border-top-color: var(--accent-3);
  animation: spin 2.4s linear infinite;
}
.w5 { grid-column: span 4; flex-direction: row !important; align-items: center; }
.w5 i { flex: 1; height: 10px; width: auto !important; }
.w5 i:nth-child(odd) { background: color-mix(in srgb, var(--accent) 45%, transparent); }

/* ============ Support page ============ */
.support {
  position: relative;
  padding-block: calc(var(--nav-h) + clamp(48px, 8vw, 96px)) 40px;
}
.support__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.support__bg .blob { width: 34vmax; height: 34vmax; opacity: 0.3; }
.support__intro { max-width: 820px; margin-inline: auto; text-align: center; }
.support__intro .kicker { justify-content: center; }
.support__heading {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 7vw, 4.4rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
}
:root[lang="fa"] .support__heading { letter-spacing: 0; line-height: 1.45; }
.support__text { margin-top: 18px; color: var(--muted); font-size: 1.05rem; }

.support__grid {
  margin-top: clamp(40px, 6vw, 72px);
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}

/* Bank card */
.bank-card-wrap { perspective: 1200px; display: flex; justify-content: center; }
.bank-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1.586;
  border-radius: 22px;
  padding: clamp(18px, 5%, 28px);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.25), transparent 40%),
    linear-gradient(135deg, #3b1fd1 0%, #6d4aff 35%, #0ea5c6 78%, #e0467c 125%);
  box-shadow: 0 40px 80px -30px rgba(76, 47, 214, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.7s var(--ease);
  animation: cardFloat 6s ease-in-out infinite;
  direction: ltr;
}
.bank-card.is-tilting { transition: transform 0.1s linear; animation-play-state: paused; }
.bank-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-radial-gradient(circle at 110% 120%, transparent 0 18px, rgba(255, 255, 255, 0.07) 18px 19px);
}
.bank-card__shine {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(circle at var(--sx, 30%) var(--sy, 20%), rgba(255, 255, 255, 0.35), transparent 45%);
  mix-blend-mode: overlay;
}
.bank-card__top { display: flex; justify-content: space-between; align-items: center; }
.bank-card__bank { font-weight: 700; font-size: 15px; letter-spacing: 0.04em; }
:root[lang="fa"] .bank-card__bank { letter-spacing: 0; }
.bank-card__contactless { width: 24px; height: 24px; opacity: 0.85; }
.bank-card__chip {
  width: 48px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f7e1a1, #c9a44c 60%, #f2d68a);
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  padding: 6px;
  gap: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.bank-card__chip i { border-top: 1px solid rgba(0, 0, 0, 0.25); }
.bank-card__number {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: "Space Grotesk Variable", "Inter Variable", monospace;
  font-size: clamp(1.05rem, 4.4vw, 1.5rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  font-variant-numeric: tabular-nums;
}
.bank-card__bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.bank-card__bottom small {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.75;
}
.bank-card__bottom span { font-weight: 600; font-size: 15px; }
:root[lang="fa"] .bank-card__bottom small { letter-spacing: 0; font-size: 11px; }
.bank-card__logo { display: flex; }
.bank-card__logo i { width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); }
.bank-card__logo i + i { margin-left: -12px; background: rgba(255, 255, 255, 0.3); }

/* Bank details */
.bank-details { display: grid; gap: 0; padding: clamp(14px, 3vw, 24px); }
.bank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 12px;
  border-radius: 14px;
  transition: background-color 0.25s;
}
.bank-row:hover { background: var(--border); }
.bank-row__text { display: grid; gap: 2px; min-width: 0; }
.bank-row__label { font-size: 13px; color: var(--muted); }
.bank-row__value {
  font-weight: 600;
  font-size: clamp(0.98rem, 2.4vw, 1.12rem);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.bank-row__value[dir="ltr"] { font-family: "Space Grotesk Variable", "Inter Variable", monospace; letter-spacing: 0.03em; }
[dir="rtl"] .bank-row__value[dir="ltr"] { text-align: right; }
.bank-row__copy { flex-shrink: 0; height: 36px; }
.bank-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--muted);
  font-size: 13.5px;
}
.bank-note svg { margin-top: 3px; color: var(--accent); }

.support__thanks {
  margin-top: clamp(48px, 7vw, 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  color: var(--muted);
}
[dir="rtl"] svg.flip-back { transform: scaleX(-1); }

/* Extra keyframes */
@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
@keyframes shimmer { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes cardFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }

@media (max-width: 900px) {
  .project { grid-template-columns: 1fr; }
  .browser { order: -1; }
  .support__grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .browser__screen { grid-template-rows: repeat(3, 44px); gap: 8px; padding: 10px; }
  .footer { justify-content: center; text-align: center; }
  .bank-row { padding: 12px 6px; }
}
@media (hover: none) {
  .js .project[data-reveal].is-in, .bank-card { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bank-card { animation: none; }
}

main { overflow-x: clip; }
