:root {
  --font-en: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-ar: "Almarai", "Segoe UI", Tahoma, sans-serif;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #10b981;
  --accent-2: #059669;
  --accent-soft: rgba(16, 185, 129, 0.12);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 18px 40px -18px rgba(15, 23, 42, 0.28);
  --header-bg: rgba(248, 250, 252, 0.72);
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1160px;
}
[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --border: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #34d399;
  --accent-2: #10b981;
  --accent-soft: rgba(52, 211, 153, 0.15);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 18px 40px -18px rgba(0, 0, 0, 0.65);
  --header-bg: rgba(15, 23, 42, 0.72);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-en); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; transition: background-color .3s ease, color .3s ease; }
html[lang="ar"] body { font-family: var(--font-ar); line-height: 1.85; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }
.accent { color: var(--accent); }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--accent-2); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 1000; transition: top .2s ease; }
.skip-link:focus { top: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: .95rem; line-height: 1; cursor: pointer; transition: transform .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease; white-space: nowrap; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 10px 24px -10px var(--accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-whatsapp { background: #25d366; color: #06301b; font-weight: 700; }
.btn-whatsapp:hover { box-shadow: 0 10px 24px -10px #25d366; }
.site-header { position: sticky; top: 0; z-index: 100; background: var(--header-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; 
  justify-content: space-between;
  gap: 18px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: .95rem; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); letter-spacing: .5px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 1rem; }
.brand-role { font-size: .72rem; color: var(--muted); }
.primary-nav { margin-inline-start: auto; }
.nav-list { display: flex; align-items: center; gap: 6px; }
.nav-link { display: inline-block; padding: 8px 14px; border-radius: 999px; font-size: .92rem; font-weight: 500; color: var(--muted); transition: color .2s ease, background-color .2s ease; }
.nav-link:hover, .nav-link.is-active { color: var(--text); background: var(--surface-2); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-switch { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.lang-btn { border: 0; background: transparent; font-size: .8rem; font-weight: 700; padding: 3px 6px; color: var(--muted); border-radius: 6px; }
.lang-btn.is-active { color: var(--accent); }
.lang-sep { color: var(--border); font-size: .8rem; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; color: var(--text); transition: border-color .2s ease, color .2s ease, transform .2s ease; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); transform: rotate(12deg); }
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
.header-wa { padding: 10px 18px; font-size: .85rem; }
.nav-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 0; position: relative; }
.nav-toggle span { position: absolute; inset-inline: 10px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s ease, opacity .25s ease; }
.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 20px; }
.nav-toggle span:nth-child(3) { top: 26px; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.hero { padding: clamp(48px, 9vw, 104px) 0 clamp(40px, 6vw, 72px); }
.hero-inner { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 48px; align-items: center; }
.hero-greeting { color: var(--accent); font-weight: 600; letter-spacing: .3px; margin-bottom: 6px; }
.hero-title { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.08; font-weight: 800; letter-spacing: -1px; }
.hero-role { margin-top: 10px; font-size: clamp(1.05rem, 2.4vw, 1.5rem); font-weight: 600; color: var(--text); min-height: 1.6em; }
.role-text { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.role-text.role-in { animation: rolefade .5s ease; }
@keyframes rolefade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hero-desc { margin-top: 16px; max-width: 60ch; color: var(--muted); font-size: 1.02rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-photo { display: flex; justify-content: center; }
.hero-photo-ring { width: min(360px, 80vw); aspect-ratio: 1; border-radius: 50%; padding: 10px; background: conic-gradient(from 180deg, var(--accent), var(--accent-2), var(--accent)); box-shadow: var(--shadow-md); }
.hero-photo-ring img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 6px solid var(--bg); }
.section { padding: clamp(48px, 7vw, 90px) 0; }
.section:nth-of-type(even) { background: var(--surface-2); }
.section-head { margin-bottom: 34px; }
.section-title { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -0.5px; }
.section-subtitle { margin-top: 8px; color: var(--muted); max-width: 62ch; }
.subtitle { font-size: clamp(1.15rem, 2.6vw, 1.5rem); font-weight: 700; margin: 34px 0 18px; }
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 34px; align-items: start; }
.about-bio p { color: var(--muted); font-size: 1.02rem; }
.info-list { display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.info-list li { display: flex; justify-content: space-between; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.info-list li:last-child { border-bottom: 0; }
.info-label { color: var(--muted); font-size: .9rem; }
.info-value { font-weight: 600; font-size: .92rem; text-align: end; word-break: break-word; }
.info-value a:hover { color: var(--accent); }
.services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.service-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.service-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.service-card h4 { font-size: 1.1rem; margin-bottom: 8px; }
.service-card p { color: var(--muted); font-size: .95rem; }
.resume-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 46px; align-items: start; }
.resume-col .subtitle:first-child { margin-top: 0; }
.timeline { position: relative; padding-inline-start: 26px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding: 0 0 22px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; inset-inline-start: -23px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline-period { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 2px 10px; border-radius: 999px; margin-bottom: 8px; }
.timeline-title { font-size: 1.05rem; font-weight: 700; }
.timeline-org { display: inline-block; font-size: .9rem; color: var(--muted); margin-top: 2px; }
.timeline-org:hover { color: var(--accent); }
.timeline-desc { font-size: .9rem; color: var(--muted); margin-top: 2px; }
.skills { display: grid; gap: 18px; }
.skill-head { display: flex; justify-content: space-between; font-size: .92rem; font-weight: 600; margin-bottom: 8px; }
.skill-bar { height: 9px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.skill-bar > span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 1.1s cubic-bezier(.2, .7, .2, 1); }
.skill.is-visible .skill-bar > span { width: var(--level); }
.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tags li { font-size: .85rem; font-weight: 600; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: border-color .2s ease, color .2s ease; }
.tags li:hover { border-color: var(--accent); color: var(--accent); }
.portfolio-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .85rem; font-weight: 600; transition: color .2s ease, border-color .2s ease, background-color .2s ease, transform .2s ease; }
.filter img { border-radius: 3px; }
.filter:hover { transform: translateY(-1px); border-color: var(--accent); color: var(--accent); }
.filter.is-active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; }
.filter.is-active img { box-shadow: 0 0 0 1px rgba(255, 255, 255, .5); }
.portfolio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.portfolio-item.is-hidden { display: none; }
.portfolio-link { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease; }
.portfolio-link:hover { transform: translateY(-6px) scale(1.015); box-shadow: var(--shadow-md); border-color: var(--accent); }
.portfolio-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.portfolio-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.portfolio-link:hover .portfolio-media img { transform: scale(1.06); }
.portfolio-body { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; }
.portfolio-name { font-size: 1rem; font-weight: 700; }
.portfolio-visit { font-size: .8rem; font-weight: 600; color: var(--accent); white-space: nowrap; }
.site-footer { background: var(--surface-2); border-top: 1px solid var(--border); padding: clamp(44px, 6vw, 72px) 0 26px; }
.footer-cta { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.footer-title { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800; }
.footer-desc { color: var(--muted); margin-top: 10px; }
.footer-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 22px; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--muted); font-size: .88rem; }
.footer-bottom a:hover { color: var(--accent); }
.social-links { display: flex; gap: 10px; }
.social-links a { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: transform .2s ease, color .2s ease, border-color .2s ease; }
.social-links a:hover { transform: translateY(-3px); color: var(--accent); border-color: var(--accent); }
.whatsapp-fab { position: fixed; inset-inline-end: 50px; bottom: 22px; z-index: 90; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: #25d366; color: #fff; box-shadow: 0 12px 30px -8px rgba(37, 211, 102, .7); transition: transform .2s ease; }
.whatsapp-fab:hover { transform: scale(1.08); }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (max-width: 1024px) {
  .header-wa { display: none; }
  .nav-toggle { display: inline-block; }
  .primary-nav { position: absolute; top: 100%; inset-inline: 0; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md); padding: 12px 22px; display: none; }
  .primary-nav.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 4px; }
  .nav-link { display: block; padding: 12px 14px; border-radius: 10px; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { order: 2; }
  .hero-photo { order: 1; }
  .hero-desc { margin-inline: auto; }
  .hero-cta { justify-content: center; }
  .about-grid, .resume-grid { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .brand-name, .brand-role { display: none; }
  .services-grid { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .info-list li { flex-direction: column; align-items: flex-start; gap: 2px; }
  .info-value { text-align: start; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .hero-photo-ring { width: min(280px, 74vw); }
}
[dir="rtl"] .brand-mark { letter-spacing: 0; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}