/* ============================================================
   AlMohamy v5 — shared design layer ("Midnight Court")
   Loaded after the v3/v4 sheets. Area sheets (v5-top / v5-sections /
   v5-convert) build ONLY on these tokens and primitives.
   Arabic rule: never use letter-spacing on Arabic text (it breaks joins).
   ========================================================== */
:root {
  /* Ink (dark surfaces) */
  --v5-ink-950: #030817;
  --v5-ink-900: #060d22;
  --v5-ink-850: #0a1430;
  --v5-ink-800: #0e1a3d;
  --v5-ink-700: #16265a;

  /* Gold (brand accent) */
  --v5-gold-600: #b98a2e;
  --v5-gold-500: #d4a853;
  --v5-gold-400: #e6c27a;
  --v5-gold-300: #f3dca6;

  /* Supporting accents */
  --v5-blue-500: #4f7cff;
  --v5-blue-400: #7c9dff;
  --v5-emerald-500: #19c38a;
  --v5-red-500: #f05252;
  --v5-wa: #25d366;

  /* Light surfaces (warm paper, not cold grey) */
  --v5-paper: #f8f5ee;
  --v5-paper-2: #f1ece0;
  --v5-card-light: #ffffff;
  --v5-text-dark: #0d1530;
  --v5-text-dark-2: #3c4663;
  --v5-text-dark-3: #6b7490;

  /* Text on dark */
  --v5-text: #f4f6fb;
  --v5-text-2: #b9c2da;
  --v5-text-3: #8590ad;

  /* Lines & glass */
  --v5-line-dark: rgba(255, 255, 255, .08);
  --v5-line-dark-2: rgba(255, 255, 255, .14);
  --v5-line-light: rgba(13, 21, 48, .09);
  --v5-glass: rgba(255, 255, 255, .045);
  --v5-glass-2: rgba(255, 255, 255, .08);

  /* Gradients */
  --v5-grad-gold: linear-gradient(135deg, var(--v5-gold-300) 0%, var(--v5-gold-500) 45%, var(--v5-gold-600) 100%);
  --v5-grad-gold-text: linear-gradient(100deg, var(--v5-gold-300) 0%, var(--v5-gold-500) 40%, #fff1cf 55%, var(--v5-gold-500) 70%, var(--v5-gold-400) 100%);
  --v5-grad-ink: radial-gradient(120% 80% at 80% 0%, #13245a 0%, var(--v5-ink-900) 45%, var(--v5-ink-950) 100%);
  --v5-grad-aurora: radial-gradient(40% 50% at 15% 20%, rgba(79, 124, 255, .28), transparent 70%),
                    radial-gradient(35% 45% at 85% 10%, rgba(212, 168, 83, .22), transparent 70%),
                    radial-gradient(50% 50% at 50% 100%, rgba(25, 195, 138, .10), transparent 70%);

  /* Elevation */
  --v5-shadow-sm: 0 1px 2px rgba(3, 8, 23, .06), 0 2px 8px rgba(3, 8, 23, .06);
  --v5-shadow-md: 0 10px 30px -10px rgba(3, 8, 23, .25);
  --v5-shadow-lg: 0 30px 60px -20px rgba(3, 8, 23, .45);
  --v5-shadow-gold: 0 14px 40px -12px rgba(212, 168, 83, .55);
  --v5-ring: 0 0 0 3px rgba(212, 168, 83, .45);

  /* Shape */
  --v5-r-sm: 10px;
  --v5-r-md: 16px;
  --v5-r-lg: 24px;
  --v5-r-xl: 32px;
  --v5-r-full: 999px;

  /* Type scale (Cairo variable) */
  --v5-fs-eyebrow: .85rem;
  --v5-fs-body: clamp(1rem, .96rem + .2vw, 1.08rem);
  --v5-fs-lead: clamp(1.05rem, .98rem + .45vw, 1.28rem);
  --v5-fs-h3: clamp(1.15rem, 1.05rem + .5vw, 1.4rem);
  --v5-fs-h2: clamp(1.85rem, 1.35rem + 2.2vw, 3rem);
  --v5-fs-display: clamp(2.3rem, 1.4rem + 4.2vw, 4.6rem);

  /* Layout */
  --v5-container: 1240px;
  --v5-gutter: clamp(16px, 4vw, 32px);
  --v5-section-y: clamp(4.5rem, 3rem + 6vw, 8.5rem);

  /* Motion */
  --v5-ease: cubic-bezier(.22, 1, .36, 1);
  --v5-ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --v5-dur: .7s;
}

/* ---------- Layout ---------- */
.v5-container {
  width: 100%;
  max-width: calc(var(--v5-container) + var(--v5-gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--v5-gutter);
}

.v5-section {
  position: relative;
  padding-block: var(--v5-section-y);
  overflow: clip;
  isolation: isolate;
}
.v5-section--dark {
  background: var(--v5-grad-ink);
  color: var(--v5-text);
}
.v5-section--paper {
  background: var(--v5-paper);
  color: var(--v5-text-dark);
}
.v5-section--white {
  background: #fff;
  color: var(--v5-text-dark);
}

/* Faint grid + aurora backdrops (decorative, put on an absolutely positioned child) */
.v5-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.v5-backdrop--aurora { background: var(--v5-grad-aurora); }
.v5-backdrop--grid {
  background-image:
    linear-gradient(var(--v5-line-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--v5-line-dark) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000 30%, transparent 75%);
          mask-image: radial-gradient(70% 60% at 50% 30%, #000 30%, transparent 75%);
}
.v5-section--paper .v5-backdrop--grid,
.v5-section--white .v5-backdrop--grid {
  background-image:
    linear-gradient(var(--v5-line-light) 1px, transparent 1px),
    linear-gradient(90deg, var(--v5-line-light) 1px, transparent 1px);
}

/* ---------- Section heading ---------- */
.v5-head {
  max-width: 820px;
  margin: 0 auto clamp(2.5rem, 2rem + 2vw, 4rem);
  text-align: center;
}
.v5-head--start { margin-inline: 0; text-align: start; }

.v5-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .4rem 1rem;
  border-radius: var(--v5-r-full);
  font-size: var(--v5-fs-eyebrow);
  font-weight: 700;
  line-height: 1.4;
  color: var(--v5-gold-600);
  background: rgba(212, 168, 83, .12);
  border: 1px solid rgba(212, 168, 83, .28);
  margin-bottom: 1.1rem;
}
.v5-section--dark .v5-eyebrow { color: var(--v5-gold-300); background: rgba(212, 168, 83, .1); }
.v5-eyebrow .icon { width: 1rem; height: 1rem; }

.v5-title {
  font-size: var(--v5-fs-h2);
  font-weight: 900;
  line-height: 1.25;
  margin: 0 0 1rem;
  color: inherit;
  text-wrap: balance;
}
.v5-title em,
.v5-gold-text {
  font-style: normal;
  background: var(--v5-grad-gold-text);
  background-size: 200% auto;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.v5-section--paper .v5-title em,
.v5-section--white .v5-title em {
  background: linear-gradient(100deg, var(--v5-gold-600), #8a6418 60%, var(--v5-gold-600));
  -webkit-background-clip: text;
          background-clip: text;
}

.v5-lead {
  font-size: var(--v5-fs-lead);
  line-height: 1.9;
  color: var(--v5-text-dark-2);
  margin: 0;
  text-wrap: pretty;
}
.v5-section--dark .v5-lead { color: var(--v5-text-2); }

/* ---------- Buttons ---------- */
.v5-btn {
  --_bg: var(--v5-ink-800);
  --_fg: #fff;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 52px;
  padding: .85rem 1.6rem;
  border-radius: var(--v5-r-full);
  border: 1px solid transparent;
  background: var(--_bg);
  color: var(--_fg) !important;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;
  transition: transform .25s var(--v5-ease), box-shadow .25s var(--v5-ease), background-color .25s, border-color .25s;
}
.v5-btn .icon { width: 1.2rem; height: 1.2rem; flex: none; }
.v5-btn:hover { transform: translateY(-2px); }
.v5-btn:active { transform: translateY(0); }
.v5-btn:focus-visible { outline: none; box-shadow: var(--v5-ring); }

.v5-btn--gold {
  --_bg: var(--v5-grad-gold);
  --_fg: #1a1205;
  background: var(--v5-grad-gold);
  box-shadow: var(--v5-shadow-gold), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.v5-btn--gold::after { /* shine sweep */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform .8s var(--v5-ease);
}
.v5-btn--gold:hover::after { transform: translateX(120%); }

.v5-btn--ghost {
  --_bg: transparent;
  --_fg: var(--v5-text-dark);
  border-color: var(--v5-line-light);
  background: rgba(255, 255, 255, .6);
}
.v5-section--dark .v5-btn--ghost,
.v5-on-dark .v5-btn--ghost {
  --_fg: var(--v5-text);
  border-color: var(--v5-line-dark-2);
  background: var(--v5-glass);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
}
.v5-btn--ghost:hover { border-color: rgba(212, 168, 83, .6); }

.v5-btn--wa {
  --_bg: var(--v5-wa);
  --_fg: #062b15;
  box-shadow: 0 14px 36px -14px rgba(37, 211, 102, .7);
}
.v5-btn--lg { min-height: 60px; padding: 1rem 2rem; font-size: 1.08rem; }
.v5-btn--sm { min-height: 42px; padding: .55rem 1.1rem; font-size: .92rem; }
.v5-btn--block { width: 100%; }
@media (max-width: 480px) {
  .v5-btn { white-space: normal; text-align: center; }
}

/* ---------- Cards & chips ---------- */
.v5-card {
  position: relative;
  border-radius: var(--v5-r-lg);
  background: var(--v5-card-light);
  border: 1px solid var(--v5-line-light);
  box-shadow: var(--v5-shadow-sm);
  padding: clamp(1.25rem, 1rem + 1vw, 2rem);
  transition: transform .4s var(--v5-ease), box-shadow .4s var(--v5-ease), border-color .4s;
}
.v5-section--dark .v5-card,
.v5-on-dark .v5-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  border-color: var(--v5-line-dark);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.v5-card--hover:hover {
  transform: translateY(-6px);
  box-shadow: var(--v5-shadow-md);
  border-color: rgba(212, 168, 83, .35);
}

/* Cursor spotlight: add data-v5-spotlight; v5-core.js feeds --mx/--my */
[data-v5-spotlight] { --mx: 50%; --my: 50%; }
[data-v5-spotlight]::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(380px circle at var(--mx) var(--my), rgba(212, 168, 83, .14), transparent 45%);
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}
[data-v5-spotlight]:hover::before { opacity: 1; }

.v5-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .8rem;
  border-radius: var(--v5-r-full);
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.5;
  background: var(--v5-paper-2);
  color: var(--v5-text-dark-2);
  border: 1px solid var(--v5-line-light);
}
.v5-section--dark .v5-chip,
.v5-on-dark .v5-chip { background: var(--v5-glass); color: var(--v5-text-2); border-color: var(--v5-line-dark); }
.v5-chip--gold { background: rgba(212, 168, 83, .14); color: var(--v5-gold-600); border-color: rgba(212, 168, 83, .3); }
.v5-section--dark .v5-chip--gold { color: var(--v5-gold-300); }
.v5-chip--new { background: rgba(25, 195, 138, .14); color: #0b8a5f; border-color: rgba(25, 195, 138, .3); }
.v5-section--dark .v5-chip--new { color: #5be0b0; }
.v5-chip .icon { width: .95rem; height: .95rem; }

/* Icon tile */
.v5-icon-tile {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(212, 168, 83, .22), rgba(212, 168, 83, .06));
  border: 1px solid rgba(212, 168, 83, .3);
  color: var(--v5-gold-600);
  flex: none;
}
.v5-section--dark .v5-icon-tile { color: var(--v5-gold-300); }
.v5-icon-tile .icon { width: 24px; height: 24px; }
.v5-icon-tile--blue { background: linear-gradient(145deg, rgba(79, 124, 255, .22), rgba(79, 124, 255, .06)); border-color: rgba(79, 124, 255, .3); color: #3459d9; }
.v5-icon-tile--green { background: linear-gradient(145deg, rgba(25, 195, 138, .22), rgba(25, 195, 138, .06)); border-color: rgba(25, 195, 138, .3); color: #0b8a5f; }
.v5-section--dark .v5-icon-tile--blue { color: var(--v5-blue-400); }
.v5-section--dark .v5-icon-tile--green { color: #5be0b0; }

/* Animated gold border (featured cards). Wrap content; element needs position:relative + border-radius. */
.v5-glow-border { position: relative; }
.v5-glow-border::after {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--v5-angle, 0deg), transparent 0 60%, var(--v5-gold-300) 75%, var(--v5-gold-500) 85%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: v5-spin 6s linear infinite;
  pointer-events: none;
}
@property --v5-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes v5-spin { to { --v5-angle: 360deg; } }

/* ---------- Scroll reveal (v5-core.js adds .is-in) ---------- */
[data-v5-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--v5-dur) var(--v5-ease), transform var(--v5-dur) var(--v5-ease);
  transition-delay: calc(var(--i, 0) * 80ms);
}
[data-v5-reveal="fade"] { transform: none; }
[data-v5-reveal="scale"] { transform: scale(.94); }
[data-v5-reveal="start"] { transform: translateX(32px); }
[data-v5-reveal="end"] { transform: translateX(-32px); }
[data-v5-reveal].is-in { opacity: 1; transform: none; }
html:not(.v5-js) [data-v5-reveal] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-v5-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .v5-glow-border::after { animation: none; }
  .v5-btn, .v5-card { transition: none; }
}

/* ---------- Helpers ---------- */
.v5-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.v5-actions { display: flex; flex-wrap: wrap; gap: .85rem; align-items: center; }
.v5-head .v5-actions { justify-content: center; margin-top: 1.75rem; }

/* WordPress block gap adds margin-block-start to every top-level block; v5 sections sit flush. */
:where(.wp-site-blocks) > :is(.v5-section, header.wp-block-template-part, footer.wp-block-template-part, .wp-block-group:has(> .v5-section)) {
  margin-block-start: 0;
}

/* ---------- Inner-page banner (old .page-banner markup stored in page content) ---------- */
.page-banner {
  background: var(--v5-grad-ink);
  padding: clamp(3.5rem, 2.5rem + 4vw, 6rem) var(--v5-gutter) clamp(3rem, 2rem + 3vw, 4.5rem);
  isolation: isolate;
}
.page-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--v5-grad-aurora);
  pointer-events: none;
}
.page-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--v5-line-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--v5-line-dark) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(60% 70% at 50% 40%, #000 20%, transparent 75%);
          mask-image: radial-gradient(60% 70% at 50% 40%, #000 20%, transparent 75%);
  pointer-events: none;
}
.page-banner .page-banner-title {
  font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3.2rem);
  font-weight: 900;
  line-height: 1.3;
  max-width: 900px;
  margin-inline: auto;
  text-wrap: balance;
}
.page-banner .page-banner-sub {
  color: var(--v5-text-2);
  font-size: var(--v5-fs-lead);
  line-height: 1.9;
  max-width: 760px;
  margin-inline: auto;
}
.page-banner .breadcrumbs { color: var(--v5-text-3); }
.page-banner .breadcrumbs a { color: var(--v5-gold-300); }
.wp-block-post-content > .page-banner:first-child,
.wp-block-post-content > :first-child .page-banner { margin-block-start: 0; }
