/* ═══════════════════════════════════════════════════════════
   mimounghordou.com, Professional Portfolio
   ═══════════════════════════════════════════════════════════ */

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

:root {
  --bg: #0a0a0f;
  --bg-card: #111118;
  --bg-card-hover: #16161f;
  --bg-subtle: #0e0e15;
  --bg-badge: rgba(124, 58, 237, 0.1);

  --text: #e4e4ec;
  --text-secondary: #9494a8;
  --text-muted: #5e5e72;
  --text-bright: #ffffff;

  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --accent-glow: rgba(124, 58, 237, 0.15);
  --accent-glow-strong: rgba(124, 58, 237, 0.25);

  --green: #34d399;
  --blue: #60a5fa;
  --orange: #fb923c;
  --rose: #fb7185;

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.1);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --container: 1100px;
  --section-gap: 120px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: white;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ─── Global Background Gradient ─── */
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-glow::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow-strong) 0%, transparent 70%);
  top: -200px;
  right: -100px;
  border-radius: 50%;
  filter: blur(80px);
}

.bg-glow::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.08) 0%, transparent 70%);
  bottom: 20%;
  left: -150px;
  border-radius: 50%;
  filter: blur(80px);
}

/* ─── Container ─── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ─── Navigation ─── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(10, 10, 15, 0.8);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s ease;
}

.nav.scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: -0.3px;
}

.nav-logo span {
  color: var(--accent-light);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: var(--text-bright);
  background: rgba(255, 255, 255, 0.04);
}

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

.nav-cta {
  padding: 8px 20px !important;
  background: var(--accent) !important;
  color: white !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 500;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s !important;
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
  background: #6d28d9 !important;
}

.nav-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.nav-menu-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-bright);
}

/* Mobile nav */
.nav-mobile {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  z-index: 99;
}

.nav-mobile.open {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: slideDown 0.25s ease;
}

.nav-mobile a {
  padding: 12px 16px;
  font-size: 15px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.nav-mobile a:hover {
  color: var(--text-bright);
  background: rgba(255, 255, 255, 0.04);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Hero ─── */
.hero {
  padding: 160px 0 80px;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--bg-badge);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 100px;
  font-size: 13px;
  color: var(--accent-light);
  font-weight: 500;
  margin-bottom: 28px;
}

.hero-badge .dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}

.hero h1 .gradient {
  background: linear-gradient(135deg, var(--accent-light), #60a5fa, var(--accent-light));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
  to { background-position: 200% center; }
}

.hero-sub {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.6;
  margin-bottom: 36px;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: #6d28d9;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border-hover);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.btn svg {
  width: 18px;
  height: 18px;
}

/* Hero layout */
.hero-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-photo {
  flex-shrink: 0;
}

.photo-frame {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border-hover);
  box-shadow:
    0 0 0 6px rgba(124, 58, 237, 0.08),
    0 20px 60px rgba(0, 0, 0, 0.4);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.photo-frame:hover {
  transform: scale(1.03);
  box-shadow:
    0 0 0 6px rgba(124, 58, 237, 0.15),
    0 0 40px rgba(124, 58, 237, 0.15),
    0 24px 60px rgba(0, 0, 0, 0.4);
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hero stats */
.hero-stats {
  display: flex;
  gap: 48px;
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.hero-stat {
  text-align: left;
}

.hero-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.hero-stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Section common ─── */
.section {
  padding: var(--section-gap) 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-light);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 12px;
}

.section-num {
  color: var(--text-muted);
  font-weight: 400;
  margin-right: 4px;
  text-transform: none;
  letter-spacing: 0;
}

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.8px;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.6;
  margin-bottom: 48px;
}

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

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border) 80%, transparent);
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  padding-bottom: 48px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -38px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.timeline-item:first-child .timeline-dot {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow-strong);
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.timeline-role {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.timeline-company {
  font-size: 15px;
  color: var(--accent-light);
  margin-bottom: 16px;
}

.timeline-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-highlights li {
  position: relative;
  padding-left: 20px;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.timeline-highlights li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.highlight-metric {
  color: var(--green);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ─── Projects Grid ─── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.project-card:hover::before {
  opacity: 1;
}

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

.project-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-bright);
}

.project-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 100px;
  font-weight: 500;
}

.project-status.active {
  background: rgba(52, 211, 153, 0.1);
  color: var(--green);
}

.project-status.completed {
  background: rgba(96, 165, 250, 0.1);
  color: var(--blue);
}

.project-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
}

.project-links {
  display: flex;
  gap: 16px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.2s;
}

.project-link:hover {
  color: var(--accent-light);
}

.project-link svg {
  width: 16px;
  height: 16px;
}

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

.skill-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.3s, background 0.3s;
}

.skill-group:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.skill-group-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.skill-group-label.purple { color: var(--accent-light); }
.skill-group-label.green { color: var(--green); }
.skill-group-label.blue { color: var(--blue); }
.skill-group-label.orange { color: var(--orange); }
.skill-group-label.rose { color: var(--rose); }

.skill-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-item {
  font-size: 13px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  transition: border-color 0.2s, color 0.2s;
}

.skill-item:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

/* ─── Education ─── */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.3s;
}

.edu-card:hover {
  border-color: var(--border-hover);
}

.edu-period {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-light);
  margin-bottom: 8px;
}

.edu-degree {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.edu-school {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.edu-location {
  font-size: 13px;
  color: var(--text-muted);
}

/* ─── Contact ─── */
.contact-section {
  text-align: center;
  padding: var(--section-gap) 0;
}

.contact-section .section-title {
  margin-left: auto;
  margin-right: auto;
}

.contact-section .section-desc {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 36px;
}

.contact-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.contact-link:hover {
  color: var(--text-bright);
}

.contact-link svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

/* ─── GitHub Activity ─── */
.github-activity {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: border-color 0.3s;
}

.github-activity:hover {
  border-color: var(--border-hover);
}

.github-graph {
  overflow-x: auto;
  margin-bottom: 24px;
  -webkit-overflow-scrolling: touch;
}

.github-graph-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.github-svg {
  display: block;
  min-width: fit-content;
}

.github-total {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.github-total-count {
  font-weight: 600;
  color: var(--text-bright);
}

.github-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
}

.legend-label {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0 4px;
}

.legend-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.github-loading {
  font-size: 13px;
  color: var(--text-muted);
  padding: 20px 0;
}

.github-chart {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
}

.github-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.github-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.github-profile-link:hover {
  color: var(--accent-light);
}

.github-profile-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ─── Footer ─── */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-text {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-text a {
  color: var(--text-secondary);
  transition: color 0.2s;
}

.footer-text a:hover {
  color: var(--accent-light);
}

.footer-source {
  margin-top: 8px;
}

.footer-source a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-source a:hover {
  color: var(--accent-light);
}

.footer-source svg {
  width: 14px;
  height: 14px;
}

/* ─── Animations ─── */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.08s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.16s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.24s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.32s; }
.stagger.visible > *:nth-child(6) { transition-delay: 0.4s; }

.stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #2a2a3a;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a3a4a;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  :root {
    --section-gap: 80px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-stats {
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-menu-btn {
    display: block;
  }

  .hero {
    padding: 120px 0 60px;
  }

  .hero-layout {
    flex-direction: column-reverse;
    text-align: center;
    gap: 32px;
  }

  .hero-sub {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .photo-frame {
    width: 180px;
    height: 180px;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 24px 40px;
    justify-content: center;
  }

  .edu-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 32px;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
  }
}
