/*
 * Genio — "Confidentialité / Privacy" card animation, version 4.
 * Drops into a carousel card's .visual slot. Everything is sized in container
 * units (cqw), so it scales with the card at any size.
 */

.gp {
  --gp-ink: currentColor;
  --gp-alert: #d42a3c;
  --gp-transcript-font: "Newsreader", Georgia, serif;
  --gp-label-font: "Manrope", system-ui, sans-serif;
  --gp-mono-font: "DM Mono", ui-monospace, monospace;

  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  container-type: size;
  pointer-events: none;
  color: inherit;
}

/* Reds tuned to stay legible on each card colour of the site. */
.card-coral .gp,
.card-rose .gp,
.card-violet .gp {
  --gp-alert: #a4001d;
}

.card-blue .gp {
  --gp-alert: #ff7b7b;
}

/* Live indicator, top right, mirroring the card number on the left. */
.gp-live {
  position: absolute;
  top: clamp(1rem, 7.2cqw, 2.4rem);
  right: clamp(1rem, 7.2cqw, 2.4rem);
  display: flex;
  align-items: center;
  gap: 0.65em;
  font-family: var(--gp-mono-font);
  font-size: clamp(0.6rem, 3.1cqw, 1.05rem);
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.72;
}

.gp-live i {
  width: 0.62em;
  height: 0.62em;
  border-radius: 50%;
  background: var(--gp-ink);
  animation: gp-live-pulse 1.6s ease-in-out infinite;
  transition: background-color 240ms ease;
}

.gp.is-flagged .gp-live i {
  background: var(--gp-alert);
}

@keyframes gp-live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* The area the transcript and brackets live in, clear of the card chrome. */
.gp-stage {
  position: absolute;
  inset: 16% 6% 25%;
  display: block;
}

.gp-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.gp-frame path {
  fill: none;
  stroke: var(--gp-ink);
  stroke-linecap: square;
  stroke-linejoin: miter;
  transition: stroke 220ms ease;
}

.gp.is-flagged .gp-frame path {
  stroke: var(--gp-alert);
}

/* Transcript */
.gp-text {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  font-family: var(--gp-transcript-font);
  font-size: 8.6cqw;
  font-style: italic;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-align: center;
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
  will-change: transform, opacity, filter;
}

.gp-lines {
  display: block;
  transition: opacity 280ms ease;
}

.gp.is-flagged .gp-lines {
  opacity: 0.5;
}

.gp-lines.is-measuring {
  visibility: hidden;
  position: relative;
  text-wrap: balance;
}

.gp-w {
  white-space: nowrap;
}

.gp-line {
  display: block;
  white-space: nowrap;
}

.gp-li {
  position: relative;
  display: inline-block;
  will-change: transform;
}

.gp-c {
  opacity: 0;
  transition: opacity 320ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.gp-c.on {
  opacity: 1;
}

/* The verdict the shutter opens on: set larger and bolder than the words it
   replaces, so the eye lands on the feature, not on the small talk. */
.gp-label {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: flex-start;
  gap: 0.34em;
  font-family: var(--gp-label-font);
  font-size: 8.6cqw;
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.045em;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
  will-change: transform, opacity, filter;
}

/* The red dot, on the first line's x-height. */
.gp-dot {
  flex: none;
  width: 0.26em;
  height: 0.26em;
  margin-top: 0.42em;
  border-radius: 50%;
  background: var(--gp-alert);
}

.gp-label-text,
.gp-label-line {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .gp-c,
  .gp-lines {
    transition: none;
  }

  .gp-live i {
    animation: none;
  }
}
