:root {
  --bg: #000000;
  --bg-card: #070707;
  --bg-elevated: #0e0e0e;
  --bg-surface: #141414;
  --text: #f0f0f0;
  --text-muted: #8c8c8c;
  --accent: #ff5500;
  --accent-hover: #ff6d24;
  --accent-deep: #e04800;
  --accent-soft: #ff8a4d;
  --accent-rgb: 255, 85, 0;
  --accent-glow: rgba(var(--accent-rgb), 0.22);
  --accent-dim: rgba(var(--accent-rgb), 0.07);
  --accent-border: rgba(var(--accent-rgb), 0.2);
  --accent-border-strong: rgba(var(--accent-rgb), 0.42);
  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --radius: 14px;
  --radius-lg: 22px;
  --font-en: "Syne", "Inter", system-ui, sans-serif;
  --font-fa: "Vazirmatn", "Syne", system-ui, sans-serif;
  --shadow: 0 20px 56px rgba(0, 0, 0, 0.75);
  --shadow-accent: 0 8px 28px rgba(var(--accent-rgb), 0.18);
  --header-h: 76px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

html[lang="fa"] { font-family: var(--font-fa); }
html[lang="en"] { font-family: var(--font-en); }

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  min-height: 100vh;
  overflow-x: hidden;
}

html[lang="fa"] body { direction: rtl; }
html[lang="en"] body { direction: ltr; }

::selection {
  background: var(--accent);
  color: #000;
}

a { color: var(--accent); text-decoration: none; transition: color 0.25s var(--ease-out); }
a:hover { color: var(--accent-hover); }

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

.container {
  width: min(1140px, 92vw);
  margin-inline: auto;
}

/* Mesh background */
.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.mesh-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 45% at 15% -5%, rgba(var(--accent-rgb), 0.09) 0%, transparent 55%),
    radial-gradient(ellipse 50% 35% at 95% 15%, rgba(var(--accent-rgb), 0.04) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 105%, rgba(var(--accent-rgb), 0.03) 0%, transparent 55%);
}

.mesh-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: floatOrb 18s ease-in-out infinite;
}

.mesh-orb--1 {
  width: 380px;
  height: 380px;
  background: rgba(var(--accent-rgb), 0.1);
  top: -10%;
  inset-inline-end: -8%;
}

.mesh-orb--2 {
  width: 280px;
  height: 280px;
  background: rgba(var(--accent-rgb), 0.06);
  bottom: 15%;
  inset-inline-start: -10%;
  animation-delay: -6s;
  animation-duration: 22s;
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -30px) scale(1.05); }
  66% { transform: translate(-15px, 20px) scale(0.95); }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

/* Header */
.site-header {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.site-header.scrolled {
  background: rgba(0, 0, 0, 0.92);
  border-bottom-color: var(--accent-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.logo img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--accent-border);
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}

.logo:hover img {
  transform: scale(1.05);
  border-color: var(--accent-border-strong);
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-desktop a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
}

.nav-desktop a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  inset-inline: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s var(--ease-out);
  border-radius: 1px;
}

.nav-desktop a:hover,
.nav-desktop a.active { color: var(--text); }

.nav-desktop a:hover::after,
.nav-desktop a.active::after { transform: scaleX(1); }

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

.lang-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, transform 0.2s;
}

.lang-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent-border-strong);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
}

.nav-mobile {
  display: none;
  position: fixed;
  top: var(--header-h);
  inset-inline: 0;
  background: rgba(0, 0, 0, 0.96);
  border-bottom: 1px solid var(--accent-border);
  padding: 16px 24px 24px;
  flex-direction: column;
  gap: 4px;
  z-index: 99;
  animation: slideDown 0.3s var(--ease-out);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-mobile.open { display: flex; }

.nav-mobile a {
  color: var(--text-muted);
  padding: 12px 0;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.nav-mobile a:last-child { border-bottom: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s var(--ease-out), background 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
  box-shadow: 0 10px 36px var(--accent-glow);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-light);
}

.btn-outline:hover {
  border-color: var(--accent-border-strong);
  color: var(--accent-hover);
  background: var(--accent-dim);
}

/* Hero */
.hero {
  padding: calc(var(--header-h) + 72px) 0 96px;
  position: relative;
  overflow-x: clip;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr min(300px, 38vw);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  min-width: 0;
}

.hero-grid > * {
  min-width: 0;
}

.hero-tagline {
  display: inline-block;
  color: var(--accent-soft);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
  padding: 6px 14px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 14px;
  letter-spacing: -0.03em;
  color: var(--text);
}

.hero-subtitle {
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 500;
  margin-bottom: 20px;
  opacity: 0.85;
}

.hero-bio {
  color: var(--text-muted);
  max-width: 540px;
  margin-bottom: 36px;
  font-size: 1.05rem;
  line-height: 1.75;
}

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

.hero-photo {
  position: relative;
  width: min(300px, 100%);
  max-width: 100%;
  margin-inline: auto;
  justify-self: center;
  animation: heroFloat 6s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero-photo img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--accent-border);
  box-shadow: var(--shadow), 0 0 0 1px rgba(0, 0, 0, 0.8);
  position: relative;
  z-index: 1;
}

.hero-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.18) 0%, transparent 55%);
  opacity: 0.5;
  z-index: 0;
  animation: ringPulse 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes ringPulse {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.02); }
}

/* Sections */
section { padding: 80px 0; }

.section-header {
  margin-bottom: 44px;
}

.section-header h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-header p {
  color: var(--text-muted);
  max-width: 520px;
  font-size: 1.02rem;
}

.section-alt {
  background: linear-gradient(180deg, transparent 0%, rgba(var(--accent-rgb), 0.025) 50%, transparent 100%);
}

/* Services */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 22px;
}

.service-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: border-color 0.35s, transform 0.35s var(--ease-out), box-shadow 0.35s;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out);
}

html[lang="fa"] .service-card::before {
  transform-origin: right;
}

.service-card:hover {
  border-color: var(--accent-border-strong);
  transform: translateY(-4px);
  box-shadow: var(--shadow-accent);
}

.service-card:hover::before { transform: scaleX(1); }

.service-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-dim);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--accent);
  transition: transform 0.3s var(--ease-out);
}

.service-card:hover .service-icon { transform: scale(1.08); }

.service-card h3 {
  font-size: 1.08rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.service-card p {
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.65;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  text-align: center;
}

.stat-item {
  padding: 36px 20px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: transform 0.35s var(--ease-out), border-color 0.35s;
}

.stat-item:hover {
  transform: translateY(-3px);
  border-color: var(--accent-border);
}

.stat-value {
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Timeline */
.timeline { position: relative; }

.timeline-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding-bottom: 32px;
}

html[lang="fa"] .timeline-item { grid-template-columns: 1fr 140px; }
html[lang="fa"] .timeline-item > *:first-child { order: 2; }
html[lang="fa"] .timeline-item > *:last-child { order: 1; text-align: left; }

.timeline-period {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  padding-top: 6px;
}

.timeline-content {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  position: relative;
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
}

.timeline-content:hover {
  border-color: var(--accent-border);
  transform: translateX(4px);
}

html[lang="fa"] .timeline-content:hover { transform: translateX(-4px); }

.timeline-content::before {
  content: "";
  position: absolute;
  top: 24px;
  inset-inline-start: -5px;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-glow);
}

.timeline-content h3 { font-size: 1.05rem; margin-bottom: 4px; font-weight: 700; }

.timeline-company {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.timeline-location {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.timeline-content p {
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.65;
}

/* Education */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}

.edu-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.3s var(--ease-out);
}

.edu-card:hover { transform: translateY(-3px); }

.edu-period {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.edu-card h3 { font-size: 1rem; margin-bottom: 6px; }
.edu-school { color: var(--text-muted); font-size: 0.92rem; }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 10px; }

.tag {
  background: var(--accent-dim);
  color: var(--accent);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--accent-border);
  transition: transform 0.2s, background 0.2s;
}

.tag:hover {
  transform: translateY(-2px);
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent-soft);
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  transition: border-color 0.35s, transform 0.35s var(--ease-out), box-shadow 0.35s;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.project-card::after {
  content: "→";
  position: absolute;
  top: 28px;
  inset-inline-end: 28px;
  font-size: 1.2rem;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.3s, transform 0.3s var(--ease-out);
}

html[lang="fa"] .project-card::after {
  content: "←";
  transform: translateX(8px);
}

.project-card:hover {
  border-color: var(--accent-border-strong);
  transform: translateY(-5px);
  box-shadow: var(--shadow-accent);
}

.project-card:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.project-card h3 { font-size: 1.25rem; margin-bottom: 12px; font-weight: 700; }
.project-card h3 a { color: var(--text); transition: color 0.2s; }
.project-card h3 a:hover { color: var(--accent); }

.project-card p {
  color: var(--text-muted);
  font-size: 0.93rem;
  flex: 1;
  margin-bottom: 18px;
  line-height: 1.65;
}

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

.project-tag {
  background: var(--bg-surface);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  border: 1px solid var(--border);
}

/* Cert list */
.cert-list {
  list-style: none;
  display: grid;
  gap: 12px;
}

.cert-list li {
  padding: 15px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.93rem;
  color: var(--text-muted);
  transition: border-color 0.25s;
}

.cert-list li:hover { border-color: var(--accent-border); }

.cert-list li::before {
  content: "✓";
  color: var(--accent);
  font-weight: 700;
  margin-inline-end: 10px;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
}

.contact-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 26px;
  text-align: center;
  transition: transform 0.35s var(--ease-out), border-color 0.35s;
}

.contact-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-border-strong);
}

.contact-card-icon {
  width: 52px;
  height: 52px;
  background: var(--accent-dim);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--accent);
}

.contact-card-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.contact-card-value { font-weight: 600; font-size: 1rem; }
.contact-card-value a { color: var(--text); }
.contact-card-value a:hover { color: var(--accent); }

.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 44px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  transition: all 0.25s var(--ease-out);
}

.social-links a:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px);
}

/* About prose */
.prose p {
  color: var(--text-muted);
  margin-bottom: 18px;
  max-width: 680px;
  font-size: 1.03rem;
  line-height: 1.75;
}

.prose .lead {
  font-size: 1.2rem;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 24px;
}

.focus-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.focus-list li {
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: border-color 0.25s, color 0.25s;
}

.focus-list li:hover {
  border-color: var(--accent-border);
  color: var(--text);
}

.focus-list li::before {
  content: "·";
  color: var(--accent);
  font-weight: 700;
  margin-inline-end: 8px;
  font-size: 1.2rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Page hero */
.page-hero {
  padding: calc(var(--header-h) + 56px) 0 40px;
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-hero p {
  color: var(--text-muted);
  margin-top: 10px;
  font-size: 1.05rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr min(260px, 42vw);
    gap: clamp(20px, 3vw, 40px);
  }

  .hero-photo {
    animation: none;
  }

  section { padding: 64px 0; }

  .services-grid,
  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 28px;
  }

  .hero-photo {
    order: -1;
    width: min(260px, 72vw);
  }

  .hero-tagline { margin-inline: auto; }

  .hero-bio {
    margin-inline: auto;
    max-width: 100%;
  }

  .hero-actions {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  :root { --header-h: 68px; }

  .container { width: min(1140px, 94vw); }

  .nav-desktop { display: none; }
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }

  .logo {
    font-size: 0.92rem;
    gap: 8px;
    min-width: 0;
    flex: 1;
  }

  .logo span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-actions { flex-shrink: 0; }

  .lang-btn {
    min-height: 40px;
    padding: 8px 14px;
  }

  .hero {
    padding: calc(var(--header-h) + 40px) 0 64px;
  }

  .hero-grid {
    gap: 24px;
  }

  .hero-photo {
    width: min(240px, 68vw);
  }

  .hero-photo img {
    margin: 0 auto;
  }

  .hero-tagline {
    margin-inline: auto;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    line-height: 1.4;
    max-width: 100%;
  }

  .hero h1 {
    font-size: clamp(1.75rem, 7vw, 2.4rem);
    word-break: break-word;
  }

  .hero-subtitle { font-size: 1rem; }

  .hero-bio {
    margin-inline: auto;
    font-size: 0.98rem;
    max-width: 100%;
  }

  .hero-actions {
    justify-content: center;
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 48px;
  }

  section { padding: 52px 0; }

  .section-header { margin-bottom: 32px; }
  .section-header p { max-width: 100%; }

  .services-grid,
  .projects-grid,
  .edu-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .service-card,
  .project-card,
  .contact-card,
  .edu-card {
    padding: 22px 20px;
  }

  .stats-grid { grid-template-columns: 1fr; gap: 12px; }

  .stat-item { padding: 20px 16px; }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  html[lang="fa"] .timeline-item > *:first-child { order: 0; }
  html[lang="fa"] .timeline-item > *:last-child { order: 0; text-align: inherit; }

  .timeline-period {
    font-size: 0.82rem;
    margin-bottom: 4px;
  }

  .timeline-content:hover { transform: none; }

  .focus-list {
    grid-template-columns: 1fr;
  }

  .page-hero {
    padding: calc(var(--header-h) + 36px) 0 28px;
  }

  .prose p,
  .prose .lead {
    max-width: 100%;
    font-size: 1rem;
  }

  .social-links {
    gap: 10px;
    margin-top: 32px;
  }

  .social-links a {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 480px) {
  body { font-size: 15px; }

  .logo span { max-width: 11rem; }

  .hero-tagline {
    text-transform: none;
    letter-spacing: 0;
    padding: 8px 12px;
  }

  .btn {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .project-card::after { display: none; }
}

@supports (padding: max(0px)) {
  .site-header {
    padding-inline: max(0px, env(safe-area-inset-left)) max(0px, env(safe-area-inset-right));
  }

  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

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