/* ==========================================
   ========== VARIABLES & BASE STYLE ==========
   ========================================== */
:root {
  --bg: #0b0b0c;
  --card: #0f0f10;
  --text: #e6e6e6;
  --accent: #b70000; /* Crimson red */
  --accent-glow: 0 6px 24px rgba(183,0,0,0.45);
  --muted: #9a9a9a;
  --glass: rgba(255,255,255,0.05);
  --max-width: 1200px;
  --transition: 0.3s ease;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* ==========================================
   ================ HEADER ===================
   ========================================== */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  backdrop-filter: blur(6px);
  background: rgba(11,11,12,0.95);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  z-index: 999;
}

.header-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 28px;
  gap: 16px;
}

/* ===== Brand ===== */
.brand a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.6px;
}

.brand-name {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--text);
}

.dot {
  font-family: 'Poppins', sans-serif;
  color: var(--accent);
  font-weight: 500;
  font-size: 1rem;
  margin-top: 4px;
}

/* ===== Navigation ===== */
.nav {
  display: flex;
  gap: 18px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 8px;
  transition: var(--transition);
}

.nav a:hover {
  color: var(--text);
  background: var(--glass);
}

/* ===== Hamburger Button (Mobile) ===== */
.menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}


/* ===== Mobile Adjustments ===== */
@media (max-width: 900px) {
  .nav {
    display: none;           /* اخفاء nav افتراضياً */
    flex-direction: column;  /* تظهر كعمود عند الفتح */
    position: absolute;      /* فوق باقي المحتوى */
    top: 64px;               /* أسفل الهيدر */
    right: 20px;
    background: rgba(11,11,12,0.95);
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    z-index: 999;
  }

  .nav.open {
    display: flex;           /* تظهر عند الضغط على البرجر */
  }

  .menu-btn {
    display: block;          /* إظهار زر البرجر */
  }
}
/* ==========================================
   ================ HERO ====================
   ========================================== */
.hero {
  padding: 80px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

.hero-text h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  margin-bottom: 10px;
}

.hero-text .name {
  font-family: 'Neonderthaw', cursive;
  font-size: 2.8rem;
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent), 0 0 15px rgba(183,0,0,0.6);
}

.lead {
  color: var(--muted);
  margin: 10px 0 24px;
  font-size: 1.1rem;
  max-width: 520px;
}

.btn {
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  text-decoration: none;
  display: inline-block;
  box-shadow: var(--accent-glow);
  border: none;
  transition: var(--transition);
}

.btn:hover {
  transform: translateY(-3px);
  opacity: 0.9;
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
}

/* ==========================================
   =========== PROFILE & ORBIT ===============
   ========================================== */
.profile-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto;
}

.profile-img {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 0 20px var(--accent);
}

/* Orbit around profile */
.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 350px;
  height: 350px;
  margin-left: -175px;
  margin-top: -175px;
  border-radius: 50%;
  animation: rotate 30s linear infinite;
}

/* Orbit icons */
.icon {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255,0,0,0.15);
  box-shadow: 0 0 15px red;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: white;
}



/* Distribute icons on orbit */
.icon:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); }
.icon:nth-child(2) { top: 20%; right: 0; transform: translateY(-50%); }
.icon:nth-child(3) { bottom: 20%; right: 0; transform: translateY(50%); }
.icon:nth-child(4) { bottom: 0; left: 50%; transform: translateX(-50%); }
.icon:nth-child(5) { bottom: 20%; left: 0; transform: translateY(50%); }
.icon:nth-child(6) { top: 20%; left: 0; transform: translateY(-50%); }
.icon:nth-child(7) { top: 50%; right: 10%; transform: translateY(-50%); }
.icon:nth-child(8) { top: 50%; left: 10%; transform: translateY(-50%); }
.icon:nth-child(9) { top: 35%; right: 20%; }
.icon:nth-child(10){ bottom: 35%; left: 20%; }
.icon:nth-child(11){ top: 50%; left: 50%; }

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================================
   ============== SOCIALS ===================
   ========================================== */
.socials-fixed {
  position: fixed;
  top: 50%;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: translateY(-50%);
  z-index: 1000;
}

.socials-fixed a {
  text-decoration: none;
  color: var(--text);
  font-size: 1.8rem;
  background: rgba(183,0,0,0.2);
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s, color 0.3s, background 0.3s;
  animation: float 3s ease-in-out infinite;
}

.socials-fixed a:hover {
  animation-play-state: paused;
  color: #fff;
  background: var(--accent);
  transform: scale(1.2);
}

@keyframes float {
  0%   { transform: translateY(0) rotate(0deg); }
  25%  { transform: translateY(-4px) rotate(-2deg); }
  50%  { transform: translateY(0) rotate(0deg); }
  75%  { transform: translateY(4px) rotate(2deg); }
  100% { transform: translateY(0) rotate(0deg); }
}


/* ==========================================
   ============== SECTIONS ==================
   ========================================== */
.section {
  padding: 42px 0;
}

.section h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.section-sub {
  color: var(--muted);
  margin-bottom: 18px;
}

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

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.03);
  transition: var(--transition);
}

.card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 14px;
}

.card h3 {
  margin: 0 0 8px;
}

.card p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 12px;
}

.card-actions {
  display: flex;
  gap: 10px;
}

.card .link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.card:hover {
  transform: translateY(-8px);
}

/* ==========================================
   ================ SKILLS ==================
   ========================================== */
.skills-grid {
  display: grid;
  gap: 16px;
}

.skill {
  margin-bottom: 10px;
}

.skill-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.bar {
  background: rgba(255,255,255,0.03);
  height: 12px;
  border-radius: 8px;
  overflow: hidden;
}

.bar .fill {
  height: 100%;
  width: 0%;
  /* تدرج لوني يبدأ داكن جداً ويتدرج لأحمر دموي فاتح */
  background: linear-gradient(90deg, #b70000, #ca0c0c, #e03838);
  box-shadow: 0 0 8px #b70000; /* ظل أحمر داكن */
  transition: width 1.2s cubic-bezier(.2,.9,.2,1);
}


.percent {
  color: var(--muted);
  font-size: 13px;
}

/* ==========================================
   ================ ABOUT ===================
   ========================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
}

/* ==========================================
   ================ CONTACT =================
   ========================================== */
.contact-form {
  display: grid;
  gap: 10px;
  max-width: 520px;
}

.contact-form input,
.contact-form textarea {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.06);
  padding: 10px;
  border-radius: 8px;
  color: var(--text);
}

/* ==========================================
   ================ FOOTER ==================
   ========================================== */
.site-footer {
  border-top: 1px solid rgba(255,255,255,0.03);
  padding: 20px 0;
  margin-top: 30px;
  text-align: center;
  color: var(--muted);
}

/* ==========================================
   ============== RESPONSIVE =================
   ========================================== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .profile-img { width: 260px; height: 260px; margin: 0 auto; }
  .about-grid { grid-template-columns: 1fr; }
  .nav { display: none; }
  .menu-btn { display: block; }
}

/* ==========================================
   ============== INTERACTIONS ===============
   ========================================== */
a:focus {
  outline: 2px solid rgba(183,0,0,0.15);
  outline-offset: 3px;
}


/* ===== Socials at the Bottom of Contact Section ===== */
.socials-bottom {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.socials-bottom a {
  text-decoration: none;
  color: var(--text);
  font-size: 1.8rem;
  background: rgba(183,0,0,0.2);
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s, color 0.3s, background 0.3s;
  animation: float 3s ease-in-out infinite;
}

.socials-bottom a:hover {
  animation-play-state: paused;
  color: #fff;
  background: var(--accent);
  transform: scale(1.2);
}

@keyframes float {
  0%   { transform: translateY(0) rotate(0deg); }
  25%  { transform: translateY(-4px) rotate(-2deg); }
  50%  { transform: translateY(0) rotate(0deg); }
  75%  { transform: translateY(4px) rotate(2deg); }
  100% { transform: translateY(0) rotate(0deg); }
}


/* ===== Shake animation for error message ===== */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.shake {
  animation: shake 0.4s ease;
}


/* ===== Highlight empty fields ===== */
.input-error {
  border: 2px solid rgba(255, 0, 0, 0.6);
  box-shadow: 0 0 8px rgba(255, 0, 0, 0.3);
  animation: shake 0.4s ease;
}


/* Hero Section - مركزي على جميع الشاشات الكبيرة */
.hero-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 30px;
  max-width: 900px;
  margin: 0 auto;
}

.hero-text h1 {
  font-size: 3rem;
}

.profile-wrapper {
  width: 250px;
  height: 250px;
}

.profile-img {
  width: 250px;
  height: 250px;
}

.about-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

/* Projects Section - 2 Columns on desktop */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 25px;
  justify-items: center;
  max-width: 900px;
  margin: 0 auto;
}

.card {
  width: 100%;
  max-width: 400px;
}
/* Phone & Tablet */
@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr; /* عمود واحد */
  }
}



.card {
  width: 100%;
  max-width: 400px;
}

.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 500px;
  margin: 0 auto;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.socials-bottom {
  justify-content: center;
  margin-top: 30px;
}
.site-footer {
  text-align: center;
}
