/* Kinetic layer for the home page: words that rise into place, counting numbers, a ticker of policy
   types, a scroll bar, and the hero panel's Search Knowledge scene. Everything degrades to plain, finished text
   without JavaScript or with reduced motion. */

/* ---------- Kinetic words ---------- */
[data-kinetic] .kw { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .06em .16em 0; margin: 0 -.06em -.16em 0; }
[data-kinetic] .kw-i {
  display: inline-block; opacity: 0; transform: translateY(112%) rotate(5deg); transform-origin: 0 100%;
  transition: transform .95s var(--ease) calc(var(--i) * 65ms + var(--kd, 0ms)), opacity .5s ease calc(var(--i) * 65ms + var(--kd, 0ms));
}
[data-kinetic].k-in .kw-i, .no-js [data-kinetic] .kw-i { opacity: 1; transform: none; }

/* ---------- Numbers ---------- */
.proof { padding: 8px 0 0; }
.stats { list-style: none; margin: 0; padding: 40px 0 44px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 18px; }
@media (min-width: 620px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
.stat { border-left: 1px solid var(--border); padding-left: 16px; }
.stat b { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(2.8rem, 10vw, 4.4rem); line-height: 1; letter-spacing: -.025em; color: var(--text); font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 10px; max-width: 24ch; font-size: 13px; line-height: 1.5; color: var(--muted); }

/* ---------- Scroll bar ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 120; pointer-events: none; background: var(--marker); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; }

/* ---------- Hero panel: Ask AI / Search Knowledge ---------- */
.panel-tabs { display: flex; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--border); }
.panel-tabs span { padding: 8px 10px 9px; font-size: 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .3s var(--ease), border-color .3s var(--ease); }
.panel-tabs span.on { color: var(--marker); border-bottom-color: var(--marker); }
.panel-search { display: none; padding: 12px 14px 16px; }
.panel[data-mode="search"] .panel-search { display: block; }
.panel[data-mode="search"] .panel-msg, .panel[data-mode="search"] .panel-answer { display: none; }
.ps-field { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid rgba(255, 122, 0, .45); box-shadow: 0 0 0 3px rgba(255, 122, 0, .12); color: var(--text); }
.ps-field svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.ps-field span::after { content: ""; display: inline-block; width: 1px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--marker); animation: kcaret 1s steps(1) infinite; }
.ps-meta { min-height: 1.4em; margin: 10px 2px 2px; font-size: 10.5px; letter-spacing: .05em; color: var(--muted); }
.ps-results { display: grid; min-height: 190px; align-content: start; }
.res { display: flex; gap: 10px; margin-top: 7px; padding: 10px 11px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--border); font-size: 12.5px; line-height: 1.45; color: var(--text-2); animation: rise .5s var(--ease) both; }
.res-ref { flex: none; align-self: flex-start; padding: 1px 7px; border-radius: 5px; border: 1px solid rgba(255, 122, 0, .4); color: var(--marker); font-family: var(--mono); font-size: 10.5px; }
.res-body b { display: block; margin-bottom: 2px; color: var(--text); font-weight: 600; }
.res mark { padding: 0 2px; border-radius: 3px; color: var(--text); background: rgba(255, 214, 120, .24); box-shadow: inset 0 -1px 0 rgba(255, 214, 120, .6); }

/* ---------- Step 2 vignette: a search with its hits ---------- */
.v-search { display: grid; gap: 7px; align-content: start; }
.vs-field { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border-radius: 9px; background: var(--surface-2); border: 1px solid rgba(255, 122, 0, .4); color: var(--text); }
.vs-field svg { width: 14px; height: 14px; color: var(--muted); }
.vs-typed { overflow: hidden; white-space: nowrap; width: 0; border-right: 1px solid var(--marker); animation: vs-type 3.6s steps(6) infinite; }
@keyframes vs-type { 0% { width: 0; } 38%, 92% { width: 6ch; } 100% { width: 0; } }
.vs-row { display: flex; gap: 8px; align-items: baseline; padding: 6px 9px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); opacity: 0; animation: vs-hit 3.6s var(--ease) infinite; }
.vs-row:nth-of-type(3) { animation-delay: .25s; } .vs-row:nth-of-type(4) { animation-delay: .5s; } .vs-row:nth-of-type(5) { animation-delay: .75s; }
@keyframes vs-hit { 0%, 30% { opacity: 0; transform: translateY(6px); } 45%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.vs-chip { flex: none; color: var(--marker); font-family: var(--mono); font-size: 10.5px; }
.vs-row mark { padding: 0 2px; border-radius: 3px; color: var(--text); background: rgba(255, 214, 120, .24); box-shadow: inset 0 -1px 0 rgba(255, 214, 120, .6); }

@media (prefers-reduced-motion: reduce) {
  [data-kinetic] .kw-i { opacity: 1; transform: none; transition: none; }
  .vs-typed, .vs-row, .rot-caret { animation: none; }
  .vs-typed { width: auto; border: 0; } .vs-row { opacity: 1; }
}

/* ---------- Step 3 vignette: a gap becomes a private note ---------- */
.v-gap { display: grid; gap: 8px; align-content: start; font-size: 12px; }
.vg-q, .vg-note, .vg-done { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text-2); opacity: 0; animation: vs-hit 5s var(--ease) infinite; }
.vg-q { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.vg-q em { flex: none; font-style: normal; font-family: var(--mono); font-size: 10.5px; color: #FF9A7A; }
.vg-note { animation-delay: .5s; display: grid; gap: 4px; border-color: rgba(240, 192, 112, .4); }
.vg-chip { justify-self: start; font-family: var(--mono); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: #F0C070; }
.vg-done { animation-delay: 1s; color: #8BD3A5; border-color: rgba(139, 211, 165, .35); }
@media (prefers-reduced-motion: reduce) { .vg-q, .vg-note, .vg-done { animation: none; opacity: 1; } }

/* ---------- From gap to answer: four steps without vignettes ---------- */
.gapflow { margin-top: 72px; }
.gapflow .section-head { margin-bottom: 28px; }
@media (min-width: 640px) { .steps.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .steps.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.steps.four .step { min-height: 0; }

/* ---------- Helpdesk names: plain text, nothing to fail to load ---------- */
.desks-list .desk-more { font-size: 15px; font-weight: 500; font-style: italic; }

/* ---------- Readable policies: the same clause, plain and laid out ---------- */
.readable { margin: 44px 0 0; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 820px) { .readable { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rd-pane { padding: 20px 22px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); font-size: 15px; line-height: 1.65; color: var(--text-2); }
.rd-pane p { margin: 0; }
.rd-pane p + p { margin-top: 12px; }
.rd-label { margin-bottom: 12px !important; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rd-fmt { border-color: rgba(255, 122, 0, .35); background: var(--surface); color: #DCD5C8; }
.rd-head { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.rd-fmt b { color: var(--text); font-weight: 620; }
.rd-fmt u { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: rgba(255, 122, 0, .6); }
.rd-fmt mark { padding: 0 3px; margin: 0 -1px; border-radius: 4px; color: inherit; font-weight: 560; }
.rd-fmt .hl-amount { color: #9CE6BD; background: #163024; }
.rd-fmt .hl-time { color: #F5D289; background: #332A18; }
.rd-fmt .hl-limit { color: #FFB6C5; background: #3A1D29; }
.rd-cap { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
