/* ==========================================================================
   المدار القابضة — Al-Madar Holding
   Main Stylesheet — Corporate Premium RTL
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  /* Brand Colors */
  --color-navy: #0A1F44;
  --color-navy-900: #06122B;
  --color-navy-700: #142A55;
  --color-electric: #1E63D8;
  --color-electric-600: #1955BC;
  --color-electric-light: #E8F0FF;
  --color-gold: #C9A24A;
  --color-gold-light: #E8D49A;

  /* Neutrals */
  --color-white: #FFFFFF;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F4F6FA;
  --color-bg-soft: #FAFBFD;
  --color-border: #E5E9F2;
  --color-border-strong: #CDD4E0;

  /* Text */
  --color-text: #1A2238;
  --color-text-muted: #5A6478;
  --color-text-light: #8892A6;
  --color-text-on-dark: #FFFFFF;
  --color-text-on-dark-muted: #B9C2D6;

  /* States */
  --color-success: #16A34A;
  --color-warning: #D97706;
  --color-danger: #DC2626;

  /* Typography */
  --font-arabic: 'IBM Plex Sans Arabic', 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'IBM Plex Sans Arabic', 'Cairo', system-ui, sans-serif;

  /* Sizing */
  --container: 1280px;
  --container-narrow: 1080px;
  --header-h: 84px;
  --header-h-scrolled: 68px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* Shadows */
  --sh-xs: 0 1px 2px rgba(10, 31, 68, 0.06);
  --sh-sm: 0 2px 8px rgba(10, 31, 68, 0.06);
  --sh-md: 0 8px 24px rgba(10, 31, 68, 0.08);
  --sh-lg: 0 18px 48px rgba(10, 31, 68, 0.12);
  --sh-xl: 0 30px 80px rgba(10, 31, 68, 0.18);
  --sh-glow: 0 8px 32px rgba(30, 99, 216, 0.28);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 180ms;
  --t-med: 320ms;
  --t-slow: 600ms;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-arabic);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
}

img, video, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol { list-style: none; }

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::selection {
  background: var(--color-electric);
  color: #fff;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--color-navy);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.25rem, 4.5vw, 3.75rem); font-weight: 800; }
h2 { font-size: clamp(1.875rem, 3.5vw, 2.75rem); }
h3 { font-size: clamp(1.375rem, 2vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }

p { color: var(--color-text-muted); }

.lead {
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--color-text-muted);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}
.container-narrow { max-width: var(--container-narrow); }

.section {
  padding-block: clamp(60px, 8vw, 110px);
  position: relative;
}

.section-sm { padding-block: clamp(40px, 5vw, 70px); }

.section-alt { background: var(--color-bg-alt); }

.section-dark {
  background: var(--color-navy);
  color: var(--color-text-on-dark);
}
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4 {
  color: var(--color-white);
}
.section-dark p { color: var(--color-text-on-dark-muted); }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 980px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Section Heading ---------- */
.section-head {
  text-align: center;
  max-width: 760px;
  margin-inline: auto;
  margin-bottom: 56px;
}
.section-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-electric);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.section-head .eyebrow::before {
  content: '';
  width: 28px;
  height: 2px;
  background: var(--color-electric);
}
.section-head h2 {
  margin-bottom: 16px;
}
.section-head p {
  font-size: 1.0625rem;
  line-height: 1.85;
}

.section-head.start { text-align: start; margin-inline: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--r-pill);
  transition: all var(--t-med) var(--ease);
  cursor: pointer;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.btn:focus-visible {
  outline: 3px solid var(--color-electric);
  outline-offset: 3px;
}
.btn .icon {
  width: 18px;
  height: 18px;
  transition: transform var(--t-med) var(--ease);
}
.btn:hover .icon { transform: translateX(4px); }

.btn-primary {
  background: var(--color-electric);
  color: var(--color-white);
  box-shadow: var(--sh-glow);
}
.btn-primary:hover {
  background: var(--color-electric-600);
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(30, 99, 216, 0.4);
}

.btn-gold {
  background: var(--color-gold);
  color: var(--color-navy);
  box-shadow: 0 8px 24px rgba(201, 162, 74, 0.3);
}
.btn-gold:hover {
  background: var(--color-gold-light);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--color-navy);
  border-color: var(--color-border-strong);
}
.btn-outline:hover {
  border-color: var(--color-navy);
  background: var(--color-navy);
  color: var(--color-white);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
  backdrop-filter: blur(10px);
  border-color: rgba(255, 255, 255, 0.25);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-navy);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-electric);
  font-weight: 600;
  padding: 0;
  font-size: 0.9375rem;
}
.btn-link::after {
  content: '←';
  transition: transform var(--t-med) var(--ease);
  font-size: 1.1em;
}
.btn-link:hover::after { transform: translateX(-4px); }

.btn-sm { padding: 10px 20px; font-size: 0.875rem; }
.btn-lg { padding: 18px 36px; font-size: 1.0625rem; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-start { text-align: start; }
.text-gradient {
  background: linear-gradient(135deg, var(--color-electric) 0%, var(--color-gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.text-gold { color: var(--color-gold) !important; }
.text-electric { color: var(--color-electric) !important; }
.text-muted { color: var(--color-text-muted) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }

.divider-gold {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-electric), var(--color-gold));
  border-radius: 3px;
  margin: 16px 0;
}

/* ---------- Reveal Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.reveal.delay-1 { transition-delay: 80ms; }
.reveal.delay-2 { transition-delay: 160ms; }
.reveal.delay-3 { transition-delay: 240ms; }
.reveal.delay-4 { transition-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Page Hero (interior pages) ---------- */
.page-hero {
  position: relative;
  background: linear-gradient(135deg, var(--color-navy-900) 0%, var(--color-navy) 50%, var(--color-electric-600) 100%);
  color: var(--color-white);
  padding: calc(var(--header-h) + 80px) 0 100px;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 80% 10%, rgba(201, 162, 74, 0.18), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(30, 99, 216, 0.25), transparent 45%);
  pointer-events: none;
}
.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
  pointer-events: none;
}
.page-hero .container { position: relative; z-index: 2; }
.page-hero h1 {
  color: var(--color-white);
  margin-bottom: 18px;
}
.page-hero .lead {
  color: rgba(255,255,255,0.85);
  max-width: 720px;
  font-size: 1.125rem;
}
.page-hero .eyebrow {
  display: inline-block;
  color: var(--color-gold);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.875rem;
  margin-bottom: 14px;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 18px;
}
.breadcrumb a:hover { color: var(--color-gold); }
.breadcrumb .sep { opacity: 0.5; }
.breadcrumb .current { color: var(--color-white); }

/* On light backgrounds */
.breadcrumb-light {
  color: var(--color-text-muted);
}
.breadcrumb-light a:hover { color: var(--color-electric); }
.breadcrumb-light .current { color: var(--color-navy); }
