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

:root {
  --bg: #0d0f12;
  --bg-soft: #14171c;
  --card: #181c22;
  --card-hover: #1e232b;
  --fg: #eae6de;
  --fg-dim: #b8b4ac;
  --muted: #7a7770;
  --muted-dim: #4a4844;
  --accent: #d4a24c;
  --accent-bright: #e8b85e;
  --accent-soft: rgba(212, 162, 76, 0.12);
  --border: rgba(255, 255, 255, 0.07);
  --border-bright: rgba(255, 255, 255, 0.15);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --fa-sans: 'Vazirmatn', sans-serif;
  color-scheme: dark;
}

html[data-theme='light'] {
  color-scheme: light;
}
html[data-theme='light'] {
  --bg: #faf9f7;
  --bg-soft: #f0eeeb;
  --card: #ffffff;
  --card-hover: #f5f3f0;
  --fg: #1a1a1a;
  --fg-dim: #4a4a4a;
  --muted: #777;
  --muted-dim: #aaa;
  --accent: #b8860b;
  --accent-bright: #d4a017;
  --accent-soft: rgba(184, 134, 11, 0.1);
  --border: rgba(0, 0, 0, 0.08);
  --border-bright: rgba(0, 0, 0, 0.15);
}
html[data-theme='light'] body::before {
  opacity: 0.15;
}
html[data-theme='light'] body::after {
  background: radial-gradient(
    circle,
    rgba(184, 134, 11, 0.06) 0%,
    transparent 60%
  );
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

body::after {
  content: '';
  position: fixed;
  top: -300px;
  right: -200px;
  width: 800px;
  height: 800px;
  background: radial-gradient(
    circle,
    rgba(212, 162, 76, 0.09) 0%,
    transparent 60%
  );
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 2;
  max-width: 1240px;
  margin: 0 auto;
  padding: 56px 40px 100px;
}

/* === Controls bar (lang + theme) === */
.controls-bar {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* === Language toggle === */
.lang-toggle {
  display: flex;
  background: rgba(24, 28, 34, 0.85);
  border: 1px solid var(--border-bright);
  border-radius: 999px;
  padding: 4px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

html[data-theme='light'] .lang-toggle {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.lang-toggle button {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lang-toggle button.active {
  background: var(--accent);
  color: #0d0f12;
}

.lang-toggle button:not(.active):hover {
  color: var(--fg);
}

html[dir='rtl'] .lang-en {
  display: none !important;
}
html[dir='ltr'] .lang-fa {
  display: none !important;
}
html[dir='rtl'] body {
  font-family: var(--fa-sans);
}

/* === Theme toggle === */
.theme-toggle {
  background: rgba(24, 28, 34, 0.85);
  border: 1px solid var(--border-bright);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  color: var(--muted);
}

html[data-theme='light'] .theme-toggle {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.theme-toggle .icon-sun {
  display: none;
}
.theme-toggle .icon-moon {
  display: block;
}
html[data-theme='light'] .theme-toggle .icon-sun {
  display: block;
}
html[data-theme='light'] .theme-toggle .icon-moon {
  display: none;
}

/* === Header === */
.header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 48px;
  padding-bottom: 44px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 36px;
}

.avatar-wrapper {
  flex-shrink: 0;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow: 0 0 24px rgba(212, 162, 76, 0.2);
  transition: box-shadow 0.3s ease;
}

.avatar:hover {
  box-shadow: 0 0 36px rgba(212, 162, 76, 0.35);
}

.header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 140px;
  height: 1px;
  background: var(--accent);
}

html[dir='rtl'] .header::after {
  left: auto;
  right: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 18px;
}

.eyebrow::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.8);
  }
}

.name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(48px, 7.5vw, 104px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--fg);
  margin-bottom: 22px;
}

.name em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

html[dir='rtl'] .name {
  font-family: var(--fa-sans);
  font-weight: 900;
  letter-spacing: -0.02em;
}

html[dir='rtl'] .name em {
  font-style: normal;
  font-weight: 300;
  color: var(--accent);
}

.title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 14px;
  color: var(--fg-dim);
  font-weight: 400;
}

.title-row span {
  position: relative;
}

.title-row span:not(:last-child)::after {
  content: '/';
  margin-left: 14px;
  color: var(--muted-dim);
}

html[dir='rtl'] .title-row span:not(:last-child)::after {
  margin-left: 0;
  margin-right: 14px;
}

.contact-block {
  text-align: right;
  font-size: 13px;
  min-width: 220px;
}

html[dir='rtl'] .contact-block {
  text-align: left;
}

.contact-block .label {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}

html[dir='rtl'] .contact-block .label {
  font-family: var(--fa-sans);
  letter-spacing: 0;
}

.contact-block a {
  display: block;
  color: var(--fg-dim);
  text-decoration: none;
  padding: 3px 0;
  transition:
    color 0.2s,
    transform 0.2s;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.01em;
}

.contact-block a:hover {
  color: var(--accent);
  transform: translateX(-3px);
}
html[dir='rtl'] .contact-block a:hover {
  transform: translateX(3px);
}

html[dir='rtl'] .contact-block a[href^="tel:"] {
  direction: ltr;
  unicode-bidi: isolate;
}

.contact-block a[href^="tel:"] {
  direction: ltr;
  unicode-bidi: isolate;
}

/* === Layout === */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 64px;
}

aside {
  position: sticky;
  top: 32px;
  align-self: start;
}

.section-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.section-label .num {
  color: var(--accent);
  font-weight: 500;
}

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

/* Skills */
.skill-group {
  margin-bottom: 22px;
}
.skill-group:last-child {
  margin-bottom: 0;
}

.skill-group h4 {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 600;
}

html[dir='rtl'] .skill-group h4 {
  font-family: var(--fa-sans);
  letter-spacing: 0;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 5px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg-dim);
  transition: all 0.2s;
  cursor: default;
}

.skill-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

/* Info cards */
.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}

.info-card:hover {
  border-color: var(--border-bright);
}

.info-card h4 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 500;
}

html[dir='rtl'] .info-card h4 {
  letter-spacing: 0;
  font-family: var(--fa-sans);
  font-size: 11px;
}

.info-card .big {
  font-size: 15px;
  color: var(--fg);
  margin-bottom: 4px;
  font-weight: 500;
  font-family: var(--serif);
}

html[dir='rtl'] .info-card .big {
  font-family: var(--fa-sans);
  font-weight: 700;
}

.info-card p {
  font-size: 12.5px;
  color: var(--fg-dim);
  line-height: 1.55;
}
.info-card .muted {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 4px;
  font-family: var(--mono);
}

/* Stats */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.stat-row:last-child {
  border-bottom: none;
}

.stat-row .num {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--accent);
  font-weight: 500;
}

html[dir='rtl'] .stat-row .num {
  font-family: var(--fa-sans);
  font-weight: 700;
}

.stat-row .label {
  font-size: 11.5px;
  color: var(--fg-dim);
  text-align: right;
}

html[dir='rtl'] .stat-row .label {
  text-align: left;
}

/* === Main content === */
.main-section {
  margin-bottom: 64px;
}
.main-section:last-child {
  margin-bottom: 0;
}

.main-section h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  display: flex;
  align-items: baseline;
  gap: 18px;
  color: var(--fg);
}

html[dir='rtl'] .main-section h2 {
  font-family: var(--fa-sans);
  font-weight: 700;
  font-size: 32px;
}

.main-section h2 .num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.1em;
}

.summary-text {
  font-size: 16px;
  line-height: 1.75;
  color: var(--fg-dim);
  max-width: 68ch;
}

html[dir='rtl'] .summary-text {
  font-size: 15px;
}

html[dir='rtl'] .summary-text bdi {
  direction: ltr;
  unicode-bidi: isolate;
}

.summary-text strong {
  color: var(--fg);
  font-weight: 500;
}

/* Experience timeline */
.experience-item {
  margin-bottom: 44px;
  padding-left: 28px;
  border-left: 1px solid var(--border);
  position: relative;
}

html[dir='rtl'] .experience-item {
  padding-left: 0;
  padding-right: 28px;
  border-left: none;
  border-right: 1px solid var(--border);
}

.experience-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 6px;
  width: 9px;
  height: 9px;
  background: var(--bg);
  border: 2px solid var(--accent);
  border-radius: 50%;
  transition: all 0.3s;
}

html[dir='rtl'] .experience-item::before {
  left: auto;
  right: -5px;
}

.experience-item:hover::before {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 4px;
}

.exp-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.01em;
}

html[dir='rtl'] .exp-title {
  font-family: var(--fa-sans);
  font-weight: 700;
  font-size: 19px;
}

.exp-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.exp-org {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  font-family: var(--mono);
}

.exp-promo {
  font-size: 13px;
  color: var(--fg-dim);
  font-style: italic;
  margin-bottom: 18px;
  line-height: 1.6;
  padding-left: 14px;
  border-left: 2px solid var(--accent-soft);
}

html[dir='rtl'] .exp-promo {
  padding-left: 0;
  padding-right: 14px;
  border-left: none;
  border-right: 2px solid var(--accent-soft);
}

.exp-subhead {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 22px;
  margin-bottom: 10px;
  font-weight: 500;
}

html[dir='rtl'] .exp-subhead {
  font-family: var(--fa-sans);
  font-size: 11px;
  letter-spacing: 0;
}

.exp-list {
  list-style: none;
}

.exp-list li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--fg-dim);
  padding-left: 20px;
  position: relative;
  margin-bottom: 6px;
}

html[dir='rtl'] .exp-list li {
  padding-left: 0;
  padding-right: 20px;
}

.exp-list li::before {
  content: '\2014';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--mono);
}

html[dir='rtl'] .exp-list li::before {
  left: auto;
  right: 0;
}

/* Project cards */
.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 22px;
  margin-bottom: 10px;
  transition: all 0.25s;
}

.project-card:hover {
  background: var(--card-hover);
  border-color: var(--border-bright);
  transform: translateY(-2px);
}

.project-card h5 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

html[dir='rtl'] .project-card h5 {
  font-family: var(--fa-sans);
  font-weight: 700;
  font-size: 16px;
}

.project-card h5 .tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 8px;
  border-radius: 3px;
  font-weight: 500;
}

.project-card p {
  font-size: 13px;
  color: var(--fg-dim);
  line-height: 1.65;
  margin-bottom: 4px;
}

.tech-stack {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  letter-spacing: 0.02em;
}

.tech-stack strong {
  color: var(--accent);
  font-weight: 500;
}

/* Knowledge grid */
.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}

.knowledge-item {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 11px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg-dim);
  transition: all 0.2s;
  text-align: center;
}

html[dir='rtl'] .knowledge-item {
  font-family: var(--fa-sans);
  font-size: 12.5px;
}

.knowledge-item:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

/* === Print button === */
.print-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 100;
  background: var(--accent);
  color: #0d0f12;
  border: none;
  padding: 12px 22px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(212, 162, 76, 0.35);
  transition: all 0.25s;
}

.print-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(212, 162, 76, 0.45);
}

.print-btn svg {
  width: 14px;
  height: 14px;
}

/* === Responsive === */

/* Tablet */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  aside {
    position: static;
  }
  .header {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .avatar {
    width: 100px;
    height: 100px;
  }
  .contact-block {
    text-align: left;
    min-width: 0;
    width: 100%;
  }
  html[dir='rtl'] .contact-block {
    text-align: right;
  }
}

/* Large phone */
@media (max-width: 640px) {
  .page {
    padding: 72px 16px 80px;
  }
  .controls-bar {
    top: 12px;
    right: 12px;
    gap: 6px;
  }
  .lang-toggle button {
    padding: 6px 14px;
    font-size: 10px;
  }
  .theme-toggle {
    width: 34px;
    height: 34px;
  }
  .theme-toggle svg {
    width: 14px;
    height: 14px;
  }
  .avatar {
    width: 80px;
    height: 80px;
  }
  .eyebrow {
    font-size: 10px;
    margin-bottom: 14px;
  }
  .name {
    margin-bottom: 16px;
  }
  .title-row {
    font-size: 13px;
    gap: 4px 10px;
  }
  .header {
    padding-bottom: 32px;
    margin-bottom: 40px;
  }
  .contact-block {
    font-size: 12px;
  }
  .contact-block a {
    font-size: 11px;
  }
  .main-section {
    margin-bottom: 48px;
  }
  .main-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
    gap: 12px;
  }
  .main-section h2 .num {
    font-size: 11px;
  }
  .summary-text {
    font-size: 14px;
  }
  .exp-header {
    flex-direction: column;
    gap: 4px;
  }
  .exp-title {
    font-size: 18px;
  }
  html[dir='rtl'] .exp-title {
    font-size: 17px;
  }
  .exp-promo {
    font-size: 12.5px;
  }
  .exp-list li {
    font-size: 13px;
    padding-left: 16px;
  }
  html[dir='rtl'] .exp-list li {
    padding-left: 0;
    padding-right: 16px;
  }
  .experience-item {
    padding-left: 20px;
    margin-bottom: 32px;
  }
  html[dir='rtl'] .experience-item {
    padding-left: 0;
    padding-right: 20px;
  }
  .project-card {
    padding: 14px 16px;
  }
  .project-card h5 {
    font-size: 15px;
    flex-wrap: wrap;
  }
  html[dir='rtl'] .project-card h5 {
    font-size: 15px;
  }
  .project-card p {
    font-size: 12.5px;
  }
  .tech-stack {
    font-size: 10px;
  }
  .knowledge-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .knowledge-item {
    font-size: 10.5px;
    padding: 9px 10px;
  }
  html[dir='rtl'] .knowledge-item {
    font-size: 11.5px;
  }
  .sidebar-section {
    margin-bottom: 32px;
  }
  .section-label {
    font-size: 10px;
    margin-bottom: 16px;
    padding-bottom: 10px;
  }
  .skill-tag {
    font-size: 10px;
    padding: 4px 8px;
  }
  .info-card {
    padding: 12px 14px;
    margin-bottom: 8px;
  }
  .info-card h4 {
    font-size: 9px;
    margin-bottom: 6px;
  }
  html[dir='rtl'] .info-card h4 {
    font-size: 10px;
  }
  .info-card .big {
    font-size: 13px;
  }
  .info-card p {
    font-size: 11.5px;
  }
  .stat-row {
    padding: 8px 0;
  }
  .stat-row .num {
    font-size: 18px;
  }
  .stat-row .label {
    font-size: 10.5px;
  }
  .print-btn {
    bottom: 20px;
    right: 20px;
    padding: 10px 18px;
    font-size: 10px;
    gap: 6px;
  }
  .print-btn svg {
    width: 12px;
    height: 12px;
  }
  .exp-subhead {
    margin-top: 18px;
    margin-bottom: 8px;
  }
}

/* Small phone */
@media (max-width: 380px) {
  .page {
    padding: 68px 12px 70px;
  }
  .controls-bar {
    top: 10px;
    right: 10px;
    gap: 4px;
  }
  .lang-toggle {
    padding: 3px;
  }
  .lang-toggle button {
    padding: 5px 10px;
    font-size: 9px;
    letter-spacing: 0.05em;
  }
  .theme-toggle {
    width: 30px;
    height: 30px;
  }
  .theme-toggle svg {
    width: 12px;
    height: 12px;
  }
  .avatar {
    width: 68px;
    height: 68px;
  }
  .name {
    font-size: clamp(32px, 10vw, 48px);
  }
  .title-row {
    font-size: 12px;
    gap: 3px 8px;
  }
  .knowledge-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
  .knowledge-item {
    font-size: 10px;
    padding: 7px 6px;
  }
  .skill-tags {
    gap: 4px;
  }
  .skill-tag {
    font-size: 9px;
    padding: 3px 6px;
  }
  .project-card {
    padding: 12px 12px;
  }
}

/* === Animations === */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

html[dir='rtl'] @keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

html[dir='rtl'] @keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes borderGlow {
  0%, 100% { border-color: var(--border); }
  50% { border-color: var(--accent); }
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* Header entrance */
.header {
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.avatar {
  animation: scaleIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s backwards,
             float 4s ease-in-out 1.5s infinite;
}

.name-block {
  animation: fadeIn 0.6s ease-out 0.3s backwards;
}

.contact-block {
  animation: fadeIn 0.6s ease-out 0.5s backwards;
}

/* Eyebrow dot */
.eyebrow::before {
  animation: dotPulse 2.4s ease-in-out infinite;
}

/* Sidebar entrance */
aside {
  animation: slideInRight 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.2s backwards;
}

html[dir='rtl'] aside {
  animation-name: slideInLeft;
}

/* Main content entrance */
main {
  animation: fadeIn 0.6s ease-out 0.3s backwards;
}

/* Scroll-triggered animations */
.scroll-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal-right {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

html[dir='rtl'] .scroll-reveal-left {
  transform: translateX(24px);
}

html[dir='rtl'] .scroll-reveal-right {
  transform: translateX(-24px);
}

.scroll-reveal-left.revealed,
.scroll-reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Staggered children animation */
.stagger-children > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-children.revealed > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.revealed > *:nth-child(1) { transition-delay: 0s; }
.stagger-children.revealed > *:nth-child(2) { transition-delay: 0.06s; }
.stagger-children.revealed > *:nth-child(3) { transition-delay: 0.12s; }
.stagger-children.revealed > *:nth-child(4) { transition-delay: 0.18s; }
.stagger-children.revealed > *:nth-child(5) { transition-delay: 0.24s; }
.stagger-children.revealed > *:nth-child(6) { transition-delay: 0.30s; }
.stagger-children.revealed > *:nth-child(7) { transition-delay: 0.36s; }
.stagger-children.revealed > *:nth-child(8) { transition-delay: 0.42s; }
.stagger-children.revealed > *:nth-child(9) { transition-delay: 0.48s; }
.stagger-children.revealed > *:nth-child(10) { transition-delay: 0.54s; }
.stagger-children.revealed > *:nth-child(11) { transition-delay: 0.60s; }
.stagger-children.revealed > *:nth-child(12) { transition-delay: 0.66s; }

/* Skill tags stagger */
.skill-tags.stagger-children.revealed > *:nth-child(1) { transition-delay: 0.02s; }
.skill-tags.stagger-children.revealed > *:nth-child(2) { transition-delay: 0.04s; }
.skill-tags.stagger-children.revealed > *:nth-child(3) { transition-delay: 0.06s; }
.skill-tags.stagger-children.revealed > *:nth-child(4) { transition-delay: 0.08s; }
.skill-tags.stagger-children.revealed > *:nth-child(5) { transition-delay: 0.10s; }
.skill-tags.stagger-children.revealed > *:nth-child(6) { transition-delay: 0.12s; }
.skill-tags.stagger-children.revealed > *:nth-child(7) { transition-delay: 0.14s; }
.skill-tags.stagger-children.revealed > *:nth-child(8) { transition-delay: 0.16s; }
.skill-tags.stagger-children.revealed > *:nth-child(9) { transition-delay: 0.18s; }

/* Hover animations */
.skill-tag {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.info-card {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.info-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.project-card {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  border-color: var(--accent);
}

.knowledge-item {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.knowledge-item:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Experience item timeline animation */
.experience-item {
  transition: all 0.3s ease;
}

.experience-item::before {
  transition: all 0.3s ease;
}

.experience-item:hover::before {
  box-shadow: 0 0 12px var(--accent);
  transform: scale(1.3);
}

/* Stat row hover */
.stat-row {
  transition: all 0.3s ease;
}

.stat-row:hover {
  padding-left: 4px;
  padding-right: 4px;
}

html[dir='rtl'] .stat-row:hover {
  padding-left: 0;
  padding-right: 8px;
}

.stat-row:hover .num {
  transform: scale(1.1);
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Name */
.name {
  transition: all 0.3s ease;
}

.name em {
  transition: all 0.3s ease;
}

/* Print button pulse */
.print-btn {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Section label hover */
.section-label {
  transition: all 0.3s ease;
}

/* Experience promo quote bar animation */
.exp-promo {
  transition: border-color 0.3s ease;
}

.experience-item:hover .exp-promo {
  border-color: var(--accent);
}

/* Contact link hover */
.contact-block a {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Main section headings */
.main-section h2 {
  position: relative;
  overflow: hidden;
}

/* Page load sequence */
.page {
  animation: fadeIn 0.5s ease-out;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .scroll-reveal,
  .scroll-reveal-left,
  .scroll-reveal-right,
  .scroll-reveal-scale,
  .stagger-children > * {
    opacity: 1;
    transform: none;
  }
}

/* === Print === */
@media print {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .scroll-reveal,
  .scroll-reveal-left,
  .scroll-reveal-right,
  .scroll-reveal-scale,
  .stagger-children > * {
    opacity: 1 !important;
    transform: none !important;
  }
  html[data-theme] {
    --bg: white;
    --fg: black;
    --fg-dim: #222;
    --muted: #555;
    --accent: #8a6d2a;
    --border: #ddd;
    --card: #f8f8f8;
  }
  body {
    background: white;
    color: black;
    font-size: 11px;
  }
  body::before,
  body::after {
    display: none;
  }
  .lang-toggle,
  .print-btn,
  .controls-bar {
    display: none !important;
  }
  .avatar {
    border-color: #999;
    box-shadow: none;
  }
  .page {
    max-width: 100%;
    padding: 0;
  }
  .layout {
    grid-template-columns: 220px 1fr;
    gap: 24px;
  }
  .card,
  .project-card,
  .info-card {
    background: #f8f8f8;
    border: 1px solid #ddd;
    transform: none !important;
  }
  .skill-tag {
    background: #f0f0f0;
    border: 1px solid #ddd;
    color: #333;
  }
  .name {
    color: #000;
  }
  .name em {
    color: #8a6d2a;
  }
  .main-section h2,
  .exp-title,
  .project-card h5 {
    color: #000;
  }
  .summary-text,
  .exp-list li,
  .project-card p {
    color: #222;
  }
  .eyebrow,
  .exp-meta,
  .section-label .num,
  .skill-group h4,
  .exp-subhead {
    color: #8a6d2a;
  }
  .experience-item,
  .experience-item::before {
    border-color: #999;
  }
  html[dir='rtl'] .lang-en,
  html[dir='ltr'] .lang-fa {
    display: none !important;
  }
}
