:root {
  --bg: #F6F3ED;
  --bg-alt: #ECE5D6;
  --ink: #262119;
  --ink-muted: #6E6459;
  --accent: #AD4C2B;
  --line: #DCD2BD;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; line-height: 1.6; }
a { color: var(--ink); }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: 'Cormorant', Georgia, 'Times New Roman', serif; font-weight: 500; margin: 0; }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: 40px; padding-right: 40px; }
header.site-header { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 20px 0; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); line-height: 1.1; }
.logo-mark { width: 32px; height: auto; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; }
.logo .name { font-family: 'Cormorant', Georgia, serif; font-size: 22px; font-weight: 600; letter-spacing: 0.02em; }
.logo .role { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-muted); }
/* .name-local replaces the "Rim Younes" Latin wordmark with its Arabic
   transliteration on /ar/ — same visual weight/role as .name, just a
   different (Arabic-capable) font, not a smaller secondary line. Kept on
   Cairo (matching the hero title) rather than the IBM Plex Sans Arabic
   used for body/other headings — the brand mark is a display element, not
   body copy.
   Specificity note: .logo .name-local (two classes) must be at least as
   specific as .logo .name above, or that rule's 'Cormorant' font-family
   wins even though this element also has the .name-local class. */
.name-local { font-family: 'Cairo', sans-serif; }
.logo .name-local { font-family: 'Cairo', sans-serif; font-size: 22px; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; }
.main-nav { display: flex; gap: 32px; font-size: 15px; }
.main-nav a { text-decoration: none; }
.main-nav a.active { color: var(--accent); font-weight: 500; }
.lang-switch { display: flex; align-items: center; gap: 6px; font-size: 12px; letter-spacing: 0.05em; }
.lang-switch a { text-decoration: none; padding: 4px 9px; border-radius: 2px; color: var(--ink-muted); }
.lang-switch a.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav-cta { display: inline-block; padding: 10px 20px; border-radius: 2px; background: var(--accent); color: #fff; text-decoration: none; font-size: 13px; letter-spacing: 0.03em; white-space: nowrap; }
.nav-cta:hover { background: var(--ink); color: #fff; }
.hero { padding: 100px 0 84px; display: flex; flex-direction: column; gap: 28px; align-items: flex-start; }
.hero .kicker { font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.hero h1 { font-size: clamp(40px, 6vw, 68px); line-height: 1.06; max-width: 820px; }
.hero p { font-size: 18px; color: var(--ink-muted); max-width: 560px; margin: 0; }
.hero .actions { display: flex; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 14px 28px; border-radius: 2px; text-decoration: none; font-size: 14px; letter-spacing: 0.03em; border: none; cursor: pointer; font-family: inherit; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { border: 1px solid var(--ink); color: var(--ink); background: transparent; }
section.alt { background: var(--bg-alt); padding: 80px 0; }
section.plain { padding: 84px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 40px; flex-wrap: wrap; gap: 16px; }
.section-head h2 { font-size: 32px; }
.section-head a { color: var(--accent); text-decoration: none; font-size: 14px; letter-spacing: 0.03em; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 32px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 48px 56px; }
.project-card .thumb { aspect-ratio: 4/3; background: var(--bg); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.project-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-card .thumb svg { width: 72%; height: 72%; }
.project-card .title { font-family: 'Cormorant', Georgia, serif; font-size: 20px; font-weight: 500; margin-top: 16px; }
.project-card .meta { font-size: 13px; color: var(--ink-muted); margin-top: 4px; }
.page-portfolio .project-card .thumb, section.alt .project-card .thumb { background: var(--bg-alt); }
.portfolio-filters { display: flex; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
.portfolio-filters a { text-decoration: none; padding: 7px 16px; border-radius: 2px; border: 1px solid var(--line); color: var(--ink-muted); font-size: 13px; letter-spacing: 0.02em; }
.portfolio-filters a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.service-icon { color: var(--accent); }
.service-block .name { font-size: 16px; font-weight: 500; margin-top: 16px; }
.service-block .desc { font-size: 14px; color: var(--ink-muted); margin-top: 8px; }
.service-row { display: flex; gap: 20px; }
.service-row .name { font-size: 18px; font-weight: 500; margin-top: 0; }
.service-row .desc { font-size: 14px; color: var(--ink-muted); margin-top: 8px; }
.about-photo { aspect-ratio: 5/6; background: var(--bg-alt); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.about-photo svg { width: 55%; height: 55%; }
.about-placeholder { font-size: 15px; color: var(--ink-muted); margin-top: 16px; max-width: 620px; }
input, textarea, select { font-family: 'Work Sans', sans-serif; font-size: 15px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 2px; padding: 12px 14px; width: 100%; }
label { font-size: 13px; color: var(--ink-muted); margin-bottom: 6px; display: block; }
.help-block { color: #b3261e; font-size: 13px; margin-top: 4px; }
.alert { font-size: 14px; padding: 14px 16px; border-radius: 2px; margin-bottom: 24px; }
.alert-success { background: #e7f0d8; color: #3d5a1e; }
.alert-danger { background: #f7dede; color: #7a2323; }
.contact-detail { margin-top: 28px; display: flex; flex-direction: column; gap: 16px; font-size: 15px; }
.contact-detail .label { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); }
.contact-detail .value { margin-top: 4px; }
.contact-detail .value a + a { margin-inline-start: 14px; }
.map-box { aspect-ratio: 4/3; background: var(--bg-alt); border: 1px solid var(--line); overflow: hidden; margin-bottom: 24px; }
.map-box svg, .map-box iframe { width: 100%; height: 100%; display: block; }
.error-page { padding: 120px 0 140px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.error-page .error-code { font-family: 'Cormorant', Georgia, serif; font-size: 96px; font-weight: 500; color: var(--accent); line-height: 1; }
.error-page h1 { font-size: 32px; margin-top: 16px; }
.error-page p { font-size: 16px; color: var(--ink-muted); max-width: 480px; margin: 16px 0 0; }
.error-actions { display: flex; gap: 16px; margin-top: 32px; flex-wrap: wrap; justify-content: center; }
footer.site-footer { border-top: 1px solid var(--line); padding: 56px 0 32px; }
.footer-row { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-brand { max-width: 280px; }
.footer-brand p { font-size: 14px; color: var(--ink-muted); margin-top: 12px; }
.logo-mark-large { width: 72px; height: auto; display: block; margin-bottom: 16px; color: var(--ink); }
.footer-cols { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.footer-col .head { color: var(--ink-muted); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 4px; }
.footer-col a { text-decoration: none; }
.footer-bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-muted); }
html[dir="rtl"] .hero, html[dir="rtl"] .footer-brand, html[dir="rtl"] .service-row, html[dir="rtl"] .footer-col { text-align: right; }
/* dir="ltr" (phone/email — see contact.php, layout.php) forces correct LTR
   digit/character order, but text-align is independent of dir — without
   this, those elements stay left-aligned even inside an otherwise
   right-aligned RTL block. */
html[dir="rtl"] [dir="ltr"] { text-align: right; }
html[dir="rtl"] .service-row { flex-direction: row-reverse; }
/* Cormorant/Work Sans have no Arabic glyphs at all — without this override,
   Arabic text silently falls back to whatever generic sans the browser
   ships, ignoring the site's type system entirely. IBM Plex Sans Arabic
   covers body + non-hero headings — chosen specifically to CONTRAST with
   Cairo (kept for the hero title only, below) rather than compete with it:
   Cairo is warm/geometric, Plex is neutral/engineered, echoing the
   display-vs-workhorse relationship Cormorant/Work Sans have on the Latin
   side (an earlier Cairo+Tajawal pairing was dropped for being too close
   in style to read as deliberate). */
html[dir="rtl"] body,
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 { font-family: 'IBM Plex Sans Arabic', 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
/* Hero title only (not every h1 site-wide) stays on Cairo per explicit choice. */
html[dir="rtl"] .hero h1 { font-family: 'Cairo', sans-serif; }
/* Same brand-display treatment as .name-local — the tagline under the logo
   is part of the brand mark, not body copy. */
html[dir="rtl"] .logo .role { font-family: 'Cairo', sans-serif; }
@media (max-width: 860px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .header-row, .footer-row, .about-grid { flex-direction: column; align-items: flex-start; }
  .hero h1 { font-size: 34px; }
}
