/* ============================================================
   LFT v3 — Voices (problem quotes) + Solution engine gallery
   Loaded after lft-styles-v3.css
   ============================================================ */

/* ================= VOICES ================= */

.voices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
@media (max-width: 860px) { .voices-grid { grid-template-columns: 1fr; } }

.voice { display: flex; flex-direction: column; }
.bubble {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 30px 32px 26px 32px;
  font-size: calc(21px * var(--scale));
  line-height: 1.45;
  color: var(--ink);
  text-wrap: pretty;
}
.bubble::before {
  content: "\201C";
  position: absolute;
  top: 4px;
  left: 14px;
  font-family: var(--head);
  font-size: 54px;
  line-height: 1;
  color: var(--line);
}
.bubble::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 38px;
  width: 13px;
  height: 13px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  transform: rotate(45deg);
}
.voice .who {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 0 24px;
}
.voice .avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(245, 244, 237, 0.18), transparent 45%),
    var(--surface-2);
  border: 1px solid var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink);
  flex-shrink: 0;
}
.voice .role {
  font-family: var(--mono);
  font-size: calc(13px * var(--scale));
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ================= SOLUTIONS GRID ================= */

.sol-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
@media (max-width: 920px) { .sol-grid { grid-template-columns: 1fr; } }
.sol-card h3 { margin-bottom: 10px; }
.sol-card p { font-size: calc(17.5px * var(--scale)); }

/* shared viz stage */
.viz {
  height: 184px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 55%, var(--surface-2));
  margin-bottom: 26px;
  overflow: hidden;
  padding: 16px;
}
.viz-cap {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- 1. CRM update engine ---------- */

.mini-chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
  background: var(--surface);
}
.flow-dash {
  width: 48px;
  height: 1px;
  background-image: linear-gradient(90deg, var(--muted) 55%, transparent 55%);
  background-size: 9px 1px;
}
@media (prefers-reduced-motion: no-preference) {
  html[data-motion="full"] .flow-dash { animation: vzdash 0.9s linear infinite; }
  @keyframes vzdash { to { background-position: 9px 0; } }
}
.mini-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px 16px;
  min-width: 168px;
}
.mp-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 12px;
}
.mp-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.mp-row:last-child { margin-bottom: 0; }
.mp-row .bar {
  width: 104px;
  height: 8px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
  display: block;
}
.mp-row .bar i {
  display: block;
  height: 100%;
  background: var(--muted);
  transform-origin: left;
}
.mp-row .tick {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
}
@media (prefers-reduced-motion: no-preference) {
  html.anim-ready[data-motion="full"] .mp-row .bar i { animation: vzfill 4.6s ease-in-out infinite; }
  html.anim-ready[data-motion="full"] .mp-row .tick { animation: vztick 4.6s ease-in-out infinite; }
  html.anim-ready[data-motion="full"] .mp-row:nth-child(3) .bar i,
  html.anim-ready[data-motion="full"] .mp-row:nth-child(3) .tick { animation-delay: 0.45s; }
  html.anim-ready[data-motion="full"] .mp-row:nth-child(4) .bar i,
  html.anim-ready[data-motion="full"] .mp-row:nth-child(4) .tick { animation-delay: 0.9s; }
  @keyframes vzfill {
    0% { transform: scaleX(0); }
    22% { transform: scaleX(1); }
    88% { transform: scaleX(1); }
    100% { transform: scaleX(0); }
  }
  @keyframes vztick {
    0%, 20% { opacity: 0; }
    30%, 86% { opacity: 1; }
    100% { opacity: 0; }
  }
}

/* ---------- 2. corporate brain (svg) ---------- */

.vz-svg { width: 100%; max-width: 330px; height: auto; display: block; }
.vz-svg .src {
  fill: var(--surface);
  stroke: var(--line);
}
.vz-svg text {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  fill: var(--muted);
}
.vz-svg .t-ink { fill: var(--ink); font-size: 11px; }
.vz-svg .vz-link { stroke: var(--line); stroke-width: 1.2; fill: none; }
.vz-svg .vz-pulse {
  stroke: var(--amber);
  stroke-width: 1.2;
  fill: none;
  stroke-dasharray: 6 70;
}
html[data-amber="strict"] .vz-svg .vz-pulse { stroke: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  html[data-motion="full"] .vz-svg .vz-pulse { animation: dashflow 2.4s linear infinite; }
}
.vz-svg .vz-node { fill: var(--surface); stroke: var(--muted); stroke-width: 1.3; }
.vz-svg .vz-halo {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1;
  opacity: 0.5;
}
@media (prefers-reduced-motion: no-preference) {
  html[data-motion="full"] .vz-svg .vz-halo {
    animation: vzhalo 2.6s ease-out infinite;
    transform-origin: 165px 66px;
    transform-box: view-box;
  }
  @keyframes vzhalo {
    0% { transform: scale(0.78); opacity: 0.7; }
    85% { transform: scale(1.25); opacity: 0; }
    100% { transform: scale(1.25); opacity: 0; }
  }
}
.vz-svg .caret-line { stroke: var(--ink); stroke-width: 1.4; }
@media (prefers-reduced-motion: no-preference) {
  html[data-motion="full"] .vz-svg .caret-line { animation: caretblink 1.1s steps(1) infinite; }
}

/* ---------- 3. outreach pipeline ---------- */

.viz-reach { position: relative; gap: 0; justify-content: space-between; padding: 16px 26px; }
.reach-track {
  position: absolute;
  left: 40px;
  right: 40px;
  top: calc(50% - 13px);
  height: 1px;
  background: var(--line);
}
.reach-runner {
  position: absolute;
  top: calc(50% - 16px);
  left: 7%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  opacity: 0;
}
html[data-amber="strict"] .reach-runner { background: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  html[data-motion="full"] .reach-runner { animation: vzrun 5s linear infinite; }
  @keyframes vzrun {
    0% { left: 7%; opacity: 0; }
    6% { opacity: 1; }
    94% { opacity: 1; }
    100% { left: 88%; opacity: 0; }
  }
}
.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
  width: 70px;
}
.stage span {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
  max-width: 70px;
}
.s-ic {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  position: relative;
}
.s-people i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  background: var(--surface-2);
  margin-left: -5px;
}
.s-people i:first-child { margin-left: 0; }
.s-doc { flex-direction: column; gap: 3px; }
.s-doc i { width: 18px; height: 2px; background: var(--muted); display: block; border-radius: 1px; }
.s-doc i:last-child { width: 12px; }
.s-seq { flex-direction: column; gap: 3px; }
.s-seq i {
  width: 20px;
  height: 6px;
  border: 1px solid var(--muted);
  border-radius: 2px;
  display: block;
}
.s-gate { border-color: var(--amber); color: var(--amber); }
html[data-amber="strict"] .s-gate { border-color: var(--muted); color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  html[data-motion="full"] .s-gate::after {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 1px solid var(--amber);
    animation: vzgatep 2.4s ease-out infinite;
  }
  html[data-amber="strict"] .s-gate::after { border-color: var(--muted); }
  @keyframes vzgatep {
    0% { transform: scale(0.8); opacity: 0.8; }
    80%, 100% { transform: scale(1.35); opacity: 0; }
  }
}

/* ---------- 4. proposal page ---------- */

.doc-page {
  position: relative;
  width: 122px;
  height: 148px;
  background: var(--ink);
  border-radius: 4px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}
.doc-page::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-style: solid;
  border-width: 0 16px 16px 0;
  border-color: transparent var(--surface-2) transparent transparent;
}
.doc-page .dl {
  display: block;
  height: 6px;
  border-radius: 2px;
  background: #0D1B2E;
  opacity: 0.82;
  transform-origin: left;
  width: 100%;
}
.doc-page .dl.t { height: 10px; width: 70%; margin-bottom: 4px; }
.doc-page .dl.short { width: 55%; }
@media (prefers-reduced-motion: no-preference) {
  html.anim-ready[data-motion="full"] .doc-page .dl { animation: vzwrite 5.2s ease-in-out infinite; }
  html.anim-ready[data-motion="full"] .doc-page .dl:nth-child(2) { animation-delay: 0.35s; }
  html.anim-ready[data-motion="full"] .doc-page .dl:nth-child(3) { animation-delay: 0.7s; }
  html.anim-ready[data-motion="full"] .doc-page .dl:nth-child(4) { animation-delay: 1.05s; }
  html.anim-ready[data-motion="full"] .doc-page .dl:nth-child(5) { animation-delay: 1.4s; }
  @keyframes vzwrite {
    0% { transform: scaleX(0); }
    18% { transform: scaleX(1); }
    90% { transform: scaleX(1); }
    100% { transform: scaleX(0); }
  }
}
.doc-badge {
  position: absolute;
  bottom: -11px;
  right: -16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--amber);
  border: 1px solid var(--amber);
  background: var(--bg);
  border-radius: 4px;
  padding: 4px 9px;
}
html[data-amber="strict"] .doc-badge { color: var(--muted); border-color: var(--muted); }
.doc-side {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 120px;
  line-height: 1.8;
}

/* ---------- 5. funnel + stall ---------- */

.viz-funnel { align-items: flex-end; gap: 22px; padding-bottom: 34px; position: relative; }
.fbar {
  width: 38px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  height: calc(var(--h) * 118px);
  transform-origin: bottom;
}
@media (prefers-reduced-motion: no-preference) {
  html.anim-ready .reveal.is-in .fbar { animation: vzgrow 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  html.anim-ready .reveal.is-in .fbar:nth-child(2) { animation-delay: 0.12s; }
  html.anim-ready .reveal.is-in .fbar:nth-child(3) { animation-delay: 0.24s; }
  html.anim-ready .reveal.is-in .fbar:nth-child(4) { animation-delay: 0.36s; }
  @keyframes vzgrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
}
.stall {
  position: absolute;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.stall .ring {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px dashed var(--amber);
}
html[data-amber="strict"] .stall .ring { border-color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  html[data-motion="full"] .stall .ring { animation: vzstall 2s ease-in-out infinite; }
  @keyframes vzstall {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.6; }
  }
}
.stall .lab {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
}
html[data-amber="strict"] .stall .lab { color: var(--muted); }
.funnel-axis {
  position: absolute;
  bottom: 18px;
  left: 26px;
  right: 26px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- 6. warehouse terminal ---------- */

.viz-term { padding: 22px 24px; }
.term {
  width: 100%;
  font-family: var(--mono);
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.term .t-head {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.term .q { display: flex; gap: 8px; color: var(--ink); }
.term .q .prompt { color: var(--muted); }
.term .q .type { white-space: nowrap; overflow: hidden; }
.term .a { color: var(--amber); }
html[data-amber="strict"] .term .a { color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  /* hidden start states are opt-in: only when anim-ready confirms animations run */
  html.anim-ready[data-motion="full"] .term .q .type {
    width: 0;
    animation: vztype 7s steps(46) infinite;
  }
  html.anim-ready[data-motion="full"] .term .a { opacity: 0; animation: vzans 7s ease infinite; }
  @keyframes vztype {
    0%, 4% { width: 0; }
    52% { width: 100%; }
    100% { width: 100%; }
  }
  @keyframes vzans {
    0%, 60% { opacity: 0; }
    66%, 96% { opacity: 1; }
    100% { opacity: 0; }
  }
}
@media (max-width: 1180px) {
  .term { font-size: 10.5px; }
}
@media (max-width: 560px) {
  .term .q .type {
    animation: none !important;
    width: auto !important;
    white-space: normal;
  }
  .term .a { animation: none !important; opacity: 1 !important; }
}

/* ---------- calm-mode kill switch for all viz loops ---------- */
html[data-motion="calm"] .viz *,
html[data-motion="calm"] .viz *::before,
html[data-motion="calm"] .viz *::after {
  animation: none !important;
}
html[data-motion="calm"] .reach-runner { opacity: 0; }
html[data-motion="calm"] .term .q .type { width: auto; }
