/* GoBolt launch kit v2. page components. Needs tokens.css and base.css.
   1. .stage-card   a big product picture on a soft painterly sheet (the Harvey hero card)
   2. .lang         the language control in the header
   3. .player       a real audio player for the briefing and the highlight clips
   4. .k-travel     an ink path between two panels, question bubbles travelling along it, and a counter
   5. .k-stepper    Back and Next under a stepped piece that plays on view (kitAutoplay in motion.js)
   Behaviour for 2, 3 and 4 is in components.js; 5 is in motion.js. */

/* ── 1. stage card ────────────────────────────────────────────────────
   <div class="stage-card"><img src="…" alt="…"></div>
   <div class="stage-card"><div data-ui="product"></div></div>
   Full width in a .picture, or one side of a .split. The sheet is paper-toned: a low-frequency
   turbulence in pearl and honey (painterly), a fine grain over it, and three soft radial washes.
   No raster. data-tone="cool" swaps the washes to sage and violet. data-inset="0" drops the padding. */
.stage-card {
  --stage-pad: clamp(14px, 3vw, 40px);
  --stage-1: var(--k-pearl);
  --stage-2: var(--k-honey);
  --stage-3: var(--k-sage);
  position: relative; isolation: isolate; overflow: hidden;
  width: 100%; padding: var(--stage-pad);
  border-radius: var(--k-r-stage);
  background-color: #edeae2;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='900'%3E%3Cfilter id='p' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.0028' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 0.96  0 0 0 0 0.85  0 0 0 1.1 -0.32'/%3E%3C/filter%3E%3Cfilter id='g' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' seed='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.14  0 0 0 0 0.11  0 0 0 0.075 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"),
    radial-gradient(110% 80% at 14% 8%, color-mix(in srgb, var(--stage-1) 92%, transparent) 0%, transparent 58%),
    radial-gradient(80% 70% at 88% 18%, color-mix(in srgb, var(--stage-2) 36%, transparent) 0%, transparent 60%),
    radial-gradient(100% 62% at 62% 104%, color-mix(in srgb, var(--stage-3) 34%, transparent) 0%, transparent 62%),
    linear-gradient(162deg, #f4f2ec 0%, #e8e5dc 100%);
  background-size: 900px 900px, auto, auto, auto, auto;
  box-shadow: inset 0 0 0 1px rgba(30, 29, 26, 0.06), var(--k-shadow-quiet);
}
.stage-card[data-tone="cool"] { --stage-1: var(--k-pearl); --stage-2: var(--k-sage); --stage-3: var(--k-violet); }
.stage-card[data-tone="warm"] { --stage-2: var(--k-coral); --stage-3: var(--k-honey); }
.stage-card[data-inset="0"] { --stage-pad: 0; }
.stage-card > * { position: relative; }
.stage-card > img, .stage-card > picture, .stage-card > video, .stage-card > figure > img {
  display: block; width: 100%; height: auto;
  border-radius: calc(var(--k-r-stage) - var(--stage-pad) * 0.6);
  box-shadow: var(--k-shadow-sheet);
}
.stage-card[data-inset="0"] > img, .stage-card[data-inset="0"] > picture { border-radius: var(--k-r-stage); box-shadow: none; }
.stage-card > [data-ui] { margin-inline: auto; }
/* the kit mocks already carry their own shadow, so the card adds none */
@media (max-width: 640px) { .stage-card { --stage-pad: clamp(10px, 3vw, 16px); border-radius: 20px; } }

/* ── 2. language control ──────────────────────────────────────────────
   <div class="lang"><select aria-label="Language"></select></div>
   components.js fills the options (14 languages, each in its own script) when the select is
   empty, keeps it in step with <html lang>, and emits kit:lang on change. No flags. */
.lang { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 8px 6px 8px 8px; border-radius: var(--k-r-control); color: var(--k-ink-2); font-size: 1rem; line-height: 1; white-space: nowrap; cursor: pointer; transition: color var(--k-fast) ease; }
.lang:hover { color: var(--k-ink); }
.lang[hidden] { display: none; }
html:not(.js) .lang { display: none; }   /* without JS it has no languages to offer */
/* MKT-032: the control is a globe (the partial's .lang-globe) and a chevron; the language's name (the span the kit
   writes) is read by assistive tech and the native menu, never drawn, so the control is the same width in every
   language. The native select sits over it, invisible, and does all the work (keyboard, screen reader, menu). */
.lang-globe { width: 20px; height: 20px; pointer-events: none; flex: none; }
.lang-name { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; pointer-events: none; }
.lang::after {
  content: ""; width: 7px; height: 7px; margin: -4px 4px 0 0;
  border-inline-end: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
  pointer-events: none;
}
[dir="rtl"] .lang::after { transform: rotate(-45deg); margin: -4px 0 0 4px; }
.lang select { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; font: inherit; appearance: none; -webkit-appearance: none; }
.lang:has(select:focus-visible) { outline: 3px solid var(--k-green); outline-offset: 2px; }
.lang select option { color: var(--k-ink); }
/* under a thumb the control is 44 px tall: the select, which takes the tap, reaches past the drawn box */
@media (pointer: coarse) { .lang select { top: -6px; height: calc(100% + 12px); } }

/* ── 3. audio player ──────────────────────────────────────────────────
   <div class="player" data-clip="highlight" data-title="Pack for the weekend" data-voices="2"></div>
   <div class="player" data-variants="briefing,briefingDaily" data-title="Monday briefing"></div>
   components.js builds the button, the head (title, voice marks, the Weekly / Daily switch), the
   waveform, the two times, the paid-plan line and the <audio>. One plays at a time. The bars move only
   while playing: from the audio itself (.is-live, Web Audio) or, when that is not possible, a slow
   breath. Reduced motion keeps them still. Arrow keys on the button seek 5 seconds. */
.player {
  display: flex; align-items: center; gap: 14px;
  width: 100%; max-width: 30rem; padding: 12px 18px 12px 12px;
  background: var(--k-surface); border: 1px solid var(--k-line); border-radius: var(--k-r-sheet);
  box-shadow: var(--k-shadow-quiet);
  color: var(--k-ink); font-family: var(--k-font); font-size: var(--k-small); line-height: 1.3;
}
.player-btn {
  flex: none; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; background: var(--k-ink); color: var(--k-surface);
  transition: transform var(--k-fast) var(--k-ease), opacity var(--k-fast) ease;
}
.player-btn:hover { transform: scale(1.04); }
.player-btn:active { transform: none; }
.player-btn svg { grid-area: 1 / 1; width: 18px; height: 18px; transition: opacity 200ms ease; }
.player-btn .player-play { margin-inline-start: 2px; }
.player-btn .player-pause, .player.is-playing .player-btn .player-play { opacity: 0; }
.player.is-playing .player-btn .player-pause { opacity: 1; }
/* inside a scaled mock the button draws under 44 px; under a thumb its hit area never does */
@media (pointer: coarse) { .player-btn { position: relative; } .player-btn::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; } }
.player-body { flex: 1; min-width: 0; }
.player-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-height: 20px; margin-bottom: 6px; }
.player-title { flex: 0 1 auto; min-width: 0; font-weight: 500; color: var(--k-ink); white-space: normal; overflow-wrap: anywhere; }

/* two voice marks: each follows the energy in one pitch band of the real signal, never a scripted turn */
.player-voices { flex: none; display: inline-flex; gap: 5px; }
.player-voices i {
  --lv: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--k-ink);
  opacity: calc(0.18 + var(--lv) * 0.72); transform: scale(calc(0.8 + var(--lv) * 0.5));
}
.player-voices i:nth-child(2) { background: var(--k-ink-2); }

/* the Weekly / Daily switch: two quiet words in a track, the chosen one lifted in ink. It shares the title's
   row when both fit; when they do not (a phone, a long translated title) it wraps to its own row under the
   title, so the title is never cut. .is-stacked (set by components.js) lets it start that row. */
.player-variants {
  flex: none; display: inline-flex; gap: 2px; margin-inline-start: auto; padding: 2px; border-radius: var(--k-r-pill);
  background: color-mix(in srgb, var(--k-ink) 5%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k-ink) 6%, transparent);
}
.player.is-stacked .player-variants { order: 2; margin-inline-start: 0; margin-top: 8px; }
/* when any variant's title would push the switch down, it always starts its own row, whichever title shows */
.player.is-stacked .player-head { row-gap: 0; }
.player.is-stacked .player-head::after { content: ""; order: 1; flex-basis: 100%; height: 0; }
.player-variants button {
  position: relative; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  border-radius: var(--k-r-pill); color: var(--k-ink-3); font-size: var(--k-small); line-height: 1.2; cursor: pointer;
  transition: color var(--k-fast) ease, background-color var(--k-fast) ease, box-shadow var(--k-fast) ease;
}
.player-variants button:hover { color: var(--k-ink); background: color-mix(in srgb, var(--k-ink) 4%, transparent); }
@media (pointer: coarse) { .player-variants button::after { content: ""; position: absolute; inset: -4px 0; } }
.player-variants button[aria-checked="true"], .player-variants button[aria-checked="true"]:hover { color: var(--k-ink); background: var(--k-surface); box-shadow: 0 1px 2px rgba(30, 29, 26, 0.08); }
.player-variants button:focus-visible { outline-offset: 1px; }
/* forced colours drop the chosen option's surface and shadow: mark it with a system-colour ring, and an underline
   that still shows while the focus ring (Highlight) replaces the ring on the focused option */
@media (forced-colors: active) {
  .player-variants button[aria-checked="true"] { outline: 2px solid CanvasText; outline-offset: -2px; text-decoration: underline 2px; text-underline-offset: 4px; }
  .player-variants button[aria-checked="true"]:focus-visible { outline: 2px solid Highlight; outline-offset: 1px; }
  /* the waveform bars are background colour, which forced colours paint as Canvas: keep them as text colour */
  .player-wave i { forced-color-adjust: none; background: CanvasText; }
}
.player-note { margin-top: 6px; color: var(--k-ink-3); font-size: var(--k-small); line-height: 1.4; }

.player-wave { display: flex; align-items: center; justify-content: space-between; gap: 3px; height: 28px; cursor: pointer; color: var(--k-ink); }
.player-wave i {
  flex: 1; min-width: 2px; max-width: 4px; height: calc(var(--h) * 100%); border-radius: 2px;
  background: currentColor; opacity: 0.22; transform-origin: center; transition: opacity 300ms ease, transform 420ms var(--k-ease);
}
.player-wave i.is-played { opacity: 1; }
/* no live signal: a slow breath while playing */
.player.is-playing:not(.is-live) .player-wave i { animation: player-breathe 1.7s ease-in-out infinite; animation-delay: calc(var(--i) * -110ms); }
@keyframes player-breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.58); } }
/* live: full-height bars scaled every frame by components.js; at rest they settle back to the calm shape */
.player.is-live .player-wave i { height: 100%; transform: scaleY(var(--h)); }
.player.is-live.is-playing .player-wave i { transition: opacity 300ms ease; }
.player-time { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; color: var(--k-ink-3); font-variant-numeric: tabular-nums; }
.player-len:empty::before { content: "\2013"; }
.player.is-unavailable { opacity: 0.6; }
.player.is-unavailable .player-btn { cursor: not-allowed; }
.player.is-unavailable .player-btn:hover { transform: none; }
.player--bare { padding: 0; background: none; border: 0; box-shadow: none; }
@media (max-width: 380px) { .player { padding-inline-end: 14px; gap: 12px; } .player-variants button { padding-inline: 12px; } }

@media (prefers-reduced-motion: reduce) {
  .player.is-playing .player-wave i { animation: none; }
  .player-btn, .player-btn svg, .player-wave i, .lang, .player-variants button { transition: none; }
}
.still .player.is-playing .player-wave i { animation: none; }

/* ── 4. travelling connector ──────────────────────────────────────────
   <div class="k-travel" data-travel data-count="12" data-label="{n} shoppers asked"></div>
   The element is the box the path is drawn in: give it the gap between the panels. It is a row from
   900 px up and a column below; set --travel-dir on it (or a parent) to choose for yourself.
   An ink line that draws itself in, small question bubbles travelling along it, a counter that rides
   with them and settles at the far end, and one soft pulse there when the last one lands. */
.k-travel {
  --travel-dir: column;
  position: relative; display: block; width: 100%; height: 100%;
  min-width: 64px; min-height: 96px;
}
@media (min-width: 900px) { .k-travel { --travel-dir: row; } }
.k-travel-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.k-travel-path { fill: none; stroke: var(--k-ink); stroke-width: 1.75; stroke-linecap: round; opacity: 0.82; }
.k-travel-end { fill: var(--k-paper); stroke: var(--k-ink); stroke-width: 1.5; transition: fill var(--k-slow) var(--k-ease), opacity var(--k-slow) var(--k-ease); }
.k-travel.has-count .k-travel-to { fill: var(--k-ink); }
.k-travel-ring { fill: none; stroke: var(--k-ink); stroke-width: 1.25; opacity: 0; }
.k-travel.is-landed .k-travel-ring { animation: k-travel-ring 1100ms var(--k-ease) 1; }
@keyframes k-travel-ring { from { opacity: 0.45; transform: scale(1); } to { opacity: 0; transform: scale(3.6); } }
/* a question on its way: a paper bubble with an ink edge and an ink question mark */
.k-travel-mark path { fill: var(--k-surface, #fff); stroke: var(--k-ink); stroke-width: 1.25; stroke-linejoin: round; }
.k-travel-mark text {
  fill: var(--k-ink); font-family: var(--k-font); font-size: 11.5px; font-weight: 600;
  text-anchor: middle; dominant-baseline: central; user-select: none;
}
.k-travel-marks.is-small .k-travel-mark > * { transform: scale(0.84); }
.k-travel-count {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -100%);
  width: max-content; font-size: var(--k-small); line-height: 1.3; color: var(--k-ink); text-align: center; text-wrap: balance;
  font-variant-numeric: tabular-nums; white-space: normal; pointer-events: none;
  opacity: 0; transition: opacity var(--k-slow) var(--k-ease);
}
.k-travel[data-dir="column"] .k-travel-count { text-align: start; }
.k-travel.has-count .k-travel-count { opacity: 1; }
/* data-land="<selector>": what the questions land on gives one soft pulse when the last one arrives */
.k-landed { animation: k-landed 1200ms var(--k-ease) 1; }
@keyframes k-landed {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--k-ink) 22%, transparent); }
  100% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--k-ink) 0%, transparent); }
}

/* ── 5. stepper: Back and Next under a stepped piece ──────────────────
   <div class="k-stepper" data-stepper></div> inside a [data-autoplay-view] block; motion.js fills it.
   Two quiet round buttons and a hairline that fills as the story goes. No words, no dots, no numbers. */
.k-stepper { display: flex; align-items: center; justify-content: center; gap: var(--k-4); margin-top: var(--k-5); }
.k-stepper-btn {
  width: 44px; height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--k-line); background: color-mix(in srgb, var(--k-paper) 60%, #fff); color: var(--k-ink-2);
  cursor: pointer; transition: color var(--k-fast) ease, border-color var(--k-fast) ease;
}
.k-stepper-btn svg { width: 18px; height: 18px; }
.k-stepper-btn:hover:not(:disabled) { color: var(--k-ink); border-color: var(--k-ink-3); }
.k-stepper-btn:disabled { opacity: 0.35; cursor: default; }
.k-stepper-track { width: 56px; height: 2px; border-radius: 2px; background: var(--k-line); overflow: hidden; }
.k-stepper-track i { display: block; width: 100%; height: 100%; background: var(--k-ink-2); transform-origin: 0 50%;
  transform: scaleX(var(--p, 0)); transition: transform 600ms var(--k-ease); }
[dir="rtl"] .k-stepper-track i { transform-origin: 100% 50%; }
[dir="rtl"] .k-stepper-btn svg { transform: scaleX(-1); }
@media (prefers-reduced-motion: reduce) {
  .k-travel-end, .k-travel-count, .k-stepper-btn, .k-stepper-track i { transition: none; }
  .k-travel-ring, .k-landed { animation: none !important; }
}
.still .k-travel-end, .still .k-travel-count, .still .k-stepper-track i { transition: none; }

/* MKT-LEADS-001: the shared acquisition dialog, assembled by site.js. Native <dialog> owns focus/Escape. */
.k-lead-dialog {
  width: min(100% - var(--k-6), 32rem); max-height: calc(100dvh - var(--k-6));
  margin: auto; padding: var(--k-6); overflow-y: auto; text-align: start;
  color: var(--k-ink); background: var(--k-surface); border: 1px solid var(--k-line);
  border-radius: var(--k-r-sheet); box-shadow: var(--k-shadow-sheet); font-family: var(--k-font);
}
.k-lead-dialog::backdrop { background: color-mix(in srgb, var(--k-ink) 45%, transparent); }
.k-lead-dialog [hidden] { display: none !important; }
.k-lead-dialog .k-lead-head { display: flex; align-items: start; gap: var(--k-4); margin-bottom: var(--k-4); }
.k-lead-dialog h2 { flex: 1; margin: 0; font-size: var(--k-title); font-weight: var(--k-weight); }
.k-lead-dialog .k-lead-close { min-width: 44px; min-height: 44px; margin: calc(-1 * var(--k-2)); border-radius: var(--k-r-control); font-size: var(--k-title); }
.k-lead-dialog p { color: var(--k-ink-2); font-size: var(--k-small); line-height: var(--k-lead-body); margin: 0 0 var(--k-5); }
.k-lead-dialog fieldset { margin: 0 0 var(--k-5); padding: 0; border: 0; }
.k-lead-dialog legend, .k-lead-dialog .k-lead-label { display: block; margin-bottom: var(--k-2); font-size: var(--k-small); font-weight: var(--k-weight); }
.k-lead-options { display: grid; gap: var(--k-2); }
.k-lead-options label { display: flex; align-items: center; gap: var(--k-3); min-height: 44px; padding: var(--k-3) var(--k-4); border: 1px solid var(--k-line); border-radius: var(--k-r-control); cursor: pointer; }
.k-lead-options label:has(input:checked) { border-color: var(--k-green); background: var(--k-green-tint); }
.k-lead-options input { accent-color: var(--k-green); width: 1rem; height: 1rem; margin: 0; }
.k-lead-dialog input:not([type="radio"]), .k-lead-dialog textarea, .k-lead-dialog select { display: block; width: 100%; min-height: 48px; padding: var(--k-3); margin-bottom: var(--k-4); border: 1px solid var(--k-line); border-radius: var(--k-r-control); color: var(--k-ink); background: var(--k-surface); font: inherit; }
.k-lead-dialog :focus-visible { outline: 2px solid var(--k-green); outline-offset: 3px; }
.k-lead-dialog .button { width: 100%; }
.k-lead-dialog .button:disabled { cursor: wait; opacity: .65; transform: none; }
.k-lead-dialog .k-lead-error { padding: var(--k-3); background: var(--k-paper); border-inline-start: 3px solid var(--k-ink-2); }
.k-lead-dialog .k-lead-note { margin-block: var(--k-4) 0; }
.k-lead-dialog a:not(.button) { color: var(--k-ink); text-underline-offset: .2em; }
@media (max-width: 480px) { .k-lead-dialog { padding: var(--k-5); } }

.k-lead-dialog .start-enterprise label { display: block; margin-bottom: var(--k-2); font-size: var(--k-small); }

