/**
 * Sovereign Intelligence — global design system for public pages (body.mg-public).
 * Load after Bootstrap, design-system, design-tokens, public.css, institutional-foundation.
 */

/* ── Design tokens ───────────────────────────────────────────── */
:root {
  /* Brand colors */
  --navy-950: #060d16;
  --navy-900: #0a1628;
  --navy-800: #0d2137;
  --navy-700: #142d4c;
  --navy-600: #1a3a5c;
  --navy-400: #2e6096;

  --teal-600: #0a7a5c;
  --teal-500: #0e9e76;
  --teal-400: #12c491;
  --teal-300: #4dd9ac;
  --teal-100: #d0f5eb;
  --teal-50: #e8fbf5;

  --gold-500: #c9921a;
  --gold-400: #e0a820;
  --gold-300: #f0c040;
  --gold-100: #fdf3d0;

  /* Page backgrounds */
  --bg-dark: #060d16;
  --bg-navy: #0a1628;
  --bg-light: #f5f7fa;
  --bg-white: #ffffff;
  --bg-warm: #fafaf8;

  /* Text */
  --text-inverse: #ffffff;
  --text-primary: #0a1628;
  --text-secondary: #4a5568;
  --text-muted: #8896a5;
  --text-teal: #0e9e76;
  --text-gold: #c9921a;

  /* UI */
  --border-light: #e8ecf0;
  --border-dark: rgba(255, 255, 255, 0.1);
  --shadow-card: 0 4px 24px rgba(10, 22, 40, 0.08);
  --shadow-float: 0 20px 60px rgba(10, 22, 40, 0.16);

  /* Typography (Sovereign stack) */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-arabic: "Noto Sans Arabic", system-ui, sans-serif;

  /* Spacing */
  --section-py: 100px;
  --container: 1200px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;
}

@media (max-width: 768px) {
  :root {
    --section-py: 60px;
  }
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Intentionally no universal margin/padding reset — preserves Bootstrap/forms */

/* ── Base (public site only) ─────────────────────────────────── */
[dir="rtl"] body.mg-public {
  font-family: var(--font-arabic), var(--font-body);
  letter-spacing: 0;
}

body.mg-public {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-white);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body.mg-public h1,
body.mg-public h2,
body.mg-public h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: inherit;
}

body.mg-public h1 {
  font-size: clamp(44px, 6vw, 80px);
}

body.mg-public h2 {
  font-size: clamp(32px, 4vw, 56px);
}

body.mg-public h3 {
  font-size: clamp(22px, 3vw, 32px);
}

body.mg-public main p {
  max-width: 68ch;
}

/* Numbers / stats — add class where needed */
body.mg-public .mg-data,
body.mg-public .stat-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Layout container — align marketing shell to 1200px cap */
body.mg-public .container:not(.container-fluid) {
  max-width: min(var(--container), 100%);
  margin-left: auto;
  margin-right: auto;
  padding-left: 40px;
  padding-right: 40px;
}

@media (max-width: 768px) {
  body.mg-public .container:not(.container-fluid) {
    padding-left: 20px;
    padding-right: 20px;
  }
}

body.mg-public .sov-section {
  padding-block: var(--section-py);
}

/* ── Buttons (Bootstrap-compatible; scoped to public body) ─── */
body.mg-public .btn.mg-language-toggle {
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  gap: 0.35rem;
}

body.mg-public .btn:not(.mg-language-toggle):not(.navbar-toggler) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

body.mg-public .btn.btn-sm:not(.mg-language-toggle) {
  padding: 10px 20px;
  font-size: 13px;
}

body.mg-public .btn.btn-lg:not(.mg-language-toggle) {
  padding: 18px 36px;
  font-size: 16px;
}

body.mg-public .btn-primary,
body.mg-public .btn-mg-primary {
  background: var(--teal-500) !important;
  color: var(--text-inverse) !important;
  border-color: transparent !important;
  box-shadow: 0 4px 20px rgba(14, 158, 118, 0.35);
}

body.mg-public .btn-primary:hover,
body.mg-public .btn-mg-primary:hover {
  background: var(--teal-400) !important;
  color: var(--text-inverse) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(14, 158, 118, 0.45);
}

body.mg-public .btn-gold {
  background: var(--gold-400);
  color: var(--navy-900);
  box-shadow: 0 4px 20px rgba(224, 168, 32, 0.35);
}

body.mg-public .btn-gold:hover {
  background: var(--gold-300);
  transform: translateY(-2px);
  color: var(--navy-900);
}

body.mg-public .btn-outline-white,
body.mg-public .btn-mg-outline-light {
  background: transparent !important;
  color: var(--text-inverse) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.35) !important;
  backdrop-filter: blur(8px);
}

body.mg-public .btn-outline-white:hover,
body.mg-public .btn-mg-outline-light:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
  color: var(--text-inverse) !important;
  transform: translateY(-2px);
}

body.mg-public .btn-mg-white {
  background: var(--bg-white) !important;
  color: var(--navy-900) !important;
  border: none !important;
}

body.mg-public .btn-outline-navy {
  background: transparent;
  color: var(--navy-800);
  border: 1.5px solid var(--navy-800);
}

body.mg-public .btn-outline-navy:hover {
  background: var(--navy-800);
  color: var(--text-inverse);
  transform: translateY(-2px);
}

body.mg-public .btn-outline-primary {
  color: var(--teal-600) !important;
  border-color: var(--teal-500) !important;
  background: transparent !important;
}

body.mg-public .btn-outline-primary:hover {
  background: var(--teal-500) !important;
  color: var(--text-inverse) !important;
  transform: translateY(-2px);
}

body.mg-public .btn-arrow::after {
  content: "→";
  display: inline-block;
  transition: transform 0.2s ease;
  margin-inline-start: 2px;
}

body.mg-public .btn-arrow:hover::after {
  transform: translateX(4px);
}

/* ── Section label ───────────────────────────────────────────── */
body.mg-public .section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-500);
  margin-bottom: 16px;
}

body.mg-public .section-label::before {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background: var(--teal-500);
  border-radius: 1px;
}

body.mg-public .section-label-gold {
  color: var(--gold-400);
}

body.mg-public .section-label-gold::before {
  background: var(--gold-400);
}

body.mg-public .section-label-white {
  color: rgba(255, 255, 255, 0.7);
}

body.mg-public .section-label-white::before {
  background: rgba(255, 255, 255, 0.4);
}

/* ── Geometric texture ───────────────────────────────────────── */
body.mg-public .geo-pattern {
  position: relative;
  overflow: hidden;
}

body.mg-public .geo-pattern::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.04) 1px, transparent 0);
  background-size: 40px 40px;
  pointer-events: none;
}

body.mg-public .geo-pattern-teal::before {
  background-image: radial-gradient(circle at 1px 1px, rgba(14, 158, 118, 0.12) 1px, transparent 0);
}

/* ── Scroll reveal (always visible: hidden “reveal” caused huge blank scroll areas) ─ */
body.mg-public .reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

body.mg-public .reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

body.mg-public .reveal-delay-1 {
  transition-delay: 0.1s;
}

body.mg-public .reveal-delay-2 {
  transition-delay: 0.2s;
}

body.mg-public .reveal-delay-3 {
  transition-delay: 0.3s;
}

body.mg-public .reveal-delay-4 {
  transition-delay: 0.4s;
}

@media (prefers-reduced-motion: reduce) {
  body.mg-public .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  body.mg-public .reveal-delay-1,
  body.mg-public .reveal-delay-2,
  body.mg-public .reveal-delay-3,
  body.mg-public .reveal-delay-4 {
    transition-delay: 0s;
  }

  body.mg-public .btn:not(.mg-language-toggle):not(.navbar-toggler):hover {
    transform: none;
  }
}

/* SEO / long-form landing heroes: public.css sets body.mg-public h1–h6 to dark navy,
   which overrides Bootstrap .text-white inheritance and hides headlines on blue/dark bands. */
body.mg-public .mg-seo-hero {
  color: #fff;
}

body.mg-public .mg-seo-hero--blue-gradient {
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
}

body.mg-public .mg-seo-hero h1,
body.mg-public .mg-seo-hero h2,
body.mg-public .mg-seo-hero h3,
body.mg-public .mg-seo-hero h4,
body.mg-public .mg-seo-hero h5,
body.mg-public .mg-seo-hero h6,
body.mg-public .mg-seo-hero .lead {
  color: #fff !important;
}

body.mg-public .mg-seo-hero .text-muted {
  color: rgba(255, 255, 255, 0.82) !important;
}
