/* ===========================
   Portfolio CSS réécrit
   - Hero parallaxe centré et fiable
   - Overlay contrôlable
   - Hamburger animé -> croix
   - Responsive et performant
   =========================== */

/* Polices */
@import url('https://fonts.googleapis.com/css2?family=Abril+Fatface&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600&display=swap');
html, body {
  overscroll-behavior-x: none;
  touch-action: pan-y;
  overflow-x: hidden;
  html, body {
  overflow-y: auto !important;
  height: auto;
}
}




html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main {
  flex: 1;
}
.footer {
  margin-top: auto;
}

/* Variables */
:root{
  --accent: #f97316;
  --bg-dark: #111827;
  --muted: #9ca3af;
  --nav-link: #25004785;
  --nav-hover: #f97316;
  --nav-active: #ffb86b;
  --nav-bg-mobile: rgba(17,24,39,0.95);
  --container-padding: 5vw;
  --max-width: 1100px;
  --hero-overlay: linear-gradient(180deg, rgba(0,0,0,0.15), rgba(0,0,0,0.35));
}

/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Montserrat', system-ui, sans-serif;
  color: #111;
  background: #f5f5f5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Header */
.site-header { position: relative; z-index: 60; background: transparent; }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  ;
}
.brand { display:flex; align-items:center; gap:.6rem; text-decoration:none; color:inherit; }
.logo { height:48px; display:block; }
.site-name { font-weight:600; letter-spacing:.03em; }

/* Navigation */
.main-nav { display:flex; align-items:center; gap:1rem; position:relative; }
.nav-list { list-style:none; display:flex; gap:1.2rem; align-items:center; }

.nav-list a {
  color: var(--nav-link);
  text-decoration:none;
  padding: .25rem 0;
  display:inline-block;
  transition: color 180ms ease;
  position:relative;
}
.nav-list a:hover, .nav-list a:focus { color: var(--nav-hover); }
.nav-list a.active { color: var(--nav-active); font-weight:600; }
.nav-list a::after {
  content:"";
  position:absolute;
  left:0; bottom:-6px;
  height:2px; width:0;
  background:var(--nav-hover);
  transition: width 180ms ease;
}
.nav-list a:hover::after, .nav-list a.active::after { width:100%; }

/* Hamburger */
.nav-toggle { 
  display:none; 
  align-items:center; 
  justify-content:center; 
  width:48px; height:48px; 
  padding:8px; 
  border-radius:8px; 
  background:transparent; 
  border:0; 
  cursor:pointer; 
  color:var(--nav-link); 
  transition: background 160ms ease; 
  z-index:10002;
}
.nav-toggle:hover { background: rgba(255,255,255,0.04); }

.hamburger { width:26px; height:18px; position:relative; }
.bar { 
  position:absolute; 
  left:0; right:0; 
  height:2px; 
  background:currentColor; 
  border-radius:2px; 
  transition: transform 300ms cubic-bezier(.2,.9,.2,1), opacity 200ms ease, top 300ms cubic-bezier(.2,.9,.2,1);
}
.bar1 { top:0; } 
.bar2 { top:8px; } 
.bar3 { top:16px; }

.nav-toggle.active .bar1 { top:8px; transform: rotate(45deg); }
.nav-toggle.active .bar2 { opacity:0; transform: scaleX(0.2); }
.nav-toggle.active .bar3 { top:8px; transform: rotate(-45deg); }

/* Hero / Parallaxe */
.top-page {
  position: relative;
  min-height: 55vh; /* important */
  overflow: hidden;
  
}


.hero-media {
  position: absolute;
  inset: 0;
  height: 120%;
  filter: brightness(1.1) contrast(1.2);

}

/* Préparer l'image pour animation GPU */
.scroll-animate {
  position: absolute;
  left: 50%;
  top: 0;
  width: 120%;
  height: 120%;
  object-fit: cover;
  will-change: transform;
}

/* Overlay et empilement */
.hero-media { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.hero-media::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: var(--hero-overlay);
}

/* Contenu au-dessus */
.landing-page { position: relative; z-index: 10; }


.scroll-animate.is-visible { opacity: 1; }

/* Landing */
.landing-page {
  padding: 4rem 0;
  text-align: center;
  position: relative;
  z-index: 10;
}
.bigtitle {
  font-family: 'Abril Fatface', cursive;
  font-size: clamp(2.2rem, 6vw, 4rem);
  color: aliceblue;
  margin-bottom: .6rem;
}
.subtitle { color: #d1d5db; margin-bottom: 1rem; }

/* Scroll arrow */
.scroll-d {
  display:inline-flex; align-items:center; justify-content:center; gap:.4rem;
  color:#f3e8e8; margin-top:1.5rem; text-decoration:none; font-size:1.6rem;
  width:48px; height:48px; border-radius:999px; background: rgba(255,255,255,0.04);
  transition: transform 220ms ease, background 160ms ease; z-index:12;
}
.scroll-d:hover { transform: translateY(4px); background: rgba(255,255,255,0.06); }
.scroll-d i { animation: arrow-bounce 1.4s infinite; }
@keyframes arrow-bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(6px)} }

/* Sections */
.section { padding: 3.5rem ; background: #f5f5f5; border-radius:20px; }
.section:nth-of-type(even) { background: #eaeef0; }
.section h2 { font-size: 1.6rem ; margin-bottom: 1rem; }

/* Projects */
.projects-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap:1.25rem; }
.project-card {color: #000000; background:#fff; padding:1.25rem; border-radius:10px; box-shadow:0 8px 20px rgba(0,0,0,0.06); }


/* Footer */
.footer { background: var(--bg-dark); color: var(--muted); padding:1rem 0; }
.footer-inner { display:flex; justify-content:space-between; align-items:center; gap:1rem; flex-wrap:wrap; }
.socials { display:flex; gap:.8rem; }
.socials i { font-size:1.25rem; color:#e5e7eb; }
.socials a:hover i { color: var(--accent); }

/* Mobile menu */
.nav-list {
  display: block;
  position: fixed;
  top: 0;
  right: 0;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background: #fff;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 9999;
  padding: 3rem 1.5rem;
  box-shadow: -4px 0 12px rgba(0,0,0,0.12);
}
.nav-list.open { transform: translateX(0); }

.nav-list a {
  display: block;
  padding: 0.8rem 0;
  color: #111;
  text-decoration: none;
  font-size: 1.05rem;
}

/* Desktop menu */
@media (min-width: 900px) {
  .nav-list {
    position: static;
    transform: none;
    height: auto;
    width: auto;
    background: transparent;
    box-shadow: none;
    display: flex;
    gap: 1rem;
    padding: 0;
  }
  .nav-toggle { display:none; }
}

/* Mobile */
@media (max-width:900px) {
  .nav-toggle { display:flex; }
  .scroll-animate { width:140%; }
}
@media (max-width:600px) {
  :root { --container-padding: 4vw; }
  .scroll-animate { width:160%; }
}



.contact-page .top-page {
  height: 100vh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.2);
}

.email-link {
  color: #eefaff;
  font-weight: 600;
  border-bottom: 1px solid var(--accent);
  text-decoration: none;
}



.project-card {
  transition: transform 0.35s ease, box-shadow 0.35s ease, width 0.35s ease, height 0.35s ease;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

/* Quand la carte est ouverte */
.project-card.expanded {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 90vw;
  max-width: 900px;
  height: auto;
  transform: translate(-50%, -50%) scale(1.25);
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.35);
  z-index: 9999;
}

/* Optionnel : empêcher les autres cartes de bouger */
.projects-grid {
  position: relative;
}

/* Image dans la carte */
.project-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.expanded-clone {
  transition: all 0.35s ease;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  overflow: hidden;
}

/* Position finale au centre */
.expanded-clone.expanded {
  top: 50% !important;
  left: 50% !important;

  width: 100vw !important;      /* prend toute la largeur de l’écran */
  max-width: 1000px;             /* limite sur desktop */
  max-height: 90vh;             /* ne dépasse jamais en hauteur */

  transform: translate(-50%, -50%); /* ❗️ on retire le scale */
  overflow-y: auto;
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.35);
}


.project-card .content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
}

/* Quand la carte est ouverte → afficher le contenu */
.expanded-clone .content {
  max-height: 1000px; /* assez grand pour tout contenir */
  opacity: 1;
}


.expanded-clone.expanded .project-img {
  width: 100%;
  height: 500px;      /* grande image pour PC */
  object-fit: cover;
  border-radius: 12px;
}
@media (max-width: 600px) {
  .expanded-clone.expanded .project-img {
    height: 200px;   /* taille idéale mobile */
  }
}


.project-card .project-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
}

@media (min-width: 900px) {
  .expanded-clone.expanded {
    max-height: 100vh;   /*  autorise la carte à prendre toute la hauteur */
    height: 95vh;        /*  la carte devient VRAIMENT grande */
    padding: 3rem;       /* plus d’espace intérieur */
  }
}

.hero-media {
  height: 100%;
}

.content {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.project-img {
  border: 1px solid rgb(0, 0, 0);
}
.project-card.expanded .content {
  max-height: 1000px;
  opacity: 1;
}

.expanded-clone.expanded .content {
  max-height: 2200px;
  opacity: 1;
  overflow: visible;
}

.email-link {
  display: inline-block;
  max-width: 100%;
  text-align: center;
  word-break: break-word;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .hero-media {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }
}
