@font-face { font-family: "Thmanyah Display"; src: url("assets/fonts/thmanyah-display-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Display"; src: url("assets/fonts/thmanyah-display-black.woff2") format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("assets/fonts/thmanyah-sans-light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("assets/fonts/thmanyah-sans-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("assets/fonts/thmanyah-sans-medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("assets/fonts/thmanyah-sans-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* بَعْدي — ليلٌ واحد، وضوءٌ ذهبي واحد. */
:root {
  --night: #0b0a08;
  --night-2: #131109;
  --smoke: #1d1913;
  --sand: #ebe1cd;
  --sand-dim: #b6a88f;
  --sand-faint: #7f7461;
  --gold: #d4b06a;
  --gold-2: #c6a873;
  --gold-deep: #9c7b3f;
  --line: rgba(235, 225, 205, 0.10);
  --font-display: "Thmanyah Display", "Thmanyah Sans", "SF Arabic", "Geeza Pro", sans-serif;
  --font-body: "Thmanyah Sans", "SF Arabic", "Geeza Pro", sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  color: var(--sand);
  background: var(--night);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 2;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }
.wrap { width: min(100% - 48px, 1120px); margin: 0 auto; }
.gold { color: var(--gold); font-weight: 500; }

/* ---------- الطبقات الثابتة: الغبار والمصباح ---------- */
#dust { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.lantern {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(520px circle at var(--x, 50%) var(--y, 30%), rgba(212, 176, 106, 0.075), transparent 62%);
  transition: opacity 600ms ease;
}
@media (hover: none) { .lantern { display: none; } }
main, .site-header, .site-footer { position: relative; z-index: 2; }

/* ---------- الافتتاحية ---------- */
.intro {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: var(--night);
  transition: opacity 1200ms ease, visibility 0s linear 1200ms;
}
.intro.is-done { opacity: 0; visibility: hidden; }
.intro__path { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro__path path {
  fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  filter: drop-shadow(0 0 6px rgba(212, 176, 106, 0.9)) drop-shadow(0 0 22px rgba(212, 176, 106, 0.45));
}
.intro.is-playing .intro__path path { animation: draw 1900ms var(--ease) forwards; }
.intro__logo { width: min(62vw, 420px); color: var(--sand); opacity: 0; filter: blur(14px); transform: scale(0.96); }
.intro.is-playing .intro__logo { animation: bloom 1500ms var(--ease) 1200ms forwards; }
.intro__glow {
  position: absolute; width: 60vmin; height: 60vmin; border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 176, 106, 0.28), transparent 60%);
  filter: blur(30px); opacity: 0;
}
.intro.is-playing .intro__glow { animation: glow 1800ms ease 1100ms forwards; }
.intro__skip { position: absolute; bottom: 28px; inset-inline-start: 50%; transform: translateX(50%); font-size: 0.8rem; color: var(--sand-faint); padding: 8px 14px; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes bloom { to { opacity: 1; filter: blur(0); transform: scale(1); } }
@keyframes glow { 0% { opacity: 0; } 60% { opacity: 1; } 100% { opacity: 0.55; } }

/* ---------- الترويسة ---------- */
.site-header {
  position: fixed; top: 0; inset-inline: 0; z-index: 20;
  padding: 18px 0;
  background: linear-gradient(180deg, rgba(11, 10, 8, 0.9), rgba(11, 10, 8, 0));
  transition: transform 500ms var(--ease), opacity 500ms ease;
}
.site-header.is-hidden { transform: translateY(-100%); opacity: 0; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--sand); }
.brand svg { height: 26px; width: auto; }
.brand span { font-size: 0.82rem; color: var(--sand-dim); }
.site-nav { display: flex; gap: 22px; }
.site-nav a { font-size: 0.86rem; color: var(--sand-dim); position: relative; padding-bottom: 3px; transition: color 200ms; }
.site-nav a::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: right; transition: transform 240ms var(--ease); }
.site-nav a:hover, .site-nav a.is-active { color: var(--sand); }
.site-nav a:hover::after, .site-nav a.is-active::after { transform: scaleX(1); }
.menu-btn { display: none; font-size: 0.86rem; color: var(--sand); border: 1px solid var(--line); padding: 6px 14px; }
.menu {
  position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; gap: 0;
  background: rgba(11, 10, 8, 0.96); backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden; transition: opacity 400ms ease, visibility 0s linear 400ms;
}
.menu.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.menu nav { display: grid; gap: 18px; text-align: center; }
.menu a { font-family: var(--font-display); font-size: 1.6rem; color: var(--sand); }
.menu__close { position: absolute; top: 22px; inset-inline-start: 24px; color: var(--sand-dim); font-size: 0.9rem; padding: 8px 12px; border: 1px solid var(--line); }

/* ---------- المشهد الأول ---------- */
.hero { position: relative; min-height: 100svh; display: grid; align-items: end; padding: 140px 0 90px; overflow: clip; isolation: isolate; }
.hero__art { position: absolute; inset: 0; z-index: -1; }
.hero__art img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%;
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 50%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 50%, transparent 100%);
  transform: scale(1.06);
}
.js .hero__art img { animation: burns 26s ease-out forwards; }
@keyframes burns { from { transform: scale(1.12) translateY(-1.5%); } to { transform: scale(1.02) translateY(0); } }
.hero__art::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(70% 55% at 50% 45%, transparent 0%, rgba(11, 10, 8, 0.55) 70%, var(--night) 100%);
}
.hero__inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: 640px; }
.hero__logo { width: min(62vw, 340px); color: var(--sand); filter: drop-shadow(0 0 24px rgba(212, 176, 106, 0.28)); }
.hero__logo svg { width: 100%; height: auto; }
.hero__meta { margin: 6px 0 0; font-size: 0.86rem; color: var(--sand-dim); display: flex; gap: 12px; align-items: center; }
.hero__meta .status { color: var(--gold); }
.hero__meta i { width: 26px; height: 1px; background: var(--gold); display: inline-block; }
.lines { display: grid; gap: 2px; margin: 18px 0 0; }
.lines p { margin: 0; font-size: clamp(1.25rem, 2.3vw, 1.7rem); line-height: 1.9; font-weight: 300; }
.lines p.gold, .lines p b { color: var(--gold); font-weight: 500; }
.hero__sub { margin: 22px 0 0; max-width: 34rem; color: var(--sand-dim); font-size: 1rem; line-height: 2.05; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 11px 22px; border: 1px solid var(--gold-deep); font-size: 0.92rem; font-weight: 400; color: var(--sand); transition: background 200ms, border-color 200ms, box-shadow 300ms; }
.btn:hover { background: rgba(212, 176, 106, 0.10); border-color: var(--gold); box-shadow: 0 0 30px rgba(212, 176, 106, 0.12); }
.btn--ghost { border-color: var(--line); color: var(--sand-dim); }
.scroll-cue { position: absolute; bottom: 26px; inset-inline-start: 50%; transform: translateX(50%); display: grid; justify-items: center; gap: 8px; font-size: 0.72rem; color: var(--sand-faint); }
.scroll-cue i { width: 1px; height: 46px; background: linear-gradient(180deg, var(--gold), transparent); display: block; }
.js .scroll-cue i { animation: cue 2.2s ease-in-out infinite; }
@keyframes cue { 0%, 100% { transform: scaleY(0.4); transform-origin: top; opacity: 0.4; } 50% { transform: scaleY(1); opacity: 1; } }

/* ---------- الظهور ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); filter: blur(6px); transition: opacity 900ms var(--ease), transform 900ms var(--ease), filter 900ms var(--ease); transition-delay: calc(var(--i, 0) * 110ms); }
.js .reveal.is-in { opacity: 1; transform: none; filter: none; }

/* ---------- الأقسام ---------- */
.section { padding: 120px 0; border-top: 1px solid var(--line); }
.section__label { margin: 0 0 12px; font-size: 0.8rem; color: var(--gold); font-weight: 500; display: flex; align-items: center; gap: 12px; }
.section__label::before { content: ""; width: 26px; height: 1px; background: var(--gold); }
.section__title { margin: 0 0 34px; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.8rem, 3.4vw, 2.7rem); line-height: 1.5; max-width: 16ch; text-wrap: balance; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 60px; align-items: start; }
.prose p { margin: 0; max-width: 36rem; font-size: 1.05rem; line-height: 2.15; color: rgba(235, 225, 205, 0.86); }
.prose p + p { margin-top: 16px; }
.prose .note { color: var(--sand-dim); font-size: 0.98rem; }

/* على طريقة البوسترات: سطور تتنفس، وآخرها ذهبي */
.poster-text { display: grid; gap: 4px; max-width: 30rem; }
.poster-text p { margin: 0; font-size: clamp(1.15rem, 1.7vw, 1.4rem); line-height: 1.95; font-weight: 300; }
.poster-text p.gap { margin-top: 18px; }
.poster-text p.gold { color: var(--gold); font-weight: 500; }
.poster-text cite { display: block; margin-top: 22px; font-style: normal; font-size: 0.8rem; color: var(--sand-faint); }
.poster-text cite::before { content: ""; display: block; width: 34px; height: 1px; background: var(--gold-deep); margin-bottom: 14px; }

/* ---------- التكوينات والخيط ---------- */
.formations { position: relative; display: grid; gap: 0; padding-inline-start: 44px; }
.thread-svg { position: absolute; top: 0; bottom: 0; inset-inline-start: 8px; width: 2px; height: 100%; overflow: visible; }
.thread-svg line { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: var(--p, 1); filter: drop-shadow(0 0 6px rgba(212, 176, 106, 0.8)); }
.thread-svg .ghost { stroke: rgba(235, 225, 205, 0.12); stroke-dasharray: none; filter: none; }
.formation { position: relative; display: grid; grid-template-columns: minmax(150px, 190px) minmax(0, 1fr); gap: 28px; padding: 30px 0; border-top: 1px solid var(--line); }
.formation:first-child { border-top: 0; padding-top: 4px; }
.formation::before {
  content: ""; position: absolute; top: 44px; inset-inline-start: -44px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--night); border: 1px solid rgba(235, 225, 205, 0.25); transform: translateX(50%) translateX(0.5px);
  transition: border-color 500ms, box-shadow 700ms, background 500ms;
}
.formation:first-child::before { top: 18px; }
.formation.is-lit::before { border-color: var(--gold); background: var(--gold); box-shadow: 0 0 0 4px var(--night), 0 0 18px rgba(212, 176, 106, 0.9); }
.formation__ordinal { margin: 0 0 2px; font-size: 0.78rem; color: var(--sand-faint); }
.formation__name { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; line-height: 1.5; transition: color 500ms; }
.formation.is-lit .formation__name { color: var(--gold); }
.questions { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.questions li { display: grid; grid-template-columns: 2.4rem 1fr; gap: 10px; align-items: baseline; font-size: 1.02rem; line-height: 1.9; color: rgba(235, 225, 205, 0.85); }
.questions li b { font-weight: 400; font-size: 0.78rem; color: var(--gold-deep); font-variant-numeric: tabular-nums; }
.formations__closing { margin-top: 26px; padding-inline-start: 44px; font-size: 1.2rem; color: var(--sand-dim); }
.formations__closing b { color: var(--gold); font-weight: 500; font-family: var(--font-display); }

/* ---------- المعرض السينمائي ---------- */
.section--reel { padding-bottom: 60px; }
.reel-wrap { position: relative; margin-top: 10px; }
.reel {
  display: flex; gap: 20px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab;
  padding: 24px calc(50% - 150px) 34px; margin-inline: calc(50% - 50vw); width: 100vw;
}
.reel.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.reel::-webkit-scrollbar { display: none; }
.card { flex: 0 0 300px; scroll-snap-align: center; position: relative; aspect-ratio: 9 / 16; perspective: 900px; }
.card__inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 500ms var(--ease), box-shadow 500ms; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6); border: 1px solid rgba(235, 225, 205, 0.08); overflow: hidden; background: var(--smoke); }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease), opacity 500ms; }
.card:hover .card__inner { box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7), 0 0 40px rgba(212, 176, 106, 0.12); }
.card:hover img { transform: scale(1.03); }
.card__open { position: absolute; inset: 0; width: 100%; height: 100%; }
.card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 70%, rgba(11, 10, 8, 0.5)); opacity: 0; transition: opacity 400ms; }
.reel__nav { display: flex; justify-content: center; gap: 12px; margin-top: 8px; }
.reel__btn { width: 44px; height: 44px; border: 1px solid var(--line); color: var(--sand-dim); display: grid; place-items: center; transition: border-color 200ms, color 200ms; }
.reel__btn:hover { border-color: var(--gold); color: var(--gold); }
.reel__hint { text-align: center; font-size: 0.78rem; color: var(--sand-faint); margin: 10px 0 0; }
.reel-wrap::before, .reel-wrap::after { content: ""; position: absolute; top: 0; bottom: 0; width: 12vw; pointer-events: none; z-index: 2; }
.reel-wrap::before { inset-inline-start: calc(50% - 50vw); background: linear-gradient(90deg, transparent, var(--night)); }
.reel-wrap::after { inset-inline-end: calc(50% - 50vw); background: linear-gradient(270deg, transparent, var(--night)); }

/* المشاهدة الكاملة */
.lightbox { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(6, 5, 4, 0.94); backdrop-filter: blur(8px); }
.lightbox__inner { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.lightbox img { max-height: 92vh; max-width: 92vw; width: auto; height: auto; box-shadow: 0 40px 120px rgba(0, 0, 0, 0.8); }
.lightbox__close { position: absolute; top: 18px; inset-inline-start: 18px; color: var(--sand-dim); font-size: 0.86rem; border: 1px solid var(--line); padding: 8px 14px; background: rgba(11, 10, 8, 0.6); }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; display: grid; place-items: center; color: var(--sand); background: rgba(11, 10, 8, 0.55); border: 1px solid var(--line); }
.lightbox__nav--prev { inset-inline-end: 18px; }
.lightbox__nav--next { inset-inline-start: 18px; }
.lightbox__caption { position: absolute; bottom: 16px; inset-inline: 0; text-align: center; font-size: 0.8rem; color: var(--sand-faint); }

/* ---------- المعنى: مشهد بخلفية ---------- */
.scene { position: relative; padding: 160px 0; overflow: clip; isolation: isolate; border-top: 1px solid var(--line); }
.scene__bg { position: absolute; inset: -10% 0; z-index: -1; }
.scene__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 70%; opacity: 0.38; will-change: transform; }
.scene__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--night) 0%, rgba(11, 10, 8, 0.2) 35%, rgba(11, 10, 8, 0.2) 65%, var(--night) 100%); }
.scene .poster-text { margin: 0 auto; text-align: center; max-width: 34rem; }
.scene .poster-text p { font-size: clamp(1.3rem, 2.3vw, 1.85rem); }
.scene .poster-text cite::before { margin-inline: auto; }

/* ---------- كيف يُقرأ ---------- */
.guide { display: grid; gap: 0; margin-top: 10px; }
.guide__item { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; padding: 20px 0; border-top: 1px solid var(--line); }
.guide__item:last-child { border-bottom: 1px solid var(--line); }
.guide__mark { width: 8px; height: 8px; margin-top: 16px; border-radius: 50%; border: 1px solid var(--gold); justify-self: center; box-shadow: 0 0 12px rgba(212, 176, 106, 0.5); }
.guide__item p { margin: 0; font-size: 1.3rem; line-height: 1.85; font-weight: 300; }

/* ---------- المؤلف ---------- */
.author-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.author-links a { display: inline-grid; gap: 2px; padding: 14px 18px; border: 1px solid var(--line); min-width: 210px; transition: border-color 200ms, box-shadow 300ms; }
.author-links a:hover { border-color: var(--gold-deep); box-shadow: 0 0 30px rgba(212, 176, 106, 0.08); }
.author-links small { font-size: 0.76rem; color: var(--sand-faint); }
.author-links span { font-size: 0.95rem; }
.author-links span[dir="ltr"] { color: var(--gold); font-size: 0.86rem; }

/* ---------- الباب ---------- */
.closing { position: relative; padding: 140px 0 110px; text-align: center; border-top: 1px solid var(--line); overflow: clip; }
.door { position: relative; width: 190px; height: 300px; margin: 0 auto 44px; border-radius: 95px 95px 0 0; border: 1px solid rgba(235, 225, 205, 0.18); background: #090806; overflow: hidden; }
.door__light {
  position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(60% 50% at 50% 60%, rgba(212, 176, 106, 0.95), rgba(212, 176, 106, 0.35) 45%, transparent 75%);
  transform: scale(var(--open, 0.15)); opacity: calc(var(--open, 0.15) + 0.15); transform-origin: 50% 70%;
  filter: blur(calc((1 - var(--open, 0.15)) * 6px));
  transition: transform 200ms linear, opacity 200ms linear;
}
.door__path { position: absolute; bottom: -10px; inset-inline-start: 50%; width: 3px; height: 45%; transform: translateX(50%) scaleY(var(--open, 0.15)); transform-origin: bottom; background: linear-gradient(0deg, var(--gold), transparent); filter: blur(1px); transition: transform 200ms linear; }
.door__figure { position: absolute; bottom: 0; inset-inline-start: 50%; width: 14px; height: 44px; transform: translateX(50%); background: #07060504; background: var(--night); border-radius: 7px 7px 0 0; opacity: calc(var(--open, 0.15) * 1.2); }
.closing__text p { margin: 0 auto; max-width: 26ch; font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.85; font-weight: 300; text-wrap: balance; }
.closing__text p b { color: var(--gold); font-weight: 500; }
.closing__text small { display: block; margin-top: 18px; font-size: 0.82rem; color: var(--sand-faint); }

.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding: 26px 0 40px; border-top: 1px solid var(--line); font-size: 0.8rem; color: var(--sand-faint); }

/* ---------- تقليل الحركة ---------- */
@media (prefers-reduced-motion: reduce) {
  .intro { display: none; }
  .js .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .js .hero__art img, .js .scroll-cue i { animation: none; }
  #dust, .lantern { display: none; }
  html { scroll-behavior: auto; }
}

/* ---------- الشاشات الصغيرة ---------- */
@media (max-width: 860px) {
  .site-nav { display: none; }
  .menu-btn { display: inline-block; }
  .grid-2 { grid-template-columns: 1fr; gap: 30px; }
  .section { padding: 90px 0; }
  .formation { grid-template-columns: 1fr; gap: 12px; }
  .hero { padding: 120px 0 90px; }
  .hero__art img { object-position: 50% 30%; opacity: 0.5; }
  .card { flex-basis: 250px; }
  .reel { padding-inline: calc(50% - 125px); }
  .scene { padding: 120px 0; }
}
@media (max-width: 480px) {
  .wrap { width: min(100% - 32px, 1120px); }
  .door { width: 150px; height: 240px; border-radius: 75px 75px 0 0; }
}

/* ---------- التواصل ---------- */
.contact { display: grid; gap: 14px; max-width: 30rem; }
.contact label { display: grid; gap: 6px; font-size: 0.82rem; color: var(--sand-dim); }
.contact input, .contact textarea { font: inherit; font-size: 1rem; color: var(--sand); background: rgba(235, 225, 205, 0.04); border: 1px solid var(--line); padding: 10px 14px; transition: border-color 200ms, box-shadow 300ms; }
.contact input:focus, .contact textarea:focus { outline: none; border-color: var(--gold-deep); box-shadow: 0 0 24px rgba(212, 176, 106, 0.1); }
.contact textarea { resize: vertical; }
.contact__hp { position: absolute; inset-inline-start: -9999px; }
.contact__foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.contact__note { margin: 0; font-size: 0.86rem; color: var(--gold); }
