/* ═══════════════════════════════════════════════════════════════
   shehab.cloud — Shared Design System
   3D Storytelling Dark Navy Theme
   Bilingual: LTR (English) + RTL (Arabic)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ─── */
:root {
  --navy: #0A0F1C;
  --navy-mid: #111827;
  --navy-light: #1F2937;
  --blue: #2563EB;
  --blue-light: #3B82F6;
  --blue-glow: #60A5FA;
  --orange: #F97316;
  --orange-glow: #FB923C;
  --cyan: #06B6D4;
  --teal: #14B8A6;
  --green: #22C55E;
  --gold: #FBBF24;
  --red: #EF4444;
  --white: #F8FAFC;
  --text: #E2E8F0;
  --text-muted: #94A3B8;
  --glass-bg: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.08);
  --glass-hover: rgba(255,255,255,0.08);
  --elevation-1: 0 4px 16px rgba(0,0,0,0.3);
  --elevation-2: 0 8px 32px rgba(0,0,0,0.4);
  --elevation-3: 0 16px 48px rgba(0,0,0,0.5);
  --radius: 16px;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  /* Accent — overridden per article */
  --accent: var(--orange);
  --accent-glow: var(--orange-glow);
}

/* Arabic pages override heading font */
[dir="rtl"] {
  --font-heading: 'Cairo', 'Inter', sans-serif;
}

/* ─── Reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--navy);
  color: var(--text);
  line-height: 1.85;
  font-size: 18px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  perspective: 1px;
}

a { color: inherit; text-decoration: none; }

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .parallax-bg { transform: none !important; }
}

/* ─── Scroll Reveal ─── */
.reveal {
  opacity: 0;
  transform: translateY(32px) translateZ(-20px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0) translateZ(0);
}

/* ─── Progress Bar ─── */
.progress-bar {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--accent), var(--cyan));
  z-index: 300;
  border-radius: 0 2px 2px 0;
}

/* ─── Chapter Progress Dots ─── */
.chapter-nav {
  position: fixed;
  inset-inline-end: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chapter-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  transition: all 0.3s ease-out;
}
.chapter-dot.active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(249,115,22,0.5);
  transform: scale(1.3);
}
.chapter-dot:hover { background: rgba(255,255,255,0.4); }

/* ─── Floating Nav ─── */
nav {
  position: fixed;
  top: 16px; left: 16px; right: 16px;
  background: rgba(10, 15, 28, 0.8);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 250;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.nav-brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-decoration: none;
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color 0.2s ease-out;
  cursor: pointer;
}
.nav-links a:hover, .nav-links a:focus-visible { color: #fff; }
.nav-links a.active { color: var(--accent); }

/* Language Switcher */
.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted) !important;
  font-family: var(--font-heading) !important;
  font-weight: 600 !important;
  font-size: 11px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  transition: all 0.2s ease-out;
  cursor: pointer;
  text-decoration: none;
}
.lang-switch:hover {
  background: rgba(255,255,255,0.12);
  color: #fff !important;
  border-color: rgba(255,255,255,0.2);
}

/* ─── Hero — Cinematic Full Screen ─── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse 120% 80% at 50% 40%, var(--hero-bg, #1a2744) 0%, var(--navy) 70%);
}
.hero-bg-orbs {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: orbFloat 20s ease-in-out infinite;
}
.orb-1 { width: 500px; height: 500px; background: var(--blue); top: -10%; left: -5%; animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: var(--accent); bottom: -15%; right: -10%; animation-delay: -7s; }
.orb-3 { width: 300px; height: 300px; background: var(--cyan); top: 30%; right: 10%; animation-delay: -14s; opacity: 0.15; }

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 24px;
}
.series-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(249,115,22,0.1);
  border: 1px solid rgba(249,115,22,0.25);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 8px 20px;
  border-radius: 24px;
  margin-bottom: 36px;
}
.series-badge svg { width: 14px; height: 14px; }
.hero h1 {
  font-family: var(--font-heading);
  font-size: 60px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -1.5px;
}
[dir="rtl"] .hero h1 { letter-spacing: 0; line-height: 1.25; }
.hero h1 .accent { color: var(--accent); }
.hero h1 .glow { text-shadow: 0 0 40px rgba(249,115,22,0.3); }
.hero-subtitle {
  font-size: 20px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 600px;
  margin-inline: auto;
}
[dir="rtl"] .hero-subtitle { line-height: 1.9; }
.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}
.hero-meta-item { display: flex; align-items: center; gap: 6px; }
.hero-meta-item svg { width: 14px; height: 14px; opacity: 0.5; }
.meta-divider { width: 1px; height: 14px; background: rgba(255,255,255,0.12); }

.scroll-cue {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.3);
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: scrollBounce 2s ease-in-out infinite;
}
.scroll-cue svg { width: 20px; height: 20px; }
@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ─── Chapter Sections ─── */
.chapter {
  position: relative;
  padding: 100px 20px;
  min-height: 50vh;
}
.chapter-inner {
  max-width: 780px;
  margin: 0 auto;
}

.chapter-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.chapter-title {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 28px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
[dir="rtl"] .chapter-title { letter-spacing: 0; line-height: 1.4; }

/* ─── 3D Glass Cards ─── */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 44px 48px;
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: var(--elevation-2);
  transition: transform 0.35s ease-out, box-shadow 0.35s ease-out;
  
}
.glass-card:hover {
  transform: translateY(-4px) rotateX(1deg);
  box-shadow: var(--elevation-3);
}
.glass-card p {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 22px;
  line-height: 1.9;
  max-width: 68ch;
  font-weight: 400;
  letter-spacing: 0.01em;
}
[dir="rtl"] .glass-card p { letter-spacing: 0; line-height: 2; }
.glass-card p:last-child { margin-bottom: 0; }
.glass-card strong { color: #fff; font-weight: 600; }

.highlight-label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  color: var(--accent);
  letter-spacing: 0.5px;
}

/* ─── Stats Strip ─── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 40px 0;
}
.stat-box {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 24px 16px;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.25s ease-out, box-shadow 0.25s ease-out, border-color 0.25s ease-out;
  cursor: default;
  
}
.stat-box:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px rgba(37,99,235,0.15);
  border-color: rgba(59,130,246,0.3);
}
.stat-number {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--blue-light), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ─── Chart Containers ─── */
.chart-container {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 28px 24px 18px;
  margin: 32px 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--elevation-1);
  transition: box-shadow 0.25s ease-out, transform 0.25s ease-out;
  
}
.chart-container:hover {
  box-shadow: var(--elevation-2);
  transform: translateY(-2px);
}
.chart-container canvas { max-height: 320px; }
.chart-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
  text-align: center;
}
.chart-subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 10px;
}
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 32px 0;
}
.charts-grid .chart-container { margin: 0; }

/* ─── Callout ─── */
.callout {
  background: rgba(239,68,68,0.06);
  border-inline-start: 4px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px 28px;
  margin: 28px 0;
  font-size: 17px;
  color: var(--text);
  line-height: 1.8;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
[dir="rtl"] .callout { border-radius: var(--radius) 0 0 var(--radius); }
.callout svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--red); margin-top: 2px; }

/* ─── Insight Box ─── */
.insight-box {
  background: rgba(37,99,235,0.06);
  border-inline-start: 4px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px 28px;
  margin: 28px 0;
  font-size: 17px;
  color: var(--text);
  line-height: 1.8;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
[dir="rtl"] .insight-box { border-radius: var(--radius) 0 0 var(--radius); }
.insight-box svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--blue-light); margin-top: 2px; }

/* ─── Divider ─── */
.chapter-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  margin: 0;
}

/* ─── Series CTA ─── */
.series-cta {
  background: linear-gradient(135deg, rgba(249,115,22,0.1), rgba(37,99,235,0.1));
  border: 1px solid rgba(249,115,22,0.2);
  border-radius: var(--radius);
  padding: 36px;
  margin-top: 40px;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.series-cta p { color: var(--text) !important; font-size: 18px !important; margin-bottom: 0 !important; line-height: 1.8 !important; }
.series-cta strong { color: #fff; }

/* ─── Sources ─── */
.sources-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sources-heading {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sources-heading svg { width: 18px; height: 18px; color: var(--text-muted); }
.sources-list { list-style: none; padding: 0; }
.sources-list li {
  font-size: 14px;
  color: var(--text-muted);
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  line-height: 1.6;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.sources-list li::before {
  content: '';
  width: 4px; height: 4px;
  background: var(--blue-light);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 8px;
}
.sources-list li:last-child { border-bottom: none; }
.sources-list a {
  color: var(--blue-glow);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease-out;
  cursor: pointer;
}
.sources-list a:hover { color: #fff; text-decoration: underline; }
.sources-list a:focus-visible { outline: 2px solid var(--blue-light); outline-offset: 2px; border-radius: 2px; }
.source-pub { font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,0.25); }

/* ─── Footer ─── */
footer {
  background: rgba(0,0,0,0.3);
  border-top: 1px solid rgba(255,255,255,0.04);
  color: var(--text-muted);
  text-align: center;
  padding: 32px 40px;
  font-size: 14px;
  font-family: var(--font-mono);
}
footer strong { color: var(--text); }
footer a { color: var(--blue-glow); text-decoration: none; }
footer a:hover { color: #fff; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .hero h1 { font-size: 48px; }
  body { font-size: 17px; }
}
@media (max-width: 768px) {
  nav { top: 8px; left: 8px; right: 8px; padding: 0 20px; height: 50px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 11px; }
  .hero h1 { font-size: 36px; }
  .hero-subtitle { font-size: 17px; }
  .chapter { padding: 70px 16px; }
  .glass-card { padding: 28px 24px; }
  .glass-card p { font-size: 17px; line-height: 1.85; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .chapter-title { font-size: 28px; }
  .chapter-nav { display: none; }
  body { font-size: 16px; }
}
@media (max-width: 480px) {
  nav { padding: 0 14px; border-radius: 12px; }
  .hero h1 { font-size: 28px; letter-spacing: -0.5px; }
  [dir="rtl"] .hero h1 { letter-spacing: 0; }
  .glass-card { padding: 22px 18px; }
  .glass-card p { font-size: 16px; }
  .stats-strip { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-box { padding: 18px 10px; }
  .stat-number { font-size: 22px; }
  .chapter-title { font-size: 24px; }
}

/* ═══════════════════════════════════════
   Landing Page Specific Styles
   ═══════════════════════════════════════ */

/* Section container */
.section {
  padding: 100px 20px;
  position: relative;
}
.section-inner {
  max-width: 900px;
  margin: 0 auto;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 28px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
[dir="rtl"] .section-title { letter-spacing: 0; line-height: 1.4; }

/* Landing hero */
.landing-hero .hero-content { max-width: 700px; }
.landing-hero h1 { font-size: 68px; }
.landing-hero .hero-tagline {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

/* About section */
.about-text {
  font-size: 18px;
  color: var(--text);
  line-height: 1.9;
  max-width: 68ch;
}
[dir="rtl"] .about-text { line-height: 2.1; }

/* Articles Grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.article-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 36px;
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: var(--elevation-1);
  transition: transform 0.35s ease-out, box-shadow 0.35s ease-out, border-color 0.35s ease-out;
  
  display: flex;
  flex-direction: column;
  text-decoration: none;
}
.article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--elevation-3);
  border-color: var(--accent);
}
.article-card .card-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.article-card h3 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.3;
}
.article-card .card-excerpt {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 20px;
}
.article-card .card-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  display: flex;
  gap: 16px;
}
.article-card .read-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 16px;
  transition: gap 0.2s ease-out;
}
.article-card:hover .read-link { gap: 12px; }
.article-card .read-link svg { width: 16px; height: 16px; }

/* Contact section */
.contact-links {
  display: flex;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 12px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.25s ease-out;
  letter-spacing: 0.5px;
}
.contact-btn.primary {
  background: var(--blue);
  color: #fff;
  border: 1px solid var(--blue);
}
.contact-btn.primary:hover { background: var(--blue-light); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37,99,235,0.3); }
.contact-btn.secondary {
  background: var(--glass-bg);
  color: var(--text);
  border: 1px solid var(--glass-border);
}
.contact-btn.secondary:hover { background: var(--glass-hover); border-color: rgba(255,255,255,0.15); transform: translateY(-2px); }
.contact-btn svg { width: 18px; height: 18px; }

/* Back to home (article pages) */
.back-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color 0.2s;
}
.back-home:hover { color: #fff; }
.back-home svg { width: 14px; height: 14px; }
[dir="rtl"] .back-home svg { transform: scaleX(-1); }

@media (max-width: 768px) {
  .landing-hero h1 { font-size: 42px; }
  .articles-grid { grid-template-columns: 1fr; }
  .contact-links { flex-direction: column; }
}
@media (max-width: 480px) {
  .landing-hero h1 { font-size: 32px; }
}

/* Fix: Ensure links and buttons inside glass cards are clickable */
.glass-card a,
.glass-card button,
.article-card a {
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

.hero-bg-orbs {
    pointer-events: none;
}
