/* Mohamed Ali Belajouza — personal brand
   Default theme: Light Editorial (:root + data-theme="light") */
:root, [data-theme="light"] {
  --bg: #f7f4ef;
  --bg2: #fff;
  --card: #ffffff;
  --card2: #f3efe8;
  --text: #0f172a;
  --muted: #475569;
  --faint: #94a3b8;
  --accent: #b45309;
  --accent2: #d97706;
  --accent-ink: #fff7ed;
  --link: #0f766e;
  --line: rgba(15,23,42,.1);
  --glow: rgba(180,83,9,.12);
  --hero-grad: linear-gradient(135deg, #f7f4ef 0%, #fff 55%, #fef3c7 100%);
  --nav-bg: rgba(247,244,239,.9);
  --shadow: 0 18px 40px rgba(15,23,42,.08);
  --radius: 20px;
  --font: "Segoe UI", Inter, system-ui, -apple-system, "Noto Sans Arabic", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
[data-theme="midnight"] {
  --bg: #060b1d;
  --bg2: #0a1028;
  --card: #0c1433;
  --card2: #111d45;
  --text: #eef2ff;
  --muted: #8b9cc7;
  --faint: #5a6b94;
  --accent: #f0b429;
  --accent2: #fbbf24;
  --accent-ink: #1c0a00;
  --link: #4dabf7;
  --line: rgba(255,255,255,.08);
  --glow: rgba(240,180,41,.2);
  --hero-grad: linear-gradient(135deg, #060b1d 0%, #0c1433 50%, #111d45 100%);
  --nav-bg: rgba(6,11,29,.82);
  --shadow: 0 24px 60px rgba(0,0,0,.35);
  color-scheme: dark;
}
[data-theme="desert"] {
  --bg: #1a120b;
  --bg2: #24180f;
  --card: #2c1d12;
  --card2: #3a2718;
  --text: #faf3e8;
  --muted: #c4a574;
  --faint: #8a6a42;
  --accent: #e8b86d;
  --accent2: #f0c987;
  --accent-ink: #1a120b;
  --link: #7dd3c0;
  --line: rgba(232,184,109,.15);
  --glow: rgba(232,184,109,.18);
  --hero-grad: linear-gradient(145deg, #1a120b 0%, #2c1d12 45%, #3a2718 100%);
  --nav-bg: rgba(26,18,11,.88);
  --shadow: 0 24px 50px rgba(0,0,0,.4);
  color-scheme: dark;
}
[data-theme="siyada"] {
  --bg: #042f2e;
  --bg2: #0f3d3a;
  --card: #115e59;
  --card2: #0f766e;
  --text: #ecfdf5;
  --muted: #99f6e4;
  --faint: #5eead4;
  --accent: #fbbf24;
  --accent2: #fde68a;
  --accent-ink: #134e4a;
  --link: #a7f3d0;
  --line: rgba(153,246,228,.18);
  --glow: rgba(251,191,36,.2);
  --hero-grad: linear-gradient(135deg, #042f2e 0%, #0f766e 55%, #115e59 100%);
  --nav-bg: rgba(4,47,46,.88);
  --shadow: 0 24px 50px rgba(0,0,0,.3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background .35s ease, color .25s ease;
}
body.rtl { direction: rtl; }
img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem 4rem; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(16px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1120px; margin: 0 auto;
  padding: .75rem 1.25rem;
  display: flex; align-items: center; gap: .85rem; flex-wrap: wrap;
  justify-content: space-between;
}
.logo {
  display: flex; align-items: center; gap: .65rem;
  color: var(--text); font-weight: 800; text-decoration: none;
}
.logo img {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}
.logo small { display: block; font-weight: 600; font-size: .7rem; color: var(--muted); letter-spacing: .03em; }
.nav-links { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.nav-links a {
  color: var(--muted); font-weight: 650; font-size: .88rem;
  padding: .4rem .7rem; border-radius: 999px; text-decoration: none;
}
.nav-links a:hover, .nav-links a.active { background: var(--glow); color: var(--text); }
.nav-tools { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--card);
  color: var(--text); border-radius: 999px; padding: .35rem .65rem;
  font-size: .78rem; font-weight: 700; cursor: pointer;
}
.chip:hover, .chip.active { border-color: var(--accent); color: var(--accent); }
.theme-wrap { position: relative; }
.theme-panel {
  display: none; position: absolute; top: calc(100% + 8px); inset-inline-end: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: .5rem; min-width: 160px; box-shadow: var(--shadow); z-index: 60;
}
.theme-panel.open { display: grid; gap: .3rem; }
.theme-opt {
  border: 0; background: transparent; color: var(--text); text-align: start;
  padding: .5rem .65rem; border-radius: 10px; cursor: pointer; font-weight: 650; font-size: .85rem;
}
.theme-opt:hover, .theme-opt.active { background: var(--glow); color: var(--accent); }
.menu-btn { display: none; }

/* Hero */
.hero {
  margin: 1.5rem 0 2rem;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 2rem; align-items: center;
  background: var(--hero-grad);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 2rem 2rem 2rem 2.25rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.hero::before {
  content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%;
  background: var(--glow); filter: blur(40px); inset-inline-end: -80px; top: -60px; pointer-events: none;
}
.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--glow); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent); font-size: .78rem; font-weight: 800; padding: .35rem .75rem;
  border-radius: 999px; margin-bottom: 1rem; letter-spacing: .02em;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.hero h1 {
  margin: 0 0 .75rem; font-size: clamp(2rem, 4.5vw, 3.1rem);
  letter-spacing: -.03em; line-height: 1.08; max-width: 14ch;
}
.hero h1 span { color: var(--accent); }
.hero .thesis {
  margin: 0 0 1.25rem; color: var(--muted); font-size: 1.08rem; max-width: 38ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.4rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 0; border-radius: 12px; padding: .85rem 1.15rem; font-weight: 800; font-size: .92rem;
  cursor: pointer; text-decoration: none !important; transition: transform .15s ease, filter .15s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); text-decoration: none !important; }
.btn-primary { background: linear-gradient(180deg, var(--accent2), var(--accent)); color: var(--accent-ink); box-shadow: 0 10px 24px var(--glow); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-soft { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.stats { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; }
.stat b { display: block; font-size: 1.45rem; color: var(--accent); letter-spacing: -.02em; }
.stat span { font-size: .82rem; color: var(--muted); }
.hero-visual { position: relative; justify-self: end; width: min(100%, 380px); }
.portrait-frame {
  position: relative; border-radius: 28px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px rgba(0,0,0,.35), 0 0 0 1px var(--glow);
  aspect-ratio: 3/4; background: var(--card);
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.float-tag {
  position: absolute; z-index: 2; background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(10px); border: 1px solid var(--line); color: var(--text);
  font-size: .75rem; font-weight: 800; padding: .45rem .7rem; border-radius: 999px;
  box-shadow: var(--shadow);
}
.float-tag--1 { top: 12%; inset-inline-start: -8%; }
.float-tag--2 { bottom: 22%; inset-inline-end: -6%; }
.float-tag--3 { bottom: 8%; inset-inline-start: 8%; }

/* Sections */
.section { margin: 2.5rem 0; }
.section-head { margin-bottom: 1.15rem; }
.eyebrow { color: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.section h2 { margin: .25rem 0 .4rem; font-size: clamp(1.4rem, 2.5vw, 1.85rem); letter-spacing: -.02em; }
.section .lead { margin: 0; color: var(--muted); max-width: 62ch; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: .85rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.25rem; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.card p, .card li { color: var(--muted); font-size: .95rem; }
.card ul { margin: .4rem 0 0; padding-inline-start: 1.1rem; }
.card.accent { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: color-mix(in srgb, var(--card) 88%, var(--accent)); }
.pill {
  display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; padding: .28rem .6rem; border-radius: 999px;
  background: var(--glow); color: var(--accent); margin-bottom: .55rem;
}
.quote {
  border-inline-start: 4px solid var(--accent);
  background: var(--card); padding: 1.1rem 1.25rem; border-radius: 0 16px 16px 0;
  color: var(--text); font-size: 1.05rem; margin: 1.25rem 0;
}
body.rtl .quote { border-radius: 16px 0 0 16px; }

.work-card {
  display: flex; flex-direction: column; gap: .5rem; min-height: 100%;
  transition: transform .15s ease, border-color .15s;
}
.work-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.work-card .meta { font-size: .8rem; color: var(--faint); font-weight: 650; }

.cta-band {
  margin: 2.5rem 0 1rem;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 18%, var(--card)), var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 24px; padding: 1.75rem 1.75rem;
  display: grid; grid-template-columns: 1.3fr .7fr; gap: 1.25rem; align-items: center;
}
.cta-band h2 { margin: 0 0 .4rem; }
.cta-band p { margin: 0; color: var(--muted); }

.footer {
  margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
  color: var(--faint); font-size: .88rem;
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
}
.footer a { color: var(--muted); }

/* Forms */
.form { display: grid; gap: .75rem; }
.form label { font-size: .82rem; font-weight: 700; color: var(--muted); }
.form input, .form textarea, .form select {
  width: 100%; border: 1px solid var(--line); background: var(--bg2);
  color: var(--text); border-radius: 12px; padding: .75rem .9rem; font: inherit;
}
.form textarea { min-height: 120px; resize: vertical; }

/* Page hero small */
.page-hero {
  margin: 1.5rem 0 1.5rem; padding: 1.75rem 1.75rem;
  border-radius: 24px; background: var(--hero-grad); border: 1px solid var(--line);
}
.page-hero h1 { margin: .3rem 0 .5rem; font-size: clamp(1.7rem, 3vw, 2.3rem); letter-spacing: -.02em; }
.page-hero p { margin: 0; color: var(--muted); max-width: 60ch; }

.proof-row {
  display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem;
}
.proof-row span {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  font-size: .75rem; font-weight: 750; padding: .4rem .7rem; border-radius: 999px;
}

@media (max-width: 900px) {
  .hero, .cta-band { grid-template-columns: 1fr; }
  .hero-visual { justify-self: center; width: min(100%, 320px); }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .menu-btn { display: inline-flex; }
  .nav-links { display: none; width: 100%; }
  .nav-links.open { display: flex; }
  .float-tag--1, .float-tag--2 { display: none; }
}
@media (max-width: 560px) {
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .hero { padding: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover, .work-card:hover { transform: none; }
}

/* Modal + toast */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.55);
  display: grid; place-items: center;
  padding: 1rem;
}
.modal-backdrop[hidden] { display: none !important; }
.modal {
  width: min(100%, 440px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.35rem 1.35rem 1.2rem;
  box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 .4rem; font-size: 1.15rem; }
.modal p { margin: 0 0 1rem; color: var(--muted); font-size: .92rem; }
.modal-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .85rem; }
.site-toast {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%) translateY(140%);
  background: var(--card2); color: var(--text); border: 1px solid var(--line);
  padding: .85rem 1.2rem; border-radius: 999px; font-weight: 750; font-size: .9rem;
  z-index: 120; transition: transform .25s ease; max-width: min(92vw, 420px); text-align: center;
  box-shadow: var(--shadow);
}
.site-toast.show { transform: translateX(-50%) translateY(0); }
.site-toast.ok { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.site-toast.err { border-color: #fb7185; color: #fb7185; }

/* Logo / proof wall */
.logo-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
  margin-top: 1rem;
}
.logo-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .55rem; min-height: 110px; padding: 1rem .75rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  text-align: center; transition: border-color .15s, transform .15s;
}
.logo-tile:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); }
.logo-tile img {
  max-width: 96px; max-height: 56px; width: auto; height: auto;
  object-fit: contain; filter: none;
  border-radius: 10px;
}
.logo-tile img.logo-square {
  max-width: 56px; max-height: 56px; border-radius: 12px;
  background: #fff; padding: 4px;
}
[data-theme="midnight"] .logo-tile img.invert-soft,
[data-theme="desert"] .logo-tile img.invert-soft,
[data-theme="siyada"] .logo-tile img.invert-soft {
  /* keep readable on dark cards */
}
.logo-tile span {
  font-size: .72rem; font-weight: 750; color: var(--muted); line-height: 1.25;
}
.role-card .logo-row {
  display: flex; align-items: center; gap: .75rem; margin-bottom: .65rem;
}
.role-card .logo-row img {
  width: 48px; height: 48px; object-fit: contain; border-radius: 10px;
  background: #fff; padding: 4px; border: 1px solid var(--line);
}

/* Stage / conference photo */
.stage-photo {
  margin: 0;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--card);
  position: relative;
  display: block;
}
.stage-photo img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
  object-position: center 25%;
  display: block;
}
.stage-photo figcaption,
.stage-photo__cta {
  display: block;
  padding: .85rem 1.1rem;
  font-size: .88rem;
  font-weight: 650;
  color: var(--muted);
}
.stage-photo--link {
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, transform .15s;
}
.stage-photo--link:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  transform: translateY(-2px);
  text-decoration: none;
}
.stage-photo--link .stage-photo__cta { color: var(--accent); }

.media-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
  align-items: stretch;
}
.media-grid .stage-photo img {
  max-height: 420px;
  min-height: 240px;
}
@media (max-width: 800px) {
  .media-grid { grid-template-columns: 1fr; }
}
