/* ======================================================================
   FOOTER — présentoir 3D « Par où commencer ? »
   Adapté de « Coin Rack Selector » d'Emirhan Albayrak, licence MIT.
   Scripts  : sections/07-footer/footer.js (les pièces), coin-rack.js (la scène three.js)
   ====================================================================== */

.coin-rack {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: clamp(620px, 52vw, 720px);
  overflow: hidden;
  background: linear-gradient(to bottom var(--in-oklab), var(--navy-bottom), var(--navy-abyss));
  border-bottom: 1px solid rgba(237, 241, 253, 0.14);
  color: #FFFFFF;
}

/* Les calques d'ambiance s'effacent en haut : le bord supérieur garde exactement
   la couleur de fin de la section des avis, donc aucune ligne à la jonction. */
.coin-rack-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 200px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 200px);
}

/* lumière d'ambiance derrière le titre */
.coin-rack-ambient {
  background:
    radial-gradient(60% 36% at 50% 24%, rgba(155, 199, 231, 0.16), transparent 70%),
    radial-gradient(50% 30% at 50% 62%, rgba(155, 199, 231, 0.1), transparent 75%);
}

/* scène 3D : fondue en bas (et à peine sur les côtés, le présentoir ne se répète plus) */
.coin-rack-stage {
  position: absolute;
  inset: 0;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
  -webkit-mask-image:
    linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent),
    linear-gradient(180deg, #000 78%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent),
    linear-gradient(180deg, #000 78%, transparent 100%);
  mask-composite: intersect;
}

.coin-rack-vignette {
  background: radial-gradient(120% 85% at 50% 48%, transparent 55%, rgba(4, 18, 40, 0.6) 100%);
}

.coin-rack-grain {
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.coin-rack-head {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(56px, 6vw, 72px) 24px 0;
  text-align: center;
  pointer-events: none;
}

/* Same title style as the carousel and the comparison. */
.coin-rack-heading { margin-bottom: 0; }

.coin-rack-links a:focus-visible {
  outline: 2px solid rgba(237, 241, 253, 0.7);
  outline-offset: 3px;
}

/* liens pour le clavier et les lecteurs d'écran (masqués tant que la 3D fonctionne) */
.coin-rack-links {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* secours sans WebGL : les liens deviennent des pastilles visibles */
.coin-rack.is-fallback {
  min-height: 0;
  padding-bottom: 56px;
}

.coin-rack.is-fallback .coin-rack-stage {
  display: none;
}

.coin-rack.is-fallback .coin-rack-links {
  position: relative;
  z-index: 10;
  width: auto;
  height: auto;
  margin: 40px 0 0;
  padding: 0 24px;
  overflow: visible;
  clip: auto;
  white-space: normal;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.coin-rack.is-fallback .coin-rack-links a {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(237, 241, 253, 0.18);
  font-size: 14px;
  color: rgba(237, 241, 253, 0.92);
}

.coin-rack.is-fallback .coin-rack-links a:hover {
  background: rgba(237, 241, 253, 0.1);
}
