/* Mohamed Emad Portfolio — Premium Dark Theme */

:root {
  --bg: #0f1218;
  --bg-alt: #141820;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.11);
  --text: #e8ecf1;
  --text-muted: #9aa4b2;
  --text-dim: #6b7585;
  --accent: #7eb6ff;
  --accent-2: #94a3b8;
  --accent-3: #6ee7cf;
  --gradient: linear-gradient(135deg, #7eb6ff 0%, #94a3b8 52%, #6ee7cf 100%);
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
  --nav-h: 72px;
  --max: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 24px); }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
}

.section { padding: 96px 0; position: relative; }
.section-alt { background: linear-gradient(180deg, transparent, rgba(59, 130, 246, 0.03), transparent); }

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-3);
  margin-bottom: 12px;
}

.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 12px;
}

.section-desc { color: var(--text-muted); font-size: 1rem; }

/* Ambient */
.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
}

.ambient-1 {
  width: 600px; height: 600px;
  background: #3b5bdb;
  top: -200px; right: -100px;
}

.ambient-2 {
  width: 500px; height: 500px;
  background: #5c6ac4;
  bottom: 10%; left: -150px;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

main, header, footer { position: relative; z-index: 1; }

/* Nav */
.nav-wrap {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 24px;
}

.nav {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 999px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.95rem;
}

.logo-mark {
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--gradient);
  font-size: 0.75rem;
  font-weight: 800;
  color: white;
}

.logo-text { display: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

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

.nav-cta {
  background: var(--gradient) !important;
  color: white !important;
  font-weight: 600;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  margin: 6px 0;
  border-radius: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.925rem;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), opacity 0.2s;
  border: 1px solid transparent;
}

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

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: 0 12px 40px rgba(126, 182, 255, 0.22);
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: rgba(255,255,255,0.03);
}

.btn-full { width: 100%; border: none; cursor: pointer; }

/* Hero */
.hero { padding-top: calc(var(--nav-h) + 80px); min-height: 100vh; display: flex; align-items: center; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(126, 182, 255, 0.22);
  background: rgba(126, 182, 255, 0.08);
  color: #b8d4ff;
}

.badge-muted {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-muted);
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 28px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-dim);
}

.social-row a {
  transition: color 0.2s;
  border-bottom: 1px solid transparent;
}

.social-row a:hover { color: var(--accent-3); border-bottom-color: var(--accent-3); }

.hero-visual { display: grid; gap: 16px; }

.photo-card { padding: 16px; border-radius: var(--radius-lg); }

.photo-frame {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: calc(var(--radius-lg) - 8px);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #0b0e13;
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 28%;
  display: block;
  filter: saturate(0.92) contrast(1.03) brightness(0.96);
}

.photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 18, 24, 0.82) 0%, rgba(15, 18, 24, 0.08) 48%, transparent 100%);
  pointer-events: none;
}

.photo-meta { padding: 16px 8px 4px; }
.photo-name { font-weight: 700; font-size: 1.1rem; }
.photo-role { color: var(--text-muted); font-size: 0.875rem; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  padding: 4px;
  border-radius: var(--radius);
  overflow: hidden;
}

.hero-stats div {
  padding: 16px 12px;
  text-align: center;
  background: rgba(255,255,255,0.02);
}

.hero-stats strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-stats span { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card { padding: 28px; }
.card h3 { font-size: 1.1rem; margin-bottom: 14px; }
.card p { color: var(--text-muted); font-size: 0.925rem; margin-bottom: 12px; }
.card p:last-child { margin-bottom: 0; }

.journey-list li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.journey-list li span { font-weight: 700; color: var(--accent-3); font-family: "JetBrains Mono", monospace; font-size: 0.8rem; }

.philosophy-grid {
  display: grid;
  gap: 14px;
}

.philosophy-grid div {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
}

.philosophy-grid strong {
  font-family: "JetBrains Mono", monospace;
  color: var(--accent);
  font-size: 0.85rem;
}

.philosophy-grid p { margin: 0; font-size: 0.875rem; }

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.skill-card {
  padding: 24px;
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
  cursor: default;
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: rgba(126, 182, 255, 0.22);
  background: var(--surface-hover);
}

.skill-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.skill-head h3 { font-size: 1rem; }
.skill-score { font-family: "JetBrains Mono", monospace; color: var(--accent-3); font-size: 0.875rem; }

.skill-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}

.skill-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--gradient);
  transition: width 1.2s var(--ease);
}

.skill-card.in-view .skill-bar span { width: var(--w); }

.skill-card ul li {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 4px 0;
  padding-left: 14px;
  position: relative;
}

.skill-card ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 11px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* Metrics */
.metrics-section { padding: 48px 0; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  padding: 4px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.metric {
  text-align: center;
  padding: 32px 16px;
  background: rgba(255,255,255,0.02);
}

.metric strong {
  display: block;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 6px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.metric span { font-size: 0.8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }

/* Timeline */
.timeline { position: relative; padding-left: 32px; }

.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
}

.timeline-item { position: relative; margin-bottom: 28px; }

.timeline-dot {
  position: absolute;
  left: -32px; top: 24px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.timeline-card { padding: 28px; }

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.8rem;
}

.timeline-date {
  font-family: "JetBrains Mono", monospace;
  color: var(--accent-3);
}

.timeline-loc { color: var(--text-dim); }

.timeline-card h3 { font-size: 1.15rem; margin-bottom: 8px; }

.timeline-impact {
  color: var(--text);
  font-weight: 500;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.timeline-card ul { margin-bottom: 16px; }

.timeline-card ul li {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 4px 0 4px 16px;
  position: relative;
}

.timeline-card ul li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
}

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }

.tag-row span {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

.project-card { overflow: hidden; transition: transform 0.3s var(--ease); }
.project-card:hover { transform: translateY(-6px); }

.screenshot-placeholder {
  height: 180px;
  background:
    linear-gradient(135deg, rgba(126,182,255,0.08), rgba(6,182,212,0.08)),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.02) 0 1px, transparent 1px 12px);
  border-bottom: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-body { padding: 24px; }

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}

.project-top h3 { font-size: 1.05rem; }
.project-top a { font-size: 0.8rem; color: var(--accent-3); white-space: nowrap; }
.project-top a:hover { text-decoration: underline; }

.project-body p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.project-body .tag-row { margin-top: 14px; }

/* Architecture */
.arch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.arch-card {
  padding: 28px;
  transition: transform 0.3s var(--ease), border-color 0.3s;
}

.arch-card:hover {
  transform: translateY(-4px);
  border-color: rgba(148, 163, 184, 0.28);
}

.arch-icon { font-size: 1.75rem; margin-bottom: 12px; }
.arch-card h3 { font-size: 1rem; margin-bottom: 10px; }
.arch-card p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 14px; }

.arch-card ul li {
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 3px 0;
}

/* AI */
.ai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.ai-card { padding: 28px; }

.ai-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  margin-bottom: 12px;
}

.ai-card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.ai-card p { font-size: 0.875rem; color: var(--text-muted); }

/* Testimonials */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.testimonial { padding: 28px; position: relative; }

.avatar-placeholder {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--gradient);
  opacity: 0.4;
  margin-bottom: 16px;
}

.quote {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 16px;
  line-height: 1.7;
}

.author strong { display: block; font-size: 0.9rem; }
.author span { font-size: 0.8rem; color: var(--text-dim); }

.placeholder-note {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.7rem;
  color: var(--text-dim);
  border: 1px dashed var(--border);
  padding: 4px 8px;
  border-radius: 6px;
}

/* Contact */
.contact-section { padding-bottom: 120px; }

.contact-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: 48px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(126,182,255,0.06), rgba(139,92,246,0.06)),
    var(--surface);
}

.contact-copy h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin: 8px 0 16px;
  letter-spacing: -0.03em;
}

.contact-copy p { color: var(--text-muted); margin-bottom: 24px; }

.contact-links { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }

.contact-form {
  display: grid;
  gap: 16px;
}

.contact-form label {
  display: grid;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (min-width: 768px) {
  .logo-text { display: inline; }
}

@media (max-width: 960px) {
  .hero-grid,
  .about-grid,
  .contact-card { grid-template-columns: 1fr; }

  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .metrics-grid .metric:last-child { grid-column: span 2; }

  .nav-toggle { display: block; }

  .nav-links {
    position: fixed;
    top: calc(var(--nav-h) + 8px);
    right: 24px;
    left: 24px;
    flex-direction: column;
    padding: 16px;
    border-radius: var(--radius);
    background: rgba(15, 18, 24, 0.96);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
  }

  .nav-links.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

@media (max-width: 600px) {
  .section { padding: 72px 0; }
  .container { width: calc(100% - 32px); }
  .hero-stats { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr; }
  .metrics-grid .metric:last-child { grid-column: auto; }
  .contact-card { padding: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
}
