/* =========================================================================
   Visual enhancements, motion, depth, craft. Loaded site-wide.
   Everything is gated behind .js and disabled under prefers-reduced-motion.
   ========================================================================= */

/* ---- Reveal: smoother easing + directional + scale ---- */
.js .reveal { opacity: 0; transform: translateY(30px); filter: blur(2px);
  transition: opacity .7s cubic-bezier(.22,.7,.2,1), transform .7s cubic-bezier(.22,.7,.2,1), filter .7s ease; }
.js .reveal.in { opacity: 1; transform: none; filter: none; }
.js [data-rdir="left"]  { transform: translateX(-40px); }
.js [data-rdir="right"] { transform: translateX(40px); }
.js [data-rdir="scale"] { transform: scale(.93); }

/* ---- Staggered grids ---- */
.js .stagger > * { opacity: 0; transform: translateY(26px) scale(.98);
  transition: opacity .6s cubic-bezier(.22,.7,.2,1), transform .6s cubic-bezier(.22,.7,.2,1); }
.js .stagger.in-view > * { opacity: 1; transform: none; transition-delay: calc(var(--i, 0) * 70ms); }

@media (prefers-reduced-motion: reduce){
  .js .reveal, .js .stagger > *, .js [data-rdir] { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
}

/* ---- Hero: slow Ken-Burns zoom ---- */
@media (prefers-reduced-motion: no-preference){
  .hero-bg img { animation: kenburns 24s ease-in-out infinite alternate; will-change: transform; }
}
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.09); } }
@media (max-width: 640px){ .hero-bg img { animation: none; } }

/* ---- Gold shimmer on accent words ---- */
@media (prefers-reduced-motion: no-preference){
  .gold-word {
    background: linear-gradient(100deg, var(--gold) 28%, #f6e7bd 50%, var(--gold) 72%);
    background-size: 220% auto; -webkit-background-clip: text; background-clip: text;
    color: transparent; animation: shimmer 6s linear infinite;
  }
}
@keyframes shimmer { to { background-position: -220% center; } }

/* ---- Shader band layering ---- */
.has-shader { position: relative; isolation: isolate; }
.has-shader > .shader-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; border-radius: inherit; }
.has-shader > *:not(.shader-canvas) { position: relative; z-index: 1; }

/* ---- Card hover: image zoom + softer lift + gold edge ---- */
.course-card .thumb, .tool-hub-card { overflow: hidden; }
.course-card .thumb img { transition: transform .6s cubic-bezier(.22,.7,.2,1); will-change: transform; }
.card-hover:hover .thumb img { transform: scale(1.07); }
.card-hover { transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease; }
.card-hover:hover { border-color: rgba(212,168,67,.55); }

/* ---- Learning Journey: draw the path + pop the nodes ---- */
@media (prefers-reduced-motion: no-preference){
  .journey::before { transform: scaleX(0); transform-origin: left center; }
  .journey.in-view::before { transform: scaleX(1); transition: transform 1.1s cubic-bezier(.22,.7,.2,1); }
  .journey .journey-node { opacity: 0; transform: translateY(14px) scale(.8); }
  .journey.in-view .journey-step:nth-child(1) .journey-node { animation: nodepop .5s .15s forwards; }
  .journey.in-view .journey-step:nth-child(2) .journey-node { animation: nodepop .5s .30s forwards; }
  .journey.in-view .journey-step:nth-child(3) .journey-node { animation: nodepop .5s .45s forwards; }
  .journey.in-view .journey-step:nth-child(4) .journey-node { animation: nodepop .5s .60s forwards; }
  .journey.in-view .journey-step:nth-child(5) .journey-node { animation: nodepop .5s .75s forwards; }
}
@keyframes nodepop { to { opacity: 1; transform: none; } }

/* ---- Ornamental section divider (between major bands) ---- */
.orn-divider { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 2.2rem 0 .4rem; color: var(--gold); }
.orn-divider::before, .orn-divider::after { content: ""; height: 1px; width: min(160px, 22vw); background: linear-gradient(90deg, transparent, var(--gold)); }
.orn-divider::after { background: linear-gradient(270deg, transparent, var(--gold)); }
.orn-divider span { font-size: 13px; transform: rotate(45deg); opacity: .9; }

/* ---- Stat count-up: gold underline sweep ---- */
.stat .num { position: relative; display: inline-block; }
.js .stat .num::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: -8px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); transform: scaleX(0); transform-origin: center; transition: transform .8s ease .3s; }
.js .stats.in-view .stat .num::after, .js .kpi-dark.in-view .stat .num::after { transform: scaleX(1); }

/* ---- Buttons: subtle sheen on hover ---- */
.btn--primary, .btn--gold { position: relative; overflow: hidden; }
.btn--primary::after, .btn--gold::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-20deg); transition: left .6s ease; }
.btn--primary:hover::after, .btn--gold:hover::after { left: 120%; }

/* ==================== HERO v2 ==================== */
.hero-v2 .hero-scrim {
  background: linear-gradient(90deg, rgba(14,50,17,.95) 0%, rgba(14,50,17,.78) 32%, rgba(14,50,17,.42) 60%, rgba(14,50,17,.15) 100%),
              radial-gradient(120% 80% at 15% 40%, rgba(14,50,17,.35), transparent 60%);
}
/* blend hero into the cream section below */
.hero-v2 .hero-bg::after { content:""; position:absolute; left:0; right:0; bottom:0; height:130px; z-index:2; pointer-events:none;
  background: linear-gradient(transparent, var(--cream)); }

/* faint Read (اقرأ) calligraphy watermark */
.hero-calligraphy { position:absolute; z-index:0; right:5%; top:50%; transform:translateY(-50%);
  font-size: clamp(7rem, 20vw, 18rem); line-height:1; color:#fff; opacity:.07; pointer-events:none; user-select:none; }

/* ornamental mihrab arch outline over the dome side */
.hero-arch { position:absolute; right:3%; bottom:0; height:82%; width:auto; max-width:42%; z-index:1; pointer-events:none; }

.eyebrow-diamond { color:var(--gold); font-size:.7em; }
.hero-v2 h1 { line-height:1.08; letter-spacing:-.5px; }

/* feature trust strip under the buttons */
.hero-trust { list-style:none; padding:0; margin:1.7rem 0 0; display:flex; flex-wrap:wrap; gap:.6rem 1.5rem; }
.hero-trust li { display:inline-flex; align-items:center; gap:.45rem; color:rgba(255,255,255,.92); font-weight:500; font-size:.92rem; }
.hero-trust li .icon { width:18px; height:18px; color:var(--gold); }

/* mobile: clean stacked hero, drop the desktop-only flourishes */
@media (max-width: 640px){
  .hero-calligraphy, .hero-arch, .hero-v2 .hero-bg::after { display:none; }
  .hero-trust { gap:.5rem 1.2rem; }
  .hero-v2 h1 br { display:none; }
}
