/* ===== Tokens (from the Figma "Personal Portfolio" design) ===== */
:root {
  --bg: #0d1424;
  --bg-deep: #0a0f1c;
  --surface: #26324d;
  --surface-2: #1a2338;
  --surface-3: #141c2e;
  --line: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --text-2: #b7bfd1;
  --text-3: #8790a6;
  --accent: #f7a928;          /* tab underline / avatar tile */
  --accent-soft: rgba(247, 169, 40, 0.14);
  --glow-top: rgba(150, 66, 72, 0.55);
  --glow-bottom: rgba(98, 34, 196, 0.5);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: var(--font);
  --font-display: "Londrina Solid", "Poppins", system-ui, sans-serif;
}

/* English display headings: Londrina Solid (OFL 1.1, shipped unmodified — licence in assets/fonts) */
@font-face {
  font-family: "Londrina Solid";
  src: url("/assets/fonts/londrina-solid-regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
/* English: Londrina Solid everywhere (body, paragraphs, labels, buttons). Only the Regular weight ships,
   so turn off faux-bold — 500/600 text renders with the real face instead of a smeared synthetic bold. */
html:not(:lang(ar)) { --font: "Londrina Solid", system-ui, -apple-system, "Segoe UI", sans-serif; --font-head: var(--font); font-synthesis: none; }
html:not(:lang(ar)) body { font-size: 16.5px; letter-spacing: 0.015em; }
html:not(:lang(ar)) .name, html:not(:lang(ar)) .section-head h2, html:not(:lang(ar)) .modal-body h3,
html:not(:lang(ar)) .stats dd, html:not(:lang(ar)) .job h3, html:not(:lang(ar)) .skill-head h3,
html:not(:lang(ar)) .hl h3, html:not(:lang(ar)) .ach h3, html:not(:lang(ar)) .b-title {
  font-family: var(--font-display) !important; font-weight: 400; letter-spacing: 0.01em;
}
html:not(:lang(ar)) .name { font-size: 32px; line-height: 1.15; }
html:not(:lang(ar)) .section-head h2 { font-size: 34px; line-height: 1.1; }
html:not(:lang(ar)) .modal-body h3 { font-size: 28px; }
html:not(:lang(ar)) .job h3, html:not(:lang(ar)) .skill-head h3, html:not(:lang(ar)) .hl h3, html:not(:lang(ar)) .ach h3 { font-size: 19px; }
html:not(:lang(ar)) .b-title { font-size: 17px; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
.i { width: 18px; height: 18px; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--accent); color: #111; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 16px; }

/* Language switch (top corner, mirrors in RTL) */
.lang-switch {
  position: fixed; z-index: 60;
  top: 16px; inset-inline-end: 20px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(13, 20, 36, .72);
  border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-size: 13px; font-weight: 600; color: #fff;
  transition: background .2s, border-color .2s, transform .2s;
}
.lang-switch::before {
  content: ""; width: 15px; height: 15px; flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20M12 2a15 15 0 0 1 0 20M12 2a15 15 0 0 0 0 20'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20M12 2a15 15 0 0 1 0 20M12 2a15 15 0 0 0 0 20'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .8;
}
@media (max-width: 860px) { .lang-switch { position: absolute; top: 12px; inset-inline-end: 12px; } }
.lang-switch:hover { background: rgba(247, 169, 40, .16); border-color: rgba(247, 169, 40, .5); transform: translateY(-1px); }
.lang-switch:lang(ar) { font-family: "Readex Pro", "IBM Plex Sans Arabic", system-ui, sans-serif; font-size: 14px; }

/* ===== Background glows ===== */
.glow { position: fixed; inset: auto; pointer-events: none; z-index: 0; filter: blur(20px); }
.glow--top { top: -20vh; left: -10vw; width: 80vw; height: 70vh; background: radial-gradient(closest-side, var(--glow-top), transparent); }
.glow--bottom { bottom: -30vh; left: 10vw; width: 90vw; height: 60vh; background: radial-gradient(closest-side, var(--glow-bottom), transparent); }

/* ===== Layout ===== */
.shell {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 56px 24px 40px;
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

/* ===== Profile column ===== */
.profile { position: sticky; top: 32px; padding-top: 92px; }
/* Avatar: yellow tile in a page-coloured socket that reads as a notch in the card (per Figma) */
.avatar-socket {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 10px;
  border-radius: 46px;
  background: var(--bg);
}
.avatar-tile {
  position: relative;
  width: 176px; height: 176px;
  border-radius: 38px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, #ffd25e 0%, rgba(255, 210, 94, 0) 60%),
    linear-gradient(180deg, #fcbc2c 0%, #f5a51f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    inset 0 -18px 30px -12px rgba(150, 80, 0, .25),
    0 18px 40px -18px rgba(247, 169, 40, .55);
}
.avatar {
  position: absolute;
  /* crop the cut-out to head & shoulders, head centred like the illustration */
  width: 112%;
  max-width: none;
  height: auto;
  left: 50%;
  top: 4%;
  transform: translateX(-48.6%);
  filter: drop-shadow(0 6px 10px rgba(80, 40, 0, .28));
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}
.avatar-tile:hover .avatar { transform: translateX(-48.6%) scale(1.04); }
.profile-card {
  position: relative;
  text-align: center;
  padding: 122px 24px 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 55%, rgba(20, 28, 46, 0.92) 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.name { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.handle { color: var(--text-3); font-size: 13px; margin-top: 2px; }

.role-badge {
  display: inline-block;
  margin-top: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px; font-weight: 500; letter-spacing: .02em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(247, 169, 40, .25);
}
.summary { margin: 10px auto 0; max-width: 260px; font-size: 13.5px; line-height: 1.55; color: var(--text-2); text-wrap: balance; }
/* Tech-stack marquee */
.stack { margin: 18px -24px 0; }
.stack-label {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 10px;
  font-size: 10px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--text-3);
}
.stack-label::before, .stack-label::after { content: ""; width: 28px; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22)); }
.stack-label::after { transform: scaleX(-1); }
.stack-viewport {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.stack-track {
  display: flex;
  width: max-content;
  padding: 2px 0;
  animation: stack-scroll 38s linear infinite;
}
.stack:hover .stack-track { animation-play-state: paused; }
.stack-chip {
  display: inline-flex; align-items: center; gap: 8px;
  margin-inline-end: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  font-size: 12px; font-weight: 500; color: #e6e9f2;
  white-space: nowrap;
  transition: border-color .25s, background .25s, transform .25s;
}
.stack-chip:hover { border-color: rgba(247, 169, 40, .45); background: rgba(247, 169, 40, .08); transform: translateY(-2px); }
.stack-logo { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #f4f6fb; }
.stack-logo img { width: 15px; height: 15px; }
@keyframes stack-scroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .stack-viewport { -webkit-mask-image: none; mask-image: none; padding: 0 16px; }
  .stack-track { width: auto; flex-wrap: wrap; justify-content: center; row-gap: 8px; animation: none; }
  .stack-chip[aria-hidden="true"] { display: none; }
}

.cta { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.cta .btn { padding: 9px 18px; font-size: 13px; }
.meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; font-size: 12px; color: var(--text-2); }
.meta > span { display: inline-flex; align-items: center; gap: 6px; }
.meta .i { width: 15px; height: 15px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18); }

/* Bio icons: brand-coloured tiles, LinkedIn-style */
.socials { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.socials a { display: block; border-radius: 12px; }
.socials a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.s-ico { --c: #333; }
.socials .s-ico {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px; color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 82%, #fff), var(--c));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 16px -8px var(--c);
  transition: transform .2s, box-shadow .2s, filter .2s;
}
.socials a:hover .s-ico { transform: translateY(-3px); filter: brightness(1.08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 10px 22px -8px var(--c); }
.s-ico .i { width: 20px; height: 20px; }
.s-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.s-ico--linkedin { --c: #0a66c2; }
.s-ico--github   { --c: #24292f; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 6px 16px -8px #000; }
.s-ico--upwork   { --c: #14a800; }
.s-ico--upwork .i { width: 23px; }
.s-ico--mostaql  { --c: #2386c8; }
.s-ico--mostaql .i { width: 32px; height: 11px; }
.s-ico--whatsapp { --c: #25d366; }
.s-ico--facebook { --c: #1877f2; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 22px 0 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dt { font-size: 11px; color: var(--text-3); }
.stats dd { margin: 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats .count-suf { display: inline-block; color: var(--accent); opacity: 0; transform: translateY(4px) scale(.7); transition: opacity .35s ease, transform .45s cubic-bezier(.34, 1.56, .64, 1); }
.stats dd.done .count-suf { opacity: 1; transform: none; }
.stats dd.done .count { animation: stat-pop .5s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes stat-pop { 50% { transform: scale(1.12); } }
.stats .count { display: inline-block; }
@media (prefers-reduced-motion: reduce) { .stats .count-suf { opacity: 1; transform: none; } }

/* Section switcher: a 3×2 segmented control */
.tabs {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
  margin-top: 16px; padding: 6px;
  background: rgba(255, 255, 255, .035); border: 1px solid var(--line); border-radius: 18px;
}
.tabs button {
  min-width: 0; padding: 10px 6px;
  background: transparent; border: 1px solid transparent; border-radius: 12px;
  font-size: 13px; font-weight: 500; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
  transition: color .2s, background-color .2s, border-color .2s, box-shadow .2s, transform .15s;
}
.tabs button:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.tabs button:active { transform: scale(.97); }
.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tabs button[aria-selected="true"] {
  color: #1a1205; font-weight: 600;
  background: linear-gradient(180deg, #ffc155, var(--accent));
  box-shadow: 0 6px 18px -8px rgba(247, 169, 40, .75), inset 0 1px 0 rgba(255, 255, 255, .35);
}

/* ===== Content column ===== */
.content { display: flex; flex-direction: column; gap: 56px; outline: none; }
/* `hidden` must always win over component display rules (e.g. .proj { display: flex }) */
[hidden] { display: none !important; }
.section-head { margin-bottom: 18px; }
.section-head h2 { font-size: 22px; font-weight: 600; }
/* Subtitle under every section heading: brighter, larger, comfortable line length */
.section-head p { margin-top: 6px; max-width: 60ch; color: var(--text-2); font-size: 15px; line-height: 1.65; text-wrap: pretty; }
html:lang(ar) .section-head p { font-size: 16.5px; font-weight: 500; line-height: 1.9; color: #c9d0de; }

.card {
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(38, 50, 77, 0.75), rgba(20, 28, 46, 0.75));
  border: 1px solid var(--line);
  padding: 24px;
  backdrop-filter: blur(8px);
}

/* About */
.about .lead { font-size: 17px; color: #fff; line-height: 1.7; }
.about .approach { margin-top: 12px; color: var(--text-2); }
.highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.hl { padding: 18px; border-radius: var(--radius-md); background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); transition: border-color .25s, background .25s; }
.hl:hover { border-color: rgba(247, 169, 40, .35); background: rgba(255, 255, 255, 0.05); }
.hl-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); margin-bottom: 12px; }
.hl-ico .i { width: 20px; height: 20px; }
.hl h3 { font-size: 15px; font-weight: 600; }
.hl p { margin-top: 4px; font-size: 13px; color: var(--text-2); line-height: 1.6; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.mini { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: var(--radius-md); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.mini strong { color: #fff; font-weight: 500; }
.mini-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); margin-bottom: 4px; }
.mini li b { color: #fff; font-weight: 500; }

/* Projects — browser-framed cards */
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.proj {
  display: flex; flex-direction: column;
  padding: 10px 10px 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(38, 50, 77, 0.7), rgba(20, 28, 46, 0.85));
  text-align: start;
  transition: transform .3s ease, border-color .3s, box-shadow .3s;
}
.proj:hover { transform: translateY(-4px); border-color: rgba(247, 169, 40, .35); box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .9); }
.proj-frame { display: block; border-radius: 12px; overflow: hidden; background: #0b1120; border: 1px solid rgba(255, 255, 255, .06); }
.proj-bar { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; background: #161f33; }
.proj-bar i { width: 8px; height: 8px; border-radius: 50%; background: #3a4560; }
.proj-bar i:nth-child(1) { background: #ff6159; } .proj-bar i:nth-child(2) { background: #ffbd2e; } .proj-bar i:nth-child(3) { background: #28c840; }
.proj-url { flex: 1; margin-inline-start: 8px; padding: 2px 10px; border-radius: 6px; background: rgba(255, 255, 255, .06); font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-shot { display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.proj-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .6s ease; }
.proj:hover .proj-shot img { transform: scale(1.04); }
.proj-info { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 6px 16px; }
.proj-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.proj-title { font-size: 16px; font-weight: 600; line-height: 1.3; }
.proj-domain { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-go { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .07); transition: background .25s, color .25s; }
.proj-go .i { width: 16px; height: 16px; }
.proj:hover .proj-go { background: var(--accent); color: #1a1205; }
.show-all { margin-top: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  transition: background .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: #1a1205; }
.btn--primary:hover { background: #ffbb45; }
.btn--outline { background: transparent; border-color: rgba(255, 255, 255, .22); color: #fff; }
.btn--outline:hover { background: rgba(255, 255, 255, .08); }
.btn--ghost { background: rgba(255, 255, 255, 0.06); border-color: var(--line); color: #fff; width: 100%; }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.1); }

/* Career timeline */
.timeline { position: relative; display: flex; flex-direction: column; gap: 14px; }
.job { position: relative; padding-inline-start: 28px; }
.job::before { content: ""; position: absolute; inset-inline-start: 6px; top: 26px; bottom: -14px; width: 2px; background: var(--line); }
.job:last-child::before { display: none; }
.job::after { content: ""; position: absolute; inset-inline-start: 0; top: 22px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.job .card { padding: 20px 22px; }
.job-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.job h3 { font-size: 16px; font-weight: 600; }
.job-company { color: var(--text-2); font-size: 14px; }
.job-dates { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.job-head { display: flex; gap: 14px; align-items: flex-start; }
.job-id { flex: 1; min-width: 0; }
.job-logo { flex: none; width: 48px; height: 48px; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--line); display: grid; place-items: center; }
.job-logo img { width: 100%; height: 100%; object-fit: cover; }
.job-logo--mono { background: var(--surface-3); color: var(--accent); font-weight: 700; font-size: 15px; letter-spacing: .02em; }
.job-place { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.job .pill { margin-inline-start: 62px; }

/* Licenses & certifications */
.certs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cert { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--line); transition: border-color .2s, transform .2s; }
.cert:hover { border-color: rgba(247, 169, 40, .45); transform: translateY(-2px); }
.cert-badge { flex: none; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--b, #334); color: #fff; font: 700 17px/1 var(--font-head, inherit); }
.cert-badge--icon { background: #fff; overflow: hidden; }
.cert-badge--full img { width: 100%; height: 100%; object-fit: cover; }
.cert-body { min-width: 0; flex: 1; }
.cert h3 { font-size: 14.5px; font-weight: 600; line-height: 1.35; text-align: start; unicode-bidi: plaintext; }
.cert-meta { color: var(--text-2); font-size: 12.5px; margin-top: 3px; }
.cert-id { color: var(--text-3); font-size: 11.5px; margin-top: 4px; overflow-wrap: anywhere; }
.cert-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--accent); text-decoration: none; }
.cert-link .i { width: 14px; height: 14px; }
.cert-link:hover { text-decoration: underline; }
.pill { display: inline-block; margin-top: 8px; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; background: var(--accent-soft); color: var(--accent); }
.job ul { margin-top: 12px; display: grid; gap: 6px; }
.job li { position: relative; padding-inline-start: 16px; color: var(--text-2); font-size: 14px; }
.job li::before { content: ""; position: absolute; inset-inline-start: 0; top: 10px; width: 6px; height: 2px; background: var(--text-3); }

/* Skills */
.skills {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(38, 50, 77, 0.7), rgba(20, 28, 46, 0.8));
  overflow: hidden;
}
.skill-row { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; padding: 22px 24px; }
.skill-row + .skill-row { border-top: 1px solid var(--line); }
.skill-head h3 { font-size: 15px; font-weight: 600; }
.skill-head p { margin-top: 2px; font-size: 13px; color: var(--text-3); line-height: 1.5; }
.skill-count { display: inline-block; margin-top: 10px; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.skill-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; }
.skill {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  font-size: 13px; color: #e6e9f2;
  transition: border-color .2s, background .2s, transform .2s;
}
.skill:hover { border-color: rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .07); transform: translateY(-1px); }
.skill-logo { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #f4f6fb; }
.skill-logo img { width: 20px; height: 20px; }
.skill-logo--badge { background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 5px 12px; border-radius: 8px; font-size: 13px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); color: #e6e9f2; }

/* Achievements */
.achievements { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ach { display: flex; flex-direction: column; overflow: hidden; padding: 0; text-align: start; border: 1px solid var(--line); }
button.ach { cursor: zoom-in; }
.ach-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-3); }
.ach-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
button.ach:hover .ach-media img { transform: scale(1.04); }
.ach-media--icon { display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, rgba(247, 169, 40, .25), transparent 60%), var(--surface-3); color: var(--accent); }
.ach-media--icon .i { width: 44px; height: 44px; }
.ach-body { padding: 16px 18px 18px; }
.ach h3 { font-size: 15px; font-weight: 600; }
.ach p { color: var(--text-2); font-size: 13px; margin-top: 4px; }

/* Contact bento — mirrors the link cards in the design */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.b {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 132px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.b:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -18px rgba(0, 0, 0, .8); }
.b-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.b-ico { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; font-weight: 700; font-size: 15px; }
.b-ico .i { width: 26px; height: 26px; }
.b-arrow { width: 18px; height: 18px; opacity: .85; }
.b-title { font-size: 14px; font-weight: 600; margin-top: 14px; }
.b-sub { font-size: 12px; color: rgba(255, 255, 255, 0.72); overflow-wrap: anywhere; }
.b-follow { padding: 2px 10px; margin-inline-start: 10px; border-radius: 6px; background: #e5e7eb; color: #111; font-size: 11px; font-weight: 500; align-self: center; }
.b-row { display: flex; align-items: center; }

.b--email   { grid-column: span 4; background: linear-gradient(135deg, #1f3a7a, #142450 60%, #101a36); }
.b--email .b-ico { background: #fff; color: #1f3a7a; }
.b--fb      { grid-column: span 2; background: linear-gradient(160deg, #3aa0ff, #1265e0); }
.b--fb .b-ico { color: #fff; }
.b--github  { grid-column: span 4; background: linear-gradient(135deg, #1b1f2a, #0f1219); }
.b--github .b-ico { background: #fff; color: #0f1219; border-radius: 50%; }
.b--wa      { grid-column: span 2; background: linear-gradient(160deg, #2fd27a, #128c4a); }
.b--wa .b-ico { color: #fff; }
.b--upwork  { grid-column: span 2; background: linear-gradient(160deg, #1b3a24, #0f2216); }
.b--upwork .b-ico { background: #14a800; color: #fff; }
.b--mostaql { grid-column: span 2; background: linear-gradient(160deg, #e9e3ff, #c9bcff); color: #1d1640; }
.b--mostaql .b-sub { color: rgba(29, 22, 64, .7); }
.b--mostaql .b-ico { width: auto; padding: 0 12px; background: #2386c8; color: #fff; }
.b--mostaql .b-ico .i { width: 52px; height: 16px; }
.b--linkedin .b-ico .i { width: 22px; height: 22px; }
.b--linkedin { grid-column: span 4; background: linear-gradient(135deg, #0a66c2, #074a8f 60%, #06386b); }
.b--linkedin .b-ico { background: #fff; color: #0a66c2; }
.b--phone   { grid-column: span 4; background: linear-gradient(160deg, #3a2a5e, #22183d); }
.b--phone .b-ico { background: rgba(255, 255, 255, .12); color: #fff; }

.note { margin-top: 14px; font-size: 13px; color: var(--text-3); }
.footer { padding-top: 8px; font-size: 12px; color: var(--text-3); }

/* ===== Modal ===== */
.modal {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--text);
  overflow: auto;
}
.modal::backdrop { background: rgba(5, 8, 16, 0.7); backdrop-filter: blur(4px); }
.modal[open] { animation: pop .25s ease; }
.modal-close { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 0; background: rgba(10, 15, 28, .75); }
.modal-media img { width: 100%; max-height: 420px; object-fit: cover; object-position: top; }
.modal-media--contain img { object-fit: contain; max-height: 70vh; background: #fff; }
.modal-body { padding: 22px 24px 26px; }
.modal-body h3 { font-size: 22px; font-weight: 600; }
.modal-body > p { color: var(--text-2); margin-top: 6px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0 20px; }
.facts .mini { padding: 12px 14px; }
.facts .chips { gap: 6px; }
.facts .chip { font-size: 12px; padding: 3px 8px; }

@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  .shell { grid-template-columns: 340px minmax(0, 1fr); gap: 28px; }
  .skill-row { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); max-width: 560px; padding: 32px 16px 32px; gap: 32px; }
  .profile { position: relative; top: 0; min-width: 0; }
  .profile-card { padding-left: 16px; padding-right: 16px; }
  .stack { margin-left: -16px; margin-right: -16px; }
  .content { gap: 44px; }
  .achievements, .certs { grid-template-columns: 1fr; }
  .job .pill { margin-inline-start: 0; }
}
@media (max-width: 520px) {
  .project-grid { grid-template-columns: 1fr; gap: 14px; }
  .highlights { grid-template-columns: 1fr; }
  .skill-row { padding: 18px 16px; }
  .skill-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .skill { padding: 7px 8px; gap: 8px; font-size: 12px; }
  .skill-logo { width: 28px; height: 28px; }
  .about-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense; }
  .b--email, .b--github, .b--linkedin { grid-column: span 2; }
  .b--fb, .b--wa, .b--upwork, .b--mostaql, .b--phone { grid-column: span 1; }
  .b--phone { grid-column: span 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* =====================================================================
   Arabic / RTL  (applies on /ar/ where <html lang="ar" dir="rtl">)
   Body: IBM Plex Sans Arabic · UI labels & numbers: Readex Pro
   Display headings: Thmanyah Serif Text Bold (arfonts.net — free, shipped unmodified per its licence)
   ===================================================================== */
@font-face {
  font-family: "Thmanyah Serif Text";
  src: url("/assets/fonts/thmanyah-serif-text-bold.otf") format("opentype");
  font-weight: 700; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+060C, U+061B, U+061F;
}
:root:lang(ar) {
  --font: "IBM Plex Sans Arabic", "Readex Pro", "Segoe UI", Tahoma, sans-serif;
  --font-head: "Readex Pro", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-display: "Thmanyah Serif Text", "Readex Pro", "IBM Plex Sans Arabic", serif;
}
html:lang(ar) body { line-height: 1.85; font-size: 15.5px; }
/* letter-spacing breaks Arabic letter joining, uppercase has no meaning in Arabic */
html:lang(ar) *, html:lang(ar) *::before, html:lang(ar) *::after { letter-spacing: 0 !important; text-transform: none !important; }

.name, .section-head h2, .hl h3, .job h3, .skill-head h3, .ach h3, .modal-body h3,
.proj-title, .b-title, .stats dd, .stack-label, .role-badge, .mini-label, .pill, .skill-count, .tabs button, .btn {
  font-family: var(--font-head);
}
/* Serif display face for headings — Latin glyphs fall through to the next font via unicode-range */
html:lang(ar) .name, html:lang(ar) .section-head h2, html:lang(ar) .job h3, html:lang(ar) .skill-head h3,
html:lang(ar) .ach h3, html:lang(ar) .hl h3, html:lang(ar) .modal-body h3, html:lang(ar) .b-title {
  font-family: var(--font-display); font-weight: 700;
}
html:lang(ar) .name { font-size: 30px; line-height: 1.45; }
html:lang(ar) .section-head h2 { font-size: 30px; line-height: 1.4; }
html:lang(ar) .job h3, html:lang(ar) .skill-head h3 { font-size: 18px; }
html:lang(ar) .b-title { font-size: 16px; }
html:lang(ar) .about .lead { font-size: 17.5px; line-height: 1.95; }
html:lang(ar) .summary { line-height: 1.9; }
html:lang(ar) .stack-label, html:lang(ar) .mini-label, html:lang(ar) .skill-count { font-size: 12px; }
html:lang(ar) .pill { font-size: 12px; padding: 3px 12px; }
html:lang(ar) .tabs button { font-size: 14px; }
/* Latin bits inside Arabic text (domains, emails, dates) keep their own font & direction */
html:lang(ar) [dir="ltr"] { font-family: "Poppins", var(--font); }

/* Mirror directional icons */
[dir="rtl"] .proj-go .i, [dir="rtl"] .b-arrow, [dir="rtl"] .btn .i, [dir="rtl"] .cert-link .i { transform: scaleX(-1); }
[dir="rtl"] .cert h3 { text-align: right; }
/* Marquee scrolls the other way in RTL */
[dir="rtl"] .stack-track { animation-name: stack-scroll-rtl; }
/* Keep "175+" reading left-to-right inside Arabic text */
.stats dd { direction: ltr; unicode-bidi: isolate; }
@keyframes stack-scroll-rtl { to { transform: translateX(50%); } }
/* Skip link from the right in RTL */
[dir="rtl"] .skip { left: auto; right: -9999px; }
[dir="rtl"] .skip:focus { right: 16px; }
/* Hide glows mirroring issues: keep warm glow on the reading-start side */
[dir="rtl"] .glow--top { left: auto; right: -10vw; }
