@font-face {
  font-family: "Vazirmatn";
  src: url("assets/fonts/Vazirmatn-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy-950: #041528;
  --navy-900: #071f3d;
  --navy-800: #0b2e57;
  --blue-600: #075bd8;
  --blue-500: #1478ff;
  --cyan-400: #63ddff;
  --ink: #0a1625;
  --muted: #5b6a7d;
  --paper: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #eef2f7;
  --border: #dce3ec;
  --shadow: 0 32px 90px rgba(0, 14, 35, .28);
  --radius-lg: 34px;
  --radius-md: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

html[data-theme="dark"] {
  --ink: #f4f8ff;
  --muted: #a6b5c9;
  --paper: #061426;
  --surface: #0a203a;
  --surface-soft: #102b49;
  --border: #23415f;
  --shadow: 0 38px 100px rgba(0, 0, 0, .46);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 8%, rgba(20, 120, 255, .2), transparent 30rem),
    radial-gradient(circle at 86% 86%, rgba(99, 221, 255, .14), transparent 28rem),
    var(--navy-950);
  font-family: "Vazirmatn", Tahoma, sans-serif;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

button, a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

a { color: inherit; }

.skip-link {
  position: fixed;
  inset: 10px auto auto 10px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  color: #fff;
  background: var(--blue-600);
  transform: translateY(-150%);
  transition: transform .2s ease;
}

.skip-link:focus { transform: translateY(0); }

.ambient {
  position: fixed;
  z-index: -1;
  width: 26rem;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 50%;
  pointer-events: none;
}

.ambient::before, .ambient::after {
  content: "";
  position: absolute;
  inset: 17%;
  border: inherit;
  border-radius: inherit;
}

.ambient::after { inset: 35%; }
.ambient--one { inset: -10rem auto auto -10rem; animation: ambientSpin 28s linear infinite; }
.ambient--two { inset: auto -12rem -12rem auto; animation: ambientSpin 34s linear infinite reverse; }

.page-shell {
  width: min(1240px, calc(100% - 32px));
  margin-inline: auto;
  padding-block: clamp(24px, 5vw, 72px);
}

.profile-card {
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(20px, 4vw, 46px);
  border-bottom: 1px solid var(--border);
}

.brand {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  direction: ltr;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .16em;
  text-decoration: none;
}

.topbar__actions { display: flex; align-items: center; gap: 12px; }

.availability {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.availability i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #18b870;
  box-shadow: 0 0 0 5px rgba(24, 184, 112, .12);
  animation: pulse 2.4s ease-in-out infinite;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface-soft);
  cursor: pointer;
  transition: transform .2s var(--ease), border-color .2s ease, background .2s ease;
}

.theme-toggle:hover { transform: translateY(-2px); border-color: var(--blue-500); }
.theme-toggle svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle__moon { display: none; }
html[data-theme="dark"] .theme-toggle__sun { display: none; }
html[data-theme="dark"] .theme-toggle__moon { display: block; }

.profile-layout { display: grid; grid-template-columns: minmax(330px, .82fr) minmax(0, 1.42fr); direction: ltr; }
.profile-layout > * { direction: rtl; }

.visual-panel {
  position: sticky;
  top: 24px;
  align-self: start;
  height: min(820px, calc(100vh - 48px));
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(26px, 4vw, 46px);
  color: #fff;
  background: var(--navy-900);
  isolation: isolate;
}

.wordscape {
  position: absolute;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, transparent 0 112px, rgba(99, 221, 255, .24) 113px 114px, transparent 115px 158px, rgba(20, 120, 255, .2) 159px 160px, transparent 161px 220px, rgba(255, 255, 255, .08) 221px 222px, transparent 223px),
    radial-gradient(circle at 18% 14%, rgba(20, 120, 255, .32), transparent 24%),
    radial-gradient(circle at 82% 78%, rgba(99, 221, 255, .14), transparent 26%),
    linear-gradient(155deg, #082a50, var(--navy-950) 72%);
  animation: patternBreathe 8s var(--ease) infinite alternate;
}

.wordscape::before,
.wordscape::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.wordscape::before {
  inset: -28%;
  background: conic-gradient(from 20deg at 50% 50%, transparent 0 9%, rgba(99, 221, 255, .2) 9.5% 10%, transparent 10.5% 27%, rgba(20, 120, 255, .24) 27.5% 28%, transparent 28.5% 61%, rgba(255, 255, 255, .1) 61.5% 62%, transparent 62.5% 100%);
  mask-image: radial-gradient(circle, transparent 0 18%, #000 35% 67%, transparent 79%);
  animation: patternSpin 26s linear infinite;
}

.wordscape::after {
  inset: 0;
  opacity: .34;
  background-image: radial-gradient(circle, rgba(99, 221, 255, .8) 0 1px, transparent 1.6px);
  background-size: 34px 34px;
  mask-image: linear-gradient(135deg, transparent 8%, #000 42%, transparent 88%);
  animation: patternFlow 13s linear infinite;
}

.visual-panel::before {
  content: "";
  position: absolute;
  z-index: -2;
  width: 26rem;
  height: 26rem;
  inset: 30% auto auto 50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 120, 255, .3), transparent 68%);
  transform: translate(-50%, -50%);
}

.visual-panel__grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .34;
  background:
    radial-gradient(circle at 12% 72%, var(--cyan-400) 0 3px, transparent 4px),
    radial-gradient(circle at 84% 20%, var(--blue-500) 0 2px, transparent 3px),
    radial-gradient(circle at 76% 88%, rgba(255,255,255,.7) 0 1px, transparent 2px);
  animation: orbitMarkers 11s var(--ease) infinite alternate;
}

.visual-panel__eyebrow, .visual-panel__footer {
  display: flex;
  align-items: center;
  gap: 12px;
  direction: ltr;
  color: rgba(255, 255, 255, .68);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .18em;
}

.visual-panel__eyebrow span { color: var(--cyan-400); }
.visual-panel__footer .line { height: 1px; flex: 1; background: rgba(255, 255, 255, .25); }

.portrait-wrap {
  position: relative;
  width: min(82%, 340px);
  aspect-ratio: 1;
  align-self: center;
  margin: clamp(34px, 6vh, 56px) auto auto;
  border-radius: 48% 48% 44% 56% / 48% 38% 62% 52%;
}

.portrait {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  border: 8px solid rgba(255, 255, 255, .92);
  border-radius: inherit;
  object-fit: cover;
  box-shadow: 0 28px 60px rgba(0, 0, 0, .38);
}

.portrait-orbit { position: absolute; inset: -34px; z-index: 1; animation: orbit 16s linear infinite; }
.portrait-orbit::before { content: ""; position: absolute; inset: 0; border: 1px solid rgba(99, 221, 255, .25); border-radius: 50%; }
.portrait-orbit span { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--cyan-400); box-shadow: 0 0 18px var(--cyan-400); }
.portrait-orbit span:nth-child(1) { inset: 5% auto auto 26%; }
.portrait-orbit span:nth-child(2) { inset: auto 2% 30% auto; width: 5px; height: 5px; }
.portrait-orbit span:nth-child(3) { inset: auto auto 2% 45%; width: 7px; height: 7px; }

.portrait-badge {
  position: absolute;
  z-index: 3;
  inset: auto -13px 8% auto;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 5px solid var(--navy-900);
  border-radius: 50%;
  color: var(--navy-950);
  background: var(--cyan-400);
  direction: ltr;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -.05em;
}

.content-panel { padding: clamp(32px, 5vw, 68px); background: var(--surface); }
.intro-copy { max-width: 670px; }
.kicker { margin: 0 0 10px; color: var(--blue-600); font-size: 13px; font-weight: 800; letter-spacing: -.01em; }

h1 { margin: 0; line-height: 1.08; }
.name-fa { display: block; font-size: clamp(42px, 5.4vw, 76px); font-weight: 900; letter-spacing: -.06em; }
.name-en { display: block; margin-top: 11px; color: var(--muted); font-size: clamp(18px, 2vw, 26px); font-weight: 620; letter-spacing: .01em; }
.role { margin: 23px 0 0; color: var(--muted); font-size: clamp(15px, 1.5vw, 18px); }
.role b { margin-inline: 7px; color: var(--blue-500); }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(34px, 5vw, 52px);
}

.contact-card {
  position: relative;
  min-height: 82px;
  display: grid;
  grid-template-columns: 48px 1fr 24px;
  align-items: center;
  gap: 13px;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  text-decoration: none;
  background: var(--surface-soft);
  transition: color .24s ease, background .24s ease, border-color .24s ease, transform .24s var(--ease), box-shadow .24s ease;
}

.contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(120deg, var(--blue-600), #06459f);
  transition: opacity .24s ease;
}

.contact-card > * { position: relative; z-index: 1; }
.contact-card:hover { color: #fff; border-color: transparent; transform: translateY(-4px); box-shadow: 0 14px 30px rgba(7, 91, 216, .2); }
.contact-card:hover::before { opacity: 1; }
.contact-card:active { transform: translateY(-1px) scale(.99); }
.contact-card:hover small, .contact-card:hover .contact-card__arrow { color: rgba(255, 255, 255, .72); }

.contact-card__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: var(--navy-900);
}

.contact-card__icon svg { width: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.contact-card__icon .fill { fill: currentColor; stroke: none; }
.contact-card__icon--text { direction: ltr; font-family: Arial, sans-serif; font-size: 22px; font-weight: 800; }
.contact-card strong, .contact-card small { display: block; }
.contact-card strong { font-size: 14px; font-weight: 800; }
.contact-card small { margin-top: -1px; color: var(--muted); direction: ltr; font-size: 11px; font-weight: 560; text-align: right; transition: color .24s ease; }
.contact-card__arrow { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); transition: color .24s ease, transform .24s var(--ease); }
.contact-card:hover .contact-card__arrow { transform: translate(-2px, -2px); }

.cv-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
  padding: 17px 20px 17px 17px;
  overflow: hidden;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(120deg, var(--blue-600), #6b2fe8 120%);
  box-shadow: 0 16px 34px rgba(7, 91, 216, .24);
  text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s ease;
}

.cv-button:hover { transform: translateY(-4px); box-shadow: 0 20px 42px rgba(7, 91, 216, .34); }
.cv-button:active { transform: translateY(-1px) scale(.995); }
.cv-button__label small, .cv-button__label strong { display: block; }
.cv-button__label small { color: rgba(255,255,255,.7); font-size: 11px; }
.cv-button__label strong { margin-top: 2px; font-size: 17px; }
.cv-button__label i { margin-inline: 4px; color: var(--cyan-400); font-style: normal; }
.cv-button__icon { width: 47px; height: 47px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.2); border-radius: 15px; background: rgba(255,255,255,.13); }
.cv-button__icon svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.about { margin-top: clamp(40px, 6vw, 66px); padding-top: 26px; border-top: 1px solid var(--border); }
.section-heading { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .12em; }
.section-heading__line { height: 1px; flex: 1; background: var(--border); }
.about h2 { max-width: 620px; margin: 20px 0 12px; font-size: clamp(24px, 3.1vw, 38px); line-height: 1.42; letter-spacing: -.04em; }
.about p { max-width: 640px; margin: 0; color: var(--muted); font-size: 15px; }
.expertise { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.expertise li { padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--ink); background: var(--surface-soft); font-size: 12px; font-weight: 650; }

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px clamp(20px, 4vw, 46px);
  border-top: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface-soft);
  direction: ltr;
  font-size: 11px;
}

.footer p { margin: 0; }
.footer a { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; direction: rtl; font-weight: 650; text-decoration: none; }
.footer a:hover { color: var(--blue-500); }
.footer svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 3px solid var(--cyan-400); outline-offset: 4px; }

.reveal { opacity: 0; transition: opacity .65s var(--ease), transform .65s var(--ease); transition-delay: var(--delay, 0ms); }
.reveal[data-reveal="up"] { transform: translateY(24px); }
.reveal[data-reveal="down"] { transform: translateY(-18px); }
.reveal[data-reveal="right"] { transform: translateX(-24px); }
.reveal.is-visible { opacity: 1; transform: translate3d(0, 0, 0); }

@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.78); opacity: .65; } }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes ambientSpin { to { transform: rotate(360deg); } }
@keyframes patternSpin { to { transform: rotate(360deg); } }
@keyframes patternFlow { to { background-position: 68px 34px; } }
@keyframes patternBreathe { from { filter: saturate(.9) brightness(.92); } to { filter: saturate(1.14) brightness(1.06); } }
@keyframes orbitMarkers { from { transform: translate3d(-8px, 4px, 0) rotate(-2deg); } to { transform: translate3d(9px, -8px, 0) rotate(2deg); } }

@media (max-width: 900px) {
  .page-shell { width: min(720px, calc(100% - 24px)); padding-block: 18px; }
  .profile-card { overflow: hidden; }
  .profile-layout { grid-template-columns: 1fr; }
  .visual-panel { position: relative; top: auto; height: auto; min-height: 500px; padding: 26px; }
  .portrait-wrap { width: min(58vw, 290px); }
  .content-panel { padding: 40px clamp(22px, 6vw, 48px) 52px; }
  .intro-copy { text-align: center; margin-inline: auto; }
  .name-fa { font-size: clamp(40px, 10vw, 62px); }
  .role { max-width: 520px; margin-inline: auto; }
}

@media (max-width: 560px) {
  :root { --radius-lg: 26px; }
  .page-shell { width: min(100% - 16px, 480px); padding-block: 8px; }
  .topbar { min-height: 70px; padding: 12px 16px; }
  .brand { font-size: 13px; }
  .availability { font-size: 11px; }
  .visual-panel { min-height: 430px; padding: 22px; }
  .visual-panel__eyebrow { font-size: 9px; }
  .portrait-wrap { width: min(64vw, 260px); }
  .portrait { border-width: 6px; }
  .portrait-orbit { inset: -22px; }
  .portrait-badge { width: 52px; height: 52px; border-width: 4px; }
  .content-panel { padding: 34px 18px 44px; }
  .name-fa { font-size: clamp(38px, 12vw, 53px); }
  .name-en { font-size: 18px; }
  .role { font-size: 14px; }
  .contact-grid { grid-template-columns: 1fr; gap: 10px; margin-top: 34px; }
  .contact-card { min-height: 76px; }
  .cv-button { margin-top: 14px; }
  .about { margin-top: 45px; }
  .about h2 { font-size: 25px; }
  .footer { padding: 18px; }
}

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