/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

html, body { overflow-x: hidden; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #070b17;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0a0f1e; }
::-webkit-scrollbar-thumb { background: #1e3a5f; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #06b6d4; }

/* ── Font helper ── */
.font-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ── Page ambient background (shared across every page) ── */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-glow {
  position: absolute;
  width: 60vw;
  height: 60vw;
  max-width: 900px;
  max-height: 900px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  mix-blend-mode: screen;
}
.bg-glow--1 {
  top: -20%; left: -10%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.35), transparent 70%);
  animation: glowDrift 22s ease-in-out infinite alternate;
}
.bg-glow--2 {
  bottom: -25%; right: -15%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.28), transparent 70%);
  animation: glowDrift 28s ease-in-out infinite alternate-reverse;
}
@keyframes glowDrift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, -30px) scale(1.1); }
}
.bg-grid-soft {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(6, 182, 212, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 182, 212, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse at center, black 35%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 35%, transparent 85%);
}
.bg-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0,
    rgba(255, 255, 255, 0) 3px,
    rgba(255, 255, 255, 0.012) 4px,
    rgba(255, 255, 255, 0.012) 5px
  );
  opacity: 0.5;
}

/* Sections sit above the ambient bg */
nav, header, section, footer { position: relative; z-index: 1; }

/* ── Text gradient (3-stop, shared) ── */
.text-gradient,
.title-gradient {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Shared: section kicker (mono tag above a title) ── */
.section-kicker {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  color: #06b6d4;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: inline-block;
}

/* ── Shared: window chrome (terminal dots + path) ── */
.dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dot-red    { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
.dot-yellow { background: #eab308; box-shadow: 0 0 8px rgba(234, 179, 8, 0.45); }
.dot-green  { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.5); }

.window-frame {
  background: linear-gradient(135deg, #101a34 0%, #0c1326 100%);
  border: 1px solid rgba(6, 182, 212, 0.22);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(6, 182, 212, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.frame-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(6, 182, 212, 0.15);
}
.frame-path {
  margin-left: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  color: #94a3b8;
}
.frame-body { padding: 28px; }

/* ── Shared: blink (used for carets, cursors) ── */
@keyframes blink { 50% { opacity: 0; } }

/* ── Navbar ── */
.nav-link {
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-link:hover { color: #06b6d4; }

.navbar-scrolled {
  background: rgba(10, 15, 30, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(30, 58, 95, 0.45);
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 28px;
  border-radius: 10px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 22px rgba(6, 182, 212, 0.28);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 36px rgba(6, 182, 212, 0.45);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #06b6d4;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 28px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.btn-outline:hover {
  background: rgba(6, 182, 212, 0.08);
  border-color: #06b6d4;
}

/* ── Section title ── */
.section-title {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 44px;
  height: 3px;
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
  border-radius: 2px;
}

/* ── Social links ── */
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  color: #9ca3af;
  text-decoration: none;
  transition: all 0.2s;
}
.social-link:hover {
  border-color: #06b6d4;
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.08);
}

/* ── About tags ── */
.about-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.07);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.18);
  transition: background 0.2s, border-color 0.2s;
}
.about-tag:hover {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.35);
}

/* ── Project cards ── */
.project-card {
  background: rgba(13, 21, 38, 0.85);
  border: 1px solid rgba(30, 58, 95, 0.55);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.project-card:hover {
  transform: translateY(-5px);
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(6, 182, 212, 0.08);
}

/* ── Project image / placeholder ── */
.project-img {
  width: 100%;
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(30, 58, 95, 0.45);
  flex-shrink: 0;
  overflow: hidden;
}

/* When an actual <img> is placed inside .project-img */
.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-img--blue {
  background: linear-gradient(135deg, rgba(14, 36, 120, 0.5) 0%, rgba(6, 182, 212, 0.15) 100%);
}
.project-img--indigo {
  background: linear-gradient(135deg, rgba(67, 56, 202, 0.45) 0%, rgba(59, 130, 246, 0.15) 100%);
}
.project-img--teal {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.45) 0%, rgba(6, 182, 212, 0.15) 100%);
}
/* ── White background logo card ── */
.project-img--white-bg {
  background: #ffffff;
}
.project-img--white-bg img.project-logo-contain {
  width: auto;
  height: auto;
  max-width: 58%;
  max-height: 58%;
  object-fit: contain;
}

/* ── Dark background logo card ── */
.project-img--dark-bg {
  background: #0d1526;
}
.project-img--dark-bg img.project-logo-contain {
  width: auto;
  height: auto;
  max-width: 58%;
  max-height: 58%;
  object-fit: contain;
}

/* ── Mmar Naqel logo card ── */
.mmar-logo-card {
  background: #ffffff;
  flex-direction: column;
  gap: 10px;
}
.mmar-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
}
.mmar-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.mmar-en {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1a202c;
  letter-spacing: 0.06em;
  line-height: 1.2;
}
.mmar-ar {
  font-size: 0.78rem;
  font-weight: 500;
  color: #4a5568;
  letter-spacing: 0.02em;
}

.project-img-label {
  font-size: 0.68rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.18);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  padding: 5px 12px;
  border-radius: 6px;
  margin-top: 8px;
}

/* ── Badges ── */
.badge-done {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-wip {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(234, 179, 8, 0.1);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.25);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Tech tags ── */
.tech-tag {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(6, 182, 212, 0.07);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.18);
}

/* ── Project links ── */
.project-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: #06b6d4;
  text-decoration: none;
  transition: opacity 0.2s;
}
.project-link:hover { opacity: 0.65; }

.project-link-muted {
  font-size: 0.82rem;
  font-weight: 600;
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s;
}
.project-link-muted:hover { color: #d1d5db; }

/* ── Skill groups ── */
.skill-group {
  background: rgba(13, 21, 38, 0.85);
  border: 1px solid rgba(30, 58, 95, 0.55);
  border-radius: 16px;
  padding: 28px;
  transition: border-color 0.25s;
}
.skill-group:hover { border-color: rgba(6, 182, 212, 0.3); }

.skill-group-title {
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #06b6d4;
  margin-bottom: 18px;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d1d5db;
  font-size: 0.9rem;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.skill-item:last-child { border-bottom: none; }
.skill-item::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #06b6d4;
  flex-shrink: 0;
}

/* ── Contact form ── */
.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  background: rgba(13, 21, 38, 0.85);
  border: 1px solid rgba(30, 58, 95, 0.55);
  border-radius: 10px;
  padding: 12px 16px;
  color: #fff;
  font-size: 0.9rem;
  font-family: 'Inter', system-ui, sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input::placeholder { color: #374151; }
.form-input:focus {
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.08);
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
