/* ---------- Fonts ---------- */
@font-face { font-family: thmanyahSans; src: url("fonts/thmanyah-light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: thmanyahSans; src: url("fonts/thmanyah-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: thmanyahSans; src: url("fonts/thmanyah-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: thmanyahSans; src: url("fonts/thmanyah-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: thmanyahSans; src: url("fonts/thmanyah-black.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: Geist; src: url("fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: thmanyahDisplay; src: url("fonts/thmanyah-serif-display-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: thmanyahDisplay; src: url("fonts/thmanyah-serif-display-black.woff2") format("woff2"); font-weight: 900; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --bg: #ffffff;
  --fg: #070707;
  --muted: #6b7280;
  --border: #e9e9e9;
  --card: #ffffff;
  --chip: #f6f6f6;
  --shadow: 0 1px 2px rgba(0,0,0,.04);
  --radius: 14px;
  --max: 1120px;
}
:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --fg: #f5f5f5;
  --muted: #9aa0a6;
  --border: #232323;
  --card: #101010;
  --chip: #161616;
  --shadow: none;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  font-family: thmanyahSans, Geist, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
html[lang="en"] body { font-family: Geist, thmanyahSans, system-ui, sans-serif; line-height: 1.7; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 20px; }
.brand { display: inline-flex; align-items: center; }
.brand .mark { width: 36px; height: 36px; flex: none; color: var(--fg); transition: opacity .18s ease; }
.brand .mark svg { width: 100%; height: 100%; display: block; }
.brand:hover .mark { opacity: .82; }
.nav-links { display: flex; gap: 26px; font-size: 15px; color: var(--fg); }
.nav-links a { color: var(--muted); transition: color .18s ease; }
.nav-links a:hover, .nav-links a.active { color: var(--fg); }
.nav-tools { display: flex; align-items: center; gap: 10px; }

.btn-pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--card); color: var(--fg);
  font: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: border-color .18s ease, background .18s ease;
}
.btn-pill:hover { border-color: color-mix(in srgb, var(--fg) 30%, var(--border)); }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card); color: var(--fg);
  cursor: pointer; transition: border-color .18s ease;
}
.btn-icon:hover { border-color: color-mix(in srgb, var(--fg) 30%, var(--border)); }
.btn-icon svg, .btn-pill svg { width: 16px; height: 16px; }

/* ---------- Hero ---------- */
.hero { padding: 108px 0 92px; text-align: center; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 14px; color: var(--muted); background: var(--card);
}
.chip svg { width: 15px; height: 15px; }
.hero h1 {
  margin: 26px 0 0;
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 900; letter-spacing: -.02em; line-height: 1.14;
}
.display { font-family: thmanyahDisplay, thmanyahSans, serif; }
.hero p.lede {
  margin: 22px auto 0; max-width: 720px;
  font-size: 17px; color: var(--muted); line-height: 2;
}
.hero-actions { margin-top: 34px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 10px;
  font-size: 15px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border); background: var(--card); color: var(--fg);
  transition: transform .15s ease, border-color .18s ease, opacity .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-solid { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-solid:hover { opacity: .88; }
.btn svg { width: 16px; height: 16px; }
.scroll-hint { margin-top: 62px; color: var(--muted); font-size: 13px; }
.scroll-hint span { display: block; margin-top: 6px; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0);} 50% { transform: translateY(6px);} }

/* ---------- Stats ---------- */
.stats { border-block: 1px solid var(--border); background: var(--chip); padding: 30px 0 8px; }
.stats-label { text-align: center; font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: .01em; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; text-align: center; padding: 0; }
.stat { padding: 34px 18px; position: relative; }
.stat + .stat::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 22%; bottom: 22%;
  width: 1px; background: var(--border);
}
.stat b {
  display: block; font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -.03em;
  font-family: Geist, thmanyahSans, sans-serif; direction: ltr; unicode-bidi: isolate;
}
.stat span { display: block; margin-top: 8px; font-size: 13.5px; font-weight: 500; color: var(--muted); line-height: 1.5; }
.tag, .xp-meta, .edu-txt span { unicode-bidi: plaintext; }

/* ---------- Sections ---------- */
section { padding: 92px 0; }
.sec-head { text-align: center; margin-bottom: 52px; }
.sec-head h2 { font-family: thmanyahDisplay, thmanyahSans, serif; font-size: clamp(32px, 4.6vw, 46px); font-weight: 900; letter-spacing: -.02em; }
.sec-head p { margin-top: 12px; color: var(--muted); font-size: 16px; }

.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow);
  padding: 28px;
}

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: stretch; }
.about-grid > .card { display: flex; flex-direction: column; justify-content: center; }
.about-grid .facts { width: 100%; }
.about-grid p { color: var(--muted); font-size: 16.5px; }
.about-grid p + p { margin-top: 16px; }
.facts li { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.facts li:last-child { border-bottom: 0; padding-bottom: 0; }
.facts li:first-child { padding-top: 0; }
.facts b { font-weight: 500; }
.facts span { color: var(--muted); text-align: left; }
html[lang="en"] .facts span { text-align: right; }

/* ---------- Experience ---------- */
.xp { display: grid; gap: 18px; }
.xp-item { display: grid; grid-template-columns: 46px 1fr; gap: 18px; }
.logo {
  width: 46px; height: 46px; border-radius: 11px; overflow: hidden;
  border: 1px solid var(--border); background: var(--chip);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; font-family: Geist, sans-serif;
}
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; justify-content: space-between; }
.xp-role { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.xp-org { color: var(--muted); font-size: 15px; margin-top: 2px; }
.xp-meta { color: var(--muted); font-size: 14px; white-space: nowrap; }
.xp-body { margin-top: 14px; }
.xp-body li { position: relative; padding-inline-start: 18px; color: var(--muted); font-size: 15.5px; margin-bottom: 9px; }
.xp-body li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 13px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--muted); opacity: .55;
}
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.tag {
  font-size: 12.5px; padding: 5px 11px; border-radius: 999px;
  background: var(--chip); color: var(--muted); border: 1px solid var(--border);
  font-family: Geist, thmanyahSans, sans-serif;
}

/* روابط المنتجات داخل بطاقة الخبرة */
.xp-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.xp-links a {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 13px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg);
  font-size: 13.5px; font-weight: 500;
  transition: border-color .18s ease, transform .15s ease;
}
.xp-links a:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--fg) 32%, var(--border)); }
.xp-links svg { width: 15px; height: 15px; flex: none; }

.xp-app {
  margin-top: 18px; padding: 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--chip);
}
.xp-app-head { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.xp-app-head > img { width: 44px; height: 44px; border-radius: 11px; flex: none; display: block; }
.xp-app-body { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--border); }
.xp-app-body li { position: relative; padding-inline-start: 18px; color: var(--muted); font-size: 15px; margin-bottom: 8px; }
.xp-app-body li:last-child { margin-bottom: 0; }
.xp-app-body li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 12px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--muted); opacity: .55;
}
.xp-app-meta { flex: 1; min-width: 160px; }
.xp-app-meta b { display: block; font-size: 15px; font-weight: 700; }
.xp-app-meta span { font-size: 13.5px; color: var(--muted); unicode-bidi: plaintext; }
.xp-app .xp-links { margin-top: 0; }

/* ---------- Skills ---------- */
.skill-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.skill-grid h3 { font-size: 16.5px; font-weight: 700; margin-bottom: 6px; }
.skill-grid .hint { color: var(--muted); font-size: 14px; margin-bottom: 16px; }

.contact-cta { margin-top: 22px; }

/* ---------- Case study ---------- */
.case { padding: 8px 28px; }
.case-row { display: grid; grid-template-columns: 168px 1fr; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--border); }
.case-row:last-child { border-bottom: 0; }
.case-k { font-size: 14.5px; font-weight: 700; padding-top: 2px; }
.case-v { color: var(--muted); font-size: 16.5px; }

/* ---------- Tools ---------- */
.tools { text-align: center; }
.tools-sec { padding: 0 0 92px; }
.tools-label { font-size: 13.5px; font-weight: 500; color: var(--muted); margin-bottom: 20px; }
.tool-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.tool {
  display: inline-flex; align-items: center; gap: 11px;
  height: 54px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--muted); transition: color .18s ease, border-color .18s ease, transform .15s ease;
}
.tool:hover { color: var(--fg); transform: translateY(-1px); border-color: color-mix(in srgb, var(--fg) 28%, var(--border)); }
.tool svg { width: 22px; height: 22px; flex: none; }
.tool span { font-size: 15.5px; font-weight: 500; font-family: Geist, thmanyahSans, sans-serif; }

/* ---------- Education ---------- */
.edu-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.edu-card {
  display: flex; align-items: center; gap: 14px;
  padding: 18px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow);
}
.edu-card:first-child { grid-column: 1 / -1; }
.edu-ico {
  width: 42px; height: 42px; flex: none; border-radius: 11px;
  border: 1px solid var(--border); background: var(--chip);
  display: flex; align-items: center; justify-content: center; color: var(--fg);
}
.edu-ico svg { width: 21px; height: 21px; }
.edu-ico-txt { font-size: 19px; font-weight: 700; }
.edu-txt { flex: 1; min-width: 0; }
.edu-txt b { display: block; font-size: 15px; font-weight: 700; line-height: 1.5; }
.edu-txt span { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.edu-badge {
  flex: none; font-size: 12.5px; color: var(--muted);
  padding: 5px 11px; border-radius: 999px; background: var(--chip); border: 1px solid var(--border);
}
.edu-verify {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg);
  font-size: 13px; font-weight: 500; color: var(--muted);
  transition: color .18s ease, border-color .18s ease;
}
.edu-verify:hover { color: var(--fg); border-color: color-mix(in srgb, var(--fg) 32%, var(--border)); }
.edu-verify svg { width: 15px; height: 15px; flex: none; }

/* ---------- Contact ---------- */
.contact-card { max-width: 560px; margin: 0 auto; }
.contact-card h3 { font-size: 17px; font-weight: 700; }
.contact-card p { color: var(--muted); font-size: 15.5px; margin-top: 8px; }
.contact-row { display: flex; align-items: center; gap: 10px; margin-top: 20px; font-size: 15.5px; }
.contact-row svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.socials { display: flex; gap: 10px; margin-top: 14px; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 30px 0; }
.foot { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }

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

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about-grid, .skill-grid, .edu-list { grid-template-columns: 1fr; }
  .case { padding: 4px 20px; }
  .case-row { grid-template-columns: 1fr; gap: 6px; padding: 18px 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 26px 12px; }
  .stat b { font-size: 32px; }
  .stat:nth-child(odd)::before { display: none; }
  .stat:nth-child(n+3)::after {
    content: ""; position: absolute; inset-inline: 8px; top: 0; height: 1px; background: var(--border);
  }
  section { padding: 68px 0; }
  .hero { padding: 68px 0 56px; }
  html { scroll-padding-top: 128px; }

  /* الشريط العلوي يصير سطرين: الاسم والأزرار، ثم الروابط في شريط أفقي قابل للتمرير */
  .nav-in { flex-wrap: wrap; height: auto; padding-block: 12px; row-gap: 10px; }
  .brand .mark { width: 32px; height: 32px; }
  .nav-tools { order: 2; }
  .nav-links {
    order: 3; width: 100%; gap: 18px; font-size: 14px;
    overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { white-space: nowrap; }

  .card { padding: 22px; }
  .xp-item { grid-template-columns: 38px 1fr; gap: 12px; }
  .logo { width: 38px; height: 38px; border-radius: 10px; font-size: 15px; }
  .xp-meta { white-space: normal; }
  .facts li { flex-wrap: wrap; row-gap: 2px; }
  .facts span { text-align: inherit; }
  .scroll-hint { margin-top: 44px; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat + .stat::before { display: none; }
  .stat:nth-child(n+2)::after {
    content: ""; position: absolute; inset-inline: 8px; top: 0; height: 1px; background: var(--border);
  }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .edu-card { flex-wrap: wrap; }
  .xp-app { gap: 12px; }
}
