/* ==========================================================================
   VIBE UI SUITE — PORTFOLIO DESIGN SYSTEM CORE (2026)
   Architect: Omid Zaferi (omid-io)
   Aesthetic: Minimalist High-Performance Engineering + Luxury Glass 2.0
   Color Space: OKLCH with WCAG AAA Contrast
   Direction: Bi-Directional (Strict Semantic RTL + Monospace LTR Isolation)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300..800;1,9..40,300..800&family=JetBrains+Mono:ital,wght@0,300..800;1,300..800&family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
  /* OKLCH Porcelain Snow (Light Mode) */
  --bg: oklch(0.985 0.004 260);
  --bg-subtle: oklch(0.965 0.008 260);
  --surface: oklch(1 0 0);
  --surface-hover: oklch(0.975 0.006 260);
  --surface-elevated: oklch(1 0 0);
  --surface-glass: oklch(1 0 0 / 0.82);

  --border: oklch(0.90 0.01 260);
  --border-strong: oklch(0.82 0.02 260);
  --border-bright: oklch(0.60 0.18 255 / 0.35);

  --text-primary: oklch(0.14 0.02 260);
  --text-secondary: oklch(0.38 0.02 260);
  --text-muted: oklch(0.55 0.015 260);
  --text-subtle: oklch(0.70 0.01 260);

  --accent: oklch(0.52 0.22 255);
  --accent-hover: oklch(0.46 0.23 255);
  --accent-soft: oklch(0.94 0.04 255);
  --accent-glow: oklch(0.52 0.22 255 / 0.16);

  --emerald: oklch(0.58 0.18 152);
  --emerald-soft: oklch(0.95 0.04 152);
  --purple: oklch(0.54 0.20 295);
  --amber: oklch(0.68 0.17 68);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;

  --shadow-sm: 0 4px 16px oklch(0.14 0.02 260 / 0.04);
  --shadow-md: 0 12px 32px oklch(0.14 0.02 260 / 0.07);
  --shadow-lg: 0 24px 64px oklch(0.14 0.02 260 / 0.10);
  --shadow-glow: 0 0 32px var(--accent-glow);

  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-fa: "Vazirmatn", "DM Sans", sans-serif;

  --max-width: 1060px;
}

html[data-theme="dark"] {
  /* OKLCH Obsidian Velvet (Dark Mode) */
  --bg: oklch(0.12 0.015 260);
  --bg-subtle: oklch(0.15 0.018 260);
  --surface: oklch(0.165 0.02 260);
  --surface-hover: oklch(0.205 0.024 260);
  --surface-elevated: oklch(0.185 0.022 260);
  --surface-glass: oklch(0.165 0.02 260 / 0.78);

  --border: oklch(0.24 0.018 260);
  --border-strong: oklch(0.32 0.022 260);
  --border-bright: oklch(0.68 0.18 250 / 0.40);

  --text-primary: oklch(0.96 0.005 260);
  --text-secondary: oklch(0.78 0.018 260);
  --text-muted: oklch(0.58 0.015 260);
  --text-subtle: oklch(0.42 0.01 260);

  --accent: oklch(0.68 0.19 250);
  --accent-hover: oklch(0.74 0.18 250);
  --accent-soft: oklch(0.22 0.04 250);
  --accent-glow: oklch(0.68 0.19 250 / 0.22);

  --emerald: oklch(0.72 0.18 155);
  --emerald-soft: oklch(0.22 0.04 155);
  --purple: oklch(0.74 0.18 295);
  --amber: oklch(0.78 0.16 70);

  --shadow-sm: 0 4px 20px oklch(0 0 0 / 0.35);
  --shadow-md: 0 16px 40px oklch(0 0 0 / 0.50);
  --shadow-lg: 0 28px 75px oklch(0 0 0 / 0.65);
  --shadow-glow: 0 0 40px var(--accent-glow);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  color-scheme: light dark;
  font-size: 15px;
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.25s var(--ease-smooth), color 0.25s var(--ease-smooth);
}

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  top: -120px;
  inset-inline-start: 24px;
  background-color: var(--text-primary);
  color: var(--bg);
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  z-index: 9999;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: top 0.2s var(--ease-spring);
}

.skip-link:focus {
  top: 16px;
}

/* Persian Language Font & Fine-Tuned Typography Calibration */
html[lang="fa"] body {
  font-family: var(--font-fa);
  line-height: 1.7;
}

html[lang="fa"] h1, 
html[lang="fa"] h2, 
html[lang="fa"] h3, 
html[lang="fa"] h4,
html[lang="fa"] h5,
html[lang="fa"] h6 {
  letter-spacing: normal;
  font-weight: 700;
  line-height: 1.35;
}

html[lang="fa"] .hero-title {
  font-size: clamp(1.65rem, 2.8vw, 2.15rem);
  line-height: 1.25;
  letter-spacing: normal;
  font-weight: 700;
  max-width: 560px;
  text-align: right !important;
}

html[lang="fa"] .hero-description {
  font-size: 0.95rem;
  line-height: 1.8;
  max-width: 580px;
}

html[lang="fa"] .section-title {
  font-size: clamp(1.2rem, 1.9vw, 1.6rem);
  line-height: 1.35;
  letter-spacing: normal;
  font-weight: 700;
}

html[lang="fa"] .section-subtitle {
  font-size: 0.85rem;
  line-height: 1.65;
}

html[lang="fa"] .project-card-title {
  font-size: 1.05rem;
  line-height: 1.35;
  letter-spacing: normal;
  font-weight: 700;
}

html[lang="fa"] .project-card-desc {
  font-size: 0.8rem;
  line-height: 1.65;
}

html[lang="fa"] .project-proof-callout {
  font-size: 0.75rem;
  line-height: 1.55;
}

html[lang="fa"] .project-tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
}

html[lang="fa"] .upstream-title {
  font-size: 0.95rem;
  line-height: 1.35;
  letter-spacing: normal;
  font-weight: 600;
}

html[lang="fa"] .upstream-desc {
  font-size: 0.78rem;
  line-height: 1.6;
}

html[lang="fa"] .dna-title {
  font-size: 1rem;
  line-height: 1.35;
  letter-spacing: normal;
  font-weight: 700;
}

html[lang="fa"] .dna-desc {
  font-size: 0.8rem;
  line-height: 1.65;
}

html[lang="fa"] .cta-title {
  font-size: clamp(1.2rem, 1.9vw, 1.55rem);
  line-height: 1.35;
  letter-spacing: normal;
  font-weight: 700;
}

html[lang="fa"] .cta-desc {
  font-size: 0.85rem;
  line-height: 1.65;
}

html[lang="fa"] .profile-card-name {
  font-size: 1.05rem;
  letter-spacing: normal;
}

html[lang="fa"] .profile-card-role {
  font-size: 0.75rem;
  line-height: 1.4;
}

html[lang="fa"] .status-pill,
html[lang="fa"] .spec-tag {
  font-size: 0.72rem;
}

html[lang="fa"] .nav-item {
  font-size: 0.8rem;
}

html[lang="fa"] .filter-btn {
  font-size: 0.75rem;
}

html[lang="fa"] .btn-primary,
html[lang="fa"] .btn-secondary,
html[lang="fa"] .copy-email-btn {
  font-size: 0.8rem;
}

html[lang="fa"] .footer-inner {
  font-size: 0.78rem;
  line-height: 1.6;
}

html[lang="fa"] .eyebrow {
  letter-spacing: normal;
  font-size: 0.72rem;
}

/* Preserve Default English Font (DM Sans) for Latin Identity & Brand Terms in Persian Mode */
.en-font,
html[lang="fa"] .en-font,
html[lang="fa"] .profile-card-name,
html[lang="fa"] .profile-card-role,
html[lang="fa"] .brand-name,
html[lang="fa"] .github-cta-btn,
html[lang="fa"] .spec-tag,
html[lang="fa"] .upstream-repo-name,
html[lang="fa"] bdi:not(.mono-data),
html[lang="fa"] .bdi:not(.mono-data) {
  font-family: var(--font-sans) !important;
  letter-spacing: -0.015em;
}

/* Semantic LTR Isolation for Numbers and Code */
bdi, .bdi, code, pre, .mono-data, .metric-number, .stat-value {
  direction: ltr !important;
  unicode-bidi: isolate;
  font-family: var(--font-mono) !important;
}

/* ==========================================================================
   Vibe UI Suite: Semantic RTL & Macro Layout Preservation
   Rule: Macro layout coordinates, grid tracks, and navbars remain locked in LTR.
   RTL applies strictly to textual semantics, headings, prose, and list content.
   ========================================================================== */

html[dir="rtl"] .nav-container,
html[dir="rtl"] .hero-layout,
html[dir="rtl"] .hero-info-col,
html[dir="rtl"] .status-pill-group,
html[dir="rtl"] .specialization-tags,
html[dir="rtl"] .hero-cta-group,
html[dir="rtl"] .section-head,
html[dir="rtl"] .filter-tabs,
html[dir="rtl"] .projects-grid,
html[dir="rtl"] .project-card-actions,
html[dir="rtl"] .upstream-grid,
html[dir="rtl"] .upstream-footer,
html[dir="rtl"] .dna-grid,
html[dir="rtl"] .engagement-grid,
html[dir="rtl"] .telemetry-grid,
html[dir="rtl"] .cta-banner,
html[dir="rtl"] .footer-inner,
html[dir="rtl"] .social-dock,
html[dir="rtl"] .nav-actions,
html[dir="rtl"] .stack-chips-group {
  direction: ltr; /* Keeps macro coordinate system and columns physically locked */
}

/* Explicit textual RTL & BiDi Punctuation Isolation */
html[lang="fa"] .hero-title,
html[lang="fa"] .hero-title span,
html[lang="fa"] .hero-description,
html[lang="fa"] .section-title,
html[lang="fa"] .section-subtitle,
html[lang="fa"] .project-card-title,
html[lang="fa"] .project-card-desc,
html[lang="fa"] .project-proof-callout,
html[lang="fa"] .upstream-title,
html[lang="fa"] .upstream-desc,
html[lang="fa"] .dna-title,
html[lang="fa"] .dna-desc,
html[lang="fa"] .engagement-title,
html[lang="fa"] .engagement-desc,
html[lang="fa"] .cta-title,
html[lang="fa"] .cta-desc,
html[lang="fa"] .project-card-body,
html[lang="fa"] .upstream-card,
html[lang="fa"] .dna-card,
html[lang="fa"] .engagement-card {
  unicode-bidi: plaintext;
  text-align: start;
}

html[dir="rtl"] .terminal-box {
  direction: ltr;
}

/* Background Architectural Ambient Grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image: 
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 10%, black 20%, transparent 80%);
}

html[data-theme="dark"] body::before {
  opacity: 0.16;
}

/* ==========================================================================
   Interactive Background Canvas & Ambient Atmospheric Lighting
   ========================================================================== */

#neural-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

html:not([data-theme="dark"]) #neural-canvas {
  opacity: 0.38;
}

.ambient-glow-top {
  position: fixed;
  top: -240px;
  left: 50%;
  transform: translateX(-50%);
  width: 1200px;
  height: 700px;
  background: radial-gradient(circle, oklch(0.68 0.19 250 / 0.18) 0%, oklch(0.74 0.18 295 / 0.08) 45%, transparent 75%);
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
}

.ambient-glow-bottom {
  position: fixed;
  bottom: -280px;
  right: -100px;
  width: 850px;
  height: 650px;
  background: radial-gradient(circle, oklch(0.72 0.18 155 / 0.12) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
  filter: blur(90px);
}

/* Linear-Style Mouse Spotlight on Cards */
.spotlight-card {
  position: relative;
  overflow: hidden;
}

.spotlight-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    480px circle at var(--mouse-x, -500px) var(--mouse-y, -500px),
    oklch(0.68 0.19 250 / 0.45),
    transparent 65%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.3s var(--ease-spring);
}

.spotlight-card:hover::before {
  opacity: 1;
}

/* Live ECG Telemetry Badge */
.pulse-telemetry-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background-color: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.pulse-telemetry-badge canvas {
  display: block;
}

.latency-indicator {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--emerald);
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--text-primary);
}


p {
  color: var(--text-secondary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s var(--ease-smooth);
}

button {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

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

.container {
  width: min(var(--max-width), calc(100% - 48px));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background-color: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.25s var(--ease-smooth), background-color 0.25s var(--ease-smooth);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  gap: 16px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-logo-frame {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: grid;
  place-items: center;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 3px 10px var(--accent-glow);
}

.brand-name span {
  color: var(--accent);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-elevated);
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}

.nav-item {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s var(--ease-smooth);
}

.nav-item:hover, .nav-item.active {
  color: var(--text-primary);
  background-color: var(--surface-hover);
}

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

/* Utility Control Buttons (Theme, Language, Github) */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text-secondary);
  transition: all 0.2s var(--ease-spring);
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background-color: var(--surface-hover);
  transform: translateY(-1px);
}

.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s var(--ease-spring);
}

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

.github-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-strong);
  background-color: var(--surface-elevated);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.2s var(--ease-spring);
}

.github-cta-btn:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.menu-toggle-btn {
  display: none;
}

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0;
  transition: opacity 0.25s var(--ease-smooth);
  pointer-events: none;
}

.nav-backdrop.show,
.nav-backdrop.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   Hero Section & Personal Identity
   ========================================================================== */

.hero-section {
  padding: 40px 0 28px;
  position: relative;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 32px;
  align-items: center;
}

/* Status Pill with Pulsing Live Indicator */
.status-pill-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background-color: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--emerald);
  box-shadow: 0 0 0 0 oklch(0.72 0.18 155 / 0.5);
  animation: pulse-ring 2.2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 oklch(0.72 0.18 155 / 0.6);
  }
  70% {
    box-shadow: 0 0 0 6px oklch(0.72 0.18 155 / 0);
  }
  100% {
    box-shadow: 0 0 0 0 oklch(0.72 0.18 155 / 0);
  }
}

.hero-title {
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}

.hero-title .accent-gradient {
  display: block;
  background: linear-gradient(135deg, var(--accent) 20%, var(--purple) 85%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 580px;
  margin-bottom: 18px;
}

/* Specialization Micro-Tags */
.specialization-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.spec-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  background-color: var(--surface-elevated);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.spec-tag svg {
  color: var(--accent);
}

/* Call to Action Buttons */
.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-xs);
  background-color: var(--text-primary);
  color: var(--bg);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.22s var(--ease-spring);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: var(--bg);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-xs);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.22s var(--ease-spring);
}

.btn-secondary:hover {
  background-color: var(--surface-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Directional Arrow Icon Handling */
.arrow-icon {
  transition: transform 0.2s var(--ease-spring);
}

.btn-primary:hover .arrow-icon,
.btn-secondary:hover .arrow-icon {
  transform: translateX(3px);
}

html[dir="rtl"] .arrow-icon {
  transform: scaleX(-1);
}

html[dir="rtl"] .btn-primary:hover .arrow-icon,
html[dir="rtl"] .btn-secondary:hover .arrow-icon {
  transform: scaleX(-1) translateX(3px);
}

/* Copy Email Micro-Action with Tooltip */
.copy-email-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s var(--ease-spring);
}

.copy-email-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background-color: var(--surface);
}

.copy-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  inset-inline-start: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 5px 10px;
  background-color: var(--text-primary);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.18s var(--ease-spring);
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.copy-tooltip.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Hero Visual Side: Personal Portrait & Social Media Dock
   ========================================================================== */

.hero-visual-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color 0.25s var(--ease-smooth);
  max-width: 296px;
  width: 100%;
  margin-inline: auto;
}

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

/* Studio Portrait with Subtle Halo */
.avatar-halo-wrapper {
  position: relative;
  width: 84px;
  height: 84px;
  margin-bottom: 12px;
}

.avatar-halo-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple), var(--emerald));
  opacity: 0.25;
  filter: blur(8px);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.hero-visual-card:hover .avatar-halo-ring {
  opacity: 0.45;
  filter: blur(12px);
}

.avatar-image-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--surface);
  background-color: var(--surface-hover);
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.avatar-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease-spring);
}

.hero-visual-card:hover .avatar-image-frame img {
  transform: scale(1.04);
}

.avatar-badge-online {
  position: absolute;
  bottom: 3px;
  inset-inline-end: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--emerald);
  border: 2px solid var(--surface);
  z-index: 3;
  box-shadow: 0 1px 4px oklch(0.72 0.18 155 / 0.4);
}

.profile-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.profile-card-role {
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Comprehensive Social Media Dock */
.social-dock {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: var(--radius-pill);
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  width: auto;
  max-width: 100%;
}

.social-dock-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--text-secondary);
  background-color: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.2s var(--ease-spring);
  position: relative;
  flex-shrink: 0;
}

.social-dock-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background-color: var(--surface-hover);
  transform: translateY(-1px);
}

.social-dock-link svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* ==========================================================================
   Telemetry Bento Strip (Public Engineering Footprint)
   ========================================================================== */

.telemetry-strip {
  padding: 16px 0 28px;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.telemetry-card {
  position: relative;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background-color: var(--surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.22s var(--ease-spring);
  overflow: hidden;
}

.telemetry-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.telemetry-indicator {
  position: absolute;
  top: 12px;
  inset-inline-end: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}

.emerald-indicator { background-color: var(--emerald); color: var(--emerald); }
.purple-indicator { background-color: var(--purple); color: var(--purple); }
.accent-indicator { background-color: var(--accent); color: var(--accent); }
.amber-indicator { background-color: var(--amber); color: var(--amber); }

.telemetry-number {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.telemetry-plus {
  color: var(--accent);
  font-size: 1.05rem;
}

.telemetry-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

html[lang="fa"] .telemetry-label {
  letter-spacing: normal;
  text-transform: none;
  font-size: 0.74rem;
  font-weight: 500;
}

/* ==========================================================================
   Section Header & Filtering System
   ========================================================================== */

.section-padding {
  padding: 38px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

html[lang="fa"] .eyebrow {
  letter-spacing: normal;
}

.section-title {
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.section-subtitle {
  max-width: 480px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Project Filter Tabs */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
}

.filter-btn {
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  transition: all 0.2s var(--ease-spring);
}

.filter-btn:hover {
  background-color: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.filter-btn.active {
  background-color: var(--text-primary);
  color: var(--bg);
  border-color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Standardized 16:9 Banner Project Cards Grid
   ========================================================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.project-card {
  border-radius: var(--radius-md);
  background-color: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.28s var(--ease-spring);
  position: relative;
}

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

/* STRICT 16:9 ASPECT RATIO BANNER CONTAINER */
.project-banner-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
}

.project-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s var(--ease-spring);
}

.project-card:hover .project-banner-img {
  transform: scale(1.03);
}

/* Banner Overlay & Floating Badge */
.project-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, oklch(0 0 0 / 0.50) 100%);
  pointer-events: none;
}

.project-banner-badge {
  position: absolute;
  bottom: 10px;
  inset-inline-start: 12px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background-color: oklch(0 0 0 / 0.70);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  border: 1px solid oklch(1 0 0 / 0.12);
}

/* Card Body Content */
.project-card-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

html[lang="fa"] .project-tag {
  letter-spacing: normal;
  text-transform: none;
}

.project-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.project-card-desc {
  font-size: 0.825rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 12px;
  flex-grow: 1;
}

/* Architectural Proof Block */
.project-proof-callout {
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  background-color: var(--surface-subtle);
  border-inline-start: 2px solid var(--accent);
  font-size: 0.775rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-inline-end: 1px solid var(--border);
}

/* Stack Chips */
.stack-chips-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 14px;
}

.stack-chip {
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Card Action Links */
.project-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.card-action-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  transition: all 0.2s var(--ease-spring);
}

.card-action-link:hover {
  color: var(--accent-hover);
  transform: translateY(-1px);
}

/* ==========================================================================
   Upstream Open Source Track Record
   ========================================================================== */

.upstream-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.upstream-card {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.22s var(--ease-spring);
}

.upstream-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.upstream-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.upstream-org {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.upstream-badge {
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-merged {
  background-color: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid oklch(0.72 0.18 155 / 0.3);
}

.badge-approved {
  background-color: var(--accent-soft);
  color: var(--accent);
  border: 1px solid oklch(0.68 0.19 250 / 0.3);
}

.upstream-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.upstream-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 12px;
  flex-grow: 1;
}

.upstream-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.upstream-pr-id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Engineering DNA & Core Architecture Columns
   ========================================================================== */

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

.dna-card {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.25s var(--ease-spring);
}

.dna-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dna-icon-frame {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  background-color: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}

.dna-icon-frame svg {
  width: 16px;
  height: 16px;
}

.dna-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.dna-desc {
  font-size: 0.825rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ==========================================================================
   Interactive Terminal & Command Strip
   ========================================================================== */

.terminal-box {
  margin-top: 24px;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  background-color: var(--surface-subtle);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-family: var(--font-mono);
}

.terminal-command {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-primary);
  overflow-x: auto;
}

.terminal-prompt {
  color: var(--accent);
  font-weight: 700;
}

.terminal-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  background-color: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s var(--ease-spring);
}

.terminal-copy-btn:hover {
  background-color: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* ==========================================================================
   High-Impact CTA Box & Footer
   ========================================================================== */

/* Collaboration & Engagement Vectors Grid */
.engagement-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.engagement-card {
  padding: 20px 20px;
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.25s var(--ease-spring);
}

.engagement-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.engagement-icon-frame {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  background-color: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}

.engagement-icon-frame svg {
  width: 16px;
  height: 16px;
}

.engagement-title {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.engagement-desc {
  font-size: 0.825rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.cta-banner-title {
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.cta-banner {
  padding: 28px 32px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--surface-elevated), var(--surface));
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: "";
  position: absolute;
  inset-inline-end: -40px;
  bottom: -40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.cta-title {
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
}

.cta-desc {
  max-width: 520px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.site-footer {
  padding: 24px 0 36px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-social-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-social-links a:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   Mobile Responsive Architecture
   ========================================================================== */

@media (max-width: 1024px) {
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-visual-card {
    order: -1;
    max-width: 320px;
    margin-inline: auto;
  }

  .telemetry-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .dna-grid {
    grid-template-columns: 1fr;
  }

  .engagement-grid {
    grid-template-columns: 1fr;
  }

  .upstream-grid {
    grid-template-columns: 1fr;
  }

  .cta-banner {
    flex-direction: column;
    text-align: center;
    padding: 36px 24px;
  }

  .cta-desc {
    margin-inline: auto;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }

  .menu-toggle-btn {
    display: inline-flex;
  }

  .github-cta-btn span {
    display: none;
  }

  .github-cta-btn {
    padding: 0 10px;
    width: 40px;
    height: 40px;
    justify-content: center;
  }

  .nav-actions {
    gap: 6px;
  }

  .nav-menu.open {
    display: flex;
    position: absolute;
    top: 56px;
    inset-inline-start: 16px;
    inset-inline-end: 16px;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    background-color: var(--surface-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 210;
  }

  .nav-menu.open .nav-item {
    padding: 12px 16px;
    border-radius: var(--radius-xs);
  }

  .nav-menu.open .nav-item:hover {
    background-color: var(--surface-hover);
  }

  .hero-cta-group {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
  }

  .hero-cta-group .btn-primary,
  .hero-cta-group .btn-secondary,
  .hero-cta-group .copy-email-btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .filter-tabs {
    display: flex !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 6px;
    width: 100%;
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 38px;
  }

  .project-card-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 32px);
  }

  .hero-section {
    padding-top: 28px;
    padding-bottom: 40px;
  }

  .hero-title,
  html[lang="fa"] .hero-title {
    font-size: clamp(1.45rem, 5.8vw, 1.85rem) !important;
    line-height: 1.25 !important;
  }

  .telemetry-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }

  .telemetry-card {
    padding: 12px 12px;
  }

  .telemetry-number {
    font-size: 1.25rem;
  }

  .telemetry-label {
    font-size: 0.72rem;
  }

  .hero-visual-card {
    max-width: 296px;
    margin-inline: auto;
  }

  .project-card-body,
  .upstream-card,
  .dna-card {
    padding: 16px;
  }

  .project-meta-top {
    flex-wrap: wrap;
    gap: 6px;
  }

  .cta-banner {
    padding: 28px 18px;
  }

  .cta-btn {
    width: 100%;
    max-width: 320px;
    justify-content: center;
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .container {
    width: calc(100% - 24px);
  }

  .telemetry-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }

  .telemetry-card {
    padding: 10px 8px;
  }

  .telemetry-number {
    font-size: 1.15rem;
  }

  .telemetry-label {
    font-size: 0.68rem;
  }

  .profile-avatar-wrapper {
    width: 76px;
    height: 76px;
  }

  .social-dock {
    gap: 4px;
    padding: 4px 6px;
  }

  .social-dock-link {
    width: 27px;
    height: 27px;
  }
}

/* Accessibility: 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;
  }
}
