/*
 * Ekhaa 2026 — motion layer for the light design.
 *
 * Loaded after sector.css. The earlier motion was written for a dark page and
 * most of it reads as nothing on cream, so this is a fresh set tuned to the
 * light palette: shadow, scale and mask rather than glow.
 *
 * Every rule sits inside `@media (prefers-reduced-motion: no-preference)` or is
 * cancelled by :root[data-ekhaa-motion="off"]. Deleting this file changes
 * nothing except that the page stops moving.
 */

@media (prefers-reduced-motion: no-preference) {

/* ==========================================================================
   1. The arch opens
   The signature shape should arrive by opening, not by fading.
   ========================================================================== */

:root[data-ekhaa-anim="on"] .arch {
	clip-path: inset(0 0 100% 0 round 50% 50% 18px 18px / 32% 32% 18px 18px);
	transition: clip-path 1.15s cubic-bezier(.19,1,.22,1);
}
:root[data-ekhaa-anim="on"] .arch.is-in {
	clip-path: inset(0 0 0 0 round 50% 50% 18px 18px / 32% 32% 18px 18px);
}

/* and breathes very slowly once open */
.arch img { transition: transform 1.2s var(--ease); }
.arch:hover img { transform: scale(1.05); }

/* The gold outline behind it draws upward. */
:root[data-ekhaa-anim="on"] .arch--framed::before {
	transform: scaleY(0);
	transform-origin: bottom;
	transition: transform .9s cubic-bezier(.19,1,.22,1) .25s;
}
:root[data-ekhaa-anim="on"] .arch-wrap.is-in .arch--framed::before,
:root[data-ekhaa-anim="on"] .arch--framed.is-in::before { transform: scaleY(1); }

/* ==========================================================================
   2. Headline — the emphasised word lifts and colours in
   ========================================================================== */

:root[data-ekhaa-anim="on"] .ekhaa-hero h1 em {
	display: inline-block;
	animation: ekhaa-word 1s cubic-bezier(.19,1,.22,1) .45s backwards;
}
@keyframes ekhaa-word {
	from { opacity: 0; transform: translateY(.35em) rotate(-2deg); }
	to   { opacity: 1; transform: none; }
}

/* A slow warm wash behind the hero, so the cream is never flat. */
.ekhaa-hero::before {
	content: "";
	display: block;
	position: absolute;
	inset: -20% -10% auto -10%;
	height: 70%;
	background: radial-gradient(60% 60% at 70% 30%, rgba(220,168,89,.28), transparent 70%);
	pointer-events: none;
	animation: ekhaa-wash 18s ease-in-out infinite alternate;
}
@keyframes ekhaa-wash {
	from { transform: translate3d(0,0,0) scale(1); opacity: .75; }
	to   { transform: translate3d(-4%, 3%, 0) scale(1.15); opacity: 1; }
}

/* ==========================================================================
   3. Cards lift on a real shadow, which is what reads on a light page
   ========================================================================== */

.ekhaa-card,
.impact__item {
	transition:
		transform .45s cubic-bezier(.19,1,.22,1),
		box-shadow .45s cubic-bezier(.19,1,.22,1),
		border-color .35s var(--ease);
}
.impact__item:hover {
	transform: translateY(-6px);
	box-shadow: var(--shadow-lift);
	border-color: var(--sand);
}

/* The eyebrow diamond turns as its card is entered. */
.ekhaa-card .ekhaa-eyebrow::before,
.impact__item .ekhaa-eyebrow::before {
	transition: transform .5s cubic-bezier(.19,1,.22,1), background-color .3s var(--ease);
}
.ekhaa-card:hover .ekhaa-eyebrow::before,
.impact__item:hover .ekhaa-eyebrow::before {
	transform: rotate(225deg);
	background: var(--clay-deep);
}

/* ==========================================================================
   4. Section dividers draw themselves
   ========================================================================== */

:root[data-ekhaa-anim="on"] .najdi-band {
	transform: scaleX(0);
	transform-origin: inline-start;
	transition: transform 1.1s cubic-bezier(.19,1,.22,1);
}
:root[data-ekhaa-anim="on"] .najdi-band.is-in { transform: scaleX(1); }

/* ==========================================================================
   5. The pledge arrives as a block
   ========================================================================== */

:root[data-ekhaa-anim="on"] .pledge blockquote {
	opacity: 0;
	transform: translateX(28px);
	transition: opacity .9s var(--ease) .2s, transform .9s cubic-bezier(.19,1,.22,1) .2s;
}
:root[data-ekhaa-anim="on"] .pledge.is-in blockquote { opacity: 1; transform: none; }

/* ==========================================================================
   6. Branch rows: a gold edge wipes in on hover
   ========================================================================== */

.branch { position: relative; }
.branch::after {
	content: "";
	position: absolute;
	inset-inline: 0;
	bottom: -1px;
	height: 2px;
	background: var(--gold);
	transform: scaleX(0);
	transform-origin: inline-end;
	transition: transform .4s cubic-bezier(.19,1,.22,1);
}
.branch:hover::after,
.branch:focus-visible::after { transform: scaleX(1); transform-origin: inline-start; }

/* ==========================================================================
   7. Primary action: a slow ring, so the one CTA is findable
   ========================================================================== */

.ekhaa-btn--cta { position: relative; }
.ekhaa-btn--cta::after {
	content: "";
	position: absolute;
	inset: -4px;
	border-radius: inherit;
	border: 2px solid var(--clay-deep);
	opacity: 0;
	animation: ekhaa-ring 3.6s ease-out infinite;
	pointer-events: none;
}
@keyframes ekhaa-ring {
	0%   { opacity: .5; transform: scale(1); }
	55%  { opacity: 0;  transform: scale(1.14); }
	100% { opacity: 0;  transform: scale(1.14); }
}

/* ==========================================================================
   8. Header condenses once the page moves
   ========================================================================== */

.ekhaa-header { transition: box-shadow .35s var(--ease), background-color .35s var(--ease); }
.ekhaa-header.is-stuck {
	box-shadow: 0 1px 0 var(--line), 0 10px 30px -18px rgba(22,40,74,.35);
	background: rgba(253,251,246,.96);
}
.ekhaa-header__inner { transition: min-height .35s var(--ease); }
.is-stuck .ekhaa-header__inner { min-height: 62px; }

/* ==========================================================================
   9. Page transition
   The six pages are separate documents, so a short fade on arrival and on
   leaving makes them feel like one site.
   ========================================================================== */

:root[data-ekhaa-anim="on"] body { animation: ekhaa-enter .5s ease-out; }
:root[data-ekhaa-anim="on"] body.is-leaving { opacity: 0; transition: opacity .22s ease-in; }

@keyframes ekhaa-enter {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

/* ==========================================================================
   10. The FAQ answer slides rather than snaps
   ========================================================================== */

.faq[open] > div,
.faq[open] > p { animation: ekhaa-unfold .4s cubic-bezier(.19,1,.22,1); }
@keyframes ekhaa-unfold {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: none; }
}

} /* end no-preference */

/* ==========================================================================
   The off switch — everything above, cancelled
   ========================================================================== */

:root[data-ekhaa-motion="off"] .arch,
:root[data-ekhaa-motion="off"] .arch--framed::before,
:root[data-ekhaa-motion="off"] .najdi-band,
:root[data-ekhaa-motion="off"] .pledge blockquote {
	clip-path: none !important;
	transform: none !important;
	opacity: 1 !important;
	transition: none !important;
}
:root[data-ekhaa-motion="off"] .ekhaa-hero::before,
:root[data-ekhaa-motion="off"] .ekhaa-btn--cta::after,
:root[data-ekhaa-motion="off"] .ekhaa-hero h1 em,
:root[data-ekhaa-motion="off"] body { animation: none !important; }
:root[data-ekhaa-motion="off"] .ekhaa-btn--cta::after { display: none; }

/* ==========================================================================
   Off switch, part two
   These animations live in cinema.css inside a prefers-reduced-motion query,
   so they obeyed the operating system but ignored the in-page toggle. A
   visitor who presses "إيقاف الحركة" must get stillness from BOTH paths.
   Found by counting elements still animating after pressing it.
   ========================================================================== */

:root[data-ekhaa-motion="off"] .journey__node,
:root[data-ekhaa-motion="off"] .journey .journey__node,
:root[data-ekhaa-motion="off"] .journey.is-in .journey__node,
:root[data-ekhaa-motion="off"] .branch,
:root[data-ekhaa-motion="off"] .branches.is-in .branch,
:root[data-ekhaa-motion="off"] .ekhaa-mote,
:root[data-ekhaa-motion="off"] .ekhaa-marquee__track,
:root[data-ekhaa-motion="off"] .ekhaa-scroll span,
:root[data-ekhaa-motion="off"] .assistant-mock__dot,
:root[data-ekhaa-motion="off"] .is-entering *,
:root[data-ekhaa-motion="off"] [class*="ekhaa-"]::before,
:root[data-ekhaa-motion="off"] [class*="ekhaa-"]::after {
	animation: none !important;
	transition: none !important;
}

/* Belt and braces: nothing anywhere may animate once it is switched off. */
:root[data-ekhaa-motion="off"] *,
:root[data-ekhaa-motion="off"] *::before,
:root[data-ekhaa-motion="off"] *::after {
	animation-duration: 0.001ms !important;
	animation-iteration-count: 1 !important;
	transition-duration: 0.001ms !important;
	scroll-behavior: auto !important;
}
