:root {
  --ink: #12322D;
  --ink-2: #1E4A43;
  --ink-3: #0B221E;
  --paper: #F6F3EC;
  --paper-2: #ECE6D8;
  --card: #FFFFFF;
  --brass: #B8965E;
  --brass-2: #8F7043;
  --brass-soft: #F2E8D6;
  --slate: #5B6472;
  --line: #DED6C2;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(18, 50, 45, 0.08);
  --font: "Cairo", system-ui, sans-serif;
  --display: "Almarai", "Cairo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 112px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); line-height: 1.7; -webkit-font-smoothing: antialiased; }
html[lang="en"] body { --display: "Cairo", system-ui, sans-serif; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.25; margin: 0; }
h2 { font-size: clamp(26px, 4vw, 38px); margin-bottom: 18px; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.eyebrow { color: var(--brass); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 8px; }
.eyebrow.dark { color: var(--brass-2); }
.lead { font-size: clamp(16px, 2vw, 19px); color: rgba(255,255,255,.82); max-width: 640px; }
.lead.small { font-size: 15px; }
.body { color: var(--slate); font-size: 16px; white-space: pre-line; }
.empty { color: var(--slate); text-align: center; padding: 30px 0; }
.empty.light { color: rgba(255,255,255,.6); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 13px 26px; font: 700 15px var(--font); text-decoration: none; cursor: pointer; transition: transform .15s, background .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 9px 18px; font-size: 14px; }
.btn-brass { background: var(--brass); color: #fff; box-shadow: 0 6px 18px rgba(184,150,94,.35); }
.btn-brass:hover { background: var(--brass-2); }
.btn-ghost { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.btn-ink { background: var(--ink); color: #fff; width: 100%; }
.btn-ink:hover { background: var(--ink-2); }
.btn[disabled] { opacity: .6; cursor: default; transform: none; }

/* nav */
.nav { position: sticky; top: 0; z-index: 40; background: rgba(18,50,45,.94); backdrop-filter: blur(10px); color: #fff; }
.nav-inner { display: flex; align-items: center; gap: 20px; height: 104px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--brass); color: var(--ink); display: grid; place-items: center; font: 800 22px var(--display); overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
/* uploaded logo: shown at a real size on a white plate, keeping its own proportions (wide logos stay wide) */
.brand-mark.has-logo { display: inline-flex; align-items: center; justify-content: center; width: auto; height: auto; padding: 0; background: transparent; border-radius: 0; box-shadow: none; overflow: visible; }
.brand.has-logo .brand-text { display: none; } /* the logo already carries the company name */
.brand-mark.has-logo img { display: block; width: auto; height: 84px; max-width: 260px; object-fit: contain; background: transparent; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--display); font-size: 18px; }
.brand-text small { font-size: 11px; color: rgba(255,255,255,.65); }
.links { display: flex; gap: 22px; margin-inline-start: auto; }
.links a { text-decoration: none; font-weight: 600; font-size: 15px; color: rgba(255,255,255,.82); }
.links a:hover { color: var(--brass); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.lang { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 6px 12px; font: 700 13px var(--font); cursor: pointer; }
.burger { display: none; background: none; border: 0; width: 40px; height: 40px; padding: 8px; cursor: pointer; }
.burger span { display: block; height: 2px; background: #fff; margin: 5px 0; border-radius: 2px; }

/* hero */
.hero { position: relative; background: var(--ink); color: #fff; overflow: hidden; padding: 90px 0 0; }
.hero-bg { position: absolute; inset: 0; background: radial-gradient(1200px 500px at 85% -10%, rgba(184,150,94,.28), transparent 60%), linear-gradient(160deg, var(--ink) 0%, var(--ink-3) 100%); background-size: cover; background-position: center; }
.hero-bg.has-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,34,30,.55), rgba(11,34,30,.92)); }
.hero-inner { position: relative; padding-bottom: 60px; }
.hero h1 { font-size: clamp(32px, 6vw, 60px); max-width: 860px; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--brass); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.stats { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(255,255,255,.1); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.stat { background: var(--ink-2); padding: 22px 18px; text-align: center; }
.stat b { display: block; font: 800 clamp(26px, 4vw, 36px) var(--display); color: var(--brass); }
.stat span { font-size: 14px; color: rgba(255,255,255,.75); }

/* sections */
.section { padding: 90px 0; }
.section.alt { background: var(--paper-2); }
.section.dark { background: var(--ink); color: #fff; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.section-head h2 { margin-bottom: 0; }
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 50px; align-items: start; }
.vision-card { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 34px; box-shadow: var(--shadow); }
.vision-card h3 { color: var(--brass); font-size: 22px; margin-bottom: 10px; }
.vision-card p { color: rgba(255,255,255,.82); white-space: pre-line; }
.values { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.values li { display: flex; gap: 10px; align-items: flex-start; }
.values li::before { content: ""; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--brass); margin-top: 10px; }

.grid { display: grid; gap: 22px; }
.services { grid-template-columns: repeat(3, 1fr); }
.service { background: var(--card); border-radius: var(--radius); padding: 30px 26px; box-shadow: var(--shadow); border-top: 4px solid var(--brass); }
.service .ic { width: 52px; height: 52px; border-radius: 14px; background: var(--brass-soft); color: var(--brass-2); display: grid; place-items: center; margin-bottom: 16px; font-size: 26px; }
.service h3 { font-size: 20px; margin-bottom: 8px; }
.service p { color: var(--slate); margin: 0; white-space: pre-line; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 7px 16px; font: 600 14px var(--font); cursor: pointer; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.works { grid-template-columns: repeat(3, 1fr); }
.work { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.work-img { position: relative; aspect-ratio: 4/3; background: var(--paper-2); cursor: pointer; overflow: hidden; border: 0; padding: 0; width: 100%; }
.work-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.work-img:hover img { transform: scale(1.05); }
.work-img .count { position: absolute; bottom: 10px; inset-inline-start: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; border-radius: 999px; padding: 2px 10px; }
.work-img .ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--brass-2); font: 800 44px var(--display); background: linear-gradient(135deg, var(--brass-soft), var(--paper-2)); }
.work-body { padding: 18px 20px 22px; }
.work-tag { display: inline-block; background: var(--brass-soft); color: var(--brass-2); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; margin-bottom: 8px; }
.work h3 { font-size: 19px; margin-bottom: 4px; }
.work .meta { color: var(--slate); font-size: 14px; }
.work p.desc { color: var(--slate); font-size: 14px; margin: 8px 0 0; white-space: pre-line; }

.partners { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-top: 30px; }
.partner { background: #fff; border-radius: 14px; aspect-ratio: 3/2; display: grid; place-items: center; padding: 18px; text-decoration: none; color: var(--ink); transition: transform .2s; }
.partner:hover { transform: translateY(-3px); }
.partner img { max-height: 100%; max-width: 100%; object-fit: contain; }
.partner span { font: 700 15px var(--display); text-align: center; }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 14px; }
.contact-list li { display: flex; gap: 12px; align-items: flex-start; }
.contact-list .ic { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; background: var(--ink); color: var(--brass); display: grid; place-items: center; }
.contact-list small { display: block; color: var(--slate); font-size: 13px; }
.contact-list a { text-decoration: none; font-weight: 700; }
.socials { display: flex; gap: 10px; flex-wrap: wrap; }
.socials a { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; font-weight: 700; font-size: 14px; text-decoration: none; }
.form { background: var(--card); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
.form input, .form select, .form textarea { width: 100%; font: 16px var(--font); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--brass); border-color: transparent; }
.form .hp { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); pointer-events: none; }
.form { position: relative; }
body { overflow-x: clip; }
.form-msg { margin: 0; font-weight: 700; font-size: 14px; min-height: 1.5em; }
.form-msg.ok { color: #178F7A; }
.form-msg.err { color: #A8462A; }
.map { margin-top: 40px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.map iframe { width: 100%; height: 340px; border: 0; display: block; }

.footer { background: var(--ink-3); color: rgba(255,255,255,.7); padding: 28px 0; font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer strong { color: #fff; }
.footer p { margin: 4px 0 0; }
.staff { color: var(--brass); text-decoration: none; font-weight: 700; border: 1px solid rgba(184,150,94,.4); border-radius: 999px; padding: 7px 16px; }

.wa-fab { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom)); inset-inline-end: 20px; z-index: 50; width: 58px; height: 58px; border-radius: 50%; background: #25D366; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
html[dir="rtl"] .wa-fab { inset-inline-end: auto; inset-inline-start: 20px; }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(5,15,13,.94); display: flex; align-items: center; justify-content: center; padding: 20px; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 1000px; width: 100%; text-align: center; }
.lightbox img { max-height: 78vh; margin: 0 auto; border-radius: 10px; }
.lightbox figcaption { color: #fff; margin-top: 12px; font-weight: 700; }
.lb-close { position: absolute; top: 14px; inset-inline-end: 18px; background: none; border: 0; color: #fff; font-size: 40px; cursor: pointer; line-height: 1; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.12); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 30px; cursor: pointer; }
.lb-prev { inset-inline-start: 14px; }
.lb-next { inset-inline-end: 14px; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s, transform .6s; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

@media (max-width: 960px) {
  .services, .works { grid-template-columns: repeat(2, 1fr); }
  .partners { grid-template-columns: repeat(3, 1fr); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 30px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .burger { display: block; }
  .hide-sm { display: none; }
  .links { display: none; position: absolute; top: 80px; inset-inline: 0; background: var(--ink); flex-direction: column; gap: 0; padding: 8px 16px 16px; margin: 0; }
  .links.open { display: flex; }
  .links a { padding: 12px 4px; border-bottom: 1px solid rgba(255,255,255,.08); }
  .nav-actions { margin-inline-start: auto; }
  .nav-inner { height: 80px; }
  .brand-mark.has-logo img { height: 62px; max-width: 170px; }
  .section { padding: 64px 0; }
  .hero { padding-top: 56px; }
}
@media (max-width: 560px) {
  .services, .works { grid-template-columns: 1fr; }
  .partners { grid-template-columns: repeat(2, 1fr); }
  .form, .vision-card { padding: 22px; }
  .brand-text small { display: none; }
}

/* ---------- first paint: hold the page until Firebase answers (avoids flashing default text, or the
   full site before the maintenance screen). A 5s safety timeout in app.js always reveals the page. */
.boot { display: none; }
html.booting body > *:not(.boot) { visibility: hidden; }
html.booting .boot { display: grid; place-items: center; position: fixed; inset: 0; background: var(--ink); z-index: 200; }
.boot-dot { width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(184,150,94,.25); border-top-color: var(--brass); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- maintenance mode ---------- */
html.maintenance body > *:not(.maint) { display: none !important; }
.maint { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(900px 420px at 80% -10%, rgba(184,150,94,.25), transparent 60%), linear-gradient(160deg, var(--ink), var(--ink-3)); color: #fff; text-align: center; }
.maint-card { width: min(560px, 100%); display: grid; gap: 14px; justify-items: center; }
.maint-logo img { height: 110px; width: auto; max-width: 280px; object-fit: contain; }
.maint-icon { font-size: 44px; }
.maint h1 { font-size: clamp(24px, 5vw, 34px); color: #fff; }
.maint-en { margin: 0; color: rgba(255,255,255,.7); font-size: 15px; }
.maint-contact { display: grid; gap: 10px; width: 100%; margin-top: 10px; }
.maint-contact a { display: flex; align-items: center; justify-content: center; gap: 10px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 14px; padding: 13px 16px; color: #fff; text-decoration: none; font-weight: 700; font-size: 16px; }
.maint-contact a:hover { background: rgba(255,255,255,.14); }
.maint-contact a.wa { background: #25D366; border-color: #25D366; }
.maint-contact a.fb { background: #1877F2; border-color: #1877F2; }
.maint-contact .ic { display: inline-grid; color: var(--brass); }
.maint-contact a.wa .ic, .maint-contact a.fb .ic { color: #fff; }
.maint-staff { margin-top: 12px; color: rgba(255,255,255,.55); font-size: 13px; text-decoration: none; }
.maint-staff:hover { color: var(--brass); }
