:root {
  --bg: #0a0a0a;
  --bg2: #111111;
  --bg3: #161616;
  --accent: #c778dd;
  --accent2: #e06c75;
  --text: #abb2bf;
  --text-bright: #e5e5e5;
  --text-dim: #5c6370;
  --border: #2a2a2a;
  --green: #98c379;
  --yellow: #e5c07b;
  --blue: #61afef;
  --font: 'Fira Code', 'Tajawal', ui-monospace, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.7;
  overflow-x: hidden;
}
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

.skip { position: absolute; left: 20px; top: -80px; background: var(--accent); color: var(--bg); padding: 8px 12px; z-index: 200; text-decoration: none; }
.skip:focus { top: 10px; }

/* ── NAVBAR ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 16px 40px;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { color: var(--text-bright); font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; direction: ltr; }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 22px; list-style: none; }
.nav-links a { color: var(--text); text-decoration: none; font-size: 13px; transition: color .2s; white-space: nowrap; }
.nav-links a span { color: var(--accent); }
.nav-links a:hover { color: var(--text-bright); }
.lang-switch { border: 1px solid var(--accent); color: var(--accent) !important; padding: 4px 10px; }
.lang-switch:hover { background: var(--accent); color: var(--bg) !important; }
.nav-end { display: flex; align-items: center; gap: 14px; }
.nav-end .lang-switch { display: none; font-size: 12px; text-decoration: none; }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 6px 4px; background: none; border: 0; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text-bright); transition: all .3s; }
.mobile-menu {
  display: none; position: fixed; top: 56px; left: 0; right: 0; z-index: 99;
  background: rgba(10,10,10,0.97); padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-direction: column; gap: 6px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a { color: var(--text); text-decoration: none; font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.mobile-menu a span { color: var(--accent); }

/* ── SIDE ICONS ── */
.side-icons {
  position: fixed; left: 16px; bottom: 80px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  z-index: 50;
}
.side-icons::after {
  content: ''; display: block; width: 1px; height: 70px;
  background: var(--text-dim); margin-top: 8px;
}
.side-icons a { color: var(--text-dim); text-decoration: none; transition: color .2s, transform .2s; }
.side-icons a:hover { color: var(--accent); transform: translateY(-3px); }

/* ── SECTIONS ── */
section { padding: 80px 40px; }
.container { max-width: 1100px; margin: 0 auto; }
.section-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 20px; color: var(--text-bright); margin-bottom: 14px;
  flex-wrap: wrap;
}
.section-title .hash { color: var(--accent); }
.section-title::after {
  content: ''; flex: 1; min-width: 40px; max-width: 300px; height: 1px; background: var(--border);
}
.section-lead { font-size: 13px; color: var(--text); max-width: 620px; margin-bottom: 36px; }
.section-lead strong { color: var(--accent2); font-weight: 500; }

/* ── HERO ── */
#home {
  min-height: 100vh;
  display: flex; align-items: center;
  padding-top: 90px;
}
.about-grid {
  display: grid; grid-template-columns: 1fr auto;
  gap: 50px; align-items: center; width: 100%; max-width: 1100px; margin: 0 auto;
}
.hero-tag { color: var(--accent); font-size: 13px; margin-bottom: 10px; }
.hero-title { font-size: clamp(26px,4vw,48px); color: var(--text-bright); line-height: 1.2; margin-bottom: 12px; }
.hero-subtitle { font-size: clamp(13px,2vw,17px); color: var(--accent2); margin-bottom: 20px; }
.hero-desc { max-width: 520px; font-size: 13px; line-height: 1.8; margin-bottom: 16px; }
.hero-desc p { margin-bottom: 10px; }
.hero-desc p span { color: var(--accent); }
.about-highlight {
  border: 1px solid var(--border); padding: 14px 18px; background: var(--bg2); margin-top: 16px; margin-bottom: 24px; max-width: 520px;
}
.about-highlight ul { list-style: none; }
.about-highlight li { font-size: 12px; padding: 3px 0; }
.about-highlight li::before { content: '// '; color: var(--text-dim); }
.about-highlight li strong { color: var(--text-bright); font-weight: 500; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; font-family: var(--font); font-size: 13px;
  text-decoration: none; border: 1px solid var(--accent); color: var(--accent);
  background: transparent; cursor: pointer; transition: all .2s;
  position: relative; overflow: hidden; white-space: nowrap;
}
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: var(--accent); transform: translateX(-101%); transition: transform .3s; z-index: 0;
}
.btn:hover::before { transform: translateX(0); }
.btn:hover { color: var(--bg); }
.btn span { position: relative; z-index: 1; }
.btn-ghost { border-color: var(--text-dim); color: var(--text); }
.btn-ghost::before { background: var(--text-dim); }
.btn-ghost:hover { color: var(--bg); }
.status-badge {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 14px; border: 1px solid var(--border);
  background: var(--bg2); font-size: 12px; margin-top: 16px;
}
.status-badge strong { color: var(--text-bright); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; flex-shrink: 0; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* Avatar */
.avatar-wrap { position: relative; width: 260px; height: 320px; flex-shrink: 0; }
.avatar-wrap::before {
  content: ''; position: absolute; top: 12px; left: 12px;
  width: 100%; height: 100%; border: 1px solid var(--accent); z-index: 0;
}
.avatar-wrap::after {
  content: ''; position: absolute; bottom: 12px; right: 12px;
  width: 55%; height: 55%; border: 1px solid var(--accent2); z-index: 0; opacity: .4;
}
.avatar-img {
  width: 100%; height: 100%; object-fit: cover; object-position: center;
  position: relative; z-index: 1; display: block;
  background: var(--bg3);
}
.dot-grid {
  display: grid; grid-template-columns: repeat(5,8px); gap: 6px;
  position: absolute; bottom: -28px; right: -18px; opacity: .25;
}
.dot-grid span { width: 3px; height: 3px; background: var(--accent); border-radius: 50%; display: block; }

/* ── QUOTE ── */
.quote-section {
  padding: 50px 40px; display: flex; justify-content: center;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.quote-box { max-width: 640px; width: 100%; border: 1px solid var(--border); padding: 28px 36px; background: var(--bg2); }
.quote-mark { color: var(--accent); font-size: 26px; line-height: 1; }
.quote-mark.end { text-align: right; }
.quote-text { color: var(--text-bright); font-size: 15px; line-height: 1.8; margin: 6px 0; text-align: center; }
.quote-author { color: var(--text-dim); font-size: 12px; text-align: right; }
.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 20px; }
.stat { border: 1px solid var(--border); background: var(--bg); padding: 12px 14px; font-size: 11px; color: var(--text-dim); }
.stat strong { display: block; color: var(--accent); font-size: 14px; font-weight: 700; }

/* ── ABOUT ── */
.contact-grid { display: grid; grid-template-columns: 1fr auto; gap: 50px; align-items: start; }
.about-text p { font-size: 13px; line-height: 1.9; margin-bottom: 14px; max-width: 620px; }
.about-text p span { color: var(--accent); }
.contact-box { border: 1px solid var(--border); padding: 22px 26px; background: var(--bg2); min-width: 280px; }
.contact-box-title { font-size: 11px; color: var(--text-dim); margin-bottom: 14px; }
.focus-cmd { font-size: 12px; color: var(--text-bright); margin-bottom: 6px; direction: ltr; text-align: left; }
.focus-cmd b { color: var(--accent); font-weight: 400; }
.focus-list { list-style: none; margin-bottom: 14px; }
.focus-list li { font-size: 12px; padding: 3px 0; }
.focus-list li::before { content: '▹ '; color: var(--accent); }
.focus-note { font-size: 11px; color: var(--text-dim); border-top: 1px solid var(--border); padding-top: 12px; }
.contact-item { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text); margin-bottom: 10px; text-decoration: none; transition: color .2s; overflow-wrap: anywhere; }
.contact-item:hover { color: var(--accent); }
.contact-item .icon { color: var(--accent); font-size: 14px; flex-shrink: 0; display: inline-flex; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ── SKILLS ── */
.skills-wrapper { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 20px; }
.skill-group { border: 1px solid var(--border); padding: 18px; background: var(--bg2); }
.skill-group-title { color: var(--accent); font-size: 12px; margin-bottom: 12px; font-weight: 700; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 10px; border: 1px solid var(--border); font-size: 11px; color: var(--text); background: var(--bg); transition: border-color .2s, color .2s; cursor: default; }
.tag:hover { border-color: var(--accent); color: var(--accent); }

/* ── EXPERIENCE ── */
#experience, #projects { background: var(--bg2); }
.exp-list { display: grid; gap: 18px; }
.exp-card { border: 1px solid var(--border); background: var(--bg); transition: border-color .2s; }
.exp-card:hover { border-color: var(--accent); }
.exp-bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 6px 18px; background: var(--bg3); border-bottom: 1px solid var(--border); font-size: 11px; color: var(--text-dim); }
.exp-bar .date { color: var(--accent); }
.exp-body { padding: 18px; }
.exp-name { color: var(--text-bright); font-size: 15px; font-weight: 700; }
.exp-role { color: var(--accent2); font-size: 12px; margin-bottom: 10px; }
.exp-body ul { list-style: none; }
.exp-body li { font-size: 12px; padding: 3px 0; padding-left: 18px; position: relative; }
.exp-body li::before { content: '▹'; color: var(--accent); position: absolute; left: 0; }

/* ── PROJECTS ── */
#projects { background: var(--bg); }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(270px,1fr)); gap: 18px; }
.proj-card { border: 1px solid var(--border); background: var(--bg2); overflow: hidden; transition: border-color .2s, transform .2s; }
.proj-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.proj-img { width: 100%; height: 120px; display: flex; align-items: center; justify-content: center; position: relative; }
.proj-icon { font-size: 44px; opacity: .25; }
.proj-num { position: absolute; top: 10px; left: 14px; font-size: 11px; color: var(--accent); }
.proj-tech-bar { padding: 5px 14px; background: var(--bg3); font-size: 10px; color: var(--text-dim); border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-body { padding: 18px; }
.proj-name { color: var(--text-bright); font-size: 14px; font-weight: 700; margin-bottom: 7px; }
.proj-desc { font-size: 12px; line-height: 1.7; margin-bottom: 12px; }
.proj-flow { font-size: 10px; color: var(--text-dim); border-top: 1px dashed var(--border); padding-top: 10px; }
.proj-flow b { color: var(--accent); font-weight: 400; }
.proj-vis-1 { background: linear-gradient(135deg,#1a1a2e,#16213e); }
.proj-vis-2 { background: linear-gradient(135deg,#1a1a1a,#2d1b2e); }
.proj-vis-3 { background: linear-gradient(135deg,#0d1f0d,#1a2e1a); }
.proj-vis-4 { background: linear-gradient(135deg,#1f1a0d,#2e2a1a); }
.proj-vis-5 { background: linear-gradient(135deg,#1a0d0d,#2e1a1a); }

/* ── EDUCATION / CERTIFICATIONS ── */
#education { background: var(--bg2); }
.certs-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 14px; }
.cert-card { border: 1px solid var(--border); padding: 16px 18px; background: var(--bg); transition: border-color .2s; }
.cert-card:hover { border-color: var(--accent); }
.cert-card.wide { grid-column: span 2; }
.cert-icon { color: var(--accent); font-size: 17px; margin-bottom: 7px; }
.cert-name { color: var(--text-bright); font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.cert-by { color: var(--text-dim); font-size: 11px; }
.sub-title { color: var(--accent); font-size: 12px; font-weight: 700; margin: 30px 0 14px; }

/* ── CONTACT ── */
.contact-desc { font-size: 13px; line-height: 1.8; margin-bottom: 12px; max-width: 560px; }
.contact-desc strong { color: var(--text-bright); font-weight: 500; }

/* ── FOOTER ── */
footer {
  padding: 22px 40px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.footer-logo { color: var(--text-bright); font-size: 14px; font-weight: 700; direction: ltr; }
.footer-logo span { color: var(--accent); }
.footer-copy { color: var(--text-dim); font-size: 11px; }
.footer-links { display: flex; gap: 14px; }
.footer-links a { color: var(--text-dim); text-decoration: none; font-size: 12px; transition: color .2s; }
.footer-links a:hover { color: var(--accent); }

/* ── ANIMATIONS ── */
.js .fade-in { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.js .fade-in.visible { opacity: 1; transform: translateY(0); }

.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%;
  color: var(--text-bright);
  clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
}
.glitch::before { animation: glitch1 3s infinite; color: var(--accent); }
.glitch::after { animation: glitch2 3s infinite; color: var(--accent2); clip-path: polygon(0 66%, 100% 66%, 100% 100%, 0 100%); }
@keyframes glitch1 { 0%,92%,100% { transform: translate(0) } 93% { transform: translate(-2px,1px) } 95% { transform: translate(2px,-1px) } 97% { transform: translate(-1px,0) } }
@keyframes glitch2 { 0%,92%,100% { transform: translate(0) } 93% { transform: translate(2px,-1px) } 95% { transform: translate(-2px,1px) } 97% { transform: translate(1px,0) } }
.cursor::after { content: '|'; animation: blink 1s infinite; color: var(--accent); }
@keyframes blink { 0%,100% { opacity: 1 } 50% { opacity: 0 } }

/* ── RTL (Arabic) ── */
html[dir="rtl"] body { line-height: 1.9; }
html[dir="rtl"] .side-icons { left: auto; right: 16px; }
html[dir="rtl"] .btn::before { transform: translateX(101%); }
html[dir="rtl"] .btn:hover::before { transform: translateX(0); }
html[dir="rtl"] .avatar-wrap::before { left: auto; right: 12px; }
html[dir="rtl"] .avatar-wrap::after { right: auto; left: 12px; }
html[dir="rtl"] .dot-grid { right: auto; left: -18px; }
html[dir="rtl"] .quote-mark { text-align: right; }
html[dir="rtl"] .quote-mark.end, html[dir="rtl"] .quote-author { text-align: left; }
html[dir="rtl"] .glitch::before, html[dir="rtl"] .glitch::after { left: auto; right: 0; }
html[dir="rtl"] .exp-body li { padding-left: 0; padding-right: 18px; }
html[dir="rtl"] .exp-body li::before { content: '◃'; left: auto; right: 0; }
html[dir="rtl"] .focus-list li::before { content: '◃ '; }
html[dir="rtl"] .proj-num { left: auto; right: 14px; }
html[dir="rtl"] .hero-title, html[dir="rtl"] .section-title { line-height: 1.5; }

/* ── RESPONSIVE ── */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .nav-end .lang-switch { display: inline-block; }
}
@media (max-width: 768px) {
  nav { padding: 14px 20px; }
  .side-icons { display: none; }
  section { padding: 55px 20px; }
  #home { padding-top: 80px; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .avatar-wrap { width: 200px; height: 240px; margin: 0 auto; order: -1; }
  .contact-grid { grid-template-columns: 1fr; gap: 28px; }
  .contact-box { min-width: unset; }
  .quote-section { padding: 36px 20px; }
  .quote-box { padding: 22px 20px; }
  footer { padding: 18px 20px; }
  .section-title { font-size: 18px; }
  .cert-card.wide { grid-column: auto; }
}
@media (max-width: 480px) {
  .hero-btns { flex-direction: column; }
  .btn { justify-content: center; }
  .stats { grid-template-columns: 1fr; }
  .projects-grid, .skills-wrapper, .certs-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .fade-in { opacity: 1; transform: none; }
}
html[dir="rtl"] .focus-cmd { text-align: right; }
