/* Datasheet: cool paper, ink, one cobalt accent, a green status light. Light theme only. */
:root {
  --bg: #eceee8;
  --paper: #f6f7f3;
  --ink: #0f1513;
  --muted: #59625e;
  --line: #cdd2ca;
  --line-strong: #a9b0a7;
  --accent: #2443d4;
  --accent-soft: #dfe4fb;
  --led: #15a46a;
  --dark: #0f1513;
  --dark-text: #e8ece6;
  --dark-muted: #9aa49f;
  --dark-line: #2a332f;
  --on-dark: #8ea0ff;
  --sans: "Archivo", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
[lang="ar"] { --sans: "IBM Plex Sans Arabic", "Archivo", system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
  background-attachment: fixed;
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::before { /* wash the grid so it reads as texture, not pattern */
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 10; padding: 10px 14px; background: var(--ink); color: var(--bg); text-decoration: none; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }

/* mono labels share one voice */
.idx, .years, .status, .kicker, .id-text small, .specs dt, figcaption, .work-kind, .langs a, .bar-cv, .foot, .port, .hub-name, .hub-status, .chrome span, .contact-cards small, .stats span {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
[lang="ar"] :is(.status, .kicker, .specs dt, figcaption, .work-kind, .id-text small, .foot, .bar-cv, .hub-status, .contact-cards small, .stats span) {
  font-family: var(--sans); font-size: 13px; letter-spacing: 0; text-transform: none; font-weight: 500;
}

/* scroll reveal, where the browser supports scroll-driven animation */
@supports (animation-timeline: view()) {
  .rv { animation: rv linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
  @keyframes rv { from { opacity: 0; transform: translateY(28px); } }
}

/* top bar */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.id { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.id-mark { display: grid; place-items: center; width: 36px; height: 36px; flex: none; background: var(--ink); color: var(--bg); font: 500 13px/1 var(--mono); letter-spacing: .04em; }
.id-text { display: grid; line-height: 1.25; min-width: 0; }
.id-text b { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.id-text small { color: var(--muted); font-size: 11px; }
.bar-tools { display: flex; align-items: center; gap: 10px; }
.langs { display: flex; border: 1px solid var(--line-strong); }
.langs a { padding: 7px 10px; text-decoration: none; color: var(--muted); }
.langs a + a { border-inline-start: 1px solid var(--line-strong); }
.langs a[aria-current] { background: var(--ink); color: var(--bg); }
.langs a:hover:not([aria-current]) { color: var(--ink); }
.bar-cv { padding: 7px 12px; border: 1px solid var(--ink); text-decoration: none; }
.bar-cv:hover { background: var(--ink); color: var(--bg); }
@media (max-width: 560px) { .id-text small, .bar-cv { display: none; } }

main, .foot { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }

/* hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .75fr); gap: clamp(32px, 6vw, 96px);
  align-items: center; min-height: calc(100svh - 61px); padding-block: clamp(32px, 5vw, 64px);
}
.status { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.led { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--led); box-shadow: 0 0 0 4px color-mix(in srgb, var(--led) 22%, transparent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--led) 0%, transparent); } }
h1 { margin-top: 22px; font-weight: 800; font-size: clamp(40px, 6.6vw, 98px); line-height: .92; letter-spacing: -.045em; }
h1 span { display: block; white-space: nowrap; animation: rise .8s var(--ease) both; }
h1 span + span { animation-delay: .08s; color: var(--accent); }
[lang="ar"] h1 { font-weight: 700; letter-spacing: 0; line-height: 1.15; }
@keyframes rise { from { opacity: 0; transform: translateY(.3em); } }
.kicker { margin-top: 26px; font-size: 13px; }
.lede { margin-top: 18px; max-width: 58ch; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border: 1px solid var(--ink); text-decoration: none; font-weight: 600; font-size: 15px;
  transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn-solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-solid:hover { background: var(--ink); border-color: var(--ink); }
.arr { display: inline-block; transition: transform .2s; }
:is(.btn, .contact-mail):hover .arr { transform: translateX(4px); }
[dir="rtl"] .arr { transform: scaleX(-1); }
[dir="rtl"] :is(.btn, .contact-mail):hover .arr { transform: scaleX(-1) translateX(4px); }

.plate { position: relative; justify-self: end; width: 100%; max-width: 400px; background: var(--paper); border: 1px solid var(--line-strong); padding: 18px; animation: rise .9s .15s var(--ease) both; }
.plate::before, .plate::after { content: ""; position: absolute; width: 18px; height: 18px; border: 0 solid var(--ink); }
.plate::before { top: -7px; inset-inline-start: -7px; border-top-width: 2px; border-inline-start-width: 2px; }
.plate::after { bottom: -7px; inset-inline-end: -7px; border-bottom-width: 2px; border-inline-end-width: 2px; }
.photo { aspect-ratio: 4 / 5; overflow: hidden; background: var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .8s var(--ease); }
.plate:hover .photo img { transform: scale(1.03); }
figcaption { margin-top: 10px; color: var(--muted); font-size: 11px; }
.specs { margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.specs div { display: grid; gap: 4px; align-content: start; padding-block-start: 12px; padding-inline-end: 16px; }
.specs dt { color: var(--muted); font-size: 11px; }
.specs dd { margin: 0; font-weight: 500; font-size: 15px; }

/* sections */
.sec { padding-block: clamp(64px, 9vw, 120px); }
.sec-h { display: flex; align-items: baseline; gap: 18px; margin-bottom: clamp(32px, 4.5vw, 56px); padding-top: 18px; border-top: 1px solid var(--ink); }
.sec-h .idx { color: var(--accent); font-size: 13px; }
h2 { font-weight: 800; font-size: clamp(32px, 4.6vw, 56px); line-height: 1; letter-spacing: -.03em; }
[lang="ar"] h2 { letter-spacing: 0; font-weight: 700; line-height: 1.25; }
h3 { font-weight: 600; font-size: 20px; line-height: 1.3; letter-spacing: -.01em; }
[lang="ar"] h3 { letter-spacing: 0; }
.sec-intro { max-width: 62ch; color: var(--muted); margin-bottom: 36px; }

/* 01 profile: one statement, three figures, four short cards */
.statement { max-width: 30em; font-size: clamp(22px, 2.6vw, 34px); line-height: 1.35; letter-spacing: -.015em; font-weight: 500; }
[lang="ar"] .statement { letter-spacing: 0; line-height: 1.6; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: clamp(40px, 5vw, 64px); }
.stats li { border-top: 3px solid var(--accent); padding-top: 14px; }
.stats b { display: block; font-weight: 800; font-size: clamp(56px, 7vw, 96px); line-height: 1; letter-spacing: -.05em; }
[dir="rtl"] .stats b { text-align: right; }
.stats span { display: block; margin-top: 10px; color: var(--muted); max-width: 22ch; }
.pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: clamp(40px, 5vw, 64px); }
.pillars li { background: var(--paper); border: 1px solid var(--line-strong); padding: 20px; transition: transform .3s var(--ease), border-color .3s; }
.pillars li:hover { transform: translateY(-4px); border-color: var(--ink); }
.pillars .idx { color: var(--accent); font-size: 11px; }
.pillars h3 { margin-top: 18px; }
.pillars p { margin-top: 8px; color: var(--muted); font-size: 15px; line-height: 1.5; }

/* 02 skills: a core switch with six links */
.topo { --link: 56px; display: grid; grid-template-columns: minmax(0, 1fr) 220px minmax(0, 1fr); grid-template-rows: repeat(3, auto); gap: 20px 0; align-items: center; }
.hub {
  grid-column: 2; grid-row: 1 / 4; align-self: center;
  background: var(--ink); color: var(--dark-text); padding: 22px 18px; text-align: center; position: relative; z-index: 1;
}
.hub-name { font-size: 13px; color: #fff; }
.ports { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px auto; width: 120px; }
.ports li { aspect-ratio: 1.3; border: 1px solid var(--dark-line); background: #1b2321; display: grid; place-items: center; }
.ports i { width: 6px; height: 6px; border-radius: 50%; background: var(--led); animation: blink 1.6s steps(2, jump-none) infinite; }
.ports li:nth-child(2) i { animation-delay: .3s; } .ports li:nth-child(3) i { animation-delay: .9s; }
.ports li:nth-child(4) i { animation-delay: .5s; } .ports li:nth-child(5) i { animation-delay: 1.2s; } .ports li:nth-child(6) i { animation-delay: .7s; }
@keyframes blink { 50% { opacity: .25; } }
.hub-status { color: var(--dark-muted); font-size: 11px; }
.node { position: relative; background: var(--paper); border: 1px solid var(--line-strong); padding: 18px 20px; }
.n0, .n1, .n2 { grid-column: 1; margin-inline-end: var(--link); }
.n0 { grid-row: 1; } .n1 { grid-row: 2; } .n2 { grid-row: 3; }
.n3, .n4, .n5 { grid-column: 3; margin-inline-start: var(--link); }
.n3 { grid-row: 1; } .n4 { grid-row: 2; } .n5 { grid-row: 3; }
.node::after { /* the cable to the switch */
  content: ""; position: absolute; top: 50%; width: var(--link); height: 2px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 14px);
  background-size: 28px 2px; animation: flow 1.2s linear infinite;
}
.n0::after, .n1::after, .n2::after { inset-inline-start: 100%; }
.n3::after, .n4::after, .n5::after { inset-inline-end: 100%; animation-direction: reverse; }
@keyframes flow { to { background-position: 28px 0; } }
.node h3 { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.port { color: var(--accent); font-size: 11px; padding: 2px 6px; border: 1px solid var(--accent); }
.node ul { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.node li { padding: 3px 9px; border: 1px solid var(--line-strong); background: var(--bg); font-size: 14px; }

/* 03 experience: a timeline */
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; top: 8px; bottom: 8px; inset-inline-start: calc(10em + 20px); width: 2px; background: var(--line-strong); }
.tl { position: relative; display: grid; grid-template-columns: 10em 40px minmax(0, 1fr); padding-bottom: 28px; }
.tl .years { padding-top: 22px; color: var(--accent); font-size: 13px; unicode-bidi: isolate; }
.tl-dot { justify-self: center; margin-top: 24px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--ink); position: relative; z-index: 1; }
.tl-now .tl-dot { background: var(--led); border-color: var(--led); box-shadow: 0 0 0 5px color-mix(in srgb, var(--led) 22%, transparent); animation: pulse 2.4s ease-in-out infinite; }
.tl-card { background: var(--paper); border: 1px solid var(--line-strong); padding: clamp(20px, 2.6vw, 30px); transition: border-color .3s; }
.tl-card:hover { border-color: var(--ink); }
.tl-now .tl-card { border-inline-start: 4px solid var(--accent); }
.tl-card h3 { font-size: clamp(20px, 2vw, 24px); }
.tl-org { margin-top: 4px; font-size: 15px; }
.job-points { margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px; }
.job-points li { position: relative; padding-inline-start: 18px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.job-points li::before { content: ""; position: absolute; inset-inline-start: 0; top: .72em; width: 8px; height: 2px; background: var(--accent); }

/* 04 built: framed screenshots */
.works { display: grid; gap: 24px; }
.work { background: var(--paper); border: 1px solid var(--line-strong); display: grid; align-content: start; transition: transform .4s var(--ease), box-shadow .4s; }
.work:hover { transform: translateY(-6px); box-shadow: 0 24px 48px -28px rgba(15, 21, 19, .45); }
.work-big { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.work-shot { display: block; overflow: hidden; background: var(--ink); }
.chrome { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; background: #1b2321; }
.chrome i { width: 8px; height: 8px; border-radius: 50%; background: #3b4642; }
.chrome span { margin-inline-start: 10px; color: var(--dark-muted); font-size: 10px; text-transform: none; }
.work-shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; transition: transform .8s var(--ease); }
.work-big .work-shot img { aspect-ratio: 1200 / 630; }
.work:hover .work-shot img { transform: scale(1.04); }
.work-body { padding: 22px; display: grid; gap: 8px; align-content: start; }
.work-big .work-body { align-content: center; padding: clamp(24px, 3vw, 40px); }
.work-kind { color: var(--accent); font-size: 11px; }
.work-body > p:not(.work-kind) { color: var(--muted); font-size: 15px; }
.work-big h3 { font-size: clamp(26px, 3vw, 38px); letter-spacing: -.02em; }
.work-link { margin-top: 8px; font-weight: 600; font-size: 15px; text-decoration: none; border-bottom: 2px solid var(--accent); justify-self: start; }
.work-link:hover { color: var(--accent); }
.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }

/* 05 education: two degree cards and a certificate card */
.edu { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.degree { background: var(--paper); border: 1px solid var(--line-strong); padding: 24px; display: grid; gap: 6px; align-content: start; }
.degree:first-child { background: var(--ink); color: var(--dark-text); border-color: var(--ink); }
.degree:first-child .years { color: var(--on-dark); }
.degree:first-child .muted { color: var(--dark-muted); }
.degree h3 { margin-top: 18px; font-size: 22px; }
.degree p { font-size: 15px; }
.degree .years { font-size: 13px; color: var(--accent); }
.certs { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); padding: 24px; }
.certs h3 { font-size: 17px; margin-bottom: 8px; }
.certs li { display: flex; gap: 10px; padding: 8px 0; font-size: 15px; border-top: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); }
.certs li:first-child { border-top: 0; }
.tick { color: var(--accent); font-weight: 700; }

/* 06 contact: a dark plate with big targets */
.sec-dark { margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); background: var(--dark); color: var(--dark-text); }
.sec-dark .sec-h { border-top-color: var(--dark-text); }
.sec-dark .idx { color: var(--on-dark); }
.sec-dark :focus-visible { outline-color: var(--on-dark); }
.contact-h { font-weight: 800; font-size: clamp(40px, 7vw, 96px); line-height: .95; letter-spacing: -.045em; max-width: 12em; }
[lang="ar"] .contact-h { letter-spacing: 0; font-weight: 700; line-height: 1.25; }
.contact-text { margin-top: 20px; color: var(--dark-muted); max-width: 56ch; }
.contact-mail {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 32px; padding: 18px 26px;
  background: var(--on-dark); color: var(--ink); text-decoration: none;
  font: 500 clamp(16px, 2.2vw, 26px)/1.2 var(--mono); max-width: 100%; overflow-wrap: anywhere;
  transition: background .2s;
}
.contact-mail:hover { background: #fff; }
.contact-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 48px; }
.contact-cards > li > a, .cv-card { display: grid; gap: 8px; height: 100%; padding: 20px; border: 1px solid var(--dark-line); text-decoration: none; transition: border-color .2s, background .2s; }
.contact-cards > li > a:hover { border-color: var(--on-dark); background: #161d1b; }
.contact-cards small { color: var(--dark-muted); font-size: 11px; }
.contact-cards b { font-weight: 600; font-size: 17px; }
.cv-card span { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.cv-card a { font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--on-dark); }
.cv-card a:hover { color: var(--on-dark); }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 28px 40px; color: var(--muted); font-size: 11px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--accent); }

.nf { max-width: 640px; margin: 0 auto; padding: 18vh var(--gutter); }
.nf h1 { font-size: clamp(40px, 8vw, 72px); margin: 12px 0 24px; }

@media (max-width: 1040px) {
  .topo { grid-template-columns: 1fr; gap: 14px; }
  .hub { grid-column: 1; grid-row: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: start; }
  .ports { margin: 0; }
  .node, .n0, .n1, .n2, .n3, .n4, .n5 { grid-column: 1; grid-row: auto; margin-inline: var(--link) 0; }
  .node::after, .n3::after, .n4::after, .n5::after { inset-inline: auto 100%; animation-direction: normal; }
  .topo { position: relative; }
  .topo::before { content: ""; position: absolute; top: 40px; bottom: 40px; inset-inline-start: 0; width: 2px; background: var(--accent); }
  .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .hero, .work-big { grid-template-columns: 1fr; }
  .hero { min-height: 0; }
  .plate { justify-self: start; max-width: 340px; }
  .edu { grid-template-columns: 1fr 1fr; }
  .certs { grid-column: 1 / -1; }
  .job-points { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  :root { --link: 28px; }
  .topo { --link: 28px; }
  .work-grid, .edu, .stats, .pillars, .contact-cards { grid-template-columns: 1fr; }
  .stats { gap: 28px; }
  .specs { grid-template-columns: 1fr 1fr; }
  .specs div:last-child { grid-column: 1 / -1; }
  .timeline::before { inset-inline-start: 6px; }
  .tl { grid-template-columns: 14px minmax(0, 1fr); column-gap: 18px; }
  .tl .years { grid-column: 2; padding-top: 0; margin-bottom: 8px; }
  .tl-dot { grid-column: 1; grid-row: 1; margin-top: 2px; }
  .tl-card { grid-column: 2; }
  .hub { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
