/* =========================
   GLOBAL
   ========================= */

body{
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,244,196,.14), transparent 45%),
    radial-gradient(circle at 80% 35%, rgba(255,244,196,.10), transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(0,0,0,.25), transparent 55%),
    #590202;
  color: #FFF4C4;
}

.projects-page{
  padding-top: 34px;
}

/* =========================
   HEADER
   ========================= */

.page-title{
  font-weight: 900;
  letter-spacing: .5px;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  margin: 0 0 12px 0;
  color: #FFF4C4;
}

.description{
  font-size: 1rem;
  color: rgba(255,244,196,.78);
  max-width: 820px;
  line-height: 1.7;
  margin: 0 0 26px 0;
}

/* =========================
   PROJECTS GRID
   ========================= */

.projects-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project-card{
  border: 1px solid rgba(255,244,196,.22);
  background: rgba(0,0,0,.18);
  border-radius: 22px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: 0 22px 55px rgba(0,0,0,.35);
  transition: transform .18s ease, border-color .18s ease;
}

.project-card:hover{
  transform: translateY(-4px);
  border-color: rgba(255,244,196,.45);
}

.project-thumb{
  height: 210px;
  background: rgba(0,0,0,.22);
}

.project-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-body{
  padding: 18px 18px 20px;
}

.project-title{
  font-weight: 900;
  font-size: 1.25rem;
  margin: 0 0 8px 0;
}

.project-desc{
  margin: 0 0 14px 0;
  color: rgba(255,244,196,.78);
  line-height: 1.6;
  font-size: .98rem;
}

/* =========================
   TAGS
   ========================= */

.project-tags{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag{
  border: 1px solid rgba(255,244,196,.22);
  background: rgba(255,244,196,.08);
  color: #FFF4C4;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .2px;
}

/* =========================
   BUTTONS
   ========================= */

.project-actions{
  display: flex;
  gap: 10px;
}

.btn-ghost,
.btn-fill{
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 800;
  font-size: .9rem;
}

.btn-ghost{
  border: 1px solid rgba(255,244,196,.28);
  color: #FFF4C4;
  background: transparent;
}

.btn-fill{
  background: #FFF4C4;
  color: #111;
}

.btn-ghost:hover{ opacity: .9; }
.btn-fill:hover{ opacity: .9; }



.video-modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;      
  padding: 18px;
  
}

.video-modal.hidden{
  display: none;
}

.video-modal-content{
  position: relative;
  width: min(92vw, 520px);
  padding: 35px;
  box-shadow: 0 22px 55px rgba(0,0,0,.55);
}


.video-close{
  position: absolute;
  top: 10px;
  right: 10px;
  background: #fff;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
}

.phone-frame{
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  
}

.video-player{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* =========================
   DETAILS MODAL
   ========================= */

.details-modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 18px;
}

.details-modal.hidden{
  display:none;
}

.details-content{
  width: min(1100px, 96vw);
  background: rgba(0,0,0,.92);
  border: 1px solid rgba(255,244,196,.22);
  border-radius: 22px;
  padding: 16px;
  position: relative;
  box-shadow: 0 22px 55px rgba(0,0,0,.55);
}

.details-close{
  position:absolute;
  top: 10px;
  right: 12px;
  background:#fff;
  border:none;
  border-radius:50%;
  width: 38px;
  height: 38px;
  font-size: 22px;
  cursor:pointer;
}

.details-grid{
  display:grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
}

.details-media{
  border-radius: 18px;
  overflow:hidden;
  background:#000;
  max-height: 72vh;
  border: 1px solid rgba(255,244,196,.14);
}

.details-media img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

.details-info{
  color:#FFF4C4;
  padding: 6px 6px;
}

.details-info h2{
  font-weight: 900;
  margin: 6px 0 10px;
}

.details-info p{
  color: rgba(255,244,196,.82);
  line-height: 1.7;
}

.details-tags{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  margin: 14px 0 10px;
}

.details-tag{
  border: 1px solid rgba(255,244,196,.22);
  background: rgba(255,244,196,.08);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 800;
}

.details-links{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  margin-top: 12px;
}

.details-links a{
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  display:inline-flex;
  align-items:center;
  gap: 8px;
  text-decoration:none;
  font-weight: 800;
  font-size: .9rem;
  background:#FFF4C4;
  color:#111;
}

.details-links a:hover{ opacity:.9; }

.details-note{
  margin-top: 14px;
  font-size: .9rem;
  color: rgba(255,244,196,.70);
}


@media (max-width: 992px){
  .projects-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px){
  .details-grid{
    grid-template-columns: 1fr;
  }
  .details-media{
    max-height: 45vh;
  }
}

@media (max-width: 576px){
  .projects-grid{
    grid-template-columns: 1fr;
  }
}

/* ✅ iPhone XR + phones (<= 414px) */
@media (max-width: 420px){

  .projects-page{
    padding-top: 18px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .page-title{
    font-size: 2.1rem;
  }

  .description{
    font-size: .95rem;
    line-height: 1.6;
    margin-bottom: 18px;
  }

  .projects-grid{
    gap: 14px;
  }

  .project-thumb{
    height: 170px;
  }

  .project-body{
    padding: 14px;
  }

  .project-title{
    font-size: 1.1rem;
  }

  .project-desc{
    font-size: .92rem;
  }

  /* ✅ Boutons: empile au lieu de déborder */
  .project-actions{
    flex-direction: column;
  }
  .btn-ghost,
  .btn-fill{
    width: 100%;
    justify-content: center;
  }

  /* ✅ Modals: padding plus petit */
  .video-modal{
    padding: 12px;
  }
  .video-modal-content{
    padding: 16px;
  }

  .details-modal{
    padding: 12px;
  }
  .details-content{
    width: 100%;
    padding: 12px;
    border-radius: 16px;
  }

  .details-info h2{
    font-size: 1.2rem;
  }

  /* ✅ Liens dans la modal: empile */
  .details-links{
    flex-direction: column;
  }
  .details-links a{
    width: 100%;
    justify-content: center;
  }

  /* ✅ Image/vidéo dans la modal: évite trop grand */
  .details-media{
    max-height: 38vh;
  }
}

