/* Firas Mohammed — portfolio
   Self-hosted fonts, no external requests, light/dark aware.
   Type: Space Grotesk (display) + DM Sans (text) — same pairing as the CV PDF. */

@font-face {
  font-family: 'Space Grotesk';
  src: url('/assets/fonts/space-grotesk-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/assets/fonts/dm-sans-latin.woff2') format('woff2');
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  /* ink */
  --ink: #0f1419;
  --ink-soft: #4b5766;
  --ink-faint: #7b8797;
  /* surfaces */
  --bg: #fbfaf8;
  --panel: #ffffff;
  --panel-2: #f3f2ee;
  --line: #e4e2db;
  --line-strong: #d3d0c6;
  /* accent */
  --accent: #0d6e6b;
  --accent-deep: #095855;
  --accent-wash: #e7f1f0;
  /* data marks */
  --mark-before: #b9b6ac;
  --mark-after: var(--accent);

  --display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --text: 'DM Sans', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 14px;
  --maxw: 880px;
  --readw: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #edefec;
    --ink-soft: #a7b0b8;
    --ink-faint: #78828c;
    --bg: #0e1113;
    --panel: #14181b;
    --panel-2: #1a1f22;
    --line: #262c30;
    --line-strong: #333a3f;
    --accent: #5cc9bf;
    --accent-deep: #7ad8ce;
    --accent-wash: #12302e;
    --mark-before: #414a4e;
    --mark-after: var(--accent);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  /* Hero wash lives on the body box so it can never widen the page. An absolutely
     positioned pseudo-element with negative insets caused horizontal scroll. */
  background-color: var(--bg);
  background-image: radial-gradient(70% 38% at 50% 0%, color-mix(in srgb, var(--accent) 13%, transparent) 0%, transparent 72%);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.wrap.read { max-width: var(--readw); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── header ─────────────────────────────────────────── */
header.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
header.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 15px;
  padding-bottom: 15px;
}
.brand {
  font-family: var(--display);
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
nav.top-nav { display: flex; gap: 22px; font-size: 15px; }
nav.top-nav a { color: var(--ink-soft); }
nav.top-nav a:hover { color: var(--accent); }
@media (max-width: 520px) { nav.top-nav a.hide-sm { display: none; } }

/* ── hero ───────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 96px 0 56px;
}
/* photo + eyebrow sit on one line on desktop, stack on small screens */
.hero-id {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 26px;
}
.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 1px solid var(--line);
  box-shadow: 0 2px 10px -4px rgba(0, 0, 0, 0.35);
  background: var(--panel-2);
}
@media (max-width: 560px) {
  .hero-id { flex-direction: column; align-items: flex-start; gap: 16px; }
}

.eyebrow {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.eyebrow::after {
  content: '';
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 650;
  margin: 0 0 24px;
  text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede {
  font-size: 20px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 14px;
  max-width: 40em;
}
.hero .meta {
  font-size: 15px;
  color: var(--ink-faint);
  margin: 0 0 32px;
  font-variant-numeric: tabular-nums;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 550;
  letter-spacing: -0.01em;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }

/* ── stat tiles ─────────────────────────────────────── */
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 8px 0 4px;
}
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  position: relative;
  overflow: hidden;
}
.metric::after {
  content: '';
  position: absolute;
  inset-inline-start: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0.85;
}
.metric .num {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.03em;
  display: block;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.metric .num .was { color: var(--ink-faint); }
.metric .num .to { color: var(--ink-faint); margin: 0 2px; font-weight: 400; }
.metric .label { font-size: 14.5px; color: var(--ink-soft); line-height: 1.5; }
@media (max-width: 720px) { .metrics { grid-template-columns: 1fr; } }

/* ── sections ───────────────────────────────────────── */
section { padding: 62px 0; }
section + section { border-top: 1px solid var(--line); }
h2 {
  font-family: var(--display);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  font-weight: 620;
  margin: 0 0 28px;
}
h3 {
  font-family: var(--display);
  font-size: 21px;
  line-height: 1.3;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  font-weight: 620;
}
p { margin: 0 0 18px; }
p:last-child { margin-bottom: 0; }

/* Intro paragraph under a section heading. Sits above the card grid, so it
   carries the section's framing without competing with the card titles. */
.section-lede {
  font-size: 17.5px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 42em;
  margin: -6px 0 28px;
}
.section-lede em { font-style: italic; color: var(--ink); }

.tags-note {
  margin-top: 26px;
  color: var(--ink-soft);
  max-width: 42em;
}

/* ── case cards ─────────────────────────────────────── */
.cases { display: grid; gap: 16px; }
.card {
  position: relative;
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 30px;
  color: var(--ink);
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.45);
}
.card .idx {
  position: absolute;
  inset-inline-end: 22px;
  top: 14px;
  font-family: var(--display);
  font-size: 54px;
  font-weight: 650;
  letter-spacing: -0.04em;
  color: var(--ink);
  opacity: 0.055;
  line-height: 1;
}
.card .kicker {
  font-family: var(--display);
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 620;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.card p { color: var(--ink-soft); font-size: 16px; margin: 0; max-width: 54em; }
.card .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
}
.card .result {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 620;
  background: var(--accent-wash);
  color: var(--accent);
  padding: 6px 13px;
  border-radius: 999px;
  white-space: nowrap;
}
.card .go { color: var(--ink-faint); font-size: 15px; }
.card:hover .go { color: var(--accent); }

/* Some result pills carry three facts rather than a before/after pair, which is
   wider than the phone viewport. Let the footer stack and the pill wrap there —
   nowrap is only worth keeping while the line actually fits. */
@media (max-width: 620px) {
  .card .foot { flex-direction: column; align-items: flex-start; gap: 10px; }
  .card .result { white-space: normal; }
}

/* ── lists ──────────────────────────────────────────── */
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}
ul.plain li:last-child { border-bottom: none; }
ul.plain li b { color: var(--ink); font-weight: 620; font-family: var(--display); letter-spacing: -0.01em; }

ul.bullets, ol.steps { padding-inline-start: 22px; margin: 0 0 18px; color: var(--ink-soft); }
ul.bullets li, ol.steps li { margin-bottom: 12px; padding-inline-start: 4px; }
ol.steps li::marker { color: var(--accent); font-family: var(--display); font-weight: 650; }
ul.bullets li::marker { color: var(--accent); }

.tags { display: flex; flex-wrap: wrap; gap: 9px; }
.tag {
  font-size: 14px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--panel);
}

/* ── case page ──────────────────────────────────────── */
.back { font-size: 15px; color: var(--ink-faint); display: inline-block; margin-bottom: 30px; }
.back:hover { color: var(--accent); }
.case-head { padding: 62px 0 10px; position: relative; }
.case-head .kicker {
  font-family: var(--display);
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 620;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.case-head h1 {
  font-family: var(--display);
  font-size: clamp(29px, 5vw, 42px);
  line-height: 1.13;
  letter-spacing: -0.032em;
  margin: 0 0 18px;
  font-weight: 650;
  text-wrap: balance;
}
.case-head .sub { font-size: 19px; line-height: 1.6; color: var(--ink-soft); margin: 0; }
.case-head .where {
  font-size: 14px;
  color: var(--ink-faint);
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--display);
  letter-spacing: 0.01em;
}

.block { padding: 38px 0; border-top: 1px solid var(--line); }
.block h2 { margin-bottom: 16px; }

/* ── result figure: single measure, before vs after ─── */
.figure {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin: 28px 0;
}
.figure .cap {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 620;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
  color: var(--ink);
}
.bars { display: grid; gap: 14px; }
.bar-row {
  display: grid;
  grid-template-columns: 62px 1fr;
  align-items: center;
  gap: 14px;
}
.bar-row .name {
  font-size: 13.5px;
  color: var(--ink-faint);
  text-align: end;
  font-variant-numeric: tabular-nums;
}
.bar-track { position: relative; height: 26px; display: flex; align-items: center; }
.bar {
  height: 26px;
  border-start-end-radius: 4px;
  border-end-end-radius: 4px;
  background: var(--mark-before);
  min-width: 4px;
}
.bar.after { background: var(--mark-after); }
.bar-val {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 620;
  margin-inline-start: 10px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.figure .note { font-size: 14px; color: var(--ink-faint); margin: 18px 0 0; }

.callout {
  background: linear-gradient(180deg, var(--accent-wash), transparent 140%);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: var(--radius);
  padding: 26px 28px;
  margin: 28px 0;
}
.callout .big {
  font-family: var(--display);
  font-size: clamp(26px, 4.4vw, 34px);
  font-weight: 650;
  letter-spacing: -0.035em;
  display: block;
  margin-bottom: 8px;
  line-height: 1.15;
}
.callout .big .was { color: var(--ink-faint); }
.callout .big .to { color: var(--ink-faint); font-weight: 400; }
.callout p { color: var(--ink-soft); font-size: 15.5px; margin: 0; }

.reflection {
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.55;
  letter-spacing: -0.015em;
  color: var(--ink);
  border-inline-start: 3px solid var(--accent);
  padding-inline-start: 22px;
  margin: 0;
}

.next {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 30px 0 0;
  border-top: 1px solid var(--line);
  font-size: 16px;
  font-family: var(--display);
  letter-spacing: -0.01em;
}

/* ── footer ─────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 44px 0 72px;
  color: var(--ink-faint);
  font-size: 15px;
  background: var(--panel-2);
}
footer .links { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 16px; }

@media print {
  header.top, .actions, .next, footer .links { display: none; }
  body { background: #fff; color: #000; font-size: 12pt; }
}

/* 2026-10-20: competency summary under the Built cards */
.built-h3 { margin: 36px 0 12px; font-size: 1.05rem; }

/* ── 2026-11-07: bilingual site, services, notes ─────── */
@font-face {
  font-family: 'Plex Arabic';
  src: url('/assets/fonts/plex-arabic-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Plex Arabic';
  src: url('/assets/fonts/plex-arabic-600.woff2') format('woff2');
  font-weight: 600 700;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

.skip { position: absolute; inset-inline-start: -9999px; top: 8px; z-index: 50; background: var(--panel); padding: 8px 14px; border-radius: 8px; }
.skip:focus { inset-inline-start: 12px; }

nav.top-nav { align-items: center; }
nav.top-nav a.lang {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px 12px;
  color: var(--ink);
  font-size: 14px;
}
nav.top-nav a.lang:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
@media (max-width: 420px) { nav.top-nav { gap: 14px; } }

/* services */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.service {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
}
.service h3 { font-size: 18px; }
.service p { color: var(--ink-soft); font-size: 15.5px; margin-bottom: 14px; }
.service .proof { margin-top: auto; margin-bottom: 0; font-size: 14px; color: var(--ink-faint); }
.services-cta { margin-top: 24px; color: var(--ink-soft); }
@media (max-width: 760px) { .services { grid-template-columns: 1fr; } }

.more { margin-top: 20px; font-family: var(--display); }
.meta-sm { font-size: 14px; color: var(--ink-faint); }
section.flush { padding-top: 10px; }
section.flush + section, .case-head + section.flush { border-top: none; }

.block h3 { font-size: 18px; margin-top: 22px; }
.block h3:first-of-type { margin-top: 0; }
code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 0.88em;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}
pre {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 18px;
  direction: ltr;
  text-align: left;
}
pre code { background: none; border: none; padding: 0; font-size: inherit; }

.author-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 38px;
  padding: 22px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.author-box img { border-radius: 50%; flex: none; }
.author-box p { font-size: 15.5px; color: var(--ink-soft); margin-bottom: 8px; }
.author-box .ab-h { font-family: var(--display); color: var(--ink); font-weight: 620; margin-bottom: 4px; }

footer .links.small { font-size: 14px; gap: 14px 20px; }

/* ── Arabic / right-to-left ─────────────────────────── */
html[dir="rtl"] {
  --display: 'Plex Arabic', 'Space Grotesk', 'Segoe UI', Tahoma, sans-serif;
  --text: 'Plex Arabic', 'DM Sans', 'Segoe UI', Tahoma, sans-serif;
}
html[dir="rtl"] body { line-height: 1.85; }
/* Arabic letters must join: no tracking, no forced case anywhere. */
html[dir="rtl"] *, html[dir="rtl"] *::before, html[dir="rtl"] *::after { letter-spacing: 0 !important; }
html[dir="rtl"] h2,
html[dir="rtl"] .eyebrow,
html[dir="rtl"] .kicker { text-transform: none; font-size: 14.5px; }
html[dir="rtl"] .hero h1 { line-height: 1.35; }
html[dir="rtl"] .case-head h1 { line-height: 1.4; }
html[dir="rtl"] .callout .big, html[dir="rtl"] .metric .num { line-height: 1.4; }
html[dir="rtl"] .eyebrow::after { background: linear-gradient(270deg, var(--line-strong), transparent); }
html[dir="rtl"] .metric .num, html[dir="rtl"] .callout .big { text-align: right; }
html[dir="rtl"] .metric .num { white-space: normal; }
