/* ============================================================
   WATAD — Core UI: loader, header, hero, anchor line, buttons
   ============================================================ */

/* ---------------- Preloader ---------------- */
.loader {
  position: fixed; inset: 0; z-index: var(--z-loader);
  display: grid; place-items: center;
  background: var(--ivory);
  transition: opacity .8s var(--e-out), visibility .8s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__inner { display: grid; justify-items: center; gap: 1.4rem; }
.loader__mark { width: 74px; height: 74px; opacity: 0; transform: translateY(8px);
  animation: markIn 1s var(--e-out) .1s forwards; }
.loader__mark svg { width: 100%; height: 100%; }
.loader__logo { width: clamp(122px, 24vw, 156px); height: auto; opacity: 0; transform: translateY(8px) scale(.98); animation: markIn 1s var(--e-out) .1s forwards; }
.loader__word {
  font-family: var(--font-display); font-size: 1.15rem; letter-spacing: .58em;
  text-indent: .58em; text-transform: uppercase; color: var(--ink);
}
.loader__bar { width: 132px; height: 2px; background: var(--line); overflow: hidden; border-radius: 2px; }
.loader__bar span { display: block; height: 100%; width: 0; background: var(--grad-gold); animation: barFill 1.6s var(--e-inout) forwards; }
@keyframes markIn { to { opacity: 1; transform: none; } }
@keyframes barFill { to { width: 100%; } }

/* ---------------- Anchor line (signature) ---------------- */
.anchorline {
  position: fixed; top: 0; bottom: 0; inset-inline-start: var(--anchor-x, clamp(1rem, 4.2vw, 4rem));
  width: 1px; z-index: var(--z-line); pointer-events: none;
  background: linear-gradient(180deg, transparent 0, var(--line) 8%, var(--line) 92%, transparent 100%);
}
.anchorline__fill {
  position: absolute; top: 0; inset-inline-start: 0; width: 1px;
  height: calc(var(--scroll, 0) * 100%);
  background: var(--grad-gold-v);
  box-shadow: 0 0 12px rgba(201,162,74,.5);
}
.anchorline__node {
  position: absolute; inset-inline-start: 50%; bottom: -5px;
  width: 9px; height: 9px; transform: translateX(-50%) rotate(45deg);
  background: var(--grad-gold); box-shadow: 0 0 14px rgba(201,162,74,.7);
}
[dir="rtl"] .anchorline__node { transform: translateX(50%) rotate(45deg); }
@media (max-width: 720px) { .anchorline { display: none; } }

/* ---------------- Header / nav ---------------- */
.header {
  position: fixed; inset-inline: 0; top: 0; z-index: var(--z-header);
  padding-block: 1.15rem;
  transition: background var(--t-fast) var(--e-out), box-shadow var(--t-fast), padding var(--t-fast), border-color var(--t-fast);
  border-bottom: 1px solid transparent;
}
.header.is-scrolled {
  background: rgba(251,250,246,.86);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--line);
  padding-block: .7rem;
}
.header__row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; }
.brand__mark { height: 30px; flex: none; display: inline-flex; align-items: center; }
.brand__mark svg, .brand__mark img { height: 100%; width: auto; object-fit: contain; }
.mark-img { display: block; height: 100%; width: auto; object-fit: contain; }
.brand__word {
  font-family: var(--font-display); font-weight: 600; font-size: 1.32rem;
  letter-spacing: .3em; text-indent: .3em; text-transform: uppercase; line-height: 1;
}
[dir="rtl"] .brand__word { font-family: var(--font-display-ar); letter-spacing: normal; text-indent: 0; }

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.4rem); }
.nav__links { display: flex; align-items: center; gap: clamp(1rem, 2vw, 2rem); }
.nav__link {
  font-size: .82rem; font-weight: 500; letter-spacing: .06em; color: var(--ink);
  position: relative; padding-block: .3rem; opacity: .82; transition: opacity var(--t-fast);
}
.nav__link::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1px;
  background: var(--gold); transform: scaleX(0); transform-origin: inline-start;
  transition: transform var(--t-fast) var(--e-out);
}
.nav__link:hover { opacity: 1; }
.nav__link:hover::after { transform: scaleX(1); }

/* language toggle */
.langtoggle { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-pill); overflow: hidden; }
.langtoggle button {
  min-height: 38px; padding: .32rem .7rem; font-size: .74rem; font-weight: 600; letter-spacing: .08em;
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--muted); transition: color var(--t-fast), background var(--t-fast);
}
/* SVG flags rather than emoji: Windows renders flag emoji as bare letters ("EG"),
   which would look broken on a large share of desktop visitors. */
.langtoggle .flag {
  width: 18px; height: auto; flex: none; border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(23,21,15,.16); transition: opacity var(--t-fast);
}
.langtoggle button[aria-pressed="false"] .flag { opacity: .45; }
.langtoggle button[aria-pressed="false"]:hover .flag { opacity: 1; }
.langtoggle button[aria-pressed="true"] {
  color: var(--onyx); background: var(--gold-tint); box-shadow: inset 0 0 0 1px var(--gold);
}
.langtoggle button:first-child { border-inline-end: 1px solid var(--line); }

/* mobile toggle */
.navtoggle { display: none; width: 42px; height: 42px; position: relative; }
.navtoggle span { position: absolute; inset-inline: 10px; height: 1.5px; background: var(--ink); transition: transform var(--t-fast) var(--e-out), opacity var(--t-fast); }
.navtoggle span:nth-child(1) { top: 15px; } .navtoggle span:nth-child(2) { top: 21px; } .navtoggle span:nth-child(3) { top: 27px; }
body.nav-open .navtoggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.nav-open .navtoggle span:nth-child(2) { opacity: 0; }
body.nav-open .navtoggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* While the menu is open the header must NOT have a backdrop-filter: that would
   make it the containing block for the fixed panel, clipping the menu to the
   header's own 60px box instead of the viewport. */
body.nav-open .header,
body.nav-open .header.is-scrolled {
  -webkit-backdrop-filter: none; backdrop-filter: none;
  background: rgba(251,250,246,.98);
}

@media (max-width: 900px) {
  .navtoggle { display: block; }

  /* No backdrop-filter anywhere in the header on mobile. A filtered ancestor
     becomes the containing block for position:fixed descendants, which would
     clip the menu panel to the header's own 60px box — the menu items then
     spill out over the page instead of filling the screen. */
  .header, .header.is-scrolled {
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .header.is-scrolled { background: rgba(251,250,246,.97); }

  .nav__links {
    position: fixed; inset: 0; top: 0; width: 100vw; max-width: 100vw;
    height: 100vh; height: 100dvh;
    flex-direction: column; justify-content: center;
    gap: 1.6rem; background: var(--ivory);
    overscroll-behavior: contain;
    transform: translateY(-100%); transition: transform var(--t-med) var(--e-inout); z-index: -1;
  }
  body.nav-open .nav__links { transform: translateY(0); }
  .nav__link { font-size: 1.35rem; font-family: var(--font-display); letter-spacing: .1em; }
  [dir="rtl"] .nav__link { font-family: var(--font-display-ar); letter-spacing: normal; }
}

/* keep the header row on one line on small phones */
@media (max-width: 480px) {
  .brand__mark { height: 26px; }
  .brand__word { font-size: 1.02rem; letter-spacing: .18em; text-indent: .18em; }
  .nav { gap: .5rem; }
  .nav__book { --btn-px: .85rem; font-size: .68rem; }
  /* the flag alone identifies the language here — dropping the EN/ع text keeps
     the header on one line now that the CTA reads "Request" */
  .langtoggle button { padding: .3rem .5rem; font-size: .68rem; min-height: 34px; gap: 0; }
  .langtoggle button > span { display: none; }
  .navtoggle { width: 36px; }
}

/* ---------------- Buttons ---------------- */
.btn {
  --btn-py: .95rem; --btn-px: 1.7rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: var(--btn-py) var(--btn-px);
  font-family: var(--font-body); font-size: .82rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; line-height: 1;
  border-radius: var(--r-pill); position: relative; overflow: hidden; isolation: isolate;
  transition: transform var(--t-fast) var(--e-out), box-shadow var(--t-fast), color var(--t-fast), background var(--t-fast);
  white-space: nowrap;
}
[dir="rtl"] .btn { font-family: var(--font-body-ar); letter-spacing: 0; font-weight: 700; }
.btn:active { transform: translateY(1px); }
.btn__i { width: 1.05em; height: 1.05em; }

.btn--gold { background: var(--grad-gold); background-size: 180% 180%; color: var(--onyx); box-shadow: var(--sh-gold); }
.btn--gold::after {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--grad-sheen);
  transform: translateX(-130%); transition: transform .7s var(--e-out);
}
.btn--gold:hover { transform: translateY(-2px); box-shadow: 0 18px 46px -14px rgba(160,122,44,.6); }
.btn--gold:hover::after { transform: translateX(130%); }
[dir="rtl"] .btn--gold:hover::after { transform: translateX(-130%); }

.btn--dark { background: var(--onyx); color: var(--ivory); }
.btn--dark:hover { transform: translateY(-2px); box-shadow: var(--sh-2); color: var(--gold-200); }

.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--gold-line); }
.btn--ghost:hover { background: var(--gold-tint); box-shadow: inset 0 0 0 1px var(--gold); }

.btn--ghost-light { background: transparent; color: var(--ivory); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.btn--ghost-light:hover { background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.7); }

.btn--sm { --btn-py: .7rem; --btn-px: 1.2rem; font-size: .74rem; }
.btn--lg { --btn-py: 1.1rem; --btn-px: 2.2rem; }

/* text link with arrow */
.tlink { display: inline-flex; align-items: center; gap: .5rem; font-size: .82rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-600); }
[dir="rtl"] .tlink { letter-spacing: 0; }
.tlink svg { width: 1.1em; height: 1.1em; transition: transform var(--t-fast) var(--e-out); }
.tlink:hover svg { transform: translateX(4px); }
[dir="rtl"] .tlink svg { transform: scaleX(-1); }
[dir="rtl"] .tlink:hover svg { transform: scaleX(-1) translateX(4px); }

/* ---------------- Hero ---------------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; background: var(--onyx); }
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media img, .hero__media video { width: 100%; height: 100%; object-fit: cover; }
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(12,12,14,.32) 0%, rgba(12,12,14,0) 30%, rgba(12,12,14,.12) 60%, rgba(12,12,14,.78) 100%),
    linear-gradient(90deg, rgba(12,12,14,.42) 0%, rgba(12,12,14,0) 55%);
}
[dir="rtl"] .hero__media::after { background:
    linear-gradient(180deg, rgba(12,12,14,.32) 0%, rgba(12,12,14,0) 30%, rgba(12,12,14,.12) 60%, rgba(12,12,14,.78) 100%),
    linear-gradient(270deg, rgba(12,12,14,.42) 0%, rgba(12,12,14,0) 55%); }

.hero__inner { position: relative; z-index: 1; width: 100%; padding-block: clamp(3rem, 8vh, 7rem); }
.hero__eyebrow { color: var(--gold-200); margin-bottom: 1.3rem; opacity: 0; }
.hero__title {
  font-family: var(--font-display); font-weight: 500; color: var(--white);
  font-size: var(--fs-hero); line-height: 1.02; letter-spacing: .01em; max-width: 15ch;
}
[dir="rtl"] .hero__title { font-family: var(--font-display-ar); line-height: 1.2; }
.hero__title .accent { display: block; }
.hero__sub { margin-top: 1.5rem; max-width: 46ch; color: rgba(251,250,246,.82); font-size: var(--fs-lead); }
.hero__actions { margin-top: 2.4rem; display: flex; flex-wrap: wrap; gap: .9rem; }

.hero__meta { margin-top: 3rem; display: flex; flex-wrap: wrap; gap: 2rem 2.6rem; align-items: center; }
.hero__stat { display: grid; gap: .15rem; }
.hero__stat b { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; color: var(--white); line-height: 1; }
[dir="rtl"] .hero__stat b { font-family: var(--font-display-ar); }
.hero__stat span { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(251,250,246,.6); }
[dir="rtl"] .hero__stat span { letter-spacing: .04em; }

.scroll-cue {
  position: absolute; z-index: 1; bottom: 1.7rem; inset-inline-end: var(--gutter);
  display: inline-flex; align-items: center; gap: .7rem; color: rgba(251,250,246,.7);
  font-size: .68rem; letter-spacing: .22em; text-transform: uppercase; writing-mode: vertical-rl;
}
.scroll-cue i { display: block; width: 1px; height: 46px; background: linear-gradient(rgba(251,250,246,.7), transparent); position: relative; overflow: hidden; }
.scroll-cue i::after { content: ""; position: absolute; top: -50%; left: 0; width: 100%; height: 50%; background: var(--gold-200); animation: cueRun 2.2s var(--e-inout) infinite; }
@keyframes cueRun { 0% { top: -50%; } 100% { top: 100%; } }
@media (max-width: 720px) { .scroll-cue { display: none; } }

/* hero load choreography (JS adds .is-ready to body; gated on html.js so
   content is fully visible if scripts never run) */
html.js .hero__eyebrow, html.js .hero__title, html.js .hero__sub,
html.js .hero__actions, html.js .hero__trust { opacity: 0; transform: translateY(22px); }
body.is-ready .hero__eyebrow { animation: heroUp .9s var(--e-out) .15s forwards; }
body.is-ready .hero__title { animation: heroUp 1.05s var(--e-out) .3s forwards; }
body.is-ready .hero__sub { animation: heroUp 1s var(--e-out) .5s forwards; }
body.is-ready .hero__actions { animation: heroUp 1s var(--e-out) .66s forwards; }
body.is-ready .hero__trust { animation: heroUp 1s var(--e-out) .8s forwards; }
@keyframes heroUp { to { opacity: 1; transform: none; } }

/* ---------------- Section head ---------------- */
.section-head { max-width: 62ch; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head__index {
  font-family: var(--font-display); font-size: .9rem; letter-spacing: .3em; color: var(--gold-600);
  display: inline-flex; align-items: center; gap: .8rem; margin-bottom: 1.1rem;
}
/* Cinzel carries no Arabic glyphs, so in RTL this fell back to whatever Arabic
   font the OS supplied (Geeza Pro on iOS, Noto Naskh on Android) — and 0.3em of
   letter-spacing on a cursive script severs the joins between letters. */
[dir="rtl"] .section-head__index { font-family: var(--font-body-ar); letter-spacing: normal; font-weight: 700; }
.section-head__index::before { content: ""; width: 34px; height: 1px; background: var(--gold-line); }
.section-head.center .section-head__index { justify-content: center; }
.section-head__title { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h2); line-height: 1.1; color: var(--ink); }
[dir="rtl"] .section-head__title { font-family: var(--font-display-ar); line-height: 1.3; }
.section-head__intro { margin-top: 1.1rem; color: var(--muted); font-size: var(--fs-lead); max-width: 52ch; }
.section-head.center .section-head__intro { margin-inline: auto; }

/* ---------------- Scroll reveal (gated on html.js) ---------------- */
.reveal { transition: opacity .7s var(--e-out), transform .7s var(--e-out); will-change: opacity, transform; }
html.js .reveal { opacity: 0; transform: translateY(24px); }
html.js .reveal.in { opacity: 1; transform: none; }
html.js .reveal[data-reveal="left"] { transform: translateX(-32px); }
html.js .reveal[data-reveal="right"] { transform: translateX(32px); }
html.js .reveal.in[data-reveal] { transform: none; }
.reveal[data-delay="1"] { transition-delay: .1s; }
.reveal[data-delay="2"] { transition-delay: .2s; }
.reveal[data-delay="3"] { transition-delay: .3s; }
.reveal[data-delay="4"] { transition-delay: .4s; }
@media (prefers-reduced-motion: reduce) { html.js .reveal { opacity: 1 !important; transform: none !important; } }

/* dark section */
.section--dark { background: var(--grad-onyx); color: var(--ivory); }
.section--dark .section-head__title { color: var(--white); }
.section--dark .section-head__intro { color: var(--muted-dark); }
.section--bone { background: var(--bone); }

/* anchor-scroll offset for the fixed header */
:where(main [id], footer[id]) { scroll-margin-top: 5rem; }

/* ============================================================
   Desktop custom cursor
   ============================================================ */
/* The gold ring trails the real pointer. The system cursor stays visible inside
   it — so the arrow, the hand over links and the I-beam over text all behave
   exactly as the user expects, instead of a decorative dot. */
.cursor-ring { position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; border-radius: 50%; will-change: transform; }
.cursor-ring { width: 34px; height: 34px; border: 1.5px solid var(--gold); opacity: .85; transition: opacity .3s, background .3s, border-color .3s; }
html.cursor-hover .cursor-ring { background: rgba(201,162,74,.14); border-color: var(--gold-300); }
@media (max-width: 1023px) { .cursor-ring { display: none; } }

/* idle attention on the persistent Book CTA (desktop, motion-safe) */
@keyframes bookPulse { 0%, 100% { box-shadow: var(--sh-gold); } 50% { box-shadow: 0 14px 44px -12px rgba(160,122,44,.7), 0 0 0 4px rgba(201,162,74,.12); } }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .nav__book { animation: bookPulse 3.6s var(--e-inout) infinite; } }

/* ============================================================
   Floating buttons — WhatsApp (primary) and back to top
   ============================================================ */
:root { --fab-inset: clamp(1.1rem, 3vw, 2rem); --fab-size: 58px; --fab-gap: .65rem; }
@media (max-width: 720px) { :root { --fab-size: 52px; } }

.wafab {
  position: fixed; inset-block-end: var(--fab-inset); inset-inline-end: var(--fab-inset);
  z-index: 90; width: var(--fab-size); height: var(--fab-size); border-radius: 50%;
  display: grid; place-items: center; color: var(--onyx);
  background: var(--grad-gold); box-shadow: var(--sh-gold);
  transition: transform var(--t-fast) var(--e-out), box-shadow var(--t-fast), opacity var(--t-fast);
}
.wafab svg { width: 30px; height: 30px; position: relative; z-index: 1; }
.wafab:hover { transform: translateY(-3px); box-shadow: 0 18px 46px -14px rgba(160,122,44,.65); }
.wafab__pulse { position: absolute; inset: 0; border-radius: 50%; background: var(--gold); z-index: 0; opacity: 0; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .wafab__pulse { animation: waPulse 2.8s var(--e-out) infinite; } }
@keyframes waPulse { 0% { opacity: .45; transform: scale(1); } 100% { opacity: 0; transform: scale(1.85); } }
@media (max-width: 720px) { .wafab svg { width: 27px; height: 27px; } }

/* Back to top — deliberately quieter than the gold WhatsApp button:
   it's a utility, not a call to action. Stacked directly above it. */
.totop {
  position: fixed; inset-inline-end: var(--fab-inset);
  inset-block-end: calc(var(--fab-inset) + var(--fab-size) + var(--fab-gap));
  z-index: 90; width: var(--fab-size); height: var(--fab-size); border-radius: 50%;
  display: grid; place-items: center; color: var(--gold-700);
  background: var(--ivory); box-shadow: var(--sh-2), inset 0 0 0 1px var(--gold-line);
  opacity: 0; visibility: hidden; transform: translateY(10px) scale(.94); pointer-events: none;
  transition: opacity var(--t-fast) var(--e-out), transform var(--t-fast) var(--e-out),
              visibility var(--t-fast), box-shadow var(--t-fast), color var(--t-fast);
}
.totop.is-show { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
.totop svg { width: 22px; height: 22px; }
.totop:hover { color: var(--onyx); box-shadow: var(--sh-2), inset 0 0 0 1px var(--gold); }
.totop.is-show:hover { transform: translateY(-3px); }
.totop:active { transform: translateY(0) scale(.96); }

/* the floating buttons must not sit on top of the open mobile menu */
body.nav-open .wafab, body.nav-open .totop { opacity: 0; pointer-events: none; }
