/* أكاديمية الفايزية: الألوان والخطوط من دليل فواز v2، والإخراج حديث */
@font-face { font-family: "Alexandria"; src: url("fonts/Alexandria-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Almarai"; src: url("fonts/Almarai-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }

:root {
  --deep: #0E3A36;
  --green: #1F7A70;
  --wine: #2A2130;
  --gold: #D9B86C;
  --cream: #F5F1E3;
  --silver: #DADDED;
  --expo: cubic-bezier(.16, 1, .3, 1);
  --head: "Alexandria", system-ui, sans-serif;
  --body: "Almarai", system-ui, sans-serif;
  --pad: clamp(20px, 5vw, 72px);
}

* { box-sizing: border-box; }
html { scroll-padding-top: 90px; overflow-x: clip; }
body {
  margin: 0;
  background: var(--wine);
  color: var(--cream);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2 { font-family: var(--head); font-weight: 600; margin: 0; }
em { font-style: normal; color: var(--gold); }
bdi { unicode-bidi: isolate; white-space: nowrap; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
::selection { background: var(--gold); color: var(--deep); }

/* حبيبات خفيفة فوق كل شي */
.grain {
  position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 15px; letter-spacing: .02em; color: var(--gold); margin: 0 0 18px;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: ping 2.4s var(--expo) infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(217,184,108,.55); } 100% { box-shadow: 0 0 0 14px rgba(217,184,108,0); } }

/* ===== الشريط العلوي ===== */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 32px;
  padding: 18px var(--pad);
  transition: transform .6s var(--expo), background .4s, padding .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.topbar.solid {
  background: rgba(14, 58, 54, .72);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  padding-block: 12px;
  border-color: rgba(217, 184, 108, .18);
}
.topbar.hide { transform: translateY(-110%); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-ar { font-family: var(--head); font-weight: 600; font-size: 22px; color: var(--gold); }
.brand-en { font-family: var(--head); font-size: 10px; letter-spacing: .34em; color: var(--silver); direction: ltr; text-align: right; }
.nav { display: flex; gap: 30px; margin-inline-start: auto; }
.nav a { position: relative; font-size: 15px; opacity: .82; transition: opacity .3s; }
.nav a::after { content: ""; position: absolute; inset: auto 0 -4px 0; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: right; transition: transform .5s var(--expo); }
.nav a:hover { opacity: 1; }
.nav a:hover::after { transform: scaleX(1); }

.pill {
  font-family: var(--head); font-weight: 600; font-size: 14px;
  padding: 10px 20px; border-radius: 999px;
  border: 1px solid rgba(217, 184, 108, .6); color: var(--gold);
  position: relative; overflow: hidden; isolation: isolate;
  transition: color .4s var(--expo);
}
.pill::before { content: ""; position: absolute; inset: 0; background: var(--gold); transform: translateY(101%); transition: transform .5s var(--expo); z-index: -1; }
.pill:hover { color: var(--deep); }
.pill:hover::before { transform: none; }

/* ===== الأزرار ===== */
.btn {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--head); font-weight: 600; font-size: 17px;
  padding: 10px 28px 10px 10px; border-radius: 999px;
  background: var(--gold); color: var(--deep);
  position: relative; overflow: hidden; isolation: isolate;
  transition: transform .5s var(--expo);
  will-change: transform;
}
.btn::before { content: ""; position: absolute; inset: 0; background: var(--cream); border-radius: inherit; transform: scale(0); transition: transform .6s var(--expo); z-index: -1; }
.btn:hover::before { transform: scale(1.05); }
.btn svg { order: 2; width: 38px; height: 38px; padding: 9px; border-radius: 50%; background: var(--deep); color: var(--gold); transition: transform .5s var(--expo); }
.btn:hover svg { transform: translateX(-4px); }
.btn-light { background: var(--cream); }
.btn-light::before { background: var(--gold); }

/* ===== الواجهة ===== */
.hero { position: relative; height: 100svh; min-height: 620px; display: flex; align-items: flex-end; overflow: hidden; background: var(--deep); }
.hero-media {
  position: absolute; inset: 0;
  clip-path: inset(14% 10% 14% 10% round 28px);
  transform: scale(1.12);
  transition: clip-path 1.6s var(--expo), transform 2.2s var(--expo);
}
.loaded .hero-media { clip-path: inset(0 0 0 0 round 0); transform: scale(1); }
.hero-video { width: 100%; height: 100%; object-fit: cover; object-position: center 70%; }
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to left, rgba(14,58,54,.78) 0%, rgba(14,58,54,.45) 38%, rgba(14,58,54,0) 68%),
    linear-gradient(to top, rgba(14,58,54,.94) 0%, rgba(14,58,54,.4) 45%, rgba(42,33,48,.12) 70%, rgba(42,33,48,.55) 100%);
}
.hero-content { position: relative; padding: 0 var(--pad) clamp(56px, 10vh, 120px); width: 100%; will-change: transform, opacity; }
.hero-title { font-size: clamp(44px, 8.4vw, 132px); line-height: 1.12; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; margin-top: clamp(26px, 4vh, 44px); }
.hero-phone { font-family: var(--head); font-weight: 600; font-size: 24px; color: var(--cream); opacity: .9; border-bottom: 1px solid rgba(245,241,227,.35); padding-bottom: 2px; transition: color .3s, border-color .3s; }
.hero-phone:hover { color: var(--gold); border-color: var(--gold); }

/* كشف السطور من خلف قناع */
.line { display: block; overflow: hidden; padding-block: .08em; }
.line > span, .line > bdi { display: inline-block; transform: translateY(115%); transition: transform 1.3s var(--expo); transition-delay: var(--d, 0s); }
.loaded .hero-title .line > span { transform: none; }
.intro { opacity: 0; transform: translateY(16px); transition: opacity 1s var(--expo), transform 1s var(--expo); transition-delay: var(--d, 0s); }
.loaded .intro { opacity: 1; transform: none; }

.scroll-cue { position: absolute; left: var(--pad); bottom: 40px; width: 1px; height: 64px; background: rgba(245,241,227,.25); overflow: hidden; }
.scroll-cue span { position: absolute; inset: 0; background: var(--gold); animation: cue 2.2s var(--expo) infinite; }
@keyframes cue { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

/* ===== الشريط المتحرك ===== */
.marquee { background: var(--gold); color: var(--deep); overflow: hidden; padding: 16px 0; transform: rotate(-1.2deg) scale(1.03); margin-block: -14px; position: relative; z-index: 2; }
.marquee-track { display: flex; align-items: center; gap: 36px; width: max-content; animation: marquee 36s linear infinite; font-family: var(--head); font-weight: 600; font-size: clamp(22px, 3vw, 38px); white-space: nowrap; }
.marquee-track .en { letter-spacing: .2em; font-size: .7em; }
.marquee-track i { font-style: normal; font-size: .6em; opacity: .7; }
@keyframes marquee { to { transform: translateX(50%); } }

/* ===== العبارة ===== */
.statement { background: var(--cream); color: var(--deep); padding: clamp(110px, 16vw, 200px) var(--pad) clamp(70px, 10vw, 130px); }
.statement .eyebrow { color: var(--green); }
.statement-text { font-family: var(--head); font-weight: 600; font-size: clamp(30px, 5vw, 76px); line-height: 1.35; margin: 0; max-width: 19ch; }
.statement-text .w { opacity: .14; transition: opacity .3s linear; }
.statement-text .w.on { opacity: 1; }

/* ===== صورتين ===== */
.duo { background: var(--cream); display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(14px, 2vw, 28px); padding: 0 var(--pad) clamp(90px, 12vw, 160px); align-items: end; }
.duo figure { margin: 0; overflow: hidden; border-radius: 20px; }
.duo img { width: 100%; height: 100%; object-fit: cover; }
.duo-a img { aspect-ratio: 4 / 3; }
.duo .duo-b { margin-bottom: clamp(40px, 8vw, 120px); }
.duo-b img { aspect-ratio: 3 / 4; object-position: 64% center; }
.duo-a img { object-position: 30% center; }

.js .img-reveal { clip-path: inset(0 0 0 100% round 20px); transition: clip-path 1.4s var(--expo); }
.js .img-reveal img { transform: scale(1.25); transition: transform 1.8s var(--expo); }
.js .img-reveal.in { clip-path: inset(0 0 0 0 round 20px); }
.js .img-reveal.in img { transform: scale(1); }

/* ===== المعرض الأفقي ===== */
.hgallery { background: var(--deep); position: relative; height: 340vh; }
.hg-sticky { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; gap: clamp(24px, 4vh, 44px); }
.hg-head { padding: 0 var(--pad); }
.hg-head .eyebrow { margin-bottom: 8px; }
.hg-title { font-size: clamp(34px, 5vw, 72px); line-height: 1.15; }
.hg-track { display: flex; gap: clamp(16px, 2vw, 28px); padding: 0 var(--pad); width: max-content; will-change: transform; }
.card { margin: 0; width: clamp(280px, 38vw, 560px); flex: none; }
.card:nth-child(even) { margin-top: 48px; }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 18px; filter: saturate(.92); transition: filter .6s, transform .9s var(--expo); }
.card:hover img { filter: saturate(1.08); transform: scale(.985); }
.card figcaption { display: flex; gap: 12px; align-items: baseline; margin-top: 14px; font-size: 16px; opacity: .85; }
.card figcaption b { font-family: var(--head); color: var(--gold); font-size: 13px; letter-spacing: .1em; }
.hg-progress { margin: 0 var(--pad); height: 2px; background: rgba(245,241,227,.14); border-radius: 2px; overflow: hidden; }
.hg-progress span { display: block; height: 100%; background: var(--gold); transform-origin: right; transform: scaleX(0); }

/* ===== اسأل عن ===== */
.ask { padding: clamp(100px, 14vw, 180px) var(--pad); max-width: 1400px; margin: 0 auto; }
.ask-head h2 { font-size: clamp(38px, 6vw, 88px); line-height: 1.1; margin-bottom: clamp(30px, 5vw, 60px); }
.ask-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(245,241,227,.16); }
.ask-list li { border-bottom: 1px solid rgba(245,241,227,.16); }
.ask-list a { position: relative; display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 20px; padding: clamp(22px, 3vw, 38px) 8px; overflow: hidden; isolation: isolate; }
.ask-list a::before { content: ""; position: absolute; inset: 0; background: var(--deep); transform: scaleY(0); transform-origin: bottom; transition: transform .6s var(--expo); z-index: -1; }
.ask-list a:hover::before { transform: none; }
.ask-list .num { font-family: var(--head); color: var(--gold); font-size: 14px; letter-spacing: .12em; padding-inline-start: 12px; }
.ask-list .q { font-family: var(--head); font-weight: 600; font-size: clamp(24px, 3.4vw, 48px); line-height: 1.3; transition: transform .6s var(--expo); }
.ask-list a:hover .q { transform: translateX(-14px); }
.ask-list .arrow { font-size: 28px; color: var(--gold); padding-inline-end: 12px; opacity: 0; transform: translateX(16px); transition: opacity .4s, transform .6s var(--expo); }
.ask-list a:hover .arrow { opacity: 1; transform: none; }
.ask-note { margin: 34px 0 0; opacity: .85; }
.ask-note a { color: var(--gold); font-family: var(--head); font-weight: 600; }

/* ===== الختام ===== */
.closing {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #15504a 0%, var(--deep) 55%, #0a2a27 100%);
  border-top: 4px solid var(--gold);
  text-align: center;
  padding: clamp(100px, 14vw, 180px) var(--pad);
  display: flex; flex-direction: column; align-items: center;
}
.closing-mark { width: clamp(72px, 8vw, 104px); height: auto; margin-bottom: 26px; }
.closing-phone { display: block; font-family: var(--head); font-weight: 600; color: var(--gold); font-size: clamp(46px, 11vw, 176px); line-height: 1.05; transition: color .4s; }
.closing-phone:hover { color: var(--cream); }
.closing-phone .line > bdi { transition-duration: 1.4s; }
.closing-phone.in .line > bdi { transform: none; }
.closing-meta { display: flex; align-items: center; gap: 16px; margin: 30px 0 40px; font-size: 20px; opacity: .9; }
.closing-meta i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }

.footer { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 26px var(--pad) 34px; font-size: 14px; color: rgba(245,241,227,.55); background: #0a2a27; }
.footer .en { font-family: var(--head); letter-spacing: .25em; font-size: 12px; direction: ltr; }

/* زر الاتصال العائم (جوال) */
.fab {
  position: fixed; bottom: 18px; left: 18px; z-index: 60;
  width: 58px; height: 58px; display: none; place-items: center; border-radius: 50%;
  background: var(--gold); color: var(--deep);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  transform: scale(0); transition: transform .6s var(--expo);
}
.fab.show { transform: scale(1); }

/* دخول عام عند الظهور */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--expo), transform 1.2s var(--expo); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* ===== الجوال ===== */
@media (max-width: 820px) {
  .nav { display: none; }
  .pill { margin-inline-start: auto; }
  .topbar { padding: 14px 18px; }
  .hero-media { clip-path: inset(10% 6% 10% 6% round 20px); }
  .hero-video { object-position: center; }
  .hero-shade { background: linear-gradient(to top, rgba(14,58,54,.96) 0%, rgba(14,58,54,.7) 45%, rgba(42,33,48,.2) 75%, rgba(42,33,48,.6) 100%); }
  .hero-actions { gap: 18px; }
  .duo { grid-template-columns: 1fr; }
  .duo .duo-b { margin-bottom: 0; }
  .duo-b img { aspect-ratio: 4 / 3; }
  .hgallery { height: auto; }
  .hg-sticky { position: static; height: auto; padding: 90px 0; }
  .hg-track { width: auto; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: none; transform: none !important; }
  .hg-track::-webkit-scrollbar { display: none; }
  .card { width: 78vw; scroll-snap-align: center; }
  .card:nth-child(even) { margin-top: 0; }
  .hg-progress { display: none; }
  .ask-list a { grid-template-columns: 44px 1fr; }
  .ask-list .arrow { display: none; }
  .fab { display: grid; }
  .scroll-cue { display: none; }
}

/* ===== تقليل الحركة ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-media { clip-path: none !important; transform: none !important; }
  .line > span, .line > bdi, .intro, .js .reveal { transform: none !important; opacity: 1 !important; }
  .js .img-reveal { clip-path: none; }
  .js .img-reveal img { transform: none; }
  .statement-text .w { opacity: 1; }
  .hgallery { height: auto; }
  .hg-sticky { position: static; height: auto; padding: 90px 0; }
  .hg-track { width: auto; overflow-x: auto; transform: none !important; }
}
