/* Omar Yousef — site styles. Bilingual: elements carry class "ar" or "en"; html[lang] shows one of them. */
:root {
  --navy: #0b1f3a; --navy-2: #12305a; --cyan: #00a6d6; --cyan-2: #36c4ee; --coral: #ff6b4a; --gold: #f2b134; --teal: #1fb58f;
  --bg: #f5f8fb; --surface: #ffffff; --surface-2: #eef3f8; --ink: #0b1f3a; --ink-2: #33475f; --muted: #66788f; --line: #dce5ee;
  --accent: #0089b3; --accent-soft: #e2f4fa; --shadow: 0 14px 40px rgba(11, 31, 58, .08);
  --radius: 18px; --max: 1160px;
  --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif; --display: 'Space Grotesk', 'IBM Plex Sans Arabic', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #08142a; --surface: #0f1f3a; --surface-2: #142849; --ink: #e9f0f8; --ink-2: #c4d2e3; --muted: #93a6bf; --line: #223a5e;
    --accent: #36c4ee; --accent-soft: #10324d; --shadow: 0 14px 40px rgba(0, 0, 0, .35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #08142a; --surface: #0f1f3a; --surface-2: #142849; --ink: #e9f0f8; --ink-2: #c4d2e3; --muted: #93a6bf; --line: #223a5e;
  --accent: #36c4ee; --accent-soft: #10324d; --shadow: 0 14px 40px rgba(0, 0, 0, .35); color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.75 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
html[lang="ar"] .en, html[lang="en"] .ar { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: 16px; top: 12px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

/* ---------------------------------------------------------------- header */
.site-header { position: sticky; top: 0; z-index: 30; backdrop-filter: saturate(160%) blur(14px); background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 18px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand svg { width: 36px; height: 36px; flex: none; }
.brand small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); line-height: 1.2; }
.brand b { font-family: var(--display); font-size: 17px; line-height: 1.1; display: block; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; align-items: center; }
.nav a { color: var(--ink-2); padding: 8px 12px; border-radius: 10px; font-size: 15px; font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.tools { display: flex; gap: 6px; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); height: 38px; min-width: 38px; padding: 0 10px; border-radius: 10px; cursor: pointer; font: 600 14px var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  .nav { position: absolute; inset-inline: 0; top: 66px; flex-direction: column; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px 16px; display: none; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
  .tools { margin-inline-start: auto; }
}

/* ---------------------------------------------------------------- hero */
.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 600px at 80% -10%, #164a7a 0%, transparent 60%), linear-gradient(160deg, #071630 0%, #0b1f3a 55%, #0d2a4d 100%); color: #eaf3fb; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.25fr .75fr; gap: 48px; align-items: center; padding: 88px 0 96px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--cyan-2); font-weight: 600; }
.eyebrow::before { content: ""; width: 26px; height: 2px; background: currentColor; }
html[lang="ar"] .eyebrow { letter-spacing: 0; }
.hero h1 { font-family: var(--display); font-size: clamp(40px, 6.2vw, 74px); line-height: 1.04; margin: 14px 0 12px; letter-spacing: -.02em; }
.hero h1 .ar { font-family: var(--font); letter-spacing: 0; }
.hero .role { font-size: clamp(17px, 2vw, 21px); color: #bcd3ea; margin: 0 0 20px; max-width: 40ch; }
.hero p.lead { color: #d3e2f1; max-width: 60ch; margin: 0 0 28px; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 12px; font-weight: 600; border: 1px solid transparent; cursor: pointer; font-size: 15px; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--cyan); color: #04213a; }
.btn.primary:hover { background: var(--cyan-2); }
.btn.ghost { border-color: rgba(255, 255, 255, .28); color: #fff; }
.btn.ghost:hover { border-color: #fff; }
.btn.outline { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn.outline:hover { border-color: var(--accent); }
.portrait { position: relative; justify-self: center; width: min(340px, 80vw); aspect-ratio: 1; }
.portrait .hex { position: absolute; inset: 0; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); background: linear-gradient(140deg, var(--cyan), var(--coral)); }
.portrait img { position: absolute; inset: 7px; width: calc(100% - 14px); height: calc(100% - 14px); object-fit: cover; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); }
.portrait .orbit { position: absolute; inset: -18px; border: 1px dashed rgba(54, 196, 238, .35); border-radius: 50%; animation: spin 60s linear infinite; }
.portrait .orbit::after { content: ""; position: absolute; top: 12%; inset-inline-start: 8%; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 16px var(--gold); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .portrait .orbit { animation: none; } }
.hero-facts { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(255, 255, 255, .12); border-top: 1px solid rgba(255, 255, 255, .12); }
.hero-facts div { background: rgba(7, 22, 48, .72); padding: 20px 22px; }
.hero-facts b { display: block; font-family: var(--display); font-size: 22px; color: #fff; }
.hero-facts span { font-size: 13.5px; color: #a9c1da; }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; padding: 56px 0 64px; text-align: start; }
  .portrait { order: -1; width: min(220px, 60vw); }
  .hero-facts { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------------------------------------------------------- page head (inner pages) */
.page-head { position: relative; overflow: hidden; background: linear-gradient(160deg, #071630, #0d2a4d); color: #eaf3fb; }
.page-head canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .7; }
.page-head .wrap { position: relative; padding: 64px 0 56px; }
.page-head h1 { font-family: var(--display); font-size: clamp(32px, 4.6vw, 52px); margin: 10px 0 8px; line-height: 1.1; }
.page-head h1 .ar { font-family: var(--font); }
.page-head p { margin: 0; color: #c3d6ea; max-width: 70ch; }

/* ---------------------------------------------------------------- sections */
section.block { padding: 72px 0; }
section.block.alt { background: var(--surface-2); }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-title h2 { font-family: var(--display); font-size: clamp(26px, 3.2vw, 36px); margin: 4px 0 0; line-height: 1.15; }
.section-title h2 .ar { font-family: var(--font); }
.kicker { font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: .14em; text-transform: uppercase; }
html[lang="ar"] .kicker { letter-spacing: 0; }
.grid { display: grid; gap: 20px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid.c3, .grid.c4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card h3 { margin: 10px 0 6px; font-size: 18px; line-height: 1.4; }
.card p { margin: 0; color: var(--ink-2); font-size: 15px; }
.card .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.card .ico svg { width: 22px; height: 22px; }
.card.link { transition: transform .2s, border-color .2s; color: inherit; display: block; }
.card.link:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.prose { font-size: 17px; color: var(--ink-2); max-width: 72ch; }
.prose p { margin: 0 0 16px; }
.two-col { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chip.coral { background: color-mix(in srgb, var(--coral) 16%, transparent); color: var(--coral); }
.chip.gold { background: color-mix(in srgb, var(--gold) 20%, transparent); color: #b07a06; }
.chip.teal { background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--teal); }
.list-check { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.list-check li { position: relative; padding-inline-start: 28px; color: var(--ink-2); }
.list-check li::before { content: ""; position: absolute; inset-inline-start: 0; top: .55em; width: 14px; height: 14px; clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%); background: var(--cyan); }

/* ---------------------------------------------------------------- CV timeline */
.cv-layout { display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: start; }
@media (max-width: 900px) { .cv-layout { grid-template-columns: 1fr; } }
.cv-side { position: sticky; top: 90px; }
@media (max-width: 900px) { .cv-side { position: static; } }
.cv-side img { width: 140px; height: 140px; object-fit: cover; border-radius: 50%; border: 4px solid var(--surface); box-shadow: var(--shadow); margin-bottom: 14px; }
.cv-side h3 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 22px 0 8px; }
html[lang="ar"] .cv-side h3 { letter-spacing: 0; }
.cv-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.site-footer ul { overflow-wrap: anywhere; }
.meter { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.meter i { display: inline-flex; gap: 3px; }
.meter i b { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.meter i b.on { background: var(--accent); }
.timeline { position: relative; display: grid; gap: 4px; }
.timeline h2 { font-family: var(--display); font-size: 24px; margin: 26px 0 12px; display: flex; align-items: center; gap: 10px; }
.timeline h2 .ar { font-family: var(--font); }
.timeline h2:first-child { margin-top: 0; }
.timeline h2::before { content: ""; width: 14px; height: 14px; clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%); background: var(--coral); }
.entry { position: relative; padding: 14px 20px 16px; border-inline-start: 2px solid var(--line); margin-inline-start: 6px; }
.entry::before { content: ""; position: absolute; inset-inline-start: -7px; top: 22px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.entry .head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.entry h4 { margin: 0; font-size: 17px; }
.entry .when { font-weight: 600; color: var(--accent); font-size: 14px; white-space: nowrap; }
.entry .where { color: var(--muted); font-size: 14.5px; font-style: italic; }
.entry ul { margin: 6px 0 0; padding-inline-start: 18px; color: var(--ink-2); font-size: 15px; }

/* ---------------------------------------------------------------- lists: lectures, articles */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.toolbar input, .toolbar select { height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: var(--surface); color: var(--ink); font: 15px var(--font); }
.toolbar input { flex: 1; min-width: 220px; }
.file-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 16px; align-items: center; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.file-row + .file-row { margin-top: 10px; }
.file-row .badge { width: 48px; height: 56px; border-radius: 8px; display: grid; place-items: center; font: 700 12px var(--display); color: #fff; background: linear-gradient(160deg, var(--coral), #e2462a); }
.file-row .badge.slides { background: linear-gradient(160deg, var(--gold), #d9940f); }
.file-row .badge.notes { background: linear-gradient(160deg, var(--teal), #138a6b); }
.file-row h3 { margin: 0; font-size: 16.5px; }
.file-row p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.file-row .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
@media (max-width: 640px) { .file-row { grid-template-columns: 40px 1fr; } .file-row .btn { grid-column: 1 / -1; justify-content: center; } }
.empty { text-align: center; padding: 48px 20px; border: 1.5px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.article-card .cover { height: 150px; border-radius: 12px; margin: -6px -6px 14px; background: linear-gradient(135deg, var(--navy), var(--navy-2)); position: relative; overflow: hidden; }
.article-card .cover svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.article-card time { font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- article page */
.article { padding: 56px 0 80px; }
.article .body { max-width: 760px; margin-inline: auto; font-size: 18px; color: var(--ink-2); }
.article .body h2 { color: var(--ink); font-size: 24px; margin: 34px 0 10px; }
.article .body p { margin: 0 0 18px; }
.article .body figure { margin: 24px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.article .body figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.article .body .eq { direction: ltr; text-align: center; font-family: 'Cambria Math', Cambria, serif; font-size: 19px; background: var(--surface-2); border-radius: 10px; padding: 12px; margin: 18px 0; }
.byline { display: flex; align-items: center; gap: 12px; margin: 18px 0 0; color: #c3d6ea; font-size: 14px; }
.byline img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }

/* ---------------------------------------------------------------- NanoLab */
.shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .shots { grid-template-columns: repeat(2, 1fr); } }
.shots figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: zoom-in; }
.shots img { aspect-ratio: 16 / 9; object-fit: cover; object-position: top; width: 100%; }
.shots figcaption { padding: 10px 12px; font-size: 14px; font-weight: 600; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(4, 12, 26, .88); display: none; place-items: center; padding: 24px; cursor: zoom-out; }
.lightbox.open { display: grid; }
.lightbox img { max-height: 90vh; border-radius: 12px; }
.steps { counter-reset: s; display: grid; gap: 14px; }
.steps li { list-style: none; counter-increment: s; position: relative; padding: 16px 18px 16px 18px; padding-inline-start: 64px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.steps li::before { content: counter(s); position: absolute; inset-inline-start: 16px; top: 14px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 700 16px var(--display); }
.steps { padding: 0; margin: 0; }
.cta { background: linear-gradient(140deg, var(--navy), #0f3a63); color: #eaf3fb; border-radius: 24px; padding: 40px; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta h2 { margin: 0 0 6px; font-family: var(--display); }
.cta p { margin: 0; color: #c3d6ea; }

/* ---------------------------------------------------------------- footer */
.site-footer { background: #061226; color: #9fb4cc; padding: 48px 0 28px; font-size: 14.5px; }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: #fff; margin: 0 0 10px; font-size: 15px; }
.site-footer a { color: #cfe0f0; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer .copy { grid-column: 1 / -1; border-top: 1px solid #1a2d4a; padding-top: 18px; margin-top: 10px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }
