/* ==========================================================================
   MOHAMMAD HOSSEIN YAGHUBI - PORTFOLIO DESIGN SYSTEM
   Theme: Midnight Matrix & Technical Minimalism
   Full RTL & LTR Bilingual Support (English / Persian)
   ========================================================================== */

:root {
  --bg-canvas: #070A0F;
  --bg-surface: #0B0F17;
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-card-hover: rgba(22, 32, 56, 0.85);
  --bg-glass-input: rgba(11, 15, 23, 0.9);
  
  --primary: #0D9488;
  --primary-light: #14B8A6;
  --primary-glow: rgba(13, 148, 136, 0.35);
  --teal-emerald: #10B981;
  --cyan: #38BDF8;
  --cyan-glow: rgba(56, 189, 248, 0.25);
  --indigo: #6366F1;
  --indigo-glow: rgba(99, 102, 241, 0.25);
  --amber: #F59E0B;
  
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-bright: rgba(255, 255, 255, 0.16);
  --border-glow: rgba(56, 189, 248, 0.3);
  
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-persian: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;

  --transition-fast: 0.18s ease;
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

body {
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  background-color: var(--bg-canvas);
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(13, 148, 136, 0.15), transparent),
    radial-gradient(circle 600px at 90% 20%, rgba(56, 189, 248, 0.06), transparent),
    radial-gradient(circle 500px at 10% 60%, rgba(99, 102, 241, 0.07), transparent);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Persian / RTL Typography & Layout Adjustments */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
  font-family: var(--font-persian);
}

[dir="rtl"] h1, 
[dir="rtl"] h2, 
[dir="rtl"] h3, 
[dir="rtl"] h4, 
[dir="rtl"] .font-heading {
  font-family: var(--font-persian);
  letter-spacing: 0 !important;
}

[dir="rtl"] .font-mono {
  font-family: var(--font-mono), var(--font-persian);
  direction: ltr;
  display: inline-block;
  text-align: left;
}

[dir="rtl"] .code-terminal,
[dir="rtl"] .ltr-code {
  direction: ltr !important;
  text-align: left !important;
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

@media (max-width: 640px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Glassmorphic Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 1rem;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-panel:hover {
  border-color: rgba(56, 189, 248, 0.25);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7), 0 0 20px -5px rgba(56, 189, 248, 0.15);
}

/* Header & Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  transition: all var(--transition-normal);
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 2px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 14px rgba(13, 148, 136, 0.35);
  flex-shrink: 0;
  display: block;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.brand-logo:hover .brand-avatar {
  transform: scale(1.08);
  border-color: #38BDF8;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.6);
}

.brand-symbol {
  color: var(--primary-light);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  background: rgba(13, 148, 136, 0.12);
  border: 1px solid rgba(13, 148, 136, 0.25);
  border-radius: 0.375rem;
}

.brand-title {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 700;
  font-size: 1.15rem;
  color: #FFFFFF;
}

.brand-tag {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.925rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.05);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Language Switcher Button */
.lang-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass-bright);
  color: var(--text-secondary);
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-toggle-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--cyan);
}

.lang-toggle-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  color: #FFF;
}

/* Primary Button CTA */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #0D9488 0%, #0284C7 100%);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.925rem;
  padding: 0.65rem 1.35rem;
  border-radius: 0.625rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 18px var(--primary-glow);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(13, 148, 136, 0.5);
  color: #FFFFFF;
}

.btn-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.925rem;
  padding: 0.65rem 1.25rem;
  border-radius: 0.625rem;
  border: 1px solid var(--border-glass-bright);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-glass:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--cyan);
  transform: translateY(-2px);
}

/* Mobile Toggle */
.mobile-menu-btn {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass-bright);
  color: var(--text-primary);
  font-size: 1.25rem;
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--cyan);
}

@media (max-width: 900px) {
  .nav-desktop {
    display: none;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
}

.mobile-drawer {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem 1rem 1.75rem;
  background: rgba(11, 15, 23, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-glass-bright);
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.85);
}

.mobile-drawer.open {
  display: flex;
  animation: mobileSlideDown 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.mobile-drawer .nav-link {
  font-size: 1rem;
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-radius: 0.625rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-drawer .nav-link:hover,
.mobile-drawer .nav-link.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.25);
  color: var(--cyan);
}

.mobile-drawer-footer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Hero Section */
.hero-section {
  padding: 4.5rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 3rem;
  align-items: center;
}

.hero-content,
.hero-terminal-wrap {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 100%;
    gap: 2.25rem;
  }
}

/* Status Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(13, 148, 136, 0.12);
  border: 1px solid rgba(13, 148, 136, 0.3);
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.775rem;
  font-weight: 600;
  color: #5EEAD4;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
  max-width: 100%;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10B981;
  box-shadow: 0 0 10px #10B981;
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-greeting {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--cyan);
  margin-bottom: 0.5rem;
  font-family: var(--font-heading);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #FFFFFF;
  margin-bottom: 0.65rem;
  word-break: break-word;
  overflow-wrap: break-word;
}

.hero-subtitle {
  font-size: clamp(1.15rem, 3vw, 1.35rem);
  font-weight: 600;
  color: var(--teal-emerald);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  line-height: 1.35;
}

.hero-subtitle .sub-role {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 1.15rem;
}

.hero-description {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 620px;
}

/* Metric Cards */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2.25rem;
}

.metric-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 0.75rem;
  padding: 1rem;
  backdrop-filter: blur(8px);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.metric-val {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: #38BDF8;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.35;
}

/* Hero CTA Group */
.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.email-copy-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-glass-bright);
  padding: 0.65rem 1rem;
  border-radius: 0.625rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  max-width: 100%;
}

.email-copy-pill:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--cyan);
}

/* Code Terminal Window */
.terminal-window {
  background: #0B111E;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.8), 0 0 30px -10px rgba(56, 189, 248, 0.2);
  position: relative;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.terminal-header {
  background: #0F172A;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mac-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mac-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.dot-red { background: #FF5F56; }
.dot-yellow { background: #FFBD2E; }
.dot-green { background: #27C93F; }

.terminal-tab {
  font-family: var(--font-mono);
  font-size: 0.775rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terminal-pill-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
}

.terminal-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terminal-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.terminal-btn:hover {
  color: #FFF;
  background: rgba(56, 189, 248, 0.2);
}

.terminal-code-body {
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.65;
  color: #E2E8F0;
  overflow-x: auto;
  direction: ltr !important;
  text-align: left !important;
}

/* Syntax Highlight classes */
.code-keyword { color: #F472B6; font-weight: 600; }
.code-class { color: #38BDF8; font-weight: 600; }
.code-func { color: #FBBF24; }
.code-str { color: #34D399; }
.code-comment { color: #64748B; font-style: italic; }
.code-var { color: #E2E8F0; }
.code-num { color: #A78BFA; }

.terminal-footer {
  background: #080D17;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  direction: ltr !important;
}

.terminal-cmd {
  color: #94A3B8;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.terminal-cmd span.caret {
  color: #38BDF8;
}

.terminal-status-ok {
  color: #10B981;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

/* Floating Terminal Badge */
.power-eng-badge {
  margin-top: 1rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  backdrop-filter: blur(12px);
}

.badge-icon {
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  background: rgba(56, 189, 248, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  font-size: 1rem;
}

.badge-text-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFFFFF;
}

.badge-text-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Section Header Structure */
.section-wrapper {
  padding: 4.5rem 0;
  position: relative;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  margin-bottom: 0.65rem;
}

@media (max-width: 640px) {
  .section-title {
    font-size: 1.95rem;
  }
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin-bottom: 2.75rem;
}

/* 01 // About & Core Foundation */
.about-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.75rem;
}

@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

.about-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.about-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-pill-tag {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
}

.card-icon-ghost {
  color: var(--text-dim);
  font-size: 1.25rem;
}

.about-card-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 0.85rem;
}

.about-card-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

.about-features-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-glass);
}

@media (max-width: 640px) {
  .about-features-row {
    grid-template-columns: 1fr;
  }
}

.feature-micro-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.feature-micro-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #38BDF8;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.feature-micro-desc {
  font-size: 0.775rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.academic-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.45rem 0.85rem;
  border-radius: 0.5rem;
  color: #34D399;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 1.25rem;
}

/* 02 // Experience */
.experience-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 992px) {
  .experience-grid {
    grid-template-columns: 1fr;
  }
}

.experience-card {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.exp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.exp-company-tag {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  color: var(--cyan);
}

.exp-role-tag {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  color: var(--text-dim);
}

.exp-company-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 0.25rem;
}

.exp-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--teal-emerald);
  margin-bottom: 1rem;
}

.exp-description {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.exp-bullet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.exp-bullet-item {
  font-size: 0.825rem;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.exp-bullet-item i {
  color: var(--primary-light);
  margin-top: 0.2rem;
  font-size: 0.75rem;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-glass);
}

.tag-badge {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  padding: 0.2rem 0.55rem;
  border-radius: 0.375rem;
  color: var(--text-secondary);
}

/* 03 // Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 992px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

.skill-card {
  padding: 1.5rem;
}

.skill-card-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.skill-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 0.5rem;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  font-size: 1.1rem;
}

.skill-card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #FFFFFF;
}

.skill-card-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  min-height: 2.5rem;
}

/* 04 // Featured Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

.project-card {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project-mockup-frame {
  background: #060911;
  border: 1px solid var(--border-glass-bright);
  border-radius: 0.75rem;
  overflow: hidden;
  position: relative;
  margin-bottom: 1.5rem;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mockup-inner {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform var(--transition-slow);
}

.project-mockup-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform var(--transition-slow);
}

.project-card:hover .mockup-inner,
.project-card:hover .project-mockup-img {
  transform: scale(1.04);
}

.mockup-overlay-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(7, 10, 15, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34D399;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.725rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

[dir="rtl"] .mockup-overlay-badge {
  left: auto;
  right: 0.75rem;
}

.project-subhead {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.project-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 0.75rem;
}

.project-quote {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-glass);
}

.project-host-note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* 05 // Contact Section */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2.5rem;
}

@media (max-width: 900px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.direct-mail-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.mail-label {
  font-size: 0.775rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.mail-address {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: #FFFFFF;
  margin-bottom: 0.75rem;
  word-break: break-all;
}

.social-links-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.social-btn {
  width: 42px;
  height: 42px;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.social-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--cyan);
  transform: translateY(-2px);
}

/* Telegram Quick Order Card */
.telegram-order-card {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(99, 102, 241, 0.12) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-top: 1.75rem;
}

.tg-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #0284C7;
  color: #FFF;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.725rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
}

/* Form inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--bg-glass-input);
  border: 1px solid var(--border-glass-bright);
  border-radius: 0.625rem;
  padding: 0.75rem 1rem;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.25);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--teal-emerald);
  color: #FFFFFF;
  padding: 0.85rem 1.4rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  font-weight: 500;
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-normal);
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

[dir="rtl"] .toast-notice {
  right: auto;
  left: 2rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-glass);
  padding: 3.5rem 0 2.5rem;
  background: #06090F;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.footer-brand h4 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: #FFFFFF;
  margin-bottom: 0.35rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.875rem;
  max-width: 480px;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.5rem;
  font-size: 0.825rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 1rem;
}

/* Interactive Tabs (Used in products.html) */
.filter-tabs-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 2rem;
}

.filter-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.filter-tab-btn.active, .filter-tab-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #FFFFFF;
}

/* Modal Styling */
.custom-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.custom-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content-box {
  background: #0B111E;
  border: 1px solid var(--border-glass-bright);
  border-radius: 1rem;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

[dir="rtl"] .modal-close-btn {
  right: auto;
  left: 1.25rem;
}

/* ==========================================================================
   COMPREHENSIVE MOBILE RESPONSIVE ENGINE (Tablet & Phone Form Factors)
   ========================================================================== */

@media (max-width: 768px) {
  /* Layout & Spacing */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .section-wrapper {
    padding: 2.75rem 0;
  }

  .section-tag {
    font-size: 0.75rem;
  }

  .section-title {
    font-size: clamp(1.75rem, 6.5vw, 2.15rem);
    line-height: 1.25;
  }

  .section-subtitle {
    font-size: 0.925rem;
    line-height: 1.6;
    margin-bottom: 2rem;
  }

  /* Header on Mobile */
  .site-header {
    background: rgba(7, 10, 15, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    max-width: 100vw;
  }

  .header-inner {
    height: 60px;
  }

  .brand-logo {
    gap: 0.55rem;
    min-width: 0;
  }

  .brand-avatar {
    width: 35px;
    height: 35px;
    border-width: 1.5px;
  }

  .brand-symbol {
    font-size: 0.9rem;
    padding: 0.15rem 0.4rem;
    flex-shrink: 0;
  }

  .brand-name {
    font-size: 1.05rem;
    white-space: nowrap;
  }

  .brand-tag {
    display: none;
  }

  .header-actions {
    gap: 0.45rem;
    flex-shrink: 0;
  }

  .header-actions .btn-primary {
    display: none; /* Accessible in the mobile drawer */
  }

  .lang-toggle-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.775rem;
    white-space: nowrap;
  }

  .mobile-menu-btn {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
  }

  /* Hero Section */
  .hero-section {
    padding: 1.75rem 0 2rem;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow: hidden;
  }

  .hero-grid {
    grid-template-columns: 100% !important;
    gap: 2rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .hero-grid > * {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100%;
    box-sizing: border-box;
  }

  .status-pill {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.5rem;
    white-space: normal;
    font-size: 0.72rem;
    line-height: 1.4;
    padding: 0.45rem 0.85rem;
    max-width: 100%;
    border-radius: 0.75rem;
    word-break: break-word;
    box-sizing: border-box;
    margin-bottom: 1rem;
  }

  .status-pill .pulse-dot {
    margin-top: 0.25rem;
    flex-shrink: 0;
  }

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

  .hero-title {
    font-size: clamp(1.85rem, 6.8vw, 2.35rem);
    line-height: 1.18;
    margin-bottom: 0.5rem;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .hero-subtitle {
    font-size: clamp(1.05rem, 4vw, 1.25rem);
    margin-bottom: 1rem;
    line-height: 1.35;
  }

  .hero-subtitle .sub-role {
    font-size: 0.95rem;
  }

  .hero-description {
    font-size: 0.925rem;
    line-height: 1.65;
    margin-bottom: 1.5rem;
  }

  /* Compact 3-Column Metrics (Tablet) */
  .metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
  }

  .metric-card {
    padding: 0.75rem 0.45rem;
    text-align: center;
    box-sizing: border-box;
    min-width: 0;
  }

  .metric-val {
    font-size: clamp(1.15rem, 4.5vw, 1.45rem);
    margin-bottom: 0.2rem;
    line-height: 1;
  }

  .metric-label {
    font-size: 0.68rem;
    line-height: 1.25;
    word-break: break-word;
  }

  /* Hero CTA Group */
  .hero-cta-group {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
    box-sizing: border-box;
  }

  .hero-cta-group .btn-primary,
  .hero-cta-group .btn-glass,
  .hero-cta-group .email-copy-pill {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    box-sizing: border-box;
  }

  .email-copy-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    overflow: hidden;
  }

  .email-copy-pill span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
    font-size: 0.82rem;
  }

  /* Terminal Window */
  .hero-terminal-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .terminal-window {
    border-radius: 0.75rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .terminal-header {
    padding: 0.65rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    box-sizing: border-box;
  }

  .mac-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
  }

  .mac-dot {
    width: 9px;
    height: 9px;
  }

  .terminal-tab {
    font-size: 0.72rem;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .terminal-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
  }

  .terminal-pill-badge {
    display: none;
  }

  .terminal-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }

  .terminal-code-body {
    padding: 0.85rem;
    font-size: 0.76rem;
    line-height: 1.55;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .terminal-code-body code {
    display: block;
    white-space: pre;
    min-width: max-content;
  }

  .terminal-footer {
    padding: 0.65rem 0.75rem;
    font-size: 0.7rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    width: 100%;
    box-sizing: border-box;
  }

  .terminal-cmd {
    width: 100%;
    word-break: break-all;
    white-space: normal;
  }

  .power-eng-badge {
    padding: 0.75rem 0.85rem;
    gap: 0.65rem;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin-top: 0.85rem;
  }

  .badge-icon {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
    flex-shrink: 0;
  }

  .badge-text-title {
    font-size: 0.825rem;
  }

  .badge-text-sub {
    font-size: 0.725rem;
    line-height: 1.35;
  }

  /* About Section Cards */
  .about-card {
    padding: 1.35rem 1.15rem;
  }

  .about-card-title {
    font-size: 1.25rem;
  }

  .about-card-body {
    font-size: 0.875rem;
    line-height: 1.65;
    margin-bottom: 1.25rem;
  }

  .about-features-row {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  /* Experience Cards */
  .experience-card {
    padding: 1.35rem 1.15rem;
  }

  .exp-company-name {
    font-size: 1.35rem;
  }

  .exp-title {
    font-size: 0.825rem;
    margin-bottom: 0.75rem;
  }

  .exp-description {
    font-size: 0.825rem;
    line-height: 1.6;
    margin-bottom: 1rem;
  }

  /* Skills Grid */
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .skill-card {
    padding: 1.25rem;
  }

  /* Featured Projects Cards */
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .project-card {
    padding: 1.35rem 1.15rem;
  }

  .project-title {
    font-size: 1.45rem;
  }

  .project-quote {
    font-size: 0.85rem;
    line-height: 1.6;
  }

  .project-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .project-footer .btn-primary,
  .project-footer .btn-glass,
  .project-footer .btn-launch-telegram {
    width: 100%;
    justify-content: center;
    padding: 0.7rem;
    font-size: 0.85rem;
  }

  .project-host-note {
    text-align: center;
  }

  /* Contact Section */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .direct-mail-box {
    padding: 1.15rem;
  }

  .mail-address {
    font-size: 0.95rem;
  }

  .telegram-order-card {
    padding: 1.25rem;
  }

  /* Form Elements */
  form div[style*="grid-template-columns: 1fr 1fr"],
  form div[style*="grid-template-columns: 1fr 1fr;"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  form button[type="submit"],
  form button[type="button"] {
    width: 100%;
    justify-content: center;
  }

  /* Social links */
  .social-links-row {
    justify-content: center;
  }

  .social-btn {
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
  }

  /* Filter Tabs */
  .filter-tabs-row {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
  }

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

  .filter-tab-btn {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
  }

  /* Toast Notification */
  .toast-notice {
    left: 1rem !important;
    right: 1rem !important;
    bottom: 1.25rem;
    width: auto;
    max-width: calc(100% - 2rem);
    justify-content: center;
    text-align: center;
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
  }

  /* Modal */
  .modal-content-box {
    padding: 1.5rem 1.25rem;
    max-width: 95vw;
  }

  /* Footer */
  .footer-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

/* Mobile Phone Viewports (540px and below) */
@media (max-width: 540px) {
  .hero-section {
    padding: 1.25rem 0 1.5rem;
  }

  .status-pill {
    font-size: 0.68rem;
    padding: 0.35rem 0.65rem;
    line-height: 1.35;
  }

  .hero-title {
    font-size: clamp(1.75rem, 7.5vw, 2.15rem);
  }

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

  .hero-subtitle .sub-role {
    font-size: 0.9rem;
  }

  .metrics-row {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 1.35rem;
  }

  .metric-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
  }

  [dir="rtl"] .metric-card {
    text-align: right;
  }

  .metric-val {
    font-size: 1.45rem;
    margin-bottom: 0;
    order: 2;
    flex-shrink: 0;
  }

  .metric-label {
    font-size: 0.825rem;
    order: 1;
    margin-right: 0.75rem;
    line-height: 1.3;
  }

  [dir="rtl"] .metric-label {
    margin-right: 0;
    margin-left: 0.75rem;
  }

  .email-copy-pill span {
    max-width: 200px;
    font-size: 0.78rem;
  }
}

/* Extra small devices (portrait phones, under 420px) */
@media (max-width: 420px) {
  .hero-title {
    font-size: 1.7rem;
  }

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

  .brand-name {
    font-size: 0.95rem;
  }

  .email-copy-pill span {
    max-width: 180px;
    font-size: 0.75rem;
  }

  .terminal-header {
    padding: 0.5rem 0.65rem;
  }

  .terminal-code-body {
    padding: 0.75rem 0.65rem;
    font-size: 0.72rem;
  }
}

