/* ── MAD-RC Brand Tokens ── */
:root {
  --navy: #033765;
  --navy-light: #064a8a;
  --gold: #DAB45C;
  --gold-light: #f0d078;
  --bg: #fafbfc;
  --bg-alt: #f0f2f5;
  --text: #1a1a2e;
  --text-muted: #5a6178;
  --white: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(3,55,101,0.08);
  --shadow-lg: 0 8px 32px rgba(3,55,101,0.12);
  --transition: 0.2s ease;
  --max-w: 1120px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* ── Z-Index Scale ── */
  --z-nav: 100;
  --z-dropdown: 200;
  --z-sticky: 300;
  --z-overlay: 400;
  --z-modal: 500;
  --z-muse-fab: 600;
  --z-muse-panel: 700;
  --z-toast: 800;
  --z-loading: 900;
}

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

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── RTL ── */
[dir="rtl"] { direction: rtl; text-align: right; }

/* ── Layout ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ── Nav ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-nav);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(3,55,101,0.06);
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-brand { display: flex; align-items: center; gap: 8px; }
.brand-mark { color: var(--gold); font-size: 1.4rem; font-weight: 700; }
.brand-text { color: var(--navy); font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; }
.brand-sub { color: var(--text-muted); font-size: 0.85rem; font-weight: 400; }
.nav-cta {
  background: var(--navy); color: var(--white); padding: 8px 20px;
  border-radius: var(--radius-sm); font-weight: 600; font-size: 0.9rem;
  text-decoration: none; transition: background var(--transition);
}
.nav-cta:hover { background: var(--navy-light); }

/* ── Hero ── */
.hero {
  padding: 140px 24px 80px;
  background: linear-gradient(135deg, var(--navy) 0%, #054d94 100%);
  color: var(--white);
  text-align: center;
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700; line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: rgba(255,255,255,0.8);
  max-width: 560px; margin: 0 auto 32px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.95rem; font-weight: 600;
  border: none; cursor: pointer; text-decoration: none;
  transition: all var(--transition);
}
.btn-icon { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: var(--gold-light); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,0.4); }
.btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,0.1); }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }

/* ── Sections ── */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  text-align: center; font-size: 1.8rem; font-weight: 700;
  color: var(--navy); margin-bottom: 40px; letter-spacing: -0.02em;
}

/* ── Card Grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.card-grid-services {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* ── Cards ── */
.card {
  background: var(--white); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-name {
  font-size: 1.15rem; font-weight: 700; color: var(--navy);
  margin-bottom: 6px;
}
.card-detail {
  font-size: 0.9rem; color: var(--text-muted);
  margin-bottom: 4px;
}
.card-tag {
  display: inline-block; margin-top: 12px;
  background: rgba(218,180,92,0.12); color: var(--gold);
  padding: 4px 12px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 600;
}

/* service cards */
.svc-card { cursor: default; }
.svc-card .card-name { font-size: 1.05rem; }
.svc-duration {
  font-size: 0.85rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 4px;
}

/* ── Filter Bar ── */
.filter-bar {
  display: flex; gap: 8px; justify-content: center;
  flex-wrap: wrap; margin-bottom: 28px;
}
.filter-btn {
  padding: 8px 18px; border-radius: 20px;
  border: 1.5px solid rgba(3,55,101,0.15);
  background: var(--white); color: var(--text);
  font-family: var(--font); font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--navy); color: var(--navy); }
.filter-btn.active {
  background: var(--navy); color: var(--white);
  border-color: var(--navy);
}

/* ── Skeleton ── */
.skeleton-card {
  background: var(--white); border-radius: var(--radius);
  height: 140px; box-shadow: var(--shadow);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── CTA Section ── */
.section-cta {
  background: linear-gradient(135deg, var(--navy) 0%, #054d94 100%);
  color: var(--white); text-align: center;
}
.cta-inner { max-width: 560px; margin: 0 auto; }
.cta-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 12px; color: var(--white); }
.cta-text { color: rgba(255,255,255,0.8); margin-bottom: 28px; font-size: 1.05rem; }

/* ── Footer ── */
.footer {
  padding: 40px 0;
  border-top: 1px solid rgba(3,55,101,0.08);
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.footer-brand { font-weight: 600; color: var(--navy); font-size: 0.95rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; }
.footer-links a:hover { color: var(--navy); }
.footer-copy { color: var(--text-muted); font-size: 0.85rem; }

/* ── Muse Chat Widget ── */
.muse-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: var(--z-muse-fab);
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 20px rgba(218,180,92,0.4);
  transition: transform var(--transition), box-shadow var(--transition);
}
.muse-fab svg { width: 26px; height: 26px; }
.muse-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(218,180,92,0.5); }
.muse-fab.hidden { display: none; }

.muse-panel {
  position: fixed; bottom: 24px; right: 24px; z-index: var(--z-muse-panel);
  width: 400px; max-width: calc(100vw - 32px);
  height: 560px; max-height: calc(100vh - 48px);
  background: var(--white); border-radius: 16px;
  box-shadow: 0 12px 48px rgba(3,55,101,0.18);
  display: none; flex-direction: column;
  overflow: hidden;
}
.muse-panel.open { display: flex; }

.muse-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: var(--navy); color: var(--white);
}
.muse-header-title { font-weight: 700; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.muse-close {
  background: none; border: none; color: var(--white);
  font-size: 1.6rem; cursor: pointer; line-height: 1; padding: 0 4px;
}

.muse-messages {
  flex: 1; overflow-y: auto; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.muse-msg {
  max-width: 85%; padding: 10px 14px;
  border-radius: 12px; font-size: 0.92rem; line-height: 1.5;
  word-wrap: break-word;
}
.muse-msg.bot {
  align-self: flex-start;
  background: var(--bg-alt); color: var(--text);
  border-bottom-left-radius: 4px;
}
.muse-msg.user {
  align-self: flex-end;
  background: var(--navy); color: var(--white);
  border-bottom-right-radius: 4px;
}
.muse-msg.typing {
  align-self: flex-start;
  background: var(--bg-alt); color: var(--text-muted);
  font-style: italic;
}

/* Options rendered by Muse */
.muse-options {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px;
}
.muse-option-btn {
  padding: 6px 14px; border-radius: 20px;
  border: 1.5px solid var(--navy);
  background: var(--white); color: var(--navy);
  font-family: var(--font); font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
}
.muse-option-btn:hover { background: var(--navy); color: var(--white); }

.muse-input-row {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid rgba(3,55,101,0.08);
}
.muse-input {
  flex: 1; padding: 10px 14px; border: 1.5px solid rgba(3,55,101,0.15);
  border-radius: var(--radius-sm); font-family: var(--font); font-size: 0.92rem;
  outline: none; transition: border-color var(--transition);
}
.muse-input:focus { border-color: var(--navy); }
.muse-send {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--navy); color: var(--white);
  border: none; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: background var(--transition);
}
.muse-send svg { width: 18px; height: 18px; }
.muse-send:hover { background: var(--navy-light); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-inner { height: 56px; }
  .brand-sub { display: none; }
  .hero { padding: 110px 20px 60px; }
  .section { padding: 52px 0; }
  .card-grid { grid-template-columns: 1fr; }
  .card-grid-services { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .footer-inner { flex-direction: column; text-align: center; }
  .muse-panel { bottom: 0; right: 0; width: 100%; max-width: 100%; height: 100vh; max-height: 100vh; border-radius: 0; }
}
@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: center; }
  .btn-lg { width: 100%; justify-content: center; }
}
