/* ── Reset & Custom Properties ─────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: dark;
  --bg:           oklch(14% 0.055 240);
  --surface:      oklch(19% 0.055 240);
  --border:       oklch(28% 0.055 240);
  --text:         oklch(93% 0.005 240);
  --text-muted:   oklch(62% 0.012 240);
  --accent:       oklch(72% 0.18 200);
  --accent-dim:   oklch(72% 0.18 200 / 0.12);
  --accent-glow:  oklch(72% 0.18 200 / 0.25);
  --radius:       10px;
  --nav-h:        64px;
  --font-en:      'Inter', system-ui, sans-serif;
  --font-ar:      'Cairo', 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;
  --ease:         0.2s ease;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-en);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Nav ────────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  background: oklch(14% 0.055 240 / 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: opacity var(--ease);
}
.nav-logo:hover { opacity: 0.7; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color var(--ease);
}
.nav-links a:hover { color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--ease);
}

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 2rem) clamp(1.5rem, 5vw, 4rem) 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 60% 50% at 50% 40%,
    oklch(72% 0.18 200 / 0.06) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 760px;
}

.hero-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  margin-bottom: 1.5rem;
  box-shadow: 0 0 0 6px var(--accent-dim);
  transition: box-shadow var(--ease), transform var(--ease);
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.hero-avatar:hover {
  box-shadow: 0 0 0 8px var(--accent-glow);
  transform: scale(1.04);
}

.hero-greeting {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.hero-name {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text) 55%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-role {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 0.75rem;
}

.hero-ar {
  font-family: var(--font-ar);
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  opacity: 0.75;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: oklch(14% 0.055 240);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: oklch(78% 0.18 200);
  border-color: oklch(78% 0.18 200);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Scroll hint */
.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
}
.hero-scroll-hint span {
  display: block;
  width: 1.5px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scroll-line 2s ease-in-out infinite;
}
@keyframes scroll-line {
  0%   { opacity: 0; transform: scaleY(0); transform-origin: top; }
  50%  { opacity: 1; transform: scaleY(1); transform-origin: top; }
  100% { opacity: 0; transform: scaleY(1); transform-origin: bottom; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .hero-scroll-hint { display: none; }
}

/* ── Sections ───────────────────────────────────────────────────────── */
.section     { padding: 6rem clamp(1.5rem, 5vw, 4rem); }
.section-alt { background: oklch(17% 0.06 240); }

.container { max-width: 1100px; margin: 0 auto; }

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 2.5rem;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ── About ──────────────────────────────────────────────────────────── */
.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.about-en p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}
.about-en p:last-child { margin-bottom: 0; }
.about-en strong { color: var(--text); font-weight: 600; }

.about-ar {
  border-left: 1px solid var(--border);
  padding-left: 2.5rem;
  font-family: var(--font-ar);
  color: var(--text-muted);
  line-height: 2;
  font-size: 0.95rem;
}

/* ── Skills ─────────────────────────────────────────────────────────── */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.skill-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: background-color var(--ease), border-color var(--ease), color var(--ease);
  cursor: default;
}
.skill-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.skill-pill.featured {
  border-color: oklch(24% 0.04 200);
  background: oklch(16% 0.02 200);
  color: oklch(78% 0.15 200);
}
.skill-pill.featured:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── Projects ───────────────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim), 0 8px 30px oklch(0% 0 0 / 0.3);
  transform: translateY(-2px);
}

.project-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.project-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 0.1rem;
}
.project-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text);
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.25rem;
}
.tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  background: oklch(23% 0.055 240);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Contact ────────────────────────────────────────────────────────── */
.contact-container { text-align: center; }

.contact-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 3rem;
  margin-top: -1.75rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease);
}
.contact-link svg {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}
.contact-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 16px var(--accent-glow);
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}
.footer-domain { color: var(--accent); }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: oklch(17% 0.055 240);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 1.25rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 1rem; }

  .about-card {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .about-ar {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 2rem;
  }

  .projects-grid { grid-template-columns: 1fr; }

  .contact-links { flex-direction: column; align-items: center; }
  .contact-link  { width: 100%; max-width: 320px; justify-content: center; }
}

@media (max-width: 480px) {
  .section      { padding: 4rem 1.25rem; }
  .about-card   { padding: 1.75rem; }
  .project-card { padding: 1.4rem; }
}
