/* ==========================================================================
   Wedia — page portfolio
   Fond noir, en-tête complet. Des projets concepts, dit clairement en haut de page
   et sur chaque projet ; les bases (couleurs, police, en-tête, fondus) viennent de style.css.
   ========================================================================== */
:root {
  --cw-surface: #111214;
  --cw-line: rgba(39, 229, 255, 0.16);
}

body {
  min-height: 100vh;
}

/* la page en cours, en Azur dans l'en-tête */
.site-header__link[aria-current="page"],
.mobile-nav__link[aria-current="page"] {
  color: var(--azur);
}

/* ---------- Titre ---------- */
.pf-main {
  position: relative;
  /* le curseur qui tire le cadre et les pages en pile ne doivent pas dépasser du bord (sur mobile, la page dézoomerait) */
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(112px, 15vh, 136px) clamp(1rem, 4vw, 2rem) clamp(4rem, 10vh, 7rem);
}

.pf-intro {
  position: relative;
  width: 100%;
  text-align: center;
}

/* même police que la phrase de l'accueil */
.pf-title {
  margin: 0;
  color: #fff;
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  font-weight: 700;
  font-optical-sizing: auto;
  line-height: 1.06;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.pf-title__accent {
  color: var(--azur);
}

/* dès le titre : des projets concepts, des entreprises fictives */
.pf-notice {
  max-width: 60ch;
  margin: 1.25rem auto 0;
  color: rgba(253, 243, 224, 0.88);
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.6;
}

/* sur chaque projet, au-dessus de son titre */
.pf-concept {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.45em 0.9em;
  border: 1px solid rgba(39, 229, 255, 0.45); /* étiquette du projet, taste-skill-ignore */
  border-radius: 999px;
  color: var(--azur);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase; /* étiquette du projet, taste-skill-ignore */
}

/* ---------- Cadre de l'avant / après, comme celui du calendrier de la page rendez-vous ---------- */
.pf-frame {
  /* tient dans le premier écran sur ordinateur, sous l'en-tête et le titre */
  width: min(100%, 1240px, calc((100svh - 380px) * 16 / 9));
  min-width: min(100%, 560px);
  margin-top: clamp(1.75rem, 4.5vh, 3rem);
  padding: clamp(8px, 1.2vw, 14px);
  border-radius: 30px;
  background: var(--cw-surface);
  box-shadow: inset 0 0 0 1px var(--cw-line); /* liseré du cadre, taste-skill-ignore */
}

.pf-compare {
  --pos: 50%;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  background: #0a0a0a;
  cursor: ew-resize;
  /* sur mobile, le doigt glisse la poignée à l'horizontale et fait défiler la page à la verticale */
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.pf-compare__layer {
  position: absolute;
  inset: 0;
}

/* l'après est à droite de la poignée */
.pf-compare__layer--after {
  clip-path: inset(0 0 0 var(--pos));
}

.pf-compare img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0;
  pointer-events: none;
  -webkit-user-drag: none;
}

.pf-compare__label {
  position: absolute;
  top: clamp(10px, 1.6vw, 18px);
  padding: 0.5em 0.95em;
  border-radius: 999px;
  font-size: clamp(11px, 1vw, 13px);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  pointer-events: none;
}

.pf-compare__label--before {
  left: clamp(10px, 1.6vw, 18px);
  background: rgba(10, 10, 10, 0.78);
  color: #fff;
}

.pf-compare__label--after {
  right: clamp(10px, 1.6vw, 18px);
  background: var(--azur);
  color: #0a0a0a;
}

/* trait de séparation et poignée ronde, comme sur clickway.fr */
.pf-compare__line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  margin-left: -1px;
  background: #fff;
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.pf-compare__handle {
  position: absolute;
  top: 50%;
  left: var(--pos);
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  color: #0a0a0a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); /* ombre de la poignée, taste-skill-ignore */
  transform: translate(-50%, -50%);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.pf-compare:hover .pf-compare__handle,
.pf-compare.is-dragging .pf-compare__handle {
  box-shadow: 0 0 0 6px rgba(39, 229, 255, 0.28), 0 8px 24px rgba(0, 0, 0, 0.4); /* halo Azur, taste-skill-ignore */
}

.pf-compare.is-dragging .pf-compare__handle {
  transform: translate(-50%, -50%) scale(1.08);
}

.pf-compare__handle:focus-visible {
  outline: 2px solid var(--azur);
  outline-offset: 4px;
}

/* Curseur et dimensions pendant que le cadre se dessine (ajoutés par portfolio.js) */
.pf-drag {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  pointer-events: none;
}

.pf-size {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

/* ---------- Le cas zitro : texte à gauche, pages superposées à droite ---------- */
.pf-case {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(2.5rem, 5vw, 5rem);
  width: min(100%, 1240px);
  margin-top: clamp(5rem, 14vh, 9rem);
}

.pf-case__title {
  margin: 0 0 1.25rem;
  color: #fff;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  font-optical-sizing: auto;
  line-height: 1.06;
  letter-spacing: -0.045em;
  /* sur deux lignes, le titre se coupe en deux moitiés égales plutôt que de laisser un mot seul */
  text-wrap: balance;
}

.pf-case__body {
  margin: 0;
  color: rgba(253, 243, 224, 0.85);
  font-size: clamp(1rem, 1.25vw, 1.125rem);
  line-height: 1.7;
}

.pf-hl {
  color: var(--azur);
}

/* un mot en Azur et la ponctuation qui le suit restent sur la même ligne */
.pf-nb {
  white-space: nowrap;
}

.pf-case__result {
  margin: 1.5rem 0 0;
  color: var(--azur);
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  font-weight: 600;
  line-height: 1.55;
}

/* trois pages du nouveau site, en pile : la 1 au fond, la 3 au milieu, la 4 devant ;
   chacune laisse voir le haut de celle de dessous */
.pf-stack {
  position: relative;
  aspect-ratio: 100 / 85;
}

.pf-shot {
  position: absolute;
  width: 72%;
  height: auto;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 24px 60px rgba(0, 0, 0, 0.65); /* liseré et ombre des pages, taste-skill-ignore */
  cursor: zoom-in;
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out);
}

.pf-shot--1 {
  top: 0;
  left: 0;
  z-index: 1;
}

.pf-shot--3 {
  top: 23.5%;
  left: 14%;
  z-index: 2;
}

.pf-shot--4 {
  top: 47%;
  left: 28%;
  z-index: 3;
}

/* quatre pages : la 1 au fond, la 4 devant (l'ordre du code suffit à les empiler) */
.pf-stack--4 {
  aspect-ratio: 100 / 88;
}

.pf-stack--4 .pf-shot {
  width: 64%;
}

.pf-stack--4 .pf-shot:nth-child(1) {
  top: 0;
  left: 0;
}

.pf-stack--4 .pf-shot:nth-child(2) {
  top: 18.18%;
  left: 12%;
}

.pf-stack--4 .pf-shot:nth-child(3) {
  top: 36.36%;
  left: 24%;
}

.pf-stack--4 .pf-shot:nth-child(4) {
  top: 54.55%;
  left: 36%;
}

/* un projet de refonte plus bas dans la page : son avant / après s'éloigne du projet précédent */
.pf-frame--next {
  margin-top: clamp(6rem, 16vh, 10rem);
}

/* survolée, une page passe devant pour être lue en entier
   (pas au doigt : le survol y resterait collé après la fermeture du zoom) */
@media (hover: hover) {
  .pf-shot:hover {
    z-index: 4;
    box-shadow: 0 0 0 1px rgba(39, 229, 255, 0.4), 0 30px 70px rgba(0, 0, 0, 0.7); /* liseré Azur, taste-skill-ignore */
    transform: translateY(-6px) scale(1.02);
  }
}

.pf-shot:focus-visible {
  z-index: 4;
  box-shadow: 0 0 0 1px rgba(39, 229, 255, 0.4), 0 30px 70px rgba(0, 0, 0, 0.7); /* liseré Azur, taste-skill-ignore */
  transform: translateY(-6px) scale(1.02);
}

/* ---------- Pour finir : la question, et le bouton « Prendre rendez-vous » au bout de la phrase ---------- */
.pf-outro {
  width: min(100%, 1100px);
  margin-top: clamp(6rem, 18vh, 11rem);
  text-align: center;
}

.pf-outro__text {
  margin: 0;
  color: #fff;
  font-size: clamp(1.9rem, 4vw, 3.5rem);
  font-weight: 700;
  font-optical-sizing: auto;
  line-height: 1.15;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

/* le bouton de l'accueil, posé au milieu de la ligne */
.pf-outro__cta {
  margin-left: 0.3em;
  vertical-align: middle;
}

/* ---------- Une page en grand : l'arrière se floute, on glisse pour passer aux autres, un clic referme ---------- */
.pf-zoom {
  position: fixed;
  inset: 0;
  z-index: 900;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  cursor: zoom-out;
  /* les glissés du doigt servent à changer de page, pas à faire défiler */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.pf-zoom.is-open {
  visibility: visible;
  pointer-events: auto;
}

.pf-zoom:focus {
  outline: none;
}

.pf-zoom__veil {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.pf-zoom.is-open .pf-zoom__veil {
  opacity: 1;
}

.pf-zoom__track {
  position: absolute;
  inset: 0;
  display: flex;
  will-change: transform;
}

.pf-zoom__slide {
  flex: 0 0 100%;
  display: grid;
  place-items: center;
}

.pf-zoom__slide img {
  width: auto;
  height: auto;
  max-width: min(calc(100vw - 32px), 1500px);
  max-height: calc(100svh - 120px);
  border-radius: clamp(10px, 1.4vw, 18px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 30px 80px rgba(0, 0, 0, 0.6); /* liseré et ombre de la page en grand, taste-skill-ignore */
  pointer-events: none;
  -webkit-user-drag: none;
}

/* où l'on en est dans les trois pages */
.pf-zoom__dots {
  position: absolute;
  right: 0;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.pf-zoom.is-open .pf-zoom__dots {
  opacity: 1;
}

.pf-zoom.is-closing .pf-zoom__veil,
.pf-zoom.is-closing .pf-zoom__dots {
  opacity: 0;
}

.pf-zoom__dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.pf-zoom__dots i.is-on {
  background: var(--azur);
  transform: scale(1.3);
}

.pf-shot:focus-visible {
  outline: 2px solid var(--azur);
  outline-offset: 4px;
}

@media (max-width: 900px) {
  .pf-case {
    grid-template-columns: minmax(0, 1fr);
  }

  /* le texte et le résultat centrés, le titre reste à gauche */
  .pf-case__body,
  .pf-case__result {
    text-align: center;
  }

  .pf-shot {
    width: 78%;
  }

  .pf-stack {
    aspect-ratio: 100 / 83;
  }

  .pf-shot--3 {
    top: 20.5%;
    left: 11%;
  }

  .pf-shot--4 {
    top: 41%;
    left: 22%;
  }

  .pf-stack--4 {
    aspect-ratio: 100 / 87;
  }

  .pf-stack--4 .pf-shot {
    width: 72%;
  }

  .pf-stack--4 .pf-shot:nth-child(2) {
    top: 16.09%;
    left: 9.33%;
  }

  .pf-stack--4 .pf-shot:nth-child(3) {
    top: 32.18%;
    left: 18.67%;
  }

  .pf-stack--4 .pf-shot:nth-child(4) {
    top: 48.28%;
    left: 28%;
  }
}

@media (max-width: 600px) {
  .pf-frame {
    border-radius: 20px;
  }

  .pf-compare {
    border-radius: 13px;
  }

  .pf-compare__handle {
    width: 40px;
    height: 40px;
  }

  .pf-compare__handle svg {
    width: 18px;
    height: 18px;
  }

  .pf-shot {
    border-radius: 9px;
  }

  /* sur téléphone, le bouton passe sous la phrase, centré */
  .pf-outro__cta {
    display: flex;
    width: fit-content;
    margin: 1.25rem auto 0;
  }
}
