/* ============================================================
   ABDULLAH ALRASHEDI — PREMIUM PORTFOLIO
   ============================================================ */

/* ==================== CUSTOM PROPERTIES ==================== */
:root {
  --bg-primary: #06080f;
  --bg-secondary: #0c0f18;
  --bg-card: #111525;
  --bg-card-hover: #161b30;
  --surface-glass: rgba(255, 255, 255, 0.025);
  --surface-glass-hover: rgba(255, 255, 255, 0.05);

  --accent-1: #7c3aed;
  --accent-2: #3b82f6;
  --accent-3: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #3b82f6 50%, #06b6d4 100%);
  --accent-gradient-text: linear-gradient(135deg, #a78bfa, #60a5fa, #22d3ee);
  --accent-glow: rgba(124, 58, 237, 0.15);
  --accent-glow-strong: rgba(124, 58, 237, 0.3);

  --text-primary: #eef2ff;
  --text-secondary: #8892b0;
  --text-muted: #5a6484;

  --border: rgba(139, 92, 246, 0.08);
  --border-hover: rgba(139, 92, 246, 0.2);
  --border-card: rgba(255, 255, 255, 0.05);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-card: 0 4px 30px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.08);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-arabic: 'Tajawal', 'Inter', sans-serif;

  --nav-height: 72px;
  --container-max: 1200px;
  --section-padding: 120px;
}

/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.no-scroll {
  overflow: hidden;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s;
}

ul { list-style: none; }

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

::selection {
  background: rgba(124, 58, 237, 0.3);
  color: var(--text-primary);
}

/* ==================== UTILITIES ==================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: var(--section-padding) 0;
  position: relative;
}

.gradient-text {
  background: var(--accent-gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  padding-bottom: 0.15em;
  margin-bottom: -0.15em;
}

/* ==================== SCROLL PROGRESS ==================== */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent-gradient);
  z-index: 10001;
  transition: width 0.1s linear;
}

/* ==================== NAVIGATION ==================== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  transition: background 0.4s, box-shadow 0.4s, backdrop-filter 0.4s;
}

#navbar.scrolled {
  background: rgba(6, 8, 15, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 var(--border), 0 4px 30px rgba(0,0,0,0.2);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.logo-dot {
  color: var(--accent-1);
  font-size: 1.8rem;
  line-height: 1;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  transition: color 0.3s, background 0.3s;
  position: relative;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
  color: var(--text-primary);
  background: rgba(124, 58, 237, 0.1);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-1);
}

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

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: transform 0.3s, box-shadow 0.3s;
  white-space: nowrap;
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

.hamburger-line {
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(6, 8, 15, 0.97);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s;
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mobile-link {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 12px 32px;
  border-radius: var(--radius-md);
  transition: color 0.3s, transform 0.3s, background 0.3s;
  transform: translateY(20px);
  opacity: 0;
}

.mobile-menu.open .mobile-link {
  transform: translateY(0);
  opacity: 1;
}

.mobile-menu.open .mobile-link:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.1s; }
.mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.15s; }
.mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.2s; }
.mobile-menu.open .mobile-link:nth-child(5) { transition-delay: 0.25s; }
.mobile-menu.open .mobile-link:nth-child(6) { transition-delay: 0.3s; }
.mobile-menu.open .mobile-link:nth-child(7) { transition-delay: 0.35s; }
.mobile-menu.open .mobile-cta { transition-delay: 0.4s; }

.mobile-link:hover,
.mobile-link.active {
  color: var(--text-primary);
  background: rgba(124, 58, 237, 0.1);
}

.mobile-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.4s, opacity 0.4s;
}

/* ==================== HERO / ABOUT ==================== */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--nav-height) + 40px);
  padding-bottom: 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
}

.orb-1 {
  width: 600px;
  height: 600px;
  top: -200px;
  right: -100px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.25), transparent 70%);
}

.orb-2 {
  width: 500px;
  height: 500px;
  bottom: -100px;
  left: -200px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent 70%);
}

.orb-3 {
  width: 300px;
  height: 300px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(6, 182, 212, 0.08), transparent 70%);
}

.grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 20%, transparent 80%);
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-text {
  max-width: 620px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent-1);
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: var(--radius-full);
  margin-bottom: 28px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--accent-1);
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.hero-summary {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 36px;
}

.hero-summary strong {
  color: var(--text-primary);
  font-weight: 600;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  color: #fff;
  background: var(--accent-gradient);
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.35);
}

.btn-primary i {
  transition: transform 0.3s;
}

.btn-primary:hover i {
  transform: translateX(4px);
}

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

.btn-outline:hover {
  background: rgba(124, 58, 237, 0.08);
  border-color: var(--accent-1);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.85rem;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* Hero Image */
.hero-image {
  position: relative;
  flex-shrink: 0;
}

.image-wrapper {
  position: relative;
  width: 340px;
  height: 340px;
  border-radius: 50%;
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: relative;
  z-index: 2;
}

.image-border {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--accent-gradient);
  z-index: 1;
  animation: rotate-border 8s linear infinite;
}

@keyframes rotate-border {
  to { transform: rotate(360deg); }
}

.image-glow {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.15), transparent 70%);
  z-index: 0;
  animation: glow-pulse 4s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.float-element {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--accent-1);
  z-index: 3;
  box-shadow: var(--shadow-card);
  animation: float 6s ease-in-out infinite;
}

.float-1 {
  top: 20px;
  right: -10px;
  animation-delay: 0s;
}

.float-2 {
  bottom: 30px;
  left: -20px;
  animation-delay: 2s;
  color: var(--accent-2);
}

.float-3 {
  top: 50%;
  left: -30px;
  animation-delay: 4s;
  color: var(--accent-3);
}

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

/* Hero Stats */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 80px;
  position: relative;
  z-index: 1;
}

.stat-card {
  text-align: center;
  padding: 28px 16px;
  background: var(--surface-glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  transition: transform 0.3s, border-color 0.3s, background 0.3s;
  flex: 0 1 220px;
  min-width: 160px;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  background: var(--surface-glass-hover);
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.stat-suffix {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent-1);
}

.stat-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ==================== SECTION HEADERS ==================== */
.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-tag {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-1);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.4;
  overflow: visible;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
}

/* ==================== EXPERIENCE ==================== */
#experience {
  background: var(--bg-secondary);
}

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

.timeline-item {
  display: flex;
  gap: 32px;
  margin-bottom: 40px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  padding-top: 4px;
}

.marker-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-gradient);
  box-shadow: 0 0 0 4px var(--bg-secondary), 0 0 0 5px var(--border-hover);
  flex-shrink: 0;
}

.marker-line {
  width: 2px;
  flex: 1;
  background: linear-gradient(to bottom, var(--border-hover), transparent);
  margin-top: 8px;
}

.timeline-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.timeline-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

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

.timeline-role {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.timeline-company {
  font-size: 0.92rem;
  color: var(--accent-1);
  display: flex;
  align-items: center;
  gap: 6px;
}

.timeline-company i {
  font-size: 0.8rem;
}

.timeline-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.timeline-date,
.timeline-location {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.timeline-list {
  margin-bottom: 20px;
}

.timeline-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.timeline-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-1);
  opacity: 0.5;
}

.timeline-list li:last-child {
  margin-bottom: 0;
}

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

.tag {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(124, 58, 237, 0.08);
  color: var(--accent-1);
  border: 1px solid rgba(124, 58, 237, 0.12);
  transition: background 0.3s, border-color 0.3s;
}

.tag:hover {
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.25);
}

/* ==================== EDUCATION ==================== */
.education-showcase {
  max-width: 800px;
  margin: 0 auto;
}

.edu-card-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 44px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.edu-card-main:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.edu-card-main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

.edu-icon-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.edu-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--accent-1);
}

.edu-decoration {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.edu-decoration span {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border-hover);
}

.edu-badge {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-1);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.12);
  margin-bottom: 16px;
}

.edu-degree {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.edu-institution {
  font-size: 1rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.edu-institution i {
  color: var(--accent-1);
  font-size: 0.85rem;
}

.edu-location {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.edu-location i {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.edu-highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.edu-highlight-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
}

.edu-highlight-item i {
  color: var(--accent-1);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.edu-project {
  background: rgba(124, 58, 237, 0.04);
  border: 1px solid rgba(124, 58, 237, 0.08);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}

.edu-project h4 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.edu-project h4 i {
  color: var(--accent-1);
}

.edu-project p {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* Languages */
.edu-languages {
  margin-top: 32px;
}

.edu-lang-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

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

.lang-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.3s;
}

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

.lang-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.lang-level {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.lang-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.lang-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 2px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0% !important;
}

.lang-fill.animated {
  width: var(--target-width) !important;
}

/* ==================== SKILLS ==================== */
#skills {
  background: var(--bg-secondary);
}

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

.skill-category {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.skill-category:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.skill-cat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.skill-cat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(124, 58, 237, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--accent-1);
  flex-shrink: 0;
}

.skill-cat-header h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

.skill-tag {
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  border: 1px solid var(--border-card);
  transition: all 0.3s;
}

.skill-tag:hover {
  background: rgba(124, 58, 237, 0.1);
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* ==================== PROJECTS ==================== */
.project-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: stretch;
  margin-bottom: 64px;
  padding: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.project-showcase:last-child {
  margin-bottom: 0;
}

.project-showcase:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.project-showcase.reverse {
  direction: rtl;
}

.project-showcase.reverse > * {
  direction: ltr;
}

/* Full-width project cards (no gallery) */
.project-showcase:has(.project-info-full) {
  grid-template-columns: 1fr;
}

.project-info-full {
  text-align: left;
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 24px;
}

.project-info-full .project-icon-wrap {
  grid-row: 1 / 4;
  align-self: start;
  margin-top: 4px;
}

.project-info-full .project-label {
  grid-column: 2;
}

.project-info-full .project-name {
  grid-column: 2;
}

.project-info-full .project-subtitle {
  grid-column: 2;
}

.project-info-full .project-description {
  grid-column: 1 / -1;
  margin-top: 16px;
}

.project-info-full .project-features {
  grid-column: 1 / -1;
  columns: 2;
  column-gap: 40px;
}

.project-info-full .project-features li {
  break-inside: avoid;
}

.project-info-full .project-tech {
  grid-column: 1 / -1;
}

html[dir="rtl"] .project-info-full {
  text-align: right;
}

.project-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--accent-1);
  margin: 0 auto 20px;
}

/* Project Gallery */
.project-gallery {
  position: relative;
}

.gallery-viewport {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-secondary);
  max-height: 550px;
  margin: 0 auto;
}

.gallery-track {
  width: 100%;
  height: 100%;
  position: relative;
}

.gallery-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.gallery-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}

.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.gallery-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-glass);
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  transition: all 0.3s;
}

.gallery-btn:hover {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--accent-1);
  color: var(--text-primary);
}

.gallery-dots {
  display: flex;
  gap: 6px;
}

.gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: all 0.3s;
  cursor: pointer;
}

.gallery-dot.active {
  background: var(--accent-1);
  width: 24px;
  border-radius: 4px;
}

/* Project Info */
.project-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.project-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.project-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.project-description {
  margin-bottom: 16px;
}

.project-description p {
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.project-description strong {
  color: var(--text-primary);
  font-weight: 600;
}

.project-description ul {
  padding-left: 0;
}

.project-description li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.project-description li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-1);
  opacity: 0.5;
}

.project-features {
  list-style: none;
  padding-left: 0;
  margin: 0 0 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-card);
}

.project-features li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.project-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-1);
  opacity: 0.5;
}

.project-note {
  font-style: italic;
  opacity: 0.8;
  font-size: 0.85rem !important;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-card);
  margin-top: auto;
}

.project-features + .project-tech {
  border-top: none;
  padding-top: 0;
}

.tech-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.08);
  color: var(--accent-2);
  border: 1px solid rgba(59, 130, 246, 0.12);
  transition: all 0.3s;
}

.tech-badge:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}

/* ==================== CERTIFICATIONS ==================== */
#certifications {
  background: var(--bg-secondary);
}

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

.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

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

.cert-card-inner {
  padding: 32px;
}

.cert-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--accent-1);
  margin-bottom: 20px;
}

.cert-provider {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.cert-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.4;
}

.cert-desc {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.cert-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-1);
  transition: gap 0.3s, color 0.3s;
}

.cert-link:hover {
  gap: 10px;
  color: var(--accent-2);
}

/* ==================== CONTACT ==================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.contact-heading {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.3;
}

.contact-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface-glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  transition: all 0.3s;
}

.contact-item:hover {
  border-color: var(--border-hover);
  background: var(--surface-glass-hover);
  transform: translateX(4px);
}

.contact-item-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(124, 58, 237, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-1);
  font-size: 1rem;
  flex-shrink: 0;
}

.contact-item-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.contact-item-value {
  display: block;
  font-size: 0.92rem;
  color: var(--text-primary);
  font-weight: 500;
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--surface-glass);
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--text-secondary);
  transition: all 0.3s;
}

.social-btn:hover {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--accent-1);
  color: var(--text-primary);
  transform: translateY(-3px);
}

/* Contact Form */
.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 40px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  font-size: 0.92rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08);
}

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

/* ==================== FOOTER ==================== */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border-card);
}

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

.footer-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

.footer-links a {
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: color 0.3s, transform 0.3s;
}

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

/* ==================== BACK TO TOP ==================== */
#back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
}

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

#back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.4);
}

/* ==================== LIGHTBOX ==================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  cursor: pointer;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: background 0.2s;
  z-index: 2;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-prev {
  left: 24px;
}

.lightbox-next {
  right: 24px;
}

.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ==================== SCROLL REVEAL ANIMATIONS ==================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for hero elements */
.hero-section .reveal[data-delay="0"] { transition-delay: 0.1s; }
.hero-section .reveal[data-delay="1"] { transition-delay: 0.2s; }
.hero-section .reveal[data-delay="2"] { transition-delay: 0.35s; }
.hero-section .reveal[data-delay="3"] { transition-delay: 0.5s; }
.hero-section .reveal[data-delay="4"] { transition-delay: 0.65s; }
.hero-section .reveal[data-delay="5"] { transition-delay: 0.8s; }

/* ==================== RESPONSIVE ==================== */

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --section-padding: 80px;
  }

  .nav-menu { display: none; }
  .nav-cta { display: none; }
  .nav-toggle { display: flex; }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero-text {
    max-width: 100%;
    order: 2;
  }

  .hero-image {
    order: 1;
    display: flex;
    justify-content: center;
  }

  .image-wrapper {
    width: 260px;
    height: 260px;
  }

  .hero-ctas {
    justify-content: center;
  }

  .hero-badge {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 48px;
  }

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

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

  .project-showcase {
    grid-template-columns: 1fr;
    padding: 28px;
    gap: 32px;
  }

  .project-showcase.reverse {
    direction: ltr;
  }

  .project-info-full {
    grid-template-columns: 1fr;
  }

  .project-info-full .project-icon-wrap {
    grid-row: auto;
    grid-column: 1;
    margin-bottom: 12px;
  }

  .project-info-full .project-label,
  .project-info-full .project-name,
  .project-info-full .project-subtitle {
    grid-column: 1;
  }

  .project-info-full .project-features {
    columns: 1;
  }

  .gallery-viewport {
    max-height: 400px;
    margin: 0 auto;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .edu-card-main {
    grid-template-columns: 1fr;
    padding: 32px;
  }

  .edu-icon-area {
    flex-direction: row;
    gap: 12px;
  }

  .edu-decoration { display: none; }
}

/* Mobile */
@media (max-width: 640px) {
  :root {
    --section-padding: 60px;
    --nav-height: 64px;
  }

  .container {
    padding: 0 16px;
  }

  .hero-name {
    font-size: 2.2rem;
  }

  .hero-summary {
    font-size: 0.95rem;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 20px 12px;
  }

  .stat-number,
  .stat-suffix {
    font-size: 1.6rem;
  }

  .image-wrapper {
    width: 200px;
    height: 200px;
  }

  .float-element {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .timeline-item {
    gap: 16px;
  }

  .timeline-card {
    padding: 22px;
  }

  .timeline-role {
    font-size: 1.1rem;
  }

  .timeline-header {
    flex-direction: column;
    gap: 8px;
  }

  .timeline-meta {
    align-items: flex-start;
    flex-direction: row;
    gap: 12px;
  }

  .edu-highlights {
    grid-template-columns: 1fr;
  }

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

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

  .cert-card-inner {
    padding: 24px;
  }

  .project-showcase {
    padding: 20px;
  }

  .project-name {
    font-size: 1.3rem;
  }

  .contact-form {
    padding: 24px;
  }

  .contact-heading {
    font-size: 1.3rem;
  }

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

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

  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .mobile-link {
    font-size: 1.3rem;
  }
}

/* Extra small */
@media (max-width: 380px) {
  .hero-name {
    font-size: 1.9rem;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
  }

  .stat-number,
  .stat-suffix {
    font-size: 1.4rem;
  }
}

/* ==================== LANGUAGE TOGGLE ==================== */
.lang-toggle {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
  padding: 3px;
  position: relative;
  gap: 0;
}

.lang-btn {
  position: relative;
  z-index: 2;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  transition: color 0.3s;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.lang-btn.active {
  color: #fff;
}

.lang-slider {
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.lang-toggle.ar-active .lang-slider {
  transform: translateX(100%);
}

html[dir="rtl"] .lang-toggle.ar-active .lang-slider {
  transform: translateX(-100%);
}

/* ==================== RTL / ARABIC SUPPORT ==================== */
html[dir="rtl"] {
  font-family: var(--font-arabic);
}

html[dir="rtl"] body {
  font-family: var(--font-arabic);
}

html[dir="rtl"] .nav-logo,
html[dir="rtl"] .hero-name,
html[dir="rtl"] .section-title,
html[dir="rtl"] .timeline-role,
html[dir="rtl"] .edu-degree,
html[dir="rtl"] .project-name,
html[dir="rtl"] .cert-name,
html[dir="rtl"] .contact-heading,
html[dir="rtl"] .stat-label,
html[dir="rtl"] .loader-name,
html[dir="rtl"] .footer-brand {
  font-family: var(--font-arabic);
  letter-spacing: 0;
  line-height: 1.5;
}

html[dir="rtl"] .hero-title,
html[dir="rtl"] .section-tag,
html[dir="rtl"] .project-label,
html[dir="rtl"] .cert-provider,
html[dir="rtl"] .edu-badge,
html[dir="rtl"] .nav-link,
html[dir="rtl"] .mobile-link,
html[dir="rtl"] .btn,
html[dir="rtl"] .tag,
html[dir="rtl"] .tech-badge,
html[dir="rtl"] .skill-tag,
html[dir="rtl"] .skill-cat-header h3 {
  font-family: var(--font-arabic);
  letter-spacing: 0;
}

/* Flip directional elements */
html[dir="rtl"] .hero-content {
  direction: rtl;
}

html[dir="rtl"] .timeline-item {
  direction: rtl;
}

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

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

html[dir="rtl"] .timeline-meta {
  align-items: flex-start;
}

html[dir="rtl"] .nav-cta i,
html[dir="rtl"] .btn-primary i {
  transform: scaleX(-1);
}

html[dir="rtl"] .btn-primary:hover i {
  transform: scaleX(-1) translateX(4px);
}

html[dir="rtl"] .contact-item:hover {
  transform: translateX(-4px);
}

html[dir="rtl"] .project-description li {
  padding-left: 0;
  padding-right: 20px;
}

html[dir="rtl"] .project-description li::before {
  left: auto;
  right: 0;
}

html[dir="rtl"] .project-features li {
  padding-left: 0;
  padding-right: 20px;
}

html[dir="rtl"] .project-features li::before {
  left: auto;
  right: 0;
}

html[dir="rtl"] .project-showcase.reverse {
  direction: ltr;
}

html[dir="rtl"] .project-showcase.reverse > * {
  direction: rtl;
}

html[dir="rtl"] .cert-link i {
  transform: scaleX(-1);
}

html[dir="rtl"] .edu-card-main {
  direction: rtl;
}

html[dir="rtl"] .edu-highlight-item {
  direction: rtl;
}

html[dir="rtl"] .float-element.float-1 {
  right: auto;
  left: -10px;
}

html[dir="rtl"] .float-element.float-2 {
  left: auto;
  right: -20px;
}

html[dir="rtl"] .float-element.float-3 {
  left: auto;
  right: -30px;
}

html[dir="rtl"] #scroll-progress {
  left: auto;
  right: 0;
}

html[dir="rtl"] .nav-link.active::after {
  left: auto;
  right: 50%;
  transform: translateX(50%);
}

/* Improved Arabic text rendering */
html[dir="rtl"] .hero-summary,
html[dir="rtl"] .project-description p,
html[dir="rtl"] .cert-desc,
html[dir="rtl"] .contact-text,
html[dir="rtl"] .edu-project p,
html[dir="rtl"] .timeline-list li,
html[dir="rtl"] .section-subtitle {
  line-height: 2;
}

/* Form alignment in RTL */
html[dir="rtl"] .form-group input,
html[dir="rtl"] .form-group textarea {
  text-align: right;
}

html[dir="rtl"] .form-group label {
  text-align: right;
}

/* Gallery controls — keep LTR arrows */
html[dir="rtl"] .gallery-controls {
  direction: ltr;
}

/* Footer RTL */
html[dir="rtl"] .footer-content {
  direction: rtl;
}

/* Responsive RTL adjustments */
@media (max-width: 1024px) {
  html[dir="rtl"] .timeline-meta {
    flex-direction: row;
  }

  .lang-toggle {
    order: -1;
  }
}

@media (max-width: 640px) {
  .lang-btn {
    padding: 5px 10px;
    font-size: 0.72rem;
  }
}

/* ==================== PREFERS REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
