/* ============================= */
/* PROJECTS PAGE — COMPACT */
/* ============================= */

.projects{
  background:
    radial-gradient(760px 360px at 18% 8%, rgba(124,58,237,.12), transparent 62%),
    radial-gradient(640px 300px at 85% 22%, rgba(124,58,237,.08), transparent 64%),
    linear-gradient(180deg, rgba(124,58,237,.05), rgba(124,58,237,0) 44%);
}

/* spacing system */
.projects :where(.projects-hero, .projects-section){
  scroll-margin-top: 110px;
}

/* Sections : plus compact */
.projects-section{
  padding: 52px 0;
}

/* Hero plus court */
.projects-hero{
  padding: 72px 0 30px;
}

/* La section juste après le hero */
.projects-hero + .projects-section{
  padding-top: 26px;
}

/* ============================= */
/* HERO */
/* ============================= */

.projects-kicker{
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 900;
  font-size: 11px;
  color: rgba(124,58,237,.92);
  margin: 0 0 10px;
}

.projects-title{
  margin: 0 0 10px;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.06;
  font-weight: 950;
  color: #0f172a;
  text-wrap: balance;
}

.projects-lead{
  margin: 0;
  max-width: 720px;
  color: rgba(15,23,42,.72);
  line-height: 1.7;
  font-size: 15px;
}

/* séparateur plus discret */
.projects-hero .container{
  position: relative;
}
.projects-hero .container::after{
  content:"";
  display:block;
  margin-top: 18px;
  height: 1px;
  width: min(760px, 100%);
  background: linear-gradient(90deg, rgba(124,58,237,.20), rgba(15,23,42,.08), transparent);
}

/* ============================= */
/* HEAD SECTION */
/* ============================= */

.projects-head{
  max-width: 720px;
  margin: 0 0 18px;
}

.section-title{
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 950;
  color: #0f172a;
}

.section-subtitle{
  margin: 0;
  color: rgba(15,23,42,.70);
  line-height: 1.6;
  font-size: 14px;
}

/* ============================= */
/* GRID + CARDS */
/* ============================= */

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

/* cards plus petites */
.project-card{
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.75);
  box-shadow: 0 14px 42px rgba(2,6,23,.06);
  overflow: hidden;
  display: grid;
  grid-template-rows: 170px auto;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
  backdrop-filter: blur(8px);
}

.project-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 22px 60px rgba(2,6,23,.10);
  border-color: rgba(124,58,237,.20);
}

/* Media */
.project-media{
  position: relative;
  display:block;
  overflow:hidden;
  background: linear-gradient(180deg, rgba(124,58,237,.14), rgba(255,255,255,0) 72%);
  height: 100%;
}

.project-media::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(520px 180px at 18% 8%, rgba(124,58,237,.18), transparent 62%),
    linear-gradient(180deg, rgba(2,6,23,.00), rgba(2,6,23,.26));
  opacity: .9;
  pointer-events:none;
  z-index: 1;
}

/* Slider layers */
.project-slider{
  position:absolute;
  inset:0;
  z-index: 0;
}

.project-slide{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  opacity:0;
  transform: scale(1.02);
  transition: opacity .30s ease, transform .60s ease;
}

.project-slide.is-active{
  opacity:1;
  transform: scale(1.06);
}

/* fallback (si pas d’image) */
.project-media-fallback{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  padding: 14px;
  gap: 8px;
  z-index: 2;
}

.project-media-fallback.is-empty{
  position: relative;
  height: 170px;
  justify-content:center;
}

.fallback-badge{
  display:inline-flex;
  align-self:flex-start;
  padding: 7px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  color: rgba(124,58,237,.98);
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(124,58,237,.18);
}

.fallback-title{
  font-weight: 950;
  color: #0f172a;
  font-size: 16px;
}

.fallback-sub{
  color: rgba(15,23,42,.72);
  line-height: 1.55;
  font-size: 13px;
  max-width: 44ch;
}

/* Body compact */
.project-body{
  padding: 14px 14px 12px;
}

.project-top{
  display:flex;
  justify-content:space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 8px;
}

.project-title{
  margin:0;
  font-size: 15px;
  font-weight: 950;
  color: #0f172a;
}

.project-status{
  font-size: 11px;
  font-weight: 950;
  padding: 5px 9px;
  border-radius: 999px;
  color: rgba(15,23,42,.82);
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(15,23,42,.10);
}

.project-desc{
  margin: 0 0 10px;
  color: rgba(15,23,42,.72);
  line-height: 1.65;
  font-size: 13px;
}

/* tags compact */
.project-tags{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.project-tags span{
  display:inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  color: rgba(15,23,42,.80);
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(15,23,42,.08);
}

/* meta compact */
.project-meta{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
}

.meta-item{
  display:inline-flex;
  align-items:center;
  gap: 7px;
  font-size: 11px;
  font-weight: 850;
  color: rgba(15,23,42,.70);
}

.meta-item .dot{
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(124,58,237,.92);
}

/* Actions */
.project-actions{
  display:flex;
  gap: 10px;
  align-items:center;
}

/* Buttons scoped (plus compacts) */
.projects .btn,
.project-show-page .btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 9px 12px;
  border-radius: 999px;
  font-weight: 950;
  font-size: 12px;
  text-decoration:none;
  border: 1px solid transparent;
  transition: transform .12s ease, opacity .12s ease, box-shadow .12s ease;
  line-height: 1;
}

.projects .btn:hover,
.project-show-page .btn:hover{
  transform: translateY(-1px);
}

.projects .btn:active,
.project-show-page .btn:active{
  transform: translateY(0);
  opacity: .92;
}

.projects .btn-primary,
.project-show-page .btn-primary{
  background: rgba(124,58,237,.98);
  color:#fff;
  border-color: rgba(124,58,237,.35);
  box-shadow: 0 10px 20px rgba(124,58,237,.18);
}

.projects .btn-ghost,
.project-show-page .btn-ghost{
  background: rgba(255,255,255,.92);
  color: rgba(15,23,42,.92);
  border-color: rgba(15,23,42,.10);
}

/* ============================= */
/* CASE STUDY — COMPACT */
/* ============================= */

.projects-case{
  padding-top: 10px;
}

.case-wrap{
  display:grid;
  grid-template-columns: 1.10fr .90fr;
  gap: 16px;
  align-items: start;
}

.case-left{
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.70);
  box-shadow: 0 14px 42px rgba(2,6,23,.06);
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.case-left::before{
  content:"";
  position:absolute;
  inset:-2px;
  background: radial-gradient(520px 180px at 18% 8%, rgba(124,58,237,.12), transparent 62%);
  pointer-events:none;
}

.case-left > *{
  position: relative;
}

.case-kicker{
  letter-spacing:.14em;
  text-transform: uppercase;
  font-weight: 950;
  font-size: 11px;
  color: rgba(124,58,237,.90);
  margin: 0 0 8px;
}

.case-title{
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 950;
  color: #0f172a;
  text-wrap: balance;
}

.case-lead{
  margin: 0 0 12px;
  color: rgba(15,23,42,.72);
  line-height: 1.65;
  font-size: 14px;
}

.case-points{
  display:grid;
  gap: 10px;
  margin-top: 10px;
}

.case-point{
  padding: 12px;
  border-radius: 16px;
  background: rgba(124,58,237,.05);
  border: 1px solid rgba(124,58,237,.12);
}

.case-chip{
  display:inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  color: rgba(124,58,237,.95);
  background: rgba(255,255,255,.90);
  border: 1px solid rgba(15,23,42,.08);
  margin-bottom: 8px;
}

.case-point p{
  margin:0;
  color: rgba(15,23,42,.76);
  line-height: 1.6;
  font-size: 13px;
}

/* Right block */
.case-right{
  position: sticky;
  top: 96px;
}

.case-card{
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(124,58,237,.05));
  box-shadow: 0 14px 42px rgba(2,6,23,.06);
  padding: 14px;
}

.case-card-top{
  display:flex;
  gap: 10px;
  align-items:center;
  margin-bottom: 10px;
}

.case-badge{
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  color: rgba(124,58,237,.95);
  background: rgba(124,58,237,.10);
  border: 1px solid rgba(124,58,237,.18);
}

.case-name{
  font-weight: 950;
  color: #0f172a;
  font-size: 13px;
}

.case-list{
  margin: 0;
  padding-left: 16px;
  color: rgba(15,23,42,.75);
  line-height: 1.6;
  font-size: 13px;
}

.case-list li{
  margin: 8px 0;
}

.case-tech{
  margin-top: 12px;
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-tech span{
  display:inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  color: rgba(15,23,42,.80);
  background: rgba(255,255,255,.90);
  border: 1px solid rgba(15,23,42,.08);
}

/* ============================= */
/* PROOF — COMPACT */
/* ============================= */

.projects-proof{
  padding-top: 0;
}

.proof-wrap{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 14px 42px rgba(2,6,23,.06);
}

.proof-item{
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(15,23,42,.08);
}

.proof-num{
  font-weight: 950;
  font-size: 16px;
  color: #0f172a;
  margin-bottom: 4px;
}

.proof-label{
  color: rgba(15,23,42,.70);
  line-height: 1.45;
  font-size: 12px;
  font-weight: 850;
}

/* ============================= */
/* PROJECT SHOW PAGE */
/* ============================= */

.project-show-page{
  background:
    radial-gradient(760px 360px at 18% 8%, rgba(124,58,237,.12), transparent 62%),
    radial-gradient(640px 300px at 85% 22%, rgba(124,58,237,.08), transparent 64%),
    linear-gradient(180deg, rgba(124,58,237,.05), rgba(124,58,237,0) 44%);
  padding: 72px 0 52px;
}

.project-show-hero{
  padding: 0 0 24px;
}

.project-show-kicker{
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 900;
  font-size: 11px;
  color: rgba(124,58,237,.92);
  margin: 0 0 10px;
}

.project-show-title{
  margin: 0 0 10px;
  font-size: clamp(30px, 3.8vw, 46px);
  line-height: 1.06;
  font-weight: 950;
  color: #0f172a;
  text-wrap: balance;
}

.project-show-subtitle{
  margin: 0;
  max-width: 760px;
  color: rgba(15,23,42,.72);
  line-height: 1.7;
  font-size: 15px;
}

.project-show-section{
  padding: 8px 0 0;
}

.project-show-grid{
  display:grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.project-show-main,
.project-show-sidebar{
  display:grid;
  gap: 14px;
}

.project-gallery{
  display:grid;
  gap: 12px;
}

.project-gallery-main{
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.80);
  box-shadow: 0 14px 42px rgba(2,6,23,.06);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.project-gallery-main img{
  display:block;
  width:100%;
  height: 520px;
  object-fit: cover;
  cursor: zoom-in;
}

.project-gallery-thumbs{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
  gap: 10px;
}

.project-thumb{
  display:block;
  padding:0;
  border:0;
  background: transparent;
  cursor:pointer;
}

.project-thumb img{
  display:block;
  width:100%;
  height:82px;
  object-fit:cover;
  border-radius: 14px;
  border: 2px solid transparent;
  box-shadow: 0 8px 18px rgba(2,6,23,.06);
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}

.project-thumb:hover img{
  transform: translateY(-2px);
  border-color: rgba(124,58,237,.42);
  box-shadow: 0 14px 26px rgba(124,58,237,.16);
}

.project-show-card{
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.75);
  box-shadow: 0 14px 42px rgba(2,6,23,.06);
  padding: 16px;
  backdrop-filter: blur(8px);
}

.project-show-card h2,
.project-show-card h3{
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 950;
  color: #0f172a;
}

.project-show-card p,
.project-show-content{
  margin: 0;
  color: rgba(15,23,42,.74);
  line-height: 1.7;
  font-size: 14px;
}

.project-show-sidebar .project-tags,
.project-show-sidebar .project-meta{
  margin-bottom: 0;
}

.lightbox{
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(2,6,23,.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox img{
  max-width: min(1280px, 100%);
  max-height: 90vh;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,.34);
}

.lightbox-close{
  position: absolute;
  top: 16px;
  right: 16px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

/* ============================= */
/* RESPONSIVE */
/* ============================= */

@media (max-width: 980px){
  .projects-section{
    padding: 46px 0;
  }

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

  .case-wrap{
    grid-template-columns: 1fr;
  }

  .case-right{
    position: relative;
    top: auto;
  }

  .proof-wrap{
    grid-template-columns: 1fr 1fr;
  }

  .project-show-grid{
    grid-template-columns: 1fr;
  }

  .project-gallery-main img{
    height: 380px;
  }
}

@media (max-width: 520px){
  .projects-hero{
    padding: 66px 0 26px;
  }

  .project-card{
    grid-template-rows: 160px auto;
  }

  .proof-wrap{
    grid-template-columns: 1fr;
  }

  .project-show-page{
    padding: 66px 0 44px;
  }

  .project-gallery-main img{
    height: 280px;
  }

  .project-gallery-thumbs{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .project-thumb img{
    height: 74px;
  }

  .project-actions{
    flex-wrap: wrap;
  }
}