/* Homepage: one request followed end to end, then the industry index. */

.flow-showcase { scroll-margin-top: 5rem; }
.showcase-intro { margin-bottom: 1.5rem; }
.showcase-intro h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); line-height: 1.2; margin: 0 0 0.6rem; max-width: 24ch; }
.showcase-intro > p { color: var(--mist); margin: 0; }

.flow { border: 1px solid #2a3f57; border-radius: 18px; overflow: hidden; overflow: clip; background: linear-gradient(160deg, #0b1522, #08111a); box-shadow: 0 30px 80px -40px #000; }
.flow-tabs { display: none; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #0c1826; border-bottom: 1px solid #2a3f57; }
.flow-ready .flow-tabs { display: grid; }
.flow-tabs button { min-width: 0; padding: 1rem 0.6rem; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--mist); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.flow-tabs button + button { border-left: 1px solid var(--line); }
.flow-tabs button:hover { color: var(--frost); background: #132437; }
.flow-tabs button[aria-selected="true"] { color: var(--ice); background: linear-gradient(0deg, #17405b55, transparent); border-bottom-color: var(--ice); }
.flow-tabs button:focus-visible { outline-offset: -5px; }
.flow-panel[hidden] { display: none; }
.flow-panel + .flow-panel { border-top: 1px solid #2a3f57; }
.flow-ready .flow-panel + .flow-panel { border-top: 0; }

.flow-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 1.5rem; padding: 1.5rem 1.75rem 1rem; }
.flow-business { margin: 0 0 0.3rem; font-size: 0.9rem; color: var(--mist); }
.flow-head h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); margin: 0; }
.flow-badge { margin: 0; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel); }
.flow-time { font-size: 0.8rem; color: var(--steel); font-variant-numeric: tabular-nums; white-space: nowrap; }
.flow-trigger { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; align-items: center; margin: 0 1.75rem; padding: 0.9rem 1.1rem; border: 1px solid #2c435c; border-radius: 12px; background: #0e1b2b; }
.flow-trigger .flow-time { color: var(--ice); font-weight: 600; font-size: 0.9rem; }
.flow-channel { margin: 0 0 0.2rem; font-size: 0.85rem; color: var(--mist); }
.flow-quote { margin: 0; font-size: 1.15rem; color: var(--frost); line-height: 1.45; }

.flow-body { display: grid; gap: 1.75rem 2rem; padding: 1.5rem 1.75rem 1.6rem; }
@media (min-width: 60rem) { .flow-body { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } .flow-side { position: sticky; top: 5rem; align-self: start; } }
.flow-steps { list-style: none; margin: 0; padding: 0; }
.flow-step { --kind: var(--ice); display: grid; grid-template-columns: 2.4rem 1rem minmax(0, 1fr); column-gap: 0.75rem; position: relative; margin: 0; padding-bottom: 1.15rem; }
.flow-step:last-child { padding-bottom: 0; }
.flow-step > .flow-time { text-align: right; padding-top: 0.12rem; }
.flow-step:not(:last-child)::before { content: ""; position: absolute; left: calc(3.65rem - 1px); top: 0.9rem; bottom: -0.3rem; width: 2px; background: #22354b; }
.flow-node { width: 0.8rem; height: 0.8rem; border-radius: 50%; border: 2px solid var(--kind); background: var(--night); margin-top: 0.28rem; justify-self: center; position: relative; z-index: 1; }
.kind-lookup { --kind: #93a6ba; }
.kind-human { --kind: #f0c674; }
.kind-action { --kind: #62d6c2; }
.flow-kind { display: block; margin: 0 0 0.12rem; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--kind); }
.flow-text summary { list-style: none; cursor: pointer; }
.flow-text summary::-webkit-details-marker { display: none; }
.flow-text h4 { display: inline; margin: 0; font-family: var(--font-body); font-size: 1.1rem; font-weight: 600; line-height: 1.35; color: var(--frost); }
.flow-text h4::after { content: "+"; margin-left: 0.5rem; color: var(--steel); font-weight: 400; }
.flow-text[open] h4::after { content: "\2212"; }
.flow-text summary:hover h4::after { color: var(--ice); }
.flow-text > p { margin: 0.3rem 0 0; font-size: 0.95rem; line-height: 1.55; color: var(--mist); }
.flow-text > .flow-systems { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.flow-systems span { font-size: 0.78rem; line-height: 1.5; border: 1px solid #2c435c; border-radius: 6px; padding: 0 0.45rem; color: #c5d4e2; background: #101f30; }
.kind-human .flow-text { border: 1px solid #f0c67455; background: #f0c6740d; border-radius: 10px; padding: 0.6rem 0.8rem; }
.kind-human .flow-node { background: #f0c674; }

.flow-side { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.approval-card { border: 1px solid #33506b; border-radius: 16px; background: #0a1420; padding: 1.1rem 1.15rem; box-shadow: 0 18px 40px -24px #000; }
.approval-state { margin: 0; }
.approval-state span { display: inline-block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.2rem 0.6rem; border-radius: 999px; }
.state-pending { color: #f0c674; background: #f0c6741a; border: 1px solid #f0c67455; }
.approval-state .state-done { display: none; color: #62d6c2; background: #62d6c21a; border: 1px solid #62d6c255; }
.approval-title { margin: 0.75rem 0 0.1rem; font-weight: 600; font-size: 1.15rem; }
.approval-subject { margin: 0 0 0.8rem; color: var(--mist); font-size: 0.95rem; }
.approval-fields { margin: 0; display: grid; gap: 0.45rem; border-top: 1px solid var(--line); padding-top: 0.8rem; }
.approval-fields > div { display: grid; grid-template-columns: 6.2rem minmax(0, 1fr); gap: 0.6rem; font-size: 0.92rem; line-height: 1.45; }
.approval-fields dt { color: var(--mist); }
.approval-fields dd { margin: 0; color: var(--frost); }
.approval-draft { margin: 0.9rem 0; padding: 0.75rem 0.9rem; border-left: 2px solid var(--ice); border-radius: 0 8px 8px 0; background: #0f1e2f; font-size: 0.95rem; line-height: 1.6; color: #d3dfe9; }
.approval-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; }
.approval-actions span { font-size: 0.9rem; font-weight: 600; padding: 0.5rem 0.9rem; border-radius: 8px; }
.mock-primary { background: linear-gradient(180deg, #b4e3fb, #84cbef); color: #03121d; }
.mock-ghost { border: 1px solid #2c435c; color: var(--mist); }
.flow-runs { margin: 0; font-size: 0.92rem; line-height: 1.5; color: #d3dfe9; }
.flow-runs span { display: block; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel); font-weight: 600; }

.flow-outcome { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.75rem; border-top: 1px solid #2a3f57; background: linear-gradient(90deg, #62d6c214, transparent 70%); }
.flow-outcome p { margin: 0; color: #bff0e6; font-size: 1.05rem; line-height: 1.5; }
.flow-replay { flex: none; font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--mist); background: transparent; border: 1px solid #2c435c; border-radius: 8px; padding: 0.4rem 0.8rem; cursor: pointer; }
.flow-replay:hover { color: var(--frost); border-color: var(--ice); }

/* Playback: steps light up in order, the approval card waits, then the outcome lands. */
.flow-anim .flow-step, .flow-anim .approval-card, .flow-anim .flow-outcome p, .flow-anim .approval-actions { transition: opacity 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease; }
.flow-anim .flow-step:not(.is-on) { opacity: 0.22; }
.flow-anim .flow-step.is-on .flow-node { background: var(--kind); box-shadow: 0 0 0 4px color-mix(in srgb, var(--kind) 22%, transparent); }
.flow-anim .flow-panel:not(.is-asking):not(.is-approved) .approval-card { opacity: 0.4; }
.flow-anim .is-asking .approval-card { border-color: #f0c674aa; box-shadow: 0 0 0 4px #f0c6741f, 0 18px 40px -24px #000; }
.flow-anim .is-approved .state-pending { display: none; }
.flow-anim .is-approved .approval-state .state-done { display: inline-block; }
.flow-anim .is-approved .approval-actions { opacity: 0.3; }
.flow-anim .flow-panel:not(.is-finished) .flow-outcome p { opacity: 0.25; }

@media (max-width: 47.99rem) {
  .flow-tabs { grid-template-columns: 1fr 1fr; }
  .flow-tabs button { padding: 0.8rem 0.4rem; font-size: 0.82rem; }
  .flow-tabs button:nth-child(3) { border-left: 0; }
  .flow-tabs button:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .flow-tabs button[aria-selected="true"] { border-bottom: 2px solid var(--ice); }
  .flow-head { padding: 1.15rem 1rem 0.8rem; }
  .flow-trigger { margin: 0 1rem; padding: 0.8rem; gap: 0.7rem; grid-template-columns: 1fr; }
  .flow-body { padding: 1.15rem 1rem; }
  .flow-step { grid-template-columns: 1rem minmax(0, 1fr); }
  .flow-step > .flow-time { display: none; }
  .flow-step:not(:last-child)::before { left: calc(0.5rem - 1px); }
  .flow-outcome { padding: 0.9rem 1rem; flex-direction: column; align-items: flex-start; }
}

/* Industry index */
.hero .lead strong { color: var(--frost); font-weight: 600; }
