/* SL-43 Wave 2: the stage (views/wrpm/_hero-stage.ejs). A white card that
   sits on the dark intake and on the navy landing hero. Motion runs on
   transform and opacity only (web.dev top-cwv); timings follow the Material
   motion tokens: 150-200 ms for a cell flip, 300-400 ms emphasized
   decelerate for an entry, 500-600 ms for the stamp. Inserted rows enter
   through @starting-style. Reduced motion shows the final frame, no motion. */

.stg {
  --stg-ink: #0E1A2F;
  --stg-muted: #4B5870;
  --stg-line: #DCE3F3;
  --stg-tint: #F2F5FC;
  --stg-gold: #E4B33C;
  --stg-silver: #C6CAD3;
  --stg-bronze: #B5835A;
  --stg-red: #C2402A;
  --stg-green: #22A06B;
  --stg-empty: #E9EDF5;
  --stg-cols: 5;
  position: relative;
  box-sizing: border-box;
  background: #FFFFFF;
  color: var(--stg-ink);
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  font-family: 'Plus Jakarta Sans', -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.35;
  overflow: hidden;
  contain: layout paint;
}
.stg * { box-sizing: border-box; }
.stg p { margin: 0; }

.stg-label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--stg-muted); }
.stg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 8px; }
.stg-biz { font-size: 15px; font-weight: 800; min-width: 0; }
.stg-biz b { font-weight: 800; }
.stg-market { display: block; font-size: 12px; font-weight: 500; color: var(--stg-muted); }
.stg-count { flex: none; font-size: 12px; color: var(--stg-muted); font-variant-numeric: tabular-nums; }
.stg-count b { font-size: 18px; color: var(--stg-ink); font-weight: 800; }

/* Persona chips: ten dark, each lifts as its kind is asked. */
.stg-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; min-height: 22px; }
.stg-chip {
  display: inline-block;
  font-size: 10.5px;
  line-height: 1.2;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--stg-line);
  color: var(--stg-muted);
  background: var(--stg-tint);
  opacity: 0.55;
  transform: translateY(0);
  transition: transform 300ms cubic-bezier(0.05, 0.7, 0.1, 1), opacity 300ms cubic-bezier(0.05, 0.7, 0.1, 1);
}
.stg-chip.is-lit { opacity: 1; transform: translateY(-2px); color: var(--stg-ink); border-color: var(--stg-ink); background: #FFFFFF; font-weight: 700; }

/* The question as it types. */
.stg-q { margin-top: 12px; min-height: 2.7em; font-size: 15px; font-weight: 700; color: var(--stg-ink); }
.stg-q:not(:empty)::after { content: ''; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--stg-ink); animation: stgCaret 900ms steps(2, end) infinite; }
.stg.is-done .stg-q::after { animation: none; opacity: 0; }

/* Five lanes: the AI name as text, then dots, then the first place named. */
.stg-lanes { display: grid; grid-template-columns: repeat(var(--stg-cols), minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.stg-lane { min-width: 0; border: 1px solid var(--stg-line); border-radius: 10px; padding: 7px 8px; background: #FFFFFF; min-height: 58px; }
.stg-lane-k { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--stg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .stg-lane-k { font-size: 9px; letter-spacing: 0; } .stg-lane { padding: 6px 6px; } }
.stg-lane-a { display: block; margin-top: 4px; font-size: 12px; font-weight: 700; line-height: 1.25; color: var(--stg-ink); overflow-wrap: anywhere; opacity: 1; transform: translateY(0); transition: opacity 350ms cubic-bezier(0.05, 0.7, 0.1, 1), transform 350ms cubic-bezier(0.05, 0.7, 0.1, 1); }
@starting-style {
  .stg-lane-a { opacity: 0; transform: translateY(6px); }
}
.stg-lane-a.is-g, .stg-lane-a.is-gk, .stg-lane-a.is-ok { color: #8A6410; }
.stg-lane-a.is-x, .stg-lane-a.is-xb, .stg-lane-a.is-xbc, .stg-lane-a.is-xbk { color: var(--stg-red); }
.stg-lane-a.is-n { color: var(--stg-muted); font-weight: 500; }
.stg-lane.is-typing .stg-lane-a::before { content: '\2022\2022\2022'; letter-spacing: 2px; color: var(--stg-muted); animation: stgDots 900ms ease-in-out infinite; display: inline-block; }

/* The 25 by 5 grid: one square each, flipped as the answers land. */
.stg-grid { display: grid; grid-template-columns: repeat(var(--stg-cols), minmax(0, 1fr)); gap: 3px; margin-top: 12px; }
.stg-cell { display: block; height: 7px; border-radius: 2px; background: var(--stg-empty); transform: scale(1); }
.stg-cell.is-on { animation: stgFlip 180ms cubic-bezier(0.2, 0, 0, 1) both; }
.stg-cell.is-g, .stg-cell.is-gk { background: var(--stg-gold); }
.stg-cell.is-s { background: var(--stg-silver); }
.stg-cell.is-b { background: var(--stg-bronze); }
.stg-cell.is-x, .stg-cell.is-xb, .stg-cell.is-xbc, .stg-cell.is-xbk { background: var(--stg-red); }
.stg-cell.is-ok { background: var(--stg-green); }
.stg-cell.is-n { background: #CBD2E0; }

/* The gap line, the wrong-fact card (red, no AI name, no logo), the stamp. */
.stg-gap { margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--stg-ink); opacity: 1; transform: translateY(0); transition: opacity 350ms cubic-bezier(0.05, 0.7, 0.1, 1), transform 350ms cubic-bezier(0.05, 0.7, 0.1, 1); }
.stg-wrong { margin-top: 10px; border-radius: 10px; background: #FBE9E5; border: 1px solid #F1B9AE; color: #7A1F10; padding: 9px 11px; font-size: 12.5px; line-height: 1.4; opacity: 1; transform: translateY(0); transition: opacity 350ms cubic-bezier(0.05, 0.7, 0.1, 1), transform 350ms cubic-bezier(0.05, 0.7, 0.1, 1); }
.stg-wrong-k { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stg-red); margin-right: 4px; }
@starting-style {
  .stg-gap, .stg-wrong { opacity: 0; transform: translateY(8px); }
}
.stg-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; min-height: 40px; }
.stg-stamp { display: inline-block; border: 2px solid var(--stg-red); color: var(--stg-red); border-radius: 8px; padding: 4px 10px; font-size: 15px; font-weight: 800; letter-spacing: 0.02em; transform: rotate(-3deg) scale(1); animation: stgStamp 600ms cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.stg-replay { margin-left: auto; border: 1px solid var(--stg-line); background: #FFFFFF; color: var(--stg-ink); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transform: scale(1); transition: transform 120ms ease; }
.stg-replay:hover { border-color: var(--stg-ink); }
.stg-replay:active { transform: scale(0.97); }
.stg [hidden] { display: none; }

@keyframes stgFlip { 0% { transform: scale(0.4); opacity: 0.4; } 60% { transform: scale(1.25); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes stgStamp { 0% { transform: rotate(-3deg) scale(0.4); opacity: 0; } 100% { transform: rotate(-3deg) scale(1); opacity: 1; } }
@keyframes stgDots { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes stgCaret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes stgPulse { 0% { transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }

/* ---------- the landing hero around the stage (altimeter host) ---------- */
.wrpm-hero--stage .wrpm-stage-main { box-sizing: border-box; padding: 24px 16px 36px; display: flex; flex-direction: column; gap: 26px; }
.wrpm-stage-copy { display: flex; flex-direction: column; gap: 16px; color: #FFFFFF; }
.wrpm-stage-copy h1 { font-size: clamp(32px, 8.5vw, 42px); }
.wrpm-stage-copy .wrpm-lede { color: #C9D2EA; font-size: 17px; line-height: 1.6; }
.wrpm-stage-greet { font-size: 14px; font-weight: 700; color: #F5A623; }
.wrpm-form--stage { width: 100%; max-width: 520px; }
/* Two fields on the first screen: the Other box opens only when Other is picked by hand. */
.wrpm-form--stage [data-industry-other][hidden] { display: none; }
.wrpm-form--stage button[type="submit"] { transform: scale(1); transition: transform 120ms ease; }
.wrpm-form--stage button[type="submit"]:active { transform: scale(0.97); }
.wrpm-form--stage button[type="submit"].is-pulse { animation: stgPulse 600ms cubic-bezier(0.2, 0, 0, 1) 1; }
.wrpm-stage-under { margin-top: 10px; font-size: 13.5px; line-height: 1.5; color: #4B5870; }
.wrpm-stage-chips { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.wrpm-stage-chips li { font-size: 12px; font-weight: 700; color: #0E1A2F; background: #F2F5FC; border: 1px solid #DCE3F3; border-radius: 999px; padding: 5px 10px; }
/* The proof strip: one sourced line per pack under the chips (SL-43 Wave 8). */
.wrpm-stage-proof { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wrpm-stage-proof li { font-size: 13px; line-height: 1.5; color: #4B5870; }
.wrpm-stage-proof li[hidden] { display: none; }
.wrpm-stage-cite { color: #6B7891; font-size: 12px; }
.wrpm-stage-side { min-width: 0; }
.stg--hero { box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); }

/* The contact line that stays on screen at every width. It reads the brand's
   number; it has no deadline (the SMASH banner has its own). */
.wrpm-contact {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 14px;
  padding: 10px 16px;
  background: #0A1428;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
body.wrpm:has(.wrpm-contact) { padding-bottom: 64px; }
body.wrpm .wrpm-contact a { color: #F5A623; text-decoration: underline; text-underline-offset: 3px; }
body.wrpm .wrpm-contact .wrpm-contact-cta { text-decoration: none; background: #F5A623; color: #0A1428; border-radius: 999px; padding: 5px 12px; }

@media (min-width: 880px) {
  .wrpm-hero--stage .wrpm-stage-main { flex-direction: row; align-items: flex-start; gap: 40px; padding: 40px clamp(24px, 6vw, 120px) 56px; }
  .wrpm-stage-copy { flex: 1 1 0; min-width: 0; }
  .wrpm-stage-copy h1 { font-size: clamp(40px, 4vw, 56px); }
  .wrpm-stage-side { flex: 1 1 0; position: sticky; top: 16px; }
  body.wrpm:has(.wrpm-contact) { padding-bottom: 48px; }
}

/* The intake's side column keeps its width; the stage fills it. */
.av3-side .stg { box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5); }

@media (prefers-reduced-motion: reduce) {
  .stg *, .stg, .wrpm-form--stage button[type="submit"] { animation: none !important; transition: none !important; }
  .stg-q::after { display: none; }
}

/* SL-44 wave 5 step 2: the bank hero form and contact bar (AIV_LANDING_V2).
   Every rule is scoped to .wrpm-v2, so the page with the flag off is unchanged.
   City and State stay on one row at 390; State is 5 ch wide. */
.wrpm-v2 .wrpm-v2-place { grid-template-columns: minmax(0, 1fr) auto; }
.wrpm-v2 .wrpm-v2-state input { width: calc(5ch + 30px); }
.wrpm-v2 .wrpm-v2-help { margin: -6px 0 0; font-size: 13px; line-height: 1.5; color: #4B5870; }
/* The contact bar after the bank hero: each link is a 44 px target. */
.wrpm-v2 ~ .wrpm-contact a { display: inline-flex; align-items: center; min-height: 44px; }
body.wrpm .wrpm-v2 ~ .wrpm-contact .wrpm-contact-cta { padding: 0 16px; }
body.wrpm:has(.wrpm-v2 ~ .wrpm-contact) { padding-bottom: 124px; }
@media (min-width: 880px) {
  body.wrpm:has(.wrpm-v2 ~ .wrpm-contact) { padding-bottom: 72px; }
}
.wrpm-v2 .stg-replay { min-height: 44px; }

/* SL-44 wave 5 step 3 (D11): the bank sample cells carry a glyph or a word
   (data-word, set by the player only when the sample has cellWords), so
   colour is never the only signal. The kind colours copy the wave 3 race
   (aiv-race-v2.css .rv-cell[data-kind]); on this white card the light ink
   and the muted grey take the card's own ink and muted tokens. A cell
   without data-word keeps its 7 px bar. */
.stg-cell[data-word] {
  display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  min-width: 28px; height: auto; min-height: 20px; border-radius: 5px; border: 1px solid transparent;
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace; font-style: normal; font-size: 11px; font-weight: 600; line-height: 1;
  color: var(--stg-muted); white-space: nowrap; overflow: hidden;
}
.stg-cell[data-word].is-on { background: #FFFFFF; border-color: var(--stg-line); }
.stg-cell[data-word].is-first, .stg-cell[data-word].is-ok { background: #8E9CFF; border-color: #8E9CFF; color: #0A1428; }
.stg-cell[data-word].is-second { background: #FFFFFF; border-color: #8E9CFF; color: var(--stg-ink); }
.stg-cell[data-word].is-notyou, .stg-cell[data-word].is-xb, .stg-cell[data-word].is-xbc, .stg-cell[data-word].is-xbk { background: #2A1E0A; border-color: #9C6B17; color: #F5A623; }
.stg-cell[data-word].is-nobank, .stg-cell[data-word].is-n { background: #FFFFFF; border-color: var(--stg-line); color: var(--stg-muted); }
.stg-cell[data-word].is-late, .stg-cell[data-word].is-waiting { background: #FFFFFF; border-color: var(--stg-muted); border-style: dashed; color: var(--stg-muted); }
/* The key under the bank grid: one line per glyph. */
.stg-key { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; line-height: 1.4; color: var(--stg-muted); }
.stg-key li { display: inline-flex; align-items: center; gap: 5px; }
.stg-key b { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-width: 28px; height: 20px; padding: 0 4px; border-radius: 5px; border: 1px solid var(--stg-line); font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace; font-size: 11px; font-weight: 600; color: var(--stg-muted); }
.stg-key b[data-kind="first"] { background: #8E9CFF; border-color: #8E9CFF; color: #0A1428; }
.stg-key b[data-kind="second"] { border-color: #8E9CFF; color: var(--stg-ink); }
.stg-key b[data-kind="notyou"] { background: #2A1E0A; border-color: #9C6B17; color: #F5A623; }
.stg-key b[data-kind="late"] { border-style: dashed; border-color: var(--stg-muted); }
