:root {
  --primary: #1e40af;
  --primary-dark: #1e3a8a;
  --primary-soft: #eff6ff;
  --accent: #0ea5e9;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --white: #fff;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(30, 64, 175, 0.12);
  --radius: 12px;
  --max: 960px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Tajawal', sans-serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ── Header ── */
.site-head {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 8px;
}
.brand-text strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.3;
}
.brand-text span {
  font-size: 0.78rem;
  color: var(--muted);
}
.nav { display: flex; flex-wrap: wrap; gap: 6px; }
.nav a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover {
  background: var(--primary-soft);
  color: var(--primary);
  text-decoration: none;
}

/* ── Hero ── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 56px 0 48px;
  background: linear-gradient(160deg, #1e3a8a 0%, #1e40af 45%, #2563eb 100%);
  color: var(--white);
  text-align: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(14, 165, 233, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 40%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #bfdbfe;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.tag::before {
  content: "";
  width: 7px;
  height: 7px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.hero h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 16px;
  max-width: 620px;
  margin-inline: auto;
}
.hero .lead {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.8;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
}
.stat-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  padding: 16px 10px;
  backdrop-filter: blur(4px);
}
.stat-card strong {
  display: block;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.2;
}
.stat-card span {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
  display: block;
}

/* ── Section common ── */
.section-head {
  text-align: center;
  margin-bottom: 28px;
}
.section-head h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.section-head p {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 480px;
  margin: 0 auto;
}
.section-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}

section { padding: 48px 0; }
section:nth-child(even) { background: var(--white); }

/* ── Semesters ── */
.semesters { padding: 48px 0; }
.term-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  max-width: 520px;
  margin: 0 auto;
}
.term-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px 16px;
  cursor: pointer;
  user-select: none;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.term-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #93c5fd;
}
.term-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.term-img {
  background: var(--primary-soft);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
  overflow: hidden;
}
.term-img img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  display: block;
}
.term-card span {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.term-card small {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}
.term-hint {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 20px;
}

/* ── Services ── */
.services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.service {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
}
section:nth-child(even) .service { background: var(--bg); }
.service:hover {
  box-shadow: var(--shadow-md);
  border-color: #bfdbfe;
}
.service-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.service h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.service p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ── Grades ── */
.grades-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
section:nth-child(even) .grades-wrap { background: var(--bg); }
.grades { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.grade {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.grade:hover {
  border-color: #93c5fd;
  background: #dbeafe;
}

/* ── SEO / About ── */
.seo-content {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
}
.seo h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin: 24px 0 10px;
}
.seo h3:first-child { margin-top: 0; }
.seo-intro {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.85;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.seo p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.8;
}
.note {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(90deg, var(--primary-soft) 0%, #f0f9ff 100%);
  border-right: 4px solid var(--primary);
  padding: 14px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 20px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.seo-disclaimer {
  font-size: 0.82rem !important;
  color: var(--muted) !important;
  margin-top: 24px !important;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  line-height: 1.75 !important;
}

.keywords-block {
  margin-top: 28px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
}
.keywords-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 14px;
  text-align: center;
}
.keywords { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.kw {
  font-size: 0.78rem;
  padding: 5px 12px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* ── Roadmap ── */
.roadmap {
  list-style: none;
  display: grid;
  gap: 10px;
}
.roadmap li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
section:nth-child(even) .roadmap li { background: var(--bg); }
.status {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  min-width: 52px;
  text-align: center;
}
.status.done { background: #dcfce7; color: #166534; }
.status.work { background: #fef3c7; color: #b45309; }
.status.soon { background: #f1f5f9; color: var(--muted); }
.roadmap strong {
  display: block;
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 2px;
}
.roadmap li > div { font-size: 0.82rem; color: var(--muted); }

/* ── Footer ── */
.site-foot {
  background: var(--text);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 32px 20px;
  font-size: 0.82rem;
}
.site-foot strong { color: var(--white); font-weight: 600; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .services { grid-template-columns: repeat(2, 1fr); }
  .nav { display: none; }
  .hero { padding: 40px 0 36px; }
}

@media (max-width: 520px) {
  .services { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; max-width: 200px; }
  .term-grid { grid-template-columns: 1fr; max-width: 240px; }
  section { padding: 36px 0; }
}
