/* ============ المتغيرات العامة ============ */
:root {
  --bg: #070b14;
  --bg-soft: #0b1120;
  --card: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.09);
  --text: #e8edf7;
  --text-dim: #94a3b8;
  --accent: #6d5cff;
  --accent-2: #00e0c6;
  --gradient: linear-gradient(135deg, #6d5cff 0%, #00e0c6 100%);
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============ أساسيات ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Noto Kufi Arabic", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  overflow-x: hidden;
}

.container { width: min(1100px, 92%); margin-inline: auto; }

.hidden { display: none !important; }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

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

/* شريط تمرير مخصص */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============ الخلفية المتحركة ============ */
.bg-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; }

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.45;
  animation: float 14s ease-in-out infinite;
}
.blob-1 { width: 480px; height: 480px; background: #4338ca; top: -140px; right: -120px; }
.blob-2 { width: 420px; height: 420px; background: #0e7490; bottom: -120px; left: -100px; animation-delay: -5s; }
.blob-3 { width: 320px; height: 320px; background: #7c3aed; top: 45%; left: 38%; animation-delay: -9s; opacity: 0.28; }

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

.stars { position: absolute; inset: 0; }
.star {
  position: absolute;
  width: 2px; height: 2px;
  background: #fff;
  border-radius: 50%;
  opacity: 0.5;
  animation: twinkle 3.5s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.85; }
}

/* ============ شريط التنقل ============ */
.navbar {
  position: fixed;
  top: 0; right: 0; left: 0;
  z-index: 100;
  padding: 18px 0;
  transition: var(--transition);
}
.navbar.scrolled {
  padding: 10px 0;
  background: rgba(7, 11, 20, 0.75);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }

.logo { font-size: 1.5rem; font-weight: 900; letter-spacing: 0.5px; }
.logo .dot { color: var(--accent-2); }

.nav-links { display: flex; gap: 6px; }
.nav-link {
  padding: 8px 16px;
  border-radius: 12px;
  color: var(--text-dim);
  font-weight: 500;
  transition: var(--transition);
}
.nav-link:hover { color: var(--text); background: var(--card); }
.nav-link.active { color: #fff; background: var(--card); box-shadow: inset 0 0 0 1px var(--card-border); }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav-toggle span {
  display: block;
  width: 26px; height: 3px;
  background: var(--text);
  border-radius: 3px;
  margin: 5px 0;
  transition: var(--transition);
}

/* ============ الأزرار ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 30px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 10px 30px rgba(109, 92, 255, 0.35);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(109, 92, 255, 0.5); }
.btn-whatsapp {
  background: linear-gradient(135deg, #128c7e, #25d366);
  color: #fff;
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.35);
}
.btn-whatsapp:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(37, 211, 102, 0.5); }
.btn-ghost {
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--card-border);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); transform: translateY(-3px); }

/* ============ القسم الرئيسي ============ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding-top: 80px;
}
.hero-inner { text-align: center; }

.avatar-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 22px; }
.avatar-ring {
  padding: 5px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, var(--accent), var(--accent-2), var(--accent));
  animation: spin 6s linear infinite;
  box-shadow: 0 0 50px rgba(109, 92, 255, 0.45);
}
@keyframes spin { to { transform: rotate(360deg); } }
.avatar {
  width: 128px; height: 128px;
  border-radius: 50%;
  background: var(--gradient);
  display: grid;
  place-items: center;
  font-size: 3.4rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--accent-2);
  background: rgba(0, 224, 198, 0.08);
  border: 1px solid rgba(0, 224, 198, 0.25);
  padding: 6px 14px;
  border-radius: 999px;
}
.pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(0, 224, 198, 0.6);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  to { box-shadow: 0 0 0 9px rgba(0, 224, 198, 0); }
}

.hero-title { font-size: clamp(2.2rem, 6vw, 3.8rem); font-weight: 900; margin-bottom: 10px; }
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-role {
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  font-weight: 500;
  color: var(--accent-2);
  min-height: 2.2em;
  margin-bottom: 14px;
}
.cursor { animation: blink 1s step-end infinite; font-weight: 300; }
@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  max-width: 620px;
  margin: 0 auto 30px;
  color: var(--text-dim);
  font-size: 1.1rem;
}

.hero-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

.scroll-hint {
  position: absolute;
  bottom: 28px; right: 50%;
  transform: translateX(50%);
  width: 26px; height: 44px;
  border: 2px solid var(--text-dim);
  border-radius: 20px;
  display: flex;
  justify-content: center;
}
.scroll-hint span {
  width: 4px; height: 9px;
  background: var(--accent-2);
  border-radius: 4px;
  margin-top: 7px;
  animation: scrollDown 1.6s ease-in-out infinite;
}
@keyframes scrollDown {
  0% { opacity: 1; transform: translateY(0); }
  70% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 0; }
}

/* ============ الأقسام العامة ============ */
.section { padding: 110px 0; }

.section-title {
  text-align: center;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900;
  margin-bottom: 50px;
  position: relative;
}
.section-title::after {
  content: "";
  display: block;
  width: 70px; height: 4px;
  background: var(--gradient);
  border-radius: 4px;
  margin: 14px auto 0;
}
.section-sub { text-align: center; color: var(--text-dim); margin: -30px 0 40px; }

/* ============ البطاقات الزجاجية ============ */
.glass-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  padding: 30px;
  transition: var(--transition);
}
.glass-card:hover {
  transform: translateY(-6px);
  border-color: rgba(109, 92, 255, 0.45);
  box-shadow: 0 24px 70px rgba(109, 92, 255, 0.18);
}

/* ============ نبذة عني ============ */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: center;
}
.about-grid p { color: var(--text-dim); margin-bottom: 14px; }
.about-grid p:last-child { margin-bottom: 0; }

.about-stats { display: grid; gap: 16px; }
.stat { display: flex; align-items: baseline; gap: 6px; padding: 20px 26px; }
.stat-num { font-size: 2.2rem; font-weight: 900; color: var(--accent-2); }
.stat-plus { font-size: 1.4rem; font-weight: 900; color: var(--accent); }
.stat-label { margin-inline-start: auto; color: var(--text-dim); font-weight: 500; }

/* ============ المهارات ============ */
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 34px; }
.skill-head { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 12px; }
.skill-pct { color: var(--accent-2); }
.skill-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  overflow: hidden;
}
.skill-bar span {
  display: block;
  height: 100%;
  width: var(--w);
  background: var(--gradient);
  border-radius: 10px;
  box-shadow: 0 0 14px rgba(0, 224, 198, 0.5);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}
.skill-bar.animate span { transform: scaleX(1); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip {
  padding: 8px 18px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: var(--transition);
}
.chip:hover { color: #fff; border-color: var(--accent); transform: translateY(-3px); }

/* ============ التواصل ============ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}
.contact-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.contact-icon { font-size: 2.1rem; margin-bottom: 6px; }
.contact-label { font-weight: 700; }
.contact-value { color: var(--text-dim); font-size: 0.92rem; word-break: break-all; }

/* ============ التذييل ============ */
.footer {
  border-top: 1px solid var(--card-border);
  padding: 34px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.footer .heart { color: #ff4d6d; }
.footer .hosted { font-size: 0.82rem; opacity: 0.6; margin-top: 4px; }
.footer .hosted a { color: var(--accent-2); font-weight: 700; }
.footer .hosted a:hover { text-decoration: underline; }

/* ============ أنيميشن الظهور ============ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible { opacity: 1; transform: none; }
.delay-1 { transition-delay: 0.12s; }
.delay-2 { transition-delay: 0.24s; }
.delay-3 { transition-delay: 0.36s; }
.delay-4 { transition-delay: 0.48s; }

/* ============ الجوال ============ */
@media (max-width: 820px) {
  .about-grid, .skills-grid { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }

  .nav-toggle { display: block; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100dvh;
    width: min(300px, 80vw);
    background: rgba(11, 17, 32, 0.97);
    backdrop-filter: blur(18px);
    flex-direction: column;
    padding: 100px 26px;
    gap: 10px;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    border-inline-start: 1px solid var(--card-border);
  }
  .nav-links.open { transform: translateX(0); }
}
