/* Variants chart (src/components/solutions/VariantsChart.astro). Scoped to
   .vc; sits in the shared .frame with .st-corners. The drawing is a
   1280 x 560 SVG; its words are HTML placed in % of that box from 600px and
   stacked under it on phones, so they never drop below a legible size. */

.vc { margin: 0; overflow: visible; }
.vc-chart { position: relative; }
.vc-svg { display: block; width: 100%; height: auto; border-radius: 11px 11px 0 0; }

.vc-grid { fill: none; stroke: rgba(32, 31, 29, .05); stroke-width: 1; }
.vc-axis { fill: none; stroke: rgba(32, 31, 29, .38); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Mini emails */
.vc-mb { fill: #fff; stroke: rgba(32, 31, 29, .28); stroke-width: .8; }
.vc-mt { fill: none; stroke: rgba(32, 31, 29, .35); stroke-width: 1; stroke-linecap: round; }
/* Monochrome copies (the build-in and the floor row) */
.vc-vars--mono, .vc-row { --h: #D4D0CC; --c: #A8A39F; }
/* Dark grey copy (scene 3) */
.vc-vars--dark { --h: #6B665E; --c: #3A3835; }
.vc-vars--dark .vc-mb { fill: #E4E1DF; stroke: rgba(32, 31, 29, .45); }
.vc-vars--dark .vc-mt { stroke: rgba(32, 31, 29, .55); }

/* Ticks (scene 3) */
.vc-check circle { fill: #0A7891; stroke: #F8F7F7; stroke-width: 1; }
.vc-check path { fill: none; stroke: #F8F7F7; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Dollar signs (scenes 4 and 5) */
.vc-cash circle { fill: #0C505D; stroke: #FFFA66; stroke-width: 1.5; }
.vc-cash text { fill: #FFFA66; font-family: var(--font-body, sans-serif); font-size: 12px; font-weight: 700; }

/* Axis words */
.vc-mono {
  position: absolute;
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--type-label-s);
  letter-spacing: var(--type-label-tracking);
  text-transform: uppercase;
  color: #6B665E;
}
.vc-volume { left: 5%; top: 4%; }
.vc-today { left: 5%; top: 92.5%; }
.vc-grows { right: 5%; top: 92.5%; }

/* Labels: one style, one at a time, each on a leader to what it describes. */
.vc-lead path { fill: none; stroke: #201F1D; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.vc-lead circle { fill: #201F1D; stroke: #fff; stroke-width: 2; }
.vc-notes { display: grid; padding: 16px; }
.vc-note {
  grid-area: 1 / 1;
  align-self: start;
  margin: 0;
  font-size: var(--type-h5);
  line-height: 1.2;
  font-weight: var(--type-subhead-weight);
  color: #201F1D;
}
.vc-title { font-size: var(--type-h4); line-height: var(--type-h3-lh); letter-spacing: var(--type-h3-ls); font-weight: var(--type-heading-weight, 500); }

@media (min-width: 600px) {
  .vc { container-type: inline-size; }
  .vc-notes { position: absolute; inset: 0; padding: 0; display: block; pointer-events: none; }
  .vc-note { position: absolute; font-size: clamp(var(--type-small), 2.4cqi, var(--type-h4)); }
  /* Each label's bottom sits just above its leader's underline (y 175 for the
     variants, y 330 for the floor row, in the 1280 x 500 drawing). */
  .vc-at--area { left: 39%; bottom: 66.6%; width: 34%; }
  .vc-at--floor { left: 9.4%; bottom: 35.6%; width: 30%; }
  /* The conclusion: a title in the empty top left, under the axis word. */
  .vc-title { left: 5%; top: 11%; width: 42%; font-size: clamp(var(--type-h4), 2.6cqi, var(--type-h3)); }
  .vc-svg { border-radius: 11px; }
}

/* Without JS (or with reduced motion) the last scene shows still: colour
   variants, the coloured floor row, the dollar signs, the title only. */
.vc:not(.vc--js) :is(.vc-vars--dark, .vc-checks) { display: none; }
.vc:not(.vc--js) .vc-note:not(.vc-note--win),
.vc:not(.vc--js) .vc-lead { display: none; }

.vc-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.vc-foot { display: flex; justify-content: flex-end; padding: 0 16px 12px; }
.vc-replay {
  font-family: var(--font-mono);
  font-size: var(--type-label-s);
  letter-spacing: var(--type-label-tracking);
  text-transform: uppercase;
  color: #6B665E;
  background: #fff;
  border: 1px solid rgba(32, 31, 29, .2);
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
}
.vc-replay[hidden] { display: none; }
@media (min-width: 600px) {
  .vc-foot { position: absolute; right: 5%; top: 4%; padding: 0; }
}

/* Scenes (JS on, motion allowed). In each, the drawing comes first, then the
   label that explains it, then a pause to read (scene starts in the component script).
   1 .is-in  light grey emails snap in, left to right (0.3s to 1.7s); label
   2 .is-p2  the floor row colours in, left to right; label
   3 .is-p3  the curve turns dark grey, left to right; ticks sweep in with the label
   4 .is-p4  ticks go; the curve colours in, left to right; dollar signs twinkle with the label
   5 .is-p5  the conclusion title (dollar signs keep twinkling)
   Each label (and its own leader) replaces the one before. */
@keyframes vc-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes vc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes vc-twinkle {
  0%, 100% { opacity: 0; transform: scale(.5); }
  35%, 65% { opacity: 1; transform: scale(1.15); }
}
.vc--js :is(.vc-vars, .vc-row) use { opacity: 0; transform-box: fill-box; transform-origin: center; }
.vc--js .vc-cash { opacity: 0; transform-box: fill-box; transform-origin: center; }
.vc--js .vc-check { opacity: 0; transition: opacity .3s; }
.vc--js .vc-note,
.vc--js .vc-lead { opacity: 0; transition: opacity .6s; }
.vc--reset :is(.vc-note, .vc-lead, .vc-check) { transition: none !important; }

/* 1 */
.vc--js.is-in :is(.vc-note--top, .vc-lead--top) { transition-delay: 2s; opacity: 1; }
.vc--js.is-in :is(.vc-vars--mono, .vc-row) use { animation: vc-pop .2s cubic-bezier(.2, .8, .3, 1.2) calc(var(--d, 0s) + .3s) forwards; }

/* 2 */
.vc--js.is-p2 :is(.vc-note--top, .vc-lead--top) { transition-delay: 0s; opacity: 0; }
.vc--js.is-p2 .vc-vars--floor use { animation: vc-fade .5s ease calc(var(--d, 0s) * 1.5 + .4s) forwards; }
.vc--js.is-p2 :is(.vc-note--floor, .vc-lead--floor) { transition-delay: 2.8s; opacity: 1; }

/* 3 */
.vc--js.is-p3 :is(.vc-note--floor, .vc-lead--floor) { transition-delay: 0s; opacity: 0; }
.vc--js.is-p3 .vc-vars--dark use { animation: vc-fade .5s ease calc(var(--d, 0s) * 1.5 + .4s) forwards; }
.vc--js.is-p3 :is(.vc-note--help, .vc-lead--help) { transition-delay: 2.8s; opacity: 1; }
.vc--js.is-p3 .vc-check { transition-delay: calc(var(--d, 0s) + 2.6s); opacity: 1; }

/* 4 */
.vc--js.is-p4 :is(.vc-note--help, .vc-lead--help) { transition-delay: 0s; opacity: 0; }
.vc--js.is-p4 .vc-check { transition: opacity .5s; transition-delay: 0s; opacity: 0; }
.vc--js.is-p4 .vc-vars--colour use { animation: vc-fade .5s ease calc(var(--d, 0s) * 1.5 + .4s) forwards; }
.vc--js.is-p4 :is(.vc-note--safe, .vc-lead--safe) { transition-delay: 2.8s; opacity: 1; }
.vc--js.is-p4 .vc-cash { animation: vc-twinkle 2.4s ease-in-out calc(var(--t) + 2.6s) infinite; }

/* 5 */
.vc--js.is-p5 :is(.vc-note--safe, .vc-lead--safe) { transition-delay: 0s; opacity: 0; }
.vc--js.is-p5 .vc-note--win { transition-delay: 1.2s; opacity: 1; }

/* Quick pace (.vc--quick, scene starts in the component script): the drawings
   sweep faster and each label follows sooner. */
.vc--quick.vc--js.is-in :is(.vc-note--top, .vc-lead--top) { transition-delay: 1.3s; }
.vc--quick.vc--js.is-p2 .vc-vars--floor use,
.vc--quick.vc--js.is-p3 .vc-vars--dark use,
.vc--quick.vc--js.is-p4 .vc-vars--colour use { animation-duration: .35s; animation-delay: calc(var(--d, 0s) + .2s); }
.vc--quick.vc--js.is-p2 :is(.vc-note--floor, .vc-lead--floor),
.vc--quick.vc--js.is-p3 :is(.vc-note--help, .vc-lead--help),
.vc--quick.vc--js.is-p4 :is(.vc-note--safe, .vc-lead--safe) { transition-delay: 1.6s; }
.vc--quick.vc--js.is-p3 .vc-check { transition-delay: calc(var(--d, 0s) + 1.4s); }
.vc--quick.vc--js.is-p4 .vc-cash { animation-delay: calc(var(--t) + 1.4s); }
.vc--quick.vc--js.is-p5 .vc-note--win { transition-delay: .6s; }
/* Labels going out never wait. */
.vc--quick.vc--js.is-p2 :is(.vc-note--top, .vc-lead--top),
.vc--quick.vc--js.is-p3 :is(.vc-note--floor, .vc-lead--floor),
.vc--quick.vc--js.is-p4 :is(.vc-note--help, .vc-lead--help),
.vc--quick.vc--js.is-p5 :is(.vc-note--safe, .vc-lead--safe) { transition-delay: 0s; }

/* Persona pages (.sol-page): thinner pointer lines in the medium stroke, and
   the end dot without its white ring. */
.sol-page .vc-lead path { stroke: var(--stroke-medium, rgba(32, 31, 29, .4)); stroke-width: 1; }
.sol-page .vc-lead circle { fill: var(--stroke-medium, rgba(32, 31, 29, .4)); stroke: none; }

/* Four scenes (.vc--four; the script adds .is-p3 and .is-p4 together):
   1 the grey emails rise into place column by column, left to right
   2 the floor row colours in
   3 the curve colours in (no dark grey step) as the ticks sweep, with
     "Stensul makes them safe to ship"
   4 the ticks clear, the dollar signs twinkle, the title */
@keyframes vc-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.vc--four .vc-vars--dark { display: none; }
.vc--four.vc--js.is-in :is(.vc-vars--mono, .vc-row) use { animation: vc-rise .45s cubic-bezier(.2, .7, .3, 1) calc(var(--d, 0s) + .2s) both; }
.vc--four.vc--js.is-p4:not(.is-p5) .vc-check { transition: opacity .3s; transition-delay: calc(var(--d, 0s) + 1.2s); opacity: 1; }
.vc--four.vc--js.is-p4:not(.is-p5) .vc-cash { animation: none; opacity: 0; }
.vc--four.vc--js.is-p5 .vc-check { transition-delay: 0s; opacity: 0; }
/* The conclusion stays up the whole time, so a reader who doesn't wait still
   gets it; the last scene's payoff is the ticks clearing and the dollar signs. */
.vc--four.vc--js .vc-note--win { opacity: 1; transition: none; }
/* Phones: the standing title sits at the top of the frame, under the
   "Personalized email variants" axis word, with room before the drawing; the
   scene labels stay under the chart. */
@media (max-width: 599px) {
  .vc--four .vc-chart { padding-top: 88px; }
  .vc--four .vc-volume { top: 16px; left: 16px; }
  .vc--four .vc-note--win { position: absolute; top: 40px; left: 16px; right: 16px; }
}
/* Persona pages: no outlines on the mini emails; a light Ivory fill keeps them
   visible on the white chart (the dark grey copy keeps its own fill). */
.sol-page .vc-mb { stroke: none; fill: #EEECEA; }
.sol-page .vc-vars--dark .vc-mb { stroke: none; fill: #D9D6D3; }
