/* =====================================================================
   mamoun.info — Editorial / Academic-Modern Design System
   Bilingual EN / AR (RTL) · Light + Dark · Static (no build tools)
   ===================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Type families */
  --font-display: "Fraunces", "Georgia", "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Space Grotesk", ui-monospace, "SFMono-Regular", monospace;

  /* Light palette (paper & ink) */
  --paper: #faf7f0;
  --paper-2: #f3eee3;
  --surface: #ffffff;
  --ink: #1a1714;
  --ink-2: #46413a;
  --muted: #837c70;
  --accent: #9a6a2e;     /* antique bronze / gold */
  --accent-2: #7c521d;
  --accent-soft: rgba(154, 106, 46, 0.12);
  --line: rgba(26, 23, 20, 0.12);
  --line-strong: rgba(26, 23, 20, 0.24);
  --shadow-sm: 0 1px 2px rgba(26, 23, 20, 0.05), 0 2px 8px rgba(26, 23, 20, 0.04);
  --shadow-md: 0 6px 18px rgba(26, 23, 20, 0.08), 0 2px 6px rgba(26, 23, 20, 0.05);
  --shadow-lg: 0 24px 60px rgba(26, 23, 20, 0.14);
  --sel: rgba(154, 106, 46, 0.22);

  /* Fluid type scale */
  --step--1: clamp(0.83rem, 0.79rem + 0.18vw, 0.92rem);
  --step-0: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --step-3: clamp(1.9rem, 1.55rem + 1.7vw, 2.85rem);
  --step-4: clamp(2.4rem, 1.85rem + 2.8vw, 4rem);
  --step-5: clamp(3rem, 2.1rem + 4.4vw, 5.75rem);

  /* Spacing & layout */
  --container: 1180px;
  --container-narrow: 760px;
  --gutter: clamp(1.25rem, 0.7rem + 2.5vw, 3rem);
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --nav-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: light;
}

html[data-theme="dark"] {
  --paper: #131110;
  --paper-2: #1b1815;
  --surface: #1f1b18;
  --ink: #f3ede1;
  --ink-2: #cbc3b4;
  --muted: #9b9284;
  --accent: #cf9f57;
  --accent-2: #e2b878;
  --accent-soft: rgba(207, 159, 87, 0.15);
  --line: rgba(243, 237, 225, 0.13);
  --line-strong: rgba(243, 237, 225, 0.26);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.6);
  --sel: rgba(207, 159, 87, 0.3);
  color-scheme: dark;
}

/* Arabic typography swap */
html[lang="ar"] {
  --font-display: "IBM Plex Sans Arabic", "Tajawal", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Arabic", "Tajawal", system-ui, sans-serif;
  --font-mono: "IBM Plex Sans Arabic", system-ui, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}
::selection { background: var(--sel); }

img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
ul, ol { list-style: none; padding: 0; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- Headings ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.08; letter-spacing: -0.015em; color: var(--ink); }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4 { letter-spacing: 0; line-height: 1.3; font-weight: 700; }
.h-display { font-size: var(--step-5); font-weight: 400; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

/* ---------- Layout primitives ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: var(--container-narrow); }
.section { padding-block: clamp(3.5rem, 2rem + 7vw, 8rem); }
.section--tight { padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem); }
.divider { height: 1px; background: var(--line); border: 0; }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
html[lang="ar"] .eyebrow { letter-spacing: 0.04em; }
.eyebrow::before { content: ""; width: 1.8em; height: 1px; background: var(--accent); opacity: 0.6; }

.lede { font-size: var(--step-1); line-height: 1.55; color: var(--ink-2); font-weight: 400; }
.muted { color: var(--muted); }
.measure { max-width: 62ch; }

.section-head { margin-bottom: clamp(2rem, 1rem + 3vw, 3.5rem); }
.section-head h2 { margin-top: 0.5rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  padding: 0.85em 1.5em; border-radius: var(--radius-pill);
  font-weight: 600; font-size: var(--step-0); line-height: 1;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  border: 1px solid transparent; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 1.1em; height: 1.1em; }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--accent-2); box-shadow: var(--shadow-md); }
html[data-theme="dark"] .btn--primary { background: var(--accent); color: #1a1410; }
html[data-theme="dark"] .btn--primary:hover { background: var(--accent-2); }
.btn--ghost { border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-2); box-shadow: var(--shadow-md); }

.link-arrow { display: inline-flex; align-items: center; gap: 0.5em; font-weight: 600; color: var(--accent); }
.link-arrow svg { width: 1em; height: 1em; transition: transform 0.25s var(--ease); }
.link-arrow:hover svg { transform: translateX(0.3em); }
html[dir="rtl"] .link-arrow svg { transform: scaleX(-1); }
html[dir="rtl"] .link-arrow:hover svg { transform: scaleX(-1) translateX(0.3em); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-block-end: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.site-header.scrolled { border-block-end-color: var(--line); box-shadow: var(--shadow-sm); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; width: 100%; }
.brand { display: flex; align-items: center; gap: 0.7rem; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.brand .mark {
  width: 38px; height: 38px; flex: none; border-radius: 11px;
  display: grid; place-items: center; color: var(--paper); background: var(--ink);
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 600;
  transition: background 0.3s var(--ease), transform 0.4s var(--ease);
}
html[data-theme="dark"] .brand .mark { background: var(--accent); color: #1a1410; }
.brand:hover .mark { transform: rotate(-6deg); }
.brand small { display: block; font-family: var(--font-body); font-size: 0.6rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
html[lang="ar"] .brand small { letter-spacing: 0.04em; }

.nav-links { display: flex; align-items: center; gap: 0.35rem; }
.nav-links a {
  position: relative; padding: 0.5rem 0.85rem; border-radius: var(--radius-pill);
  font-size: 0.95rem; font-weight: 500; color: var(--ink-2);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-links a:hover { color: var(--ink); background: var(--accent-soft); }
.nav-links a.active { color: var(--accent); }

/* Dropdown groups */
.nav-group { position: relative; }
.nav-trigger {
  display: flex; align-items: center; gap: 0.3em;
  padding: 0.5rem 0.85rem; border-radius: var(--radius-pill);
  font-size: 0.95rem; font-weight: 500; color: var(--ink-2);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-trigger:hover { color: var(--ink); background: var(--accent-soft); }
.nav-trigger.parent-active { color: var(--accent); }
.nav-trigger .chev { display: inline-flex; opacity: 0.7; transition: transform 0.25s var(--ease); }
.nav-trigger .chev svg { width: 13px; height: 13px; }
.nav-group:hover .nav-trigger .chev, .nav-group:focus-within .nav-trigger .chev, .nav-group.open .nav-trigger .chev { transform: rotate(180deg); }
.nav-menu {
  position: absolute; inset-block-start: calc(100% + 8px); inset-inline-start: 0;
  min-width: 230px; padding: 0.5rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; gap: 2px; z-index: 110;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
}
.nav-menu::before { content: ""; position: absolute; inset-block-start: -10px; inset-inline: 0; height: 10px; }
.nav-group:hover .nav-menu, .nav-group:focus-within .nav-menu, .nav-group.open .nav-menu {
  opacity: 1; visibility: visible; transform: none;
}
.nav-menu a {
  padding: 0.6rem 0.8rem; border-radius: 10px; font-size: 0.92rem; font-weight: 500;
  color: var(--ink-2); white-space: nowrap; transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-menu a:hover { background: var(--accent-soft); color: var(--accent); }
.nav-menu a.active { color: var(--accent); }

/* Mobile grouped sections */
.mnav-group { display: flex; flex-direction: column; margin-block: 0.3rem; }
.mnav-label { font-family: var(--font-body); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); padding: 0.9rem 0 0.3rem; }
html[lang="ar"] .mnav-label { letter-spacing: 0.04em; }
.mobile-nav a.mnav-sub { font-size: var(--step-1); border-block-end: 1px solid var(--line); }

.nav-actions { display: flex; align-items: center; gap: 0.5rem; }
.icon-btn {
  width: 42px; height: 42px; border-radius: var(--radius-pill);
  display: grid; place-items: center; color: var(--ink-2);
  border: 1px solid var(--line); transition: all 0.2s var(--ease);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }
.lang-btn { width: auto; padding-inline: 0.95rem; font-weight: 600; font-size: 0.85rem; letter-spacing: 0.04em; gap: 0.4em; }

.nav-toggle { display: none; }

/* Mobile nav */
.mobile-nav {
  position: fixed; inset: 0; z-index: 99;
  background: var(--paper); padding: calc(var(--nav-h) + 2rem) var(--gutter) 2rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  transform: translateY(-100%); opacity: 0; pointer-events: none;
  transition: transform 0.5s var(--ease), opacity 0.4s var(--ease);
  overflow-y: auto;
}
.mobile-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.mobile-nav a {
  font-family: var(--font-display); font-size: var(--step-2); padding: 0.5rem 0;
  border-block-end: 1px solid var(--line); color: var(--ink);
  display: flex; justify-content: space-between; align-items: center;
}
.mobile-nav a .idx { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: calc(var(--nav-h) + clamp(2.5rem, 5vw, 5rem)) clamp(3rem, 6vw, 6rem); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.25fr 0.85fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.hero-tag { margin-bottom: 1.5rem; }
.hero h1 { margin-bottom: 1.5rem; }
.hero h1 .accent { color: var(--accent); font-style: italic; }
.hero .lede { max-width: 52ch; margin-bottom: 2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }
.hero-stats { display: flex; flex-wrap: wrap; gap: clamp(1.5rem, 4vw, 3rem); margin-top: clamp(2.5rem, 5vw, 4rem); padding-top: 2rem; border-top: 1px solid var(--line); }
.stat .n { font-family: var(--font-display); font-size: var(--step-3); line-height: 1; color: var(--ink); display: block; }
.stat .l { font-size: var(--step--1); color: var(--muted); margin-top: 0.4rem; letter-spacing: 0.02em; }

.portrait {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  aspect-ratio: 4 / 5; background: var(--paper-2); box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  background:
    radial-gradient(120% 90% at 70% 10%, var(--accent-soft), transparent 55%),
    linear-gradient(160deg, var(--paper-2), var(--surface));
  color: var(--muted); padding: 2rem;
}
.portrait-fallback .initials { font-family: var(--font-display); font-size: clamp(4rem, 12vw, 7rem); color: var(--accent); opacity: 0.85; }
.portrait-badge {
  position: absolute; inset-block-end: 1rem; inset-inline: 1rem;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.8rem 1.1rem; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 0.7rem; font-size: 0.85rem;
}
.portrait-badge .dot { width: 9px; height: 9px; border-radius: 50%; background: #2ea043; box-shadow: 0 0 0 4px rgba(46,160,67,0.18); flex: none; }
.portrait-badge strong { font-weight: 600; }

/* decorative marquee of expertise */
.marquee { border-block: 1px solid var(--line); padding-block: 1.1rem; overflow: hidden; white-space: nowrap; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: inline-flex; gap: 3rem; animation: marquee 38s linear infinite; will-change: transform; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font-family: var(--font-display); font-size: var(--step-1); color: var(--ink-2); display: inline-flex; align-items: center; gap: 3rem; }
.marquee span::after { content: "✶"; color: var(--accent); font-size: 0.7em; }
@keyframes marquee { to { transform: translateX(-50%); } }
html[dir="rtl"] .marquee-track { animation-name: marquee-rtl; }
@keyframes marquee-rtl { to { transform: translateX(50%); } }

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: clamp(1.25rem, 2.5vw, 2rem); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.2rem);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
  position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.card h3 { margin-bottom: 0.6rem; }
.card .card-ico { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 1.2rem; }
.card .card-ico svg { width: 24px; height: 24px; }
.card-meta { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.05em; color: var(--accent); text-transform: uppercase; margin-bottom: 0.8rem; }

/* feature project card */
.project-card { display: flex; flex-direction: column; min-height: 260px; }
.project-card .tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; padding-top: 1.2rem; }
.tag { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; padding: 0.3em 0.75em; border-radius: var(--radius-pill); background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); }
.project-card .yr { font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted); }

/* ---------- Timeline ---------- */
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; inset-block: 0.5rem 0; inset-inline-start: 7px; width: 2px; background: linear-gradient(var(--accent), var(--line)); }
.tl-item { position: relative; padding-inline-start: 2.5rem; padding-bottom: 2.5rem; }
.tl-item::before { content: ""; position: absolute; inset-inline-start: 0; inset-block-start: 0.45rem; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }
.tl-item:last-child { padding-bottom: 0; }
.tl-yr { font-family: var(--font-mono); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em; color: var(--accent); }
.tl-role { font-family: var(--font-display); font-size: var(--step-1); margin: 0.25rem 0 0.2rem; }
.tl-org { color: var(--ink-2); font-weight: 500; }
.tl-loc { color: var(--muted); font-size: var(--step--1); }
.tl-desc { margin-top: 0.8rem; color: var(--ink-2); }
.tl-desc li { position: relative; padding-inline-start: 1.3em; margin-bottom: 0.4rem; }
.tl-desc li::before { content: ""; position: absolute; inset-inline-start: 0; inset-block-start: 0.7em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0.7; }

/* ---------- Publications ---------- */
.pub-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.chip { padding: 0.5em 1.1em; border-radius: var(--radius-pill); border: 1px solid var(--line); font-size: 0.85rem; font-weight: 600; color: var(--ink-2); transition: all 0.2s var(--ease); }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
html[data-theme="dark"] .chip.active { background: var(--accent); color: #1a1410; border-color: var(--accent); }
.pub { display: grid; grid-template-columns: 90px 1fr; gap: 1.5rem; padding: 1.5rem 0; border-block-end: 1px solid var(--line); transition: opacity 0.3s var(--ease); }
.pub .pub-yr { font-family: var(--font-mono); font-size: 1.05rem; color: var(--accent); font-weight: 600; }
.pub .pub-type { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-top: 0.3rem; }
.pub .pub-title { font-family: var(--font-display); font-size: var(--step-1); line-height: 1.25; margin-bottom: 0.35rem; }
.pub .pub-venue { color: var(--ink-2); font-size: 0.95rem; }
.pub .pub-authors { color: var(--muted); font-size: 0.9rem; margin-top: 0.2rem; }
.pub.hide { display: none; }

/* ---------- Teaching / material cards ---------- */
.subject-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.subject-tags .tag { font-size: 0.82rem; padding: 0.45em 0.9em; }
.empty-state { text-align: center; padding: clamp(2.5rem, 6vw, 5rem) 1rem; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--paper-2); }
.empty-state .card-ico { margin: 0 auto 1.2rem; }

/* ---------- Services / pricing ---------- */
.service-card { display: flex; flex-direction: column; }
.service-card ul { margin-top: 1.2rem; display: grid; gap: 0.7rem; }
.service-card ul li { display: flex; gap: 0.7rem; align-items: flex-start; color: var(--ink-2); }
.service-card ul li svg { width: 1.1em; height: 1.1em; color: var(--accent); flex: none; margin-top: 0.25em; }
.service-card .price { font-family: var(--font-display); font-size: var(--step-2); margin: 0.5rem 0; }
.service-card .price small { font-size: 0.5em; color: var(--muted); font-family: var(--font-body); }
.service-card.featured { border-color: var(--accent); box-shadow: var(--shadow-md); }
.service-card.featured::after { content: ""; position: absolute; inset-block-start: 0; inset-inline: 0; height: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ---------- Contact / forms ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 4vw, 4rem); align-items: start; }
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.45rem; color: var(--ink-2); }
.field label .req { color: var(--accent); }
.field input, .field textarea, .field select {
  width: 100%; padding: 0.85em 1em; font: inherit; font-size: var(--step-0);
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field .err { display: none; color: #c0392b; font-size: 0.8rem; margin-top: 0.35rem; }
.field.invalid input, .field.invalid textarea { border-color: #c0392b; }
.field.invalid .err { display: block; }
html[data-theme="dark"] .field .err, html[data-theme="dark"] .field.invalid input { color: #ff8a7a; border-color: #ff8a7a; }
.form-note { font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }
.form-status { padding: 1rem 1.2rem; border-radius: var(--radius); margin-bottom: 1.2rem; display: none; font-weight: 500; }
.form-status.show { display: block; }
.form-status.ok { background: rgba(46,160,67,0.12); color: #1e7e34; border: 1px solid rgba(46,160,67,0.3); }
.form-status.bad { background: rgba(192,57,43,0.1); color: #c0392b; border: 1px solid rgba(192,57,43,0.3); }

.contact-info { display: grid; gap: 1.2rem; }
.contact-line { display: flex; gap: 1rem; align-items: flex-start; }
.contact-line .card-ico { width: 44px; height: 44px; margin: 0; flex: none; }
.contact-line .l { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.contact-line .v { font-weight: 500; font-size: var(--step-0); }

.booking-embed { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm); background: var(--surface); }
.booking-embed iframe { width: 100%; min-height: 640px; border: 0; display: block; }
.booking-placeholder { padding: clamp(2.5rem, 6vw, 5rem) 2rem; text-align: center; background: var(--paper-2); }

/* ---------- Quote / statement block ---------- */
.statement { position: relative; padding-inline-start: 2rem; border-inline-start: 3px solid var(--accent); }
.statement p { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.35; font-style: italic; color: var(--ink); }
html[lang="ar"] .statement p { font-style: normal; }
.statement cite { display: block; margin-top: 1.2rem; font-family: var(--font-body); font-style: normal; font-size: 0.95rem; color: var(--muted); }

/* CTA band */
.cta-band { background: var(--ink); color: var(--paper); border-radius: var(--radius-lg); padding: clamp(2.5rem, 5vw, 4.5rem); text-align: center; position: relative; overflow: hidden; }
.cta-band::before { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 120% at 50% -20%, rgba(207,159,87,0.25), transparent 60%); }
.cta-band > * { position: relative; }
.cta-band h2 { color: var(--paper); }
html[data-theme="dark"] .cta-band { background: var(--surface); border: 1px solid var(--line); }
html[data-theme="dark"] .cta-band h2 { color: var(--ink); }
.cta-band .lede { color: rgba(250,247,240,0.8); margin: 1rem auto 2rem; }
html[data-theme="dark"] .cta-band .lede { color: var(--ink-2); }

/* ---------- Footer ---------- */
.site-footer { background: var(--paper-2); border-block-start: 1px solid var(--line); padding-block: clamp(3rem, 5vw, 4.5rem) 2rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 3rem; }
.footer-grid h4 { font-family: var(--font-body); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin-bottom: 1.1rem; font-weight: 600; }
.footer-grid a { display: block; padding: 0.3rem 0; color: var(--ink-2); font-size: 0.95rem; transition: color 0.2s var(--ease); }
.footer-grid a:hover { color: var(--accent); }
.footer-brand p { color: var(--ink-2); max-width: 34ch; margin-top: 1rem; font-size: 0.95rem; }
.social-row { display: flex; gap: 0.6rem; margin-top: 1.4rem; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; padding-top: 2rem; border-block-start: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); }

/* ---------- Page hero (interior) ---------- */
.page-hero { padding-block: calc(var(--nav-h) + clamp(2.5rem, 5vw, 4.5rem)) clamp(2rem, 4vw, 3.5rem); }
.page-hero h1 { margin: 0.8rem 0 1.2rem; max-width: 18ch; }
.breadcrumb { font-size: 0.85rem; color: var(--muted); display: flex; gap: 0.5rem; align-items: center; }
.breadcrumb a:hover { color: var(--accent); }

/* prose */
.prose p { margin-bottom: 1.3rem; color: var(--ink-2); }
.prose p:first-of-type::first-letter { font-family: var(--font-display); font-size: 3.4em; float: inline-start; line-height: 0.8; padding-inline-end: 0.08em; padding-block-start: 0.05em; color: var(--accent); }
html[lang="ar"] .prose p:first-of-type::first-letter { font-size: 1em; float: none; padding: 0; color: inherit; }

/* ---------- Blog / Insights ---------- */
.post-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.post-card .post-cover { aspect-ratio: 16 / 9; }
.post-card .post-card-body { padding: clamp(1.3rem, 2.5vw, 1.8rem); display: flex; flex-direction: column; flex: 1; }
.post-card h3 { font-family: var(--font-display); font-size: var(--step-1); line-height: 1.3; margin: 0.5rem 0 0.6rem; }
.post-card[lang="ar"] h3 { font-weight: 700; }
.post-card .excerpt { color: var(--ink-2); font-size: 0.95rem; flex: 1; }
.post-card[lang="ar"] .excerpt { line-height: 1.8; }
.post-card .post-meta { display: flex; gap: 0.8rem; align-items: center; margin-top: 1.2rem; font-size: 0.8rem; color: var(--muted); }
.post-card .post-meta .cat { color: var(--accent); font-weight: 600; }

/* Generated cover art (no stock images needed) */
.post-cover {
  position: relative; overflow: hidden; background: var(--ink);
  display: grid; place-items: center;
}
.post-cover::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(207,159,87,0.35) 1.2px, transparent 1.2px);
  background-size: 22px 22px; opacity: 0.5;
  -webkit-mask-image: radial-gradient(120% 120% at 80% 10%, #000, transparent 70%);
  mask-image: radial-gradient(120% 120% at 80% 10%, #000, transparent 70%);
}
.post-cover .glyph { position: relative; font-family: "Fraunces", serif; font-size: clamp(2.5rem, 7vw, 4.5rem); color: var(--accent); opacity: 0.92; }
.post-cover .glyph svg { width: clamp(48px, 10vw, 80px); height: auto; }
.post-cover.v1 { background: linear-gradient(135deg, #1a1714, #2a2218); }
.post-cover.v2 { background: linear-gradient(135deg, #14110e, #3a2e1a); }
.post-cover.v3 { background: linear-gradient(135deg, #1c1a17, #243042); }
.post-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Single article page (bilingual: each language block carries its own lang/dir) */
.article-wrap { max-width: 760px; margin-inline: auto; }
.post-head { text-align: start; margin-bottom: 2rem; }
.post-head .cat { color: var(--accent); font-weight: 600; font-size: var(--step--1); letter-spacing: 0.04em; }
.post-head h1 { font-family: var(--font-display); margin: 1rem 0 1.4rem; font-size: clamp(1.9rem, 1.4rem + 2.4vw, 3.1rem); line-height: 1.3; }
html[lang="ar"] .post-head h1 { font-weight: 700; }
html:not([lang="ar"]) .post-head h1 { font-weight: 500; letter-spacing: -0.015em; }
.post-byline { display: flex; align-items: center; gap: 0.9rem; padding-block: 1.2rem; border-block: 1px solid var(--line); }
.post-byline .mark { width: 46px; height: 46px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-family: "Fraunces", serif; font-weight: 600; }
html[data-theme="dark"] .post-byline .mark { background: var(--accent); color: #1a1410; }
.post-byline .who { font-weight: 600; }
.post-byline .when { font-size: 0.85rem; color: var(--muted); }
.post-cover-lg { aspect-ratio: 21 / 9; border-radius: var(--radius-lg); margin-block: 2rem; box-shadow: var(--shadow-md); }

.article { color: var(--ink); }
.article[lang="en"] { font-family: "Inter", system-ui, sans-serif; font-size: 1.05rem; line-height: 1.8; }
.article[lang="ar"] { font-family: "IBM Plex Sans Arabic", "Tajawal", system-ui, sans-serif; font-size: 1.08rem; line-height: 1.95; }
.article h2, .article h3 { letter-spacing: -0.01em; line-height: 1.4; margin: 2.4rem 0 1rem; color: var(--ink); }
.article[lang="en"] h2, .article[lang="en"] h3 { font-family: "Fraunces", serif; font-weight: 500; }
.article[lang="ar"] h2, .article[lang="ar"] h3 { font-family: "IBM Plex Sans Arabic", sans-serif; font-weight: 700; }
.article h2 { font-size: var(--step-2); }
.article h3 { font-size: var(--step-1); }
.article p { margin-bottom: 1.3rem; color: var(--ink-2); }
.article strong { color: var(--ink); font-weight: 600; }
.article ul { margin: 0 0 1.4rem; display: grid; gap: 0.6rem; }
.article ul li { position: relative; padding-inline-start: 1.5em; color: var(--ink-2); }
.article ul li::before { content: ""; position: absolute; inset-inline-start: 0; inset-block-start: 0.75em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.article blockquote { margin: 1.8rem 0; padding: 1.2rem 1.5rem; border-inline-start: 4px solid var(--accent); background: var(--paper-2); border-radius: var(--radius); font-size: var(--step-1); line-height: 1.7; color: var(--ink); }
.article[lang="en"] blockquote { font-family: "Fraunces", serif; font-style: italic; }
.article[lang="ar"] blockquote { font-family: "IBM Plex Sans Arabic", sans-serif; font-weight: 500; }
.article table { width: 100%; border-collapse: collapse; margin: 1.6rem 0; font-size: 0.96rem; }
.article table th, .article table td { padding: 0.8rem 0.9rem; border: 1px solid var(--line); text-align: start; }
.article table th { background: var(--paper-2); font-weight: 600; color: var(--ink); }
.article table td strong { color: var(--accent); }

.post-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2.5rem; }
.post-sources { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.post-sources h2 { font-family: var(--font-display); font-size: var(--step-1); margin-bottom: 1rem; }
.post-sources ol { list-style: decimal; padding-inline-start: 1.4em; display: grid; gap: 0.9rem; }
.post-sources li { color: var(--ink-2); font-size: 0.92rem; line-height: 1.7; }
.post-sources a { color: var(--accent); word-break: break-word; }
.post-sources a:hover { text-decoration: underline; }

.post-share { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.post-share .lbl { font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.share-btn { display: inline-flex; align-items: center; gap: 0.5em; padding: 0.6em 1.1em; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); font-size: 0.9rem; font-weight: 600; transition: all 0.2s var(--ease); }
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.share-btn svg { width: 17px; height: 17px; }
.share-btn.li:hover { background: #0a66c2; color: #fff; border-color: #0a66c2; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; }
.post-nav a { padding: 1.2rem 1.4rem; border: 1px solid var(--line); border-radius: var(--radius); transition: all 0.25s var(--ease); }
.post-nav a:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.post-nav .dir { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.post-nav .ttl { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; margin-top: 0.4rem; line-height: 1.5; display: block; }
.post-nav a.next { text-align: end; }
@media (max-width: 560px) { .post-nav { grid-template-columns: 1fr; } }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: 0.08s; }
.reveal[data-d="2"] { transition-delay: 0.16s; }
.reveal[data-d="3"] { transition-delay: 0.24s; }
.reveal[data-d="4"] { transition-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* scroll progress bar */
.scroll-progress { position: fixed; inset-block-start: 0; inset-inline-start: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); z-index: 200; transition: width 0.1s linear; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-toggle { display: grid; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; max-width: 380px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  :root { --nav-h: 64px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .pub { grid-template-columns: 1fr; gap: 0.4rem; }
  .pub .pub-yr { font-size: 0.95rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-stats { gap: 1.5rem 2rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* print (CV) */
@media print {
  .site-header, .site-footer, .nav-actions, .cta-band, .scroll-progress { display: none !important; }
  body { background: #fff; color: #000; }
}
