/* ============================================================
   MITHRA 2026 — Home page improvements (Attio-audit pass)
   Editorial spine · animated product moments · scale band ·
   pull-quotes · capability strip · perf
   Depends on: mithra.css, home.css, product-ui.css
   ============================================================ */

/* ---------- Chapter eyebrow (numbered editorial spine) ---------- */
.chapter-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  font-size: 13px; font-weight: 500; letter-spacing: .02em;
  color: var(--slate);
}
.chapter-eyebrow .ce-num {
  font-weight: 600; color: var(--really-blue);
  border: 1px solid var(--soft-border); border-radius: 7px;
  padding: 3px 9px; line-height: 1; background: var(--off-white);
}
.chapter-eyebrow .ce-rule { width: 26px; height: 2px; background: var(--cool-water); border-radius: 2px; }
.chapter-eyebrow.on-dark { color: rgba(255,255,255,.66); }
.chapter-eyebrow.on-dark .ce-num { color: var(--clear-sky); background: rgba(120,169,255,.12); border-color: rgba(120,169,255,.28); }
.chapter-eyebrow.on-dark .ce-rule { background: var(--clear-sky); }

/* a small "live" badge for product panels */
.live-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--green); margin-left: auto;
}
.live-badge .lb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(36,161,72,.5); animation: lbPulse 1.8s var(--ease) infinite; }
@keyframes lbPulse { 0%{ box-shadow: 0 0 0 0 rgba(36,161,72,.45);} 70%{ box-shadow: 0 0 0 7px rgba(36,161,72,0);} 100%{ box-shadow: 0 0 0 0 rgba(36,161,72,0);} }
@media (prefers-reduced-motion: reduce){ .live-badge .lb-dot { animation: none; } }

/* ---------- Chapter layout (text column + product panel) ---------- */
.chapter { display: grid; grid-template-columns: 0.92fr 1.08fr; gap: clamp(36px,5vw,72px); align-items: center; }
.chapter.flip .chapter-copy { order: 2; }
.chapter.flip .chapter-visual { order: 1; }
@media (max-width: 960px){ .chapter { grid-template-columns: 1fr; gap: 40px; } .chapter.flip .chapter-copy, .chapter.flip .chapter-visual { order: initial; } }
.chapter-copy .agent-id { margin-top: 22px; }
.chapter-copy .h2 { margin-top: 18px; }
.chapter-copy .lede { margin-top: 16px; }

/* compact agent roster used inside a chapter (2-col, profile rows) */
.roster-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 36px; margin-top: 26px; }
@media (max-width: 540px){ .roster-2 { grid-template-columns: 1fr; } }
.roster-2 .sub-agent { padding: 14px 0; align-items: flex-start; }
.roster-2 .sub-orb { margin-top: 1px; }

/* ---------- Pull-quote (woven into chapters) ---------- */
.pull-quote {
  margin: 28px 0 0; padding: 18px 22px; border-left: 3px solid var(--cool-water);
  background: var(--off-white); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.bg-offwhite .pull-quote { background: #fff; }
.pull-quote blockquote { margin: 0; font-family: var(--font-head); font-weight: 500; font-size: 17px; line-height: 1.45; color: var(--ink); letter-spacing: -.01em; }
.pull-quote figcaption { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--slate); }
.pull-quote figcaption img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.pull-quote figcaption b { font-family: var(--font-head); color: var(--ink); font-weight: 600; }

/* ---------- Product panel chrome (shared) ---------- */
.prod-panel { box-shadow: var(--shadow-lg); }
.prod-panel .pp-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 18px;
  border-bottom: 1px solid #eef2f8; background: #fff;
}
.prod-panel .pp-title { font-family: var(--font-head); font-weight: 600; font-size: 14px; color: #1f2733; }
.prod-panel .pp-sub { font-size: 12px; color: var(--slate); }

/* ---------- Atlas: live classification table ---------- */
.atlas-classify .tbl-cat tbody td { vertical-align: middle; }
.cl-cat { min-width: 188px; }
.cl-spin { display: none; align-items: center; gap: 9px; color: var(--slate); font-size: 12.5px; font-style: italic; }
.cl-spin::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--soft-border); border-top-color: var(--really-blue);
  animation: clSpin .7s linear infinite; flex: 0 0 auto;
}
@keyframes clSpin { to { transform: rotate(360deg); } }
.cl-result { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* during animation: rows not yet classified show the spinner */
.atlas-classify.anim-pending .clr:not(.classified) .cl-result { display: none; }
.atlas-classify.anim-pending .clr:not(.classified) .cl-spin { display: inline-flex; }
.atlas-classify.anim-pending .clr:not(.classified) { opacity: .55; }
.atlas-classify .clr { transition: opacity .4s var(--ease); }
.clr.classified .cl-result { animation: clPop .45s var(--ease); }
@keyframes clPop { from { opacity: 0; transform: translateY(5px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce){ .clr.classified .cl-result { animation: none; } }
.atlas-foot { display: flex; align-items: center; gap: 9px; padding: 14px 18px; border-top: 1px solid #eef2f8; font-size: 12.5px; color: var(--slate); }
.atlas-foot .ic { width: 16px; height: 16px; color: var(--green); flex: 0 0 auto; }
.atlas-foot b { color: var(--really-blue); font-family: var(--font-head); }

/* ---------- Pulse: ranked opportunities populate ---------- */
.pulse-opps .opp-rr { transition: opacity .55s var(--ease), transform .55s var(--ease); }
.pulse-opps.anim-pending .opp-rr { opacity: 0; transform: translateY(12px); }
.pulse-opps .opp-rr.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){ .pulse-opps.anim-pending .opp-rr { opacity: 1; transform: none; } }
.opp-rank-hd .orh-val .ohv-sub { font-size: 13px; color: var(--slate); font-weight: 500; margin-left: 6px; letter-spacing: 0; }

/* ---------- Data-flow strip: staggered build ---------- */
#flowStrip.flow-anim .flow-step { opacity: 0; transform: translateY(16px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
#flowStrip.flow-anim .flow-step.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){ #flowStrip.flow-anim .flow-step { opacity: 1 !important; transform: none !important; } }

/* ---------- Capability strip (replaces heavy use-case grid) ---------- */
.cap-strip { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 34px; }
.cap-strip a {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  padding: 11px 18px; border: 1px solid var(--soft-border); border-radius: var(--radius-pill);
  background: #fff; transition: border-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.cap-strip a .ic { width: 17px; height: 17px; color: var(--cool-water); transition: color .18s; }
.cap-strip a:hover { border-color: var(--cool-water); color: var(--really-blue); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.cap-strip a:hover .ic { color: var(--really-blue); }

/* ---------- Scale / trust metrics band (in dark enterprise section) ---------- */
.scale-band {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0; margin-left: auto; margin-right: auto;
  border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius-lg);
  background: rgba(255,255,255,.03); overflow: hidden;
}
.scale-cell { padding: 30px 24px; text-align: center; position: relative; }
.scale-cell + .scale-cell::before { content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 1px; background: rgba(255,255,255,.13); }
.scale-num { font-family: var(--font-head); font-weight: 700; font-size: clamp(34px,3.6vw,46px); line-height: 1; letter-spacing: -.03em; color: var(--clear-sky); display: block; }
.scale-cap { display: block; margin-top: 12px; font-size: 13.5px; line-height: 1.4; color: rgba(255,255,255,.72); max-width: 210px; margin-left: auto; margin-right: auto; }
@media (max-width: 760px){
  .scale-band { grid-template-columns: 1fr 1fr; }
  .scale-cell:nth-child(odd)::before { display: none; }
  .scale-cell:nth-child(n+3)::after { content: ""; position: absolute; left: 22px; right: 22px; top: 0; height: 1px; background: rgba(255,255,255,.13); }
}

/* ---------- Hero: secondary (lighter friction) CTA line ---------- */
.hero-2nd { margin-top: 18px; font-size: 15px; color: rgba(255,255,255,.7); max-width: 480px; }
.hero-2nd a { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.4); padding-bottom: 1px; transition: border-color .18s; }
.hero-2nd a:hover { border-color: #fff; }
.hero-2nd a .ic { width: 15px; height: 15px; }

/* ---------- Atlas hero: before → after resolution ---------- */
.ba.anim-resolve .ba-mid, .ba.anim-resolve .ba-after { transition: opacity .6s var(--ease), transform .6s var(--ease); }
.ba.anim-resolve.anim-pending .ba-mid { opacity: 0; }
.ba.anim-resolve.anim-pending .ba-after { opacity: 0; transform: translateX(16px); }
.ba.anim-resolve.resolved .ba-mid { opacity: 1; }
.ba.anim-resolve.resolved .ba-after { opacity: 1; transform: none; }
.ba.anim-resolve.anim-pending .ba-mid .ic svg { animation: baSpin 1s linear infinite; }
@keyframes baSpin { to { transform: rotate(450deg); } }
@media (prefers-reduced-motion: reduce){
  .ba.anim-resolve.anim-pending .ba-mid, .ba.anim-resolve.anim-pending .ba-after { opacity: 1; transform: none; }
  .ba.anim-resolve.anim-pending .ba-mid .ic svg { animation: none; }
}

/* ---------- Pulse hero: opportunity card populate ---------- */
.opp-card-anim .opp-row, .opp-card-anim .opp-actions { transition: opacity .5s var(--ease), transform .5s var(--ease); }
.opp-card-anim.anim-pending .opp-row, .opp-card-anim.anim-pending .opp-actions { opacity: 0; transform: translateY(10px); }
.opp-card-anim .opp-row.in, .opp-card-anim .opp-actions.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){
  .opp-card-anim.anim-pending .opp-row, .opp-card-anim.anim-pending .opp-actions { opacity: 1; transform: none; }
}

/* ---------- Treemap: spend cells tile in ---------- */
.tm-anim .tm-cell { transition: opacity .5s var(--ease), transform .5s var(--ease); }
.tm-anim.anim-pending .tm-cell { opacity: 0; transform: scale(.94); }
.tm-anim .tm-cell.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){ .tm-anim.anim-pending .tm-cell { opacity: 1; transform: none; } }

/* ---------- Review queue: items arrive one by one ---------- */
.revq-anim .rev-item { transition: opacity .5s var(--ease), transform .5s var(--ease); }
.revq-anim.anim-pending .rev-item { opacity: 0; transform: translateY(12px); }
.revq-anim .rev-item.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){ .revq-anim.anim-pending .rev-item { opacity: 1; transform: none; } }

/* ---------- Generic: stagger a container's direct children ---------- */
.pop-seq > * { transition: opacity .5s var(--ease), transform .5s var(--ease); }
.pop-seq.anim-pending > * { opacity: 0; transform: translateY(10px); }
.pop-seq.anim-pending > .pop-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){ .pop-seq.anim-pending > * { opacity: 1; transform: none; } }

/* ---------- Hero: pause expensive ink when off-screen ---------- */
.hero.fx-paused .hero-ink, .hero.fx-paused .hero-ink--fine { animation-play-state: paused; }
