/* ==========================================================
   RESET & BASE
   ========================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
img, svg, canvas { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { font: inherit; border: none; background: none; cursor: pointer; color: inherit; }
ul { list-style: none; }

/* ==========================================================
   THEMES — 3 selectable looks via [data-theme]
   ========================================================== */
:root {
  --font-ar: 'Tajawal', sans-serif;
  --font-en-heading: 'Space Grotesk', sans-serif;
  --font-en-body: 'Inter', sans-serif;
  --radius: 18px;
  --nav-h: 76px;
}

/* ---- Dark / Futuristic (default) ---- */
[data-theme="dark"] {
  --bg: #06070d;
  --bg-alt: #090b14;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-solid: #10121c;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f3f4f8;
  --text-dim: #9297ab;
  --primary: #22d3ee;
  --primary-2: #a855f7;
  --accent: #f472b6;
  --grad: linear-gradient(120deg, #22d3ee, #a855f7 55%, #f472b6);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --glow: 0 0 40px rgba(168, 85, 247, 0.35);
  --canvas-opacity: 0.55;
  --blob-opacity: 0.55;
  /* لون خلفية العناصر المليانة (الأزرار/الأيقونات) ولون النص/الأيقونة فوقيها */
  --accent-bg: var(--grad);
  --accent-text: #08080c;
}

/* ---- Colorful / Bold ---- */
[data-theme="colorful"] {
  --bg: #120a24;
  --bg-alt: #180d2e;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-solid: #1d1136;
  --border: rgba(255, 255, 255, 0.12);
  --text: #fff8f0;
  --text-dim: #c3b8dd;
  --primary: #ff6b6b;
  --primary-2: #ffd93d;
  --accent: #6bcBFF;
  --grad: linear-gradient(120deg, #ff6b6b, #ff9f43 45%, #ffd93d 75%, #6bcbff);
  --shadow: 0 24px 60px rgba(255, 107, 107, 0.18);
  --glow: 0 0 50px rgba(255, 159, 67, 0.4);
  --canvas-opacity: 0.5;
  --blob-opacity: 0.75;
  --accent-bg: var(--grad);
  --accent-text: #1a0f24;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ar);
  overflow-x: hidden;
  transition: background-color .5s ease, color .5s ease;
}
html[lang="en"] body { font-family: var(--font-en-body); }
html[lang="en"] h1, html[lang="en"] h2, html[lang="en"] h3,
html[lang="en"] .brand, html[lang="en"] .btn { font-family: var(--font-en-heading); }

/* Hide reveal targets until JS animates them in (only once JS confirmed running) */
html.has-js .reveal-up { opacity: 0; }

/* Skeleton loading — بيتحط على أي حاوية صورة (position:relative + overflow:hidden) */
.img-skeleton::before {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, var(--bg-alt) 25%, var(--surface) 50%, var(--bg-alt) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
.img-skeleton img { opacity: 0; transition: opacity .4s ease; }
.img-skeleton.img-loaded::before { display: none; }
.img-skeleton.img-loaded img { opacity: 1; }
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ==========================================================
   LAYOUT UTILITIES
   ========================================================== */
.section { padding: 130px 0; position: relative; }
.section.alt { background: var(--bg-alt); }
.section-inner { width: min(1120px, 92%); margin: 0 auto; }
.eyebrow {
  display: inline-block;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 14px;
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 60px;
  max-width: 640px;
}

/* ==========================================================
   PRELOADER
   ========================================================== */
#preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: background-color .5s ease;
}
.preloader-mark {
  font-family: var(--font-en-heading);
  font-size: 4rem;
  font-weight: 700;
  color: var(--text);
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================
   CURSOR GLOW (desktop)
   ========================================================== */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 420px; height: 420px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(168,85,247,0.14), transparent 70%);
  transform: translate(-50%, -50%);
  mix-blend-mode: plus-lighter;
  will-change: transform;
  display: none;
}
[data-theme="dark"] .cursor-glow,
[data-theme="colorful"] .cursor-glow { display: block; }

/* ==========================================================
   SCROLL PROGRESS
   ========================================================== */
.scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0%;
  background: var(--grad);
  z-index: 1001;
}

/* ==========================================================
   NAVBAR
   ========================================================== */
.navbar {
  position: fixed; top: 0; inset-inline: 0;
  height: var(--nav-h);
  z-index: 900;
  transition: background-color .4s ease, border-color .4s ease, box-shadow .4s ease;
  border-bottom: 1px solid transparent;
}
.navbar.scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  width: min(1200px, 92%);
  margin: 0 auto;
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.brand {
  position: relative;
  font-family: var(--font-en-heading);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: .08em;
  min-width: 78px;
  height: 44px;
  padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; /* بيضاوي/كبسولة بدل الدايرة، يدي مساحة أكبر للاسم */
  background: var(--accent-bg);
  color: var(--accent-text);
}
@property --ring-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
.brand-ring {
  /* حلقة برّه الشعار خالص (مش جواه) بنفس شكله البيضاوي، وبتلف حواليه بشكل مستمر */
  position: absolute;
  inset: -8px;
  border-radius: 999px;
  padding: 2px;
  background: conic-gradient(from var(--ring-angle), transparent 0deg, var(--primary) 70deg, var(--primary-2) 140deg, transparent 210deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .85;
  animation: ring-spin 3.2s linear infinite;
  pointer-events: none;
}
@keyframes ring-spin { to { --ring-angle: 360deg; } }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
  font-size: .95rem;
  font-weight: 500;
  color: var(--text-dim);
  position: relative;
  padding: 6px 0;
  transition: color .25s ease;
}
.nav-links a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .3s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

.nav-actions { display: flex; align-items: center; gap: 14px; }
.theme-switch { display: flex; gap: 8px; padding: 6px; border: 1px solid var(--border); border-radius: 999px; }
.theme-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid transparent; transition: transform .2s ease, border-color .2s ease; }
.theme-dot[data-theme-choice="dark"] { background: linear-gradient(135deg,#22d3ee,#a855f7); }
.theme-dot[data-theme-choice="colorful"] { background: linear-gradient(135deg,#ff6b6b,#ffd93d); }
.theme-dot:hover { transform: scale(1.15); }
.theme-dot.active { border-color: var(--text); }

.lang-switch {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  transition: border-color .2s ease, background-color .2s ease;
}
.lang-switch:hover { border-color: var(--primary); }

.cmd-trigger {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--text-dim);
  font-size: 1rem;
  transition: border-color .2s ease, color .2s ease;
}
.cmd-trigger:hover { border-color: var(--primary); color: var(--primary); }
.cmd-trigger-key {
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  padding: 2px 6px; border-radius: 6px;
  background: var(--bg-alt); border: 1px solid var(--border);
}
@media (max-width: 760px) { .cmd-trigger-key { display: none; } }

.cmd-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(4px);
  align-items: flex-start; justify-content: center;
  padding-top: 12vh;
}
.cmd-overlay[hidden] { display: none; }
.cmd-overlay:not([hidden]) { display: flex; }
.cmd-palette {
  width: min(560px, 92%);
  border-radius: var(--radius);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cmd-input-wrap { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.cmd-input-wrap i { color: var(--text-dim); font-size: 1.2rem; }
.cmd-input-wrap input { flex: 1; background: none; border: none; outline: none; font: inherit; font-size: 1.05rem; color: var(--text); }
.cmd-input-wrap input::placeholder { color: var(--text-dim); }
.cmd-results { max-height: 50vh; overflow-y: auto; padding: 8px; }
.cmd-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: .92rem;
}
.cmd-item.active { background: var(--accent-bg); color: var(--accent-text); }
.cmd-item-hint { font-size: .74rem; opacity: .7; flex-shrink: 0; }
.cmd-empty { padding: 20px; text-align: center; color: var(--text-dim); font-size: .9rem; }

/* ===================== Certificate Lightbox ===================== */
.cert-lightbox-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0, 0, 0, .8);
  backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
  padding: 30px;
}
.cert-lightbox-overlay[hidden] { display: none; }
.cert-lightbox-overlay:not([hidden]) { display: flex; }
.cert-lightbox {
  position: relative;
  width: min(720px, 100%);
  max-height: 90vh;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden auto;
  display: flex; flex-direction: column;
}
.cert-lightbox-close {
  position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 10, 15, 0.55); color: #fff;
  font-size: 1.3rem; backdrop-filter: blur(4px);
}
.cert-lightbox-img { width: 100%; max-height: 55vh; object-fit: contain; background: var(--bg-alt); }
.cert-lightbox-info { padding: 22px 26px 26px; }
.cert-lightbox-info h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: 6px; }
.cert-lightbox-info p { color: var(--text-dim); font-size: .88rem; margin-bottom: 20px; }
.cert-lightbox-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.cert-lightbox-actions .btn { display: inline-flex; align-items: center; gap: 8px; }

.burger { display: none; flex-direction: column; gap: 5px; width: 26px; }
.burger span { height: 2px; width: 100%; background: var(--text); transition: transform .3s ease, opacity .3s ease; }
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 10px 5% 22px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.mobile-menu.open { display: flex; }
.mobile-menu a { padding: 12px 6px; font-weight: 600; border-bottom: 1px solid var(--border); }

/* ==========================================================
   BOTTOM NAV (موبايل بس) — بستايل "Liquid Glass" الزجاجي
   ========================================================== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%) translateY(24px);
  z-index: 500;
  align-items: center; gap: 2px;
  padding: 8px; border-radius: 28px;
  background: rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .12);
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.bottom-nav.visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 15px;
  border-radius: 20px;
  border: none; background: none; font-family: inherit;
  color: rgba(255, 255, 255, .65);
  font-size: .62rem; font-weight: 700;
  transition: color .25s ease, background-color .25s ease;
}
.bottom-nav-item i { font-size: 1.3rem; }
.bottom-nav-item.active { color: #fff; background: rgba(255, 255, 255, .16); }
@media (max-width: 760px) {
  .bottom-nav { display: flex; }
  .footer { padding-bottom: calc(36px + 64px + env(safe-area-inset-bottom)); }
}

/* ==========================================================
   HERO
   ========================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding-top: calc(var(--nav-h) + 24px);
  /* مساحة محجوزة تحت المحتوى عشان زرار "انزل تحت" يبقى ليه مكان ثابت ومايتداخلش مع حاجة، مهما طال المحتوى */
  padding-bottom: 100px;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
#particleCanvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: var(--canvas-opacity); }
.hero-glow {
  position: absolute;
  width: 46vw; height: 46vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: var(--blob-opacity);
  animation: floatBlob 16s ease-in-out infinite;
}
.hero-glow-1 { background: var(--primary); top: -10%; inset-inline-start: -10%; }
.hero-glow-2 { background: var(--primary-2); bottom: -15%; inset-inline-end: -8%; animation-delay: -8s; }
@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(4%, 6%) scale(1.12); }
}

.hero-inner {
  position: relative; z-index: 2;
  width: min(760px, 92%);
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}

.hero-greeting { color: var(--text-dim); font-size: 1.05rem; margin-bottom: 10px; font-weight: 500; }
.hero-name {
  font-family: var(--font-en-heading);
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  font-weight: 700;
  line-height: 1.08;
  margin-bottom: 18px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
html[lang="ar"] .hero-name { font-family: var(--font-ar); font-weight: 800; }

.hero-roles { min-height: 34px; margin-bottom: 20px; }
.role-text { font-size: clamp(1.05rem, 2.4vw, 1.4rem); font-weight: 600; color: var(--text); }
.role-caret { color: var(--primary); font-weight: 300; animation: blink 1s step-start infinite; margin-inline-start: 2px; }
@keyframes blink { 50% { opacity: 0; } }

.hero-tagline { color: var(--text-dim); font-size: 1.05rem; max-width: 560px; margin-bottom: 34px; line-height: 1.8; }

.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-bottom: 40px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 30px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .95rem;
  position: relative;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease;
}
.btn-primary { background: var(--accent-bg); color: var(--accent-text); box-shadow: var(--glow); }
.btn-outline { border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); }
.btn:hover { transform: translateY(-3px); }
.btn-lg { padding: 17px 40px; font-size: 1.05rem; }

.hero-badges { display: flex; gap: 34px; flex-wrap: wrap; justify-content: center; margin-bottom: 34px; }
.hero-badges .badge-item { text-align: center; }
.hero-badges .badge-num {
  font-family: var(--font-en-heading);
  font-size: 1.5rem; font-weight: 700;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  display: block;
}
.hero-badges .badge-label { font-size: .78rem; color: var(--text-dim); margin-top: 2px; }

.hero-social { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.hero-social a {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-size: 1.15rem;
  transition: transform .3s ease, border-color .3s ease, color .3s ease, background .3s ease;
}
.hero-social a:hover { transform: translateY(-4px); border-color: var(--primary); color: var(--primary); }

.scroll-cue {
  /* لازم left فعلي (مش inset-inline-start) عشان التوسيط بالـ translateX يشتغل صح
     في وضع RTL برضه — inset-inline-start بيتقلب لـ right في العربي وده كان بيبعدها عن النص */
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid var(--border); border-radius: 14px;
  z-index: 1;
}
.scroll-cue span {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 8px; border-radius: 2px; background: var(--primary);
  animation: scrollCue 1.8s ease infinite;
}
@keyframes scrollCue { 0% { opacity: 1; top: 8px; } 70% { opacity: 0; top: 20px; } 100% { opacity: 0; top: 8px; } }

/* ==========================================================
   ABOUT
   ========================================================== */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 60px; align-items: start; }
.about-text p { color: var(--text-dim); line-height: 2; margin-bottom: 20px; font-size: 1.02rem; }
.about-stats { display: flex; flex-direction: column; gap: 22px; }
.stat-card {
  padding: 26px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.stat-number {
  font-family: var(--font-en-heading);
  font-size: 2.2rem; font-weight: 700;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label { color: var(--text-dim); font-size: .92rem; margin-top: 6px; }

/* ==========================================================
   SKILLS
   ========================================================== */
.skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.skill-card {
  padding: 30px 26px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform .4s cubic-bezier(.2,.8,.2,1), border-color .3s ease, box-shadow .4s ease;
  transform-style: preserve-3d;
}
.skill-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.skill-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  background: var(--accent-bg);
  color: var(--accent-text);
  margin-bottom: 18px;
}
.skill-card h3 { font-size: 1.08rem; margin-bottom: 14px; font-weight: 700; }

.skill-bars { display: flex; flex-direction: column; gap: 14px; }
.skill-bar-row { display: flex; flex-direction: column; gap: 6px; }
.skill-bar-name { font-size: .85rem; color: var(--text-dim); }
.skill-bar-track {
  height: 6px; border-radius: 999px;
  background: var(--bg-alt);
  overflow: hidden;
}
.skill-bar-fill {
  height: 100%; width: 0%;
  border-radius: 999px;
  background: var(--grad);
}

/* ==========================================================
   PROJECTS
   ========================================================== */
.projects-search {
  display: flex; align-items: center; gap: 10px;
  max-width: 420px;
  margin-bottom: 24px;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color .25s ease;
}
.projects-search:focus-within { border-color: var(--primary); }
.projects-search i:first-child { color: var(--text-dim); font-size: 1.1rem; flex-shrink: 0; }
.projects-search input {
  flex: 1; min-width: 0;
  background: none; border: none; outline: none;
  font: inherit; color: var(--text);
}
.projects-search input::placeholder { color: var(--text-dim); }
.projects-search button {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; flex-shrink: 0;
  color: var(--text-dim); font-size: 1.1rem;
}
.projects-search button:hover { color: var(--primary); }

.project-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }
.project-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: .85rem; font-weight: 700;
  transition: border-color .3s ease, color .3s ease, background .3s ease;
}
.project-tab:hover { color: var(--text); border-color: var(--primary); }
.project-tab.active { background: var(--accent-bg); color: var(--accent-text); border-color: transparent; }
.project-tab-count {
  font-size: .72rem; opacity: .75;
  background: rgba(255,255,255,.15);
  border-radius: 999px; padding: 1px 7px;
}
.project-tab.active .project-tab-count { background: rgba(0,0,0,.15); }

.projects-empty { color: var(--text-dim); font-size: .95rem; padding: 30px 0; grid-column: 1 / -1; text-align: center; }

.projects-more-wrap { display: flex; justify-content: center; margin-top: 34px; }

.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.project-card {
  display: flex; flex-direction: column;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color .3s ease, transform .3s ease, box-shadow .4s ease;
}
.project-card:hover { border-color: var(--primary); transform: translateY(-6px); box-shadow: var(--shadow); }
.project-media { position: relative; height: 170px; overflow: hidden; background: var(--surface-solid); }
.project-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.project-card:hover .project-media img { transform: scale(1.06); }
.project-media-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; color: var(--primary);
  background: var(--accent-bg);
}
.project-media-placeholder i { color: var(--accent-text); }

.project-body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.project-body h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.project-body p { font-size: .88rem; color: var(--text-dim); line-height: 1.75; margin-bottom: 16px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; margin-top: auto; }
.project-tag {
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  padding: 5px 12px; border-radius: 999px;
  background: var(--bg-alt); border: 1px solid var(--border); color: var(--text-dim);
}
.project-links { display: flex; gap: 14px; }
.project-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .82rem; font-weight: 700; color: var(--primary);
}
.project-link:hover { text-decoration: underline; }

.project-card-disabled { cursor: default; opacity: .6; }
.project-card-disabled:hover { border-color: var(--border); transform: none; box-shadow: none; }
.project-card-disabled .project-media img { filter: grayscale(.4); }
.project-link-soon { color: var(--text-dim); }

.project-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.project-share {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 34px; height: 34px; padding: 0 9px; border-radius: 17px; flex-shrink: 0;
  background: var(--bg-alt); border: 1px solid var(--border); color: var(--text-dim);
  font-size: .8rem; font-family: inherit; font-weight: 700;
  cursor: pointer; transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.project-share i { font-size: 1rem; }
.project-share:hover { color: var(--primary); border-color: var(--primary); }

/* ==========================================================
   EXPERIENCE (timeline)
   ========================================================== */
.timeline { position: relative; padding-inline-start: 36px; }
.timeline::before {
  content: ""; position: absolute; inset-inline-start: 7px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(var(--border), var(--border));
}
.timeline-item { position: relative; padding-bottom: 46px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-card {
  padding: 26px 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.timeline-period { font-size: .8rem; font-weight: 700; color: var(--primary); letter-spacing: .04em; text-transform: uppercase; }
.timeline-card h3 { font-size: 1.15rem; margin: 8px 0 4px; font-weight: 700; }
.timeline-org { color: var(--text-dim); font-size: .92rem; margin-bottom: 12px; font-weight: 600; }
.timeline-card p { color: var(--text-dim); line-height: 1.8; font-size: .95rem; }
.timeline-icon {
  position: absolute; inset-inline-start: -40px; top: 0;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem;
  background: var(--accent-bg); color: var(--accent-text);
  box-shadow: 0 0 0 4px var(--bg);
}

/* ==========================================================
   ACHIEVEMENTS
   ========================================================== */
.achievements-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.achieve-card {
  padding: 34px 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
  transition: transform .4s ease, border-color .3s ease;
}
.achieve-card:hover { transform: translateY(-6px); border-color: var(--primary); }
.achieve-icon {
  width: 64px; height: 64px; margin: 0 auto 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  background: var(--accent-bg); color: var(--accent-text);
}
.achieve-text h3 { font-size: 1.1rem; margin-bottom: 10px; font-weight: 700; }
.achieve-text p { color: var(--text-dim); font-size: .92rem; line-height: 1.7; }

/* كارت مميز (زي سباحة الزعانف) — بياخد عرض الصف كامل وشكل مختلف يبرزه عن باقي الإنجازات */
.achieve-card-featured {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 30px; text-align: start;
  padding: 32px 40px;
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--surface) 60%, color-mix(in srgb, var(--primary) 10%, var(--surface)));
}
.achieve-card-featured .achieve-icon { width: 88px; height: 88px; font-size: 2.5rem; margin: 0; flex-shrink: 0; }
.achieve-card-featured .achieve-text h3 { font-size: 1.35rem; }
.achieve-card-featured .achieve-text p { font-size: .98rem; }
@media (max-width: 640px) {
  .achieve-card-featured { flex-direction: column; text-align: center; padding: 30px 26px; }
}

.swim-timeline-wrap { margin-top: 60px; }
.swim-timeline-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 30px; }

/* ==========================================================
   LATEST CONTENT (منصات المحتوى)
   ========================================================== */
.content-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.content-card {
  display: flex; align-items: center; gap: 18px;
  padding: 26px 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform .3s ease, border-color .3s ease, box-shadow .4s ease;
}
.content-card:hover { transform: translateY(-6px); border-color: var(--primary); box-shadow: var(--shadow); }
.content-icon {
  width: 54px; height: 54px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  background: var(--accent-bg); color: var(--accent-text);
}
.content-text { flex: 1; min-width: 0; }
.content-text h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.content-text p { color: var(--text-dim); font-size: .85rem; line-height: 1.6; }
.content-link {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  font-size: .82rem; font-weight: 700; color: var(--primary);
}
.content-card:hover .content-link { text-decoration: underline; }

/* ==========================================================
   NOW (دلوقتي)
   ========================================================== */
.now-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.now-card {
  padding: 30px 26px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform .3s ease, border-color .3s ease;
}
.now-card:hover { transform: translateY(-6px); border-color: var(--primary); }
.now-icon {
  width: 46px; height: 46px; margin-bottom: 16px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  background: var(--accent-bg); color: var(--accent-text);
}
.now-card p { color: var(--text-dim); font-size: .9rem; line-height: 1.75; }

/* ==========================================================
   TESTIMONIALS (قالوا عني)
   ========================================================== */
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.testimonial-card {
  padding: 30px 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform .3s ease, border-color .3s ease;
}
.testimonial-card:hover { transform: translateY(-6px); border-color: var(--primary); }
.testimonial-quote-icon { font-size: 1.6rem; color: var(--primary); opacity: .5; margin-bottom: 14px; display: block; }
.testimonial-quote { color: var(--text-dim); font-size: .92rem; line-height: 1.8; margin-bottom: 20px; }
.testimonial-footer { display: flex; flex-direction: column; gap: 2px; }
.testimonial-name { font-weight: 700; font-size: .92rem; }
.testimonial-role { color: var(--text-dim); font-size: .8rem; }

/* ==========================================================
   CERTIFICATES
   ========================================================== */
.cert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.cert-card {
  display: flex; flex-direction: column;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color .3s ease, transform .3s ease, box-shadow .3s ease;
}
/* شكل بسيط بأيقونة — للشهادات اللي لسه معندهاش صورة حقيقية */
.cert-card:not(.has-thumb) { flex-direction: row; align-items: center; gap: 16px; padding: 22px 24px; }
.cert-card:not(.has-thumb) > i { font-size: 1.7rem; color: var(--primary); flex-shrink: 0; }

/* شكل بمعاينة جزء من صورة الشهادة الحقيقية — بيدي مصداقية أكتر */
.cert-thumb { position: relative; height: 118px; overflow: hidden; background: var(--surface-solid); }
.cert-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  display: block;
  transition: transform .5s ease;
}
.cert-card.has-file:hover .cert-thumb img { transform: scale(1.05); }
.cert-thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 45%, var(--surface) 100%);
}

.cert-text { flex: 1; min-width: 0; padding: 16px 22px 20px; }
.cert-card h3 { font-size: .98rem; font-weight: 700; margin-bottom: 4px; }
.cert-card p { font-size: .82rem; color: var(--text-dim); }

/* الكروت اللي ليها ملف شهادة فعلي بتتفتح في تاب جديد لما تدوس عليها */
.cert-card.has-file { cursor: pointer; }
.cert-card.has-file:hover { border-color: var(--primary); transform: translateY(-4px); box-shadow: var(--shadow); }
.cert-view {
  font-size: .95rem; color: var(--text-dim); flex-shrink: 0;
  transition: color .3s ease, transform .3s ease;
}
.cert-card:not(.has-thumb) .cert-view { font-size: 1.15rem; }
.cert-card.has-thumb .cert-view {
  position: absolute; top: 10px; inset-inline-end: 10px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 10, 15, 0.55); color: #fff;
  backdrop-filter: blur(4px);
}
.cert-card.has-file:hover .cert-view { color: var(--primary); transform: translateX(3px); }
.cert-card.has-thumb.has-file:hover .cert-view { color: #fff; transform: none; }
html[dir="rtl"] .cert-card.has-file:hover .cert-view { transform: translateX(-3px); }
html[dir="rtl"] .cert-card.has-thumb.has-file:hover .cert-view { transform: none; }

.cert-share {
  border: none; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: .72rem; font-weight: 700;
}
.cert-share i { font-size: 1rem; }
.cert-card.has-thumb .cert-share {
  position: absolute; top: 10px; inset-inline-start: 10px; z-index: 2;
  min-width: 30px; height: 30px; border-radius: 999px; padding: 0 8px;
  background: rgba(10, 10, 15, 0.55); color: #fff;
  backdrop-filter: blur(4px);
  transition: color .3s ease, background .3s ease;
}
.cert-card.has-thumb .cert-share:hover { color: var(--primary); background: rgba(10, 10, 15, 0.75); }
.cert-card:not(.has-thumb) .cert-share {
  min-width: 30px; height: 30px; border-radius: 999px; padding: 0 8px; flex-shrink: 0;
  background: var(--bg-alt); color: var(--text-dim);
  transition: color .3s ease, border-color .3s ease;
}
.cert-card:not(.has-thumb) .cert-share:hover { color: var(--primary); }

/* لينك "عرض الشهادة" جوه كارت الخبرة (زي بنك مصر) */
.timeline-file-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px;
  font-size: .85rem; font-weight: 700;
  color: var(--primary);
}
.timeline-file-link:hover { text-decoration: underline; }

/* ==========================================================
   CONTACT
   ========================================================== */
#contact .section-inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.contact-text { color: var(--text-dim); max-width: 520px; margin: 0 auto 34px; line-height: 1.9; }
.contact-email-row { display: flex; align-items: center; gap: 10px; }
.contact-email-copy {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 999px; padding: 0 10px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: .78rem; font-weight: 700;
  transition: color .2s ease, border-color .2s ease;
}
.contact-email-copy i { font-size: 1.1rem; }
.contact-email-copy:hover { color: var(--primary); border-color: var(--primary); }
.contact-social { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 40px; }
.contact-social a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: .85rem;
  transition: border-color .3s ease, color .3s ease, transform .3s ease;
}
.contact-social a:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-3px); }

/* ==========================================================
   FOOTER
   ========================================================== */
.footer {
  padding: 36px 5%;
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: .85rem;
}
.to-top {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  transition: transform .3s ease, border-color .3s ease, color .3s ease;
}
.to-top:hover { transform: translateY(-4px); border-color: var(--primary); color: var(--primary); }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 980px) {
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .achievements-grid { grid-template-columns: 1fr; }
  .now-grid { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-links { display: none; }
  .burger { display: flex; }
  .section { padding: 90px 0; }
  .cursor-glow { display: none !important; }

  /* الهيرو على الموبايل: مسافات أصغر عشان كل المحتوى + زرار "انزل تحت" يبانوا مع بعض
     من غير ما المستخدم يحتاج ينزل، وزرار الاسكرول يفضل واضح تحت من غير ما يتلخبط */
  .hero { padding-top: calc(var(--nav-h) + 8px); padding-bottom: 56px; }
  .hero-greeting { margin-bottom: 6px; font-size: .85rem; }
  .hero-name { margin-bottom: 10px; font-size: clamp(1.9rem, 8vw, 2.6rem); }
  .hero-roles { margin-bottom: 10px; min-height: 24px; }
  .hero-tagline { margin-bottom: 18px; font-size: .85rem; line-height: 1.6; max-width: 320px; }
  .hero-cta { margin-bottom: 20px; }
  .hero .btn { padding: 12px 24px; font-size: .85rem; }
  .hero-badges { margin-bottom: 18px; gap: 22px; }
  .hero-badges .badge-num { font-size: 1.2rem; }
  .hero-social a { width: 38px; height: 38px; font-size: 1rem; }
  .scroll-cue { bottom: 100px; }
}

@media (max-width: 520px) {
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .hero-badges { gap: 20px; }
  .footer { flex-direction: column; gap: 16px; text-align: center; }
}

/* ==========================================================
   طباعة نضيفة (Ctrl+P / حفظ كـ PDF) — بتشتغل على كل صفحة شايلة style.css
   ========================================================== */
@media print {
  /* عناصر تحكم/تفاعل وديكور متحرك — مالهاش معنى على الورق */
  #preloader, .cursor-glow, .scroll-progress, .navbar, .mobile-menu,
  .hero-bg, .scroll-cue, .to-top, .brand-ring,
  .projects-search, .project-tabs, .projects-more-wrap,
  .project-share, .cert-share, .contact-email-copy, #particleCanvas, .cmd-overlay, .cert-lightbox-overlay, .bottom-nav {
    display: none !important;
  }

  * { box-shadow: none !important; text-shadow: none !important; animation: none !important; transition: none !important; }

  html, body { background: #fff !important; color: #000 !important; }
  .section, .section.alt { background: #fff !important; padding: 24px 0 !important; }
  .hero { min-height: auto !important; padding: 20px 0 !important; }

  /* النصوص اللي شكلها متدرّج (gradient text) بترجع لون واحد واضح عشان متختفيش على الورق */
  .hero-name, .badge-num, .stat-number, .section-title {
    background: none !important;
    -webkit-text-fill-color: #000 !important;
    color: #000 !important;
  }

  .project-card, .cert-card, .achieve-card, .content-card, .skill-card, .stat-card {
    border: 1px solid #ccc !important;
    background: #fff !important;
    transform: none !important;
  }

  a { color: #000 !important; text-decoration: underline; }
  /* بعد أي لينك خارجي، اطبع رابطه الفعلي — مفيد لما الورقة مش هتبقى قابلة للدوس عليها */
  .project-card[href]::after, .content-card[href]::after, .cert-card[href]::after {
    content: " (" attr(href) ")";
    font-size: .7rem;
    color: #555;
  }
}
