/* =========================================================================
   mah007.net — design system
   Deep navy/charcoal base + electric cyan & violet accents (dark-first).
   Layered on top of Bootstrap 5. Tokens here become CMS-editable later.
   ========================================================================= */

:root {
  /* Surfaces */
  --mah-bg:        #0b1120;   /* deep navy-charcoal */
  --mah-bg-2:      #0f172a;   /* slightly lifted */
  --mah-surface:   #131c31;   /* card */
  --mah-surface-2: #1b2743;   /* card hover / raised */
  --mah-border:    #24314f;

  /* Text */
  --mah-text:      #e6ecf7;
  --mah-muted:     #93a1bd;
  --mah-faint:     #64748b;

  /* Accents */
  --mah-cyan:      #22d3ee;
  --mah-cyan-2:    #06b6d4;
  --mah-violet:    #8b5cf6;
  --mah-violet-2:  #7c3aed;

  --mah-grad: linear-gradient(120deg, var(--mah-cyan) 0%, var(--mah-violet) 100%);
  --mah-grad-soft: linear-gradient(120deg, rgba(34,211,238,.16), rgba(139,92,246,.16));

  --mah-radius: 18px;
  --mah-radius-sm: 12px;
  --mah-shadow: 0 20px 50px -24px rgba(2,6,23,.9);

  /* Bootstrap overrides */
  --bs-body-bg: var(--mah-bg);
  --bs-body-color: var(--mah-text);
  --bs-border-color: var(--mah-border);
  --bs-primary: var(--mah-cyan);
  --bs-emphasis-color: #fff;
}

* { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1100px 600px at 85% -5%, rgba(139,92,246,.18), transparent 60%),
    radial-gradient(900px 500px at 5% 0%, rgba(34,211,238,.14), transparent 55%),
    var(--mah-bg);
  color: var(--mah-text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arabic, sans-serif;
  letter-spacing: .1px;
  min-height: 100vh;
}

/* Arabic typography */
html[dir="rtl"] body {
  font-family: "Cairo", "Noto Kufi Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  letter-spacing: 0;
}

h1, h2, h3, .display-1, .display-2, .display-3, .display-4, .display-5 {
  color: #fff;
  font-weight: 800;
  letter-spacing: -.02em;
}

a { color: var(--mah-cyan); text-decoration: none; }
a:hover { color: #fff; }

.text-gradient {
  background: var(--mah-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-muted-2 { color: var(--mah-muted) !important; }

/* Decorative grid backdrop for sections that opt in */
.grid-motif {
  position: relative;
}
.grid-motif::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(148,163,184,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,.06) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(70% 60% at 50% 0%, #000 40%, transparent 100%);
  pointer-events: none;
}

/* ------------------------------------------------------------------ Navbar */
.navbar.mah-nav {
  background: rgba(11,17,32,.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--mah-border);
}
.navbar.mah-nav .navbar-brand {
  font-weight: 800; letter-spacing: -.03em; color: #fff; font-size: 1.35rem;
}
.navbar.mah-nav .navbar-brand .dot { color: var(--mah-cyan); }
.mah-logo { height: 38px; width: auto; display: block; }
.mah-logo-footer { height: 30px; width: auto; opacity: .9; }
@media (max-width: 575.98px) { .mah-logo { height: 32px; } }
@media (prefers-reduced-motion: no-preference) {
  .navbar-brand .mah-logo { transition: transform .2s ease, filter .2s ease; }
  .navbar-brand:hover .mah-logo { transform: translateY(-1px); filter: drop-shadow(0 0 10px rgba(34,211,238,.45)); }
}
.navbar.mah-nav .nav-link { color: var(--mah-muted); font-weight: 500; }
.navbar.mah-nav .nav-link:hover,
.navbar.mah-nav .nav-link.active { color: #fff; }
.lang-switch a {
  color: var(--mah-muted); font-weight: 600; padding: .15rem .5rem; border-radius: 8px;
}
.lang-switch a.active { color: #fff; background: var(--mah-surface-2); }

/* ------------------------------------------------------------------ Buttons */
.btn-mah {
  background: var(--mah-grad);
  border: none; color: #05121a; font-weight: 700;
  padding: .7rem 1.4rem; border-radius: 999px;
  box-shadow: 0 10px 30px -10px rgba(34,211,238,.6);
  transition: transform .18s ease, box-shadow .18s ease;
}
.btn-mah:hover { color: #05121a; transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(139,92,246,.7); }
.btn-ghost {
  border: 1px solid var(--mah-border); color: var(--mah-text); background: transparent;
  padding: .7rem 1.4rem; border-radius: 999px; font-weight: 600;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.btn-ghost:hover { border-color: var(--mah-cyan); color: #fff; background: rgba(34,211,238,.08); }

/* ------------------------------------------------------------------ Hero */
.hero { padding: 5.5rem 0 4rem; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--mah-cyan); font-weight: 700; text-transform: uppercase;
  letter-spacing: .18em; font-size: .78rem;
  padding: .35rem .8rem; border: 1px solid var(--mah-border);
  border-radius: 999px; background: var(--mah-grad-soft);
}
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); line-height: 1.04; margin: 1.1rem 0; }
.hero .lead { color: var(--mah-muted); font-size: 1.12rem; max-width: 40rem; }
.hero .roles { color: #fff; font-weight: 700; }

/* Portrait card */
.portrait-frame {
  position: relative; border-radius: 26px; padding: 10px;
  background: var(--mah-grad-soft);
  border: 1px solid var(--mah-border);
  box-shadow: var(--mah-shadow);
}
.portrait-frame::after {
  content: ""; position: absolute; inset: -1px; border-radius: 26px;
  padding: 1px; background: var(--mah-grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: .55; pointer-events: none;
}
.portrait-frame img { border-radius: 18px; display: block; width: 100%; height: auto; }

/* ------------------------------------------------------------------ Trust strip */
.trust {
  border-top: 1px solid var(--mah-border);
  border-bottom: 1px solid var(--mah-border);
  background: rgba(19,28,49,.5);
}
.trust .stat .num { font-size: 2rem; font-weight: 800; color: #fff; }
.trust .stat .num .plus { color: var(--mah-cyan); }
.trust .stat .label { color: var(--mah-muted); font-size: .9rem; }

/* ------------------------------------------------------------------ Cards */
.section { padding: 4.5rem 0; }
.section-eyebrow { color: var(--mah-cyan); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; font-size: .8rem; }
.section-title { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }

.mah-card {
  height: 100%;
  background: var(--mah-surface);
  border: 1px solid var(--mah-border);
  border-radius: var(--mah-radius);
  padding: 1.5rem;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.mah-card:hover { transform: translateY(-4px); border-color: rgba(34,211,238,.5); background: var(--mah-surface-2); }
.mah-card .icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--mah-grad-soft); color: var(--mah-cyan); font-size: 1.3rem; margin-bottom: 1rem;
  border: 1px solid var(--mah-border);
}
.mah-card h3 { font-size: 1.2rem; margin-bottom: .5rem; }
.mah-card p { color: var(--mah-muted); margin-bottom: 1rem; }

/* Status badges (catalog states) */
.badge-status { font-weight: 700; border-radius: 999px; padding: .3rem .7rem; font-size: .72rem; letter-spacing: .04em; }
.badge-live   { background: rgba(34,197,94,.16);  color: #4ade80; border: 1px solid rgba(34,197,94,.3); }
.badge-built  { background: rgba(34,211,238,.14); color: var(--mah-cyan); border: 1px solid rgba(34,211,238,.3); }
.badge-progress { background: rgba(139,92,246,.16); color: #c4b5fd; border: 1px solid rgba(139,92,246,.3); }

.tech-chip {
  display: inline-block; font-size: .75rem; color: var(--mah-muted);
  border: 1px solid var(--mah-border); border-radius: 999px; padding: .18rem .6rem; margin: .15rem;
}
a.tech-chip:hover { color: #fff; border-color: var(--mah-cyan); }
.tech-chip.active-chip { color: #05121a; background: var(--mah-grad); border: none; font-weight: 700; }

/* ------------------------------------------------------------------ Final CTA */
.cta-band {
  background: var(--mah-grad-soft);
  border: 1px solid var(--mah-border);
  border-radius: 28px;
  padding: 3rem;
}

/* ------------------------------------------------------------------ Learning */
.learn-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.learn-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--mah-bg-2); overflow: hidden; }
.learn-thumb img { width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .3s ease; }
.learn-card:hover .learn-thumb img { transform: scale(1.04); }
.learn-thumb-ph { width: 100%; height: 100%; display: grid; place-items: center;
  background: var(--mah-grad-soft); }
.learn-thumb-ph span { font-weight: 800; letter-spacing: -.02em; color: #fff; opacity: .6; font-style: italic; }
.learn-badge { position: absolute; top: .55rem; inset-inline-start: .55rem;
  font-size: .72rem; font-weight: 700; padding: .18rem .5rem; border-radius: 999px;
  background: rgba(11,17,32,.82); color: #fff; backdrop-filter: blur(4px); }
.learn-badge-paid { background: var(--mah-grad); color: #05121a; }
.learn-badge-list { inset-inline-start: auto; inset-inline-end: .55rem; }
.learn-body { padding: 1rem 1.15rem 1.15rem; flex: 1; }

/* ------------------------------------------------------------------ Case studies */
.cs-stats { display: flex; gap: 2.5rem; margin-top: 1.5rem; flex-wrap: wrap; }
.cs-stat { display: flex; flex-direction: column; }
.cs-stat-num { font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.cs-stat-lbl { font-size: .8rem; color: var(--mah-muted); text-transform: uppercase; letter-spacing: .06em; margin-top: .25rem; }
.cs-card { display: flex; flex-direction: column; }
.cs-card-top { display: flex; align-items: center; justify-content: space-between; }
.cs-icon { font-size: 1.8rem; line-height: 1; }
.cs-flag { font-size: .7rem; font-weight: 700; color: var(--mah-cyan); border: 1px solid var(--mah-border);
  border-radius: 999px; padding: .12rem .5rem; background: var(--mah-grad-soft); }
.cs-title { font-size: 1.1rem; margin: .35rem 0 .5rem; }
.cs-excerpt { color: var(--mah-muted); font-size: .9rem; flex: 1; }
.cs-more { color: var(--mah-cyan); font-weight: 600; font-size: .85rem; margin-top: .5rem; }
.cs-card:hover .cs-more { text-decoration: underline; }
.cs-featured { border-color: transparent; background:
  linear-gradient(var(--mah-surface), var(--mah-surface)) padding-box,
  var(--mah-grad) border-box; border: 1px solid transparent; }

/* ------------------------------------------------------------------ Footer */
.mah-footer { border-top: 1px solid var(--mah-border); color: var(--mah-muted); padding: 2.5rem 0; }
.mah-footer a { color: var(--mah-muted); }
.mah-footer a:hover { color: #fff; }

/* ------------------------------------------------------------------ Forms */
/* The form card must grow with its content (mah-card sets height:100% for grid cards). */
.mah-card.mah-form { height: auto; }
.mah-form .fieldset { margin-bottom: 1.15rem; }
.mah-form .form-label { display: block; font-weight: 600; color: var(--mah-text); margin-bottom: .4rem; }
.mah-form .req { color: var(--mah-cyan); }
.mah-form .err { color: #fca5a5; font-size: .85rem; margin-top: .35rem; }
.mah-form .form-text { font-size: .82rem; margin-top: .3rem; }
.mah-sep { border-color: var(--mah-border); opacity: 1; margin: 1.5rem 0 1rem; }

/* Dark-theme form controls (Bootstrap defaults are light) */
.mah-form .form-control,
.mah-form .form-select {
  background: var(--mah-bg-2);
  border: 1px solid var(--mah-border);
  color: var(--mah-text);
  border-radius: 12px;
  padding: .7rem .9rem;
}
.mah-form .form-control::placeholder { color: var(--mah-faint); }
.mah-form .form-control:focus,
.mah-form .form-select:focus {
  background: var(--mah-bg-2);
  color: var(--mah-text);
  border-color: var(--mah-cyan);
  box-shadow: 0 0 0 .2rem rgba(34,211,238,.18);
}
.mah-form .form-select option { background: var(--mah-surface); color: var(--mah-text); }
/* Make the native date picker indicator visible on dark */
.mah-form input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity:.7; cursor:pointer; }

/* ------------------------------------------------------------------ Floating WhatsApp */
#wa-float {
  position: fixed;
  bottom: 22px;
  inset-inline-end: 22px;   /* right in LTR, left in RTL */
  width: 58px; height: 58px;
  display: grid; place-items: center;
  background: #25D366; color: #fff;
  border-radius: 50%;
  box-shadow: 0 10px 30px -6px rgba(37,211,102,.6);
  z-index: 1050;
  transition: transform .18s ease, box-shadow .18s ease;
}
#wa-float:hover { color: #fff; transform: translateY(-3px) scale(1.05); box-shadow: 0 16px 40px -8px rgba(37,211,102,.75); }

/* ------------------------------------------------------------------ Motion */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* Reveal-on-load (respect reduced motion above) */
.reveal { opacity: 0; transform: translateY(14px); animation: reveal .7s ease forwards; }
.reveal.d1 { animation-delay: .08s; }
.reveal.d2 { animation-delay: .16s; }
.reveal.d3 { animation-delay: .24s; }
@keyframes reveal { to { opacity: 1; transform: none; } }
