/* =========================================================
   layout.css — شاشة التحميل، المؤشر، الهيدر، الفوتر، نافذة المشروع
   ========================================================= */

/* ---------- شاشة التحميل ---------- */
.loader { display: none; }
.js .loader {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: grid; place-items: center; align-content: center; gap: 22px;
  /* احتياط: لو تعطل السكربت تختفي الشاشة بعد ٨ ثواني */
  animation: loaderFallback .4s 8s forwards;
}
.loader__mark { width: 96px; height: 96px; }
.loader__mark use { stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 1.6s var(--ease) forwards; }
.loader__count { font-size: 13px; letter-spacing: .2em; color: var(--muted); text-align: center; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes loaderFallback { to { opacity: 0; visibility: hidden; } }

/* ---------- شريط التقدم ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--gold); transform-origin: right; transform: scaleX(0); }

/* ---------- المؤشر المخصص (للماوس فقط) ---------- */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .js .cursor { display: block; position: fixed; inset: 0; pointer-events: none; z-index: 90; }
  .cursor__dot, .cursor__ring { position: fixed; top: 0; left: 0; border-radius: 50%; }
  .cursor__dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--gold-3); }
  .cursor__ring {
    width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 1px solid rgb(168 123 64 / 55%);
    display: grid; place-items: center; transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .35s;
  }
  .cursor__label { font-size: 12px; font-weight: 600; color: #fff; opacity: 0; transition: opacity .25s; }
  .cursor.is-hover .cursor__ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: rgb(196 149 90 / 12%); }
  .cursor.is-view .cursor__ring { width: 86px; height: 86px; margin: -43px 0 0 -43px; background: var(--ink); border-color: var(--ink); }
  .cursor.is-view .cursor__label { opacity: 1; }
}

/* ---------- الهيدر ---------- */
.header {
  white-space: nowrap;
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  display: flex; align-items: center; gap: 28px; padding-inline: var(--gutter);
  transition: background .4s, box-shadow .4s, transform .5s var(--ease);
}
.header.is-scrolled { background: rgb(251 248 242 / 82%); backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 1px 0 var(--line); }
.header.is-hidden { transform: translateY(-100%); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark { width: 40px; height: 40px; flex: none; transition: transform .8s var(--ease); }
.brand:hover .brand__mark { transform: rotate(90deg); }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__text b { font-size: 15px; font-weight: 500; letter-spacing: .04em; direction: ltr; text-align: right; }
.brand__text b i { font-style: normal; font-weight: 400; color: var(--gold-3); }
.brand__text small { font-size: 12px; color: var(--muted); }
.nav { display: flex; gap: 6px; margin-inline-start: auto; }
.nav a { position: relative; padding: 8px 12px; font-size: 15px; font-weight: 400; color: var(--muted); white-space: nowrap; transition: color .3s; }
.nav a::after { content: ""; position: absolute; inset: auto 14px 2px 14px; height: 1.5px; background: var(--gold); transform: scaleX(0); transition: transform .4s var(--ease); }
.nav a:hover, .nav a.is-active { color: var(--ink); }
.nav a:hover::after, .nav a.is-active::after { transform: scaleX(1); }
.burger { display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); place-items: center; align-content: center; gap: 6px; }
.burger span { display: block; width: 18px; height: 1.5px; background: var(--ink); transition: transform .4s var(--ease); }
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

/* ---------- الفوتر ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 36px; background: var(--bg); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer__brand { display: flex; align-items: center; gap: 14px; font-weight: 600; line-height: 1.5; }
.footer__brand small { font-weight: 400; color: var(--muted); }
.footer__brand small a { color: var(--gold-3); border-bottom: 1px solid currentColor; }
.footer__copy { font-size: 14px; color: var(--muted); }
.builder {
  display: inline-flex; align-items: center; gap: 14px; padding: 10px 12px 10px 20px;
  border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: 13px; color: var(--muted);
  transition: border-color .3s, box-shadow .3s;
}
.builder:hover { border-color: #3f6ae6; box-shadow: 0 10px 30px -14px rgb(63 106 230 / 50%); }
.builder img { height: 30px; width: auto; }

.modal-open body { overflow: hidden; }
