/* ============================================================
   PROJETS — sections plein écran, scroll-snap, fondu (dark)
   ============================================================ */

html{
  scroll-snap-type: y proximity;
}
@media (prefers-reduced-motion: reduce){
  html{ scroll-snap-type: none; }
}

.proj-scroller{ display: block; }

.proj-section{
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  scroll-margin-top: 0;
  overflow: hidden;
  padding: calc(var(--nav-h) + 40px) 0 96px;
  background: var(--bg);
}

/* subtle radial glow tint per section, layered above the shared dark bg */
.proj-section::before{
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: .8;
  pointer-events: none;
}

.proj-inner{
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;

  opacity: .18;
  transform: translateY(36px) scale(.985);
  transition: opacity .5s var(--ease), transform .6s var(--ease);
  will-change: opacity, transform;
}
.proj-section.in-view .proj-inner{
  opacity: 1;
  transform: translateY(0) scale(1);
}

.proj-index{
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .1em;
  color: var(--text-faint);
  margin-bottom: 18px;
}
.proj-title{
  font-size: clamp(36px, 6vw, 68px);
  margin: 18px 0 22px;
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
}
.proj-desc{
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-soft);
  max-width: 58ch;
  margin: 0 0 28px;
}
.proj-desc strong{ color: var(--text); font-weight: 600; }

/* ---- media layout (screenshots) ---- */
.proj-section.has-media .proj-inner{ max-width: 1080px; }
.proj-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 52px;
  align-items: center;
}
.proj-grid.media-left .proj-media{ order: -1; }
.proj-media{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.proj-media img{
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: #05060700;
  box-shadow: 0 40px 70px -30px rgba(0,0,0,.7);
}
.proj-media.stack{
  flex-direction: column;
  gap: 18px;
}
.proj-media.stack img{ max-height: 40vh; }
.proj-media.dual{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: center;
}
.proj-media.dual img{ max-height: 30vh; }
.proj-media-secondary{ max-width: 92%; }
.proj-media-phone{ max-width: 220px; max-height: 44vh !important; }

.proj-shot{ position: relative; width: 100%; }
.proj-shot .proj-icon{
  position: absolute !important;
  top: -14px;
  left: -14px;
  width: 52px !important;
  height: 52px !important;
  max-height: none !important;
  border-radius: 14px !important;
  border: 2px solid var(--bg) !important;
  box-shadow: 0 12px 26px -10px rgba(0,0,0,.7);
  z-index: 2;
  background: var(--bg-elevated);
}

@media (max-width: 900px){
  .proj-grid{ grid-template-columns: 1fr; gap: 32px; }
  .proj-grid.media-left .proj-media{ order: 0; }
  .proj-media img{ max-height: 40vh; }
  .proj-media.dual{ grid-template-columns: 1fr; gap: 18px; }
  .proj-media.dual img{ max-height: 30vh; }
  .proj-section.has-media{ padding-top: calc(var(--nav-h) + 24px); padding-bottom: 48px; }
}

.proj-link{
  display: inline-block;
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--amber);
  border-bottom: 1px solid var(--amber);
  padding-bottom: 3px;
}
.proj-link-row{ display: flex; gap: 26px; flex-wrap: wrap; margin-top: 26px; }
.proj-link-row .proj-link{ margin-top: 0; }

.proj-download{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  margin-right: 14px;
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: .02em;
  padding: 12px 20px;
  border-radius: 100px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  transition: border-color .25s var(--ease), transform .25s var(--ease), background .25s var(--ease);
}
.proj-download:hover{
  border-color: var(--amber);
  background: var(--bg-elevated-2);
  transform: translateY(-2px);
}
.proj-download::before{ content: "⬇"; color: var(--amber); font-size: 13px; }
.proj-download-row{ display: flex; flex-wrap: wrap; }

/* ---- background glow variants ---- */
.proj-section[data-bg="amber"]::before{
  background: radial-gradient(720px 520px at 18% 20%, var(--amber-dim), transparent 65%);
}
.proj-section[data-bg="pine"]::before{
  background: radial-gradient(720px 520px at 82% 24%, var(--pine-dim), transparent 65%);
}
.proj-section[data-bg="neutral"]::before{
  background: radial-gradient(680px 480px at 50% 10%, rgba(255,255,255,.045), transparent 65%);
}
.proj-section[data-bg="ink"]{
  background: #050506;
}
.proj-section[data-bg="ink"]::before{
  background:
    radial-gradient(620px 460px at 20% 15%, var(--amber-dim), transparent 60%),
    radial-gradient(620px 460px at 85% 85%, var(--pine-dim), transparent 60%);
}

/* ---- wave divider between sections ---- */
.proj-section::after{
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -1px;
  height: 84px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
  z-index: 1;
  opacity: .9;
}
.proj-section::after{
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 84' preserveAspectRatio='none'%3E%3Cpath d='M0 20 C 240 70, 480 0, 720 30 C 960 60, 1200 5, 1440 40 L1440 84 L0 84 Z' fill='%230A0B0D'/%3E%3C/svg%3E");
}
.proj-section[data-bg="ink"]::after{
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 84' preserveAspectRatio='none'%3E%3Cpath d='M0 20 C 240 70, 480 0, 720 30 C 960 60, 1200 5, 1440 40 L1440 84 L0 84 Z' fill='%23050506'/%3E%3C/svg%3E");
}
.proj-section:last-of-type::after{ display: none; }

/* ---- AI badge (inside project title) ---- */
.proj-title .ai-badge{
  font-size: .32em;
  transform: translateY(2px);
  opacity: .8;
}

/* ---- dot navigation ---- */
.proj-dots{
  position: fixed;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.proj-dots button{
  width: 9px; height: 9px;
  border-radius: 50%;
  background: transparent;
  border: 1.4px solid var(--text-faint);
  padding: 0;
  transition: background .25s, border-color .25s, transform .25s, box-shadow .25s;
}
.proj-dots button.active{
  background: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 0 10px var(--amber-glow);
  transform: scale(1.35);
}
@media (max-width: 700px){
  .proj-dots{ display: none; }
  .proj-inner{ padding: 0 22px; }
}

/* ============================================================
   Download-unavailable modal
   ============================================================ */
.dl-modal{
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.dl-modal[hidden]{ display: none; }
.dl-modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(5,6,7,.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.dl-modal-card{
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: linear-gradient(180deg, var(--bg-elevated), #0D0E11);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 38px 32px 32px;
  text-align: center;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.8), 0 0 60px -24px var(--amber-glow);
  animation: dl-pop .3s var(--ease);
}
@keyframes dl-pop{
  from{ opacity: 0; transform: translateY(14px) scale(.97); }
  to{ opacity: 1; transform: translateY(0) scale(1); }
}
.dl-modal-close{
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .2s, border-color .2s;
}
.dl-modal-close:hover{ color: var(--text); border-color: var(--border-strong); }
.dl-modal-icon{
  display: inline-flex;
  width: 52px; height: 52px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--amber-dim);
  color: var(--amber);
  font-size: 20px;
  margin-bottom: 18px;
}
.dl-modal-card h3{
  font-family: var(--display);
  font-size: 21px;
  margin-bottom: 12px;
}
.dl-modal-card p{
  font-size: 14.5px;
  color: var(--text-soft);
  line-height: 1.6;
  margin: 0 0 26px;
}
.dl-modal-card .btn{ width: 100%; justify-content: center; }
