/* albara.ramli.net, 2026 */

:root {
  --paper: #f3f1ec;
  --paper-2: #ebe8e1;
  --card: #faf9f6;
  --ink: #15202b;
  --ink-2: #3d566b;
  --ink-3: #6b7f8f;
  --line: #d9d5cb;
  --line-2: #c6c1b5;
  --signal: #d9481f;
  --signal-soft: rgba(217, 72, 31, .1);
  --nav-bg: rgba(243, 241, 236, .82);
  --shadow: 0 1px 0 rgba(21, 32, 43, .04), 0 12px 32px -18px rgba(21, 32, 43, .28);

  --f-display: "Bricolage Grotesque", "Barlow", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --f-arabic: "IBM Plex Sans Arabic", "Geeza Pro", Tahoma, sans-serif;

  --gutter: clamp(20px, 5vw, 56px);
  --max: 1200px;
  --nav-h: 64px;
  --radius: 14px;
}

:root[data-theme="dark"] {
  --paper: #0d141b;
  --paper-2: #121b24;
  --card: #141e28;
  --ink: #ece9e2;
  --ink-2: #a9c0d2;
  --ink-3: #7c91a2;
  --line: #22303c;
  --line-2: #314250;
  --signal: #ff7a4d;
  --signal-soft: rgba(255, 122, 77, .13);
  --nav-bg: rgba(13, 20, 27, .8);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 16px 36px -20px rgba(0, 0, 0, .8);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d141b;
    --paper-2: #121b24;
    --card: #141e28;
    --ink: #ece9e2;
    --ink-2: #a9c0d2;
    --ink-3: #7c91a2;
    --line: #22303c;
    --line-2: #314250;
    --signal: #ff7a4d;
    --signal-soft: rgba(255, 122, 77, .13);
    --nav-bg: rgba(13, 20, 27, .8);
    --shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 16px 36px -20px rgba(0, 0, 0, .8);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--signal); color: #fff; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }

.mono, .eyebrow {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.ar { font-family: var(--f-arabic); direction: rtl; unicode-bidi: isolate; }

/* ---------- Nav ---------- */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s;
}
.nav.is-stuck { border-bottom-color: var(--line); }
.nav .wrap { height: 100%; display: flex; align-items: center; gap: 20px; }

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--paper);
  display: grid; place-items: center; font-family: var(--f-mono); font-size: 12px; font-weight: 600; letter-spacing: 0;
}

.nav-links { margin-inline-start: auto; display: flex; align-items: center; gap: 2px; }
.nav-links a {
  padding: 8px 11px; border-radius: 8px; font-size: 14.5px; color: var(--ink-2);
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--ink); background: var(--paper-2); }
.nav-links a.is-active { color: var(--ink); }
.nav-links a.is-active::after {
  content: ""; display: block; height: 2px; margin-top: 2px; background: var(--signal); border-radius: 2px;
}

.nav-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  color: var(--ink-2); border: 1px solid var(--line); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
}
.menu-btn { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 12px;
  font-weight: 500; font-size: 15.5px; border: 1px solid var(--ink);
  transition: transform .15s, background .15s, color .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn-ghost { border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.arrow { font-family: var(--f-mono); font-size: .9em; }

/* ---------- Hero ---------- */

.hero { padding-top: calc(var(--nav-h) + clamp(24px, 4.4vw, 56px)); padding-bottom: clamp(40px, 7vw, 88px); }

.hero-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: clamp(18px, 3vw, 30px); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 5px var(--signal-soft); }

.hero h1 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(2.3rem, 10.4vw, 8.4rem);
  line-height: .88;
  letter-spacing: -.03em;
  font-variation-settings: "wdth" 96;
}
.hero h1 .deg {
  display: inline-block; vertical-align: top;
  font-family: var(--f-mono); font-weight: 500; letter-spacing: .02em;
  font-size: clamp(.8rem, 1.5vw, 1.15rem); line-height: 1;
  padding: .5em .7em; margin: .9em 0 0; margin-inline-start: .7em;
  border: 1px solid var(--line-2); border-radius: 999px; color: var(--ink-2);
}

.hero-links { margin-top: clamp(20px, 3vw, 32px); }

.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px); align-items: end;
  margin-top: clamp(18px, 2.6vw, 32px);
}
.lede { font-size: clamp(1.14rem, 1.9vw, 1.5rem); line-height: 1.42; letter-spacing: -.012em; max-width: 34ch; text-wrap: pretty; }
.lede em { font-style: normal; color: var(--signal); }
.hero-side { display: grid; gap: 20px; }
.hero-side p { color: var(--ink-2); font-size: 15.5px; max-width: 46ch; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }

/* signal panel */
.scope {
  margin-top: clamp(24px, 3.2vw, 40px);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow); overflow: hidden;
}
.scope-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); letter-spacing: .04em;
}
.scope-bar b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.scope-bar .live { color: var(--signal); }
.scope-read { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.scope-bar { align-items: center; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper); }
.seg button { min-height: 32px; padding: 0 14px; border-radius: 999px; font-family: var(--f-body); font-size: 13.5px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); transition: background .15s, color .15s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.scope-main { display: grid; grid-template-columns: 132px minmax(0, 1fr) 230px; grid-template-rows: minmax(0, 1fr); height: clamp(170px, 19vw, 224px); }
/* canvases are taken out of flow so their pixel size can never feed back into the layout */
.scope-walk, .scope-pane { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.scope-main canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.scope-pane { border-inline-start: 1px solid var(--line); }
.scope-tag { position: absolute; z-index: 1; top: 8px; left: 12px; right: 12px; font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); letter-spacing: .03em; pointer-events: none; }
.scope-tag b { color: var(--signal); font-weight: 600; }
.scope-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.scope-metrics > div { padding: 12px 16px 13px; }
.scope-metrics > div + div { border-inline-start: 1px solid var(--line); }
.scope-metrics dt { font-family: var(--f-mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.scope-metrics dd { margin-top: 2px; white-space: nowrap; }
.scope-metrics b { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.25rem, 2.2vw, 1.7rem); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.scope-metrics small { font-size: 12.5px; color: var(--ink-3); }
.scope-cap { padding: 10px 16px 12px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; color: var(--ink-3); max-width: none; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: clamp(28px, 4vw, 44px); border-top: 1px solid var(--line); }
.stat { padding-block: 20px 0; padding-inline: 0 20px; }
.stat + .stat { padding-inline-start: 20px; border-inline-start: 1px solid var(--line); }
.stat-n { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.9rem, 4.2vw, 3.1rem); line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-l { margin-top: 8px; font-size: 14px; color: var(--ink-2); line-height: 1.35; max-width: 22ch; }

/* ---------- Sections ---------- */

.sec { padding-block: clamp(56px, 9vw, 120px); border-top: 1px solid var(--line); }
.sec-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: clamp(20px, 4vw, 56px); }
.sec-head { position: sticky; top: calc(var(--nav-h) + 24px); align-self: start; }
.sec-head h2 {
  margin-top: 12px;
  font-family: var(--f-display); font-weight: 700; letter-spacing: -.03em;
  font-size: clamp(1.9rem, 3.6vw, 2.75rem); line-height: 1.02; text-wrap: balance;
}
.sec-head p.note { margin-top: 14px; color: var(--ink-2); font-size: 15px; max-width: 30ch; }
.sec-body { min-width: 0; }
.sub { font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 44px 0 16px; }
.sub:first-child { margin-top: 0; }

.prose p { font-size: clamp(1.05rem, 1.5vw, 1.2rem); line-height: 1.6; max-width: 62ch; text-wrap: pretty; }
.prose p + p { margin-top: 1.1em; }
.prose a, .ilink { border-bottom: 1px solid var(--line-2); transition: border-color .15s, color .15s; }
.prose a:hover, .ilink:hover { border-color: var(--signal); color: var(--signal); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .02em;
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap;
}

/* education */
.edu { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.edu li { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.edu .deg-n { font-family: var(--f-display); font-weight: 700; font-size: 1.6rem; letter-spacing: -.02em; line-height: 1; }
.edu .deg-f { margin-top: 10px; font-weight: 500; }
.edu .deg-s { color: var(--ink-2); font-size: 14.5px; margin-top: 2px; }
.edu .deg-x { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-2); color: var(--ink-3); font-size: 13.5px; line-height: 1.45; }

/* ---------- Research ---------- */

.feature {
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); background: var(--card);
  box-shadow: var(--shadow); padding: clamp(20px, 3.4vw, 36px);
}
.feature h3 { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.6rem, 3.2vw, 2.4rem); letter-spacing: -.03em; line-height: 1.05; margin-top: 12px; }
.feature > p { margin-top: 14px; color: var(--ink-2); max-width: 64ch; }

.pipe { counter-reset: p; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 26px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pipe li { counter-increment: p; padding: 16px; background: var(--paper); position: relative; }
.pipe li + li { border-inline-start: 1px solid var(--line); }
.pipe li::before { content: "0" counter(p); display: block; font-family: var(--f-mono); font-size: 11.5px; color: var(--signal); letter-spacing: .08em; margin-bottom: 8px; }
.pipe strong { display: block; font-weight: 600; font-size: 15px; line-height: 1.25; }
.pipe span { display: block; margin-top: 6px; font-size: 13.5px; color: var(--ink-2); line-height: 1.4; }

.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 999px; font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.pill:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.card {
  display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.card h3 { font-family: var(--f-display); font-weight: 650; font-size: 1.24rem; line-height: 1.18; letter-spacing: -.015em; margin-top: 12px; text-wrap: balance; }
.card p { margin-top: 10px; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.card .links { margin-top: auto; padding-top: 18px; }
.kicker { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--signal); }
.card p.kicker { margin-top: 0; font-size: 11.5px; line-height: 1.5; color: var(--signal); }

.more-list { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.more-list li { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 4px 20px; padding: 16px 20px; }
.more-list li + li { border-top: 1px solid var(--line); }
.more-list .k { font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding-top: 3px; }
.more-list strong { font-weight: 600; }
.more-list span { color: var(--ink-2); font-size: 15px; }

/* ---------- Publications ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip {
  min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2);
  font-size: 14px; color: var(--ink-2); transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip sup { font-family: var(--f-mono); font-size: 10.5px; margin-inline-start: 4px; opacity: .7; }

.pubs li { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: 4px 18px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.pubs li[hidden] { display: none; }
.pub-y { font-family: var(--f-mono); font-size: 13.5px; color: var(--ink-3); padding-top: 4px; font-variant-numeric: tabular-nums; }
.pub-t { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.08rem, 1.7vw, 1.28rem); line-height: 1.25; letter-spacing: -.012em; text-wrap: pretty; }
.pub-a { margin-top: 8px; font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.pub-a b { color: var(--ink); font-weight: 600; }
.pub-v { margin-top: 6px; font-size: 14.5px; }
.pub-v i { font-style: italic; }
.pub-v .type { font-family: var(--f-mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--signal); margin-inline-end: 8px; }
.pubs .links { margin-top: 12px; }

/* ---------- Timeline ---------- */

.tl li { display: grid; grid-template-columns: 10.5rem minmax(0, 1fr); gap: 6px 24px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.tl li:first-child { padding-top: 0; }
.tl-d { font-family: var(--f-mono); font-size: 13px; color: var(--ink-3); padding-top: 5px; font-variant-numeric: tabular-nums; }
.tl h3 { font-family: var(--f-display); font-weight: 650; font-size: 1.3rem; letter-spacing: -.02em; line-height: 1.2; }
.tl .org { margin-top: 3px; color: var(--ink-2); font-size: 15px; }
.tl p.d { margin-top: 10px; font-size: 15.5px; max-width: 66ch; color: var(--ink); line-height: 1.55; }
.tl ul.pts { margin-top: 10px; display: grid; gap: 6px; max-width: 68ch; }
.tl ul.pts li { display: block; padding: 0; padding-inline-start: 18px; border: 0; position: relative; font-size: 15.5px; line-height: 1.5; }
.tl ul.pts li::before { content: ""; position: absolute; inset-inline-start: 0; top: .66em; width: 8px; height: 1px; background: var(--signal); }

/* ---------- Apps ---------- */

.banner {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 28px; align-items: center;
  padding: clamp(20px, 3vw, 30px); border-radius: calc(var(--radius) + 4px);
  background: var(--ink); color: var(--paper);
}
.banner .big { font-family: var(--f-display); font-weight: 800; font-size: clamp(2.6rem, 7vw, 4.6rem); line-height: .9; letter-spacing: -.04em; }
.banner p { font-size: 15.5px; opacity: .86; max-width: 52ch; }
.banner p.big { opacity: 1; max-width: none; }
.banner .tags { margin-top: 12px; }
.banner .tag { border-color: rgba(255, 255, 255, .28); color: inherit; opacity: .9; }
:root[data-theme="dark"] .banner .tag { border-color: rgba(0, 0, 0, .25); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .banner .tag { border-color: rgba(0, 0, 0, .25); } }

.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card .ar-name { font-family: var(--f-arabic); font-size: 15px; color: var(--ink-3); margin-top: 4px; direction: rtl; text-align: left; }

.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.tools a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 16px 0; border-bottom: 1px solid var(--line); transition: padding .2s; }
.tools a:hover { padding-inline-start: 8px; }
.tools a:hover .arrow { color: var(--signal); }
.tools strong { font-weight: 600; }
.tools span { grid-column: 1; color: var(--ink-2); font-size: 14.5px; line-height: 1.4; }
.tools .arrow { grid-row: 1; grid-column: 2; color: var(--ink-3); }

/* ---------- Teaching ---------- */

.nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 24px; }
.nums li { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.nums b { display: block; font-family: var(--f-display); font-weight: 700; font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1; letter-spacing: -.03em; }
.nums span { display: block; margin-top: 8px; font-size: 13.5px; color: var(--ink-2); line-height: 1.35; }

/* ---------- Talks ---------- */

.talks li { display: grid; grid-template-columns: 4.2rem 7.5rem minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; padding: 15px 0; border-bottom: 1px solid var(--line); }
.talks .y { font-family: var(--f-mono); font-size: 13.5px; color: var(--ink-3); }
.talks .k { font-family: var(--f-mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--signal); }
.talks .t { font-weight: 500; line-height: 1.35; }
.talks .t small { display: block; font-weight: 400; font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.talks .l { font-size: 13.5px; }

/* ---------- Service / skills ---------- */

.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.box { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.box h3 { font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; margin-bottom: 14px; }
.box ul.rows li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.45; }
.box ul.rows li:first-child { border-top: 0; padding-top: 0; }
.box ul.rows b { font-weight: 600; }
.box ul.rows span { color: var(--ink-2); }

.skills { display: grid; gap: 0; }
.skills > div { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 10px 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.skills dt { font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding-top: 6px; }

/* ---------- Contact ---------- */

.contact { background: var(--ink); color: var(--paper); border-top: 0; }
.contact .eyebrow { color: inherit; opacity: .6; }
.contact h2 { font-family: var(--f-display); font-weight: 800; letter-spacing: -.04em; line-height: .92; font-size: clamp(2.5rem, 9vw, 6.6rem); margin-top: 16px; text-wrap: balance; }
.contact .mail { display: inline-block; margin-top: clamp(24px, 4vw, 40px); font-family: var(--f-display); font-weight: 600; font-size: clamp(1.35rem, 4.4vw, 2.5rem); letter-spacing: -.02em; border-bottom: 2px solid var(--signal); padding-bottom: 4px; overflow-wrap: anywhere; }
.contact .mail:hover { color: var(--signal); }
.contact p.sm { margin-top: 16px; opacity: .7; font-size: 15px; max-width: 48ch; }
.socials { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 24px; margin-top: clamp(36px, 6vw, 64px); border-top: 1px solid rgba(128, 128, 128, .35); }
.socials a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 0; border-bottom: 1px solid rgba(128, 128, 128, .35); font-weight: 500; }
.socials a span.arrow { opacity: .5; transition: opacity .15s, transform .15s; }
.socials a:hover span.arrow { opacity: 1; transform: translate(2px, -2px); color: var(--signal); }
.contact :focus-visible { outline-color: var(--signal); }

.foot { background: var(--ink); color: var(--paper); padding: 28px 0; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 13.5px; opacity: .65; }
.foot a { border-bottom: 1px solid rgba(128, 128, 128, .5); }
.foot a:hover { color: var(--signal); }

/* ---------- Graphics ---------- */

.eyebrow { display: flex; align-items: center; gap: 8px; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--signal); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.gfx { width: 100%; height: auto; color: var(--ink-2); fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.gfx .a { stroke: var(--signal); }
.gfx .af { fill: var(--signal); stroke: none; }
.gfx .as { fill: var(--signal-soft); }
.gfx .f { fill: currentColor; stroke: none; }
.gfx .m { stroke: var(--line-2); stroke-width: 1; }
.gfx .dash { stroke-dasharray: 5 6; }
.gfx .bar { stroke-width: 7; stroke-linecap: butt; }
.gfx .seg { fill: currentColor; stroke: none; }
.gfx .fill { fill: var(--paper-2); }
.gfx text { fill: var(--ink-3); stroke: none; font-family: var(--f-mono); font-size: 12px; }
.gfx text.t1 { fill: var(--ink); font-family: var(--f-body); font-weight: 600; font-size: 15px; }

.card-art { margin: -22px -22px 18px; padding: 16px 18px 8px; border-bottom: 1px solid var(--line); background: var(--paper); border-radius: var(--radius) var(--radius) 0 0; }
.card-art .gfx { max-height: 124px; }
.feature-art { margin-top: 24px; padding: 14px 10px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.feature-art + .pipe { margin-top: 12px; }
.app-ico { width: 52px; height: 52px; margin-bottom: 14px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); }


.career { margin: 0 0 36px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.career-rows { display: grid; gap: 9px; }
.career-row { display: grid; grid-template-columns: 10.5rem minmax(0, 1fr); gap: 14px; align-items: center; }
.career-l { font-size: 13.5px; color: var(--ink-2); line-height: 1.2; }
.career-t { position: relative; display: block; height: 12px; border-radius: 6px; background: linear-gradient(to right, var(--line) 1px, transparent 1px) 0 0 / calc(100% / 17 * 4) 100%; }
.career-t i { position: absolute; top: 0; bottom: 0; inset-inline-start: var(--s); width: max(var(--w), 6px); border-radius: 6px; background: var(--ink); }
.career-t i.ly { background: var(--ink-3); }
.career-t i.now { background: var(--signal); }
.career-axis .career-t { height: 16px; background: none; }
.career-axis b { position: absolute; top: 0; inset-inline-start: var(--s); font-family: var(--f-mono); font-weight: 400; font-size: 11.5px; color: var(--ink-3); }
.career figcaption, .teams-fig figcaption { margin-top: 14px; font-size: 13px; color: var(--ink-3); }
[dir="rtl"] .career-t { background-image: linear-gradient(to left, var(--line) 1px, transparent 1px); background-position: 100% 0; }

.teams-fig { margin: 24px 0 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.teams { display: flex; flex-wrap: wrap; gap: 10px 12px; }
.teams span { display: grid; grid-template-columns: repeat(2, 7px); gap: 3px; }
.teams i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-2); }
.teams span:nth-child(7n+3) i { background: var(--signal); }

.lang-btn { width: auto; padding: 0 12px; font-size: 14px; font-weight: 500; font-family: var(--f-body), var(--f-arabic); }
.lang-btn[lang="ar"] { font-family: var(--f-arabic); }

/* ---------- Arabic ---------- */

html[lang="ar"] {
  --f-display: "Alexandria", "IBM Plex Sans Arabic", "Geeza Pro", Tahoma, sans-serif;
  --f-body: "IBM Plex Sans Arabic", "Geeza Pro", Tahoma, sans-serif;
  --f-mono: "IBM Plex Sans Arabic", "IBM Plex Mono", "Geeza Pro", Tahoma, sans-serif;
}
/* letter-spacing breaks the joins between Arabic letters */
html[lang="ar"] *:not(.ltr-block, .ltr-block *) { letter-spacing: 0 !important; }
html[lang="ar"] body { line-height: 1.85; }
html[lang="ar"] .hero h1 { font-size: clamp(1.75rem, 6vw, 5rem); line-height: 1.35; font-weight: 800; }
html[lang="ar"] .hero h1 .deg { margin-top: 1.2em; font-family: var(--f-body); font-weight: 500; }
html[lang="ar"] .lede { line-height: 1.75; max-width: 30ch; }
html[lang="ar"] .sec-head h2,
html[lang="ar"] .feature h3 { line-height: 1.35; font-size: clamp(1.6rem, 3vw, 2.2rem); }
html[lang="ar"] .card h3,
html[lang="ar"] .tl h3 { line-height: 1.5; font-size: 1.14rem; }
html[lang="ar"] .contact h2 { line-height: 1.3; font-size: clamp(2rem, 7vw, 5rem); }
html[lang="ar"] .stat-n,
html[lang="ar"] .banner .big,
html[lang="ar"] .nums b,
html[lang="ar"] .edu .deg-n { line-height: 1.25; }
html[lang="ar"] .stat-n,
html[lang="ar"] .banner .big,
html[lang="ar"] .nums b,
html[lang="ar"] .scope-metrics b { font-family: "Bricolage Grotesque", var(--f-display); }
html[lang="ar"] .scope-tag,
html[lang="ar"] .scope-metrics dt { font-size: 12.5px; }
html[lang="ar"] .mono,
html[lang="ar"] .eyebrow,
html[lang="ar"] .sub,
html[lang="ar"] .kicker,
html[lang="ar"] .card p.kicker,
html[lang="ar"] .more-list .k,
html[lang="ar"] .skills dt,
html[lang="ar"] .box h3 { font-size: 13.5px; }
html[lang="ar"] .scope-bar,
html[lang="ar"] .tag { font-size: 13px; }
html[lang="ar"] .prose p { line-height: 1.95; }
html[lang="ar"] .socials a:hover span.arrow { transform: translate(-2px, -2px); }
html[lang="ar"] .gfx text { font-family: var(--f-body); font-size: 13px; }

/* English-language lists (publications, talks) inside the Arabic page */
.ltr-block {
  --f-display: "Bricolage Grotesque", "Barlow", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-family: var(--f-body); line-height: 1.6; text-align: left;
}

/* ---------- Motion ---------- */

.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .card, .tools a, .btn { transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1060px) {
  .nav-links { display: none; }
  .nav-tools { margin-inline-start: auto; }
  .menu-btn { display: grid; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    /* .nav has a backdrop-filter, so it is the containing block here: size against the viewport explicitly */
    position: fixed; top: var(--nav-h); left: 0; right: 0; height: calc(100vh - var(--nav-h)); height: calc(100dvh - var(--nav-h)); margin: 0;
    padding: 12px var(--gutter) 32px; background: var(--paper); overflow-y: auto;
  }
  .nav-links.open a {
    padding: 16px 0; border-radius: 0; border-bottom: 1px solid var(--line);
    font-family: var(--f-display); font-weight: 650; font-size: 1.6rem; letter-spacing: -.02em; color: var(--ink);
  }
  .nav-links.open a.is-active::after { display: none; }
  .cards.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .sec-grid { grid-template-columns: minmax(0, 1fr); }
  .sec-head { position: static; }
  .sec-head p.note { max-width: 56ch; }
  .scope-main { grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: 150px 104px; height: auto; }
  .scope-fft { grid-column: 1 / -1; border-inline-start: 0; border-top: 1px solid var(--line); }
  .scope-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .scope-metrics > div { grid-column: span 2; }
  .scope-metrics > div:nth-child(n+4) { grid-column: span 3; border-top: 1px solid var(--line); }
  .scope-metrics > div:nth-child(4) { border-inline-start: 0; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .lede { max-width: 40ch; }
  .pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipe li:nth-child(3) { border-inline-start: 0; }
  .pipe li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .socials { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .talks li { grid-template-columns: 4.2rem minmax(0, 1fr); }
  .talks .k { grid-column: 2; grid-row: 1; }
  .talks .y { grid-row: 1; }
  .talks .t, .talks .l { grid-column: 2; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .nav-tools .btn { display: none; }
  .scope-main { grid-template-columns: 76px minmax(0, 1fr); }
  .scope-metrics > div { padding: 10px 12px 11px; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 0 8px; }
  .career-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .career-axis .career-l { display: none; }
  .card-art { margin: -22px -22px 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding-block: 18px; padding-inline: 0 12px; }
  .stat + .stat { padding-inline-start: 0; border-inline-start: 0; }
  .stat:nth-child(even) { padding-inline-start: 16px; border-inline-start: 1px solid var(--line); }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .edu, .cards, .cards.three, .duo, .tools { grid-template-columns: minmax(0, 1fr); }
  .nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tl li { grid-template-columns: minmax(0, 1fr); padding: 22px 0; }
  .tl-d { padding-top: 0; }
  .more-list li, .skills > div { grid-template-columns: minmax(0, 1fr); }
  .skills dt { padding-top: 0; }
  .pubs li { grid-template-columns: minmax(0, 1fr); }
  .pub-y { padding-top: 0; }
  .banner { grid-template-columns: minmax(0, 1fr); }
  .cta .btn { flex: 1 1 auto; }
  .hero h1 .deg { display: table; margin: 1.1em 0 0; }
}

@media (max-width: 400px) {
  .brand-name { display: none; }
  .pipe { grid-template-columns: minmax(0, 1fr); }
  .pipe li + li { border-inline-start: 0; border-top: 1px solid var(--line); }
  .socials { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  .nav, .scope, .filters, .cta { display: none; }
  .hero { padding-top: 0; }
  .sec-grid { grid-template-columns: 1fr; }
  .sec-head { position: static; }
  .js .reveal { opacity: 1; transform: none; }
}
