:root {
  /* DARK THEME (DEFAULT) */
  --bg: #060913;
  --bg-secondary: #0c1222;
  --card-bg: rgba(15, 23, 42, 0.72);
  --card-border: rgba(56, 189, 248, 0.14);
  --card-border-hover: rgba(56, 189, 248, 0.45);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.35);
  --accent: #818cf8;
  --gradient-main: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  --gradient-card: linear-gradient(145deg, rgba(20, 32, 57, 0.75), rgba(12, 18, 34, 0.6));
  --shadow-sm: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 25px 50px -12px rgba(2, 6, 23, 0.75), 0 0 30px -5px rgba(56, 189, 248, 0.15);
  --input-bg: rgba(6, 9, 19, 0.75);
  --nav-bg: rgba(6, 9, 19, 0.82);
  --nav-scrolled: rgba(6, 9, 19, 0.95);
  --radius-lg: 20px;
  --radius-md: 14px;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* LIGHT THEME (SWITCHABLE) */
[data-theme="light"] {
  --bg: #f8fafc;
  --bg-secondary: #f1f5f9;
  --card-bg: rgba(255, 255, 255, 0.9);
  --card-border: rgba(14, 165, 233, 0.2);
  --card-border-hover: rgba(14, 165, 233, 0.55);
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #0284c7;
  --primary-glow: rgba(2, 132, 199, 0.25);
  --accent: #6366f1;
  --gradient-main: linear-gradient(135deg, #0284c7 0%, #6366f1 50%, #a855f7 100%);
  --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(241, 245, 249, 0.9));
  --shadow-sm: 0 10px 25px -8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 40px -10px rgba(15, 23, 42, 0.12), 0 0 25px -3px rgba(14, 165, 233, 0.15);
  --input-bg: #ffffff;
  --nav-bg: rgba(248, 250, 252, 0.85);
  --nav-scrolled: rgba(255, 255, 255, 0.96);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Ambient mesh background */
.ambient-mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  opacity: 0.25;
  background-image: 
    radial-gradient(at 15% 15%, rgba(56, 189, 248, 0.25) 0px, transparent 50%),
    radial-gradient(at 85% 80%, rgba(129, 140, 248, 0.2) 0px, transparent 55%),
    radial-gradient(at 50% 50%, rgba(192, 132, 252, 0.1) 0px, transparent 65%);
}

[data-theme="light"] .ambient-mesh {
  opacity: 0.15;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
}

[data-theme="light"] body::after {
  background-image: 
    linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
}

.cursor-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, rgba(129, 140, 248, 0.05) 45%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.3s ease;
  will-change: left, top;
}

/* Page reading progress bar */
.page-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3.5px;
  background: var(--gradient-main);
  z-index: 9999;
  box-shadow: 0 0 15px var(--primary);
  transition: width 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 28px;
  padding-right: 28px;
}

.text-gradient {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Header & Navbar */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--nav-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: var(--transition-smooth);
}

[data-theme="light"] .site-header {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.site-header.scrolled {
  background: var(--nav-scrolled);
  border-bottom-color: var(--card-border);
  box-shadow: var(--shadow-sm);
}

.navbar {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
}

.logo-box {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(129, 140, 248, 0.08));
  border: 1px solid var(--card-border-hover);
  border-radius: 12px;
  color: var(--primary);
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.18);
  transition: var(--transition-smooth);
}

.logo:hover .logo-box {
  transform: translateY(-2px) rotate(4deg);
  border-color: var(--primary);
}

.logo-text {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-text small {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 5px 8px;
  border-radius: 30px;
  backdrop-filter: blur(12px);
}

[data-theme="light"] .nav-links {
  background: rgba(241, 245, 249, 0.7);
  border-color: rgba(0, 0, 0, 0.05);
}

.nav-link {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.nav-link.active {
  color: #fff;
  background: var(--gradient-main);
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.35);
}

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

/* Theme Toggle Button */
.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 17px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

[data-theme="dark"] .icon-sun {
  display: block;
}
[data-theme="dark"] .icon-moon {
  display: none;
}

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

.cv-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 25px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(129, 140, 248, 0.15));
  border: 1px solid var(--card-border-hover);
  color: var(--text);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  transition: var(--transition-smooth);
}

.cv-button:hover {
  background: var(--gradient-main);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.35);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 25px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  transition: var(--transition-smooth);
}

[data-theme="light"] .nav-cta {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.03);
}

.nav-cta:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.menu-toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 6px;
}

/* Sections */
.section {
  padding: 125px 0;
  position: relative;
}

.section-muted {
  background: var(--bg-secondary);
  border-top: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
}

.hero {
  min-height: 100vh;
  padding-top: 155px;
  padding-bottom: 75px;
  display: flex;
  align-items: center;
}

.hero-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 65px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.85fr);
  align-items: center;
  gap: 60px;
}

.hero-content {
  max-width: 660px;
  position: relative;
  z-index: 2;
  padding-right: 15px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 8px 16px;
  border-radius: 30px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 22px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
  animation: modernPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.mini-title {
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 6px;
}

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(44px, 5.5vw, 68px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 18px;
}

/* Specialization Title Container with Typewriter */
.role-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.role-prefix {
  color: var(--text-muted);
  font-size: 19px;
  font-weight: 500;
}

.role-box {
  display: inline-flex;
  align-items: center;
  width: auto;
  max-width: fit-content;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid var(--card-border-hover);
  padding: 4px 12px;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
  transition: all 0.25s ease;
}

.role-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.type-cursor {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  color: var(--primary);
  margin-left: 5px;
  animation: cursorBlink 0.8s infinite;
  font-weight: 300;
  line-height: 1;
}

.hero-text {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: var(--gradient-main);
  color: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(56, 189, 248, 0.4);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 35px -5px rgba(56, 189, 248, 0.6);
}

.btn-outline {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text);
  backdrop-filter: blur(10px);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-3px);
  background: rgba(56, 189, 248, 0.08);
}

.social-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.social-row a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 16px;
  transition: var(--transition-smooth);
}

.social-row a:hover {
  color: #fff;
  border-color: var(--primary);
  background: var(--gradient-main);
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.25);
}

/* Hero Visual Frame & Floating Elements */
.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  min-height: 460px;
}

.visual-glow-backdrop {
  position: absolute;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.25), rgba(129, 140, 248, 0.1), transparent 70%);
  border-radius: 50%;
  filter: blur(50px);
  z-index: 0;
  animation: ambientFloat 8s ease-in-out infinite alternate;
}

.image-frame {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  border: 1px solid var(--card-border-hover);
  box-shadow: var(--shadow-lg);
  z-index: 2;
}

.hero-image {
  width: min(390px, 85vw);
  height: min(390px, 85vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  animation: modernFloat 6s ease-in-out infinite;
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 30%;
  transform: scale(2.45);
  transform-origin: 52% 30%;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-frame:hover img {
  transform: scale(2.72);
}

.image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #64748b;
  background: linear-gradient(145deg, #0f172a, #090d1a);
}

.image-placeholder i {
  font-size: 50px;
  color: var(--primary);
}

.image-frame:not(.image-missing) .image-placeholder {
  display: none;
}

.orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(56, 189, 248, 0.2);
  z-index: 1;
  pointer-events: none;
}

.orbit-outer {
  width: 520px;
  height: 520px;
  animation: rotateClockwise 40s linear infinite;
}

.orbit-inner {
  width: 440px;
  height: 440px;
  border-color: rgba(129, 140, 248, 0.25);
  animation: rotateCounterClockwise 30s linear infinite;
}

.orbit-sparkle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 15px var(--primary);
}

.sparkle-1 {
  top: 15%;
  right: 10%;
  animation: modernFloat 4s ease-in-out infinite;
}

.sparkle-2 {
  bottom: 20%;
  left: 8%;
  background: var(--accent);
  box-shadow: 0 0 15px var(--accent);
  animation: modernFloat 5s ease-in-out infinite reverse;
}

.floating-badge {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border-hover);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: var(--transition-smooth);
}

.badge-top {
  top: 25px;
  right: -10px;
  animation: badgeFloat1 5s ease-in-out infinite;
}

.badge-bottom {
  bottom: 40px;
  left: -15px;
  animation: badgeFloat2 5.5s ease-in-out infinite;
}

.floating-badge:hover {
  transform: scale(1.06) !important;
  border-color: var(--primary);
}

.badge-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--primary);
  font-size: 18px;
}

.badge-text strong {
  display: block;
  font-size: 17px;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text);
}

.badge-text small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

/* Stats Card */
.stats-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
}

.stat-item {
  text-align: center;
  position: relative;
  transition: var(--transition-smooth);
}

.stat-item:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 15%;
  height: 70%;
  width: 1px;
  background: var(--card-border);
}

.stat-item:hover {
  transform: translateY(-4px);
}

.stat-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}

.stat-value strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(30px, 3.2vw, 42px);
  font-weight: 700;
  color: var(--text);
}

.stat-value .symbol {
  font-size: 24px;
  color: var(--primary);
  font-weight: 700;
}

.stat-item small {
  display: block;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  margin-top: 4px;
}

/* -------------------------------------------------------------
   ABOUT SECTION (Card Positioned with Clear Visibility)
------------------------------------------------------------- */
.section-heading {
  margin-bottom: 50px;
}

.section-label {
  display: inline-block;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.25;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 70px;
  align-items: center;
}

.about-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.about-image {
  width: min(370px, 100%);
  height: 420px;
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  z-index: 1;
}

/* Experience Card positioned prominently in foreground without cutoffs */
.experience-card {
  position: relative;
  margin-top: -35px;
  z-index: 10;
  background: var(--gradient-main);
  color: #ffffff;
  padding: 16px 24px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 15px 35px rgba(56, 189, 248, 0.4);
  max-width: 360px;
  width: 90%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: var(--transition-smooth);
}

.experience-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 40px rgba(56, 189, 248, 0.55);
}

.exp-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.exp-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.exp-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.exp-text {
  font-size: 12.5px;
  line-height: 1.4;
  color: #f8fafc;
}

.highlight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 28px;
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.highlight-item i {
  color: var(--primary);
  font-size: 16px;
}

.highlight-item:hover {
  border-color: var(--primary);
  transform: translateX(6px);
  background: rgba(56, 189, 248, 0.08);
}

/* Education & Experience */
.education-card {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  padding: 36px;
  background: var(--gradient-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.education-card:hover {
  border-color: var(--card-border-hover);
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.education-icon {
  width: 65px;
  height: 65px;
  display: grid;
  place-items: center;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  color: var(--primary);
  font-size: 26px;
}

.date-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.education-main h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.school-name {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.education-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 12.5px;
}

.education-meta span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.education-meta i {
  color: var(--primary);
}

.timeline {
  position: relative;
  max-width: 960px;
  margin: auto;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--primary) 0%, rgba(56, 189, 248, 0.1) 100%);
}

.timeline-item {
  position: relative;
  padding-left: 85px;
  margin-bottom: 30px;
}

.timeline-marker {
  position: absolute;
  left: 0;
  top: 15px;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 18px;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
  transition: var(--transition-smooth);
}

.timeline-item:hover .timeline-marker {
  background: var(--gradient-main);
  color: #fff;
  transform: scale(1.1) rotate(6deg);
}

.timeline-card {
  padding: 28px;
  background: var(--gradient-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.timeline-card:hover {
  border-color: var(--card-border-hover);
  transform: translateX(8px);
  box-shadow: var(--shadow-lg);
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 6px;
}

.timeline-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 19px;
  font-weight: 700;
}

.timeline-card h4 {
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 600;
}

.timeline-card .location {
  color: var(--text-muted);
  font-size: 11.5px;
  margin-bottom: 12px;
}

.timeline-card ul {
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.timeline-card li {
  margin-bottom: 6px;
}

/* Skills & Projects */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.skill-card {
  padding: 30px;
  background: var(--gradient-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.skill-card::before,
.project-card::before,
.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-main);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.skill-card:hover,
.project-card:hover,
.service-card:hover {
  transform: translateY(-8px) scale(1.015);
  border-color: var(--card-border-hover);
  box-shadow: var(--shadow-lg);
}

.skill-card:hover::before,
.project-card:hover::before,
.service-card:hover::before {
  opacity: 1;
}

.skill-icon {
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 18px;
  display: inline-block;
  transition: var(--transition-smooth);
}

.skill-card:hover .skill-icon {
  transform: scale(1.18) rotate(-8deg);
}

.skill-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

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

.tags span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(56, 189, 248, 0.05);
  border: 1px solid var(--card-border);
  padding: 6px 10px;
  border-radius: 8px;
  transition: var(--transition-smooth);
}

.tags span:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(56, 189, 248, 0.12);
  transform: translateY(-2px);
}

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

.project-card {
  grid-column: span 2;
  padding: 30px;
  background: var(--gradient-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.project-card.featured {
  grid-column: span 3;
}

.project-number {
  position: absolute;
  right: 24px;
  top: 24px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--card-border-hover);
}

.project-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--primary);
  font-size: 20px;
  margin-bottom: 20px;
  transition: var(--transition-smooth);
}

.project-card:hover .project-icon {
  transform: scale(1.15) rotate(8deg);
}

.project-date {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
}

.project-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin: 8px 0 12px;
}

.project-card p {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.65;
  margin-bottom: 20px;
  min-height: 72px;
}

/* Services Section */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.service-card {
  padding: 28px;
  background: var(--gradient-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  position: relative;
}

.service-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.service-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--primary);
  font-size: 22px;
  transition: var(--transition-smooth);
}

.service-card:hover .service-icon {
  transform: rotate(-10deg) scale(1.12);
}

.service-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-muted);
  opacity: 0.5;
}

.service-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 12px;
}

.service-card p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.learn-more {
  background: none;
  border: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  margin-top: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.learn-more i {
  transition: transform 0.3s ease;
}

.service-extra {
  display: none;
  border-top: 1px solid var(--card-border);
  margin-top: 16px;
  padding-top: 14px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.65;
}

.service-card.open .service-extra {
  display: block;
  animation: fadeInDown 0.35s ease forwards;
}

.service-card.open .learn-more i {
  transform: rotate(180deg);
}

/* -------------------------------------------------------------
   TESTIMONIALS (Autoplay Track Slider)
------------------------------------------------------------- */
.text-center {
  text-align: center;
}

.carousel-wrapper {
  max-width: 860px;
  margin: 0 auto;
  position: relative;
}

.carousel-viewport {
  overflow: hidden;
  border-radius: var(--radius-lg);
  position: relative;
  width: 100%;
}

.carousel-track {
  display: flex;
  transition: transform 0.65s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
  width: 100%;
}

.testimonial-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  padding: 10px;
  box-sizing: border-box;
}

.testimonial-card {
  padding: 42px;
  background: var(--gradient-card);
  border: 1px solid var(--card-border-hover);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  position: relative;
  transition: var(--transition-smooth);
}

.testimonial-card:hover {
  border-color: var(--primary);
}

.quote-symbol {
  color: var(--primary);
  font-size: 32px;
  margin-bottom: 18px;
  opacity: 0.8;
}

.quote-body {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(16px, 1.8vw, 19px);
  font-style: italic;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 26px;
}

.person-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar-ring {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gradient-main);
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.35);
}

.person-details strong {
  display: block;
  font-size: 15px;
  color: var(--text);
}

.person-details small {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.carousel-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 35px;
}

.nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition-smooth);
}

.nav-btn:hover {
  background: var(--gradient-main);
  color: #ffffff;
  border-color: transparent;
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.carousel-bullets {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bullet-dot {
  width: 10px;
  height: 10px;
  border-radius: 20px;
  background: var(--card-border);
  border: 0;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bullet-dot.active {
  width: 28px;
  background: var(--gradient-main);
  box-shadow: 0 0 12px var(--primary);
}

/* -------------------------------------------------------------
   CONTACT SECTION (Fixed overlap & Side-by-side cards)
------------------------------------------------------------- */
.contact-container {
  max-width: 1140px;
}

/* FIXED: Proper margin and clear line-height so text doesn't overlap title */
.contact-subtitle {
  color: var(--text-muted);
  font-size: 15.5px;
  line-height: 1.7;
  margin-top: 14px;
  margin-bottom: 45px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* 3 Quick Cards Side by Side */
.contact-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 50px;
}

.contact-quick-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  background: var(--gradient-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.contact-quick-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-main);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.contact-quick-card:hover {
  transform: translateY(-6px);
  border-color: var(--card-border-hover);
  box-shadow: var(--shadow-lg);
}

.contact-quick-card:hover::before {
  opacity: 1;
}

.quick-card-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--primary);
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.contact-quick-card:hover .quick-card-icon {
  transform: scale(1.1) rotate(6deg);
  background: var(--gradient-main);
  color: #fff;
}

.quick-card-info {
  flex-grow: 1;
  overflow: hidden;
}

.quick-card-info small {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.quick-card-info strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-card-arrow {
  color: var(--text-muted);
  font-size: 14px;
  transition: var(--transition-smooth);
}

.contact-quick-card:hover .quick-card-arrow {
  color: var(--primary);
  transform: translate(3px, -3px);
}

.contact-bottom-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 50px;
  align-items: start;
}

.contact-extra-info h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  margin-bottom: 12px;
}

.contact-extra-info p {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.7;
  margin-bottom: 25px;
}

.extra-items {
  display: grid;
  gap: 16px;
}

.extra-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
}

.extra-item i {
  font-size: 18px;
  color: var(--primary);
  width: 30px;
}

.extra-item small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.extra-item span {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.contact-form {
  padding: 34px;
  background: var(--gradient-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

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

.contact-form label {
  display: block;
  margin-bottom: 16px;
}

.contact-form label span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: var(--transition-smooth);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

.btn-submit {
  width: 100%;
  margin-top: 10px;
}

.form-status {
  font-size: 12.5px;
  margin-top: 16px;
  font-weight: 600;
}

/* Footer */
.footer {
  border-top: 1px solid var(--card-border);
  padding: 35px 0;
  background: var(--bg);
}

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

.footer p {
  color: var(--text-muted);
  font-size: 12.5px;
}

.footer-links {
  display: flex;
  gap: 14px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 17px;
  transition: var(--transition-smooth);
}

.footer-links a:hover {
  color: var(--primary);
  transform: translateY(-2px);
}

/* Back to Top */
.back-to-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 999;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px) scale(0.8);
  transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.back-to-top-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--gradient-main);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 18px;
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.back-to-top:hover .back-to-top-circle {
  transform: translateY(-6px) scale(1.08);
  box-shadow: 0 15px 35px rgba(56, 189, 248, 0.6);
}

/* Reveal On Scroll */
.reveal {
  opacity: 1;
  transform: none;
}

html.js-ready .reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

html.js-ready .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Keyframe animations */
@keyframes modernPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(52, 211, 153, 0);
  }
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

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

@keyframes ambientFloat {
  0% {
    transform: scale(0.9) translate(0, 0);
  }
  100% {
    transform: scale(1.1) translate(20px, -20px);
  }
}

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

@keyframes badgeFloat2 {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(8px);
  }
}

@keyframes rotateClockwise {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes rotateCounterClockwise {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

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

/* Responsive Media Queries */
@media (max-width: 1080px) {
  .hero-grid {
    gap: 40px;
  }
  .skills-grid,
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .about-grid {
    gap: 50px;
  }
  .contact-cards-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 960px) {
  .navbar {
    height: 72px;
  }
  .menu-toggle {
    display: block;
    order: 4;
  }
  .nav-actions {
    margin-left: auto;
  }
  .nav-cta {
    display: none;
  }
  .nav-links {
    position: absolute;
    top: 76px;
    left: 20px;
    right: 20px;
    display: none;
    flex-direction: column;
    padding: 16px;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border-hover);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  }
  .nav-links.open {
    display: flex;
    animation: fadeInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  .nav-link {
    width: 100%;
    padding: 12px 18px;
    border-radius: 10px;
  }
  .hero {
    padding-top: 130px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-content {
    max-width: 100%;
    padding-right: 0;
  }
  .role-wrapper,
  .hero-actions,
  .social-row {
    justify-content: center;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .projects-grid {
    grid-template-columns: 1fr 1fr;
  }
  .project-card,
  .project-card.featured {
    grid-column: span 1;
  }
  .stats-card {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .stat-item:nth-child(2)::after {
    display: none;
  }
  .contact-cards-row {
    grid-template-columns: 1fr;
  }
  .contact-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 38px;
  }
  .role-text {
    font-size: 17px;
  }
  
  .hero-image {
  width: min(390px, 85vw);
  height: min(390px, 85vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  animation: modernFloat 6s ease-in-out infinite;
}
  .orbit-outer,
  .orbit-inner {
    display: none;
  }
  .skills-grid,
  .services-grid,
  .projects-grid,
  .stats-card,
  .form-row {
    grid-template-columns: 1fr;
  }
  .stat-item::after {
    display: none;
  }
  .education-card {
    flex-direction: column;
    padding: 24px;
  }
  .timeline::before {
    left: 20px;
  }
  .timeline-item {
    padding-left: 60px;
  }
  .timeline-marker {
    width: 42px;
    height: 42px;
    font-size: 14px;
  }
  .timeline-top {
    flex-direction: column;
    gap: 6px;
  }
  .testimonial-card {
    padding: 26px 20px;
  }
  .quote-body {
    font-size: 15px;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}


/* =============================================================
   LANGUAGE TOGGLE
============================================================= */
.lang-toggle {
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text);
  font-family: 'Cairo', 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.lang-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

/* =============================================================
   ARABIC (RTL) SUPPORT
   Everything below only applies when the page is in Arabic.
============================================================= */

/* Arabic font (icons keep Font Awesome) */
html[lang="ar"] body,
html[lang="ar"] body *:not(i):not(.fa-solid):not(.fa-regular):not(.fa-brands) {
  font-family: 'Cairo', 'Plus Jakarta Sans', sans-serif;
  letter-spacing: 0;
}
html[lang="ar"] .hero-title,
html[lang="ar"] .section-title {
  line-height: 1.35;
}
html[lang="ar"] .logo-box,
html[lang="ar"] .avatar-ring {
  font-family: 'Space Grotesk', sans-serif;
}

/* Navbar: keep every label on one line */
html[lang="ar"] .nav-link,
html[lang="ar"] .cv-button,
html[lang="ar"] .nav-cta {
  white-space: nowrap;
}
html[lang="ar"] .nav-link { padding-left: 11px; padding-right: 11px; }

/* Hero */
html[dir="rtl"] .hero-content { padding-right: 0; padding-left: 15px; }
html[dir="rtl"] .type-cursor { margin-left: 0; margin-right: 5px; }
html[dir="rtl"] .sparkle-1 { right: auto; left: 10%; }
html[dir="rtl"] .sparkle-2 { left: auto; right: 8%; }
html[dir="rtl"] .badge-top { right: auto; left: -10px; }
html[dir="rtl"] .badge-bottom { left: auto; right: -15px; }

/* Stats */
html[dir="rtl"] .stat-item:not(:last-child)::after { right: auto; left: 0; }
html[dir="rtl"] .stat-value { direction: ltr; }

/* Keep numbers / dates / handles reading left-to-right inside Arabic text */
html[dir="rtl"] .date-pill,
html[dir="rtl"] .project-date,
html[dir="rtl"] .exp-number,
html[dir="rtl"] .project-number,
html[dir="rtl"] .service-num,
html[dir="rtl"] .badge-text strong {
  direction: ltr;
  unicode-bidi: isolate;
}
html[dir="rtl"] .quick-card-info strong,
html[dir="rtl"] .extra-item span:not([data-i18n]) {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: right;
}
html[dir="rtl"] .tags { direction: ltr; }
html[dir="rtl"] .tags span { unicode-bidi: isolate; }

/* About / highlights */
html[dir="rtl"] .highlight-item:hover { transform: translateX(-6px); }

/* Timeline */
html[dir="rtl"] .timeline::before { left: auto; right: 28px; }
html[dir="rtl"] .timeline-item { padding-left: 0; padding-right: 85px; }
html[dir="rtl"] .timeline-marker { left: auto; right: 0; }
html[dir="rtl"] .timeline-card:hover { transform: translateX(-8px); }
html[dir="rtl"] .timeline-card ul { padding-left: 0; padding-right: 18px; }

/* Projects & misc */
html[dir="rtl"] .project-number { right: auto; left: 24px; }
html[dir="rtl"] .back-to-top { right: auto; left: 28px; }

/* Carousel: the sliding track stays LTR (so translateX works), cards read RTL */
html[dir="rtl"] .carousel-viewport { direction: ltr; }
html[dir="rtl"] .testimonial-card { direction: rtl; }

/* Mirror directional icons */
html[dir="rtl"] .fa-arrow-right,
html[dir="rtl"] .fa-arrow-left-long,
html[dir="rtl"] .fa-arrow-right-long,
html[dir="rtl"] .fa-paper-plane,
html[dir="rtl"] .fa-quote-left {
  transform: scaleX(-1);
}

@media (max-width: 960px) {
  html[dir="rtl"] .nav-actions { margin-left: 0; margin-right: auto; }
  html[dir="rtl"] .hero-content { padding-left: 0; }
}

@media (max-width: 600px) {
  html[dir="rtl"] .timeline::before { left: auto; right: 20px; }
  html[dir="rtl"] .timeline-item { padding-left: 0; padding-right: 60px; }
}

/* Arabic quotes: no fake italic (it blurs Arabic letters), a little more breathing room */
html[lang="ar"] .quote-body {
  font-style: normal;
  font-weight: 500;
  line-height: 2;
  font-size: clamp(16px, 1.7vw, 18px);
}


/* =============================================================
   FRONTEND SKILL + PENTA SERVE PROJECT CARD
============================================================= */
.skill-card.wide { grid-column: 1 / -1; }

/* 4 + 2 columns so the first project row is full (no empty gap) */
.project-card.featured { grid-column: span 4; }
.project-card.wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.project-card.wide .project-main { position: relative; }
.project-card.wide .project-main p { min-height: 0; }
.project-card.wide .project-number { top: 0; right: 0; }
html[dir="rtl"] .project-card.wide .project-number { right: auto; left: 0; }

.project-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.project-meta i { color: var(--primary); }

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: 12px;
  border: 1px solid var(--card-border-hover);
  background: var(--card-bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition-smooth);
}
.project-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}
.project-link.primary {
  background: var(--gradient-main);
  border-color: transparent;
  color: #fff;
}
.project-link.primary:hover {
  color: #fff;
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.35);
}

.project-details {
  padding: 24px 26px;
  border-radius: var(--radius-lg);
  background: rgba(56, 189, 248, 0.04);
  border: 1px solid var(--card-border);
}
.project-details h4 {
  margin-bottom: 14px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  color: var(--primary);
}
.project-details ul {
  list-style: none;
  display: grid;
  gap: 14px;
  padding: 0;
}
.project-details li {
  position: relative;
  padding-inline-start: 18px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-muted);
}
.project-details li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}
.project-details li strong { color: var(--text); }

html[dir="rtl"] .project-category { direction: rtl; }

@media (max-width: 960px) {
  .project-card.featured,
  .project-card.wide { grid-column: 1 / -1; }
  .project-card.wide { grid-template-columns: 1fr; gap: 28px; }
}

/* Links on project cards */
.project-links.compact { margin-top: 18px; gap: 10px; }
.project-links.compact .project-link { padding: 8px 14px; font-size: 12px; border-radius: 10px; gap: 7px; }

/* category line under the date on the WordPress card */
.project-category {
  display: block;
  margin: 2px 0 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary);
}
