:root {
  --bg: #07080b;               /* near-black page */
  --surface: #0f1218;          /* cards */
  --surface-2: #151a22;
  --line: #1f2531;
  --navy: #0f2a52;
  --navy-2: #173b70;
  --navy-glow: rgba(23, 59, 112, .55);
  --grey-100: #e9ecf1;
  --grey-300: #b3bac6;
  --grey-500: #7a8291;
  --grey-700: #4a5160;
  --white: #ffffff;
  --accent: #f07b1e;           /* sparingly: status dots, one hover line */
  --radius: 20px;
  --font: "Poppins", system-ui, sans-serif;
  --font-ar: "Cairo", "Poppins", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--grey-300);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html[lang="ar"] body { font-family: var(--font-ar); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(1200px, 100% - 48px); margin-inline: auto; }

/* ---------- Nav (floating pill) ---------- */
.nav { position: fixed; top: 16px; inset-inline: 0; z-index: 50; display: flex; justify-content: center; padding-inline: 16px; }
.nav-inner {
  width: min(1200px, 100%);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: rgba(15, 18, 24, .72); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 8px 8px 10px;
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--white); font-weight: 600; font-size: .92rem; white-space: nowrap; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: var(--white); font-weight: 700; font-family: var(--font);
}
.nav-links { display: flex; gap: 4px; }
.nav-links a { color: var(--grey-300); font-size: .88rem; padding: 8px 14px; border-radius: 999px; transition: background .2s, color .2s; }
.nav-links a:hover { background: var(--surface-2); color: var(--white); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.lang-switch { display: flex; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.lang-switch button {
  border: 0; background: none; color: var(--grey-500); cursor: pointer;
  font: 600 .76rem var(--font); padding: 7px 11px; border-radius: 999px; transition: .2s;
}
.lang-switch button[data-lang="ar"] { font-family: var(--font-ar); font-size: .86rem; padding-block: 4px; }
.lang-switch button.active { background: var(--white); color: var(--bg); }
.menu-btn { display: none; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.menu-btn span { width: 14px; height: 1.5px; background: var(--white); }

/* ---------- Buttons / pills ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px; border-radius: 999px; font-weight: 500; font-size: .93rem;
  transition: transform .2s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-light { background: var(--white); color: var(--bg); }
.btn-light:hover { background: var(--grey-100); }
.btn-outline { border: 1px solid var(--grey-700); color: var(--white); }
.btn-outline:hover { border-color: var(--white); }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; color: var(--grey-100);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 12px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(240,123,30,.15); }
.kicker { display: inline-block; font-size: .8rem; color: var(--grey-500); text-transform: uppercase; letter-spacing: .16em; margin-bottom: 14px; }
html[lang="ar"] .kicker { letter-spacing: 0; font-size: .9rem; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: 130px; overflow: hidden; }
.hero-glow {
  position: absolute; width: 900px; height: 900px; border-radius: 50%;
  inset-inline-end: -150px; top: -150px;
  background: radial-gradient(circle, var(--navy-glow) 0%, transparent 65%);
  pointer-events: none;
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1fr 1.1fr 0.7fr; gap: 30px; align-items: end; min-height: 520px; }
.hero-text { align-self: center; padding-bottom: 40px; }
.hero-tag { color: var(--white); font-size: clamp(1.3rem, 2.2vw, 1.7rem); font-weight: 600; line-height: 1.3; margin: 22px 0 16px; max-width: 360px; }
.hero-lead { font-size: .98rem; max-width: 380px; }
.hero-cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.hero-photo { position: relative; align-self: end; justify-self: center; width: 100%; max-width: 470px; }
.hero-photo img {
  width: 100%; height: auto;
  /* cut-out PNG: only fade the bottom so the giant name sits over it */
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 97%);
  mask-image: linear-gradient(to bottom, #000 62%, transparent 97%);
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .5));
}
.hero-photo::before {
  content: ""; position: absolute; inset: 12% 8% 0; z-index: -1; border-radius: 50% 50% 0 0;
  background: radial-gradient(circle at 50% 35%, var(--navy-2) 0%, var(--navy) 45%, transparent 72%);
  opacity: .9;
}
.socials { display: flex; gap: 10px; margin-top: 26px; }
.socials a {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--grey-300); transition: .2s;
}
.socials a:hover { color: var(--white); border-color: var(--grey-700); transform: translateY(-2px); }
.socials svg { width: 17px; height: 17px; }
.hero-stats { list-style: none; align-self: center; display: flex; flex-direction: column; gap: 26px; padding-bottom: 40px; }
.hero-stats li { border-inline-start: 1px solid var(--line); padding-inline-start: 18px; }
.hero-stats strong { display: block; color: var(--white); font-size: 2rem; font-weight: 600; line-height: 1.1; }
.hero-stats span { font-size: .83rem; color: var(--grey-500); }
.hero-name {
  position: relative; z-index: 2;
  font-size: clamp(4.5rem, 19vw, 17rem); font-weight: 600; line-height: .8; letter-spacing: -.05em;
  text-align: center; margin-top: -0.42em; padding-bottom: .08em;
  background: linear-gradient(180deg, #ffffff 30%, #8d96a6 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  user-select: none;
}
html[lang="ar"] .hero-name { font-family: var(--font-ar); font-weight: 800; letter-spacing: 0; line-height: 1.05; margin-top: -0.5em; }

/* ---------- Marquee ---------- */
.marquee { border-block: 1px solid var(--line); padding: 22px 0; overflow: hidden; direction: ltr; margin-top: 30px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 56px; width: max-content; animation: scroll 40s linear infinite; }
.marquee-track span { color: var(--grey-500); font-size: 1.05rem; font-weight: 500; white-space: nowrap; display: flex; align-items: center; gap: 56px; }
.marquee-track span::after { content: "✦"; color: var(--grey-700); font-size: .8rem; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: 120px 0; }
.section-tight { padding-top: 0; }
.section-head { margin-bottom: 50px; }
.section-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; flex-wrap: wrap; }
.section-head h2, .contact h2 { color: var(--white); font-size: clamp(1.9rem, 3.6vw, 2.9rem); font-weight: 600; line-height: 1.15; letter-spacing: -.02em; }
html[lang="ar"] .section-head h2, html[lang="ar"] .contact h2, html[lang="ar"] .statement { letter-spacing: 0; line-height: 1.4; }

.statement { color: var(--white); font-size: clamp(2rem, 4.8vw, 3.8rem); font-weight: 600; line-height: 1.12; letter-spacing: -.03em; max-width: 900px; }
.about-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 60px; margin-top: 50px; align-items: start; }
.about-photo { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4 / 5; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; filter: saturate(.85); }
.about-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(7, 8, 11, .85)); }
.about-body .facts { margin-top: 28px; grid-template-columns: repeat(3, 1fr); }
.about-body p { font-size: 1.05rem; margin-bottom: 16px; }
.facts { display: grid; gap: 14px; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; }
.facts dt { font-size: .76rem; text-transform: uppercase; letter-spacing: .12em; color: var(--grey-500); }
html[lang="ar"] .facts dt { letter-spacing: 0; font-size: .85rem; }
.facts dd { color: var(--white); font-weight: 500; }

/* ---------- Services ---------- */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.service { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 30px 38px; transition: transform .25s, border-color .25s; }
.service:hover { transform: translateY(-4px); border-color: var(--grey-700); }
.service-num { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); color: var(--grey-300); font-size: .85rem; margin-bottom: 70px; font-family: var(--font); }
.service h3 { color: var(--white); font-size: 1.3rem; font-weight: 600; margin-bottom: 10px; }
.service p { font-size: .95rem; }
.service-featured { background: linear-gradient(160deg, var(--navy-2) 0%, var(--navy) 60%, #0b1830 100%); border-color: transparent; }
.service-featured p { color: #c9d4e6; }
.service-featured .service-num { border-color: rgba(255,255,255,.25); color: var(--white); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; display: grid; gap: 16px; }
.timeline > li { display: grid; grid-template-columns: 220px 1fr; gap: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 32px; transition: border-color .25s; }
.timeline > li:hover { border-color: var(--grey-700); }
.tl-date { color: var(--grey-500); font-size: .88rem; padding-top: 4px; }
.timeline > li:first-child .tl-date::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-inline-end: 8px; vertical-align: middle; }
.tl-card h3 { color: var(--white); font-size: 1.2rem; font-weight: 600; }
.tl-org { color: #8fa8cf; font-size: .9rem; margin-bottom: 14px; }
.tl-card ul { padding-inline-start: 18px; }
.tl-card li { margin-bottom: 6px; font-size: .96rem; }
.tl-card li::marker { color: var(--grey-700); }

/* ---------- Projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button {
  border: 1px solid var(--line); background: var(--surface); color: var(--grey-300);
  font: 500 .84rem var(--font); padding: 8px 16px; border-radius: 999px; cursor: pointer; transition: .2s;
}
html[lang="ar"] .filters button { font-family: var(--font-ar); }
.filters button:hover { border-color: var(--grey-700); color: var(--white); }
.filters button.active { background: var(--white); color: var(--bg); border-color: var(--white); }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.project {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  display: flex; flex-direction: column; transition: transform .25s, border-color .25s, background .25s;
}
.project:hover { transform: translateY(-4px); border-color: var(--grey-700); background: var(--surface-2); }
.project.hidden { display: none; }
.project-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 44px; }
.project-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--navy); color: var(--white); display: grid; place-items: center; }
.project-icon svg { width: 22px; height: 22px; }
.project .cat { font-size: .74rem; color: var(--grey-500); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; }
.project h3 { color: var(--white); font-size: 1.12rem; font-weight: 600; margin-bottom: 8px; line-height: 1.35; }
.project p { font-size: .93rem; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; direction: ltr; }
html[dir="rtl"] .tags { justify-content: flex-end; }
.tags span { font-size: .72rem; background: var(--bg); color: var(--grey-300); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.skill-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.skill-card h3 { color: var(--white); font-size: 1rem; font-weight: 600; margin-bottom: 16px; }
.skill-card ul { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; direction: ltr; }
html[dir="rtl"] .skill-card ul { justify-content: flex-end; }
.skill-card li { font-size: .82rem; border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; color: var(--grey-300); }
.skill-card li.lvl { background: var(--navy); border-color: var(--navy-2); color: var(--white); }

/* ---------- Education / Languages ---------- */
.edu-wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 60px; }
.edu-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; margin-bottom: 16px; }
.edu-date { font-size: .82rem; color: var(--grey-500); }
.edu-card h3 { color: var(--white); font-size: 1.1rem; font-weight: 600; margin: 4px 0 2px; }
.langs { list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.langs li { display: grid; grid-template-columns: 1fr auto; row-gap: 10px; margin-bottom: 24px; }
.langs li:last-child { margin-bottom: 0; }
.langs span { color: var(--white); font-weight: 500; }
.langs em { font-style: normal; color: var(--grey-500); font-size: .86rem; }
.langs i { grid-column: 1 / -1; height: 4px; background: var(--line); border-radius: 4px; position: relative; overflow: hidden; }
.langs i::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--w); background: linear-gradient(90deg, var(--navy-2), #4f7fc4); border-radius: 4px; }
html[dir="rtl"] .langs i::after { background: linear-gradient(270deg, var(--navy-2), #4f7fc4); }

/* ---------- Contact / Footer ---------- */
.contact { padding: 40px 0 120px; }
.contact-inner {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.3fr 0.7fr; align-items: end; gap: 20px;
  border-radius: 32px; padding-top: 80px; padding-inline: 60px 0;
  background: radial-gradient(700px 360px at 30% 0%, var(--navy-glow), transparent 70%), var(--surface);
  border: 1px solid var(--line);
}
.contact-text { padding-bottom: 80px; }
.contact-photo {
  width: 100%; max-width: 380px; justify-self: end; align-self: end;
  filter: grayscale(1) contrast(1.05) brightness(.95) drop-shadow(0 20px 40px rgba(0,0,0,.5));
  -webkit-mask-image: linear-gradient(to bottom, #000 75%, transparent);
  mask-image: linear-gradient(to bottom, #000 75%, transparent);
}
.contact h2 { font-size: clamp(2.2rem, 4.8vw, 3.8rem); margin: 22px 0 16px; max-width: 640px; letter-spacing: -.03em; line-height: 1.1; }
.contact p { max-width: 520px; }
.contact-links { display: flex; gap: 12px; margin-top: 36px; flex-wrap: wrap; }
.footer { border-top: 1px solid var(--line); color: var(--grey-500); font-size: .85rem; }
.footer-inner { display: flex; justify-content: space-between; padding: 26px 0; }
.footer a:hover { color: var(--white); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee-track { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: 1fr 1fr; }
  .hero-stats { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; padding-bottom: 0; order: 3; }
  .services { grid-template-columns: 1fr; }
  .service-num { margin-bottom: 30px; }
  .about-grid, .edu-wrap { grid-template-columns: 1fr; gap: 30px; }
  .timeline > li { grid-template-columns: 1fr; gap: 6px; }
  .about-photo { max-width: 420px; }
  .contact-inner { grid-template-columns: 1fr; padding-inline: 30px; }
  .contact-photo { justify-self: center; max-width: 300px; }
  .contact-text { padding-bottom: 0; text-align: center; }
  .contact h2, .contact p { margin-inline: auto; }
  .contact-links { justify-content: center; }
}
@media (max-width: 760px) {
  .nav { top: 10px; }
  .logo span:last-child { display: none; }
  .menu-btn { display: flex; }
  .nav-links {
    position: absolute; top: 62px; inset-inline: 16px; flex-direction: column; gap: 2px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 10px; display: none;
  }
  .nav-links.open { display: flex; }
  .hero { padding-top: 100px; }
  .hero-inner { grid-template-columns: 1fr; min-height: 0; gap: 10px; }
  .hero-photo { order: -1; max-width: 330px; }
  .hero-text { padding-bottom: 0; text-align: center; }
  .hero-tag, .hero-lead { margin-inline: auto; }
  .hero-cta { justify-content: center; }
  .hero-stats { margin-top: 30px; gap: 10px; }
  .hero-stats li { padding-inline-start: 12px; }
  .hero-stats strong { font-size: 1.5rem; }
  .hero-name { margin-top: 20px; }
  .section { padding: 80px 0; }
  .section-tight { padding-top: 0; }
  .timeline > li, .project, .service { padding: 24px; }
  .projects { grid-template-columns: 1fr; }
  .container { width: calc(100% - 32px); }
  .contact-inner { padding: 50px 20px 0; }
  .about-body .facts { grid-template-columns: 1fr; }
  .socials { justify-content: center; }
}
