/* ============================================================
   Mohamed Al-Mahlawi · Portfolio
   Creative · Professional · Vanilla CSS
   ============================================================ */

:root {
  /* Refined Emerald — Saudi-resonant, fintech-credible, dev-coded */
  --bg: #0a0f0d;
  --bg-elev: #111714;
  --bg-card: rgba(255, 255, 255, 0.025);
  --bg-card-hover: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text: #e7efeb;
  --text-soft: #a3b3aa;
  --text-mute: #6a7a72;

  --accent: #10b981;          /* emerald primary */
  --accent-2: #34d399;         /* lighter emerald */
  --accent-3: #14b8a6;         /* teal variation */
  --accent-warm: #f59e0b;      /* refined amber for premium accents */
  --accent-glow: rgba(16, 185, 129, 0.4);

  --whatsapp: #25d366;
  --whatsapp-dark: #128c7e;
  --success: #34d399;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 40px var(--accent-glow);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --gradient-primary: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
  --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  --gradient-mesh: radial-gradient(at 20% 20%, rgba(16, 185, 129, 0.18) 0px, transparent 50%),
                   radial-gradient(at 80% 0%, rgba(20, 184, 166, 0.10) 0px, transparent 50%),
                   radial-gradient(at 80% 80%, rgba(245, 158, 11, 0.05) 0px, transparent 50%);
}

[data-theme="light"] {
  --bg: #fbfdfc;
  --bg-elev: #f3f7f4;
  --bg-card: rgba(0, 0, 0, 0.025);
  --bg-card-hover: rgba(0, 0, 0, 0.05);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);
  --text: #0a1410;
  --text-soft: #3d4a44;
  --text-mute: #5e6e66;
  --accent: #047857;
  --accent-2: #059669;
  --accent-warm: #d97706;
  --accent-glow: rgba(4, 120, 87, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.12);
  --gradient-mesh: radial-gradient(at 20% 20%, rgba(4, 120, 87, 0.08) 0px, transparent 50%),
                   radial-gradient(at 80% 0%, rgba(5, 150, 105, 0.05) 0px, transparent 50%),
                   radial-gradient(at 80% 80%, rgba(217, 119, 6, 0.04) 0px, transparent 50%);
}

/* ----------- Reset ----------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { padding: 0; margin: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

::selection { background: var(--accent); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ----------- Layout ----------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 120px 0;
  position: relative;
}

.section-alt { background: var(--bg-elev); }

.section-head { margin-bottom: 64px; }
.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ===========================================================
   Navigation
   =========================================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: all 0.3s ease;
}
.nav.scrolled {
  padding: 10px 0;
  background: rgba(10, 15, 13, 0.7);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .nav.scrolled { background: rgba(255, 255, 255, 0.78); }

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: transform 0.25s ease;
}
.nav-logo:hover { transform: translateY(-1px); }

/* Premium SVG monogram with halo + rotating ring */
.logo-mark {
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-mark::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  background: conic-gradient(
    from 0deg,
    #10b981 0%,
    #34d399 25%,
    #14b8a6 50%,
    #10b981 75%,
    #34d399 100%
  );
  opacity: 0.55;
  filter: blur(1px);
  z-index: -1;
  animation: logoRingRotate 6s linear infinite;
}

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

.logo-halo {
  position: absolute;
  inset: -14px;
  background: radial-gradient(
    circle at center,
    rgba(16, 185, 129, 0.45) 0%,
    rgba(52, 211, 153, 0.2) 35%,
    transparent 70%
  );
  border-radius: 50%;
  z-index: -2;
  animation: logoHaloPulse 3.5s ease-in-out infinite;
  pointer-events: none;
}

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

.logo-svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 12px;
  position: relative;
  z-index: 1;
  box-shadow:
    0 10px 28px rgba(16, 185, 129, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.logo-stroke {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
  animation: logoDrawIn 1.4s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

@keyframes logoDrawIn {
  to { stroke-dashoffset: 0; }
}

.logo-detail {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: logoDrawIn 0.8s ease 1.4s forwards;
}

.logo-dot-anim {
  filter: drop-shadow(0 0 5px rgba(52, 211, 153, 0.9));
  transform-origin: 38px 38px;
  opacity: 0;
  animation: logoDotAppear 0.4s ease 1.8s forwards, logoDotPulse 2s ease-in-out 2.2s infinite;
}

@keyframes logoDotAppear {
  to { opacity: 1; }
}

@keyframes logoDotPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.6); }
}

.nav-logo:hover .logo-mark {
  transform: rotate(-6deg) scale(1.08);
}
.nav-logo:hover .logo-mark::before {
  opacity: 0.85;
  animation-duration: 2.5s;
}
.nav-logo:hover .logo-svg {
  box-shadow:
    0 16px 40px rgba(16, 185, 129, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.nav-logo:hover .logo-stroke {
  animation: logoDrawIn 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.logo-tld {
  color: var(--accent-2);
  font-weight: 600;
}
.logo-mark::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, transparent 45%);
  pointer-events: none;
}
.logo-mark::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -100%;
  width: 60%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.7s ease;
  pointer-events: none;
}
.nav-logo:hover .logo-mark { box-shadow: 0 12px 32px rgba(16, 185, 129, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.nav-logo:hover .logo-mark::after { left: 130%; }


.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 3px;
}
.logo-first {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--text-mute);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.logo-last {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 4px;
}
.nav-links a {
  display: block;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-soft);
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-card); }

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

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-soft);
  transition: all 0.2s ease;
  cursor: pointer;
}
.lang-toggle:hover {
  background: var(--bg-card);
  color: var(--accent);
  border-color: var(--accent);
}
.lang-flag {
  font-size: 0.95rem;
  line-height: 1;
}
.lang-label {
  white-space: nowrap;
}
[dir="rtl"] .lang-label {
  font-family: 'Tajawal', var(--font-display);
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  transition: all 0.2s;
  color: var(--text-soft);
}
.theme-toggle:hover {
  background: var(--bg-card);
  color: var(--accent);
  border-color: var(--accent);
}
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.2s;
}
.menu-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ===========================================================
   Hero
   =========================================================== */
.hero {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  animation: float 12s ease-in-out infinite;
}
.glow-1 {
  width: 500px;
  height: 500px;
  background: var(--accent);
  top: -100px;
  left: -100px;
}
.glow-2 {
  width: 600px;
  height: 600px;
  background: var(--accent-2);
  bottom: -200px;
  right: -200px;
  animation-delay: -6s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.05); }
  66% { transform: translate(-30px, 30px) scale(0.95); }
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  opacity: 0.6;
}

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

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 28px;
  backdrop-filter: blur(10px);
}
.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 0 20px;
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--accent);
  margin: 0 0 24px;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-soft);
  max-width: 580px;
  margin: 0 0 36px;
  line-height: 1.7;
}
.hero-description strong { color: var(--text); font-weight: 600; }

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
  transition: all 0.25s ease;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn svg { width: 16px; height: 16px; transition: transform 0.25s; }
.btn:hover svg { transform: translateX(4px); }
.btn-primary:hover svg { transform: translateY(2px); }

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(16, 185, 129, 0.5);
}

.btn-ghost {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.hero-meta {
  display: flex;
  gap: 32px;
  align-items: center;
}
.meta-item { display: flex; flex-direction: column; }
.meta-value {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.025em;
}
.meta-label {
  font-size: 0.78rem;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.meta-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* Hero Card / Code Window */
.hero-card { position: relative; }
.code-window {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: perspective(1200px) rotateY(-6deg) rotateX(4deg);
  transition: transform 0.5s ease;
}
.code-window:hover {
  transform: perspective(1200px) rotateY(-2deg) rotateX(2deg);
}
.code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.code-title {
  margin-left: 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-mute);
}
.code-body {
  margin: 0;
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text);
  overflow-x: auto;
}
.c-key { color: #f472b6; }
.c-var { color: #34d399; }
.c-prop { color: #fbbf24; }
.c-str { color: #6ee7b7; }
.c-bool { color: #f59e0b; }
[data-theme="light"] .c-key { color: #be185d; }
[data-theme="light"] .c-var { color: #047857; }
[data-theme="light"] .c-prop { color: #b45309; }
[data-theme="light"] .c-str { color: #065f46; }
[data-theme="light"] .c-bool { color: #d97706; }

.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 44px;
  border: 2px solid var(--border-strong);
  border-radius: 14px;
  display: grid;
  place-items: center;
  z-index: 1;
}
.scroll-indicator span {
  width: 4px;
  height: 8px;
  background: var(--accent);
  border-radius: 2px;
  animation: scrollHint 2s infinite;
}
@keyframes scrollHint {
  0% { transform: translateY(-8px); opacity: 0; }
  50% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(8px); opacity: 0; }
}

/* ===========================================================
   About
   =========================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 60px;
  align-items: start;
}
.about-text p {
  font-size: 1.08rem;
  color: var(--text-soft);
  margin: 0 0 20px;
  line-height: 1.8;
}
.about-text strong { color: var(--text); font-weight: 600; }

.about-cards { display: grid; gap: 16px; }
.info-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}
.info-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateX(6px);
  box-shadow: var(--shadow-md);
}
.info-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  position: relative;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(52, 211, 153, 0.1));
  color: var(--accent);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
}
.info-icon svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  display: block;
}
.info-card strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}
.info-card span {
  font-size: 0.88rem;
  color: var(--text-soft);
}

/* ===========================================================
   Timeline
   =========================================================== */
.timeline {
  position: relative;
  padding-left: 32px;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 12px;
  width: 2px;
  background: linear-gradient(to bottom,
    transparent 0%,
    var(--accent) 8%,
    var(--accent) 92%,
    transparent 100%);
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
}
.timeline-marker {
  position: absolute;
  left: -28px;
  top: 26px;
  width: 18px;
  height: 18px;
  background: var(--bg);
  border: 3px solid var(--accent);
  border-radius: 50%;
  z-index: 1;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
  transition: all 0.3s;
}
.timeline-item:hover .timeline-marker {
  transform: scale(1.2);
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.25);
}

.timeline-card {
  padding: 28px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}
.timeline-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateX(8px);
  box-shadow: var(--shadow-md);
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.timeline-head h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.company {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
}
.period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-mute);
  white-space: nowrap;
  padding: 4px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.period.current {
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.08);
}
.badge-pt {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 8px;
  margin-left: 8px;
  border-radius: 6px;
  background: rgba(52, 211, 153, 0.1);
  color: var(--accent-2);
  border: 1px solid rgba(52, 211, 153, 0.25);
  vertical-align: middle;
}

.timeline-bullets {
  margin-bottom: 18px;
}
.timeline-bullets li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  color: var(--text-soft);
  font-size: 0.96rem;
  line-height: 1.7;
}
.timeline-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 12px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.timeline-bullets strong { color: var(--text); }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.08);
  color: var(--accent);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 6px;
  letter-spacing: 0.02em;
}

/* ===========================================================
   Projects
   =========================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --lift: 0px;
  --glow-x: 50%;
  --glow-y: 50%;
  position: relative;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  transform: translateY(var(--lift)) perspective(1200px) rotateY(var(--tilt-x)) rotateX(var(--tilt-y));
  transform-style: preserve-3d;
  transition:
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.4s ease,
    box-shadow 0.6s ease,
    background-color 0.4s ease;
  will-change: transform;
  overflow: hidden;
}
.project-card.tilting {
  transition:
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.4s ease,
    box-shadow 0.6s ease;
}
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at var(--glow-x) var(--glow-y),
      rgba(16, 185, 129, 0.18),
      transparent 50%
    ),
    var(--gradient-mesh);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.project-card:hover {
  --lift: -8px;
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent);
}
.project-card:hover::before { opacity: 1; }
.project-card.featured {
  border-color: rgba(16, 185, 129, 0.3);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), transparent);
}
.project-card.featured::after {
  content: 'Featured';
  position: absolute;
  top: 20px;
  right: 20px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 4px 10px;
  background: var(--gradient-primary);
  color: #fff;
  border-radius: 6px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

.project-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(52, 211, 153, 0.1));
  color: var(--accent);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 14px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}
.project-icon svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  display: block;
}
.project-card:hover .project-icon {
  transform: scale(1.08) rotate(-4deg);
}

.project-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: -0.015em;
  position: relative;
  z-index: 1;
}
.project-card p {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin: 0 0 18px;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}
.project-card p strong { color: var(--text); }

/* Project Impact Metrics */
.project-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 16px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(52, 211, 153, 0.04));
  border: 1px solid rgba(16, 185, 129, 0.18);
  border-radius: 10px;
  position: relative;
  z-index: 1;
}
.metric {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-soft);
  white-space: nowrap;
}
.metric strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}
.metric + .metric::before {
  content: '·';
  margin-right: 6px;
  color: var(--text-mute);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  color: var(--accent);
  font-weight: 500;
  position: relative;
  z-index: 1;
  transition: gap 0.25s;
}
.project-link:hover { gap: 10px; }
.project-link.nda {
  cursor: default;
  color: var(--text-mute);
}
.project-link.nda:hover { gap: 6px; }
.project-link.nda svg {
  width: 14px;
  height: 14px;
}

/* ===========================================================
   Skills
   =========================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.skill-group {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.skill-group::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}
.skill-group:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.skill-group:hover::before { transform: scaleX(1); }

.skill-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.skill-title svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  font-size: 0.84rem;
  font-weight: 500;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  transition: all 0.2s;
  cursor: default;
}
.pill-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
  opacity: 0.95;
  transition: filter 0.2s;
}
/* Dark-color brand logos (Express, GitHub, JWT, Bash, etc.) — invisible on dark bg.
   In dark mode → invert to white. In light mode → keep dark. */
.pill-icon-mono {
  filter: invert(1) brightness(1.1);
}
[data-theme="light"] .pill-icon-mono {
  filter: none;
}
/* Favicons (full-color logos from brand sites) — slight contrast boost */
.pill-icon-favicon {
  filter: brightness(1.05) saturate(1.05);
  border-radius: 2px;
}
/* Emoji icons (flags etc.) — render as text, not image */
.pill-icon-emoji {
  width: auto;
  height: auto;
  font-size: 0.95rem;
  line-height: 1;
  display: inline-block;
}
.pill:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}
.pill:hover .pill-icon { filter: brightness(0) invert(1); }
.pill:hover .pill-icon-mono { filter: brightness(0) invert(1); }
.pill:hover .pill-icon-favicon { filter: brightness(1.1) saturate(1.1); }

/* ===========================================================
   Education
   =========================================================== */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.edu-card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.edu-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-primary);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s;
}
.edu-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.edu-card:hover::after { transform: scaleY(1); }

.edu-icon {
  width: 48px;
  height: 48px;
  position: relative;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(52, 211, 153, 0.1));
  color: var(--accent);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  margin-bottom: 18px;
}
.edu-icon svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  display: block;
}

.edu-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
  line-height: 1.4;
}
.edu-meta {
  display: block;
  font-size: 0.88rem;
  color: var(--text-soft);
  margin-bottom: 8px;
  line-height: 1.5;
}
.edu-period {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--accent);
  padding: 3px 10px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 6px;
}

/* ===========================================================
   Contact
   =========================================================== */
.contact-wrap { max-width: 920px; margin: 0 auto; }
.contact-lead {
  text-align: center;
  font-size: 1.15rem;
  color: var(--text-soft);
  margin: 0 0 48px;
  line-height: 1.7;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  cursor: pointer;
}
.contact-card.location-card { cursor: default; }
.contact-card:hover:not(.location-card) {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.15);
}

.contact-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  position: relative;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(52, 211, 153, 0.08));
  color: var(--accent);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  transition: all 0.3s;
}
.contact-icon svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  display: block;
}
.contact-card:hover:not(.location-card) .contact-icon {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  transform: rotate(-6deg) scale(1.05);
}

/* WhatsApp variant */
.contact-card.whatsapp .contact-icon {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.15), rgba(18, 140, 126, 0.1));
  color: var(--whatsapp);
  border-color: rgba(37, 211, 102, 0.3);
}
.contact-card.whatsapp:hover {
  border-color: var(--whatsapp);
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.2);
}
.contact-card.whatsapp:hover .contact-icon {
  background: linear-gradient(135deg, var(--whatsapp), var(--whatsapp-dark));
  color: #fff;
}

.contact-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.contact-card span {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
  word-break: break-word;
}

/* ===========================================================
   Floating WhatsApp Button
   =========================================================== */
.fab-whatsapp {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--whatsapp), var(--whatsapp-dark));
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.45);
  z-index: 90;
  transition: all 0.3s ease;
  animation: fabPop 2.4s ease-in-out infinite;
}
.fab-whatsapp svg {
  width: 28px;
  height: 28px;
  position: relative;
  z-index: 1;
}
.fab-whatsapp::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--whatsapp);
  opacity: 0.4;
  animation: fabPulse 2s ease-out infinite;
  z-index: 0;
}
.fab-whatsapp:hover {
  transform: scale(1.08);
  box-shadow: 0 16px 40px rgba(37, 211, 102, 0.6);
}
.fab-tooltip {
  position: absolute;
  right: 72px;
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 10px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: var(--shadow-md);
}
.fab-whatsapp:hover .fab-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

@keyframes fabPulse {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes fabPop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ===========================================================
   Footer
   =========================================================== */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-mute);
}
.footer-built { font-family: var(--font-mono); }

/* ===========================================================
   Scroll Reveal Animations
   =========================================================== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.6, 0.3, 1);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 960px) {
  .section { padding: 80px 0; }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero-card { order: -1; max-width: 480px; }
  .code-window { transform: none; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .nav-links { display: none; }
  .menu-toggle { display: flex; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    flex-direction: column;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-top: 8px;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open a {
    width: 100%;
    padding: 12px 16px;
  }
}

@media (max-width: 640px) {
  .hero-meta { flex-wrap: wrap; gap: 18px; }
  .meta-divider { display: none; }
  .timeline { padding-left: 24px; }
  .timeline-marker { left: -22px; }
  .section-head { margin-bottom: 40px; }
  .timeline-card { padding: 22px 20px; }
  .project-card, .skill-group, .edu-card, .contact-card { padding: 22px; }
  .hero { padding: 100px 0 60px; }
  .fab-whatsapp { width: 54px; height: 54px; bottom: 20px; right: 20px; }
  .fab-whatsapp svg { width: 24px; height: 24px; }
  .fab-tooltip { display: none; }
}

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

/* ===========================================================
   RTL Support — Arabic Layout
   =========================================================== */
[dir="rtl"] body {
  font-family: 'Tajawal', var(--font-sans);
}
[dir="rtl"] .section-title,
[dir="rtl"] .hero-title,
[dir="rtl"] .timeline-head h3,
[dir="rtl"] .project-card h3,
[dir="rtl"] .skill-title,
[dir="rtl"] .edu-card h3,
[dir="rtl"] .info-card strong,
[dir="rtl"] .nav-logo {
  font-family: 'Tajawal', var(--font-display);
  letter-spacing: 0;
}

/* Numerals, code, monospace — keep LTR even in RTL context */
[dir="rtl"] .meta-value,
[dir="rtl"] .metric strong,
[dir="rtl"] .period,
[dir="rtl"] .tag,
[dir="rtl"] .pill,
[dir="rtl"] .section-tag,
[dir="rtl"] .edu-period,
[dir="rtl"] .code-window,
[dir="rtl"] .hero-subtitle,
[dir="rtl"] .footer-built {
  direction: ltr;
  text-align: start;
  unicode-bidi: isolate;
}

/* Timeline mirrors to right side in RTL */
[dir="rtl"] .timeline {
  padding-left: 0;
  padding-right: 32px;
}
[dir="rtl"] .timeline::before {
  left: auto;
  right: 12px;
}
[dir="rtl"] .timeline-marker {
  left: auto;
  right: -28px;
}
[dir="rtl"] .timeline-card:hover {
  transform: translateX(-8px);
}
[dir="rtl"] .timeline-bullets li {
  padding-left: 0;
  padding-right: 22px;
}
[dir="rtl"] .timeline-bullets li::before {
  left: auto;
  right: 0;
}

/* About card hover translates the other way */
[dir="rtl"] .info-card:hover {
  transform: translateX(-6px);
}

/* Hero meta — divider and stats stay LTR for stat readability */
[dir="rtl"] .hero-meta {
  direction: ltr;
  justify-content: flex-end;
}

/* Buttons — icon order */
[dir="rtl"] .btn svg {
  transform: scaleX(-1);
}
[dir="rtl"] .btn:hover svg {
  transform: translateX(-4px) scaleX(-1);
}
[dir="rtl"] .btn-primary:hover svg {
  transform: translateY(2px) scaleX(-1);
}

/* Project link arrow flips */
[dir="rtl"] .project-link {
  direction: rtl;
}

/* Scroll indicator stays centered, no change needed */

/* WhatsApp floating button — switches sides */
[dir="rtl"] .fab-whatsapp {
  right: auto;
  left: 28px;
}
[dir="rtl"] .fab-tooltip {
  right: auto;
  left: 72px;
  transform: translateY(-50%) translateX(-8px);
}
[dir="rtl"] .fab-whatsapp:hover .fab-tooltip {
  transform: translateY(-50%) translateX(0);
}

/* Mobile menu slides in from the other side */
@media (max-width: 960px) {
  [dir="rtl"] .nav-links.open {
    left: 16px;
    right: 16px;
  }
}

/* Code window stays English — already LTR via class above */
[dir="rtl"] .code-body code,
[dir="rtl"] .code-body pre {
  direction: ltr;
  text-align: left;
}

/* Gradient text doesn't get mirrored */
[dir="rtl"] .gradient-text {
  display: inline-block;
}

/* Reveal animations work the same */

/* ===========================================================
   Print
   =========================================================== */
@media print {
  body { background: #fff !important; color: #000 !important; }
  .nav, .fab-whatsapp, .scroll-indicator, .hero-bg, .theme-toggle, .menu-toggle { display: none !important; }
  .hero, .section { padding: 24px 0 !important; }
  .hero { min-height: auto !important; }
  .hero-card, .code-window { display: none !important; }
  .hero-inner { grid-template-columns: 1fr !important; }
  .section-alt { background: #fff !important; }
  .timeline-card, .project-card, .skill-group, .edu-card, .contact-card, .info-card {
    background: #fff !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  .gradient-text, .meta-value { background: none !important; -webkit-text-fill-color: #000 !important; color: #000 !important; }
  a { color: #000 !important; text-decoration: none !important; }
  .pill, .tag { background: #f0f0f0 !important; color: #000 !important; border-color: #ccc !important; }
}
