/* =========================================================
   Base layout (theme agnostic). Themes are at the bottom.
   ========================================================= */
:root {
  --maxw: 1180px;
  --gutter: clamp(16px, 4vw, 36px);
  --bg: #f7fafa; --bg-2: #eef4f4; --surface: #ffffff; --surface-2: #eaf2f3;
  --text: #0b2730; --muted: #4f6870; --line: #d6e3e5;
  --accent: #0e6e7e; --accent-2: #f0616d; --on-accent: #ffffff;
  --radius: 16px; --radius-sm: 10px; --radius-btn: 999px;
  --shadow: 0 20px 60px -30px rgba(0,0,0,.3);
  --font: 'Figtree', system-ui, sans-serif; --font-display: var(--font); --font-mono: 'DM Mono', ui-monospace, monospace;
  --h-weight: 700; --h-track: -0.02em; --h-case: none;
  --card-bg: var(--surface); --card-border: 1px solid var(--line); --card-blur: none;
  --chip-bg: var(--surface-2); --chip-text: var(--text); --chip-border: 1px solid var(--line);
  --logo-a: #0e6e7e; --logo-b: #0b2730;
  --hero-cols: minmax(0, 1.2fr) minmax(0, .8fr);
  --sec-pad: clamp(72px, 10vw, 128px);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16.5px; line-height: 1.65; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
html[lang="ar"] body { --font: 'IBM Plex Sans Arabic', system-ui, sans-serif; --font-display: 'IBM Plex Sans Arabic', system-ui, sans-serif; line-height: 1.85; }
html[lang="ar"] { --h-track: 0; --h-case: none; }
#app { opacity: 1; transition: opacity .35s ease; }
html:not(.ready) #app { opacity: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--h-weight); letter-spacing: var(--h-track); text-transform: var(--h-case); line-height: 1.12; margin: 0; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; inset-inline-start: 8px; top: 8px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; transform: translateY(-200%); }
.skip:focus { transform: none; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.ic { width: 1.1em; height: 1.1em; flex: none; }
[dir="rtl"] .ic-flip, [dir="rtl"] .btn .ic:last-child:not(:first-child) { transform: scaleX(-1); }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* buttons & chips */
.btn { display: inline-flex; align-items: center; gap: .55em; padding: .85em 1.35em; border-radius: var(--radius-btn); font: 600 .95rem/1 var(--font); text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { color: var(--on-accent); box-shadow: 0 10px 30px -10px var(--accent); }
.btn-ghost { border-color: var(--line); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-text { padding-inline: .4em; color: var(--muted); }
.btn-sm { padding: .6em 1em; font-size: .85rem; }
.btn:disabled { opacity: .6; cursor: progress; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn .ic { width: 20px; height: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font: 500 .78rem/1 var(--font-mono); padding: .5em .7em; border-radius: 999px; background: var(--chip-bg); color: var(--chip-text); border: var(--chip-border); }
.card { background: var(--card-bg); border: var(--card-border); border-radius: var(--radius); backdrop-filter: var(--card-blur); -webkit-backdrop-filter: var(--card-blur); }
.ticks li { position: relative; padding-inline-start: 1.3em; margin-top: .45em; color: var(--muted); }
.ticks li::before { content: ''; position: absolute; inset-inline-start: 0; top: .72em; width: .55em; height: .55em; border-radius: 2px; background: var(--accent); transform: rotate(45deg) scale(.8); }

/* header */
.site-head { position: sticky; top: 0; z-index: 40; transition: background .25s ease, box-shadow .25s ease, border-color .25s ease; border-bottom: 1px solid transparent; }
.site-head.scrolled { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom-color: var(--line); }
.head-row { display: flex; align-items: center; gap: 20px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 1.05rem/1 var(--font-display); text-decoration: none; letter-spacing: -.01em; }
.brand .logo-mark { width: 34px; height: 34px; }
.main-nav { margin-inline-start: auto; }
.main-nav ul { display: flex; gap: 4px; }
.main-nav a { display: block; white-space: nowrap; padding: .5em .7em; border-radius: 999px; font-size: .9rem; color: var(--muted); text-decoration: none; }
.main-nav a:hover, .main-nav a.active { color: var(--text); background: var(--surface-2); }
.head-tools { display: flex; align-items: center; gap: 10px; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.lang-switch a { min-width: 32px; text-align: center; padding: .35em .55em; border-radius: 999px; font: 600 .75rem/1.2 var(--font); text-decoration: none; color: var(--muted); }
.lang-switch a[aria-current] { background: var(--accent); color: var(--on-accent); }
.menu-btn { display: none; }
.mobile-nav { border-top: 1px solid var(--line); background: var(--bg); }
.mobile-nav ul { padding: 10px var(--gutter) 18px; display: grid; gap: 2px; }
.mobile-nav a { display: block; padding: .75em 0; text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--line); }

/* hero */
.hero { position: relative; padding: clamp(40px, 7vw, 96px) 0 clamp(56px, 8vw, 110px); overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-bg span { position: absolute; }
.hero-grid { display: grid; grid-template-columns: var(--hero-cols); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero-status { display: inline-flex; align-items: center; gap: .6em; font-size: .84rem; color: var(--muted); border: 1px solid var(--line); background: var(--surface); padding: .45em .9em; border-radius: 999px; }
.hero-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px color-mix(in srgb, #22c55e 25%, transparent); }
.status-busy .dot { background: #f59e0b; box-shadow: 0 0 0 4px color-mix(in srgb, #f59e0b 25%, transparent); }
.status-closed .dot { background: #ef4444; box-shadow: 0 0 0 4px color-mix(in srgb, #ef4444 25%, transparent); }
.hero-kicker { margin-top: 22px; font: 500 .82rem/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
html[lang="ar"] .hero-kicker { letter-spacing: 0; text-transform: none; font-family: var(--font); font-size: .95rem; }
.hero-name { margin-top: 10px; font-size: clamp(2.6rem, 7vw, 5.2rem); line-height: 1; }
.hero-title { margin-top: 18px; font: 500 clamp(1.15rem, 2.2vw, 1.55rem)/1.35 var(--font-display); max-width: 34ch; }
.hero-sub { margin-top: 16px; color: var(--muted); max-width: 60ch; }
.hero-cta { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-panel { position: relative; border-radius: calc(var(--radius) + 6px); background: var(--card-bg); border: var(--card-border); backdrop-filter: var(--card-blur); -webkit-backdrop-filter: var(--card-blur); overflow: hidden; box-shadow: var(--shadow); }
.hp-bar { display: none; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); font: 500 .78rem/1 var(--font-mono); color: var(--muted); }
.hp-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.hp-bar span { margin-inline-start: 8px; }
.hp-body { padding: clamp(20px, 3vw, 30px); }
.hp-logo { position: relative; display: grid; place-items: center; aspect-ratio: 1.6; margin-bottom: 14px; }
.hp-logo .logo-mark { width: 42%; height: auto; position: relative; z-index: 1; filter: drop-shadow(0 0 30px color-mix(in srgb, var(--accent) 55%, transparent)); }
.hp-orbit { position: absolute; border: 1px solid var(--line); border-radius: 50%; inset: 8% 18%; }
.hp-orbit.o2 { inset: -6% 4%; border-style: dashed; opacity: .6; animation: spin 60s linear infinite; }
.hp-cmd { display: none; font: 500 .85rem/1 var(--font-mono); color: var(--accent); margin-bottom: 12px; }
.hp-cmd span { color: var(--muted); }
.hp-facts { display: grid; gap: 10px; }
.hp-facts div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; font-size: .9rem; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.hp-facts div:last-child { border-bottom: 0; }
.hp-facts dt { color: var(--muted); font: 500 .72rem/1.9 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; }
html[lang="ar"] .hp-facts dt { font-family: var(--font); letter-spacing: 0; font-size: .82rem; }
.hp-stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.hp-stack li { font: 500 .72rem/1 var(--font-mono); padding: .5em .65em; border-radius: 6px; background: var(--chip-bg); border: var(--chip-border); color: var(--chip-text); }
@keyframes spin { to { transform: rotate(360deg); } }

/* stats */
.stats { padding-bottom: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--bg); padding: 26px 24px; display: grid; gap: 6px; align-content: start; }
.stat strong { font: 700 clamp(2rem, 4vw, 2.8rem)/1 var(--font-display); letter-spacing: -.03em; color: var(--text); }
.stat span { color: var(--muted); font-size: .9rem; line-height: 1.45; }

/* sections */
.sec { padding-block: var(--sec-pad); position: relative; }
.sec-head { max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
.sec-kicker { display: flex; align-items: center; gap: 12px; font: 500 .8rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
html[lang="ar"] .sec-kicker { letter-spacing: 0; text-transform: none; font-family: var(--font); font-size: .95rem; }
.sec-index { color: var(--accent); }
.sec-title { margin-top: 14px; font-size: clamp(1.9rem, 4.2vw, 3.1rem); }
.sec-intro { margin-top: 16px; color: var(--muted); font-size: 1.05rem; max-width: 62ch; }
.card h3 { font-size: 1.15rem; }
.card p { color: var(--muted); }

.about-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.about-body p { font-size: 1.12rem; line-height: 1.75; }
.about-body p + p { margin-top: 1.1em; }
.about-highlights { display: grid; gap: 14px; }
.about-highlights .card { padding: 20px 22px; }
.about-highlights p { margin-top: 6px; font-size: .95rem; }

.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.work-card { overflow: hidden; display: flex; flex-direction: column; }
.work-media { aspect-ratio: 16 / 7; background: var(--surface-2); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.work-media img { width: 100%; height: 100%; object-fit: cover; }
.work-media-empty { display: flex; align-items: flex-end; justify-content: space-between; padding: 18px 22px; background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 60%), var(--surface-2); }
.work-num { font: 700 3.4rem/1 var(--font-display); color: color-mix(in srgb, var(--text) 18%, transparent); letter-spacing: -.04em; }
.work-country { font: 600 .8rem/1 var(--font-mono); padding: .5em .7em; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); }
.work-body { padding: 22px 24px 24px; display: grid; gap: 12px; flex: 1; align-content: start; }
.work-meta { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cc { font: 700 .68rem/1 var(--font-mono); padding: .4em .5em; border-radius: 4px; background: var(--accent); color: var(--on-accent); }
.work-card h3 { font-size: 1.45rem; }
.work-summary { color: var(--muted); }
.work-metric { font-weight: 600; color: var(--accent); font-size: .95rem; }
.work-more summary { cursor: pointer; font-weight: 600; font-size: .9rem; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.work-more summary::-webkit-details-marker { display: none; }
.work-more summary::after { content: '+'; font-family: var(--font-mono); color: var(--accent); }
.work-more[open] summary::after { content: '−'; }
.work-dl { display: grid; gap: 6px; margin: 12px 0 6px; font-size: .9rem; }
.work-dl div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; }
.work-dl dt { color: var(--muted); }
.work-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 4px; }
.work-links a { display: inline-flex; align-items: center; gap: 4px; font-size: .88rem; font-weight: 600; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.work-links a .ic { width: .9em; color: var(--accent); }

.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.proj { padding: 22px; display: grid; gap: 10px; align-content: start; }
.proj-type { font: 500 .74rem/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
html[lang="ar"] .proj-type { text-transform: none; letter-spacing: 0; font-family: var(--font); font-size: .85rem; }
.proj p { font-size: .94rem; }
.proj-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .88rem; text-decoration: none; }

.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 18px; }
.svc { padding: 24px; display: grid; gap: 12px; align-content: start; }
.svc-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.svc-icon .ic { width: 24px; height: 24px; }
.svc p { font-size: .95rem; }

.timeline { display: grid; gap: 18px; }
.tl-item { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
.tl-when { padding-top: 22px; display: grid; gap: 4px; align-content: start; }
.tl-when span { font: 600 .9rem/1.4 var(--font-mono); }
.tl-when small { color: var(--muted); font-size: .82rem; }
.tl-what { padding: 22px 24px; }
.tl-org { margin-top: 4px; font-weight: 600; color: var(--text) !important; }
.tl-org span { font-weight: 400; color: var(--muted); }

.skills-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.skill-group { padding: 22px; }
.skill-group h3 { margin-bottom: 14px; font-size: 1rem; }

.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; counter-reset: s; }
.step { padding-top: 18px; border-top: 2px solid var(--line); position: relative; }
.step::before { content: ''; position: absolute; top: -2px; inset-inline-start: 0; width: 40px; height: 2px; background: var(--accent); }
.step-n { font: 600 .8rem/1 var(--font-mono); color: var(--accent); }
.step h3 { margin-top: 10px; font-size: 1.12rem; }
.step p { margin-top: 6px; color: var(--muted); font-size: .92rem; }

.eng-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 22px; align-items: start; }
.eng-models { display: grid; gap: 14px; }
.eng-model { padding: 22px 24px; display: grid; grid-template-columns: 44px 1fr; gap: 4px 16px; }
.eng-n { grid-row: span 2; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; font: 700 1rem/1 var(--font-mono); background: var(--accent); color: var(--on-accent); }
.eng-facts { padding: 24px; }
.eng-facts dl { display: grid; gap: 14px; }
.eng-facts dt { font: 500 .72rem/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
html[lang="ar"] .eng-facts dt { text-transform: none; letter-spacing: 0; font-family: var(--font); font-size: .85rem; }
.eng-facts dd { font-weight: 600; margin-top: 2px; }
.eng-legal { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .84rem; }

.edu-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 18px; align-items: start; }
.edu { padding: 24px; display: grid; gap: 8px; }
.edu-period { font: 600 .85rem/1 var(--font-mono); color: var(--accent) !important; }
.edu-degree { font-weight: 600; color: var(--text) !important; }
.langs { padding: 10px 24px; }
.langs li { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.langs li:last-child { border-bottom: 0; }
.langs span { color: var(--muted); }

.quote-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.quote { margin: 0; padding: 26px; }
.quote blockquote { margin: 0; font-size: 1.05rem; }
.quote figcaption { margin-top: 16px; display: grid; font-size: .9rem; }
.quote figcaption span { color: var(--muted); }

.faq-list { display: grid; gap: 10px; max-width: 860px; }
.faq-item { border: var(--card-border); border-radius: var(--radius-sm); background: var(--card-bg); padding: 0 20px; }
.faq-item summary { cursor: pointer; padding: 18px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-family: var(--font-mono); color: var(--accent); font-size: 1.2rem; line-height: 1; }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { padding-bottom: 18px; color: var(--muted); }

.contact-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(22px, 4vw, 48px); align-items: start; }
.contact-form { padding: clamp(20px, 3vw, 30px); display: grid; gap: 14px; }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form label { display: grid; gap: 6px; font-size: .85rem; color: var(--muted); }
.contact-form input, .contact-form select, .contact-form textarea { width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8em .9em; }
.contact-form select option { color: #111; }
.contact-form textarea { resize: vertical; min-height: 130px; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.contact-form .btn { justify-self: start; }
.form-status { font-size: .92rem; min-height: 1.2em; }
.form-status.ok { color: #22c55e; }
.form-status.err { color: #f87171; }
.contact-text { font-size: 1.1rem; }
.contact-or { margin-top: 24px; font: 500 .75rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.contact-links { margin-top: 12px; display: grid; gap: 8px; }
.contact-links a { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; padding: .55em 0; border-bottom: 1px solid var(--line); width: 100%; }
.contact-links .ic { color: var(--accent); }

.site-foot { border-top: 1px solid var(--line); padding: 34px 0 calc(34px + env(safe-area-inset-bottom)); }
.foot-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.foot-brand { display: flex; align-items: center; gap: 12px; }
.foot-brand .logo-mark { width: 38px; height: 38px; }
.foot-brand div { display: grid; font-size: .85rem; }
.foot-brand span { color: var(--muted); }
.foot-legal { margin-inline-start: auto; color: var(--muted); font-size: .82rem; text-align: end; max-width: 520px; }
.foot-top { font-size: .85rem; text-decoration: none; color: var(--muted); }

/* theme dock */
.theme-dock { position: relative; }
.theme-panel { position: absolute; top: 52px; inset-inline-end: 0; z-index: 60; width: min(300px, calc(100vw - 24px)); max-height: calc(100vh - 90px); overflow-y: auto; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 12px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.45); }
.theme-panel p { font: 600 .72rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 4px 6px 10px; }
.theme-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.theme-list button { display: grid; gap: 6px; text-align: start; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text); font: 500 .78rem/1.2 var(--font); cursor: pointer; }
.theme-list button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.sw { display: flex; height: 16px; border-radius: 4px; overflow: hidden; border: 1px solid rgba(127,127,127,.25); }
.sw i { flex: 1; }

/* reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } .hp-orbit.o2 { animation: none; } html { scroll-behavior: auto; } }

/* responsive */
@media (max-width: 1120px) {
  .main-nav { display: none; }
  .head-tools { margin-inline-start: auto; }
  .menu-btn { display: inline-grid; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .hero-grid, .about-grid, .work-grid, .skills-grid, .eng-grid, .edu-grid, .contact-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tl-item { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .tl-when { padding-top: 0; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
  .foot-legal { margin-inline-start: 0; text-align: start; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .head-row { gap: 8px; }
  .head-tools { gap: 6px; }
  .icon-btn { width: 38px; height: 38px; }
  .brand span { font-size: .95rem; }
  .theme-panel { position: fixed; top: 72px; inset-inline: 12px; width: auto; }
  .head-cta { display: none; }
  .f-row { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .hero-cta .btn { flex: 1 1 auto; justify-content: center; }
  .hp-facts div { grid-template-columns: 84px 1fr; }
  .work-dl div { grid-template-columns: 1fr; gap: 0; }
  .stat { padding: 20px 16px; }
}

/* =========================================================
   CV view (always black ink on white paper)
   ========================================================= */
html.cv, html.cv body { background: #e9e9ec; }
body.cv-mode { background: #e9e9ec; color: #000; font-family: 'Figtree', 'Segoe UI', Arial, sans-serif; }
html[lang="ar"] body.cv-mode { font-family: 'IBM Plex Sans Arabic', 'Segoe UI', Arial, sans-serif; }
.cv-mode .theme-dock { display: none; }
.cv-tools { position: sticky; top: 0; z-index: 5; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 12px; background: #fff; border-bottom: 1px solid #ddd; --accent: #111; --on-accent: #fff; --line: #ccc; --surface: #fff; --text: #111; --muted: #555; }
.cv-page { width: min(210mm, 100%); min-height: 297mm; margin: 24px auto; background: #fff; color: #000; padding: 16mm 16mm 14mm; box-shadow: 0 10px 40px rgba(0,0,0,.12); font-size: 10pt; line-height: 1.45; }
.cv-page a { color: #000; }
.cv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 1.5pt solid #000; padding-bottom: 8px; }
.cv-head h1 { font: 700 22pt/1.1 inherit; font-family: inherit; letter-spacing: -.01em; }
.cv-role { font-weight: 600; font-size: 11pt; margin-top: 4px; }
.cv-loc { font-size: 9pt; margin-top: 2px; }
.cv-logo { width: 34px; height: 34px; --logo-a: #000; --logo-b: #000; }
.cv-contacts { font-size: 9pt; margin: 6px 0 4px; }
.cv-page section { margin-top: 10px; }
.cv-page h2 { font: 700 10.5pt/1.2 inherit; font-family: inherit; text-transform: uppercase; letter-spacing: .06em; border-bottom: .75pt solid #000; padding-bottom: 2px; margin-bottom: 6px; }
html[lang="ar"] .cv-page h2 { letter-spacing: 0; }
.cv-item { margin-top: 6px; break-inside: avoid; page-break-inside: avoid; }
.cv-page h2 { break-after: avoid; page-break-after: avoid; }
.cv-page section > p, .cv-page li { orphans: 3; widows: 3; }
.cv-skill, .cv-proj { break-inside: avoid; page-break-inside: avoid; }
.cv-head, .cv-contacts { break-inside: avoid; }
.cv-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cv-line > :first-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.cv-line span { flex: 0 1 auto; max-width: 48%; text-align: end; font-size: 9pt; overflow-wrap: anywhere; }
.cv-page p, .cv-page li { overflow-wrap: anywhere; }
.cv-sub { font-size: 9.5pt; }
.cv-page ul { list-style: disc; padding-inline-start: 16px; margin-top: 2px; }
.cv-page li { margin-top: 1px; }
.cv-skill, .cv-proj { margin-top: 3px; }
@media print {
  @page { size: A4; margin: 15mm 16mm 14mm; }
  html.cv, html.cv body, body.cv-mode { background: #fff !important; margin: 0; }
  .cv-tools, .skip { display: none !important; }
  .cv-page { margin: 0; box-shadow: none; width: auto; max-width: none; min-height: 0; padding: 0; }
}
@media screen and (max-width: 760px) { .cv-page { padding: 18px; font-size: 9.5pt; margin: 0; } .cv-line { flex-direction: column; gap: 0; } .cv-line span { max-width: none; text-align: start; } }

/* =========================================================
   THEMES (ten directions designed for Aicha Rezzoug)
   ========================================================= */

/* 1. LUMEN: her brand, clean light, petrol ink, coral, a lens in the hero */
[data-theme="lumen"] {
  --bg: #f7fafa; --bg-2: #eef4f4; --surface: #ffffff; --surface-2: #eaf2f3; --text: #0b2730; --muted: #4f6870; --line: #d6e3e5;
  --accent: #0e6e7e; --accent-2: #f0616d; --on-accent: #ffffff; --radius: 18px; --radius-sm: 12px; --radius-btn: 12px;
  --shadow: 0 24px 60px -34px rgba(11,39,48,.35);
  --font: 'Figtree', system-ui, sans-serif; --font-display: 'Figtree', system-ui, sans-serif; --font-mono: 'DM Mono', ui-monospace, monospace;
  --h-weight: 800; --h-track: -0.035em;
  --card-bg: #ffffff; --card-border: 1px solid #d6e3e5; --chip-bg: #eaf2f3; --chip-border: 1px solid transparent; --chip-text: #0b4f5b;
  --logo-a: #0e6e7e; --logo-b: #0b2730; --logo-dot: #f0616d;
}
[data-theme="lumen"] .hero-bg span:nth-child(1) { width: 760px; height: 760px; top: -380px; inset-inline-end: -220px; border-radius: 50%; background: radial-gradient(circle, rgba(240,97,109,.16), transparent 62%); }
[data-theme="lumen"] .hero-bg span:nth-child(2) { inset: 0; background-image: radial-gradient(rgba(14,110,126,.16) 1px, transparent 1.4px); background-size: 22px 22px; mask-image: linear-gradient(180deg, #000, transparent 85%); -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%); }
[data-theme="lumen"] .hero-name span, [data-theme="lumen"] .hero-name { color: var(--text); }
[data-theme="lumen"] .hero-kicker { color: var(--accent-2); }
[data-theme="lumen"] .hero-panel { background: #ffffff; }
[data-theme="lumen"] .hp-logo { aspect-ratio: 1.35; }
[data-theme="lumen"] .hp-logo .logo-mark { width: 34%; filter: none; }
[data-theme="lumen"] .hp-orbit { border: 2px solid #d6e3e5; inset: 6% 22%; animation: none; }
[data-theme="lumen"] .hp-orbit.o2 { inset: -2% 15%; border: 1px dashed rgba(14,110,126,.45); opacity: 1; animation: spin 80s linear infinite; }
[data-theme="lumen"] .hp-logo::before, [data-theme="lumen"] .hp-logo::after { content: ''; position: absolute; background: rgba(14,110,126,.25); }
[data-theme="lumen"] .hp-logo::before { width: 76%; height: 1px; top: 50%; }
[data-theme="lumen"] .hp-logo::after { width: 1px; height: 100%; inset-inline-start: 50%; top: 0; }
[data-theme="lumen"] .sec-index { background: var(--accent); color: #fff; padding: .4em .6em; border-radius: 8px; }
[data-theme="lumen"] .sec-label { color: var(--accent); }
[data-theme="lumen"] .stats-grid { background: none; border: 0; gap: 14px; overflow: visible; }
[data-theme="lumen"] .stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); border-top: 3px solid var(--accent-2); }
[data-theme="lumen"] .stat strong { color: var(--accent); }
[data-theme="lumen"] .work-media-empty { background: radial-gradient(120% 140% at 100% 0%, rgba(240,97,109,.18), transparent 55%), #eaf2f3; }
[data-theme="lumen"] .work-num { color: rgba(14,110,126,.28); }
[data-theme="lumen"] .ticks li::before { border-radius: 50%; transform: none; background: var(--accent-2); }
[data-theme="lumen"] .sec:nth-of-type(even) { background: var(--bg-2); }

/* 2. FUNDUS: retina photography, ember glow on black */
[data-theme="fundus"] {
  --bg: #07070a; --bg-2: #0d0c11; --surface: #111116; --surface-2: #18171e; --text: #f6efe9; --muted: #b5a9a4; --line: #2a2328;
  --accent: #ff7a2f; --accent-2: #ffc857; --on-accent: #1c0b02; --radius: 20px; --radius-sm: 12px; --radius-btn: 999px;
  --shadow: 0 40px 80px -40px rgba(255,122,47,.35);
  --font: 'Instrument Sans', system-ui, sans-serif; --font-display: 'Unbounded', system-ui, sans-serif; --font-mono: 'Geist Mono', ui-monospace, monospace;
  --h-weight: 700; --h-track: -0.03em;
  --card-bg: #111116; --card-border: 1px solid #2a2328; --chip-bg: #1a1517; --chip-border: 1px solid #33282a; --chip-text: #ffd9bf;
  --logo-a: #ffe1b0; --logo-b: #ff7a2f; --logo-dot: #ffffff;
}
[data-theme="fundus"] .hero-bg span:nth-child(1) { width: 820px; height: 820px; bottom: -520px; inset-inline-start: -300px; border-radius: 50%; background: radial-gradient(circle, rgba(255,122,47,.22), transparent 60%); }
[data-theme="fundus"] .hero-bg span:nth-child(2) { width: 520px; height: 520px; top: -260px; inset-inline-end: 10%; border-radius: 50%; background: radial-gradient(circle, rgba(255,200,87,.10), transparent 62%); }
[data-theme="fundus"] .hero-name { font-size: clamp(2.1rem, 6.4vw, 4.6rem); line-height: 1.02; }
[data-theme="fundus"] .hero-panel { background: transparent; border: 0; box-shadow: none; overflow: visible; }
[data-theme="fundus"] .hp-body { padding: 0; }
[data-theme="fundus"] .hp-logo { aspect-ratio: 1; width: min(78%, 360px); margin: 0 auto 22px; border-radius: 50%;
  background: radial-gradient(circle at 63% 44%, #fff3c9 0 4%, #ffc857 7%, rgba(255,140,60,.95) 13%, transparent 26%),
    repeating-conic-gradient(from 10deg at 63% 44%, rgba(120,10,0,.0) 0 7deg, rgba(110,8,0,.35) 7deg 8deg, rgba(120,10,0,0) 8deg 19deg),
    radial-gradient(circle at 50% 50%, #e25a22 0, #b8341a 40%, #6d1208 63%, #1a0504 70%, transparent 71%);
  box-shadow: 0 0 80px -10px rgba(255,122,47,.45); }
[data-theme="fundus"] .hp-logo .logo-mark { width: 22%; position: absolute; inset-inline-start: 18%; bottom: 20%; filter: drop-shadow(0 4px 12px rgba(0,0,0,.6)); }
[dir="rtl"][data-theme="fundus"] .hp-logo .logo-mark { inset-inline-start: auto; inset-inline-end: 18%; }
[data-theme="fundus"] .hp-orbit { inset: -4%; border: 1px solid rgba(255,200,87,.18); }
[data-theme="fundus"] .hp-orbit.o2 { inset: -8%; border-style: dashed; border-color: rgba(255,122,47,.3); }
[data-theme="fundus"] .hp-facts div { border-bottom-color: #2a2328; }
[data-theme="fundus"] .btn-primary { background: linear-gradient(135deg, #ffc857, #ff7a2f); }
[data-theme="fundus"] .sec-index::before { content: '◉ '; }
[data-theme="fundus"] .sec-title { font-size: clamp(1.6rem, 3.6vw, 2.6rem); }
[data-theme="fundus"] .stat strong { font-size: clamp(1.7rem, 3.4vw, 2.4rem); color: var(--accent-2); }
[data-theme="fundus"] .stat { background: #0d0c11; }
[data-theme="fundus"] .work-media-empty { background: radial-gradient(70% 90% at 80% 20%, rgba(255,200,87,.25), transparent 50%), radial-gradient(90% 120% at 30% 100%, rgba(255,90,30,.35), transparent 60%), #120d10; }
[data-theme="fundus"] .cc { background: #ff7a2f; color: #1c0b02; }
[data-theme="fundus"] .card:hover { border-color: rgba(255,122,47,.45); }
[data-theme="fundus"] .card { transition: border-color .25s ease; }

/* 3. H&E STAIN: pathology slide colours, soft cells */
[data-theme="histology"] {
  --bg: #fbf6fa; --bg-2: #f6ecf3; --surface: #ffffff; --surface-2: #f8eaf2; --text: #2b1438; --muted: #6e5a78; --line: #ecdcea;
  --accent: #7b2f8e; --accent-2: #e06a9a; --on-accent: #ffffff; --radius: 28px; --radius-sm: 16px; --radius-btn: 999px;
  --shadow: 0 30px 60px -40px rgba(123,47,142,.45);
  --font: 'Hanken Grotesk', system-ui, sans-serif; --font-display: 'Young Serif', Georgia, serif; --font-mono: 'Hanken Grotesk', sans-serif;
  --h-weight: 400; --h-track: -0.01em;
  --card-bg: #ffffff; --card-border: 1px solid #ecdcea; --chip-bg: #f8eaf2; --chip-border: 1px solid #f0d5e6; --chip-text: #6a2479;
  --logo-a: #e06a9a; --logo-b: #7b2f8e; --logo-dot: #7b2f8e;
}
[data-theme="histology"] .hero-bg span { border-radius: 42% 58% 61% 39% / 47% 41% 59% 53%; background: radial-gradient(circle at 46% 52%, rgba(123,47,142,.55) 0 9%, transparent 10%), rgba(224,106,154,.16); }
[data-theme="histology"] .hero-bg span:nth-child(1) { width: 220px; height: 190px; top: 8%; inset-inline-end: 4%; }
[data-theme="histology"] .hero-bg span:nth-child(2) { width: 140px; height: 150px; bottom: 10%; inset-inline-end: 38%; transform: rotate(40deg); opacity: .8; }
[data-theme="histology"] .hero-bg span:nth-child(3) { width: 90px; height: 80px; top: 18%; inset-inline-start: 46%; transform: rotate(-20deg); opacity: .6; }
[data-theme="histology"] .hero-name { font-size: clamp(2.6rem, 7vw, 5.2rem); }
[data-theme="histology"] .hero-kicker { color: var(--accent-2); font-family: var(--font); font-weight: 700; }
[data-theme="histology"] .hero-panel { border-radius: 150px 44px 150px 44px / 130px 44px 130px 44px; background: linear-gradient(160deg, #fff, #f8eaf2); border: 1px solid #ecdcea; }
[data-theme="histology"] .hp-body { padding: clamp(28px, 4vw, 48px) clamp(26px, 4vw, 44px); }
[data-theme="histology"] .hp-logo { aspect-ratio: 2.2; margin-bottom: 6px; }
[data-theme="histology"] .hp-logo .logo-mark { width: 26%; filter: none; }
[data-theme="histology"] .hp-orbit { display: none; }
[data-theme="histology"] .hp-facts div { border-bottom: 1px dashed #e7cfe0; }
[data-theme="histology"] .sec-index { display: inline-grid; place-items: center; width: 38px; height: 34px; border-radius: 48% 52% 44% 56% / 55% 45% 55% 45%; background: var(--accent-2); color: #fff; font-weight: 700; box-shadow: inset 0 0 0 7px rgba(255,255,255,.0); }
[data-theme="histology"] .sec-title { font-size: clamp(2rem, 4.6vw, 3.3rem); }
[data-theme="histology"] .stats-grid { background: none; border: 0; gap: 16px; overflow: visible; }
[data-theme="histology"] .stat { border-radius: 38% 62% 45% 55% / 42% 38% 62% 58%; background: #fff; border: 1px solid var(--line); text-align: center; justify-items: center; padding: 30px 22px; }
[data-theme="histology"] .stat:nth-child(even) { background: #f8eaf2; }
[data-theme="histology"] .stat strong { font-family: var(--font-display); font-weight: 400; color: var(--accent); }
[data-theme="histology"] .work-media-empty { background: radial-gradient(circle at 30% 40%, rgba(123,47,142,.45) 0 5%, transparent 6%), radial-gradient(circle at 70% 60%, rgba(123,47,142,.35) 0 4%, transparent 5%), radial-gradient(circle at 55% 25%, rgba(123,47,142,.3) 0 3%, transparent 4%), linear-gradient(135deg, #f9d5e6, #f3e3f7); }
[data-theme="histology"] .work-num { color: rgba(123,47,142,.35); font-family: var(--font-display); }
[data-theme="histology"] .cc { background: var(--accent); }
[data-theme="histology"] .ticks li::before { border-radius: 50%; transform: none; background: var(--accent-2); }
[data-theme="histology"] .svc-icon { border-radius: 46% 54% 50% 50% / 55% 45% 55% 45%; }

/* 4. PREPRINT: research paper layout */
[data-theme="preprint"] {
  --bg: #ffffff; --bg-2: #f6f6f4; --surface: #ffffff; --surface-2: #f4f4f2; --text: #111111; --muted: #4d4d4d; --line: #d9d9d6;
  --accent: #b31b1b; --accent-2: #1f3f8f; --on-accent: #ffffff; --radius: 2px; --radius-sm: 2px; --radius-btn: 3px; --shadow: none;
  --font: 'Source Serif 4', Georgia, serif; --font-display: 'Source Serif 4', Georgia, serif; --font-mono: 'Source Code Pro', ui-monospace, monospace;
  --h-weight: 600; --h-track: -0.005em;
  --card-bg: transparent; --card-border: 0; --chip-bg: transparent; --chip-border: 1px solid #cfcfcb; --chip-text: #333;
  --logo-a: #111111; --logo-b: #111111; --logo-dot: #b31b1b; --hero-cols: minmax(0, 1fr); --maxw: 1040px;
}
html[lang="ar"][data-theme="preprint"] body { --font: 'Noto Naskh Arabic', 'IBM Plex Sans Arabic', serif; --font-display: 'Noto Naskh Arabic', 'IBM Plex Sans Arabic', serif; }
[data-theme="preprint"] body { font-size: 17.5px; }
[data-theme="preprint"] .hero { border-bottom: 1px solid #111; }
[data-theme="preprint"] .hero-main { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 820px; margin-inline: auto; }
[data-theme="preprint"] .hero-status { order: 6; margin-top: 22px; border-radius: 3px; }
[data-theme="preprint"] .hero-kicker { order: 0; margin-top: 0; font-family: var(--font-mono); color: var(--accent); letter-spacing: .04em; font-size: .78rem; }
[data-theme="preprint"] .hero-title { order: 1; margin-top: 14px; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.7rem, 3.6vw, 2.6rem); line-height: 1.18; max-width: 28ch; }
[data-theme="preprint"] .hero-name { order: 2; margin-top: 18px; font-size: clamp(1.15rem, 2.2vw, 1.4rem); font-weight: 600; font-style: normal; }
[data-theme="preprint"] .hero-name::after { content: '1'; font-size: .6em; vertical-align: super; margin-inline-start: 2px; color: var(--accent); }
[data-theme="preprint"] .hero-sub { order: 3; margin-top: 18px; text-align: start; font-size: .98rem; color: #222; border-block: 1px solid var(--line); padding: 14px 4px; max-width: 70ch; }
[data-theme="preprint"] .hero-sub::before { content: 'Abstract. '; font-weight: 700; }
html[lang="fr"][data-theme="preprint"] .hero-sub::before { content: 'Résumé. '; }
html[lang="ar"][data-theme="preprint"] .hero-sub::before { content: 'ملخّص. '; }
[data-theme="preprint"] .hero-cta { order: 4; justify-content: center; }
[data-theme="preprint"] .hero-panel { max-width: 820px; width: 100%; margin-inline: auto; background: none; border: 0; box-shadow: none; overflow: visible; }
[data-theme="preprint"] .hp-logo, [data-theme="preprint"] .hp-orbit { display: none; }
[data-theme="preprint"] .hp-body { padding: 0; }
[data-theme="preprint"] .hp-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; font-size: .9rem; }
[data-theme="preprint"] .hp-facts div { grid-template-columns: 1fr; gap: 0; padding: 8px 0; }
[data-theme="preprint"] .hp-facts dt { font-family: var(--font-mono); color: var(--accent); }
[data-theme="preprint"] .hp-facts dt::before { content: '¹ '; }
[data-theme="preprint"] .hp-stack { justify-content: center; }
[data-theme="preprint"] .hp-stack::before { content: 'Keywords:'; font-style: italic; margin-inline-end: 6px; align-self: center; font-size: .9rem; }
html[lang="fr"][data-theme="preprint"] .hp-stack::before { content: 'Mots-clés :'; }
html[lang="ar"][data-theme="preprint"] .hp-stack::before { content: 'كلمات مفتاحية:'; }
[data-theme="preprint"] .hp-stack li { border: 0; background: none; padding: 0; font-family: var(--font); font-style: italic; color: #333; font-size: .9rem; }
[data-theme="preprint"] .hp-stack li:not(:last-child)::after { content: ';'; }
[data-theme="preprint"] .btn { border-radius: 3px; }
[data-theme="preprint"] .btn-ghost { background: none; border-color: #111; }
[data-theme="preprint"] .sec-head { max-width: none; }
[data-theme="preprint"] .sec-kicker { font-family: var(--font-mono); letter-spacing: .02em; text-transform: none; }
[data-theme="preprint"] .sec-index { color: var(--text); font-weight: 700; }
[data-theme="preprint"] .sec-index::after { content: '.'; }
[data-theme="preprint"] .sec-title { font-size: clamp(1.5rem, 3vw, 2.1rem); }
[data-theme="preprint"] .sec { padding-block: clamp(52px, 7vw, 84px); }
[data-theme="preprint"] .sec + .sec { border-top: 1px solid var(--line); }
[data-theme="preprint"] .card { border-top: 1px solid #111; padding-inline: 0 !important; }
[data-theme="preprint"] .stats .wrap::before { content: 'Table 1. Selected results.'; display: block; font-size: .88rem; margin-bottom: 8px; font-style: italic; }
html[lang="fr"][data-theme="preprint"] .stats .wrap::before { content: 'Tableau 1. Résultats choisis.'; }
html[lang="ar"][data-theme="preprint"] .stats .wrap::before { content: 'الجدول 1. نتائج مختارة.'; }
[data-theme="preprint"] .stats-grid { border: 0; border-block: 2px solid #111; border-radius: 0; background: none; gap: 0; }
[data-theme="preprint"] .stat { background: none; border-inline-end: 1px solid var(--line); }
[data-theme="preprint"] .stat:last-child { border-inline-end: 0; }
[data-theme="preprint"] .stat strong { font-family: var(--font-mono); font-weight: 500; font-size: clamp(1.6rem, 3vw, 2.2rem); }
[data-theme="preprint"] .work-media-empty { background: repeating-linear-gradient(0deg, #f3f3f1 0 1px, transparent 1px 22px), #fafaf8; }
[data-theme="preprint"] .work-num { color: #c9c9c4; font-family: var(--font-mono); }
[data-theme="preprint"] .work-media { border-bottom: 1px solid #111; }
[data-theme="preprint"] .work-media::after { content: 'Figure'; position: absolute; inset-inline-start: 0; bottom: -1.7em; font-size: .78rem; font-style: italic; color: var(--muted); }
[data-theme="preprint"] .cc { background: none; color: var(--accent); border: 1px solid var(--accent); }
[data-theme="preprint"] .svc-icon, [data-theme="preprint"] .eng-n { border-radius: 2px; background: none; border: 1px solid #111; color: #111; }
[data-theme="preprint"] .ticks li::before { content: '-'; background: none; transform: none; width: auto; height: auto; top: 0; color: var(--muted); }
[data-theme="preprint"] .faq-item { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; padding: 0; }
[data-theme="preprint"] .chips li { font-family: var(--font-mono); border-radius: 2px; }
[data-theme="preprint"] .lang-switch, [data-theme="preprint"] .icon-btn { border-radius: 3px; } [data-theme="preprint"] .lang-switch a { border-radius: 2px; }

/* 5. LAB NOTEBOOK: graph paper, red margin, taped notes */
[data-theme="notebook"] {
  --bg: #fdfcf7; --bg-2: #f6f4ea; --surface: #ffffff; --surface-2: #f3f1e6; --text: #1e2a44; --muted: #56617a; --line: #c9d6ea;
  --accent: #1d4ed8; --accent-2: #e23d3d; --on-accent: #ffffff; --radius: 6px; --radius-sm: 4px; --radius-btn: 6px;
  --shadow: 0 2px 0 rgba(30,42,68,.06), 0 18px 30px -22px rgba(30,42,68,.35);
  --font: 'Atkinson Hyperlegible', system-ui, sans-serif; --font-display: 'Atkinson Hyperlegible', system-ui, sans-serif; --font-mono: 'Courier Prime', ui-monospace, monospace;
  --h-weight: 700; --h-track: -0.02em;
  --card-bg: #ffffff; --card-border: 1px solid #d7deea; --chip-bg: #eef3fd; --chip-border: 1px solid #c9d6ea; --chip-text: #1d3f9e;
  --logo-a: #1d4ed8; --logo-b: #1e2a44; --logo-dot: #e23d3d;
}
[data-theme="notebook"] body { background-image: linear-gradient(rgba(29,78,216,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(29,78,216,.07) 1px, transparent 1px); background-size: 24px 24px; }
[data-theme="notebook"] body::before { content: ''; position: fixed; top: 0; bottom: 0; inset-inline-start: clamp(10px, 3vw, 44px); width: 2px; background: rgba(226,61,61,.45); pointer-events: none; z-index: 0; }
[data-theme="notebook"] .hero-kicker, [data-theme="notebook"] .sec-label { font-family: 'Caveat', cursive; font-size: 1.55rem; letter-spacing: 0; text-transform: none; color: var(--accent); font-weight: 700; }
html[lang="ar"][data-theme="notebook"] .hero-kicker, html[lang="ar"][data-theme="notebook"] .sec-label { font-family: var(--font); font-size: 1rem; }
[data-theme="notebook"] .hero-kicker { transform: rotate(-2deg); transform-origin: left; display: inline-block; }
[data-theme="notebook"] .hero-name { font-size: clamp(2.5rem, 6.6vw, 4.8rem); }
[data-theme="notebook"] .hero-title { background: linear-gradient(transparent 62%, rgba(255,226,92,.65) 62%); display: inline; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
[data-theme="notebook"] .hero-sub { margin-top: 22px; }
[data-theme="notebook"] .hero-panel { background: repeating-linear-gradient(180deg, #ffffff 0 31px, #d9e3f3 31px 32px); border: 1px solid #d7deea; border-top: 3px solid var(--accent-2); border-radius: 4px; transform: rotate(1.2deg); overflow: visible; }
[data-theme="notebook"] .hero-panel::before { content: ''; position: absolute; top: -14px; inset-inline-start: 38%; width: 110px; height: 26px; background: rgba(255,226,92,.7); transform: rotate(-4deg); }
[data-theme="notebook"] .hp-logo, [data-theme="notebook"] .hp-orbit { display: none; }
[data-theme="notebook"] .hp-cmd { display: block; font-family: 'Caveat', cursive; font-size: 1.5rem; color: var(--accent-2); }
[data-theme="notebook"] .hp-cmd span { display: none; }
[data-theme="notebook"] .hp-facts div { border-bottom: 0; }
[data-theme="notebook"] .hp-facts dt { font-family: var(--font-mono); }
[data-theme="notebook"] .hp-stack li { background: #fff; font-family: var(--font-mono); }
[data-theme="notebook"] .sec-index { font-family: var(--font-mono); color: var(--accent-2); }
[data-theme="notebook"] .sec-index::before { content: 'Exp. '; }
html[lang="fr"][data-theme="notebook"] .sec-index::before { content: 'Exp. '; }
html[lang="ar"][data-theme="notebook"] .sec-index::before { content: 'تجربة '; }
[data-theme="notebook"] .card { position: relative; box-shadow: var(--shadow); }
[data-theme="notebook"] .card::before { content: ''; position: absolute; top: -9px; inset-inline-start: 22px; width: 64px; height: 18px; background: rgba(255,226,92,.6); transform: rotate(-3deg); pointer-events: none; }
[data-theme="notebook"] .about-photo::before, [data-theme="notebook"] .work-card::before { z-index: 2; }
[data-theme="notebook"] .stats-grid { background: none; border: 0; gap: 14px; overflow: visible; }
[data-theme="notebook"] .stat { background: #fff; border: 1px solid #d7deea; border-radius: 4px; }
[data-theme="notebook"] .stat strong { font-family: 'Caveat', cursive; font-size: clamp(2.6rem, 5vw, 3.4rem); color: var(--accent); font-weight: 700; letter-spacing: 0; }
[data-theme="notebook"] .work-media-empty { background: repeating-linear-gradient(180deg, #fff 0 23px, #dfe7f5 23px 24px); }
[data-theme="notebook"] .work-num { font-family: 'Caveat', cursive; color: rgba(29,78,216,.5); }
[data-theme="notebook"] .ticks li::before { content: '✓'; background: none; transform: none; width: auto; height: auto; top: 0; color: var(--accent); font-weight: 700; }
[data-theme="notebook"] .site-head.scrolled { background: rgba(253,252,247,.92); }
@media (max-width: 860px) { [data-theme="notebook"] .hero-panel { transform: none; } }

/* 6. LIGHTBOX: radiology reading room */
[data-theme="lightbox"] {
  --bg: #05080c; --bg-2: #0a1017; --surface: #0c141c; --surface-2: #111c27; --text: #e4eef5; --muted: #8ba0b2; --line: #1c2a36;
  --accent: #7fd6ff; --accent-2: #f6c445; --on-accent: #03111a; --radius: 6px; --radius-sm: 4px; --radius-btn: 4px;
  --shadow: 0 0 0 1px #1c2a36, 0 40px 80px -40px rgba(127,214,255,.25);
  --font: 'Barlow', system-ui, sans-serif; --font-display: 'Chakra Petch', system-ui, sans-serif; --font-mono: 'Azeret Mono', ui-monospace, monospace;
  --h-weight: 600; --h-track: -0.01em;
  --card-bg: #0a1118; --card-border: 1px solid #1c2a36; --chip-bg: #0f1a24; --chip-border: 1px solid #22384a; --chip-text: #bfe9ff;
  --logo-a: #ffffff; --logo-b: #9fb6c8; --logo-dot: #7fd6ff;
}
[data-theme="lightbox"] .hero-bg span:nth-child(1) { inset: 0; background: radial-gradient(60% 70% at 75% 40%, rgba(127,214,255,.08), transparent 70%); }
[data-theme="lightbox"] .hero-name { text-transform: uppercase; letter-spacing: .01em; font-size: clamp(2.3rem, 6.4vw, 4.6rem); }
html[lang="ar"][data-theme="lightbox"] .hero-name { text-transform: none; letter-spacing: 0; }
[data-theme="lightbox"] .hero-kicker { color: var(--accent-2); }
[data-theme="lightbox"] .hero-panel { background: #000; border: 1px solid #22384a; border-radius: 6px; }
[data-theme="lightbox"] .hp-bar { display: flex; background: #070c11; color: var(--accent-2); font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em; }
[data-theme="lightbox"] .hp-bar i { width: 8px; height: 8px; border-radius: 1px; background: #22384a; }
[data-theme="lightbox"] .hp-bar i:first-child { background: var(--accent-2); }
[data-theme="lightbox"] .hp-logo { aspect-ratio: 1.3; background: radial-gradient(ellipse 34% 42% at 50% 50%, rgba(200,220,235,.32), rgba(120,140,160,.12) 60%, transparent 72%), radial-gradient(ellipse 46% 52% at 50% 50%, transparent 66%, rgba(200,220,235,.16) 70%, transparent 74%), #000; border: 1px solid #14202b; }
[data-theme="lightbox"] .hp-logo .logo-mark { width: 30%; filter: drop-shadow(0 0 18px rgba(127,214,255,.35)); opacity: .92; }
[data-theme="lightbox"] .hp-orbit { border-radius: 0; border: 0; inset: 0; }
[data-theme="lightbox"] .hp-orbit.o1 { background: linear-gradient(var(--accent-2), var(--accent-2)) 50% 18% / 1px 14% no-repeat, linear-gradient(var(--accent-2), var(--accent-2)) 50% 82% / 1px 14% no-repeat, linear-gradient(var(--accent-2), var(--accent-2)) 15% 50% / 12% 1px no-repeat, linear-gradient(var(--accent-2), var(--accent-2)) 85% 50% / 12% 1px no-repeat; opacity: .7; }
[data-theme="lightbox"] .hp-orbit.o2 { animation: none; opacity: 1; }
[data-theme="lightbox"] .hp-logo::before { content: 'W 400  L 40'; position: absolute; top: 10px; inset-inline-start: 12px; font: 500 .66rem/1 var(--font-mono); color: #9fb6c8; direction: ltr; }
[data-theme="lightbox"] .hp-logo::after { content: 'AX 1/1 · 0.5 mm'; position: absolute; bottom: 10px; inset-inline-end: 12px; font: 500 .66rem/1 var(--font-mono); color: #9fb6c8; direction: ltr; }
[data-theme="lightbox"] .hp-facts dt { color: var(--accent); }
[data-theme="lightbox"] .sec-index { font-family: var(--font-mono); color: var(--on-accent); background: var(--accent-2); padding: .3em .5em; border-radius: 2px; }
[data-theme="lightbox"] .sec-index::before { content: 'SE '; }
[data-theme="lightbox"] .sec-title { text-transform: uppercase; letter-spacing: .02em; font-size: clamp(1.6rem, 3.6vw, 2.6rem); }
html[lang="ar"][data-theme="lightbox"] .sec-title { text-transform: none; letter-spacing: 0; }
[data-theme="lightbox"] .card { position: relative; }
[data-theme="lightbox"] .card::after { content: ''; position: absolute; top: -1px; inset-inline-start: 18px; width: 34px; height: 2px; background: var(--accent); pointer-events: none; }
[data-theme="lightbox"] .stat { background: #070c11; }
[data-theme="lightbox"] .stat strong { font-family: var(--font-mono); font-weight: 500; color: var(--accent); text-shadow: 0 0 22px rgba(127,214,255,.35); font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
[data-theme="lightbox"] .work-media-empty { background: radial-gradient(ellipse 40% 50% at 70% 50%, rgba(200,220,235,.18), transparent 70%), #000; }
[data-theme="lightbox"] .work-num { color: rgba(127,214,255,.25); font-family: var(--font-mono); }
[data-theme="lightbox"] .cc { background: var(--accent-2); color: #111; }
[data-theme="lightbox"] .btn-primary { background: var(--accent); }
[data-theme="lightbox"] .ticks li::before { border-radius: 0; transform: none; width: .7em; height: 1px; top: .9em; background: var(--accent-2); }

/* 7. ANDALUS: horseshoe arches, lattice screens, indigo and saffron */
[data-theme="andalus"] {
  --bg: #faf7f0; --bg-2: #f3eee2; --surface: #ffffff; --surface-2: #f2ede1; --text: #182046; --muted: #4e5578; --line: #e3dccb;
  --accent: #2b3a8c; --accent-2: #e39b2d; --on-accent: #ffffff; --radius: 16px; --radius-sm: 10px; --radius-btn: 999px;
  --shadow: 0 30px 60px -40px rgba(24,32,70,.45);
  --font: 'Mulish', system-ui, sans-serif; --font-display: 'Marcellus', Georgia, serif; --font-mono: 'Mulish', sans-serif;
  --h-weight: 400; --h-track: 0;
  --card-bg: #ffffff; --card-border: 1px solid #e3dccb; --chip-bg: #f2ede1; --chip-border: 1px solid #e3dccb; --chip-text: #2b3a8c;
  --logo-a: #2b3a8c; --logo-b: #182046; --logo-dot: #e39b2d;
}
html[lang="ar"][data-theme="andalus"] body { --font-display: 'Amiri', 'IBM Plex Sans Arabic', serif; }
html[lang="ar"][data-theme="andalus"] h1, html[lang="ar"][data-theme="andalus"] h2 { font-weight: 700; }
[data-theme="andalus"] .hero-bg span:nth-child(1) { inset: 0 0 auto 0; height: 46px; opacity: .55; background: repeating-linear-gradient(45deg, transparent 0 9px, rgba(43,58,140,.35) 9px 10px), repeating-linear-gradient(-45deg, transparent 0 9px, rgba(43,58,140,.35) 9px 10px); }
[data-theme="andalus"] .hero { border-bottom: 1px solid var(--line); }
[data-theme="andalus"] .hero-name { font-size: clamp(2.7rem, 7vw, 5.4rem); }
[data-theme="andalus"] .hero-kicker { color: #b86f10; font-family: var(--font); font-weight: 700; }
[data-theme="andalus"] .hero-panel { border-radius: 999px 999px 18px 18px / 260px 260px 18px 18px; background: #fff; border: 1px solid var(--line); }
[data-theme="andalus"] .hp-body { padding-top: 0; }
[data-theme="andalus"] .hp-logo { aspect-ratio: 1.25; margin: 0 -30px 18px; border-radius: 999px 999px 0 0 / 260px 260px 0 0; background: repeating-linear-gradient(45deg, transparent 0 13px, rgba(255,255,255,.22) 13px 15px), repeating-linear-gradient(-45deg, transparent 0 13px, rgba(255,255,255,.22) 13px 15px), linear-gradient(180deg, #2b3a8c, #182046); }
[data-theme="andalus"] .hp-logo .logo-mark { width: 30%; --logo-a: #ffffff; --logo-b: #f6d9a8; --logo-dot: #e39b2d; filter: drop-shadow(0 8px 20px rgba(0,0,0,.35)); }
[data-theme="andalus"] .hp-orbit { border-radius: 999px 999px 0 0 / 200px 200px 0 0; inset: 12% 22% 0; border: 2px solid rgba(227,155,45,.8); border-bottom: 0; animation: none; }
[data-theme="andalus"] .hp-orbit.o2 { inset: 22% 30% 0; opacity: 1; border: 1px solid rgba(255,255,255,.5); border-bottom: 0; }
[data-theme="andalus"] .btn-primary { background: var(--accent); }
[data-theme="andalus"] .btn-ghost { border-color: var(--accent-2); }
[data-theme="andalus"] .sec-head { text-align: center; margin-inline: auto; }
[data-theme="andalus"] .sec-kicker { justify-content: center; }
[data-theme="andalus"] .sec-intro { margin-inline: auto; }
[data-theme="andalus"] .sec-index { display: inline-grid; place-items: center; width: 36px; height: 44px; border-radius: 999px 999px 4px 4px / 30px 30px 4px 4px; background: var(--accent); color: #fff; padding-top: 6px; }
[data-theme="andalus"] .sec-title { font-size: clamp(2rem, 4.4vw, 3.2rem); }
[data-theme="andalus"] .sec-head::after { content: '◆'; display: block; margin-top: 18px; color: var(--accent-2); font-size: .8rem; letter-spacing: 1.2em; }
[data-theme="andalus"] .card { border-radius: 120px 120px 14px 14px / 46px 46px 14px 14px; }
[data-theme="andalus"] .about-photo, [data-theme="andalus"] .work-card { border-radius: 999px 999px 16px 16px / 120px 120px 16px 16px; }
[data-theme="andalus"] .about-photo img { aspect-ratio: 4 / 4.4; }
[data-theme="andalus"] .faq-item { border-radius: 14px; }
[data-theme="andalus"] .stats-grid { background: var(--line); border-color: var(--line); }
[data-theme="andalus"] .stat { background: #fff; text-align: center; justify-items: center; }
[data-theme="andalus"] .stat strong { font-family: var(--font-display); font-weight: 400; color: var(--accent); }
[data-theme="andalus"] .work-media-empty { background: repeating-linear-gradient(45deg, transparent 0 13px, rgba(255,255,255,.2) 13px 15px), repeating-linear-gradient(-45deg, transparent 0 13px, rgba(255,255,255,.2) 13px 15px), linear-gradient(180deg, #2b3a8c, #182046); }
[data-theme="andalus"] .work-num { color: rgba(255,255,255,.85); font-family: var(--font-display); }
[data-theme="andalus"] .work-country { color: #fff; border-color: rgba(255,255,255,.5); }
[data-theme="andalus"] .cc { background: var(--accent-2); color: #182046; }
[data-theme="andalus"] .ticks li::before { background: var(--accent-2); }
[data-theme="andalus"] .svc-icon { border-radius: 999px 999px 6px 6px / 26px 26px 6px 6px; }

/* 8. LATENT SPACE: embedding clusters on deep navy */
[data-theme="latent"] {
  --bg: #070b1a; --bg-2: #0b1124; --surface: rgba(255,255,255,.035); --surface-2: rgba(255,255,255,.06); --text: #eaf0ff; --muted: #93a0c4; --line: #1c2546;
  --accent: #5eead4; --accent-2: #ff8fb1; --on-accent: #04201b; --radius: 14px; --radius-sm: 10px; --radius-btn: 10px;
  --shadow: 0 30px 70px -40px rgba(94,234,212,.25);
  --font: 'Rubik', system-ui, sans-serif; --font-display: 'Rubik', system-ui, sans-serif; --font-mono: 'Fira Code', ui-monospace, monospace;
  --h-weight: 600; --h-track: -0.025em;
  --card-bg: rgba(12,18,38,.85); --card-border: 1px solid #1c2546; --chip-bg: #0d1430; --chip-border: 1px solid #222c55; --chip-text: #d5defc;
  --logo-a: #5eead4; --logo-b: #6aa8ff; --logo-dot: #ff8fb1;
}
[data-theme="latent"] body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .55;
  background-image: radial-gradient(circle, #5eead4 0 1.6px, transparent 2px), radial-gradient(circle, #ff8fb1 0 1.6px, transparent 2px), radial-gradient(circle, #ffc66d 0 1.6px, transparent 2px), radial-gradient(circle, #6aa8ff 0 1.6px, transparent 2px);
  background-size: 37px 41px, 53px 47px, 61px 59px, 43px 67px; background-position: 0 0, 19px 11px, 7px 31px, 29px 5px;
  mask-image: radial-gradient(40% 35% at 15% 25%, #000, transparent 70%), radial-gradient(30% 30% at 85% 70%, #000, transparent 70%); -webkit-mask-image: radial-gradient(40% 35% at 15% 25%, #000, transparent 70%), radial-gradient(30% 30% at 85% 70%, #000, transparent 70%); }
[data-theme="latent"] .hero-name { font-size: clamp(2.5rem, 6.8vw, 5rem); }
[data-theme="latent"] .hero-kicker { color: var(--accent); }
[data-theme="latent"] .hp-bar { display: flex; font-family: var(--font-mono); }
[data-theme="latent"] .hp-bar i:nth-child(1) { background: #5eead4; } [data-theme="latent"] .hp-bar i:nth-child(2) { background: #ff8fb1; } [data-theme="latent"] .hp-bar i:nth-child(3) { background: #ffc66d; }
[data-theme="latent"] .hp-logo { aspect-ratio: 1.45; border-inline-start: 1px solid #2a3566; border-bottom: 1px solid #2a3566; border-radius: 0; margin-inline-start: 8px;
  background-image: radial-gradient(circle at 22% 30%, #5eead4 0 3px, transparent 4px), radial-gradient(circle at 26% 38%, #5eead4 0 3px, transparent 4px), radial-gradient(circle at 18% 41%, #5eead4 0 2.5px, transparent 3.5px), radial-gradient(circle at 31% 27%, #5eead4 0 2px, transparent 3px),
    radial-gradient(circle at 74% 26%, #ff8fb1 0 3px, transparent 4px), radial-gradient(circle at 80% 33%, #ff8fb1 0 2.5px, transparent 3.5px), radial-gradient(circle at 70% 36%, #ff8fb1 0 2px, transparent 3px),
    radial-gradient(circle at 66% 78%, #ffc66d 0 3px, transparent 4px), radial-gradient(circle at 72% 72%, #ffc66d 0 2.5px, transparent 3.5px), radial-gradient(circle at 60% 82%, #ffc66d 0 2px, transparent 3px),
    radial-gradient(circle at 24% 76%, #6aa8ff 0 3px, transparent 4px), radial-gradient(circle at 32% 70%, #6aa8ff 0 2.5px, transparent 3.5px), radial-gradient(circle at 20% 68%, #6aa8ff 0 2px, transparent 3px); }
[data-theme="latent"] .hp-logo .logo-mark { width: 22%; filter: drop-shadow(0 0 24px rgba(94,234,212,.35)); }
[data-theme="latent"] .hp-orbit { border-color: rgba(94,234,212,.18); inset: 18% 34%; }
[data-theme="latent"] .hp-orbit.o2 { inset: 8% 26%; border-color: rgba(255,143,177,.2); }
[data-theme="latent"] .hp-logo::after { content: 'dim 1 →'; position: absolute; bottom: -18px; inset-inline-end: 0; font: 400 .64rem/1 var(--font-mono); color: var(--muted); }
[data-theme="latent"] .chips li { display: inline-flex; align-items: center; gap: 6px; }
[data-theme="latent"] .chips li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #5eead4; }
[data-theme="latent"] .chips li:nth-child(4n+2)::before { background: #ff8fb1; } [data-theme="latent"] .chips li:nth-child(4n+3)::before { background: #ffc66d; } [data-theme="latent"] .chips li:nth-child(4n+4)::before { background: #6aa8ff; }
[data-theme="latent"] .sec-index { color: var(--accent-2); }
[data-theme="latent"] .sec-index::before { content: '● '; }
[data-theme="latent"] .stats-grid { background: none; border: 0; gap: 14px; overflow: visible; }
[data-theme="latent"] .stat { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); }
[data-theme="latent"] .stat strong { color: #5eead4; } [data-theme="latent"] .stat:nth-child(2) strong { color: #ff8fb1; } [data-theme="latent"] .stat:nth-child(3) strong { color: #ffc66d; } [data-theme="latent"] .stat:nth-child(4) strong { color: #6aa8ff; }
[data-theme="latent"] .work-media-empty { background-image: radial-gradient(circle at 30% 40%, #5eead4 0 3px, transparent 4px), radial-gradient(circle at 36% 48%, #5eead4 0 2px, transparent 3px), radial-gradient(circle at 70% 30%, #ff8fb1 0 3px, transparent 4px), radial-gradient(circle at 64% 62%, #ffc66d 0 3px, transparent 4px), linear-gradient(135deg, #0b1330, #0a0f22); }
[data-theme="latent"] .work-num { color: rgba(234,240,255,.16); }
[data-theme="latent"] .cc { background: #6aa8ff; color: #06112a; }
[data-theme="latent"] .btn-primary:hover { box-shadow: 0 10px 30px -10px rgba(94,234,212,.7); }

/* 9. BENTO: rounded tiles in fresh colours */
[data-theme="bento"] {
  --bg: #eef1f6; --bg-2: #e6eaf1; --surface: #ffffff; --surface-2: #f4f6fa; --text: #101318; --muted: #4b5262; --line: #dde2ec;
  --accent: #101318; --accent-2: #ff5a36; --on-accent: #ffffff; --radius: 28px; --radius-sm: 18px; --radius-btn: 999px;
  --shadow: 0 1px 0 rgba(16,19,24,.04);
  --font: 'Gabarito', system-ui, sans-serif; --font-display: 'Gabarito', system-ui, sans-serif; --font-mono: 'Gabarito', system-ui, sans-serif;
  --h-weight: 800; --h-track: -0.035em;
  --card-bg: #ffffff; --card-border: 0; --chip-bg: #eef1f6; --chip-border: 0; --chip-text: #101318;
  --logo-a: #101318; --logo-b: #101318; --logo-dot: #ff5a36; --hero-cols: minmax(0, 1.05fr) minmax(0, .95fr);
}
[data-theme="bento"] .hero-main { background: #fff; border-radius: 32px; padding: clamp(24px, 4vw, 44px); }
[data-theme="bento"] .hero-grid { align-items: stretch; gap: 16px; }
[data-theme="bento"] .hero-name { font-size: clamp(2.5rem, 6vw, 4.6rem); }
[data-theme="bento"] .hero-kicker { color: var(--accent-2); font-weight: 700; }
[data-theme="bento"] .hero-status { background: #c8f0dc; border: 0; color: #0d3b26; font-weight: 600; }
[data-theme="bento"] .hero-panel { background: none; border: 0; box-shadow: none; overflow: visible; }
[data-theme="bento"] .hp-body { padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; height: 100%; }
[data-theme="bento"] .hp-logo { margin: 0; aspect-ratio: auto; min-height: 150px; border-radius: 28px; background: #f7efa6; }
[data-theme="bento"] .hp-logo .logo-mark { width: 44%; filter: none; }
[data-theme="bento"] .hp-orbit { display: none; }
[data-theme="bento"] .hp-facts { display: contents; }
[data-theme="bento"] .hp-facts div { grid-template-columns: 1fr; gap: 4px; padding: 18px 20px; border: 0; border-radius: 24px; background: #cfe3ff; align-content: end; }
[data-theme="bento"] .hp-facts div:nth-child(2) { background: #ffd8c2; } [data-theme="bento"] .hp-facts div:nth-child(3) { background: #c8f0dc; } [data-theme="bento"] .hp-facts div:nth-child(4) { background: #e3d9ff; }
[data-theme="bento"] .hp-facts dt { color: rgba(16,19,24,.6); font-family: var(--font); letter-spacing: .02em; }
[data-theme="bento"] .hp-facts dd { font-weight: 700; font-size: 1rem; }
[data-theme="bento"] .hp-stack { grid-column: 1 / -1; margin: 0; background: #fff; border-radius: 24px; padding: 16px; }
[data-theme="bento"] .hp-stack li { border-radius: 999px; font-family: var(--font); font-weight: 600; background: #eef1f6; border: 0; }
[data-theme="bento"] .sec-index { background: var(--text); color: #fff; padding: .45em .7em; border-radius: 999px; }
[data-theme="bento"] .sec-label { color: var(--text); font-weight: 600; }
[data-theme="bento"] .sec-title { font-size: clamp(2rem, 4.6vw, 3.4rem); }
[data-theme="bento"] .stats-grid { background: none; border: 0; gap: 16px; overflow: visible; }
[data-theme="bento"] .stat { border-radius: 28px; background: #cfe3ff; }
[data-theme="bento"] .stat:nth-child(2) { background: #ffd8c2; } [data-theme="bento"] .stat:nth-child(3) { background: #c8f0dc; } [data-theme="bento"] .stat:nth-child(4) { background: #f7efa6; }
[data-theme="bento"] .stat span { color: rgba(16,19,24,.72); }
[data-theme="bento"] .work-media-empty { background: #f7efa6; }
[data-theme="bento"] .work-card:nth-child(2) .work-media-empty { background: #cfe3ff; } [data-theme="bento"] .work-card:nth-child(3) .work-media-empty { background: #ffd8c2; } [data-theme="bento"] .work-card:nth-child(4) .work-media-empty { background: #c8f0dc; }
[data-theme="bento"] .work-num { color: rgba(16,19,24,.85); }
[data-theme="bento"] .work-media { border-bottom: 0; margin: 10px 10px 0; border-radius: 20px; }
[data-theme="bento"] .cc { background: var(--accent-2); color: #fff; }
[data-theme="bento"] .svc-icon { background: #f7efa6; color: var(--text); border-radius: 16px; }
[data-theme="bento"] .eng-n { background: var(--accent-2); }
[data-theme="bento"] .faq-item { border-radius: 22px; background: #fff; border: 0; }
[data-theme="bento"] .contact-form input, [data-theme="bento"] .contact-form select, [data-theme="bento"] .contact-form textarea { background: #f4f6fa; border-color: transparent; }
[data-theme="bento"] .ticks li::before { border-radius: 50%; transform: none; background: var(--accent-2); }

/* 10. NOCTURNE: dark editorial, italic serif, roman numerals */
[data-theme="nocturne"] {
  --bg: #0e1513; --bg-2: #121b18; --surface: #131c19; --surface-2: #18231f; --text: #ede8dc; --muted: #a6aca3; --line: #2a332f;
  --accent: #e8b4c8; --accent-2: #b9d7c4; --on-accent: #1b0f14; --radius: 4px; --radius-sm: 4px; --radius-btn: 999px;
  --shadow: none;
  --font: 'Schibsted Grotesk', system-ui, sans-serif; --font-display: 'Instrument Serif', Georgia, serif; --font-mono: 'Schibsted Grotesk', sans-serif;
  --h-weight: 400; --h-track: -0.01em;
  --card-bg: transparent; --card-border: 0; --chip-bg: transparent; --chip-border: 1px solid #36403b; --chip-text: #d9d3c6;
  --logo-a: #ede8dc; --logo-b: #e8b4c8; --logo-dot: #e8b4c8; --hero-cols: minmax(0, 1.55fr) minmax(0, .65fr);
}
[data-theme="nocturne"] main { counter-reset: sec; }
[data-theme="nocturne"] .sec { counter-increment: sec; }
[data-theme="nocturne"] .hero-name { font-size: clamp(3rem, 9vw, 7.2rem); font-style: italic; line-height: .95; }
html[lang="ar"][data-theme="nocturne"] .hero-name { font-style: normal; line-height: 1.15; }
[data-theme="nocturne"] .hero-title { font-family: var(--font-display); font-size: clamp(1.4rem, 2.8vw, 2rem); font-weight: 400; }
[data-theme="nocturne"] .hero-kicker { color: var(--accent); letter-spacing: .16em; }
[data-theme="nocturne"] .hero-status { border-color: #36403b; background: none; }
[data-theme="nocturne"] .hero-panel { background: none; border: 0; border-inline-start: 1px solid #36403b; border-radius: 0; box-shadow: none; }
[data-theme="nocturne"] .hp-logo { aspect-ratio: auto; height: 84px; justify-items: start; margin-bottom: 18px; }
[data-theme="nocturne"] .hp-logo .logo-mark { width: 64px; filter: none; }
[data-theme="nocturne"] .hp-orbit { display: none; }
[data-theme="nocturne"] .hp-body { padding: 4px 0 4px 26px; }
[dir="rtl"][data-theme="nocturne"] .hp-body { padding: 4px 26px 4px 0; }
[data-theme="nocturne"] .hp-facts div { display: flex; align-items: baseline; gap: 8px; border: 0; padding: 0; }
[data-theme="nocturne"] .hp-facts dt { order: 0; white-space: nowrap; }
[data-theme="nocturne"] .hp-facts div::after { content: ''; order: 1; flex: 1; border-bottom: 1px dotted #4a5550; min-width: 12px; transform: translateY(-4px); }
[data-theme="nocturne"] .hp-facts dd { order: 2; text-align: end; font-family: var(--font-display); font-size: 1.05rem; }
[data-theme="nocturne"] .hp-stack li { border-radius: 999px; }
[data-theme="nocturne"] .sec-index { font-size: 0; }
[data-theme="nocturne"] .sec-index::after { content: counter(sec, upper-roman) '.'; font: italic 400 1.5rem/1 var(--font-display); color: var(--accent); letter-spacing: 0; }
[data-theme="nocturne"] .sec-title { font-size: clamp(2.2rem, 5.2vw, 4rem); }
[data-theme="nocturne"] .sec-title em, [data-theme="nocturne"] .card h3 { font-style: italic; }
[data-theme="nocturne"] .card h3 { font-size: 1.5rem; }
[data-theme="nocturne"] .card { border-top: 1px solid #36403b; padding-inline: 0 !important; }
[data-theme="nocturne"] .sec + .sec { border-top: 1px solid var(--line); }
[data-theme="nocturne"] .stats-grid { background: none; border: 0; border-block: 1px solid #36403b; border-radius: 0; gap: 0; }
[data-theme="nocturne"] .stat { background: none; border-inline-end: 1px solid #36403b; }
[data-theme="nocturne"] .stat:last-child { border-inline-end: 0; }
[data-theme="nocturne"] .stat strong { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: clamp(2.4rem, 5vw, 3.6rem); color: var(--accent); }
[data-theme="nocturne"] .work-media-empty { background: radial-gradient(90% 120% at 100% 0%, rgba(232,180,200,.16), transparent 60%), #121b18; }
[data-theme="nocturne"] .work-num { font-family: var(--font-display); font-style: italic; color: rgba(237,232,220,.2); }
[data-theme="nocturne"] .cc { background: none; border: 1px solid var(--accent); color: var(--accent); }
[data-theme="nocturne"] .svc-icon, [data-theme="nocturne"] .eng-n { background: none; border: 1px solid #36403b; color: var(--accent); border-radius: 50%; }
[data-theme="nocturne"] .faq-item { border: 0; border-top: 1px solid #36403b; border-radius: 0; background: none; padding: 0; }
[data-theme="nocturne"] .btn-primary { background: var(--accent); }
[data-theme="nocturne"] .ticks li::before { content: '·'; background: none; transform: none; width: auto; height: auto; top: 0; color: var(--accent); font-weight: 700; }
@media (max-width: 860px) { [data-theme="nocturne"] .hero-panel { border-inline-start: 0; border-top: 1px solid #36403b; } [data-theme="nocturne"] .hp-body { padding: 20px 0 0 !important; } }

/* certificates */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.cert { padding: 18px 20px; display: grid; gap: 8px; align-content: start; }
.cert-top { display: flex; justify-content: space-between; gap: 10px; font: 500 .74rem/1.3 var(--font-mono); color: var(--muted); }
.cert-issuer { color: var(--accent); font-weight: 600; }
.cert h3 { font-size: 1.02rem !important; line-height: 1.3; }
.cert p { font-size: .88rem; }
.cv-links { font-size: 8.5pt; margin-top: 1px; }

/* optional photo in About */
.about-photo { padding: 0 !important; overflow: hidden; }
.about-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 22%; }

/* awards & community */
.comm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 18px; }
.comm { padding: 22px; display: grid; gap: 10px; align-content: start; }
.comm-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.comm-year { font: 700 .82rem/1 var(--font-mono); color: var(--accent); }
.comm-type { font: 500 .72rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line); padding: .4em .6em; border-radius: 999px; }
html[lang="ar"] .comm-type { text-transform: none; letter-spacing: 0; font-family: var(--font); }
.comm p { font-size: .94rem; }
@media (max-width: 560px) { [data-theme="histology"] .hero-bg span { opacity: .35 !important; } [data-theme="histology"] .hero-bg span:nth-child(3) { display: none; } }
