/* =========================================================
   Green Door Group — main stylesheet
   هوية: زرع + رمل + ماية  ·  طابع: مملوكي / فاطمي
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  /* زرع */
  --gd-primary: #5E8C7F;
  --gd-primary-text: #3A5E54;
  --gd-primary-deep: #2C4A42;   /* للخلفيات الغامقة (section الطريقة) */

  /* رمل */
  --gd-sand: #C9A66B;
  --gd-sand-text: #8C6A2E;

  /* ماية */
  --gd-water: #6FA8B8;
  --gd-water-text: #2F6E80;

  /* أسطح */
  --gd-surface: #D9CFBF;
  --gd-bg: #EFE8DC;
  --gd-bg-soft: #F5F0E7;

  /* خطوط */
  --gd-font-heading: 'Reem Kufi', sans-serif;
  --gd-font-body: 'IBM Plex Sans Arabic', sans-serif;

  /* layout */
  --container: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --section-y: clamp(72px, 11vw, 140px);
  --radius: 4px;
  --header-h: 68px;

  /* motion */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  /* ---- patterns (نجمة ثمانية متكررة — طابع مشربية) ---- */
  --pattern-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23C9A66B' stroke-width='1'%3E%3Cg transform='translate(32 32)'%3E%3Crect x='-10' y='-10' width='20' height='20'/%3E%3Crect x='-10' y='-10' width='20' height='20' transform='rotate(45)'/%3E%3C/g%3E%3Cpath d='M0 32 L18 32 M46 32 L64 32 M32 0 L32 18 M32 46 L32 64'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--gd-font-body);
  font-size: clamp(15px, 1.05vw + 11px, 17px);
  line-height: 1.9;
  color: var(--gd-primary-text);
  background: var(--gd-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/*
  قاعدة الخطوط:
  - Reem Kufi للعناوين الكبيرة بس (عناوين الـ sections من 28px وطالع + اسم الشركة).
    تحت الحجم ده حرف الحاء بيتبوّظ ("تحليل" بتتقري "تـليل").
  - أي عنوان item أو نص صغير: IBM Plex Sans Arabic 500.
*/
h1, h2, h3 {
  font-family: var(--gd-font-heading);
  font-weight: 500;
  line-height: 1.35;
  color: var(--gd-primary);
}
h3 {
  font-family: var(--gd-font-body);
  line-height: 1.5;
}

:focus-visible { outline: 2px solid var(--gd-water); outline-offset: 3px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* English mode: Plex بيغطي اللاتيني كمان */
html[lang="en"] body { line-height: 1.7; }
html[lang="en"] .section-head__title,
html[lang="en"] h3 { letter-spacing: .01em; }

/* ---------- 3. Buttons ----------
   كل زراير الموقع من css/components/gd-button.css (.gd-btn) */

/* ---------- 4. Header / Nav ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  transition: background .4s var(--ease), box-shadow .4s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(239, 232, 220, .9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--gd-surface);
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--gd-font-heading);
  font-size: 1.2rem;
  color: var(--gd-primary-text);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.nav__brand img { width: 24px; height: auto; }
/* البراند في الـ nav بيظهر بعد ما تعدّي الـ hero */
.site-header.is-scrolled .nav__brand { opacity: 1; transform: none; }

.nav__links {
  display: flex;
  gap: clamp(16px, 2.6vw, 36px);
}
.nav__links a {
  position: relative;
  padding-block: 6px;
  font-weight: 500;
  font-size: .95rem;
  color: var(--gd-primary-text);
}
.nav__links a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 1px;
  background: var(--gd-sand);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .4s var(--ease);
}
.nav__links a:hover::after,
.nav__links a.is-active::after { transform: scaleX(1); }
.nav__links a.is-active { color: var(--gd-primary); }

.nav__actions { display: flex; align-items: center; gap: 12px; }

.lang-toggle {
  min-width: 44px;
  height: 36px;
  padding-inline: 10px;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--gd-sand-text);
  border: 1px solid var(--gd-sand);
  border-radius: var(--radius);
  transition: background .3s var(--ease), color .3s var(--ease);
}
.lang-toggle:hover { background: var(--gd-sand); color: var(--gd-bg); }

.nav__burger {
  display: none;
  width: 44px;
  height: 44px;
  position: relative;
}
.nav__burger span {
  position: absolute;
  inset-inline: 11px;
  height: 1.5px;
  background: var(--gd-primary-text);
  transition: transform .35s var(--ease), opacity .25s var(--ease);
}
.nav__burger span:nth-child(1) { top: 15px; }
.nav__burger span:nth-child(2) { top: 21px; }
.nav__burger span:nth-child(3) { top: 27px; }
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- 5. Hero ---------- */
.hero {
  /* ألوان الزرار (gd-button.css API) */
  --btn-bg: var(--gd-primary);
  --btn-fg: var(--gd-bg);
  --btn-surface: var(--gd-bg);

  position: relative;
  display: grid;
  place-items: center;
  /* من غير min-height: الـ Hero بيخلص بعد الزرار بمسافة بسيطة، وبانل الخدمات يبدأ على طول */
  padding-block: calc(var(--header-h) + clamp(32px, 6vw, 72px)) clamp(28px, 4vw, 44px);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

.hero__pattern {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("../assets/patterns/gd-pattern-mashrabiya.svg");
  background-size: 28px;
  background-position: center;
  --pattern-opacity: .3;
  opacity: var(--pattern-opacity);
  /*
    ماسكين فوق بعض (intersect):
    1) radial: فاضية في النص عند اللوجو والكلام، وبتظهر بالتدريج ناحية الأطراف
    2) linear: بتخف تحت لحد ما تختفي، عشان مفيش فاصل حاد مع الـ section اللي بعدها
  */
  --hero-mask-radial: radial-gradient(ellipse at 50% 46%, transparent 32%, rgba(0,0,0,.4) 55%, #000 88%);
  --hero-mask-fade: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
  -webkit-mask-image: var(--hero-mask-radial), var(--hero-mask-fade);
  -webkit-mask-composite: source-in;
          mask-image: var(--hero-mask-radial), var(--hero-mask-fade);
          mask-composite: intersect;
  animation: patternIn 2.4s var(--ease) .2s both;
}
@media (max-width: 760px) {
  /* على الموبايل الكلام واخد العرض كله، فنوسّع المنطقة الفاضية */
  .hero__pattern {
    --hero-mask-radial: radial-gradient(ellipse at 50% 44%, transparent 45%, rgba(0,0,0,.4) 64%, #000 92%);
  }
}


.hero__inner { display: flex; flex-direction: column; align-items: center; }

.hero__arch { width: clamp(120px, 22vw, 168px); margin-bottom: clamp(20px, 3vw, 32px); }
.hero__mark { width: 100%; height: auto; overflow: visible; }

/* --- Logo intro sequence --- */
.m-sill  { transform-box: fill-box; transform-origin: center; animation: sill .8s var(--ease-out) .15s both; }
.m-door  { transform-box: fill-box; transform-origin: bottom center; animation: doorRise 1.1s var(--ease-out) .35s both; }
.m-frame { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s var(--ease) 1.05s forwards; }
.m-line  { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .7s var(--ease) 1.9s forwards; }
.m-star  { opacity: 0; animation: fadeIn .6s var(--ease) 2.2s forwards; }
.m-star__spin { transform-box: fill-box; transform-origin: center; animation: starSpin 1.4s var(--ease-out) 2.2s both; }
.m-knob  { opacity: 0; animation: fadeIn .5s var(--ease) 2.5s forwards; }

/* --- اسم الشركة تحت اللوجو --- */
.hero__name { display: flex; flex-direction: column; align-items: center; gap: 10px; }

.hero__name-ar {
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  line-height: 1.2;
  color: var(--gd-primary-text);
  /* reveal من اليمين للشمال زي ما بنقرا — clip-path عشان الحروف العربي متتقطعش */
  clip-path: inset(-10% 0 -10% 100%);
  animation: revealRTL 1.4s var(--ease-out) 2.7s forwards;
}
html[dir="ltr"] .hero__name-ar {
  clip-path: inset(-10% 100% -10% 0);
  animation-name: revealLTR;
}

.hero__name-en {
  font-family: var(--gd-font-body);
  font-weight: 500;
  font-size: clamp(.72rem, 1.4vw, .9rem);
  color: var(--gd-sand-text);
  letter-spacing: .9em;
  padding-inline-start: .9em; /* يعوّض الـ tracking عشان يفضل في النص */
  opacity: 0;
  animation: tracking 1.6s var(--ease-out) 3.3s forwards;
}

.hero__rule {
  width: clamp(200px, 30vw, 240px);
  height: auto;
  margin-block: 26px 18px;
  overflow: visible;
}
/* الخطين بيتمدّوا من عند القوس لبرّه */
.r-line {
  transform-box: fill-box;
  transform: scaleX(0);
  animation: grow 1s var(--ease-out) 3.9s forwards;
}
.r-line--start { transform-origin: right center; }
.r-line--end   { transform-origin: left center; }
/* القوس بيترسم stroke draw */
.r-arch {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1s var(--ease) 3.75s forwards;
}
.r-dot {
  opacity: 0;
  animation: fadeIn .5s var(--ease) 4.5s forwards;
}

.hero__tagline {
  font-family: var(--gd-font-body);
  font-weight: 500;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  line-height: 1.5;
  color: var(--gd-primary);
  opacity: 0;
  animation: fadeUp .9s var(--ease-out) 4.1s forwards;
}

.hero__lead {
  max-width: 46ch;
  margin-top: 12px;
  font-size: clamp(.95rem, 1.4vw, 1.05rem);
  color: var(--gd-primary-text);
  opacity: 0;
  animation: fadeUp .9s var(--ease-out) 4.25s forwards;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 36px;
  opacity: 0;
  animation: fadeUp .9s var(--ease-out) 4.45s forwards;
}

.hero__scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  translate: -50% 0;
  width: 24px;
  height: 40px;
  border: 1px solid var(--gd-sand);
  border-radius: 12px 12px 12px 12px / 18px 18px 6px 6px; /* قوس صغير */
  opacity: 0;
  animation: fadeIn .8s var(--ease) 4.8s forwards;
}
.hero__scroll span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 3px;
  height: 7px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--gd-sand);
  animation: scrollDot 2s var(--ease) infinite;
}

/* ---------- 6. Sections (shared) ---------- */
.section { position: relative; padding-block: var(--section-y); }

.section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: clamp(40px, 6vw, 64px);
}
.section-head--start { align-items: flex-start; text-align: start; margin-bottom: 28px; }

.section-head__kicker {
  font-size: .85rem;
  font-weight: 500;
  color: var(--gd-sand-text);
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.section-head__title { font-size: clamp(1.9rem, 4vw, 2.7rem); }

.gd-divider {
  /* الفاصل المعتمد للموقع: gd-divider-arch.svg (inline عشان الأنيميشن) */
  width: clamp(180px, 24vw, 240px);
  height: auto;
  margin-top: 18px;
  overflow: visible;
}
.gd-divider__line { fill: var(--gd-sand); transform-box: fill-box; }
.gd-divider__line--start { transform-origin: right center; }
.gd-divider__line--end   { transform-origin: left center; }
.gd-divider__arch { fill: none; stroke: var(--gd-sand); stroke-width: 1.4; stroke-dasharray: 1; stroke-dashoffset: 0; }
.gd-divider__dot { fill: var(--gd-primary); }

/* Divider بين الـ sections — شريط زخرفي رفيع */
.divider {
  height: 22px;
  max-width: var(--container);
  margin-inline: auto;
  background-image: var(--pattern-star);
  background-size: 22px;
  background-position: center;
  opacity: .5;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
}

/* ---------- 7. Services (Section 2) ----------
   نفس الـ HTML: grid 3×2 على الديسكتوب، 2×3 على التابلت، و compact list على الموبايل.
*/
.services {
  --btn-bg: var(--gd-primary);
  --btn-fg: var(--gd-bg);
  --btn-surface: var(--gd-bg);
  /* ألوان الحشوات (css/components/gd-panel.css) */
  --panel-surface: #F4EFE6;
  --panel-line: #C9A66B;
  --panel-cut: 14px;
  isolation: isolate;
}
/* السكشن نفسه مسافة خارجية بس، والمحتوى كله جوه البانل */
.services.section { padding-block: 0; } /* البانل لازق في الـ Hero من فوق وفي الـ section اللي بعده من تحت */

.services__panel {
  position: relative;
  /* مسافة مريحة جوه البانل: الكلام بعيد عن حافة الحجر فوق (الـ Hero) وتحت (السكشن الغامق) */
  padding-block: clamp(96px, 12vw, 168px);
}

/* خلفية حجر (ashlar) على البانل كله، من الحافة للحافة */
.services__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("../assets/patterns/gd-pattern-stone.svg");
  background-size: 104px 88px;
  background-position: center top;
  opacity: .22;
}

.section-head__sub {
  max-width: 46ch;
  margin-top: 16px;
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  color: var(--gd-primary-text);
}

.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* كارت الخدمة = حشوة حجر منحوتة (.gd-panel) — الشكل كله من الـ component.
   الكلام والأيقونة على اليمين (flex-start في RTL). */
.svc {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

/* إطار الأيقونة ثماني — نفس هندسة الزرار والنجمة */
.svc__icon-wrap {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  position: relative;
  /* clip-path بيقص الـ border على الأقطار، فالإطار = خلفية رملي + pseudo بلون السطح فوقها */
  background: rgba(201, 166, 107, .55);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
}
.svc__icon-wrap::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: var(--panel-surface);
  clip-path: inherit;
}

.svc__icon {
  position: relative;
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--gd-primary);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svc__title {
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
  color: var(--gd-primary-text);
  margin-bottom: 6px;
}
.svc__desc { font-size: .95rem; line-height: 1.85; }

.services__cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: clamp(40px, 5vw, 56px);
  text-align: center;
}
.services__cta-text {
  font-family: var(--gd-font-body);
  font-weight: 500;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  color: var(--gd-primary);
}

/* ---- عنوان السكشن + قنديل المشكاة على الشمال ----
   الكلام بس هو اللي في النص، والقنديل معلّق جنبه (absolute) فمبيزحزحش العنوان.
*/
.title-lamp {
  --lamp-w: 48px;
  --lamp-gap: 28px;
  display: flex;
  justify-content: center;
}
.title-lamp__text {
  position: relative;
  display: inline-block;
}
.title-lamp__line + .title-lamp__line::before { content: " "; }

.title-lamp__img {
  position: absolute;
  /* في RTL الـ inline-end = الشمال */
  inset-inline-end: calc(-1 * (var(--lamp-w) + var(--lamp-gap)));
  bottom: -.2em;
  width: var(--lamp-w);
  height: auto;
  transform-origin: 50% 0;
  animation: lampSway 7s ease-in-out infinite;
  pointer-events: none;
}

/* المشكاة على الويب: بعيدة عن العنوان، معلّقة من أول البانل في الركن الشمال */
.services__lamp {
  position: absolute;
  top: 0;
  inset-inline-end: 70px;
  width: 80px;
  height: auto;
  transform-origin: 50% 0;
  animation: lampSway 7s ease-in-out infinite;
  pointer-events: none;
}
@media (min-width: 768px) {
  .title-lamp__img { display: none; }     /* نسخة العنوان للموبايل بس */
}

/* هزّة خفيفة كأنه متعلّق */
@keyframes lampSway {
  0%, 100% { transform: rotate(1.4deg); }
  50%      { transform: rotate(-1.4deg); }
}

/* Tablet (768–960): عمودين، 3 أعمدة بتبقى ضيقة قوي على الحشوات */
@media (max-width: 960px) {
  .svc-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile: ليستة مفتوحة من غير gd-panel — row لكل خدمة، الأيقونة على اليمين والوصف تحت العنوان */
@media (max-width: 767px) {
  .services__lamp { display: none; }
  .svc.gd-panel { padding: 20px 0; background: none; clip-path: none; }
  .svc.gd-panel::before,
  .svc.gd-panel::after { display: none; }

  .svc-grid { grid-template-columns: 1fr; gap: 0; }

  /* الموبايل: العنوان على سطرين عشان يفضل في النص والقنديل جنبه */
  .title-lamp__line { display: block; }
  .title-lamp__line + .title-lamp__line::before { content: none; }
  /* أكبر عشان يتناسب مع العنوان اللي على سطرين، وأبعد شوية لشمال.
     min() عشان على الشاشات الضيقة (360px) القنديل ميطلعش برّه الشاشة */
  .title-lamp { --lamp-w: min(44px, 11vw); --lamp-gap: min(30px, 6vw); }

  /* على الموبايل مفيش كروت تغطي الحجر، فالخطوط بتعدّي ورا الكلام — نهدّيها */
  .services__panel::before { opacity: .12; }

  .svc {
    --svc-icon: 40px;
    --svc-gap: 14px;
    flex-direction: row;
    align-items: flex-start;
    gap: var(--svc-gap);
    padding: 20px 0; /* المسافة لوحدها هي الفاصل */
  }

  .svc__icon-wrap { width: var(--svc-icon); height: var(--svc-icon); }
  .svc__icon-wrap::before { background: var(--gd-bg); }
  .svc__icon { width: 20px; height: 20px; }

  .svc__title { font-size: 1.05rem; margin-bottom: 2px; }
  .svc__desc { font-size: .88rem; line-height: 1.75; }

  .services__cta .gd-btn { width: 100%; max-width: 300px; }
}

/* ---------- 9. Work (Section 3: من أعمالنا) — section غامق ----------
   المبدأ: الكيان الأم هادي، والبراندات اللي تحته هي اللي ملونة.
   اللون بيظهر بس في قوس كل كارد عن طريق --brand (css/components/gd-work-card.css).
*/
.work {
  --btn-bg: var(--gd-sand);
  --btn-fg: var(--gd-primary-deep);
  --btn-surface: var(--gd-primary-deep);

  background: var(--gd-primary-deep);
  color: var(--gd-bg);
  overflow: hidden;
  isolation: isolate;
}
.work__pattern {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("../assets/patterns/gd-pattern-rosette.svg");
  background-size: 128px 64px;
  background-position: center top;
  opacity: .1;
}
.section-head--light .section-head__title { color: var(--gd-bg); }
.section-head--light .section-head__kicker { color: var(--gd-sand); }
.section-head--light .section-head__sub { color: rgba(239, 232, 220, .78); }
.section-head--light .gd-divider__dot { fill: var(--gd-bg); }

/* الكروت نفسها من css/components/gd-work-card.css — هنا ألوان الـ body بس من السكشن */
.work {
  --card-surface: var(--gd-bg-soft);
  --card-ink: var(--gd-primary-text);
  --card-muted: var(--gd-primary);
  --card-accent: var(--gd-sand-text);
  --card-sand: var(--gd-sand);
}
.work .gd-work-card__title { font-family: var(--gd-font-body); }
/* dir=ltr عشان أسماء المنصات، فبنحاذيها يمين مع الكلام العربي */
html[dir="rtl"] .work .gd-work-card__platforms { justify-content: flex-end; }

.work__cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: clamp(40px, 5vw, 56px);
  text-align: center;
}
.work__cta-text {
  font-family: var(--gd-font-body);
  font-weight: 500;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  color: var(--gd-bg);
}

@media (max-width: 560px) {
  .work__cta .gd-btn { width: 100%; max-width: 300px; }
}

/* ---------- 10. About (Section 4: من نحن) ---------- */
.about {
  isolation: isolate;
  overflow: hidden;
}


/* ---- «القاعة»: قمرية + فسقية ----
   الموبايل والتابلت: في تسلسل المحتوى (قمرية ← الكلام ← اللوحة ← فسقية).
   الويب (≥1200px): absolute على الجناب — قمرية في الحيطة فوق شمال، فسقية على الأرض تحت يمين.
   الخلفية سادة في الحالتين، الرسمتين هما الزخرفة. */
.about { background: #EFE8DC; }
.about::before { display: none; }

.about__qamariya,
.about__fasqiya {
  display: block;
  height: auto;
  margin-inline: auto;
  pointer-events: none;
}
.about__qamariya { width: 100px; margin-bottom: 28px; }
.about__fasqiya  { width: 220px; margin-top: 36px; }

@media (min-width: 1200px) {
  .about__qamariya,
  .about__fasqiya { position: absolute; margin: 0; }

  .about__qamariya {
    top: 64px;
    left: max(32px, calc(50% - 600px));      /* فوق شمال */
    width: clamp(170px, 15vw, 216px);
  }
  .about__fasqiya {
    bottom: 56px;
    right: max(32px, calc(50% - 620px));     /* تحت يمين */
    width: clamp(240px, 21vw, 312px);
  }
  .about__inner { max-width: 640px; }        /* عمود الكلام ميدخلش على الرسمتين */
}

/* دخول الرسمتين (scroll reveal): القمرية بتنزل لمكانها في الحيطة كأن النور بيظهر فيها،
   والفسقية بتطلع من الأرض. بيستخدموا نفس .reveal بتاع الموقع بس بحركة خاصة بيهم. */
.about__qamariya.reveal,
.about__fasqiya.reveal {
  transition:
    opacity 1.4s var(--ease-out),
    transform 1.6s var(--ease-out),
    filter 1.6s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 150ms);
}
.about__qamariya.reveal:not(.is-visible) {
  transform: translateY(-28px) scale(.97);
  filter: brightness(1.15) blur(2px);
}
.about__fasqiya.reveal:not(.is-visible) {
  transform: translateY(36px);
  filter: blur(2px);
}

.about__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.about__inner > p {
  max-width: 60ch;
  margin-bottom: 1.1em;
}

/* النقش */
.about__inscription {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: clamp(20px, 3vw, 32px) 0 clamp(24px, 3.4vw, 36px);
}
.about__star { width: 14px; height: 14px; }
.about__inscription blockquote {
  max-width: 300px;
  margin: 0;
  font-family: var(--gd-font-heading);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.55;
  color: #5E8C7F;
  text-align: center;
  text-wrap: balance;
}

/* لوحة التأسيس */
.about__plaque {
  width: min(320px, 100%);
  aspect-ratio: 320 / 104;
  margin-top: clamp(16px, 2.4vw, 28px);
  padding-inline: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  background: url("../assets/ornaments/gd-plaque-frame.svg") center / 100% 100% no-repeat;
}
.about__plaque-year {
  font-family: var(--gd-font-heading);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.3;
  color: #3A5E54;
}
.about__plaque-note {
  font-family: var(--gd-font-body);
  font-weight: 500;
  font-size: 13px;
  line-height: 1.5;
  color: #8C6A2E;
}

/* ---------- 11. Contact — "الباب" ----------
   السكشن كله باب واحد كبير: رأس القوس SVG بيتمط مع العرض، والجنبين border-inline.
*/
.contact {
  --btn-bg: var(--gd-primary);
  --btn-fg: var(--gd-bg);
  --btn-surface: #F4EFE6;
  isolation: isolate;
  overflow: hidden;
}
/* نفس وردة «من نحن»: عالية فوق وبتقل بالتدريج لحد ما تختفي تحت */
.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("../assets/patterns/gd-pattern-rosette.svg") center top / 128px 64px repeat;
  opacity: .2;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
          mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
}

.door { position: relative; max-width: 560px; margin-inline: auto; }

.door__arch {
  position: relative;
  height: 170px;
  background: url("../assets/ornaments/gd-door-arch.svg") center / 100% 100% no-repeat;
}
.door__arch::after {            /* النجمة في رأس القوس */
  content: "";
  position: absolute;
  left: 50%;
  top: 47px;
  translate: -50% 0;
  width: 30px;
  height: 30px;
  background: url("../assets/ornaments/gd-door-star.svg") center / contain no-repeat;
}

.door__body {
  position: relative;
  display: flow-root;           /* ⚠️ بيمنع margin collapse، وإلا الـ body هيطلع فوق القوس */
  margin-top: -1px;
  padding: 0 30px 64px;
  background: #F4EFE6;
  border-inline: 1.2px solid #C9A66B;
}
.door__body::before {           /* الإطار الداخلي — كمّلة خط القوس الداخلي */
  content: "";
  position: absolute;
  inset: 0 10px;
  border-inline: 1px solid rgba(201, 166, 107, .8);
  pointer-events: none;
}
.door__body::after {            /* الإفريز */
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 17px;
  background: url("../assets/patterns/gd-frieze-tabaq.svg") center bottom / 22px 17px repeat-x;
  opacity: .6;
}

.door__content {                /* الكلام يبدأ جوه القوس */
  position: relative;
  margin-top: -58px;
  text-align: center;
}
.door__content .section-head__kicker { display: block; margin-bottom: 4px; }
.door__content .gd-divider { margin: 14px auto 0; }
.contact__lead { margin: 18px auto 24px; max-width: 40ch; }
.contact__whatsapp { margin-bottom: 36px; }
.contact__wa-icon { width: 20px; height: 20px; fill: currentColor; flex: none; }

/* بيانات التواصل */
.contact-list {
  display: grid;
  gap: 26px;
  text-align: start;
}
.contact-list li {
  display: flex;
  align-items: center;
  gap: 16px;
}
/* مثمن رملي outline: الخلفية الرملي = الخط، والـ pseudo بلون السطح فوقها */
.contact-list__icon {
  --_oct: polygon(29.29% 0, 70.71% 0, 100% 29.29%, 100% 70.71%, 70.71% 100%, 29.29% 100%, 0 70.71%, 0 29.29%);
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  background: #C9A66B;
  clip-path: var(--_oct);
}
.contact-list__icon::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: #F4EFE6;
  clip-path: var(--_oct);
}
.contact-list__icon svg {
  position: relative;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--gd-primary);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.contact-list__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;   /* القيم الـ ltr تفضل متحاذية يمين مع الـ label */
  min-width: 0;
}
.contact-list__label {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: #8C6A2E;
}
.contact-list__value {
  font-size: 17px;
  line-height: 1.6;
  color: var(--gd-primary-text);
  overflow-wrap: anywhere;
  transition: color .3s var(--ease);
}
.contact-list__value:hover { color: var(--gd-water-text); }

@media (max-width: 560px) {
  .door__body { padding-inline: 22px; }
  .contact-list__value { font-size: 16px; }
}

/* ---------- 12. Footer — "سور المبنى" ----------
   شرافات مملوكية فوق، وإفريز نجوم فاتح في آخر الصفحة. من غير باترن في الخلفية.
*/
.footer {
  --ft-bg: #3A5E54;
  --ft-ink: rgba(239, 232, 220, .82);
  --cren-w: 26px;
  --cren-h: 18px;
  position: relative;
  background: var(--ft-bg);
  /* خط رفيع فاتح عند قاعدة الشرافات */
  box-shadow: inset 0 1px 0 rgba(201, 166, 107, .45);
  color: var(--ft-ink);
  padding-bottom: 64px;          /* مساحة للإفريز */
  font-size: .95rem;
}
/* الشرافات طالعة لفوق في السكشن اللي قبله */
.footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: var(--cren-h);
  background: url("../assets/ornaments/gd-crenellation.svg") center bottom / var(--cren-w) var(--cren-h) repeat-x;
}
/* الإفريز في آخر الصفحة */
.footer::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 17px;
  background: url("../assets/patterns/gd-frieze-tabaq-light.svg") center bottom / 22px 17px repeat-x;
  opacity: .45;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  grid-template-areas: "brand links products contact";
  gap: 40px clamp(24px, 4vw, 56px);
  padding-block: clamp(48px, 6vw, 72px) clamp(36px, 4vw, 48px);
}
.footer__brand    { grid-area: brand; }
.footer__links    { grid-area: links; }
.footer__products { grid-area: products; }
.footer__contact  { grid-area: contact; }

.footer__logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.footer__logo img { width: 36px; height: auto; }
.footer__logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.footer__logo-ar {
  font-family: var(--gd-font-heading);
  font-size: 1.6rem;
  color: var(--gd-bg);
}
.footer__logo-en {
  margin-top: 4px;
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .32em;
  color: var(--gd-sand);
}
.footer__tagline {
  margin-top: 18px;
  max-width: 18ch;
  font-family: var(--gd-font-heading);
  font-weight: 500;
  font-size: 1.375rem;
  line-height: 1.5;
  color: #C9A66B;
}

.footer__title {
  margin-bottom: 6px;
  font-family: var(--gd-font-body);
  font-size: .95rem;
  font-weight: 500;
  color: var(--gd-sand);
}
.footer__list { display: grid; }
.footer__list a,
.footer__item {
  display: inline-block;
  padding: 8px 0;               /* مساحة ضغط مريحة على الموبايل */
}
.footer__list a,
.footer__item,
.footer__email {
  color: var(--ft-ink);
  text-decoration: none;
  text-underline-offset: 4px;
  transition: color .3s var(--ease);
}
.footer__list a:hover,
.footer__email:hover {
  color: var(--gd-bg);
  text-decoration: underline;
  text-decoration-color: var(--gd-sand);
}

.footer__email { display: block; width: fit-content; margin: 8px 0 4px; overflow-wrap: anywhere; }
.footer__phone { margin: 0 0 16px; }
.footer__icons { display: flex; gap: 10px; }
.footer__social { margin-top: 10px; }
.footer__social[hidden] { display: none; }

/* أيقونات مثمنة (واتساب + السوشيال) — إطار رملي مزدوج */
.footer-oct {
  --oct: polygon(29.29% 0, 70.71% 0, 100% 29.29%, 100% 70.71%, 70.71% 100%, 29.29% 100%, 0 70.71%, 0 29.29%);
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #C9A66B;
  background: #C9A66B;            /* الإطار الخارجي */
  clip-path: var(--oct);
}
.footer-oct::before {             /* تفريغ */
  content: "";
  position: absolute;
  inset: 1.2px;
  background: var(--ft-bg);
  clip-path: var(--oct);
  transition: background-color .3s var(--ease);
}
/* الإطار الداخلي SVG بدل border + clip-path، عشان الزوايا المشطوفة متتقصّش.
   النقط = نفس المثمن الخارجي مصغّر بـ inset 5px (5 + 29.29% × 42) فالأضلاع موازية بالظبط */
.footer-oct__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: rgba(201, 166, 107, .5);
  stroke-width: .8;
  pointer-events: none;
}
.footer-oct svg:not(.footer-oct__ring) {
  position: relative;
  z-index: 1;
  width: 22px;
  height: 22px;
  fill: currentColor;
}
@media (hover: hover) {
  .footer-oct:hover::before { background: #31514A; }
}

/* الشريط السفلي — من غير خط فاصل */
.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: .8rem;
  color: rgba(239, 232, 220, .55);
}

@media (max-width: 760px) {
  .footer { --cren-w: 19.5px; --cren-h: 13.5px; } /* شرافات أصغر على الموبايل (75%) */
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "brand    brand"
      "links    products"
      "contact  contact";
    gap: 32px 24px;
  }
  .footer__bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* =========================================================
   13. Scroll Reveal
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity .9s var(--ease-out),
    transform .9s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 120ms);
  will-change: opacity, transform;
}
.reveal[data-delay="1"] { --d: 1; }
.reveal[data-delay="2"] { --d: 2; }
.reveal[data-delay="3"] { --d: 3; }
.reveal[data-delay="4"] { --d: 4; }

.reveal.is-visible { opacity: 1; transform: none; }

/* الفاصل بيرسم نفسه لما الهيدر يظهر: القوس، بعدين الخطين لبرّه، بعدين النقطة */
.gd-divider__arch { transition: stroke-dashoffset .9s var(--ease) .2s; }
.gd-divider__line { transition: transform 1s var(--ease-out) .55s; }
.gd-divider__dot  { transition: opacity .5s var(--ease) .95s; }
.reveal:not(.is-visible) .gd-divider__arch { stroke-dashoffset: 1; }
.reveal:not(.is-visible) .gd-divider__line { transform: scaleX(0); }
.reveal:not(.is-visible) .gd-divider__dot  { opacity: 0; }

/* لو الـ JS مش شغال، متخبّيش المحتوى */
.no-js .reveal { opacity: 1; transform: none; }

/* =========================================================
   14. Keyframes
   ========================================================= */
@keyframes patternIn { from { opacity: 0; } to { opacity: var(--pattern-opacity); } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp   { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes draw     { to { stroke-dashoffset: 0; } }
@keyframes grow     { to { transform: scaleX(1); } }
@keyframes sill     { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes doorRise { from { opacity: 0; transform: scaleY(.6) translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes starSpin { from { transform: rotate(-135deg) scale(.3); } to { transform: none; } }
@keyframes revealRTL { to { clip-path: inset(-10% 0 -10% 0); } }
@keyframes revealLTR { to { clip-path: inset(-10% 0 -10% 0); } }
@keyframes tracking {
  from { opacity: 0; letter-spacing: .9em; padding-inline-start: .9em; }
  to   { opacity: 1; letter-spacing: .42em; padding-inline-start: .42em; }
}
@keyframes scrollDot {
  0%   { opacity: 0; transform: translateY(0); }
  30%  { opacity: 1; }
  70%  { opacity: 0; transform: translateY(12px); }
  100% { opacity: 0; }
}

/* =========================================================
   15. Responsive
   ========================================================= */
@media (max-width: 760px) {
  /* موبايل menu */
  .nav__burger { display: block; }
  .nav__links {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--gd-bg);
    border-bottom: 1px solid var(--gd-surface);
    box-shadow: 0 20px 40px -30px rgba(58, 94, 84, .5);
    clip-path: inset(0 0 100% 0);
    visibility: hidden;
    transition: clip-path .5s var(--ease-out), visibility 0s linear .5s;
  }
  .nav__links.is-open {
    clip-path: inset(0 0 0 0);
    visibility: visible;
    transition: clip-path .5s var(--ease-out), visibility 0s;
  }
  .nav__links li { border-bottom: 1px solid var(--gd-surface); }
  .nav__links li:last-child { border-bottom: 0; }
  .nav__links a { display: block; padding-block: 14px; font-size: 1.05rem; }
  .nav__links a::after { display: none; }

  /* لما المينيو مفتوح الهيدر ياخد خلفية */
  .site-header.menu-open { background: var(--gd-bg); }
  .site-header.menu-open .nav__brand { opacity: 1; transform: none; }

}

@media (max-width: 560px) {

  .hero__cta { flex-direction: column; width: 100%; max-width: 300px; }
  .hero__cta .gd-btn { width: 100%; }

}

/* احترام إعداد تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
