/* ============================================================
   MEAD — Middle East Development
   Maroon #5F0304 · Ivory #F5EFE6 · Gold #B8925A · Charcoal #221A19
   Type: Noto Kufi Arabic (display) · Readex Pro (body) · Big Shoulders (EN)
   ============================================================ */

/* ---------- Fonts (self-hosted subsets) ---------- */
@font-face {
  font-family: 'Noto Kufi Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/notokufiarabic-700-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Noto Kufi Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/notokufiarabic-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
}
@font-face {
  font-family: 'Readex Pro';
  font-style: normal;
  font-weight: 160 700;
  font-display: swap;
  src: url('/fonts/readexpro-400-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Readex Pro';
  font-style: normal;
  font-weight: 160 700;
  font-display: swap;
  src: url('/fonts/readexpro-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
}
@font-face {
  font-family: 'Big Shoulders Display';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/bigshouldersdisplay-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
}

/* ---------- Tokens ---------- */
:root {
  --maroon: #5F0304;
  --maroon-deep: #4A0203;
  --ivory: #F5EFE6;
  --ivory-warm: #EFE7D9;
  --gold: #B8925A;
  --gold-soft: rgba(184, 146, 90, 0.45);
  --charcoal: #221A19;
  --muted: #6E5F58;

  --font-display: 'Noto Kufi Arabic', 'Segoe UI', Tahoma, sans-serif;
  --font-body: 'Readex Pro', 'Segoe UI', Tahoma, sans-serif;
  --font-latin: 'Big Shoulders Display', 'Readex Pro', sans-serif;

  --ease-lay: cubic-bezier(.6, .04, .35, 1);
  --ease-tap: cubic-bezier(.34, 1.12, .64, 1);

  --container: 1200px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.0625rem;               /* 17px — Arabic floor */
  line-height: 1.8;
  color: var(--charcoal);
  background: var(--ivory);
  text-align: start;
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}

[lang="ar"], body { letter-spacing: 0; }

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; }

h1 { font-size: clamp(2.25rem, 8vw, 4.25rem); line-height: 1.3; }
h2 { font-size: clamp(1.75rem, 6vw, 2.5rem); line-height: 1.35; padding-block: 0.15em; }
h3 { font-size: 1.3125rem; line-height: 1.5; font-family: var(--font-body); font-weight: 600; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }

.section { padding-block: clamp(4.5rem, 10vw, 7.5rem); }

/* ---------- Eyebrows (English, tracked — the only tracked text) ---------- */
.eyebrow {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-block-end: 0.75rem;
  /* LTR label above an RTL heading: align to the heading's edge, not the far side */
  text-align: end;
  margin-inline-end: -0.22em; /* optically absorb trailing tracking */
}
.eyebrow-dark { color: var(--maroon); }
.eyebrow-light { color: var(--gold); }

/* ---------- Course Line (signature) ---------- */
.course-line {
  display: flex;
  gap: 4px;
  direction: rtl;
  inline-size: min(220px, 40vw);
  margin-block: 1.1rem 0;
}
.course-line span {
  height: 3px;
  flex: 1;
  background: var(--gold);
  transform-origin: 100% 50%;
  transition: transform 0.28s var(--ease-lay);
}
html.js .in-view .course-line span, html.js .course-line.in-view span { transform: scaleX(1) !important; }
html.js .course-line.in-view span:nth-child(2) { transition-delay: 0.14s; }
html.js .course-line.in-view span:nth-child(3) { transition-delay: 0.28s; }
html.js .course-line.in-view span:nth-child(4) { transition-delay: 0.42s; }
html.js .course-line.in-view span:nth-child(5) { transition-delay: 0.56s; }

/* ---------- Reveals ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease-lay), transform 0.5s var(--ease-lay);
  transition-delay: calc(min(var(--i, 0), 4) * 90ms);
}
html.js .reveal.in-view { opacity: 1; transform: none; }

/* ---------- Buttons — torque-tight taps ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.0625rem;
  min-block-size: 52px;
  padding: 0.8rem 1.8rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.15s var(--ease-tap), background-color 0.2s var(--ease-lay);
}
.btn:active { transform: scale(0.96) rotate(-0.75deg); transition-duration: 0.09s; }

.btn-primary { background: var(--maroon); color: var(--ivory); }
.btn-primary:hover { background: var(--maroon-deep); }
.btn-primary .wa-glyph { color: var(--gold); }

/* on maroon surfaces the primary button inverts to ivory */
.hero .btn-primary { background: var(--ivory); color: var(--maroon); }
.hero .btn-primary:hover { background: #fff; }
.hero .btn-primary .wa-glyph { color: var(--maroon); }

.btn-outline {
  background: transparent;
  color: var(--maroon);
  border: 1.5px solid var(--maroon);
}
.btn-outline:hover { background: var(--maroon); color: var(--ivory); }

.btn-gold { background: var(--gold); color: var(--charcoal); }
.btn-gold:hover { filter: brightness(1.05); }

.btn-lg { font-size: 1.1875rem; padding: 1rem 2.4rem; }

:focus-visible { outline: 2px solid var(--maroon); outline-offset: 3px; }
.hero :focus-visible, .site-footer :focus-visible, .process :focus-visible { outline-color: var(--gold); }

/* ---------- Header ---------- */
.site-header {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.brand img { border-radius: 6px; background: var(--ivory); padding: 4px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.6875rem, 1.6vw, 0.8125rem);
  letter-spacing: 0;
  line-height: 1.3;
  color: var(--ivory);
  text-align: center;
  max-inline-size: 132px;
}
.site-nav { display: flex; gap: clamp(1rem, 3vw, 2rem); }
.site-nav a {
  color: var(--ivory);
  font-weight: 600;
  font-size: 1rem;
  padding-block: 0.4rem;
  border-block-end: 2px solid transparent;
  transition: border-color 0.2s var(--ease-lay);
}
.site-nav a:hover { border-block-end-color: var(--gold); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--maroon);
  color: var(--ivory);
  min-block-size: 92svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-texture {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23B8925A' stroke-width='6' stroke-opacity='0.07'%3E%3Cpath d='M12 84V48h24v12H24v24zM48 84V24h36v36H72V36H60v48z'/%3E%3Cpath d='M12 12h24v24'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 96px 96px;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  max-width: var(--container);
  margin-inline: auto;
  padding: clamp(9.5rem, 14vh, 11rem) clamp(1rem, 4vw, 2.5rem) 4rem;
  inline-size: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1.5rem, 4vw, 4rem);
}
.hero-copy { flex: 1 1 auto; min-inline-size: 0; }

/* ---------- Hero mark: real logo, sliced into layers for working motion ---------- */
.hero-mark {
  flex: 0 0 auto;
  inline-size: clamp(160px, 24vw, 300px);
}
.rig { position: relative; inline-size: 100%; aspect-ratio: 328 / 323; }
.rig-layer { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; display: block; }

/* jib slowly rotates around the mast-top pivot, like it's surveying the site */
.rig-jib-wrap {
  position: absolute;
  inset: 0;
  transform-origin: 22% 29.4%;
  animation: jib-swing 9s ease-in-out infinite alternate;
}
@keyframes jib-swing {
  0% { transform: rotate(-7deg); }
  100% { transform: rotate(7deg); }
}
/* hook hangs from the jib tip and lags behind it, like a real pendulum */
.rig-hook-wrap {
  position: absolute;
  inset: 0;
  transform-origin: 61.9% 9.9%;
  animation: hook-lag 7s ease-in-out infinite alternate;
  animation-delay: 0.4s;
}
@keyframes hook-lag {
  0% { transform: rotate(4deg); }
  100% { transform: rotate(-4deg); }
}
/* a few building windows glow like an active site at dusk */
.rig-glow-wrap { position: absolute; inset: 0; }
.glow {
  position: absolute;
  inline-size: 4.3%;
  aspect-ratio: 1;
  background: var(--ivory);
  border-radius: 1px;
  opacity: 0;
  filter: blur(0.4px);
  animation: win-twinkle 4s ease-in-out infinite;
}
.glow.tw1 { animation-delay: 0s; }
.glow.tw2 { animation-delay: 0.7s; animation-duration: 4.6s; }
.glow.tw3 { animation-delay: 1.4s; }
.glow.tw4 { animation-delay: 2.1s; animation-duration: 3.6s; }
.glow.tw5 { animation-delay: 0.3s; animation-duration: 5s; }
.glow.tw6 { animation-delay: 2.8s; }
.glow.tw7 { animation-delay: 1.1s; animation-duration: 4.3s; }
.glow.tw8 { animation-delay: 1.9s; }
.glow.tw9 { animation-delay: 0.9s; animation-duration: 3.9s; }
@keyframes win-twinkle {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.85; }
}

.hero h1 { max-inline-size: 14ch; }
.hero-sub {
  max-inline-size: 52ch;
  margin-block-start: 1.4rem;
  font-size: 1.125rem;
  color: rgba(245, 239, 230, 0.88);
}
.hero-sub.is-typing::after {
  content: '';
  display: inline-block;
  inline-size: 2px;
  block-size: 1em;
  margin-inline-start: 3px;
  background: var(--gold);
  vertical-align: -0.15em;
  animation: caret-blink 0.8s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }
.hero-cta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-block-start: 2.2rem;
}
.hero-number {
  font-family: var(--font-latin);
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  unicode-bidi: isolate;
  display: inline-block;
}
.hero-line { inline-size: min(320px, 60vw); margin-block-start: 2.5rem; }

/* ---------- Work / gallery ---------- */
.work { background: var(--ivory); }
.section-lead { max-inline-size: 56ch; margin-block-start: 1.2rem; color: var(--muted); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-block-start: 1.8rem;
}
html:not(.js) .chips { display: none; } /* filter is JS-driven; no dead controls without it */
.chip {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  min-block-size: 44px;
  padding: 0.45rem 1.2rem;
  background: transparent;
  color: var(--maroon);
  border: 1.5px solid var(--gold-soft);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-lay), color 0.2s var(--ease-lay), border-color 0.2s var(--ease-lay), transform 0.15s var(--ease-tap);
}
.chip:hover { border-color: var(--gold); }
.chip:active { transform: scale(0.96); }
.chip.is-active { background: var(--maroon); color: var(--ivory); border-color: var(--maroon); }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: clamp(1rem, 2.5vw, 1.75rem);
  margin-block-start: 2.2rem;
}
.g-item {
  border: 1px solid var(--gold-soft);
  padding: 6px;
  background: var(--ivory);
  cursor: zoom-in;
  transition: border-color 0.2s var(--ease-lay);
}
.g-item:hover, .g-item:focus-visible { border-color: var(--gold); }
.g-item.is-hidden { display: none; }
.g-item img {
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--maroon);
}
.g-item figcaption {
  font-size: 0.875rem;
  color: var(--muted);
  padding: 0.55rem 0.2rem 0.15rem;
}
.work-cta { margin-block-start: 2.5rem; }

/* ---------- Services ---------- */
.services { background: var(--ivory-warm); }
.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: clamp(1rem, 2.5vw, 1.5rem);
  margin-block-start: 2.4rem;
}
.svc-card {
  position: relative;
  display: block;
  background: var(--ivory);
  border: 1px solid var(--gold-soft);
  padding: 1.8rem 1.6rem 1.6rem;
  transition: transform 0.22s var(--ease-tap), border-color 0.22s var(--ease-lay);
}
.svc-card::after {
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  block-size: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform 0.28s var(--ease-lay);
}
.svc-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.svc-card:hover::after { transform: scaleX(1); }
.svc-card:active { transform: scale(0.985); }
.svc-icon {
  inline-size: 40px;
  block-size: 40px;
  color: var(--maroon);
  margin-block-end: 1rem;
}
.svc-card h3 { color: var(--maroon); margin-block-end: 0.5rem; }
.svc-card p { font-size: 1rem; color: var(--muted); line-height: 1.75; }
.svc-go {
  position: absolute;
  inset-block-start: 1.5rem;
  inset-inline-end: 1.4rem;
  font-size: 1.3rem;
  color: var(--gold);
  transition: transform 0.22s var(--ease-tap);
}
.svc-card:hover .svc-go { transform: translateX(-4px); }

/* ---------- Process ---------- */
.process { background: var(--maroon); color: var(--ivory); }
.process h2 { color: var(--ivory); }
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-block-start: 2.6rem;
}
@media (min-width: 700px) {
  .steps { grid-template-columns: repeat(3, 1fr); } /* never orphan step 3 */
}
.steps h3 { color: var(--gold); margin-block: 0.9rem 0.4rem; }
.steps p { color: rgba(245, 239, 230, 0.82); font-size: 1rem; }
.step-num {
  font-family: var(--font-latin);
  font-size: 2.6rem;
  color: var(--gold);
  line-height: 1;
  display: inline-block;
  border-block-end: 3px solid var(--gold);
  padding-block-end: 0.3rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- About strip — deliberately still ---------- */
.about-strip {
  background: var(--ivory);
  padding-block: clamp(3rem, 6vw, 4.5rem);
  border-block-end: 1px solid var(--gold-soft);
}
.about-strip p { max-inline-size: 65ch; }
.about-strip strong { color: var(--maroon); }
.about-tagline {
  margin-block-start: 1.2rem;
  font-family: var(--font-latin);
  color: var(--maroon); /* gold text never sits on ivory (contrast rule) */
  letter-spacing: 0.14em;
  font-size: 0.9375rem;
}
.about-tagline bdi { unicode-bidi: isolate; }

/* ---------- Contact ---------- */
.contact { background: var(--ivory); }
.contact-cta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-block-start: 2rem;
}
.contact-number {
  font-family: var(--font-latin);
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  color: var(--maroon);
  unicode-bidi: isolate;
  display: inline-block;
}
.snap-band {
  margin-block-start: 4rem;
  background: var(--maroon);
  color: var(--ivory);
  padding: clamp(2rem, 5vw, 3.2rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}
.snap-band h3 { color: var(--gold); font-family: var(--font-display); font-size: 1.5rem; }
.snap-band p { color: rgba(245, 239, 230, 0.88); }
.snap-band .btn { margin-block-start: 1rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--maroon-deep);
  color: var(--ivory);
  padding-block: clamp(2.5rem, 6vw, 4rem);
  border-block-start: 3px solid var(--gold);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-brand img { opacity: 0.9; }
.footer-name {
  font-family: var(--font-latin);
  letter-spacing: 0.1em;
  font-size: 1.05rem;
  color: var(--gold);
  margin-block-start: 0.8rem;
}
.footer-info { text-align: end; }
.footer-info a { color: var(--ivory); border-block-end: 1px solid transparent; transition: border-color 0.2s var(--ease-lay); }
.footer-info a:hover { border-block-end-color: var(--gold); }
.footer-tag {
  font-family: var(--font-latin);
  color: var(--gold);
  letter-spacing: 0.14em;
  font-size: 0.8125rem;
  margin-block-start: 1rem;
}

/* ---------- Floating WhatsApp ---------- */
.wa-float {
  position: fixed;
  inset-block-end: 20px;
  inset-inline-end: auto;
  inset-inline-start: auto;
  left: 16px;                    /* physical bottom-left per UX (RTL "end/action" corner) */
  z-index: 40;
  inline-size: 56px;
  block-size: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(34, 26, 25, 0.28);
  transition: transform 0.5s var(--ease-tap), opacity 0.4s var(--ease-lay);
}
html.js .wa-float { opacity: 0; transform: translateY(80px); pointer-events: none; }
html.js .wa-float.is-on { opacity: 1; transform: none; pointer-events: auto; }
html.js .wa-float.is-on:hover, html:not(.js) .wa-float:hover { transform: scale(1.06); }
.wa-float:active { transform: scale(0.94) !important; }

/* ---------- Lightbox ---------- */
.lightbox {
  border: none;
  background: transparent;
  padding: 0;
  max-inline-size: min(92vw, 640px);
  margin: auto;
}
.lightbox::backdrop { background: rgba(34, 26, 25, 0.88); }
.lightbox img {
  display: block;
  inline-size: auto;
  block-size: auto;
  max-inline-size: 100%;
  max-block-size: 76svh;   /* tall originals stay on-screen (short/landscape viewports) */
  margin-inline: auto;
  border: 6px solid var(--ivory);
}
.lb-caption {
  color: var(--ivory);
  text-align: center;
  padding-block-start: 0.7rem;
  font-size: 0.9375rem;
}
.lb-close {
  position: absolute;
  inset-block-start: -14px;
  inset-inline-end: -14px;
  inline-size: 44px;
  block-size: 44px;
  border-radius: 50%;
  border: none;
  background: var(--gold);
  color: var(--charcoal);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1;
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  .site-nav a:nth-child(1) { display: none; } /* keep أعمالنا + تواصل; the gallery is the trust content */
  .brand-name { display: none; }   /* logo-only header on mobile; full name is already in the hero copy */
  .hero { min-block-size: 100svh; }
  .hero-inner { flex-direction: column-reverse; text-align: center; padding-block-start: 6.5rem; }
  .hero-copy { text-align: center; }
  .hero .eyebrow { text-align: center; margin-inline-end: 0; }
  .hero h1 { max-inline-size: none; }
  .hero-sub { max-inline-size: none; }
  .hero-cta { justify-content: center; }
  .hero-line { margin-inline: auto; }
  .hero-mark { inline-size: clamp(120px, 40vw, 180px); margin-block-end: 0.5rem; }
  .footer-info { text-align: start; }
  .snap-band { align-items: stretch; text-align: center; }
  .snap-band .btn { justify-content: center; }
  .lb-close { inset-inline-end: -6px; }   /* keep the full 44px target inside the viewport */
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal,
  html.js .course-line span,
  html.js .wa-float {
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .rig-jib-wrap, .rig-hook-wrap {
    animation: none !important;
    transform: none !important;
  }
  .glow {
    animation: none !important;
    opacity: 0.5 !important;
  }
  html.js .wa-float { pointer-events: auto; }
  .svc-card, .chip, .btn { transition-duration: 0.01ms !important; }
}
