:root {
  --bg: #070b0d;
  --surface: #0e1518;
  --surface-hover: #131d21;
  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(16, 185, 129, 0.35);
  --text: #eef3f5;
  --muted: #93a4ad;
  --accent: #10b981;
  --accent-bright: #34d399;
  --accent-soft: rgba(16, 185, 129, 0.12);
  --radius: 16px;
  --font-ar: "Cairo", system-ui, -apple-system, sans-serif;
  --font-en: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ar);
  line-height: 1.7;
  overflow-x: hidden;
}

html[lang="en"] body {
  font-family: var(--font-en);
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 20%, #000 35%, transparent 85%);
}

.bg-glow {
  position: fixed;
  top: -180px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  width: 680px;
  height: 420px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.16), transparent 68%);
  filter: blur(40px);
  pointer-events: none;
  z-index: -1;
}

.container {
  width: min(1080px, 92%);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: rgba(7, 11, 13, 0.78);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--border-accent);
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lang-btn {
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.lang-btn:hover {
  border-color: var(--border-accent);
  background: var(--surface-hover);
}

.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.hero {
  padding: 5.5rem 0 4rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--border-accent);
  color: var(--accent-bright);
  font-size: 0.86rem;
  font-weight: 600;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero-title {
  margin: 0;
  font-size: clamp(2.3rem, 5.5vw, 3.8rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.accent {
  color: var(--accent-bright);
  font-family: var(--font-mono);
}

.hero-subtitle {
  margin: 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 1.1rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.35rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #03150e;
}

.btn-primary:hover {
  background: var(--accent-bright);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--border-accent);
  background: var(--surface-hover);
}

.terminal-card {
  width: min(540px, 100%);
  margin-top: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }

.terminal-label {
  margin-inline-start: auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.terminal-body {
  padding: 1.1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.terminal-body p {
  margin: 0.35rem 0;
}

.t-key { color: #7dd3fc; }
.t-val { color: #a7f3d0; }
.t-link {
  color: var(--accent-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.section {
  padding: 4rem 0;
}

.section-head {
  margin-bottom: 2rem;
}

.section-head h2 {
  margin: 0 0 0.4rem;
  font-size: 1.75rem;
  font-weight: 800;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.card {
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.card:hover {
  border-color: var(--border-accent);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 1rem;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.12rem;
  font-weight: 700;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.tag {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.ext-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 1.15rem;
  transition: color 0.2s ease;
}

.ext-link:hover {
  color: var(--accent-bright);
}

.contact-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-accent);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), var(--surface));
}

.contact-box h2 {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
}

.contact-box p {
  margin: 0;
  color: var(--muted);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.toast {
  position: fixed;
  bottom: 24px;
  inset-inline-start: 50%;
  transform: translateX(-50%) translateY(16px);
  padding: 0.65rem 1.15rem;
  border-radius: 12px;
  background: #13221c;
  border: 1px solid var(--border-accent);
  color: var(--accent-bright);
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 820px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .menu-btn {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 68px;
    inset-inline: 0;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 4%;
    background: rgba(7, 11, 13, 0.96);
    border-bottom: 1px solid var(--border);
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .hero {
    padding: 3.5rem 0 2.5rem;
  }
}
