/* Connecting the two halves (export/connect-the-halves-variants.html). On top of strips-placement.css (.gm--one).
   Script: export/js/connect-variants.js. */

/* ===================== 1 · step numbers on the diagram ===================== */
.cv-badge { opacity: 0; transition: opacity .5s; }
.gm.is-drawn .cv-badge { opacity: 1; }
.gm.is-dng .cv-badge[data-n="2"] { opacity: .3; }
.cv-badge__lead { fill: none; stroke: #ffffffb3; stroke-width: 1.2; }
.cv-badge__end { fill: #fff; stroke: #0b0c0c; stroke-width: 1.5; }
.cv-badge__ring { fill: #0b0c0c; stroke: #ffffff66; stroke-width: 1.4; transition: stroke .3s; }
.cv-badge__halo { fill: none; stroke: #fff; stroke-width: 1.4; opacity: 0; }
.fx-svg text.cv-badge__n { font: 600 10.5px var(--display); fill: #fff; text-anchor: middle; dominant-baseline: central; }
.cv-badge.is-pulse .cv-badge__ring { stroke: #fff; }
.cv-badge.is-pulse .cv-badge__halo { animation: cv-halo .9s ease-out; }
@keyframes cv-halo { from { r: 12px; opacity: .9; } to { r: 26px; opacity: 0; } }
/* the step's own number answers at the same time */
.cv--1 .fx-step__n { transition: border-color .3s, box-shadow .3s; }
.cv--1 .fx-step__n.is-pulse { border-color: #fff; animation: cv-ring .9s ease-out; }
@keyframes cv-ring { from { box-shadow: 0 0 0 0 #ffffffb3; } to { box-shadow: 0 0 0 12px #fff0; } }

/* ===================== 2 · a line from the choice to the triangle ===================== */
.cv--2 .gm-block { position: relative; }
.cv-wire { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 2; }
.cv-wire path { fill: none; stroke: #ffffffb3; stroke-width: 1.3; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.cv-wire.is-on path { stroke-dashoffset: 0; transition: stroke-dashoffset .7s cubic-bezier(.4, 0, .2, 1); }
.cv-wire circle { fill: #fff; stroke: #0b0c0c; stroke-width: 1.5; opacity: 0; transition: opacity .25s; }
.cv-wire.is-on circle { opacity: 1; }
.cv-wire.is-on circle.cv-wire__end { transition-delay: .55s; }
.gm.is-dng .cv-wire, .gm:not(.is-drawn) .cv-wire { opacity: 0; }

/* ===================== 3 · one glass panel ===================== */
@media (min-width: 1060px) {
  .cv--3 .gm-block {
    padding: clamp(32px, 3.4vw, 48px) 0 clamp(28px, 3vw, 40px);
    border-radius: 32px; border: 1px solid #ffffff14;
    background:
      linear-gradient(#ffffff12, #ffffff12) 50% 50% / 1px calc(100% - 2 * clamp(32px, 3.4vw, 48px)) no-repeat,   /* the split */
      linear-gradient(180deg, #ffffff0b, #ffffff04);
    box-shadow: inset 0 1px 0 #ffffff14, 0 24px 60px -20px #000a;
  }
  /* inside the panel the chart no longer rises beside the title */
  .cv--3 .fx-chart { margin-top: 0; }
}

/* ===================== 4 · the file's name on the diagram ===================== */
.cv-name {
  position: absolute; right: 0; top: 2%; z-index: 2; text-align: right;   /* the chart's empty top-right corner */
  display: grid; gap: 3px; font-family: var(--display); pointer-events: none;
  opacity: 0; transition: opacity .5s;
}
.gm.is-drawn .cv-name { opacity: 1; }
.cv-name small { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.cv-name b { font-size: clamp(20px, 1.7vw, 24px); font-weight: 700; letter-spacing: -0.03em; color: var(--text); white-space: nowrap; }
.cv-name span { font-size: 15px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.cv-name.is-new b, .cv-name.is-new span { animation: cv-new .45s ease-out; }
@keyframes cv-new { from { opacity: .2; transform: translateY(4px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .cv-badge.is-pulse .cv-badge__halo, .cv--1 .fx-step__n.is-pulse, .cv-name.is-new b, .cv-name.is-new span { animation: none; }
  .cv-wire.is-on path { transition: none; }
}
