@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/vazirmatn-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/vazirmatn-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0A0A0F;
  --bg-soft: #111118;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.05);
  --text: #EDEDF2;
  --muted: #9A9AA6;
  --accent: #7C5CFF;
  --accent-2: #22D3EE;
  --line: rgba(255, 255, 255, 0.08);
  --max: 1100px;
  --nav-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.is-fa {
  font-family: "Vazirmatn", "Inter", system-ui, sans-serif;
  line-height: 1.9;
}

h1, h2, h3, p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

::selection {
  background: rgba(124, 92, 255, 0.35);
}

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

.skip {
  position: absolute;
  inset-inline-start: 16px;
  top: -64px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #0A0A0F;
  font-weight: 600;
  transition: top 0.25s var(--ease);
}

.skip:focus {
  top: 16px;
}

.glow-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.glow {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}

.glow--a {
  width: 46vw;
  height: 46vw;
  top: -12vw;
  inset-inline-start: -6vw;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.55), transparent 65%);
  animation: drift 22s var(--ease) infinite alternate;
}

.glow--b {
  width: 40vw;
  height: 40vw;
  top: 30vh;
  inset-inline-end: -10vw;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.38), transparent 65%);
  animation: drift 26s var(--ease) infinite alternate-reverse;
}

.glow--c {
  width: 52vw;
  height: 52vw;
  bottom: -22vw;
  inset-inline-start: 20vw;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.3), transparent 68%);
  animation: drift 30s var(--ease) infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4vw, 3vh, 0) scale(1.12); }
}

.nav {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 50;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled,
.nav.is-open {
  background: rgba(10, 10, 15, 0.82);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.nav__inner {
  max-width: var(--max);
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0A0A0F;
  font-weight: 700;
}

.nav__links {
  display: flex;
  gap: 26px;
  margin-inline-start: auto;
  font-size: 0.92rem;
  color: var(--muted);
}

.nav__links a {
  transition: color 0.3s var(--ease);
}

.nav__links a:hover,
.nav__links a[aria-current="page"] {
  color: var(--text);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav__toggle {
  display: none;
  position: relative;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}

.nav__toggleBar {
  position: absolute;
  inset-inline: 12px;
  top: 50%;
  height: 1.6px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.3s var(--ease);
}

.nav__toggleBar:nth-child(1) {
  transform: translateY(-4px);
}

.nav__toggleBar:nth-child(2) {
  transform: translateY(4px);
}

.nav.is-open .nav__toggleBar:nth-child(1) {
  transform: rotate(45deg);
}

.nav.is-open .nav__toggleBar:nth-child(2) {
  transform: rotate(-45deg);
}

.lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.lang:hover {
  border-color: var(--accent);
  color: var(--text);
}

.lang__current {
  color: var(--text);
  font-weight: 600;
}

.lang__sep {
  opacity: 0.4;
}

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: calc(var(--nav-h) + 40px) 24px 80px;
  position: relative;
}

.hero__eyebrow {
  font-size: 0.9rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 22px;
}

.hero__title {
  font-size: clamp(2.8rem, 9vw, 6rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, #ffffff 20%, #b9b9c8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__role {
  margin-top: 22px;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  color: var(--text);
}

.hero__tagline {
  margin-top: 12px;
  max-width: 46ch;
  color: var(--muted);
}

.hero__actions {
  margin-top: 36px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0A0A0F;
  font-weight: 600;
}

.btn--ghost {
  border-color: var(--line);
  color: var(--text);
}

.btn--lg {
  padding: 16px 34px;
  font-size: 1.05rem;
}

.hero__scroll {
  position: absolute;
  bottom: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__scrollLine {
  width: 1px;
  height: 46px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: pulse 2.4s var(--ease) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.7); }
  50% { opacity: 1; transform: scaleY(1); }
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 110px 24px;
}

.section__head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 46px;
  flex-wrap: wrap;
}

.section__index {
  font-size: 0.82rem;
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}

.section__title {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.section__subtitle {
  flex-basis: 100%;
  color: var(--muted);
  margin-top: 6px;
}

.about {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: center;
}

.about__text {
  display: grid;
  gap: 18px;
  font-size: 1.08rem;
  color: #d3d3dd;
}

.about__portrait {
  aspect-ratio: 1;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 30% 25%, rgba(124, 92, 255, 0.35), transparent 60%), var(--bg-soft);
  display: grid;
  place-items: center;
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.12);
}

.statement {
  --p: 0;
  position: relative;
  padding: 150px 24px;
  text-align: center;
  overflow: hidden;
}

.statement::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(124, 92, 255, 0.28), transparent 55%);
  opacity: calc(0.25 + 0.75 * var(--p));
  transform: scale(calc(0.8 + 0.4 * var(--p)));
  transition: opacity 0.2s linear, transform 0.2s linear;
  pointer-events: none;
}

.statement__text {
  position: relative;
  max-width: 20ch;
  margin: 0 auto;
  font-size: clamp(1.8rem, 5.5vw, 3.4rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
  opacity: calc(0.35 + 0.65 * var(--p));
  transform: translateY(calc((1 - var(--p)) * 28px)) scale(calc(0.94 + 0.06 * var(--p)));
  transition: opacity 0.2s linear, transform 0.2s linear;
}

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.45s var(--ease), border-color 0.45s var(--ease), box-shadow 0.45s var(--ease), background 0.45s var(--ease);
}

.card:hover {
  border-color: rgba(124, 92, 255, 0.5);
  background: var(--surface-2);
}

.card__thumb {
  position: relative;
  aspect-ratio: 1 / 0.7;
  background: linear-gradient(135deg, hsl(var(--h) 70% 55% / 0.28), hsl(calc(var(--h) + 60) 70% 55% / 0.18)), var(--bg-soft);
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.card__monogram {
  font-size: 3.4rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.16);
}

.card__body {
  padding: 22px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card__tag {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}

.card__title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.card__desc {
  color: var(--muted);
  font-size: 0.95rem;
}

.card__link {
  margin-top: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
}

.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 24px 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.footer__email {
  color: var(--text);
  transition: color 0.3s var(--ease);
}

.footer__email:hover {
  color: var(--accent);
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.hero__eyebrow { transition-delay: 0.05s; }
.hero__title { transition-delay: 0.14s; }
.hero__role { transition-delay: 0.24s; }
.hero__tagline { transition-delay: 0.32s; }
.hero__actions { transition-delay: 0.4s; }
.hero__scroll { transition-delay: 0.5s; }

@media (hover: hover) {
  .btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px -12px rgba(124, 92, 255, 0.75);
  }
  .btn--ghost:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
  }
  .card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 60px -30px rgba(124, 92, 255, 0.7);
  }
}

@media (max-width: 820px) {
  .nav__links {
    position: absolute;
    top: var(--nav-h);
    inset-inline: 0;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 12px 24px 20px;
    display: none;
    font-size: 1rem;
  }
  .nav.is-open .nav__links {
    display: flex;
  }
  .nav__links a {
    padding: 12px 0;
  }
  .nav__actions {
    margin-inline-start: auto;
  }
  .nav__toggle {
    display: inline-block;
  }
  .about {
    grid-template-columns: 1fr;
    gap: 34px;
  }
  .about__portrait {
    max-width: 280px;
  }
  .section {
    padding: 84px 22px;
  }
  .glow {
    filter: blur(60px);
    opacity: 0.42;
  }
}

@media (max-width: 520px) {
  .nav__name {
    display: none;
  }
  .projects {
    grid-template-columns: 1fr;
  }
  .statement {
    padding: 110px 22px;
  }
  .footer {
    flex-direction: column;
    text-align: center;
  }
}

[dir="rtl"] .hero__eyebrow,
[dir="rtl"] .hero__scroll {
  letter-spacing: 0;
}

[dir="rtl"] .card__tag {
  text-transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .glow,
  .hero__scrollLine {
    animation: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .statement__text,
  .statement::before {
    transition: none;
  }
}
