/* =====================================================================
   Dar Al Zawiah Engineering Consultancy — design system
   Teal + navy from the logo, warm paper neutrals from the renders.
   Logical properties throughout so one sheet serves RTL and LTR.
   ===================================================================== */

:root {
  --font: 'Cairo', system-ui, 'Segoe UI', Tahoma, sans-serif;
  --max: 1200px;

  --bg: #f7f4ee;
  --bg-2: #efeae1;
  --surface: #ffffff;
  --ink: #0e2233;
  --ink-2: #3d4f5e;
  --ink-3: #66767f;
  --line: #ddd5c6;
  --line-2: #c9bfab;

  --teal: #08808d;
  --teal-ink: #066a76;
  --on-teal: #ffffff;
  --brick: #a4523a;

  --band: #0e2233;
  --band-ink: #eef3f6;
  --band-ink-2: #aebdc7;

  --cta-btn-bg: #ffffff;
  --cta-btn-ink: #0e2233;

  --header-bg: rgba(247, 244, 238, .88);
  --shadow: 0 24px 48px -28px rgba(14, 34, 51, .45);
}

html[data-theme="dark"] {
  --bg: #0a1620;
  --bg-2: #0d1c28;
  --surface: #112431;
  --ink: #eef2f4;
  --ink-2: #b5c2cb;
  --ink-3: #8296a2;
  --line: #21394a;
  --line-2: #2f4d61;

  --teal: #1bbccc;
  --teal-ink: #4bd3e0;
  --on-teal: #05202a;
  --brick: #e0917a;

  --band: #081019;
  --cta-btn-bg: #05202a;
  --cta-btn-ink: #ffffff;

  --header-bg: rgba(10, 22, 32, .88);
  --shadow: 0 24px 48px -28px rgba(0, 0, 0, .8);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; line-height: 1.25; }
p { margin: 0 0 1em; color: var(--ink-2); }
p:last-child { margin-bottom: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { max-width: var(--max); margin-inline: auto; padding-inline: 24px; }
.section { padding: 96px 0; }
.section.alt { background: var(--bg-2); border-block: 1px solid var(--line); }

svg.i { width: 1.25em; height: 1.25em; flex: none; }
.flip-rtl { transition: transform .2s; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* ---------- Type helpers ---------- */
.kicker {
  display: inline-flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: .9rem; color: var(--teal-ink);
  margin-bottom: 14px;
}
.kicker::before { content: ""; width: 26px; height: 2px; background: var(--teal); }
.title { font-size: clamp(1.7rem, 3.2vw, 2.5rem); letter-spacing: -.005em; }
.lead { font-size: 1.1rem; color: var(--ink-2); max-width: 62ch; }
.section-head { max-width: 720px; margin-bottom: 52px; }
.section-head .lead { margin-top: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border: 1.5px solid transparent; border-radius: 2px;
  font-weight: 700; font-size: .95rem; cursor: pointer; line-height: 1.4;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); color: var(--on-teal); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-cta { background: var(--cta-btn-bg); color: var(--cta-btn-ink); }
.btn-cta:hover { filter: brightness(.94); }
.btn-outline-light { border-color: color-mix(in srgb, var(--on-teal) 55%, transparent); color: var(--on-teal); }
.btn-outline-light:hover { border-color: var(--on-teal); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { max-width: var(--max); margin-inline: auto; padding: 10px 24px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand .logo { height: 44px; width: auto; }
.logo-dark { display: none; }
html[data-theme="dark"] .logo-light { display: none; }
html[data-theme="dark"] .logo-dark { display: block; }
.brand-text strong { display: block; font-size: 1.05rem; font-weight: 800; line-height: 1.2; }
.brand-text small { display: block; font-size: .72rem; font-weight: 600; color: var(--ink-3); line-height: 1.3; }

.main-nav { display: flex; gap: 4px; margin-inline-start: auto; }
.main-nav a { position: relative; padding: 8px 14px; font-weight: 600; font-size: .95rem; color: var(--ink-2); }
.main-nav a::after {
  content: ""; position: absolute; inset-inline: 14px; bottom: 1px; height: 2px;
  background: var(--teal); transform: scaleX(0); transform-origin: center; transition: transform .2s;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--ink); }
.main-nav a:hover::after, .main-nav a[aria-current="page"]::after { transform: scaleX(1); }

.tools { display: flex; align-items: center; gap: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 2px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 7px 12px; font-weight: 700; font-size: .8rem; cursor: pointer; color: var(--ink-3); letter-spacing: .03em; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 1px solid var(--line-2); border-radius: 2px; background: transparent; cursor: pointer; color: var(--ink); }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-btn .i-sun { display: none; }
html[data-theme="dark"] .theme-btn .i-sun { display: block; }
html[data-theme="dark"] .theme-btn .i-moon { display: none; }
.menu-btn { display: none; }

/* ---------- Brand motif (nested frames from the logo) ---------- */
.motif { position: absolute; pointer-events: none; color: var(--teal); opacity: .11; }
.motif svg { display: block; width: 100%; height: auto; }
[dir="rtl"] .motif svg { transform: scaleX(-1); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 96px; }
.hero .motif { width: 560px; inset-block-start: -70px; inset-inline-start: -90px; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.02fr .98fr; gap: 64px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 4.8vw, 3.8rem); line-height: 1.18; letter-spacing: -.01em; }
.hero h1 em { display: block; font-style: normal; color: var(--teal-ink); }
.hero .lead { margin-top: 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.hero-media { position: relative; isolation: isolate; aspect-ratio: 4 / 4.5; }
.hero-media::before {
  content: ""; position: absolute; z-index: -1; width: 64%; height: 46%;
  inset-block-start: -18px; inset-inline-end: -18px; background: var(--teal);
}
.hero-media .frame { position: absolute; inset: 0; overflow: hidden; box-shadow: var(--shadow); background: var(--bg-2); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
html[data-theme="dark"] .hero-media img { filter: brightness(.86) contrast(1.04); }
.badge-year {
  position: absolute; inset-inline-start: -24px; inset-block-end: 36px;
  background: var(--surface); border: 1px solid var(--line); padding: 14px 22px; box-shadow: var(--shadow);
  display: flex; align-items: baseline; gap: 10px;
}
.badge-year small { font-weight: 700; color: var(--ink-3); font-size: .82rem; }
.badge-year b { font-size: 2.2rem; font-weight: 800; line-height: 1; color: var(--teal-ink); letter-spacing: .02em; }

/* ---------- Facts strip ---------- */
.facts { background: var(--surface); border-block: 1px solid var(--line); }
.facts-row { display: grid; grid-template-columns: repeat(3, 1fr); }
.fact { display: flex; gap: 18px; align-items: flex-start; padding: 30px 28px; border-inline-end: 1px solid var(--line); }
.fact:last-child { border-inline-end: 0; }
.ico { width: 48px; height: 48px; flex: none; display: grid; place-items: center; background: var(--bg-2); color: var(--teal-ink); transition: background-color .2s, color .2s; }
.ico svg { width: 24px; height: 24px; }
.fact h3 { font-size: 1.02rem; margin-bottom: 4px; }
.fact p { margin: 0; font-size: .9rem; color: var(--ink-3); }

/* ---------- About teaser ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.collage { position: relative; padding-bottom: 56px; }
.collage .a { aspect-ratio: 4 / 3; overflow: hidden; box-shadow: var(--shadow); }
.collage .b { position: absolute; inset-inline-end: -20px; inset-block-end: 0; width: 46%; aspect-ratio: 3 / 4; overflow: hidden; border: 8px solid var(--bg); box-shadow: var(--shadow); }
.section.alt .collage .b { border-color: var(--bg-2); }
.collage img { width: 100%; height: 100%; object-fit: cover; }
.checks { margin: 24px 0 32px; display: grid; gap: 12px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; }
.checks svg { color: var(--teal-ink); margin-top: 4px; }

/* ---------- Service rows (home) ---------- */
.svc-list { border-top: 1px solid var(--line-2); }
.svc-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1.5fr) 28px; gap: 24px; align-items: center; padding: 28px 12px; border-bottom: 1px solid var(--line); transition: background-color .2s, padding .2s; }
.svc-row:hover { background: var(--surface); padding-inline: 24px; }
.svc-row .n { font-weight: 800; font-size: 1.05rem; color: var(--teal-ink); letter-spacing: .04em; }
.svc-row h3 { font-size: 1.25rem; }
.svc-row p { margin: 0; font-size: .97rem; }
.svc-row svg { color: var(--ink-3); }

/* ---------- Featured project band ---------- */
.band { background: var(--band); color: var(--band-ink); position: relative; overflow: hidden; }
.band .kicker { color: #6fdbe6; }
.band .kicker::before { background: #6fdbe6; }
.band p { color: var(--band-ink-2); }
.band .motif { color: #fff; opacity: .06; width: 520px; inset-block-end: -60px; inset-inline-end: -80px; }
.band-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; margin-bottom: 44px; position: relative; }
.band-head .lead { color: var(--band-ink-2); margin-top: 14px; }
.compare { position: relative; display: grid; grid-template-columns: 7fr 5fr; gap: 18px; height: 540px; }
.shot { position: relative; overflow: hidden; background: #0b1620; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.shot:hover img { transform: scale(1.03); }
.chip-label { position: absolute; inset-block-start: 16px; inset-inline-start: 16px; background: var(--teal); color: var(--on-teal); font-weight: 700; font-size: .8rem; padding: 4px 12px; }
html[data-theme="dark"] .band .chip-label { background: var(--teal); }

/* ---------- Mosaic ---------- */
.mosaic { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 210px; gap: 14px; }
.mosaic a { position: relative; overflow: hidden; background: var(--bg-2); }
.mosaic a:first-child { grid-column: span 2; grid-row: span 2; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.mosaic a:hover img { transform: scale(1.05); }
.mosaic-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; margin-bottom: 40px; }

/* ---------- Process ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-2); }
.step { padding: 32px 28px 8px; border-inline-start: 1px solid var(--line); }
.step:first-child { border-inline-start: 0; padding-inline-start: 0; }
.step .no { display: block; font-size: 3.2rem; font-weight: 800; line-height: 1; color: transparent; -webkit-text-stroke: 1.5px var(--teal); margin-bottom: 18px; }
.step h3 { font-size: 1.12rem; margin-bottom: 8px; }
.step p { font-size: .94rem; }

/* ---------- CTA ---------- */
.cta { position: relative; overflow: hidden; background: var(--teal); color: var(--on-teal); padding: 76px 0; }
.cta .motif { color: var(--on-teal); opacity: .13; width: 420px; inset-block-start: -50px; inset-inline-end: 4%; }
.cta-inner { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 36px; flex-wrap: wrap; }
.cta h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); max-width: 22ch; }
.cta p { color: color-mix(in srgb, var(--on-teal) 86%, transparent); margin-top: 10px; max-width: 52ch; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Inner page header ---------- */
.page-head { position: relative; overflow: hidden; padding: 76px 0 64px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.page-head .motif { width: 380px; inset-block-start: -40px; inset-inline-end: 3%; }
.page-head .container { position: relative; }
.page-head h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); letter-spacing: -.01em; }
.page-head .lead { margin-top: 16px; }

/* ---------- Services page ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.svc-card { background: var(--surface); padding: 34px 26px 38px; display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 96px; }
.svc-card:hover .ico { background: var(--teal); color: var(--on-teal); }
.svc-card .n { font-size: .8rem; font-weight: 800; color: var(--ink-3); letter-spacing: .08em; }
.svc-card h3 { font-size: 1.18rem; }
.svc-card p { font-size: .94rem; margin: 0; }
.svc-card .top { display: flex; justify-content: space-between; align-items: flex-start; }

/* ---------- About page ---------- */
.stat-year { display: flex; align-items: baseline; gap: 12px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line-2); }
.stat-year b { font-size: 3.4rem; font-weight: 800; line-height: 1; color: transparent; -webkit-text-stroke: 1.5px var(--teal); letter-spacing: .02em; }
.stat-year span { font-weight: 700; color: var(--ink-2); }
.values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.value { background: var(--surface); padding: 34px 26px; }
.value .ico { margin-bottom: 20px; }
.value:hover .ico { background: var(--teal); color: var(--on-teal); }
.value h3 { font-size: 1.12rem; margin-bottom: 8px; }
.value p { font-size: .94rem; margin: 0; }

/* ---------- Projects page ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
.chip { border: 1px solid var(--line-2); background: transparent; padding: 9px 20px; font-weight: 700; font-size: .9rem; cursor: pointer; color: var(--ink-2); border-radius: 2px; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.proj { margin: 0; }
.proj[hidden] { display: none; }
.proj a { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; background: var(--bg-2); cursor: zoom-in; }
.proj img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.proj a:hover img { transform: scale(1.05); }
.proj .tag { position: absolute; inset-block-start: 12px; inset-inline-start: 12px; background: var(--surface); color: var(--ink); font-size: .75rem; font-weight: 700; padding: 3px 11px; border: 1px solid var(--line); }
.proj figcaption { padding: 14px 2px 0; font-weight: 600; font-size: .98rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 56px; align-items: start; }
.info-list { border-top: 1px solid var(--line-2); }
.info { display: flex; gap: 18px; align-items: flex-start; padding: 24px 0; border-bottom: 1px solid var(--line); }
.info small { display: block; color: var(--ink-3); font-weight: 600; font-size: .82rem; }
.info strong, .info a { font-size: 1.12rem; font-weight: 700; }
.info a:hover { color: var(--teal-ink); }
.info .stack { display: grid; gap: 2px; }
.form { background: var(--surface); border: 1px solid var(--line); padding: 36px; }
.form h2 { font-size: 1.5rem; margin-bottom: 24px; }
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label { font-weight: 700; font-size: .9rem; }
.field input, .field select, .field textarea { width: 100%; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 2px; }
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form .note { margin: 14px 0 0; font-size: .85rem; color: var(--ink-3); }

/* ---------- Footer ---------- */
.site-footer { background: #07111a; color: #c7d3da; padding: 68px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 56px; padding-bottom: 44px; border-bottom: 1px solid #1a2c3a; }
.footer-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.footer-brand img { height: 52px; width: auto; }
.footer-brand strong { display: block; color: #fff; font-size: 1.08rem; line-height: 1.2; }
.footer-brand small { color: #8fa3b0; font-weight: 600; font-size: .75rem; }
.site-footer p { color: #93a7b4; font-size: .94rem; max-width: 40ch; }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: 18px; }
.site-footer li { margin-bottom: 10px; font-size: .94rem; }
.site-footer a { color: #b6c6d0; }
.site-footer a:hover { color: #6fdbe6; }
.footer-bottom { padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: #7b90a0; font-size: .85rem; }

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(4, 11, 17, .94); display: none; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.lb.open { display: flex; }
.lb img { max-width: min(94vw, 1400px); max-height: 78vh; object-fit: contain; }
.lb-cap { margin-top: 16px; color: #dbe5ea; font-weight: 600; text-align: center; }
.lb button { position: absolute; width: 46px; height: 46px; display: grid; place-items: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22); color: #fff; cursor: pointer; border-radius: 2px; }
.lb button:hover { background: rgba(255,255,255,.18); }
.lb button svg { width: 20px; height: 20px; }
.lb-close { inset-block-start: 18px; inset-inline-end: 18px; }
.lb-prev, .lb-next { inset-block-start: 50%; transform: translateY(-50%); }
.lb-prev { inset-inline-start: 18px; }
.lb-next { inset-inline-end: 18px; }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .hero-grid, .split, .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-media { max-width: 560px; aspect-ratio: 4 / 3.6; }
  .svc-grid, .values { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .step:nth-child(3) { border-inline-start: 0; padding-inline-start: 0; }
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .menu-btn { display: inline-grid; }
  .main-nav {
    position: absolute; inset-inline: 0; top: 100%; margin: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 24px 16px;
    display: none;
  }
  .site-header.open .main-nav { display: flex; }
  .main-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .main-nav a::after { display: none; }
  .header-inner { gap: 12px; }
  .tools { margin-inline-start: auto; }
  .brand-text small { display: none; }
  .facts-row { grid-template-columns: 1fr; }
  .fact { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .fact:last-child { border-bottom: 0; }
  .svc-row { grid-template-columns: 48px 1fr 24px; }
  .svc-row p { display: none; }
  .compare { grid-template-columns: 1fr; height: auto; }
  .compare .shot { aspect-ratio: 4 / 3; }
  .mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 170px; }
  .row2 { grid-template-columns: 1fr; }
  .section { padding: 68px 0; }
  .badge-year { inset-inline-start: 12px; }
}
@media (max-width: 560px) {
  .svc-grid, .values, .steps, .proj-grid { grid-template-columns: 1fr; }
  .step { border-inline-start: 0; padding-inline-start: 0; border-bottom: 1px solid var(--line); padding-bottom: 28px; }
  .form { padding: 24px; }
  .brand .logo { height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
