/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #0D1B2E;
  --bg-alt:       #091626;
  --bg-card:      #122040;
  --bg-card-h:    #162850;
  --accent:       #D4A847;
  --accent-h:     #e0b84f;
  --teal:         #2ABFBF;
  --text:         #FFFFFF;
  --muted:        #7A94B0;
  --border:       rgba(255,255,255,0.07);
  --radius:       12px;
  --ease:         0.25s ease;
  --max-w:        1200px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

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

img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }

/* === NAVIGATION === */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(9, 22, 38, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background var(--ease);
}
.nav--solid { background: rgba(9, 22, 38, 0.98); }

.nav__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}

.nav__logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.nav__links {
  display: flex;
  list-style: none;
  gap: 28px;
  margin-left: auto;
}
.nav__links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--ease);
}
.nav__links a:hover { color: var(--text); }

.lang-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}
.lang-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  transition: var(--ease);
}
.lang-btn:hover { color: var(--text); }
.lang-btn.is-active { background: var(--accent); color: #0D1B2E; }

/* === RTL (Arabic) === */
[data-lang="ar"] { direction: rtl; }
[data-lang="ar"] .nav__links { margin-left: 0; margin-right: auto; }
[data-lang="ar"] .nav__burger { margin-left: 0; margin-right: auto; }
[data-lang="ar"] .hero__inner { flex-direction: row-reverse; }
[data-lang="ar"] .section__title::after { left: auto; right: 0; }
[data-lang="ar"] .contact__inner .section__title::after { right: 50%; left: auto; transform: translateX(50%); }
[data-lang="ar"] .project-card__link { flex-direction: row-reverse; }
[data-lang="ar"] .hero__content { text-align: right; }
[data-lang="ar"] .hero__actions { justify-content: flex-end; }

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.nav__burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--ease);
}

/* === HERO === */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(140deg, #091626 0%, #0D1B2E 55%, #0f2240 100%);
}

.hero__pattern {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero__glow {
  position: absolute;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(212,168,71,0.07) 0%, transparent 68%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  padding-top: 80px;
  padding-bottom: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
}

.hero__content { max-width: 580px; flex: 1; }

.hero__avatar-wrap {
  flex-shrink: 0;
  position: relative;
}

.hero__avatar {
  width: 280px;
  height: 280px;
  object-fit: cover;
  object-position: top center;
  border-radius: 50%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  display: block;
}

.hero__eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.hero__name {
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.hero__stack {
  font-size: 1rem;
  color: var(--teal);
  font-weight: 500;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.hero__desc {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 44px;
  line-height: 1.75;
}

.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--ease);
  border: none;
}
.btn--primary {
  background: var(--accent);
  color: #0D1B2E;
}
.btn--primary:hover {
  background: var(--accent-h);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212,168,71,0.25);
}
.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.18);
}
.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn--lg { padding: 15px 40px; font-size: 1rem; }

/* === SECTIONS === */
.section { padding: 96px 0; }
.section--alt { background: var(--bg-alt); }

.section__title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 56px;
  display: inline-block;
  position: relative;
}
.section__title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -12px;
  width: 40px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* === ABOUT === */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 64px;
  align-items: start;
}

.about__text p {
  color: var(--muted);
  margin-bottom: 20px;
  font-size: 1.05rem;
  line-height: 1.8;
}
.about__text p:last-child { margin-bottom: 0; }

.about__highlights {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.highlight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.highlight-card__num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.highlight-card__label {
  font-size: 0.85rem;
  color: var(--muted);
}

/* === STACK === */
.stack__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
}

.stack-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: var(--ease);
}
.stack-item:hover {
  border-color: rgba(212,168,71,0.35);
  transform: translateY(-3px);
}
.stack-item__icon {
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.stack-item__name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}
.stack-item__glyph {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--accent);
  font-family: 'Amiri', 'Arial', serif;
  line-height: 1;
}

/* === PROJECTS === */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 22px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--ease);
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  border-color: rgba(212,168,71,0.28);
  transform: translateY(-5px);
  box-shadow: 0 20px 48px rgba(0,0,0,0.35);
}

.project-card__img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.project-card__placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #162850 0%, #0f2240 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.project-card__body {
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-card__tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  width: fit-content;
}
.tag--laravel   { background: rgba(255,45,32,0.12);  color: #ff7b6e; }
.tag--wordpress { background: rgba(33,117,176,0.14); color: #5ab8ef; }

.project-card__title {
  font-size: 1.05rem;
  font-weight: 700;
}
.project-card__desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
}
.project-card__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 6px;
  transition: gap var(--ease);
}
.project-card__link:hover { gap: 9px; }

/* === CERTIFICATES === */
.certs__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.cert-item {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: var(--ease);
}
.cert-item:hover {
  border-color: rgba(212,168,71,0.35);
  transform: scale(1.03);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.cert-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cert-item__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9,22,38,0.88) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 12px;
  opacity: 0;
  transition: opacity var(--ease);
}
.cert-item:hover .cert-item__overlay { opacity: 1; }
.cert-item__label {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

/* === CONTACT === */
.contact__inner {
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}
.contact__inner .section__title { display: block; }
.contact__inner .section__title::after { left: 50%; transform: translateX(-50%); }
.contact__sub {
  color: var(--muted);
  margin-bottom: 40px;
  font-size: 1.05rem;
}

/* === FOOTER === */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 22px 0;
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer__inner p { font-size: 0.875rem; color: var(--muted); }
.footer__gh {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--muted);
  transition: color var(--ease);
}
.footer__gh:hover { color: var(--text); }

/* === LIGHTBOX === */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,0.93);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}
.lightbox__content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.lightbox__content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.lightbox__caption {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  text-align: center;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ease);
}
.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover { background: rgba(255,255,255,0.18); }

.lightbox__close { top: 20px; right: 20px; width: 42px; height: 42px; font-size: 0.95rem; }
.lightbox__prev  { left: 20px;  top: 50%; transform: translateY(-50%); width: 50px; height: 50px; font-size: 1.6rem; }
.lightbox__next  { right: 20px; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; font-size: 1.6rem; }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .about__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .about__highlights {
    flex-direction: row;
  }
  .highlight-card { flex: 1; }
}

@media (max-width: 900px) {
  .hero__inner { flex-direction: column-reverse; align-items: flex-start; gap: 36px; }
  .hero__avatar { width: 160px; height: 160px; }
}

@media (max-width: 768px) {
  .nav__links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: rgba(9, 22, 38, 0.98);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
    gap: 18px;
  }
  .nav__links.is-open { display: flex; }
  .nav__burger { display: flex; }

  .hero__actions { flex-direction: column; }
  .hero__actions .btn { justify-content: center; }

  .projects__grid { grid-template-columns: 1fr; }

  .footer__inner { flex-direction: column; gap: 12px; text-align: center; }

  .lightbox__prev { left: 8px; }
  .lightbox__next { right: 8px; }
}

@media (max-width: 480px) {
  .about__highlights { flex-direction: column; }
  .certs__grid { grid-template-columns: repeat(2, 1fr); }
  .stack__grid { grid-template-columns: repeat(3, 1fr); }
}
