:root {
  --cpts-purple: #5d2ac7;
  --cpts-purple-dark: #25116f;
  --cpts-lilac: #8d69f4;
  --cpts-orange: #ff7b2f;
  --cpts-peach: #ffd9c4;
  --cpts-ink: #201561;
  --cpts-muted: #68628c;
  --cpts-surface: rgba(255, 255, 255, .88);
}

.cpts-projects {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 34px;
  background: linear-gradient(135deg, #fffdfa 0%, #fff8f6 44%, #fbf9ff 100%);
  box-shadow: 0 18px 45px rgba(62, 36, 122, .08);
  padding: clamp(34px, 4vw, 64px);
  color: var(--cpts-ink);
}

.cpts-projects__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(250px, .82fr) minmax(0, 1.65fr);
  gap: clamp(30px, 5vw, 72px);
  align-items: center;
}

.cpts-projects__copy {
  position: relative;
  z-index: 6;
  max-width: 430px;
}

.cpts-projects__eyebrow {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .18em;
  color: #7a54e9;
}

.cpts-projects__title {
  margin: 0;
  font-size: clamp(34px, 3.3vw, 58px);
  line-height: .98;
  letter-spacing: -.045em;
  color: #1f176f;
  max-width: 610px;
}

.cpts-projects__intro {
  margin: 22px 0 0;
  max-width: 390px;
  color: var(--cpts-muted);
  font-size: clamp(16px, 1.15vw, 20px);
  line-height: 1.5;
}

.cpts-projects__all {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  margin-top: 30px;
  padding: 15px 21px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7650ef, #642cd8);
  color: white;
  text-decoration: none !important;
  font-weight: 750;
  box-shadow: 0 12px 28px rgba(93, 42, 199, .24);
  transition: transform .25s ease, box-shadow .25s ease;
}

.cpts-projects__all:hover,
.cpts-projects__all:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(93, 42, 199, .31);
}

.cpts-projects__experience {
  min-width: 0;
}

.cpts-projects__filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  position: relative;
  z-index: 10;
  margin-bottom: 20px;
}

.cpts-projects__filter {
  appearance: none;
  border: 1px solid rgba(75, 48, 150, .08);
  background: rgba(255, 255, 255, .76);
  color: #251c74;
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 7px 20px rgba(61, 37, 118, .06);
  transition: transform .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}

.cpts-projects__filter:hover,
.cpts-projects__filter:focus-visible {
  transform: translateY(-1px);
}

.cpts-projects__filter.is-active {
  color: white;
  background: linear-gradient(135deg, #7c56f6, #6937df);
  box-shadow: 0 9px 22px rgba(104, 51, 220, .24);
}

.cpts-projects__stage {
  position: relative;
  height: clamp(455px, 39vw, 545px);
  perspective: 1400px;
  perspective-origin: 50% 45%;
}

.cpts-projects__cards {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.cpts-projects__card {
  --x: 0%;
  --z: 0px;
  --ry: 0deg;
  --scale: 1;
  --opacity: 1;
  --blur: 0px;
  --card-w: clamp(210px, 22vw, 310px);
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--card-w);
  height: clamp(390px, 33vw, 445px);
  opacity: var(--opacity);
  filter: blur(var(--blur));
  transform: translate(-50%, -50%) translateX(var(--x)) translateZ(var(--z)) rotateY(var(--ry)) scale(var(--scale));
  transform-origin: 50% 50%;
  transition: transform .72s cubic-bezier(.22,.75,.18,1), opacity .45s ease, filter .45s ease;
  pointer-events: none;
  will-change: transform, opacity;
}

.cpts-projects__card.is-active {
  z-index: 8;
  pointer-events: auto;
}

.cpts-projects__card.is-near {
  pointer-events: auto;
}

.cpts-projects__card.is-hidden {
  visibility: hidden;
}

.cpts-projects__card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 28px;
  background: rgba(255, 255, 255, .94);
  color: inherit;
  text-decoration: none !important;
  border: 1px solid rgba(255,255,255,.88);
  box-shadow: 0 22px 50px rgba(47, 28, 108, .14);
  backdrop-filter: blur(12px);
}

.cpts-projects__card.is-active .cpts-projects__card-link {
  box-shadow: 0 28px 65px rgba(47, 28, 108, .23);
}

.cpts-projects__media {
  position: relative;
  height: clamp(176px, 17vw, 218px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 12px 6px;
  box-sizing: border-box;
  overflow: hidden;
  background: linear-gradient(180deg, #f8f5ff 0%, #ffffff 100%);
  flex: 0 0 auto;
}

.cpts-projects__media::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(to top, rgba(25, 14, 81, .12), transparent);
}

.cpts-projects__media img,
.cpts-projects__placeholder {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  display: block;
  object-fit: contain !important;
  object-position: center center;
  transition: transform .7s ease;
}

.cpts-projects__card.is-active:hover .cpts-projects__media img {
  transform: scale(1.035);
}

.cpts-projects__placeholder {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 75% 24%, rgba(255, 123, 47, .36), transparent 34%),
    linear-gradient(135deg, #ece4ff, #fff0e6);
}

.cpts-projects__placeholder span {
  font-size: 80px;
  font-weight: 850;
  color: rgba(70, 39, 151, .72);
}

.cpts-projects__body {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 21px 23px 72px;
}

.cpts-projects__card-title {
  margin: 0 44px 8px 0;
  font-size: clamp(20px, 1.65vw, 28px);
  line-height: 1.04;
  letter-spacing: -.035em;
  color: #1d1468;
}

.cpts-projects__excerpt {
  margin: 0;
  color: #68618c;
  line-height: 1.45;
  font-size: 14px;
}

.cpts-projects__card-arrow {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, #8059fb, #6027d5);
  box-shadow: 0 9px 22px rgba(90, 43, 198, .26);
  font-size: 22px;
}

.cpts-projects__nav {
  position: absolute;
  z-index: 12;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .96);
  color: #6838dd;
  box-shadow: 0 10px 26px rgba(55, 33, 116, .11);
  font-size: 24px;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.cpts-projects__nav:hover,
.cpts-projects__nav:focus-visible {
  transform: translateY(calc(-50% - 2px));
  box-shadow: 0 14px 30px rgba(55, 33, 116, .16);
}

.cpts-projects__nav--prev { left: 14px; }
.cpts-projects__nav--next { right: 14px; }

.cpts-projects__dots {
  position: absolute;
  z-index: 11;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.cpts-projects__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(99, 54, 215, .16);
  transition: width .25s ease, background .25s ease;
}

.cpts-projects__dot.is-active {
  width: 22px;
  border-radius: 999px;
  background: #7749e9;
}

/* Décor abstrait, entièrement en CSS : aucune image additionnelle requise. */
.cpts-projects__decor {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  filter: blur(.1px);
}

.cpts-projects__decor--one {
  width: 58%;
  height: 80%;
  left: 24%;
  top: 7%;
  border-radius: 48% 52% 44% 56% / 55% 43% 57% 45%;
  background: linear-gradient(135deg, rgba(255, 210, 184, .82), rgba(249, 214, 240, .44));
  transform: rotate(-7deg);
}

.cpts-projects__decor--two {
  width: 42%;
  height: 58%;
  right: -2%;
  top: 18%;
  border-radius: 55% 45% 58% 42% / 38% 58% 42% 62%;
  background: linear-gradient(145deg, rgba(246, 218, 255, .86), rgba(210, 199, 255, .52));
  transform: rotate(11deg);
}

.cpts-projects__decor--three {
  width: 49%;
  height: 28%;
  left: 40%;
  bottom: 8%;
  border: 30px solid rgba(255, 157, 94, .26);
  border-left-color: rgba(120, 73, 233, .20);
  border-radius: 50%;
  transform: rotate(9deg);
}

.cpts-projects-admin-note {
  padding: 16px 18px;
  border: 1px dashed #aa86ff;
  background: #faf7ff;
  color: #4d2aad;
  border-radius: 12px;
}

@media (max-width: 1050px) {
  .cpts-projects {
    padding: 38px 28px 34px;
    border-radius: 28px;
  }

  .cpts-projects__inner {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .cpts-projects__copy {
    max-width: none;
  }

  .cpts-projects__title {
    max-width: 760px;
    font-size: clamp(34px, 6vw, 50px);
  }

  .cpts-projects__intro {
    max-width: 690px;
  }

  .cpts-projects__all {
    margin-top: 20px;
  }

  .cpts-projects__filters {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 4px 2px 11px;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%);
  }

  .cpts-projects__filters::-webkit-scrollbar { display: none; }

  .cpts-projects__stage {
    height: 530px;
  }

  .cpts-projects__nav--prev { left: 10px; }
  .cpts-projects__nav--next { right: 10px; }
}

@media (max-width: 700px) {
  .cpts-projects {
    margin-inline: -2px;
    padding: 28px 16px 24px;
    border-radius: 24px;
  }

  .cpts-projects__eyebrow { font-size: 12px; }
  .cpts-projects__title { font-size: clamp(31px, 10vw, 42px); }
  .cpts-projects__intro { font-size: 16px; margin-top: 16px; }

  .cpts-projects__all {
    padding: 13px 17px;
    font-size: 14px;
  }

  .cpts-projects__experience {
    margin-inline: -16px;
  }

  .cpts-projects__filters {
    padding-inline: 16px;
    margin-bottom: 8px;
  }

  .cpts-projects__filter {
    padding: 9px 14px;
    font-size: 12px;
  }

  .cpts-projects__stage {
    height: 470px;
  }

  .cpts-projects__card {
    --card-w: min(76vw, 306px);
    height: 390px;
  }

  .cpts-projects__body { padding: 18px 18px 62px; }
  .cpts-projects__card-title { font-size: 22px; }
  .cpts-projects__excerpt { font-size: 13px; }
  .cpts-projects__card-arrow { width: 38px; height: 38px; right: 14px; bottom: 14px; }

  .cpts-projects__nav {
    width: 42px;
    height: 42px;
    top: 48%;
  }
  .cpts-projects__nav--prev { left: 8px; }
  .cpts-projects__nav--next { right: 8px; }

  .cpts-projects__dots { bottom: 14px; }

  .cpts-projects__decor--one {
    width: 110%;
    left: 8%;
    top: 42%;
    height: 42%;
  }

  .cpts-projects__decor--two {
    width: 85%;
    right: -25%;
    top: 55%;
  }

  .cpts-projects__decor--three {
    width: 90%;
    left: 30%;
    bottom: 7%;
    border-width: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cpts-projects *,
  .cpts-projects *::before,
  .cpts-projects *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* v0.1.3 — garde-fous contre les styles globaux du thème */
.cpts-projects .cpts-projects__media img {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

@media (max-width: 700px) {
  .cpts-projects__media {
    height: 170px;
    padding: 10px 10px 4px;
  }
}
