/* Curriculum vitae — an A4 sheet that prints exactly as it looks. */
:root { --ink: #151a26; --ink-2: #3b4254; --muted: #6c7386; --line: #e3e0d6; --navy: #14294b; --gold: #a9812d; --gold-2: #c9a04a; --paper: #fffefb; --bg: #0b1020;
  --display: 'Fraunces', Georgia, serif; --sans: 'Inter', system-ui, sans-serif; --ar: 'Readex Pro', system-ui, sans-serif; --ar-display: 'Alexandria', 'Readex Pro', sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 10.3pt/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
[lang="ar"] body { font-family: var(--ar); font-size: 10.6pt; line-height: 1.75; }
a { color: inherit; text-decoration: none; }
.cv-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; width: min(210mm, calc(100% - 24px)); margin: 0 auto; padding: 14px 0; }
.cv-sp { flex: 1; }
.cv-b { padding: 9px 16px; border-radius: 11px; font: 600 13.5px/1 var(--sans); cursor: pointer; }
[lang="ar"] .cv-b { font-family: var(--ar); }
.cv-b.ghost { color: #dfe4f0; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .05); }
.cv-b.gold { color: #120d04; background: linear-gradient(135deg, #f6dfa6, #d8a650); }
.sheet { width: min(210mm, calc(100% - 24px)); min-height: 297mm; margin: 0 auto 40px; padding: 15mm 15mm 13mm; background: var(--paper); box-shadow: 0 30px 90px rgba(0, 0, 0, .5); border-radius: 4px; }

.head { display: grid; grid-template-columns: minmax(0, 1fr) 30mm; gap: 8mm; align-items: center; padding-bottom: 6mm; border-bottom: 1.6pt solid var(--navy); }
.head h1 { margin: 0; font: 600 25pt/1.08 var(--display); letter-spacing: -.02em; color: var(--navy); }
[lang="ar"] .head h1 { font-family: var(--ar-display); font-weight: 700; font-size: 23pt; line-height: 1.4; letter-spacing: 0; }
.head .role { margin: 2.2mm 0 0; font-size: 11.2pt; font-weight: 600; color: var(--gold); }
.head .contacts { display: flex; flex-wrap: wrap; gap: 1mm 5mm; margin: 3.2mm 0 0; padding: 0; list-style: none; font-size: 9.2pt; color: var(--ink-2); }
.head .contacts li { display: inline-flex; gap: 1.6mm; align-items: baseline; }
.head .contacts b { color: var(--navy); font-weight: 600; }
.head img { width: 30mm; height: 36mm; object-fit: cover; object-position: 60% 16%; border-radius: 3mm; border: .6pt solid var(--line); }
section { margin-top: 5.6mm; break-inside: auto; }
h2 { display: flex; align-items: center; gap: 3mm; margin: 0 0 2.6mm; font: 700 9.4pt/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--navy); }
[lang="ar"] h2 { font-family: var(--ar-display); letter-spacing: 0; font-size: 11pt; }
h2 { break-after: avoid; }
section.keep, .pubs h4 { break-inside: avoid; }
.pubs h4 { break-after: avoid; }
h2::after { content: ''; flex: 1; height: .5pt; background: var(--line); }
h2::before { content: ''; width: 2.2mm; height: 2.2mm; border-radius: 50%; background: var(--gold-2); }
p { margin: 0; }
.sum { color: var(--ink-2); text-align: justify; }
.row { display: grid; grid-template-columns: 23mm minmax(0, 1fr); gap: 4mm; padding: 1.7mm 0; break-inside: avoid; }
.row + .row { border-top: .4pt dashed var(--line); }
.row .yr { font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; text-align: start; }
.row h3 { margin: 0; font: 600 10.6pt/1.35 var(--sans); color: var(--ink); }
[lang="ar"] .row h3 { font-family: var(--ar); font-size: 11pt; }
.row .org { color: var(--muted); font-size: 9.5pt; }
.row .note { display: inline-block; margin-top: .8mm; font-size: 9pt; font-weight: 600; color: var(--navy); }
.row ul { margin: 1mm 0 0; padding-inline-start: 4.2mm; color: var(--ink-2); font-size: 9.6pt; }
.tags { display: flex; flex-wrap: wrap; gap: 1.6mm; padding: 0; margin: 0; list-style: none; }
.tags li { padding: .9mm 2.6mm; border: .5pt solid var(--line); border-radius: 2mm; font-size: 9.2pt; color: var(--ink-2); background: #faf8f1; }
.pubs { margin: 0; padding: 0; list-style: none; counter-reset: p; }
.pubs h4 { margin: 2.6mm 0 1mm; font: 600 9.6pt/1.3 var(--sans); color: var(--gold); }
[lang="ar"] .pubs h4 { font-family: var(--ar); font-size: 10.2pt; }
.pubs li { position: relative; padding: .9mm 0 .9mm 7mm; font-size: 9.6pt; line-height: 1.45; color: var(--ink-2); break-inside: avoid; counter-increment: p; text-align: left; direction: ltr; font-family: var(--sans); }
.pubs li::before { content: '[' counter(p) ']'; position: absolute; left: 0; top: .9mm; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 8.8pt; }
.pubs li b { color: var(--ink); font-weight: 600; }
.pubs li i { font-style: italic; }
.pubs li a { color: var(--navy); word-break: break-all; }
.pubs li .st { font-weight: 600; color: var(--gold); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6mm 8mm; }
.prod { break-inside: avoid; padding: 1.2mm 0; }
.prod b { color: var(--ink); font-weight: 600; } .prod span { color: var(--muted); font-size: 9.3pt; }
.prod p { font-size: 9.3pt; color: var(--ink-2); line-height: 1.45; }
.prod a { color: var(--navy); font-size: 9pt; direction: ltr; unicode-bidi: isolate; }
.foot { margin-top: 6mm; padding-top: 2.6mm; border-top: .5pt solid var(--line); display: flex; justify-content: space-between; gap: 6mm; font-size: 8.4pt; color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: isolate; }

@media (max-width: 700px) { .sheet { padding: 22px 18px; } .head { grid-template-columns: minmax(0, 1fr) 74px; } .head img { width: 74px; height: 90px; } .grid2 { grid-template-columns: 1fr; } .row { grid-template-columns: 64px minmax(0, 1fr); } }
@page { size: A4; margin: 13mm 14mm; }
@media print {
  body { background: #fff; }
  .cv-bar { display: none; }
  .sheet { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; border-radius: 0; background: #fff; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
