/* =====================================================================
   بنو خروص — طبقة الواجهة الرئيسية
   زخرفة ذهبية، مشهد ليلي للوادي والحصن، ولمسات حركية.
   لا تُحمَّل إلا في index.html.
   ===================================================================== */

.home { background: var(--ink); }

/* ---------------------------------------------------------------
   الإطار الزخرفي الثابت حول الشاشة
   --------------------------------------------------------------- */
.ornaframe {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
}
.ornaframe::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(217, 168, 92, .30);
}
.ornaframe::after {
  content: '';
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(217, 168, 92, .12);
}
.ornaframe__corner {
  position: absolute;
  width: 108px;
  height: 108px;
  opacity: .75;
}
.ornaframe__corner svg { width: 100%; height: 100%; display: block; }
.ornaframe__corner--tr { top: 8px; right: 8px; }
.ornaframe__corner--tl { top: 8px; left: 8px; transform: scaleX(-1); }
.ornaframe__corner--br { bottom: 8px; right: 8px; transform: scaleY(-1); }
.ornaframe__corner--bl { bottom: 8px; left: 8px; transform: scale(-1, -1); }

@media (max-width: 720px) {
  .ornaframe__corner { width: 62px; height: 62px; }
}

/* ---------------------------------------------------------------
   شريط التنقل على الواجهة
   --------------------------------------------------------------- */
.home .nav {
  background: linear-gradient(to bottom, rgba(11, 8, 6, .95), rgba(11, 8, 6, .72));
  border-block-end: 1px solid rgba(217, 168, 92, .22);
  padding-inline: 26px;
}
.home .nav__brand {
  border: 1px solid rgba(217, 168, 92, .45);
  border-radius: 999px;
  padding: .34rem 1.1rem;
  background: rgba(217, 168, 92, .07);
  color: var(--gold-1);
  letter-spacing: .04em;
}
.home .nav__brand span { color: var(--gold-2); }
.home .nav__links a { color: rgba(232, 218, 192, .72); font-size: .84rem; }
.home .nav__links a:hover { color: var(--gold-1); background: transparent; }
.home .nav__links a.is-active {
  color: var(--gold-1);
  background: transparent;
  box-shadow: inset 0 -2px 0 var(--gold-2);
}

/* رايةٌ معلّقة في الزاوية */
.pennant {
  position: absolute;
  inset-inline-end: 34px;
  top: 0;
  width: 62px;
  z-index: 3;
  pointer-events: none;
  transform-origin: 50% 0;
  animation: sway 7s ease-in-out infinite;
}
.pennant svg { width: 100%; height: auto; display: block; }
@keyframes sway {
  0%, 100% { transform: rotate(-1.1deg); }
  50%      { transform: rotate(1.1deg); }
}

/* ---------------------------------------------------------------
   المشهد
   --------------------------------------------------------------- */
.stage {
  position: relative;
  min-height: min(100svh, 940px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  background: var(--ink);
  isolation: isolate;
}
.stage__scene {
  position: absolute;
  inset: -4% -4% -2%;
  z-index: 0;
}
.stage__scene svg { width: 100%; height: 100%; display: block; }

/* طبقات تتحرك قليلًا مع المؤشر */
.plx { transition: transform .5s cubic-bezier(.22,.61,.36,1); will-change: transform; }

/* غبار متطاير */
.motes { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.mote {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--gold-2);
  opacity: 0;
  filter: blur(.4px);
  animation: drift linear infinite;
}
@keyframes drift {
  0%   { opacity: 0;   transform: translate3d(0, 20px, 0) scale(.6); }
  12%  { opacity: .55; }
  70%  { opacity: .35; }
  100% { opacity: 0;   transform: translate3d(-70px, -260px, 0) scale(1.25); }
}

/* حبيبات الفيلم + تعتيم الأطراف */
.stage__grain {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  opacity: .30; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}
.stage__vignette {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 40%, transparent 42%, rgba(11,8,6,.62) 100%),
    linear-gradient(to bottom, rgba(11,8,6,.55) 0%, transparent 26%, transparent 62%, var(--ink) 99%);
}

/* ---------------------------------------------------------------
   نص الواجهة
   --------------------------------------------------------------- */
.stage__in {
  position: relative;
  z-index: 4;
  text-align: center;
  padding-block: clamp(5rem, 4rem + 7vw, 8rem) clamp(2rem, 1rem + 4vw, 3rem);
}

.stage__eyebrow {
  font-family: var(--kufi);
  font-size: .74rem;
  letter-spacing: .34em;
  color: rgba(244, 220, 168, .62);
  margin: 0 0 1.1rem;
}

.stage__title {
  font-family: var(--display);
  font-weight: 700;
  line-height: .96;
  margin: 0;
  font-size: clamp(3.2rem, 1.4rem + 8.4vw, 8.6rem);
  position: relative;
  display: inline-block;
  background:
    linear-gradient(102deg, transparent 40%, rgba(255, 251, 238, .92) 48%, transparent 56%),
    linear-gradient(178deg, #FFF3D6 4%, var(--gold-1) 26%, var(--gold-2) 52%, #8E5C28 78%, var(--gold-1) 98%);
  background-size: 300% 100%, 100% 100%;
  background-position: 190% 0, 0 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 rgba(74, 44, 16, .75)) drop-shadow(0 18px 44px rgba(0, 0, 0, .8));
  animation: shine 7s ease-in-out 1.4s infinite;
}
.stage__title small {
  display: block;
  font-size: .36em;
  line-height: 1.2;
  letter-spacing: .02em;
  margin-bottom: -.06em;
}

/* لمعة تمرّ على العنوان */
@keyframes shine {
  0%, 62%, 100% { background-position: 190% 0, 0 0; }
  86%           { background-position: -80% 0, 0 0; }
}

/* فاصل زخرفي بمعينات */
.rule-orn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  margin: 1.5rem auto 0;
  max-width: 520px;
  color: var(--gold-2);
}
.rule-orn::before,
.rule-orn::after {
  content: '';
  height: 1px;
  flex: 1;
  background: linear-gradient(to var(--dir, left), transparent, rgba(217, 168, 92, .7));
}
.rule-orn::after { --dir: right; }
.rule-orn span {
  font-family: var(--display);
  font-size: var(--step-1);
  color: rgba(244, 220, 168, .9);
  white-space: nowrap;
}
.rule-orn i { font-style: normal; opacity: .8; font-size: .8rem; }

.stage__lede {
  max-width: 52ch;
  margin: 1.6rem auto 0;
  color: rgba(232, 218, 192, .74);
  font-size: var(--step-0);
  font-weight: 300;
  line-height: 2.05;
}

/* زر النزول */
.scroller {
  margin: 2.4rem auto 0;
  width: 66px; height: 66px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(217, 168, 92, .5);
  background: rgba(11, 8, 6, .5);
  color: var(--gold-1);
  cursor: pointer;
  position: relative;
  transition: background .25s ease, transform .25s ease;
}
.scroller:hover { background: rgba(217, 168, 92, .16); transform: translateY(3px); }
.scroller::before {
  content: '';
  position: absolute; inset: -9px;
  border-radius: 50%;
  border: 1px solid rgba(217, 168, 92, .35);
  animation: ring 2.8s ease-out infinite;
}
@keyframes ring {
  0%   { transform: scale(.9); opacity: .85; }
  100% { transform: scale(1.35); opacity: 0; }
}
.scroller svg { width: 22px; height: 22px; }

.stage__meta {
  margin-top: 2.6rem;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .4rem 1.8rem;
  font-family: var(--kufi);
  font-size: .74rem;
  letter-spacing: .06em;
  color: rgba(232, 218, 192, .42);
}

/* ---------------------------------------------------------------
   شريط الركائز الجانبي
   --------------------------------------------------------------- */
.pillars {
  position: absolute;
  inset-inline-start: 26px;
  top: 50%;
  transform: translateY(-46%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid rgba(217, 168, 92, .28);
  background: rgba(11, 8, 6, .55);
  backdrop-filter: blur(3px);
}
.pillar {
  display: grid;
  justify-items: center;
  gap: .35rem;
  padding: .95rem .7rem;
  color: rgba(232, 218, 192, .62);
  text-decoration: none;
  font-family: var(--kufi);
  font-size: .68rem;
  letter-spacing: .06em;
  writing-mode: vertical-rl;
  transition: color .22s ease, background .22s ease;
}
.pillar svg { width: 20px; height: 20px; transform: rotate(90deg); }
.pillar + .pillar { border-block-start: 1px solid rgba(217, 168, 92, .16); }
.pillar:hover { color: var(--gold-1); background: rgba(217, 168, 92, .1); }

@media (max-width: 1180px) { .pillars { display: none; } }

/* ---------------------------------------------------------------
   بطاقات الأبواب
   --------------------------------------------------------------- */
.gates {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  padding-block: 0 clamp(2rem, 1rem + 4vw, 3.4rem);
}
@media (max-width: 1080px) { .gates { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .gates { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px)  { .gates { grid-template-columns: 1fr; } }

.gate {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .55rem;
  padding: 1.7rem 1.1rem 1.2rem;
  text-decoration: none;
  color: var(--sand);
  background:
    linear-gradient(180deg, rgba(38, 28, 18, .92), rgba(14, 10, 7, .95));
  border: 1px solid rgba(217, 168, 92, .34);
  outline: 1px solid rgba(217, 168, 92, .12);
  outline-offset: 5px;
  transition: transform .28s cubic-bezier(.22,.61,.36,1), border-color .28s ease, box-shadow .28s ease;
}
.gate:hover {
  transform: translateY(-6px);
  border-color: rgba(244, 220, 168, .7);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .6), 0 0 0 1px rgba(217, 168, 92, .2) inset;
}
.gate__icon {
  width: 42px; height: 42px;
  color: var(--gold-2);
  transition: color .28s ease, transform .28s ease;
}
.gate:hover .gate__icon { color: var(--gold-1); transform: translateY(-2px); }
.gate h3 {
  font-family: var(--display);
  font-size: var(--step-1);
  margin: .3rem 0 0;
  color: var(--gold-1);
}
.gate p {
  margin: 0;
  font-size: .8rem;
  font-weight: 300;
  line-height: 1.8;
  color: rgba(232, 218, 192, .62);
  max-width: 22ch;
}
.gate__more {
  margin-top: .9rem;
  padding-top: .8rem;
  width: 100%;
  border-block-start: 1px solid rgba(217, 168, 92, .2);
  font-family: var(--kufi);
  font-size: .74rem;
  letter-spacing: .1em;
  color: var(--gold-2);
  display: flex; align-items: center; justify-content: center; gap: .45rem;
}
.gate:hover .gate__more { color: var(--gold-1); }
.gate__more i { font-style: normal; transition: transform .28s ease; }
.gate:hover .gate__more i { transform: translateX(4px); }

/* ---------------------------------------------------------------
   شريط الشعار المنهجي
   --------------------------------------------------------------- */
.creed {
  position: relative;
  z-index: 4;
  background: linear-gradient(180deg, rgba(30, 21, 13, .96), rgba(12, 9, 6, .98));
  border-block: 1px solid rgba(217, 168, 92, .26);
}
.creed__in {
  padding-block: clamp(1.8rem, 1.2rem + 2vw, 2.8rem);
  text-align: center;
  position: relative;
}
.creed__in::before,
.creed__in::after {
  content: '❖';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(217, 168, 92, .45);
  font-size: .9rem;
}
.creed__in::before { inset-inline-start: 4px; }
.creed__in::after  { inset-inline-end: 4px; }
.creed p {
  margin: 0;
  font-family: var(--quote);
  font-size: clamp(1.1rem, .8rem + 1.3vw, 1.75rem);
  line-height: 1.9;
  color: var(--gold-1);
}
.creed span {
  display: block;
  margin-top: .6rem;
  font-family: var(--kufi);
  font-size: .74rem;
  letter-spacing: .16em;
  color: rgba(232, 218, 192, .45);
}

/* ---------------------------------------------------------------
   ظهور تدريجي عند التمرير
   --------------------------------------------------------------- */
.rise { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.22,.61,.36,1); }
.rise.in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------
   زر العودة للأعلى
   --------------------------------------------------------------- */
.totop {
  position: fixed;
  inset-inline-end: 26px;
  bottom: 26px;
  z-index: 55;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(217, 168, 92, .4);
  background: rgba(11, 8, 6, .8);
  color: var(--gold-1);
  cursor: pointer;
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease, background .25s ease;
}
.totop.on { opacity: 1; visibility: visible; }
.totop:hover { background: rgba(217, 168, 92, .18); }

/* ---------------------------------------------------------------
   تناغم الأقسام السفلية مع الواجهة
   --------------------------------------------------------------- */
.home .sec--dark { background: #0E0A07; }
.home .sec--sand { background: linear-gradient(180deg, #1A130C, #120D08); color: var(--sand); }
.home .sec--sand .card { background: #0E0A07; border: 1px solid rgba(217, 168, 92, .14); }
.home .sec--sand .sec__head h2 { color: var(--gold-1); }
.home .sec--sand .sec__num { color: var(--gold-2); }
.home .sec--sand .counters { background: rgba(217, 168, 92, .16); border-color: rgba(217, 168, 92, .22); }
.home .sec--sand .counter { background: #120D08; }
.home .sec--sand .counter strong { color: var(--gold-2); }
.home .sec { background-color: #0B0806; color: var(--sand); }
.home .sec .sec__head h2 { color: var(--gold-1); }
.home .sec .sec__num { color: var(--gold-2); }
.home .grid { background: rgba(217, 168, 92, .16); border-color: rgba(217, 168, 92, .2); }
.home .card { background: #100B08; }
.home .card--link h3 { color: var(--gold-1); }
.home .card--link:hover { background: #17110B; }
.home .legend { color: var(--sand); }

@media (prefers-reduced-motion: reduce) {
  .mote, .pennant, .stage__title, .scroller::before { animation: none !important; }
  .rise { opacity: 1; transform: none; transition: none; }
  .plx { transition: none; }
}


/* الراية المعلّقة تحت الشريط مباشرة */
.stage { padding-top: 0; }
.pennant { top: -6px; }

@media (max-width: 900px) {
  .foreman { display: none; }
  .pennant { display: none; }
  .stage__in { padding-block: clamp(4rem, 3rem + 6vw, 6rem) 2rem; }
}
@media (max-width: 620px) {
  .ornaframe::before { inset: 6px; }
  .ornaframe::after  { inset: 11px; }
  .stage__meta { font-size: .68rem; gap: .3rem 1rem; }
  .creed__in::before, .creed__in::after { display: none; }
}
