/* 
 Fichier : home.css
 Auteur : ElsaFlore
 Description : Portfolio responsive optimisé
*/
@charset "UTF-8";

/* --- RESET GLOBAL --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* --- BODY & FOND --- */
body {
  min-height: 100vh;
  font-family: "Poppins", sans-serif;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1rem, 5vw, 3rem);
  position: relative;
  overflow: auto; 
  background: linear-gradient(135deg, rgb(12,36,50) 0%, rgb(8,33,140) 31%, rgb(44,146,209) 74%, rgb(155,81,224) 100%);
  line-height: 1.7;
}

canvas { 
  position: fixed; 
  top:0; 
  left:0; 
  width:100%; 
  height:100%; 
  z-index: -1; 
  pointer-events: none;
}

body > *:not(canvas) {
  position: relative;
  z-index: 1;
}

/* --- TITRE PRINCIPAL --- */
h1 {
  font-weight:700;
  font-size: clamp(2.5rem, 5vw, 4rem);
  background: linear-gradient(135deg, rgb(255,160,0), rgb(255,0,230));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 1.25rem;
  margin-bottom: clamp(2rem, 6vw, 3rem);
  text-align: center;
  z-index:1;
}

/* --- SOUS-TEXTE --- */
.subtitle {
  text-align: center;
  margin: 0 auto clamp(1rem, 4vw, 2rem);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  max-width: 1200px;
  color: #fff;
}

/* --- PORTFOLIO GRID --- */
.portfolio-grid {
  column-count: 4;
  column-gap: 1.5625rem; /* 25px */
  width: 100%;
  max-width: 87.5rem; /* 1400px */
}

.portfolio-item {
  display: inline-block;
  margin-bottom: 1.5625rem; /* 25px */
  width: 100%;
}

.portfolio-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 1.25rem; /* 20px */
  transition: transform 0.4s ease;
}

.portfolio-item:hover img {
  transform: scale(1.05);
}

/* Lightbox */
.lightbox {
  display: none; /* cachée par défaut */
  position: fixed;
  z-index: 9999;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.8);
}

.lightbox-content {
 position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: block;
  max-width: 90%;
  max-height: 80%;
  border-radius: 10px;
  box-shadow: 0 0 20px #000;
}

.close {
  position: absolute;
  top: 20px;
  right: 45px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.close:hover {
  color: #ccc;
}

/* --- NAV BUTTONS --- */
.nav-buttons {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 3rem;
	margin-top: 1rem;
  margin-bottom: 1rem;
}

.nav-buttons a {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.9rem 4rem;
  flex: 1 1 auto;
  min-width: 8rem;
  border-radius: 3rem;
  text-align: center;
  color: white;
  text-decoration: none;
  background: transparent;
  position: relative;
  display: inline-block;
  overflow: hidden;
}

.nav-buttons a::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 3rem;
  padding: 0.2rem;
  background: linear-gradient(135deg, rgb(255,160,0), rgb(255,0,230));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
          mask-composite: exclude;
  z-index: -1;
  pointer-events: none;
  box-sizing: border-box;	
}

.nav-buttons a span {
  font-weight: 600;
  position: relative;
  background: linear-gradient(135deg, rgb(255,160,0), rgb(255,0,230));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  z-index: 0;
}

.nav-buttons a:hover::before {
  filter: brightness(1.2);
}

/* --- FOOTER --- */
footer {
  text-align: center;
  margin: 0 auto clamp(1rem, 4vw, 2rem);
  font-size: 1rem;
  max-width: 100%;
  color: #fff;
}

footer a {
  color: white;
  text-decoration: underline;
  margin: 0 0.375rem;
}

/* --- MEDIA QUERIES --- */

/* Tablette */
@media (max-width: 1280px) {
  .portfolio-grid {
    column-count: 3;
  }

  h1 {
    font-size: clamp(3rem, 6vw, 4.5rem);
  }

  .subtitle {
    font-size: clamp(1.4rem, 3.5vw, 2rem);
  }

  .nav-buttons a {
    font-size: 1.4rem;
    padding: 1rem 4.5rem;
  }

  footer {
    font-size: clamp(1.2rem, 2.5vw, 1.4rem);
  }
}

/* Petit écran / laptop */
@media (max-width: 1080px) {
  .portfolio-grid {
    column-count: 2;
  }

  h1 {
    font-size: clamp(2.8rem, 7vw, 4rem);
  }

  .subtitle {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
  }

  .nav-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
  }

  .nav-buttons a {
    font-size: 1rem;
    padding: 0.5rem 1.2rem; /* padding réduit pour mobile */
    min-width: auto;
  }

  .nav-buttons a::before {
    padding: 0.3rem; /* bordure plus fine sur mobile */
  }

  footer {
    font-size: clamp(1.2rem, 3vw, 1.4rem);
  }
}

/* --- MOBILE OPTIMISÉ --- */
@media (max-width: 768px) {
  .portfolio-grid {
    column-count: 2;
  }

  h1 {
    font-size: clamp(3rem, 8vw, 4.5rem);
    margin-bottom: 1.5rem;
  }

  .subtitle {
    font-size: clamp(0.95rem, 3.5vw, 1.2rem);
    margin-bottom: 1.5rem;
  }

  .nav-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
  }

  .nav-buttons a {
    font-size: 1rem;
    padding: 0.5rem 1.2rem; /* padding réduit pour mobile */
    min-width: auto;
  }

  .nav-buttons a::before {
    padding: 0.1rem; /* bordure plus fine sur mobile */
  }

  footer {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
  }
}

/* Très petit mobile */
@media (max-width: 480px) {
  .portfolio-grid {
    column-count: 2; /* 2 colonnes pour les images */
  }

  h1 {
    font-size: clamp(2.5rem, 10vw, 3.5rem);
    margin-bottom: 1.2rem;
  }

  .subtitle {
    font-size: clamp(0.9rem, 4vw, 1.1rem);
    margin-bottom: 1rem;
  }

  .nav-buttons {
    flex-direction: row; /* garde les 3 boutons côte à côte si possible */
    justify-content: center;
    gap: 1rem;          /* espace réduit pour tenir sur petit écran */
    width: 100%;
  }

  .nav-buttons a {
    font-size: clamp(0.8rem, 2.5vw, 0.95rem);
    padding: clamp(0.3rem, 1.5vw, 0.6rem) clamp(0.8rem, 3vw, 1.2rem);
    min-width: auto;
    flex: 1 1 auto;
  }

  .nav-buttons a::before {
    padding: 0.08rem; /* bordure plus fine sur très petit écran */
  }

  .container, p, h2, h3, .subtitle {
    max-width: 95%;   /* texte respire moins sur les côtés */
    padding: 0 0.5rem;
  }

  footer {
    font-size: clamp(0.85rem, 3.5vw, 1rem);
    padding: 1rem 0;
  }
}