/* ===== UFQ brand tokens (from the 2026 brand guideline) ===== */
:root {
  --terra-900: #955e48;
  --terra: #b2785b;
  --terra-300: #bf907b;
  --terra-200: #c9a697;
  --terra-100: #e2c7c0;
  --gold-700: #d3a978;
  --gold: #f2c888;
  --gold-300: #f7ddc1;
  --gold-200: #f9e5d2;
  --cream: #f7eee7;
  --paper: #fdf7f5;
  --orange: #e07d51;
  --lime: #cfee84;
  --lime-700: #b8d363;
  --ink: #3a2318;

  --radius: 18px;
  --gutter: clamp(16px, 4vw, 56px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Almarai', 'Tahoma', sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: 700 1rem 'Almarai', sans-serif;
  padding: .85em 2em; border-radius: 999px; border: 0; cursor: pointer;
  transition: transform .3s var(--ease-out), box-shadow .3s, background .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn-gold { background: var(--gold); color: var(--terra-900); box-shadow: 0 8px 24px -10px rgba(149, 94, 72, .6); }
.btn-gold:hover { background: var(--gold-300); }
.btn-line { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.7); padding: .7em 1.6em; }
.btn-line:hover { background: #fff; color: var(--terra-900); }

/* ===== Header ===== */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter);
  color: var(--gold);
  transition: background .4s, color .4s, box-shadow .4s, padding .4s;
}
.topbar.scrolled {
  background: rgba(253, 247, 245, .92);
  backdrop-filter: blur(10px);
  color: var(--terra);
  box-shadow: 0 1px 0 var(--terra-100);
  padding-block: 10px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 46px; height: 30px; fill: currentColor; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.15rem; font-weight: 800; }
.brand-text small { font-size: .62rem; letter-spacing: .12em; font-weight: 700; direction: ltr; text-align: right; }
.nav { display: flex; align-items: center; gap: clamp(12px, 2.5vw, 32px); font-weight: 700; font-size: .95rem; }
.nav a { position: relative; padding-block: 4px; }
.nav a:not(.nav-cta)::after {
  content: ''; position: absolute; inset: auto 0 -2px 0; height: 2px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease-out);
}
.nav a:not(.nav-cta):hover::after { transform: scaleX(1); }
.nav-cta { border: 1.5px solid currentColor; border-radius: 999px; padding: .45em 1.2em !important; }

/* ===== Hero ===== */
.hero {
  position: relative; min-height: 100svh; overflow: hidden;
  display: grid; place-items: center; text-align: center;
  background: var(--terra); color: var(--gold);
  padding: 120px var(--gutter) 80px;
}
.hero-pattern, .contact-pattern {
  position: absolute; inset: 0; width: 100%; height: 100%;
  color: var(--gold); opacity: .22;
}
.hero-pattern { animation: drift 40s linear infinite; height: calc(100% + 150px); }
@keyframes drift { to { transform: translateY(-150px); } }
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(178,120,91,.0) 0%, rgba(178,120,91,.85) 70%);
}
.hero-inner { position: relative; z-index: 2; max-width: 760px; }
.hero-mark { width: 120px; height: 78px; fill: var(--gold); margin: 0 auto 20px; display: block; }
.hero-mark { animation: rise 1.2s var(--ease-out) both; }
.eyebrow { letter-spacing: .3em; font-size: .8rem; font-weight: 700; opacity: .85; animation: rise 1.2s .15s var(--ease-out) both; }
.hero h1 {
  font-size: clamp(2.4rem, 7vw, 5.2rem); font-weight: 800; line-height: 1.2; margin: 14px 0 18px;
  animation: rise 1.2s .3s var(--ease-out) both;
}
.hero-sub { font-size: clamp(1rem, 2.2vw, 1.3rem); color: var(--gold-200); margin-bottom: 34px; animation: rise 1.2s .45s var(--ease-out) both; }
.hero .btn { animation: rise 1.2s .6s var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } }
.scroll-cue {
  position: absolute; bottom: 28px; left: 50%; translate: -50% 0; z-index: 2;
  width: 26px; height: 42px; border: 2px solid var(--gold); border-radius: 14px;
}
.scroll-cue span {
  position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px;
  background: var(--gold); border-radius: 2px; animation: cue 1.8s infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ===== Section heads ===== */
.projects { padding: clamp(70px, 10vw, 130px) 0 60px; overflow-x: clip; }
html, body { overflow-x: clip; }
.section-head { text-align: center; padding-inline: var(--gutter); margin-bottom: 26px; }
.head-star { width: 34px; height: 34px; fill: var(--orange); margin: 0 auto 10px; display: block; animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.section-head h2 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; color: var(--terra); line-height: 1.2; }
.section-head p { color: var(--terra-300); font-weight: 700; margin-top: 6px; }

.filters { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; padding-inline: var(--gutter); margin-bottom: clamp(40px, 6vw, 70px); }
.chip {
  font: 700 .92rem 'Almarai', sans-serif; cursor: pointer;
  padding: .55em 1.4em; border-radius: 999px;
  background: transparent; color: var(--terra); border: 1.5px solid var(--terra-100);
  transition: background .3s, color .3s, border-color .3s;
}
.chip:hover { border-color: var(--terra); }
.chip[aria-selected="true"] { background: var(--terra); color: var(--gold); border-color: var(--terra); }

/* ===== Project stream: alternating right / left, details on the photo ===== */
.stream { display: flex; flex-direction: column; gap: clamp(22px, 3.5vw, 44px); }
.project { position: relative; width: min(1040px, 88vw); height: clamp(300px, 31vw, 390px); }
.p-frame { position: relative; height: 100%; overflow: hidden; isolation: isolate; background: var(--terra); }
/* RTL: the right side is the start */
.project.side-right { margin-inline-start: 0; margin-inline-end: auto; }
.project.side-left  { margin-inline-start: auto; margin-inline-end: 0; }
.side-right .p-frame { border-radius: 0 0 0 var(--radius); }
.side-left .p-frame { border-radius: 0 0 var(--radius) 0; }

.p-media { position: absolute; inset: 0; z-index: 0; display: block; }
.p-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); transition: transform 1.6s var(--ease-out); }
.project:hover .p-media img { transform: scale(1.04); }

/* Brown wash that melts from the text side into the photo */
.p-shade { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.side-right .p-shade {
  background:
    linear-gradient(to left, rgba(149,94,72,.97) 0%, rgba(178,120,91,.9) 30%, rgba(178,120,91,.5) 52%, rgba(178,120,91,0) 72%),
    linear-gradient(to top, rgba(149,94,72,.35), transparent 40%);
}
.side-left .p-shade {
  background:
    linear-gradient(to right, rgba(149,94,72,.97) 0%, rgba(178,120,91,.9) 30%, rgba(178,120,91,.5) 52%, rgba(178,120,91,0) 72%),
    linear-gradient(to top, rgba(149,94,72,.35), transparent 40%);
}

.p-type-tag, .p-num { position: absolute; z-index: 3; }
.p-type-tag {
  top: 16px; background: rgba(253,247,245,.92); color: var(--terra);
  font-size: .78rem; font-weight: 800; padding: .3em .95em; border-radius: 999px;
}
.p-num { bottom: 14px; font-size: .8rem; font-weight: 800; color: #fff; letter-spacing: .12em; opacity: .85; }
.side-right .p-type-tag, .side-right .p-num { left: 18px; }
.side-left .p-type-tag, .side-left .p-num { right: 18px; }

.p-body {
  position: absolute; z-index: 2; top: 0; bottom: 0; width: min(50%, 470px);
  display: flex; flex-direction: column; justify-content: center;
  padding: 26px clamp(22px, 3.5vw, 46px); color: #fff;
  pointer-events: none;   /* clicks fall through to the photo link… */
}
.p-body a { pointer-events: auto; }   /* …except the buttons and name */
.side-right .p-body { right: 0; padding-right: max(var(--gutter), 26px); }
.side-left .p-body { left: 0; }
.p-district { color: var(--gold-300); font-weight: 700; font-size: .9rem; }
.p-name { display: flex; align-items: center; gap: 12px; font-size: clamp(1.9rem, 3.8vw, 3rem); font-weight: 800; color: #fff8ef; line-height: 1.1; margin: 2px 0 8px; }
.p-name a:hover { color: var(--gold); }
.p-chev { flex: none; width: 18px; height: 36px; fill: var(--orange); }
.p-line { color: #fbeee4; margin-bottom: 14px; font-size: .95rem; line-height: 1.6; }
.p-facts { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-bottom: 18px; }
.fact { display: flex; align-items: center; gap: 10px; }
.fact-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--lime); background: transparent; }
.fact small { display: block; font-size: .72rem; color: var(--gold-300); font-weight: 700; line-height: 1.2; }
.fact b { font-size: 1rem; color: #fff; font-weight: 800; }
.fact b span { font-weight: 400; font-size: .8rem; color: var(--gold-200); }
.p-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.p-actions .btn { padding: .65em 1.4em; font-size: .9rem; }
.btn-terra { background: var(--terra); color: var(--gold); }
.btn-terra:hover { background: var(--terra-900); }
.btn-outline { background: transparent; color: var(--terra); border: 1.5px solid var(--terra-200); }
.btn-outline:hover { border-color: var(--terra); }
.btn-ghost { background: transparent; color: #fff8ef; border: 1.5px solid rgba(255,248,239,.65); }
.btn-ghost:hover { background: #fff8ef; color: var(--terra-900); }

/* Entry animation: each card wipes in from its own side, then the details follow */
.p-frame { transition: clip-path 1.3s var(--ease-out), transform 1.3s var(--ease-out), opacity .8s; opacity: 0; }
.side-right .p-frame { clip-path: inset(0 0 0 100%); transform: translateX(110px); }
.side-left  .p-frame { clip-path: inset(0 100% 0 0); transform: translateX(-110px); }
.project.in .p-frame { clip-path: inset(0 0 0 0); transform: none; opacity: 1; }
.project.in .p-media img { transform: scale(1); }
.project.in:hover .p-media img { transform: scale(1.04); }
.project .p-body > * { opacity: 0; transition: opacity .9s var(--ease-out), transform 1.1s var(--ease-out); }
.project.side-right .p-body > * { transform: translateX(50px); }
.project.side-left  .p-body > * { transform: translateX(-50px); }
.project.in .p-body > * { opacity: 1; transform: none; }
.project.in .p-body > *:nth-child(1) { transition-delay: .45s; }
.project.in .p-body > *:nth-child(2) { transition-delay: .55s; }
.project.in .p-body > *:nth-child(3) { transition-delay: .65s; }
.project.in .p-body > *:nth-child(4) { transition-delay: .75s; }
.project.in .p-body > *:nth-child(5) { transition-delay: .85s; }

/* ===== About ===== */
.about { padding: clamp(60px, 9vw, 120px) var(--gutter); background: var(--gold-200); }
.about-inner { max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr; gap: clamp(24px, 5vw, 70px); align-items: center; }
.about-elements { display: flex; gap: 14px; align-items: center; }
.about-elements svg { width: 54px; height: 54px; fill: var(--terra); }
.about-elements svg:nth-child(3) { fill: var(--orange); }
.about-elements .diamond { width: 30px; height: 56px; }
.about h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); color: var(--terra); font-weight: 800; line-height: 1.3; margin-bottom: 12px; }
.about p { font-size: 1.08rem; color: #6b4a3a; }

/* ===== Contact ===== */
.contact { position: relative; z-index: 1; background: var(--terra); color: var(--gold); padding: clamp(70px, 10vw, 120px) var(--gutter); text-align: center; }
.contact-pattern { opacity: .14; }
.contact-inner { position: relative; max-width: 620px; margin: 0 auto; }
.contact h2 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; }
.contact p { color: var(--gold-200); margin-bottom: 28px; }
.lead-form { display: grid; gap: 12px; }
.lead-form input, .lead-form select {
  font: 400 1rem 'Almarai', sans-serif; color: var(--ink);
  background: var(--paper); border: 0; border-radius: 12px; padding: 1em 1.1em; width: 100%;
}
.lead-form input:focus, .lead-form select:focus { outline: 3px solid var(--gold); }
.form-note { min-height: 1.5em; font-weight: 700; margin: 0 !important; }
.lead-form input.invalid { outline: 3px solid var(--orange); }

/* ===== Brand dropdown ===== */
.dd { position: relative; text-align: right; }
.dd-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font: 700 1rem 'Almarai', sans-serif; color: var(--ink); cursor: pointer;
  background: var(--paper); border: 0; border-radius: 12px; padding: 1em 1.1em;
  transition: box-shadow .3s;
}
.dd-trigger:focus-visible, .dd.open .dd-trigger { outline: 3px solid var(--gold); }
.dd.invalid .dd-trigger { outline: 3px solid var(--orange); }
.dd-placeholder { color: #8a6f62; font-weight: 400; }
.dd-arrow { flex: none; width: 10px; height: 20px; fill: var(--orange); transform: rotate(-90deg); transition: transform .35s var(--ease-out); }
.dd.open .dd-arrow { transform: rotate(90deg); }
.dd-panel {
  position: absolute; z-index: 20; inset: calc(100% + 8px) 0 auto 0;
  list-style: none; max-height: 320px; overflow-y: auto; padding: 8px;
  background: var(--paper); border-radius: 16px;
  box-shadow: 0 24px 50px -20px rgba(58,35,24,.55), 0 0 0 1px var(--gold-300);
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.98); transform-origin: top;
  transition: opacity .25s, transform .3s var(--ease-out), visibility .25s;
  scrollbar-width: thin; scrollbar-color: var(--terra-200) transparent;
}
.dd-panel:focus { outline: none; }
.dd.open .dd-panel { opacity: 1; visibility: visible; transform: none; }
.dd.up .dd-panel { inset: auto 0 calc(100% + 8px) 0; transform-origin: bottom; transform: translateY(8px) scale(.98); }
.dd.up.open .dd-panel { transform: none; }.dd-option {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; cursor: pointer;
  color: var(--ink); transition: background .2s;
}
.dd-option img, .dd-noimg { flex: none; width: 52px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--terra-100); }
.dd-text { flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.dd-text b { font-weight: 800; font-size: .98rem; }
.dd-text small { color: var(--terra-300); font-size: .8rem; font-weight: 700; }
.dd-check { flex: none; width: 16px; height: 16px; fill: var(--gold); opacity: 0; transform: scale(.4) rotate(-45deg); transition: opacity .25s, transform .35s var(--ease-out); }
.dd-option.active { background: var(--gold-200); }
.dd-option[aria-selected="true"] { background: var(--terra); color: var(--gold); }
.dd-option[aria-selected="true"] .dd-text small { color: var(--gold-300); }
.dd-option[aria-selected="true"] .dd-check { opacity: 1; transform: none; }

/* ===== Achievements strip ===== */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  width: min(1120px, 100% - 2 * var(--gutter)); margin: 0 auto clamp(40px, 6vw, 70px);
  background: var(--terra); color: var(--gold); border-radius: var(--radius); overflow: hidden;
}
.stat { position: relative; padding: 26px 18px; text-align: center; }
.stat + .stat::before { content: ''; position: absolute; top: 22%; bottom: 22%; right: 0; width: 1px; background: rgba(242,200,136,.35); }
.stat b { display: block; font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; line-height: 1.1; }
.stat span { font-size: .92rem; color: var(--gold-200); font-weight: 700; }

/* ===== Sold-out projects: shown proudly ===== */
.p-stamp {
  position: absolute; z-index: 3; top: 50%; translate: -50% -50%;
  width: clamp(104px, 12vw, 138px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  background: rgba(149,94,72,.9); color: var(--gold);
  border: 2px solid var(--gold); box-shadow: 0 0 0 6px rgba(149,94,72,.35);
  rotate: -12deg; scale: 1.6; opacity: 0;
  transition: scale .7s .9s cubic-bezier(.3,1.6,.5,1), opacity .4s .9s;
}
.side-right .p-stamp { left: 25%; }   /* on the photo side, away from the text */
.side-left .p-stamp { left: 75%; }
.project.in .p-stamp { scale: 1; opacity: 1; }
.p-stamp svg { width: 22px; height: 22px; fill: var(--gold); margin: 0 auto 4px; display: block; }
.p-stamp b { display: block; font-size: clamp(.95rem, 1.6vw, 1.15rem); font-weight: 800; line-height: 1.25; }
.p-stamp small { display: block; font-size: .72rem; color: var(--gold-200); font-weight: 700; margin-top: 2px; }
.project.is-sold .p-media img { filter: saturate(.85); }
.fact-sold .fact-dot { border-color: var(--gold); background: var(--gold); }

@media (max-width: 820px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3)::before { display: none; }
  .stat:nth-child(n+3) { border-top: 1px solid rgba(242,200,136,.25); }
}

/* ===== Partners ===== */
.partners { background: var(--cream); padding: clamp(56px, 8vw, 96px) 0; overflow: hidden; }
.partners-head { text-align: center; padding-inline: var(--gutter); margin-bottom: clamp(28px, 4vw, 44px); }
.partners-head h2 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); font-weight: 800; color: var(--terra); line-height: 1.2; }
.partners-head p { color: var(--terra-300); font-weight: 700; margin-top: 6px; }
.marquee {
  position: relative; direction: ltr;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
  list-style: none; display: flex; gap: 18px; width: max-content;
  animation: marquee calc(var(--count) * 4s) linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(calc(-50% - 9px)); } }
.partner {
  flex: none; width: clamp(170px, 20vw, 230px); height: 110px; direction: rtl;
  display: grid; place-items: center; padding: 18px 22px;
  background: #fff; border: 1px solid var(--gold-300); border-radius: 18px;
  transition: transform .35s var(--ease-out), box-shadow .35s, border-color .35s;
}
.partner:hover { transform: translateY(-4px); border-color: var(--terra-200); box-shadow: 0 16px 30px -20px rgba(149,94,72,.7); }
.partner img { max-width: 100%; max-height: 64px; object-fit: contain; filter: grayscale(1) sepia(.35) opacity(.75); transition: filter .4s; }
.partner:hover img { filter: none; }
.partner-name { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-weight: 800; color: var(--terra); line-height: 1.35; font-size: .98rem; }
.partner-empty { background: transparent; border-style: dashed; border-color: var(--terra-200); }
.partner-empty .partner-name { color: var(--terra-200); font-weight: 700; font-size: .85rem; }
.partner-empty svg { width: 40px; height: 26px; fill: var(--terra-100); }

/* ===== Footer ===== */
.footer {
  background: var(--terra-900); color: var(--gold-300);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  padding: 28px var(--gutter); font-size: .88rem;
}
.brand-footer { color: var(--gold); }

/* Generic reveal */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

/* ===== Mobile ===== */
@media (max-width: 820px) {
  .nav a:not(.nav-cta) { display: none; }
  /* Phones: details sit at the bottom of the photo, wash rises from below */
  .project, .project.side-left { width: 94vw; height: auto; }
  .side-right .p-shade, .side-left .p-shade {
    background: linear-gradient(to top, rgba(149,94,72,.97) 0%, rgba(178,120,91,.9) 38%, rgba(178,120,91,.45) 58%, rgba(178,120,91,0) 78%);
  }
  .p-body, .side-right .p-body, .side-left .p-body {
    position: relative; top: auto; bottom: auto; left: auto; right: auto; width: 100%;
    min-height: 460px; justify-content: flex-end; padding: 22px 20px 20px;
  }
  .side-right .p-stamp, .side-left .p-stamp { left: 50%; top: 30%; }
  .p-num { display: none; }
  .about-inner { grid-template-columns: 1fr; text-align: center; }
  .about-elements { justify-content: center; }
  .footer { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .p-frame, .project .p-body > *, .reveal { opacity: 1 !important; transform: none !important; clip-path: none !important; }
}

/* «أفق في أرقام» */
.numbers-title { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: clamp(1.3rem, 2.6vw, 1.7rem); font-weight: 800; color: var(--terra); margin-bottom: 14px; }
.numbers-title svg { width: 20px; height: 20px; fill: var(--orange); }
