:root {
  color-scheme: dark;
  --bg: #05070d;
  --bg-soft: #0b1020;
  --surface: rgba(15, 23, 42, 0.72);
  --surface-strong: rgba(19, 29, 52, 0.92);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #a8b3c7;
  --muted-strong: #cbd5e1;
  --blue: #38bdf8;
  --violet: #8b5cf6;
  --green: #34d399;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(56, 189, 248, 0.16), transparent 34rem),
    radial-gradient(circle at 92% 18%, rgba(139, 92, 246, 0.18), transparent 30rem),
    linear-gradient(180deg, #05070d 0%, #080b13 46%, #05070d 100%);
  color: var(--text);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 78%);
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(5, 7, 13, 0.78);
  backdrop-filter: blur(18px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  text-decoration: none;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(139, 92, 246, 0.2));
  box-shadow: 0 0 28px rgba(56, 189, 248, 0.18);
  color: #e0f2fe;
  font-size: 0.86rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-links a {
  text-decoration: none;
  transition: color 180ms ease;
}

.nav-links a:hover {
  color: var(--text);
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
  color: rgba(203, 213, 225, 0.55);
  direction: ltr;
}

.language-button {
  padding: 6px 8px;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.language-button:hover {
  color: var(--text);
}

.language-button.is-active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.95), rgba(139, 92, 246, 0.95));
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.22);
  color: #020617;
}

.section-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.75fr);
  gap: 56px;
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: 72px 0 56px;
}

.hero-copy {
  max-width: 780px;
}

.eyebrow,
.card-kicker {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 14px;
  font-size: clamp(3.4rem, 13vw, 7.9rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.role {
  margin-bottom: 22px;
  color: var(--muted-strong);
  font-size: clamp(1.18rem, 4vw, 1.8rem);
  font-weight: 700;
}

.hero-text {
  max-width: 680px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: clamp(1rem, 2.5vw, 1.18rem);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 800;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: linear-gradient(135deg, var(--blue), var(--violet));
  color: #020617;
  box-shadow: 0 18px 42px rgba(56, 189, 248, 0.22);
}

.button-secondary {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.74);
  color: var(--text);
}

.button-secondary:hover {
  border-color: rgba(56, 189, 248, 0.52);
}

.hero-panel,
.project-card,
.experience-card,
.contact-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-strong), rgba(15, 23, 42, 0.64));
  box-shadow: var(--shadow);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: 24px;
}

.hero-panel::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.12), transparent 44%),
    linear-gradient(315deg, rgba(52, 211, 153, 0.08), transparent 42%);
  pointer-events: none;
}

.panel-topline,
.signal-card {
  position: relative;
}

.panel-topline {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: var(--muted-strong);
  font-size: 0.9rem;
  font-weight: 700;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.9);
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.signal-card {
  min-height: 122px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.42);
}

.signal-primary {
  min-height: 150px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(139, 92, 246, 0.16));
}

.signal-label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.signal-card strong {
  color: var(--text);
  font-size: clamp(1.08rem, 2.5vw, 1.4rem);
  line-height: 1.2;
}

.section-heading {
  max-width: 680px;
  margin-bottom: 26px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1;
}

#skills,
#projects,
#experience,
#contact {
  scroll-margin-top: 96px;
  padding: 72px 0;
}

.skill-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.skill-list li {
  min-height: 58px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.58);
  color: var(--muted-strong);
  font-weight: 700;
}

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

.project-card {
  display: flex;
  min-height: 304px;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px;
  border-radius: 22px;
}

.featured-project {
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(139, 92, 246, 0.16)),
    rgba(15, 23, 42, 0.8);
}

.project-card h3,
.experience-card h3 {
  margin-bottom: 14px;
  font-size: 1.35rem;
}

.project-card p:not(.card-kicker),
.focus-area,
.footer {
  color: var(--muted);
  line-height: 1.7;
}

.project-card a {
  width: fit-content;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.project-card a:hover {
  text-decoration: underline;
}

.experience-card {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 34px;
  padding: 30px;
  border-radius: 24px;
}

.company {
  margin-bottom: 12px;
  color: var(--blue);
  font-weight: 800;
}

.focus-area p {
  margin-bottom: 12px;
  color: var(--muted-strong);
  font-weight: 800;
}

.focus-area ul {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.focus-area li {
  position: relative;
  padding-left: 22px;
}

.focus-area li::before {
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  content: "";
  transform: translateY(-50%);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.contact-card {
  display: flex;
  min-width: 0;
  min-height: 132px;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border-radius: 20px;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease;
}

.contact-card:hover {
  border-color: rgba(56, 189, 248, 0.46);
  transform: translateY(-3px);
}

.contact-card span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
}

.contact-card strong {
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.4;
}

.footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 44px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 0.92rem;
}

.footer p {
  margin: 0;
}

html[dir="rtl"] .focus-area li {
  padding-right: 22px;
  padding-left: 0;
}

html[dir="rtl"] .focus-area li::before {
  right: 0;
  left: auto;
}

html[lang="fa"] .eyebrow,
html[lang="fa"] .card-kicker,
html[lang="fa"] .signal-label,
html[lang="fa"] .contact-card span {
  letter-spacing: 0;
  text-transform: none;
}

@media (max-width: 900px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-actions {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 34px;
    min-height: auto;
    padding-top: 52px;
  }

  .skill-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-grid,
  .experience-card,
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .section-shell,
  .nav,
  .footer {
    width: min(100% - 24px, 1120px);
  }

  .brand {
    font-size: 0.95rem;
  }

  .nav-links {
    gap: 16px;
    font-size: 0.88rem;
  }

  .language-switcher {
    width: fit-content;
  }

  .hero {
    padding-top: 42px;
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .button {
    padding-inline: 18px;
  }

  .hero-panel,
  .project-card,
  .experience-card {
    border-radius: 18px;
  }

  .signal-grid,
  .skill-list {
    grid-template-columns: 1fr;
  }

  .signal-card {
    min-height: 102px;
  }

  #skills,
  #projects,
  #experience,
  #contact {
    padding: 52px 0;
  }
}
