:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #1c2733;
  --muted: #5d6b7a;
  --primary: #0f4c81;
  --primary-soft: #e6eef6;
  --whatsapp: #25d366;
  --whatsapp-dark: #1ebe5b;
  --border: #e3e8ed;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(15, 40, 70, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f151c;
    --surface: #18212b;
    --text: #eef2f6;
    --muted: #9aa8b6;
    --primary: #6fb1ea;
    --primary-soft: #1f2f40;
    --border: #263341;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- الرأس ---------- */
.hero {
  text-align: center;
  padding: 40px 20px 32px;
  background: linear-gradient(135deg, #0f4c81, #1b6fb5);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.avatar {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 3px solid rgba(255, 255, 255, 0.7);
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  font-weight: 800;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero h1 {
  font-size: clamp(1.7rem, 5vw, 2.3rem);
  font-weight: 800;
  line-height: 1.4;
}

.job-title {
  margin-top: 6px;
  font-size: 1.05rem;
  opacity: 0.92;
}

/* ---------- البطاقات ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
  padding-inline-start: 12px;
  border-inline-start: 5px solid var(--primary);
  line-height: 1.4;
}

.lead {
  font-size: 1.1rem;
}

/* ---------- المهارات ---------- */
.skills {
  list-style: none;
  display: grid;
  gap: 18px;
}

.skill-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  margin-bottom: 6px;
}

.skill-level {
  font-size: 0.85rem;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 2px 12px;
  border-radius: 999px;
}

.bar {
  height: 10px;
  background: var(--primary-soft);
  border-radius: 999px;
  overflow: hidden;
}

.fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(270deg, var(--primary), #3b94d9);
  border-radius: 999px;
  transition: width 1.2s ease;
}

/* ---------- أقسام فارغة ---------- */
.empty {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

/* ---------- التعليم ---------- */
.edu-list {
  list-style: none;
  display: grid;
  gap: 14px;
}

.edu-item {
  background: var(--primary-soft);
  border-radius: 12px;
  padding: 14px 18px;
  border-inline-start: 4px solid var(--primary);
}

.edu-item h3 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.5;
}

.edu-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- التواصل ---------- */
.contact {
  text-align: center;
}

.contact h2 {
  display: inline-block;
}

.contact-text {
  color: var(--muted);
}

.phone {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin: 4px 0 20px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background: var(--whatsapp);
  color: #fff;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 800;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(37, 211, 102, 0.45);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  animation: pulse 2.4s infinite;
}

.btn-whatsapp:hover,
.btn-whatsapp:focus-visible {
  background: var(--whatsapp-dark);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.55);
  outline: none;
}

.btn-copy {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 24px;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-copy:hover,
.btn-copy:focus-visible {
  background: var(--primary);
  color: var(--surface);
  outline: none;
}

.copy-status {
  min-height: 1.6em;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

@keyframes pulse {
  0%   { box-shadow: 0 8px 22px rgba(37, 211, 102, 0.45), 0 0 0 0 rgba(37, 211, 102, 0.5); }
  70%  { box-shadow: 0 8px 22px rgba(37, 211, 102, 0.45), 0 0 0 16px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 8px 22px rgba(37, 211, 102, 0.45), 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ---------- التذييل ---------- */
.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 8px 16px 32px;
}

/* ---------- حركة الظهور ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ---------- الهاتف ---------- */
@media (max-width: 520px) {
  body { font-size: 16px; }
  .card { padding: 20px 16px; }
  .btn-whatsapp { width: 100%; justify-content: center; }
  .btn-copy { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .fill { transition: none; }
  .btn-whatsapp { animation: none; }
}