/* ============================================
   Legacy of Tariq Mahmood Sahab
   Complete Design System
   ============================================ */

/* ─── 1. DESIGN TOKENS ─── */
:root {
  --navy-950: #060e1a;
  --navy-900: #0a1628;
  --navy-800: #0f2035;
  --navy-700: #152a45;
  --navy-600: #1a365d;
  --navy-500: #2a4f7f;
  --navy-400: #3b6fb5;
  --navy-300: #6b9dd4;

  --gold-700: #7a5f0a;
  --gold-600: #96750c;
  --gold-500: #b8930f;
  --gold-400: #c9a227;
  --gold-300: #d4b94e;
  --gold-200: #e6d48a;
  --gold-100: #f5edcc;

  --warm-50: #fdfcfa;
  --warm-100: #faf8f4;
  --warm-200: #f4f1eb;
  --warm-300: #e8e4db;
  --warm-400: #d4cec2;

  --ink-900: #1a1a2e;
  --ink-800: #2d2d44;
  --ink-700: #3d3d5c;
  --ink-600: #4a4a62;
  --ink-500: #6b6b8d;
  --ink-400: #8888a8;
  --ink-300: #ababc4;

  /* Semantic */
  --bg-page: var(--warm-50);
  --bg-section: var(--warm-100);
  --bg-section-alt: var(--warm-200);
  --bg-card: #ffffff;
  --bg-nav: rgba(253,252,250,0.85);
  --bg-nav-scroll: rgba(253,252,250,0.97);

  --text-primary: var(--ink-900);
  --text-secondary: var(--ink-600);
  --text-tertiary: var(--ink-500);
  --text-on-dark: #f0ece4;
  --text-on-dark-muted: rgba(240,236,228,0.7);

  --border-light: var(--warm-300);
  --border-medium: var(--warm-400);

  --accent: var(--gold-400);
  --accent-hover: var(--gold-300);
  --brand: var(--navy-600);
  --brand-dark: var(--navy-800);

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-arabic: 'Amiri', 'Traditional Arabic', serif;

  --text-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.75rem);
  --text-sm: clamp(0.8rem, 0.75rem + 0.25vw, 0.875rem);
  --text-base: clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
  --text-lg: clamp(1.05rem, 1rem + 0.25vw, 1.175rem);
  --text-xl: clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem);
  --text-2xl: clamp(1.35rem, 1.2rem + 0.75vw, 1.65rem);
  --text-3xl: clamp(1.6rem, 1.35rem + 1.25vw, 2.1rem);
  --text-4xl: clamp(1.9rem, 1.5rem + 2vw, 2.75rem);
  --text-5xl: clamp(2.25rem, 1.75rem + 2.5vw, 3.5rem);

  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.65;
  --leading-relaxed: 1.8;

  --tracking-wide: 0.05em;
  --tracking-wider: 0.1em;
  --tracking-widest: 0.2em;

  /* Spacing */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem; --space-20: 5rem; --space-24: 6rem;

  /* Layout */
  --max-width: 1140px;
  --nav-height: 72px;
  --content-padding: clamp(1.25rem, 4vw, 3.5rem);

  /* Borders & Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15,15,26,0.04);
  --shadow-sm: 0 2px 6px rgba(15,15,26,0.05), 0 1px 2px rgba(15,15,26,0.04);
  --shadow-md: 0 4px 14px rgba(15,15,26,0.06), 0 2px 4px rgba(15,15,26,0.04);
  --shadow-lg: 0 8px 30px rgba(15,15,26,0.08), 0 2px 8px rgba(15,15,26,0.04);
  --shadow-xl: 0 16px 50px rgba(15,15,26,0.1), 0 4px 14px rgba(15,15,26,0.05);
  --shadow-gold: 0 4px 20px rgba(201,162,39,0.15);
  --shadow-card-hover: 0 12px 40px rgba(15,15,26,0.1), 0 4px 12px rgba(15,15,26,0.05);

  /* Glass */
  --glass-bg: rgba(255,255,255,0.65);
  --glass-border: rgba(255,255,255,0.25);
  --glass-blur: 20px;

  /* Easing */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Islamic geometric pattern */
  --pattern-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath d='M40 8L48 32L72 40L48 48L40 72L32 48L8 40L32 32Z' fill='none' stroke='%23c9a227' stroke-width='0.5' opacity='0.06'/%3E%3C/svg%3E");
  --pattern-dots: radial-gradient(circle, rgba(201,162,39,0.08) 1px, transparent 1px);
}

/* ─── 2. RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 1rem);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; transition: color 0.25s ease; }
a:hover { color: var(--accent); }
strong { font-weight: 700; }

/* ─── 3. TYPOGRAPHY ─── */
.main-content h1 {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 400;
  line-height: var(--leading-tight);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.main-content h2 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--text-primary);
  margin-top: var(--space-16);
  margin-bottom: var(--space-8);
  position: relative;
  padding-bottom: var(--space-4);
}

.main-content h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
}

.main-content h3 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: var(--leading-snug);
  color: var(--text-primary);
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}

.main-content h4 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.main-content p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

.main-content ul, .main-content ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
  color: var(--text-secondary);
}

.main-content li {
  margin-bottom: var(--space-2);
  line-height: var(--leading-normal);
}

.main-content li::marker {
  color: var(--accent);
}

.arabic-text {
  font-family: var(--font-arabic);
  font-size: var(--text-2xl);
  line-height: 1.8;
  direction: rtl;
}

/* ─── HR / Section Dividers ─── */
.main-content > hr,
.main-content hr {
  border: none;
  height: 1px;
  background: var(--border-light);
  margin: var(--space-16) auto;
  max-width: 200px;
  position: relative;
}

.main-content > hr::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--accent);
  background: var(--bg-page);
}

/* ─── 4. SKIP LINK ─── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--brand);
  color: white;
  border-radius: var(--radius-sm);
  z-index: 10000;
  font-size: var(--text-sm);
}
.skip-link:focus {
  top: var(--space-4);
  color: white;
}

/* ─── 5. SCROLL INDICATOR ─── */
.scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--gold-300));
  z-index: 10001;
  transition: width 0.1s linear;
}

/* ─── 6. NAVIGATION ─── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: var(--bg-nav);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.site-header.scrolled {
  background: var(--bg-nav-scroll);
  border-bottom-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--content-padding);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--text-primary);
  transition: opacity 0.25s ease;
}
.nav-brand:hover { opacity: 0.8; color: var(--text-primary); }

.nav-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color 0.25s ease, background 0.25s ease;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.nav-link:hover {
  color: var(--text-primary);
  background: rgba(0,0,0,0.04);
}
.nav-link.active {
  color: var(--accent);
}

/* Nav toggle (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}
.nav-toggle:hover { background: rgba(0,0,0,0.04); }
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
  margin-left: var(--space-2);
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-gold);
}
.theme-toggle .moon-icon { display: none; }
.theme-toggle.dark-mode .sun-icon { display: none; }
.theme-toggle.dark-mode .moon-icon { display: inline; }

/* ─── 7. MAIN CONTENT ─── */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--nav-height) + var(--space-8)) var(--content-padding) var(--space-16);
}

/* ─── 8. HERO SECTION ─── */
.hero-section {
  margin: calc(-1 * var(--nav-height) - var(--space-8)) calc(-1 * var(--content-padding)) var(--space-16);
  padding: calc(var(--nav-height) + var(--space-16)) var(--content-padding) var(--space-20);
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 50%, var(--navy-800) 100%);
  position: relative;
  overflow: hidden;
  min-height: 85vh;
  display: flex;
  align-items: center;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--pattern-star);
  background-size: 80px 80px;
  opacity: 1;
  animation: patternDrift 60s linear infinite;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--bg-page), transparent);
  pointer-events: none;
}

@keyframes patternDrift {
  from { transform: translate(0, 0); }
  to { transform: translate(80px, 80px); }
}

.hero-content {
  display: flex;
  align-items: center;
  gap: clamp(var(--space-8), 5vw, var(--space-16));
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
}

.hero-image {
  flex-shrink: 0;
}

.hero-image img {
  width: clamp(200px, 25vw, 300px);
  height: clamp(200px, 25vw, 300px);
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid rgba(201,162,39,0.4);
  box-shadow: 0 0 0 8px rgba(201,162,39,0.1), 0 0 60px rgba(201,162,39,0.15), var(--shadow-xl);
  transition: transform 0.6s var(--ease-out-expo), box-shadow 0.6s ease;
}

.hero-image img:hover {
  transform: scale(1.03);
  box-shadow: 0 0 0 8px rgba(201,162,39,0.15), 0 0 80px rgba(201,162,39,0.2), var(--shadow-xl);
}

.hero-text {
  color: var(--text-on-dark);
}

.hero-text h1 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--text-on-dark-muted);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.hero-text h2 {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: 700;
  color: var(--text-on-dark);
  margin: 0 0 var(--space-4);
  padding-bottom: 0;
  letter-spacing: 0.02em;
  line-height: var(--leading-tight);
}

.hero-text h2::after { display: none; }

.hero-text .credentials {
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wider);
  color: var(--gold-300);
  margin-bottom: var(--space-6);
  font-weight: 600;
}

.hero-text .tagline {
  font-size: var(--text-lg);
  color: var(--text-on-dark-muted);
  margin-bottom: var(--space-2);
  font-weight: 300;
}

.hero-text strong {
  color: var(--text-on-dark);
  font-weight: 400;
}

/* ─── 9. QUOTE BLOCK ─── */
.quote-block {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
  padding: var(--space-10) var(--space-12);
  margin: var(--space-12) 0;
  background: var(--bg-section);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--accent);
  position: relative;
}

.quote-mark {
  font-family: var(--font-display);
  font-size: 5rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.3;
  flex-shrink: 0;
  margin-top: -0.2em;
}

.quote-text {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-2);
}

.quote-text.arabic-text {
  font-family: var(--font-arabic);
  font-style: normal;
  font-size: var(--text-2xl);
  color: var(--text-primary);
  direction: rtl;
  margin-bottom: var(--space-4);
}

.quote-source {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
}

/* ─── 10. TWO/THREE COLUMN ─── */
.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-8), 4vw, var(--space-12));
  margin-bottom: var(--space-8);
}

.three-column {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

/* ─── 11. SECTION CONTAINERS ─── */
.section-container {
  padding: var(--space-12) var(--space-10);
  margin: var(--space-8) calc(-1 * var(--content-padding));
  padding-left: var(--content-padding);
  padding-right: var(--content-padding);
}

.section-alt {
  background: var(--bg-section);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

/* ─── 12. STATS SECTION ─── */
.stats-section {
  margin: var(--space-12) calc(-1 * var(--content-padding));
  padding: var(--space-16) var(--content-padding);
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-700) 50%, var(--navy-900) 100%);
  position: relative;
  overflow: hidden;
}

.stats-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--pattern-star);
  background-size: 80px 80px;
  opacity: 1;
}

.stats-section h2 {
  color: var(--text-on-dark);
  text-align: center;
  position: relative;
  z-index: 2;
  margin-top: 0;
}

.stats-section h2::after {
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--gold-400), transparent);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-6);
  position: relative;
  z-index: 2;
}

.stat-card {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.4s var(--ease-out-expo), background 0.4s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  background: rgba(255,255,255,0.1);
}

.stat-number {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--gold-300);
  line-height: 1;
  margin-bottom: var(--space-3);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-on-dark-muted);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

/* ─── 13. CAREER TIMELINE ─── */
.timeline {
  position: relative;
  padding-left: var(--space-10);
  margin-bottom: var(--space-8);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border-light));
  border-radius: 2px;
}

.career-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin-bottom: var(--space-6);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s ease, border-color 0.4s ease;
}

.timeline .career-card::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-10) + 6px);
  top: var(--space-10);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-page);
  box-shadow: 0 0 0 2px var(--accent);
  z-index: 2;
}

.career-card:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--accent);
}

.career-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.career-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.career-company {
  font-size: var(--text-base);
  color: var(--accent);
  font-weight: 600;
  margin: var(--space-1) 0 0;
}

.career-duration {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  font-weight: 600;
  white-space: nowrap;
  padding: var(--space-1) var(--space-3);
  background: var(--bg-section);
  border-radius: var(--radius-full);
  letter-spacing: var(--tracking-wide);
}

.career-description {
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.career-card ul {
  margin-bottom: 0;
}

/* Career cards outside timeline (in two-column) */
.two-column > .career-card {
  margin-bottom: 0;
}

.two-column > .career-card::before {
  display: none;
}

/* ─── 14. VISUAL TIMELINE (40 Years) ─── */
.journey-timeline {
  margin: var(--space-8) 0 var(--space-12);
  padding: var(--space-8);
  background: var(--bg-section);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.timeline-year {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.timeline-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--border-light), var(--accent));
  border-radius: 2px;
}

.timeline-steps {
  display: flex;
  gap: var(--space-3);
  align-items: stretch;
  min-width: max-content;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  position: relative;
  transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s ease;
  min-width: 100px;
  text-align: center;
}

.timeline-step:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.timeline-step::after {
  content: '';
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid var(--accent);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.timeline-step:last-child::after { display: none; }

.step-marker {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,162,39,0.2);
}

.step-company {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.step-duration {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: 600;
}

.timeline-parallel {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding: var(--space-4) var(--space-5);
  background: rgba(201,162,39,0.06);
  border-radius: var(--radius-md);
  border: 1px dashed var(--accent);
}

.parallel-marker {
  font-size: var(--text-lg);
}

.parallel-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
}

/* ─── 15. CERTIFICATION GRID ─── */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.cert-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-4);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.cert-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
}

.cert-badge:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.cert-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--brand);
}

.cert-org {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--accent);
}

.cert-year {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

/* ─── 16. FEATURE CARDS (Frameworks) ─── */
.feature-card {
  padding: var(--space-8);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s ease;
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: var(--space-4);
  display: block;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin: 0 0 var(--space-2);
}

.feature-card p {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin: 0;
  line-height: var(--leading-normal);
}

/* ─── 17. ACCORDION / DETAILS ─── */
.accordion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

details {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

details[open] {
  box-shadow: var(--shadow-md);
}

details summary {
  padding: var(--space-5) var(--space-6);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  transition: background 0.2s ease;
}

details summary:hover {
  background: var(--bg-section);
}

details summary::-webkit-details-marker { display: none; }
details summary::marker { display: none; }

details summary::after {
  content: '+';
  font-size: var(--text-xl);
  font-weight: 300;
  color: var(--accent);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: var(--space-4);
}

details[open] summary::after {
  transform: rotate(45deg);
}

details > ul, details > p, details > div {
  padding: 0 var(--space-6) var(--space-6);
  animation: slideDown 0.3s var(--ease-out-expo);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

details li {
  padding: var(--space-1) 0;
  font-size: var(--text-sm);
}

/* ─── 18. DOCUMENTS GRID ─── */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.link-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  text-decoration: none;
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
  transition: all 0.3s var(--ease-out-expo);
}

.link-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  color: var(--text-primary);
}

.link-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.link-content h4 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0 0 var(--space-1);
}

.link-content p {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin: 0;
}

/* ─── 19. TABLES ─── */
.main-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.main-content th {
  background: var(--bg-section-alt);
  font-weight: 700;
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-light);
}

.main-content td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.main-content tr:last-child td { border-bottom: none; }
.main-content tr:hover td { background: var(--bg-section); }

/* ─── 20. CODE BLOCKS ─── */
.main-content pre {
  background: var(--navy-900);
  color: var(--text-on-dark);
  padding: var(--space-6);
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: var(--text-sm);
  line-height: 1.6;
  margin-bottom: var(--space-6);
  border: 1px solid rgba(255,255,255,0.06);
}

.main-content code {
  font-family: var(--font-body);
  font-size: 0.9em;
}

.main-content :not(pre) > code {
  background: var(--bg-section-alt);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.875em;
}

/* ─── 21. FOOTER ─── */
.site-footer {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 100%);
  color: var(--text-on-dark);
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--pattern-star);
  background-size: 80px 80px;
  opacity: 1;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-16) var(--content-padding);
  text-align: center;
  position: relative;
  z-index: 2;
}

.footer-prayer {
  margin-bottom: var(--space-10);
}

.footer-prayer .arabic-text {
  font-size: var(--text-2xl);
  color: var(--gold-300);
  margin-bottom: var(--space-3);
}

.footer-prayer .translation {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text-on-dark-muted);
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.footer-prayer .citation {
  font-size: var(--text-sm);
  color: var(--text-on-dark-muted);
  opacity: 0.6;
}

.footer-meta {
  margin-bottom: var(--space-8);
}

.footer-meta p {
  color: var(--text-on-dark);
  font-size: var(--text-base);
  margin-bottom: var(--space-1);
}

.footer-subtitle {
  font-size: var(--text-sm);
  color: var(--text-on-dark-muted);
  font-style: italic;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-on-dark-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  transition: color 0.25s ease;
  padding: var(--space-2);
}
.footer-links a:hover { color: var(--gold-300); }

.footer-links .divider {
  color: rgba(255,255,255,0.15);
}

.footer-copyright {
  font-size: var(--text-xs);
  color: var(--text-on-dark-muted);
  opacity: 0.5;
}

/* ─── 22. BACK TO TOP ─── */
.back-to-top {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--brand);
  color: white;
  border: none;
  cursor: pointer;
  font-size: var(--text-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all 0.4s var(--ease-out-expo);
  z-index: 100;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* ─── 23. SCROLL ANIMATIONS ─── */
.fade-in-element {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}

.fade-in-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── 24. CENTERED CLOSING SECTION ─── */
.main-content > div[align="center"] h2,
.main-content > div[align="center"] {
  text-align: center;
}

.main-content > div[align="center"] h2::after {
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.main-content > div[align="center"] p {
  color: var(--text-secondary);
}

.main-content > div[align="center"] strong {
  color: var(--text-primary);
}

.main-content > div[align="center"] em {
  color: var(--text-tertiary);
}

.main-content > div[align="center"] h3 {
  margin-top: var(--space-8);
}

/* ─── 25. DARK MODE ─── */
[data-theme="dark"] {
  --bg-page: #0a1220;
  --bg-section: #0f1a2e;
  --bg-section-alt: #111d32;
  --bg-card: rgba(255,255,255,0.04);
  --bg-nav: rgba(10,18,32,0.85);
  --bg-nav-scroll: rgba(10,18,32,0.97);

  --text-primary: #e0dcd4;
  --text-secondary: #a8a29e;
  --text-tertiary: #78716c;
  --text-on-dark: #e0dcd4;
  --text-on-dark-muted: rgba(224,220,212,0.6);

  --border-light: rgba(255,255,255,0.08);
  --border-medium: rgba(255,255,255,0.12);

  --accent: #d4a439;
  --accent-hover: #e6b84d;
  --brand: #6b9dd4;
  --brand-dark: #3b6fb5;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.35);
  --shadow-xl: 0 16px 50px rgba(0,0,0,0.4);
  --shadow-card-hover: 0 12px 40px rgba(0,0,0,0.4);
  --shadow-gold: 0 4px 20px rgba(212,164,57,0.2);

  --glass-bg: rgba(15,26,46,0.65);
  --glass-border: rgba(255,255,255,0.05);

  --pattern-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath d='M40 8L48 32L72 40L48 48L40 72L32 48L8 40L32 32Z' fill='none' stroke='%23d4a439' stroke-width='0.5' opacity='0.04'/%3E%3C/svg%3E");
}

[data-theme="dark"] .hero-section {
  background: linear-gradient(135deg, #050c16 0%, #0a1628 50%, #0f1a2e 100%);
}

[data-theme="dark"] .stats-section {
  background: linear-gradient(135deg, #050c16 0%, #0a1628 50%, #060e1a 100%);
}

[data-theme="dark"] .site-footer {
  background: linear-gradient(135deg, #050c16 0%, #060e1a 100%);
}

[data-theme="dark"] .hero-image img {
  border-color: rgba(212,164,57,0.3);
  box-shadow: 0 0 0 8px rgba(212,164,57,0.08), 0 0 60px rgba(212,164,57,0.1), var(--shadow-xl);
}

[data-theme="dark"] .main-content > hr::before {
  background: var(--bg-page);
}

[data-theme="dark"] .cert-name {
  color: var(--brand);
}

[data-theme="dark"] .nav-brand { color: var(--text-primary); }
[data-theme="dark"] .nav-brand:hover { color: var(--text-primary); }

[data-theme="dark"] .timeline .career-card::before {
  border-color: var(--bg-page);
}

[data-theme="dark"] .main-content pre {
  background: #060e1a;
  border-color: rgba(255,255,255,0.04);
}

[data-theme="dark"] .main-content :not(pre) > code {
  background: rgba(255,255,255,0.06);
}

/* ─── 26. RESPONSIVE ─── */
@media (max-width: 900px) {
  .two-column { grid-template-columns: 1fr; }
  .three-column { grid-template-columns: 1fr 1fr; }

  .hero-content {
    flex-direction: column;
    text-align: center;
  }

  .hero-text h2 { font-size: var(--text-4xl); }

  .hero-section {
    min-height: auto;
    padding-top: calc(var(--nav-height) + var(--space-12));
    padding-bottom: var(--space-16);
  }

  .stat-card { padding: var(--space-6) var(--space-3); }

  .timeline { padding-left: var(--space-8); }
  .timeline .career-card::before {
    left: calc(-1 * var(--space-8) + 6px);
  }

  .section-container {
    padding: var(--space-8) var(--content-padding);
  }

  .career-header { flex-direction: column; gap: var(--space-2); }
}

@media (max-width: 640px) {
  :root {
    --nav-height: 60px;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-nav-scroll);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    flex-direction: column;
    padding: var(--space-4);
    gap: var(--space-1);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-110%);
    opacity: 0;
    transition: transform 0.4s var(--ease-out-expo), opacity 0.3s ease;
    z-index: 999;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
  }

  .nav-toggle { display: flex; }

  .nav-link {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
  }

  .theme-toggle { margin: var(--space-2) auto 0; }

  .three-column { grid-template-columns: 1fr; }

  .hero-image img {
    width: 180px;
    height: 180px;
  }

  .hero-section {
    padding-top: calc(var(--nav-height) + var(--space-8));
    padding-bottom: var(--space-12);
  }

  .quote-block {
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-6);
  }

  .quote-mark {
    font-size: 3rem;
    margin-top: 0;
  }

  .cert-grid {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: var(--space-3);
  }

  .cert-badge { padding: var(--space-4) var(--space-3); }

  .stats-section {
    margin-left: calc(-1 * var(--content-padding));
    margin-right: calc(-1 * var(--content-padding));
    padding: var(--space-12) var(--content-padding);
  }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }

  .timeline { padding-left: var(--space-6); }
  .timeline::before { left: 8px; }
  .timeline .career-card::before {
    left: calc(-1 * var(--space-6) + 2px);
    width: 12px;
    height: 12px;
  }

  .career-card { padding: var(--space-5); }

  .accordion-grid { grid-template-columns: 1fr; }
  .docs-grid { grid-template-columns: 1fr; }

  .footer-content { padding: var(--space-12) var(--content-padding); }

  .back-to-top { right: var(--space-4); bottom: var(--space-4); }

  .journey-timeline { padding: var(--space-5); }
  .timeline-steps { gap: var(--space-2); }
  .timeline-step { padding: var(--space-3) var(--space-4); min-width: 80px; }
}

/* ─── 27. REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fade-in-element {
    opacity: 1;
    transform: none;
  }

  .hero-section::before {
    animation: none;
  }
}

/* ─── 28. PRINT ─── */
@media print {
  .site-header,
  .scroll-indicator,
  .back-to-top,
  .theme-toggle,
  .nav-toggle,
  .footer-links { display: none !important; }

  .main-content {
    padding-top: 0;
    max-width: 100%;
  }

  .hero-section {
    background: none !important;
    color: black !important;
    min-height: auto;
    padding: 2rem 0;
    margin: 0;
  }

  .hero-text h1, .hero-text h2,
  .hero-text .credentials, .hero-text .tagline,
  .hero-text strong {
    color: black !important;
  }

  .stats-section {
    background: none !important;
    margin: 0;
    padding: 1rem 0;
  }

  .stat-number, .stat-label,
  .stats-section h2 { color: black !important; }

  .career-card, .cert-badge, .feature-card, .link-card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  .site-footer {
    background: none !important;
    color: black !important;
  }

  .footer-prayer .arabic-text,
  .footer-prayer .translation,
  .footer-content p,
  .footer-copyright { color: black !important; }

  a { color: black !important; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}

/* ─── 29. ACCESSIBILITY ─── */
.keyboard-navigation *:focus {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

body:not(.keyboard-navigation) *:focus {
  outline: none;
}

.theme-transition * {
  transition-duration: 0.3s !important;
}
