/* ============================================================
   Azaam — Arabic Game Localization Specialist
   Dark, modern, gaming-inspired portfolio
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg: #0a0b10;
  --bg-2: #0f1117;
  --bg-3: #141622;
  --panel: #161827;
  --panel-2: #1c1f2e;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8eaf2;
  --text-dim: #9aa0b4;
  --text-mute: #6b7088;
  --accent: #8b6cf6;       /* purple */
  --accent-2: #4ad6ff;     /* cyan */
  --accent-soft: rgba(139, 108, 246, 0.18);
  --danger: #ff6b6b;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --container: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

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

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 16px;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p  { margin: 0 0 14px; color: var(--text-dim); }
.grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 11, 16, 0.7);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav.scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 11, 16, 0.85);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.logo-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0b10;
  font-weight: 800;
}
.logo-text { letter-spacing: 0.02em; }

.nav-links {
  display: flex;
  gap: 6px;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 0.95rem;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 42px; height: 42px;
  padding: 0;
  position: relative;
}
.nav-toggle span {
  position: absolute;
  left: 11px; right: 11px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease), top 0.3s var(--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[aria-expanded="true"] span:nth-child(1) { top: 20px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { top: 20px; transform: rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
              border-color 0.2s var(--ease), color 0.2s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #6f4ee0);
  color: #fff;
  box-shadow: 0 8px 24px rgba(139, 108, 246, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--text);
}
.btn-small {
  padding: 10px 16px;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text);
}
.btn-small:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 96px 0 80px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 720px;
  background:
    radial-gradient(50% 50% at 25% 30%, rgba(139, 108, 246, 0.25), transparent 60%),
    radial-gradient(45% 45% at 80% 20%, rgba(74, 214, 255, 0.18), transparent 60%),
    radial-gradient(40% 40% at 50% 80%, rgba(139, 108, 246, 0.12), transparent 60%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}
.hero-inner { position: relative; z-index: 1; max-width: 880px; }

.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  margin: 0 0 22px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #c9bdfd;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(139, 108, 246, 0.35);
}
.hero-title { margin-bottom: 22px; }
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 720px;
  margin-bottom: 36px;
}
.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 22px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.stat { padding: 6px 12px; }
.stat-num {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-num.small {
  font-size: 1.1rem;
  background: none;
  -webkit-text-fill-color: initial;
  color: var(--text);
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-mute);
  margin-top: 4px;
}

/* ---------- Sections ---------- */
.section { padding: 96px 0; position: relative; }
.section-alt { background: var(--bg-2); }
.section-head { max-width: 760px; margin-bottom: 48px; }
.section-tag {
  display: inline-block;
  padding: 5px 12px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: rgba(74, 214, 255, 0.1);
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(74, 214, 255, 0.25);
}
.section-sub { color: var(--text-dim); font-size: 1.05rem; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 36px;
  align-items: start;
}
.about-text p { font-size: 1.02rem; }
.about-card {
  padding: 26px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.about-card h3 { margin-bottom: 18px; color: var(--text); }
.kv {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kv li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}
.kv li:last-child { border-bottom: none; padding-bottom: 0; }
.kv span { color: var(--text-mute); font-size: 0.9rem; }
.kv strong { color: var(--text); font-weight: 600; font-size: 0.95rem; }

/* ---------- Projects ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.project {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.project:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}
.project-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: #0c0d14;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border);
}
.project-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.6));
}
.media-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-mute);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  background:
    repeating-linear-gradient(45deg,
      rgba(255, 255, 255, 0.02) 0 12px,
      transparent 12px 24px),
    linear-gradient(135deg, #1a1d2b, #0f1117);
  z-index: 0;
}
/* If background-image loads, the fallback stays underneath but is fully covered. */
.project-media[style*="url"] .media-fallback { opacity: 0; }
.badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(10, 11, 16, 0.75);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
}
.project-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.project-type {
  color: var(--accent-2);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  margin: -6px 0 12px;
}
.bullets {
  list-style: none;
  padding: 0;
  margin: 8px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bullets li {
  position: relative;
  padding-left: 18px;
  color: var(--text-dim);
  font-size: 0.94rem;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 0; top: 11px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.project .btn-small { align-self: flex-start; margin-top: auto; }

/* ---------- Samples ---------- */
.samples { display: flex; flex-direction: column; gap: 22px; }
.sample {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.sample-col {
  padding: 26px 28px;
}
.sample-col + .sample-col {
  border-left: 1px solid var(--border);
}
.col-head {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 700;
  margin-bottom: 14px;
}
.sample-col p {
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.75;
}
.sample-col.ar {
  font-family: "Tajawal", "Segoe UI", sans-serif;
  text-align: right;
}
.sample-col.ar p {
  font-size: 1.08rem;
  line-height: 2;
  color: #f1f3fb;
}
.sample-col.ar .col-head { text-align: right; }
.sample.short .sample-col { padding: 30px 28px; }
.big-line {
  font-size: 1.4rem !important;
  line-height: 1.5 !important;
  font-weight: 500;
}
.sample-col.ar .big-line { font-size: 1.55rem !important; }

/* ---------- Skills ---------- */
.skills {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.skills li {
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--text);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
}
.skills li:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

/* ---------- Workflow ---------- */
.workflow {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  counter-reset: step;
}
.workflow li {
  padding: 26px 22px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.workflow li:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}
.step-num {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-2);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.workflow h3 { margin-bottom: 8px; }
.workflow p { margin: 0; font-size: 0.95rem; }

/* ---------- Contact ---------- */
.contact-card {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  padding: 44px;
  background:
    radial-gradient(60% 100% at 0% 0%, rgba(139, 108, 246, 0.18), transparent 60%),
    linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.contact-left h2 { margin: 8px 0 14px; }
.contact-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.contact-list li {
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.contact-list li:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.contact-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 700;
}
.contact-list a {
  color: var(--text);
  font-weight: 500;
  word-break: break-all;
}

/* ---------- Footer ---------- */
.footer {
  padding: 28px 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.footer p { margin: 0; font-size: 0.9rem; color: var(--text-mute); }
.to-top {
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: color 0.2s var(--ease);
}
.to-top:hover { color: var(--text); }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .about-grid,
  .projects,
  .contact-card {
    grid-template-columns: 1fr;
  }
  .workflow { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:last-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 68px; left: 0; right: 0;
    background: rgba(10, 11, 16, 0.97);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px 22px;
    gap: 4px;
  }
  .nav-links.open a {
    padding: 12px 10px;
    border-radius: 8px;
  }

  .hero { padding: 64px 0 56px; }
  .section { padding: 72px 0; }
  .section-head { margin-bottom: 32px; }

  .stats { grid-template-columns: 1fr; }
  .stat:last-child { grid-column: auto; }

  .sample { grid-template-columns: 1fr; }
  .sample-col + .sample-col {
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .workflow { grid-template-columns: 1fr; }
  .contact-card { padding: 28px; }
}

@media (max-width: 420px) {
  .container { padding: 0 18px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
