/* مدينة أبراج الرافدين — جولة معمارية رأسية الإيقاع:
   صور عريضة، عناوين قصيرة، خطوط ذهبية رأسية مستمدة من الأبراج، وباترن الكتيّب كفاصل. */
:root {
  --navy: #13294B;
  --navy-deep: #0d1d36;
  --ivory: #F0EEE9;
  --ivory-2: #e6e2d9;
  --gold: #B9975B;
  --blue: #135193;
  --orange: #ED9B33;
  --navy-soft: rgba(19, 41, 75, .74);
  --ivory-soft: rgba(240, 238, 233, .78);
  --line-navy: rgba(19, 41, 75, .16);
  --line-ivory: rgba(240, 238, 233, .2);

  /* Alexandria: خط عربي هندسي حديث يلائم الطابع المعماري؛ مع بدائل عربية محلية */
  --font: "Alexandria", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "Geeza Pro", sans-serif;
  --fs-display: clamp(2.2rem, 1.1rem + 4.3vw, 4.7rem);
  --fs-h2: clamp(1.7rem, 1.15rem + 2.1vw, 2.85rem);
  --fs-h3: clamp(1.15rem, 1rem + .6vw, 1.45rem);
  --fs-lead: clamp(1.02rem, .95rem + .3vw, 1.2rem);
  --fs-body: 1rem;
  --fs-small: .86rem;

  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --maxw: 1240px;
  --nav-h: 76px;
  --section-pad: clamp(4.5rem, 3rem + 7vw, 9rem);

  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --ease-inout: cubic-bezier(.7, 0, .2, 1);
  --t-micro: 200ms;
  --t-enter: 700ms;

  --pattern-url: url("assets/rafidain-pattern.svg");
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.is-locked, html.is-locked body { overflow: hidden; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--navy);
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 300;
  line-height: 1.95;
  letter-spacing: 0; /* يحفظ اتصال الحروف العربية */
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); }
h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.3; font-weight: 600; text-wrap: balance; }
strong, b { font-weight: 500; }
.section--ivory p, .news p, .partner p { font-weight: 400; }

/* ---------- عنوان المحطة ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: .75rem; font-size: .9rem; font-weight: 500; color: var(--navy-soft); }
.eyebrow-n { color: var(--blue); font-weight: 600; }
.eyebrow-n::after { content: ""; display: inline-block; width: 28px; height: 1px; background: var(--gold); vertical-align: middle; margin-inline-start: .75rem; }
.on-navy .eyebrow { color: var(--ivory-soft); }
.on-navy .eyebrow-n { color: var(--gold); }

/* ---------- ظهور الصور بعد تحميلها ---------- */
.img-fade { opacity: 0; transition: opacity 600ms ease; }
.img-fade.is-loaded { opacity: 1; }
.num { font-variant-numeric: tabular-nums; unicode-bidi: isolate; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 2px; }
.on-navy :focus-visible, .nav :focus-visible, .hero :focus-visible, .plan-overlay :focus-visible { outline-color: var(--gold); }

.skip {
  position: fixed; top: 8px; right: 8px; z-index: 100;
  background: var(--ivory); color: var(--navy); padding: .6rem 1rem; text-decoration: none;
  transform: translateY(-150%); transition: transform var(--t-micro);
}
.skip:focus { transform: none; }

.container {
  width: 100%; max-width: calc(var(--maxw) + 64px); margin-inline: auto;
  padding-left: var(--gutter); padding-right: var(--gutter-r);
}
@media (min-width: 900px) { .container { padding-left: max(32px, var(--gutter)); padding-right: max(32px, var(--gutter-r)); } }

.section { padding-block: var(--section-pad); scroll-margin-top: calc(var(--nav-h) - 8px); position: relative; }
.section--ivory { background: var(--ivory); color: var(--navy); }
.section--navy, .on-navy { background: var(--navy); color: var(--ivory); }

/* ---------- الباترن ---------- */
.pattern-strip {
  height: clamp(28px, 1.6rem + 1.4vw, 48px);
  background-image: var(--pattern-url);
  background-repeat: repeat-x;
  background-size: auto 100%;
  background-position: 0 0;
  direction: ltr;
  pointer-events: none;
}
.pattern-strip.reveal-rtl { clip-path: inset(0 0 0 100%); transition: clip-path 1100ms var(--ease-inout); }
.pattern-strip.reveal-rtl.is-in { clip-path: inset(0 0 0 0); }

/* ---------- رأس القسم والخط الرأسي ---------- */
.sec-head { display: grid; gap: 1rem; max-width: 46rem; margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem); }
.sec-head h2 { font-size: var(--fs-h2); }
.sec-head p { font-size: var(--fs-lead); color: var(--navy-soft); max-width: 40rem; }
.on-navy .sec-head p { color: var(--ivory-soft); }
.v-rule {
  display: block; width: 2px; height: 56px; background: var(--gold);
  transform: scaleY(0); transform-origin: top; transition: transform 600ms var(--ease-out);
}
.is-in .v-rule, .v-rule.is-in { transform: scaleY(1); }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity var(--t-enter) var(--ease-out), transform var(--t-enter) var(--ease-out); }
.is-in .reveal, .reveal.is-in { opacity: 1; transform: none; }
.is-in .reveal.d1 { transition-delay: 120ms; }
.is-in .reveal.d2 { transition-delay: 240ms; }
.is-in .reveal.d3 { transition-delay: 360ms; }

.caption {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8rem; font-weight: 500; color: var(--navy-soft);
}
.caption::before { content: ""; width: 14px; height: 1px; background: var(--gold); }
.on-navy .caption { color: var(--ivory-soft); }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 48px; padding: .7rem 1.5rem; border: 1px solid transparent; border-radius: 0;
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: background-color var(--t-micro), color var(--t-micro), border-color var(--t-micro), transform var(--t-micro);
}
.btn:active { transform: translateY(1px); }
.btn--gold { background: var(--gold); color: var(--navy); }
.btn--gold:hover { background: var(--ivory); }
.btn--line { border-color: rgba(240, 238, 233, .65); color: var(--ivory); background: rgba(19, 41, 75, .25); }
.btn--line:hover { background: var(--ivory); color: var(--navy); border-color: var(--ivory); }
.btn--blue { background: var(--blue); color: var(--ivory); }
.btn--blue:hover { background: var(--navy); }
.btn--ghost { background: transparent; border-color: var(--line-navy); color: var(--navy); }
.btn--ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn .arrow { transition: transform var(--t-micro); }
.btn:hover .arrow { transform: translateX(-4px); }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center;
  background: var(--ivory); color: var(--navy); border: 1px solid var(--line-navy); cursor: pointer;
  transition: background-color var(--t-micro), color var(--t-micro);
  font-size: 1.25rem; line-height: 1;
}
.icon-btn:hover { background: var(--blue); color: var(--ivory); border-color: var(--blue); }
.icon-btn:disabled { opacity: .4; cursor: default; background: var(--ivory); color: var(--navy); }

/* ---------- شريط التنقل ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 61; background: var(--navy); }
.nav {
  position: fixed; inset: 0 0 auto; z-index: 60;
  padding-top: env(safe-area-inset-top, 0px);
  color: var(--ivory);
  transition: background-color 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
}
.nav.is-solid { background: var(--navy); box-shadow: 0 1px 0 rgba(185, 151, 91, .35); }
.nav-inner { display: flex; align-items: center; gap: 1.5rem; height: var(--nav-h); }
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 70px; width: auto; transition: height 300ms var(--ease-out), opacity 600ms ease; }
.nav.is-solid .brand img { height: 50px; }
.nav-links { display: flex; gap: clamp(1rem, .4rem + 1.4vw, 2rem); margin-inline-start: auto; }
.nav-links a {
  position: relative; display: inline-flex; align-items: center; min-height: 44px;
  color: var(--ivory); text-decoration: none; font-weight: 500; font-size: .98rem;
}
.nav-links a::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 6px; height: 1px; background: var(--gold);
  transform: scaleX(0); transform-origin: right; transition: transform var(--t-micro) var(--ease-out);
}
.nav-links a:hover::after, .nav-links a[aria-current="true"]::after { transform: scaleX(1); }
.nav-links a[aria-current="true"]::before {
  content: ""; position: absolute; inset-inline-start: -12px; top: 50%; width: 6px; height: 6px; margin-top: -3px;
  border-radius: 50%; background: var(--orange);
}
.nav-links .nav-cta { gap: .55rem; padding-inline: .9rem; border: 1px solid rgba(185, 151, 91, .7); min-height: 40px; align-self: center; }
.nav-links .nav-cta::after { display: none; }
.nav-links .nav-cta:hover { background: var(--gold); color: var(--navy); }
.nav-links .nav-cta[aria-current="true"] { background: rgba(185, 151, 91, .18); }
.nav-pct { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; color: var(--gold); font-weight: 600; }
.nav-pct::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.nav-cta:hover .nav-pct { color: var(--navy); }
.nav-links li { display: flex; }
.nav-links li.nav-phones { display: none; }
.menu-btn {
  display: none; margin-inline-start: auto; min-height: 44px; padding: .4rem 1rem; gap: .6rem; align-items: center;
  background: transparent; border: 1px solid rgba(240, 238, 233, .5); color: var(--ivory); cursor: pointer;
}
.menu-btn .bars { width: 18px; height: 10px; position: relative; }
.menu-btn .bars::before, .menu-btn .bars::after { content: ""; position: absolute; inset-inline: 0; height: 2px; background: currentColor; transition: transform var(--t-micro); }
.menu-btn .bars::before { top: 0; }
.menu-btn .bars::after { bottom: 0; }
.menu-btn[aria-expanded="true"] .bars::before { transform: translateY(4px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .bars::after { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 860px) {
  :root { --nav-h: 66px; }
  .brand img { height: 52px; }
  .nav.is-solid .brand img { height: 44px; }
  .menu-btn { display: inline-flex; }
  .nav-links {
    position: absolute; inset: 100% 0 auto; flex-direction: column; gap: 0;
    background: var(--navy); padding: .5rem var(--gutter-r) 1.25rem var(--gutter);
    border-top: 1px solid rgba(185, 151, 91, .35);
    clip-path: inset(0 0 100% 0); visibility: hidden;
    transition: clip-path 250ms var(--ease-out), visibility 0s linear 250ms;
  }
  .nav-links.is-open { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path 250ms var(--ease-out); }
  .nav-links a { min-height: 52px; font-size: 1.1rem; border-bottom: 1px solid var(--line-ivory); width: 100%; }
  .nav-links a::after { display: none; }
  .nav-links a[aria-current="true"]::before { inset-inline-start: auto; inset-inline-end: 0; }
  .nav-links .nav-cta { border: 0; border-bottom: 1px solid var(--line-ivory); padding-inline: 0; justify-content: space-between; min-height: 52px; }
  .nav-links .nav-cta:hover { background: transparent; color: var(--ivory); }
  .nav-links .nav-cta[aria-current="true"] { background: transparent; }
  .nav-links li.nav-phones { display: block; padding-top: 1rem; }
  .nav.is-open { background: var(--navy); }
}

/* ---------- ١. الافتتاحية ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(100svh, 980px); min-height: min(100vh, 980px);
  display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--navy); color: var(--ivory);
}
@supports (height: 100svh) { .hero { min-height: min(100svh, 980px); } }
.hero-media {
  position: absolute; inset: 0; z-index: -2;
  clip-path: polygon(0% 0, 100% 0, 100% 100%, -15% 100%);
  animation: hero-wipe 800ms var(--ease-inout) both;
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; transform-origin: 50% 60%; animation: hero-zoom 9s var(--ease-out) 200ms both; }
@keyframes hero-wipe {
  from { clip-path: polygon(115% 0, 100% 0, 100% 100%, 100% 100%); }
  to   { clip-path: polygon(0% 0, 100% 0, 100% 100%, -15% 100%); }
}
@keyframes hero-zoom { from { transform: scale(1); } to { transform: scale(1.035); } }
.hero-shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(19, 41, 75, .62) 0, rgba(19, 41, 75, 0) 22%),
    linear-gradient(to left, rgba(19, 41, 75, .9) 0%, rgba(19, 41, 75, .72) 30%, rgba(19, 41, 75, .2) 55%, rgba(19, 41, 75, 0) 68%),
    linear-gradient(to top, rgba(19, 41, 75, .92) 0, rgba(19, 41, 75, 0) 34%);
}
.hero-content { padding-top: calc(var(--nav-h) + 4rem); padding-bottom: clamp(2.5rem, 2rem + 3vw, 4.5rem); }
.hero-copy { max-width: 40rem; display: grid; gap: 1.25rem; }
.hero h1 { font-size: var(--fs-display); line-height: 1.18; font-weight: 600; display: grid; }
.hero h1 .line { display: block; overflow: hidden; padding-block: .06em .14em; }
.hero h1 .line > span { display: block; animation: line-up 700ms var(--ease-out) both; }
.hero h1 .line:nth-child(1) > span { animation-delay: 380ms; }
.hero h1 .line:nth-child(2) > span { animation-delay: 560ms; color: var(--gold); }
@keyframes line-up { from { transform: translateY(108%); } to { transform: none; } }
.hero-tagline { font-size: var(--fs-lead); font-weight: 500; }
.hero-loc { display: inline-flex; align-items: center; gap: .65rem; font-size: .98rem; color: var(--ivory-soft); }
.hero-loc::before { content: ""; width: 2px; height: 1.2em; background: var(--gold); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .75rem; }
.fade-up { animation: fade-up 700ms var(--ease-out) both; }
.fade-up.d1 { animation-delay: 760ms; }
.fade-up.d2 { animation-delay: 860ms; }
.fade-up.d3 { animation-delay: 960ms; }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.hero .pattern-strip { position: relative; z-index: 1; }
.hero-content { position: relative; }
.hero-copy { border-inline-start: 2px solid var(--gold); padding-inline-start: clamp(1.25rem, .8rem + 1.5vw, 2rem); }
.hero h1 { font-weight: 600; font-size: clamp(2.05rem, .9rem + 3.9vw, 4.4rem); }
@media (min-width: 701px) { .hero-copy { max-width: 48rem; } .hero h1 .line { white-space: nowrap; } }
.hero-tagline { font-weight: 400; }
.scroll-cue {
  position: absolute; left: max(32px, var(--gutter)); bottom: clamp(2.5rem, 2rem + 3vw, 4.5rem);
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
  color: var(--ivory-soft); text-decoration: none; font-size: .8rem; font-weight: 400;
}
.scroll-cue:hover { color: var(--ivory); }
.cue-line { position: relative; width: 1px; height: 72px; background: rgba(240, 238, 233, .28); overflow: hidden; }
.cue-line::after { content: ""; position: absolute; inset: 0; background: var(--gold); transform: translateY(-100%); animation: cue 2.4s var(--ease-inout) 1.6s infinite; }
@keyframes cue { 0% { transform: translateY(-100%); } 55% { transform: translateY(0); } 100% { transform: translateY(100%); } }
@media (max-width: 700px) { .scroll-cue { display: none; } }

/* ---------- مؤشر الجولة ---------- */
.rail {
  position: fixed; z-index: 50; left: max(18px, env(safe-area-inset-left, 0px)); top: 50%;
  transform: translate(-12px, -50%); opacity: 0; pointer-events: none;
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
}
.rail.is-visible { opacity: 1; transform: translate(0, -50%); pointer-events: auto; }
.rail ol { position: relative; display: grid; gap: 22px; padding: 14px 9px; background: rgba(19, 41, 75, .88); }
.rail ol::before { content: ""; position: absolute; top: 20px; bottom: 20px; left: 50%; width: 1px; background: rgba(240, 238, 233, .25); }
.rail a { position: relative; display: grid; place-items: center; width: 14px; height: 14px; text-decoration: none; }
.rail-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ivory); opacity: .55; transition: transform var(--t-micro), background-color var(--t-micro), opacity var(--t-micro); position: relative; }
.rail li.is-past .rail-dot { background: var(--gold); opacity: 1; }
.rail li.is-active .rail-dot { background: var(--orange); opacity: 1; transform: scale(1.6); }
.rail-label {
  position: absolute; left: calc(100% + 18px); top: 50%; transform: translate(-6px, -50%); white-space: nowrap;
  background: var(--navy); color: var(--ivory); font-size: .8rem; padding: .25rem .7rem; opacity: 0; pointer-events: none;
  transition: opacity var(--t-micro), transform var(--t-micro);
}
.rail-label .num { color: var(--gold); }
.rail a:hover .rail-label { opacity: 1; transform: translate(0, -50%); }
@media (max-width: 1399px) { .rail { display: none; } }
.boot-title { font-size: var(--fs-display); font-weight: 600; line-height: 1.18; }
@media (max-width: 700px) {
  .hero { min-height: 100svh; }
  .hero-media img { object-position: var(--mobile-focus, 63% 0%); }
  .hero-shade {
    background:
      linear-gradient(to bottom, rgba(19, 41, 75, .6) 0, rgba(19, 41, 75, 0) 20%),
      linear-gradient(to top, rgba(19, 41, 75, .96) 0, rgba(19, 41, 75, .82) 36%, rgba(19, 41, 75, 0) 66%);
  }
  .hero-ctas .btn { flex: 1 1 100%; }
}

/* ---------- ٢. عن المدينة ---------- */
.about-grid { display: grid; gap: clamp(2.5rem, 2rem + 3vw, 5rem); align-items: center; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.about-text { display: grid; gap: 1.5rem; align-content: start; }
.about-text h2 { font-size: var(--fs-h2); }
.about-text p { font-size: var(--fs-lead); max-width: 34rem; }
.about-figure { display: grid; gap: .75rem; }
.about-img { overflow: hidden; aspect-ratio: 4 / 5; background: var(--ivory-2); clip-path: inset(100% 0 0 0); transition: clip-path 900ms var(--ease-inout); }
.is-in .about-img { clip-path: inset(0 0 0 0); }
.about-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; transform: scale(1.06); transition: transform 1400ms var(--ease-out); }
.is-in .about-img img { transform: scale(1); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin-top: 1rem; padding-top: 2rem; border-top: 1px solid var(--line-navy); }
.stat { display: grid; gap: .35rem; align-content: start; position: relative; padding-inline-start: 1rem; opacity: 0; transform: translateY(14px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
.stat::before { content: ""; position: absolute; inset-inline-start: 0; top: .5rem; bottom: .4rem; width: 2px; background: var(--gold); }
.is-in .stat { opacity: 1; transform: none; }
.is-in .stat:nth-child(2) { transition-delay: 180ms; }
.is-in .stat:nth-child(3) { transition-delay: 360ms; }
.stat-value { font-size: clamp(2rem, 1.3rem + 2.2vw, 3.1rem); font-weight: 600; line-height: 1.1; }
.stat-value small { font-size: .45em; font-weight: 500; margin-inline-end: .3em; vertical-align: .35em; }
.stat-label { font-size: var(--fs-small); color: var(--navy-soft); line-height: 1.6; }
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-img { aspect-ratio: 4 / 3; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; gap: 1.5rem; }
  .stat { grid-template-columns: auto 1fr; align-items: baseline; column-gap: 1rem; }
}

/* ---------- ٣. المعرض ---------- */
.tabs-wrap { overflow-x: auto; scrollbar-width: none; margin-bottom: 2rem; border-bottom: 1px solid var(--line-ivory); }
.tabs-wrap::-webkit-scrollbar { display: none; }
.tabs { position: relative; display: flex; gap: clamp(1.25rem, .5rem + 2vw, 2.75rem); width: max-content; min-width: 100%; }
.tab {
  background: none; border: 0; padding: .9rem 0 1rem; cursor: pointer; white-space: nowrap;
  color: var(--ivory-soft); font-size: clamp(1rem, .95rem + .3vw, 1.15rem); font-weight: 500;
  transition: color var(--t-micro);
}
.tab:hover { color: var(--ivory); }
.tab[aria-selected="true"] { color: var(--ivory); font-weight: 600; }
.tabs-ink {
  position: absolute; bottom: -1px; height: 3px; background: var(--gold); left: 0; width: 0;
  transition: left 250ms var(--ease-out), width 250ms var(--ease-out);
}
.gallery { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(1.75rem, 1rem + 3vw, 4rem); align-items: end; }
.gallery-window {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--navy-deep);
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab;
}
.gallery-window:active { cursor: grabbing; }
.g-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 350ms ease; }
.g-slide.is-active { opacity: 1; }
.g-slide > img.g-main { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.g-detail {
  position: absolute; bottom: clamp(12px, 3%, 24px); left: clamp(12px, 3%, 24px); width: clamp(96px, 24%, 180px);
  background: var(--ivory); padding: 6px; box-shadow: 0 12px 30px rgba(13, 29, 54, .35);
}
.g-detail img { width: 100%; height: auto; pointer-events: none; }
.g-plate {
  position: absolute; inset: 0; display: grid; grid-template-rows: 1fr auto; background: var(--ivory); color: var(--navy);
}
.g-plate-body { display: grid; align-content: center; gap: 1rem; padding: clamp(1.5rem, 1rem + 4vw, 4rem); }
.g-plate .v-rule { transform: none; height: 72px; }
.plate-icon { width: clamp(84px, 9vw, 120px); height: auto; color: var(--gold); margin-bottom: .5rem; }
.plate-icon path, .plate-icon rect, .plate-icon circle { stroke-dasharray: 400; stroke-dashoffset: 400; }
.g-slide.is-active .plate-icon path, .g-slide.is-active .plate-icon rect, .g-slide.is-active .plate-icon circle { animation: draw 1100ms var(--ease-out) 150ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.g-plate-big { font-size: clamp(2rem, 1.2rem + 3.2vw, 3.8rem); font-weight: 600; line-height: 1.2; }
.g-plate-small { font-size: var(--fs-lead); color: var(--navy-soft); }
.g-badge {
  position: absolute; top: 14px; right: 14px; background: rgba(19, 41, 75, .78); color: var(--ivory);
  font-size: .78rem; padding: .25rem .65rem; pointer-events: none;
}
.g-plate .g-badge { background: transparent; color: var(--navy-soft); border: 1px solid var(--line-navy); }
.gallery-text { display: grid; gap: 1.25rem; align-content: end; min-height: 16rem; }
.gallery-text-inner { display: grid; gap: 1.1rem; animation: fade-in 350ms ease both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.gallery-text h3 { font-size: var(--fs-h3); }
.gallery-text p { color: var(--ivory-soft); font-size: 1.08rem; }
.facts { display: grid; gap: .5rem; }
.facts li { display: flex; gap: .75rem; align-items: center; }
.facts li::before { content: ""; width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); flex: none; }
.gallery-nav { display: flex; align-items: center; gap: .75rem; margin-top: .5rem; }
.gallery-count { font-size: .95rem; color: var(--ivory-soft); min-width: 3.5rem; text-align: center; }
.gallery-nav .icon-btn { background: transparent; color: var(--ivory); border-color: var(--line-ivory); }
.gallery-nav .icon-btn:hover { background: var(--ivory); color: var(--navy); border-color: var(--ivory); }
@media (max-width: 900px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery-text { min-height: 0; }
}

/* ---------- ٤. المخطط ---------- */
.plan-section { padding-top: 0; }
.plan-section .pattern-strip { margin-bottom: var(--section-pad); }
.plan-viewer { position: relative; }
.plan-stage {
  position: relative; overflow: hidden; aspect-ratio: 2800 / 1072; max-width: 100%;
  background: var(--ivory); border-block: 1px solid var(--line-navy);
  touch-action: pan-y; cursor: zoom-in; outline-offset: -3px;
}
.plan-stage.is-zoomed { touch-action: none; cursor: grab; }
.plan-stage.is-zoomed:active { cursor: grabbing; }
.plan-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transform-origin: 50% 50%;
  user-select: none; -webkit-user-drag: none; pointer-events: none;
}
.plan-img.is-anim { transition: transform 250ms var(--ease-out); }
.plan-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1rem;
}
.plan-tools .zoom-level { min-width: 4rem; text-align: center; font-size: .95rem; color: var(--navy-soft); }
.plan-tools .btn { min-height: 44px; padding-inline: 1rem; }
.plan-tools .spacer { flex: 1; }
.plan-hint { font-size: var(--fs-small); color: var(--navy-soft); }
.plan-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: clamp(2rem, 1rem + 3vw, 4.5rem); margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem); }
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2rem; align-content: start; }
.legend li { display: grid; gap: .25rem; padding-top: .9rem; border-top: 1px solid var(--line-navy); }
.legend strong { font-weight: 600; font-size: 1.05rem; }
.legend span { color: var(--navy-soft); font-size: .98rem; }
.group { border: 1px solid var(--line-navy); background: #f7f5f1; align-self: start; }
.group summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.25rem; font-weight: 600; font-size: 1.15rem; min-height: 56px;
  transition: background-color var(--t-micro);
}
.group summary::-webkit-details-marker { display: none; }
.group summary:hover { background: var(--ivory); }
.group summary .plus { position: relative; width: 16px; height: 16px; flex: none; }
.group summary .plus::before, .group summary .plus::after { content: ""; position: absolute; background: var(--blue); transition: transform var(--t-micro); }
.group summary .plus::before { inset: 7px 0; height: 2px; }
.group summary .plus::after { inset: 0 7px; width: 2px; }
.group[open] summary .plus::after { transform: scaleY(0); }
.group[open] summary { border-bottom: 1px solid var(--line-navy); }
.group-body { padding: 1.25rem; display: grid; gap: 1.25rem; animation: fade-in 250ms ease both; }
.formula { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .7rem; }
.formula .f { display: grid; text-align: center; }
.formula .f b { font-size: 1.9rem; font-weight: 600; line-height: 1.1; }
.formula .f span { font-size: .8rem; color: var(--navy-soft); }
.formula .op { color: var(--gold); font-size: 1.4rem; font-weight: 600; }
.formula .f.total b { color: var(--blue); }
.legend strong .num { color: var(--blue); font-weight: 600; margin-inline-end: .35rem; }
.plan-note { grid-column: 1 / -1; order: 3; font-size: var(--fs-small); color: var(--navy-soft); }
/* القائمة داخل المساحة الفارغة من المخطط (أسفل اليمين) على الشاشات العريضة */
.plan-legend-overlay {
  position: absolute; left: 22%; right: 1.5%; top: 60%; bottom: 4%;
  display: none; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.25rem;
  align-content: center; pointer-events: none;
  transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out);
}
.plan-legend-overlay.is-hidden { opacity: 0; transform: translateY(8px); }
.plan-legend-overlay li { display: grid; gap: .2rem; align-content: start; padding-top: .7rem; border-top: 1px solid var(--gold); font-size: .84rem; line-height: 1.7; }
.plan-legend-overlay .num { color: var(--blue); font-weight: 600; font-size: .78rem; }
.plan-legend-overlay strong { font-size: .95rem; font-weight: 600; }
.plan-legend-overlay li > span:last-child { color: var(--navy-soft); }
@media (min-width: 1100px) {
  .plan-legend-overlay { display: grid; }
  .legend--below { display: none; }
  .plan-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .plan-note { grid-column: auto; order: 0; font-size: 1rem; max-width: 30rem; }
}
@media (max-width: 900px) { .plan-body { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .legend { grid-template-columns: 1fr; gap: 1rem; } }

.plan-overlay {
  position: fixed; inset: 0; z-index: 90; background: var(--navy); color: var(--ivory);
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  animation: fade-in 250ms ease both;
}
.plan-overlay-bar { display: flex; align-items: center; gap: 1rem; padding: .75rem 16px; }
.plan-overlay-bar h2 { font-size: 1.1rem; font-weight: 600; flex: 1; }
.plan-overlay .plan-viewer { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
.plan-overlay .plan-stage { aspect-ratio: auto; height: auto; min-height: 0; border: 0; background: var(--ivory); }
.plan-overlay .plan-tools { padding: .75rem 16px; margin: 0; }
.plan-overlay .plan-tools .zoom-level, .plan-overlay .plan-hint { color: var(--ivory-soft); }
.plan-overlay .btn--ghost { color: var(--ivory); border-color: rgba(240, 238, 233, .45); }
.plan-overlay .btn--ghost:hover { background: var(--ivory); color: var(--navy); }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------- خريطة المناطق Z1–Z8 ---------- */
.zmap { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
.zmap > * { min-width: 0; }
.zmap-stage { background: var(--ivory); border: 1px solid var(--line-navy); }
.zmap-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.zmap-canvas { position: relative; width: 820px; }
.zmap-canvas .zmap-img { width: 100%; height: auto; }
.zmap-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.zmap-swipe { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .5rem; font-size: .8rem; color: var(--navy-soft); border-top: 1px solid var(--line-navy); background: #f7f5f1; }
@media (min-width: 900px) { .zmap-canvas { width: 100%; } .zmap-swipe { display: none; } }
.zone { cursor: pointer; }
.zone polygon { fill: rgba(19, 41, 75, 0); stroke: rgba(19, 41, 75, .35); stroke-width: 4; stroke-dasharray: 18 12; transition: fill var(--t-micro), stroke var(--t-micro); }
.zone:hover polygon { fill: rgba(185, 151, 91, .18); }
.zone.is-on polygon { fill: rgba(185, 151, 91, .3); stroke: var(--gold); stroke-width: 8; stroke-dasharray: none; }
.zone-label rect { fill: var(--navy); opacity: .88; transition: fill var(--t-micro); }
.zone-label text { fill: var(--ivory); font-family: var(--font); font-size: 46px; font-weight: 500; direction: ltr; }
.zone.is-on .zone-label rect { fill: var(--gold); opacity: 1; }
.zone.is-on .zone-label text { fill: var(--navy); }
.zone-card { display: grid; gap: 1rem; align-content: start; padding: 1.75rem; background: #f7f5f1; border: 1px solid var(--line-navy); }
.zone-card-id { display: flex; align-items: baseline; gap: .75rem; font-size: .85rem; color: var(--navy-soft); }
.zone-card-id strong { font-size: 3rem; line-height: 1; color: var(--navy); font-weight: 600; }
.zone-card-type { font-size: 1.1rem; font-weight: 500; }
.zone-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; padding-block: 1rem; border-block: 1px solid var(--line-navy); margin: 0; }
.zone-stats div { display: flex; flex-direction: column-reverse; }
.zone-stats dt { font-size: .76rem; color: var(--navy-soft); }
.zone-stats dd { font-size: 1.5rem; font-weight: 600; line-height: 1.2; margin: 0; }
.zone-card .btn { width: 100%; }
.zone-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.zchip { min-height: 44px; padding: 0 1.1rem; background: transparent; border: 1px solid var(--line-navy); border-radius: 999px; cursor: pointer; font-weight: 500; color: var(--navy); transition: background-color var(--t-micro), border-color var(--t-micro), color var(--t-micro); }
.zchip:hover { border-color: var(--navy); }
.zchip.is-on, .zchip[aria-checked="true"] { background: var(--navy); color: var(--ivory); border-color: var(--navy); }
.zmap-note { margin-top: 1rem; }
@media (min-width: 1100px) { .zmap { grid-template-columns: minmax(0, 1fr) 300px; align-items: stretch; } }

/* ---------- ٥. تقدّم الأعمال ---------- */
.progress-section { overflow: hidden; }
.progress-grid { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: clamp(1.5rem, 1rem + 3vw, 4rem); }
.progress-copy { text-align: center; display: grid; gap: 1.25rem; justify-items: center; max-width: 44rem; margin-inline: auto; }
.progress-figure { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: .2em .45em; font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.5rem); font-weight: 500; line-height: 1.3; }
.progress-figure .pct { font-size: clamp(4.5rem, 2.5rem + 8vw, 9rem); font-weight: 600; color: var(--gold); line-height: 1; }
.progress-text { font-size: var(--fs-lead); color: var(--ivory-soft); max-width: 36rem; }
.progress-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.5rem; font-size: var(--fs-small); color: var(--ivory-soft); }
.progress-meta .dot { display: inline-flex; align-items: center; gap: .5rem; }
.progress-meta .dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.gauge { --h: clamp(220px, 34vw, 380px); display: grid; grid-template-columns: auto auto; gap: .9rem; height: var(--h); }
.gauge-track { position: relative; width: 4px; height: 100%; background: rgba(240, 238, 233, .16); }
.gauge-fill { position: absolute; inset: 0; background: var(--gold); transform: scaleY(0); transform-origin: bottom; transition: transform 1000ms var(--ease-out) 250ms; }
.is-in .gauge-fill { transform: scaleY(var(--p)); }
.gauge-dot {
  position: absolute; left: 50%; bottom: 0; width: 14px; height: 14px; margin: 0 0 -7px -7px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 0 5px rgba(237, 155, 51, .22);
  transition: bottom 1000ms var(--ease-out) 250ms;
}
.is-in .gauge-dot { bottom: calc(var(--p) * 100%); }
.gauge-scale { position: relative; height: 100%; width: 3.2rem; font-size: .8rem; color: var(--ivory-soft); }
.gauge-scale li { position: absolute; inset-inline-start: 0; transform: translateY(50%); display: flex; align-items: center; gap: .4rem; line-height: 1; }
.gauge-scale li::before { content: ""; width: 10px; height: 1px; background: rgba(240, 238, 233, .45); }
.gauge-scale li.is-mark { color: var(--gold); font-weight: 600; }
.gauge-scale li.is-mark::before { background: var(--gold); width: 16px; }
.gauge-ghost { width: calc(4px + .9rem + 3.2rem); }
.site-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; margin-top: 4rem; }
.site-photos figure { display: grid; gap: .5rem; }
.site-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
@media (max-width: 700px) {
  .progress-grid { grid-template-columns: auto minmax(0, 1fr); }
  .gauge-ghost { display: none; }
  .gauge { --h: 260px; }
  .progress-copy { text-align: start; justify-items: start; }
  .progress-figure, .progress-meta { justify-content: flex-start; }
}

/* ---------- ٦. الشركتان ---------- */
.partners { display: grid; grid-template-columns: minmax(0, 1fr) clamp(48px, 10vw, 160px) minmax(0, 1fr); align-items: start; }
.partner { display: grid; justify-items: center; text-align: center; gap: .6rem; }
.partner-logo { width: min(240px, 70%); aspect-ratio: 283 / 236; margin-bottom: 1rem; background: var(--ivory-2); }
.partner-logo img { width: 100%; height: 100%; object-fit: contain; }
.partner h3 { font-size: var(--fs-h3); }
.partner .en { font-size: .95rem; color: var(--navy-soft); font-weight: 500; }
.partner .role { color: var(--navy-soft); }
.partner .slogan { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--gold); font-weight: 500; color: var(--navy); }
.partners-link { align-self: start; margin-top: calc(min(240px, 70%) * 0); height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: right; transition: transform 900ms var(--ease-out) 200ms; position: relative; top: clamp(70px, 9vw, 100px); }
.is-in .partners-link { transform: scaleX(1); }
.partners-link::before, .partners-link::after { content: ""; position: absolute; top: -3px; width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); }
.partners-link::before { right: -4px; }
.partners-link::after { left: -4px; }
@media (max-width: 760px) {
  .partners { grid-template-columns: 1fr; gap: 0; }
  .partners-link { justify-self: center; width: 2px; height: 72px; top: 0; margin-block: 1.5rem 2rem; transform: scaleY(0); transform-origin: top; }
  .is-in .partners-link { transform: scaleY(1); }
  .partners-link::before { top: -4px; right: -3px; }
  .partners-link::after { top: auto; bottom: -4px; left: -3px; }
}

/* ---------- ٧. الخبر والتذييل ---------- */
.news { padding-block: clamp(3rem, 2rem + 4vw, 5.5rem); background: var(--ivory); }
.news-inner { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(1.25rem, 1rem + 2vw, 3rem); align-items: start; padding-block: 2rem; border-block: 1px solid var(--gold); }
.news-label { display: inline-flex; align-items: center; gap: .55rem; font-weight: 600; color: var(--blue); white-space: nowrap; }
.news-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.news p { font-size: clamp(1.2rem, 1rem + .9vw, 1.75rem); font-weight: 500; line-height: 1.6; max-width: 52rem; }
@media (max-width: 600px) { .news-inner { grid-template-columns: 1fr; } }

.footer { background: var(--navy); color: var(--ivory); }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 2.5rem; align-items: center; padding-block: clamp(3.5rem, 2.5rem + 3vw, 5.5rem) 2rem; }
.footer-brand { display: flex; align-items: center; gap: 1.5rem; }
.footer-logo { height: 112px; width: auto; flex: none; }
.footer-name { font-size: var(--fs-h3); font-weight: 600; }
.footer-loc { color: var(--ivory-soft); }
.footer-end { justify-self: end; }
.footer-base { padding-block: 1.25rem 1.75rem; border-top: 1px solid var(--line-ivory); font-size: .8rem; color: var(--ivory-soft); }
.footer .pattern-strip { margin-bottom: env(safe-area-inset-bottom, 0px); }

.contacts { display: grid; gap: .6rem; padding-inline-start: 1.5rem; border-inline-start: 1px solid rgba(185, 151, 91, .5); }
.contacts-title { font-size: .85rem; color: var(--ivory-soft); }
.contacts ul { display: grid; gap: .35rem; }
.contacts li { display: flex; align-items: center; gap: .75rem; }
.contacts .phone { color: var(--ivory); text-decoration: none; font-size: 1.3rem; font-weight: 500; letter-spacing: .04em; font-variant-numeric: tabular-nums; transition: color var(--t-micro); }
.contacts .phone:hover { color: var(--gold); }
.copy-btn {
  min-height: 40px; min-width: 52px; padding: .15rem .8rem; font-size: .8rem; cursor: pointer;
  background: transparent; color: var(--gold); border: 1px solid rgba(185, 151, 91, .55);
  transition: background-color var(--t-micro), color var(--t-micro);
}
.copy-btn:hover { background: var(--gold); color: var(--navy); }
.contacts--compact { padding: 0; border: 0; }
.contacts--compact ul { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.contacts--compact .phone { font-size: 1.05rem; min-height: 44px; display: inline-flex; align-items: center; border: 0 !important; width: auto !important; }
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr; justify-items: start; gap: 2rem; }
  .footer-end { justify-self: start; }
  .footer-logo { height: 88px; }
}

/* ---------- أدوات المعاينة ---------- */
img.is-missing { visibility: hidden; }
.tools-fab {
  position: fixed; z-index: 80; left: calc(16px + env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .5rem 1rem;
  background: var(--ivory); color: var(--navy); border: 1px solid var(--gold); cursor: pointer; font-weight: 600; font-size: .9rem;
  box-shadow: 0 8px 24px rgba(13, 29, 54, .25);
}
.tools-fab .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.tools-panel {
  position: fixed; z-index: 85; left: calc(16px + env(safe-area-inset-left, 0px)); bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  width: min(380px, calc(100vw - 32px)); max-height: min(70vh, 560px); overflow: auto;
  background: var(--ivory); color: var(--navy); border: 1px solid var(--gold); padding: 1.25rem; display: grid; gap: 1rem;
  box-shadow: 0 18px 48px rgba(13, 29, 54, .3); font-size: .95rem; line-height: 1.7;
}
.tools-panel h2 { font-size: 1.1rem; }
.tools-list { display: grid; gap: .3rem; font-size: .85rem; }
.tools-list li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line-navy); padding-block: .2rem; }
.tools-list code { direction: ltr; unicode-bidi: isolate; font-family: ui-monospace, Consolas, monospace; }
.tools-list .st-missing { color: #a3460f; }
.tools-list .st-local { color: var(--blue); }
.file-pick { position: relative; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-pick input:focus-visible + .btn { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ---------- تقليل الحركة ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
  .cue-line::after { animation: none !important; transform: none !important; }
  .reveal, .stat, .about-img, .pattern-strip.reveal-rtl { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .about-img img, .hero-media img { transform: none !important; }
  .v-rule { transform: none !important; }
  .gauge-fill { transform: scaleY(var(--p)) !important; }
  .gauge-dot { bottom: calc(var(--p) * 100%) !important; }
  .partners-link { transform: none !important; }
}
