/* =========================================================
   ÉTUDE DE CAS — Concept art « Le cristal des profondeurs »
   Ambiance : noir, anthracite et lueur violette
   ========================================================= */

.page-cristal {
  --accent: #9b4dca;
  --violet: #9b4dca;
  --violet-light: #c9a0e6;
  --violet-glow: rgba(155, 77, 202, .45);
  background: #0c0b0f;
}
.page-cristal .case-hero__title em,
.page-cristal .lp-title em,
.page-cristal .footer__cta em {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--violet-light);
  text-shadow: 0 0 30px var(--violet-glow);
}
.page-cristal .case-hero__intro strong { color: var(--violet-light); font-weight: 600; }
.page-cristal .lever { background: #141218; border-color: rgba(155, 77, 202, .16); }
.page-cristal .lever:hover { border-color: rgba(155, 77, 202, .55); box-shadow: 0 0 40px -15px var(--violet-glow); }
.page-cristal .lever__tag { background: rgba(155, 77, 202, .15); color: var(--violet-light); }
.page-cristal .swatch { background: #141218; border-color: rgba(155, 77, 202, .16); }
.page-cristal .swatch__info code { color: var(--violet-light); }
.page-cristal .skill-tags li { border-color: rgba(155, 77, 202, .25); }
.page-cristal .footer {
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(155, 77, 202, .18), transparent 70%), #0e0c12;
}

/* ---------- En-tête ---------- */
.cr-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  padding: clamp(8rem, 13vw, 10rem) var(--gutter) clamp(3rem, 7vw, 5rem);
  overflow: hidden;
  background:
    radial-gradient(ellipse 45% 60% at 76% 45%, rgba(155, 77, 202, .28), transparent 70%),
    radial-gradient(ellipse 80% 50% at 50% 110%, rgba(60, 12, 84, .5), transparent 70%);
}
.cr-hero__text { position: relative; z-index: 1; }
.cr-meta { grid-template-columns: repeat(2, 1fr); max-width: 560px; }

.cr-frame {
  position: relative;
  z-index: 1;
  margin: 0;
  width: min(400px, 78vw);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(201, 160, 230, .2), 0 50px 80px -30px rgba(0, 0, 0, .9);
  animation: pulse-glow 4s ease-in-out infinite;
}
.cr-frame img { display: block; width: 100%; }
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(201, 160, 230, .2), 0 50px 80px -30px rgba(0, 0, 0, .9), 0 0 60px -10px rgba(155, 77, 202, .35); }
  50% { box-shadow: 0 0 0 1px rgba(201, 160, 230, .35), 0 50px 80px -30px rgba(0, 0, 0, .9), 0 0 110px 0 rgba(155, 77, 202, .55); }
}

/* Particules de lumière */
.motes { position: absolute; inset: 0; pointer-events: none; }
.motes i {
  position: absolute;
  bottom: -10px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--violet-light);
  box-shadow: 0 0 10px 2px var(--violet-glow);
  opacity: 0;
  animation: rise-mote 9s linear infinite;
}
.motes i:nth-child(1) { left: 58%; animation-delay: 0s; }
.motes i:nth-child(2) { left: 64%; animation-delay: 1.2s; animation-duration: 11s; }
.motes i:nth-child(3) { left: 71%; animation-delay: 2.5s; }
.motes i:nth-child(4) { left: 77%; animation-delay: 4s; animation-duration: 12s; }
.motes i:nth-child(5) { left: 83%; animation-delay: .6s; animation-duration: 10s; }
.motes i:nth-child(6) { left: 89%; animation-delay: 3.2s; }
.motes i:nth-child(7) { left: 68%; animation-delay: 5.5s; width: 3px; height: 3px; }
.motes i:nth-child(8) { left: 80%; animation-delay: 6.5s; width: 3px; height: 3px; }
.motes i:nth-child(9) { left: 92%; animation-delay: 7.5s; animation-duration: 13s; }
.motes i:nth-child(10) { left: 61%; animation-delay: 8.2s; width: 3px; height: 3px; }
@keyframes rise-mote {
  0% { transform: translate(0, 0); opacity: 0; }
  15% { opacity: .9; }
  100% { transform: translate(-40px, -95vh); opacity: 0; }
}

/* ---------- Avant / après ---------- */
.cr-compare-sec { display: grid; grid-template-columns: 1fr auto; gap: 3rem; align-items: center; }
.compare {
  position: relative;
  width: 460px;
  max-width: 100%;
  aspect-ratio: 1080 / 1440;
  border-radius: 6px;
  overflow: hidden;
  user-select: none;
  box-shadow: 0 0 0 1px rgba(201, 160, 230, .2), 0 40px 70px -30px rgba(0, 0, 0, .9), 0 0 80px -20px var(--violet-glow);
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.compare__before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare__handle {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--pos);
  width: 2px;
  transform: translateX(-1px);
  background: #fff;
  box-shadow: 0 0 12px var(--violet-glow);
  pointer-events: none;
}
.compare__handle::after {
  content: "‹ ›";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #fff;
  color: #3d0c54;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 2px;
  box-shadow: 0 0 0 4px rgba(155, 77, 202, .4), 0 10px 25px rgba(0, 0, 0, .5);
}
.compare__range {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: ew-resize;
  margin: 0;
}
.compare__range:focus-visible + * , .compare:focus-within .compare__handle::after { box-shadow: 0 0 0 4px var(--violet-light), 0 10px 25px rgba(0, 0, 0, .5); }
.compare__tag {
  position: absolute;
  top: 1rem;
  padding: .3rem .7rem;
  border-radius: 6px;
  background: rgba(12, 11, 15, .75);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .7rem;
  pointer-events: none;
}
.compare__tag--l { left: 1rem; }
.compare__tag--r { right: 1rem; }

/* ---------- Processus ---------- */
.cr-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.cr-step {
  display: flex;
  flex-direction: column;
  padding: 1.6rem 1.5rem;
  background: #141218;
  border: 1px solid rgba(155, 77, 202, .16);
  border-radius: var(--radius);
}
.cr-step__num { font-family: var(--font-mono); color: var(--violet-light); font-size: .85rem; }
.cr-step h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; margin: .5rem 0 .6rem; }
.cr-step p { color: #b9b2c2; font-size: .93rem; line-height: 1.65; margin-bottom: 1.3rem; }
.cr-step img, .cr-step__swatch { margin-top: auto; width: 100%; height: 150px; border-radius: 10px; }
.cr-step img { object-fit: cover; object-position: center 35%; }
.cr-step__swatch--grey { background: linear-gradient(135deg, #141317, #38333e 45%, #706b71 80%, #a9a3ab); }
.cr-step__swatch--violet {
  background:
    radial-gradient(circle at 50% 45%, #d9b6f2 0 4%, #9b4dca 14%, #6e318b 30%, transparent 60%),
    linear-gradient(135deg, #141317, #38333e);
  box-shadow: inset 0 0 40px rgba(155, 77, 202, .35);
}

/* ---------- Loupe ---------- */
.cr-detail { display: grid; grid-template-columns: 1fr auto; gap: 3rem; align-items: center; }
.loupe {
  position: relative;
  width: min(440px, 100%);
  border-radius: 6px;
  overflow: hidden;
  cursor: none;
  box-shadow: 0 0 0 1px rgba(201, 160, 230, .2), 0 40px 70px -30px rgba(0, 0, 0, .9);
}
.loupe img { display: block; width: 100%; }
.loupe__lens {
  position: absolute;
  width: 180px; height: 180px;
  border-radius: 50%;
  border: 2px solid var(--violet-light);
  box-shadow: 0 0 30px var(--violet-glow), 0 10px 30px rgba(0, 0, 0, .7);
  background: url("../images/projets/cristal/digital.webp") no-repeat #000;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.8);
  transition: opacity .25s, transform .25s var(--ease);
}
.loupe.is-active .loupe__lens { opacity: 1; transform: translate(-50%, -50%) scale(1); }
@media (hover: none) { .loupe { cursor: auto; } .loupe__lens { display: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) { .cr-steps { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .cr-hero, .cr-compare-sec, .cr-detail { grid-template-columns: minmax(0, 1fr); }
  .cr-frame, .compare, .loupe { justify-self: center; }
}
@media (prefers-reduced-motion: reduce) { .motes { display: none; } }
.page-cristal .dot { background: var(--violet-light); box-shadow: 0 0 10px var(--violet-glow); animation: none; }
.page-cristal .btn:hover { box-shadow: 0 10px 30px -8px var(--violet-glow); }
