/* ===== NUDGE4U — PROJETS | Neumorphism Doux × Joyeux & Étudiant ===== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* ===== VARIABLES ===== */
:root {
  /* Fond lilas doux — base neumorphism */
  --bg:           #e8e6f8;
  --bg-light:     #f0eeff;
  --bg-dark:      #dbd8f2;

  /* Ombres neumorphism */
  --neu-out:      6px 6px 16px #c4c1e0, -6px -6px 16px #ffffff;
  --neu-out-sm:   3px 3px 8px #c4c1e0,  -3px -3px 8px #ffffff;
  --neu-in:       inset 4px 4px 10px #c4c1e0, inset -4px -4px 10px #ffffff;
  --neu-hover:    8px 8px 20px #bebbd8, -8px -8px 20px #ffffff;

  /* Couleurs principales Nudge4U */
  --accent:       #5b5bd6;
  --accent-light: #7b7bea;
  --accent-soft:  rgba(91, 91, 214, 0.12);

  /* Couleurs joyeuses pour badges / accents */
  --joy-pink:     #f472b6;
  --joy-yellow:   #fbbf24;
  --joy-cyan:     #22d3ee;
  --joy-green:    #34d399;
  --joy-orange:   #fb923c;

  /* Texte */
  --text-title:   #2d2b6b;
  --text-body:    #6b68a8;
  --text-muted:   #a8a5c8;
  --white:        #ffffff;

  /* Formes */
  --radius-card:  24px;
  --radius-btn:   50px;
  --radius-badge: 50px;

  --font:         'Nunito', sans-serif;
  --ease:         cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth:  cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text-title);
}

/* ===== PETITES FORMES DÉCORATIVES (ambiance joyeuse) ===== */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 320px; height: 320px;
  top: -80px; right: -80px;
  background: radial-gradient(circle, rgba(91,91,214,0.08) 0%, transparent 70%);
}

body::after {
  width: 250px; height: 250px;
  bottom: -60px; left: -60px;
  background: radial-gradient(circle, rgba(244,114,182,0.07) 0%, transparent 70%);
}

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
  height: 72px;
  gap: 2rem;
  box-shadow: 0 4px 20px rgba(91, 91, 214, 0.1), 0 1px 0 rgba(255,255,255,0.8);
}

header h1 {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 900;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.02em;
  /* Effet neumorphism sur le texte */
  text-shadow: 1px 1px 2px rgba(255,255,255,0.9), -1px -1px 2px rgba(180,175,220,0.5);
}

header nav {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1rem);
}

header nav a {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-body);
  text-decoration: none;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-btn);
  transition: all 0.25s var(--ease-smooth);
  box-shadow: var(--neu-out-sm);
  white-space: nowrap;
}

header nav a:hover {
  color: var(--accent);
  box-shadow: var(--neu-in);
  transform: scale(0.97);
}

header nav a:last-child {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: var(--white);
  box-shadow: 4px 4px 12px rgba(91,91,214,0.35), -2px -2px 8px rgba(255,255,255,0.6);
}

header nav a:last-child:hover {
  box-shadow: 6px 6px 18px rgba(91,91,214,0.45), -2px -2px 8px rgba(255,255,255,0.6);
  transform: translateY(-2px) scale(1.03);
  color: var(--white);
}

/* ===== MENU TOGGLE ===== */
.menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--accent);
  flex-shrink: 0;
  user-select: none;
  width: 42px; height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: var(--neu-out-sm);
  transition: box-shadow 0.2s;
}

.menu-toggle:active { box-shadow: var(--neu-in); }

/* ===== HERO TITRE ===== */
.projects-hero {
  text-align: center;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 5vw, 3rem) clamp(0.5rem, 2vw, 1rem);
  position: relative;
  z-index: 1;
}

.projects-hero h2 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: var(--text-title);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.projects-hero h2 span {
  color: var(--accent);
}

.projects-hero p {
  margin-top: 0.8rem;
  font-size: clamp(0.9rem, 2vw, 1rem);
  color: var(--text-body);
  max-width: 520px;
  margin-inline: auto;
  line-height: 1.65;
}

/* ===== GRID ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: clamp(1.5rem, 3vw, 2rem);
  padding: clamp(2rem, 5vw, 3rem) clamp(1.5rem, 5vw, 3rem) clamp(3rem, 7vw, 5rem);
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ===== PROJECT CARD ===== */
.project-card {
  background: var(--bg);
  border-radius: var(--radius-card);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-shadow: var(--neu-out);
  transition: box-shadow 0.35s var(--ease-smooth), transform 0.35s var(--ease);
  position: relative;
}

.project-card:hover {
  box-shadow: var(--neu-hover);
  transform: translateY(-6px);
}

.project-card:active {
  box-shadow: var(--neu-in);
  transform: translateY(0px) scale(0.98);
}

/* Bande colorée en haut (joyeuse) */
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  z-index: 5;
  transition: height 0.3s var(--ease-smooth);
}

.project-card:hover::before { height: 7px; }

/* Couleurs des bandes par ordre */
.project-card:nth-child(5n+1)::before { background: linear-gradient(90deg, var(--accent), var(--accent-light)); }
.project-card:nth-child(5n+2)::before { background: linear-gradient(90deg, var(--joy-cyan), var(--joy-green)); }
.project-card:nth-child(5n+3)::before { background: linear-gradient(90deg, var(--joy-pink), var(--joy-orange)); }
.project-card:nth-child(5n+4)::before { background: linear-gradient(90deg, var(--joy-yellow), var(--joy-orange)); }
.project-card:nth-child(5n+5)::before { background: linear-gradient(90deg, var(--joy-green), var(--joy-cyan)); }

/* Image */
.project-card img {
  width: 100%;
  height: 195px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease-smooth), filter 0.3s;
  filter: brightness(0.97) saturate(0.9);
}

.project-card:hover img {
  transform: scale(1.05);
  filter: brightness(0.88) saturate(0.85);
}

/* ===== PROJECT INFO ===== */
.project-info {
  padding: 1.2rem 1.3rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
  background: var(--bg);
}

/* Petite puce colorée devant le titre */
.project-info h3 {
  font-size: clamp(0.98rem, 2vw, 1.08rem);
  font-weight: 800;
  color: var(--text-title);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.25s;
}

.project-info h3::before {
  content: '';
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease);
}

.project-card:nth-child(5n+1) .project-info h3::before { background: var(--accent); }
.project-card:nth-child(5n+2) .project-info h3::before { background: var(--joy-cyan); }
.project-card:nth-child(5n+3) .project-info h3::before { background: var(--joy-pink); }
.project-card:nth-child(5n+4) .project-info h3::before { background: var(--joy-yellow); }
.project-card:nth-child(5n+5) .project-info h3::before { background: var(--joy-green); }

.project-card:hover .project-info h3 { color: var(--accent); }
.project-card:hover .project-info h3::before { transform: scale(1.4); }

.project-info p {
  font-size: clamp(0.78rem, 1.5vw, 0.85rem);
  color: var(--text-body);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Bouton voir */
.project-info::after {
  content: '✦ Voir le projet';
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.8rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 14px;
  border-radius: var(--radius-btn);
  width: fit-content;
  box-shadow: var(--neu-out-sm);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s, transform 0.3s var(--ease), box-shadow 0.2s;
}

.project-card:hover .project-info::after {
  opacity: 1;
  transform: translateY(0);
  box-shadow: var(--neu-in);
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(200, 196, 235, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  justify-content: center;
  align-items: center;
  padding: clamp(1rem, 5vw, 3rem);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal img {
  max-width: min(90vw, 900px);
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-card);
  box-shadow:
    12px 12px 40px #c4c1e0,
    -12px -12px 40px #ffffff;
  animation: zoomIn 0.35s var(--ease);
}

@keyframes zoomIn {
  from { transform: scale(0.82); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.close {
  position: fixed;
  top: 1.25rem; right: 1.25rem;
  font-size: 1.4rem;
  color: var(--text-body);
  cursor: pointer;
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--neu-out-sm);
  transition: box-shadow 0.2s, transform 0.3s var(--ease), color 0.2s;
  z-index: 1001;
  user-select: none;
}

.close:hover {
  box-shadow: var(--neu-in);
  color: var(--accent);
  transform: rotate(90deg);
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 1.5rem 2rem;
  background: var(--bg-dark);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  box-shadow: inset 0 4px 12px rgba(180, 175, 220, 0.4);
}

/* ===== RESPONSIVE ===== */

@media (min-width: 1400px) {
  .projects-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 960px) and (max-width: 1399px) {
  .projects-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 580px) and (max-width: 959px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 1.5rem 1.5rem 3rem;
    gap: 1.25rem;
  }
}

@media (max-width: 579px) {
  header {
    height: 64px;
    padding: 0 1.25rem;
  }

  header h1 { font-size: 1.05rem; }

  header nav {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(91,91,214,0.12);
    z-index: 199;
  }

  header nav a {
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .menu-toggle {
    display: flex;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    padding: 1.25rem 1rem 3rem;
    gap: 1.25rem;
  }

  .project-card img { height: 175px; }

  .modal img { max-width: 95vw; max-height: 75vh; }

  .close { top: 0.75rem; right: 0.75rem; width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}