/* Verikai case study: rebuilt product screens and the animated component studies.
   Product pieces sit under .vk and use the rebuilt portal's tokens (verikai-portal/css/app.css),
   so they read as the product rather than as the portfolio. Motion lives in js/verikai-cs.js. */

.vk {
    --ink: #17153f;
    --brand: #262262;
    --violet: #5b48e8;
    --violet-soft: #efedff;
    --violet-line: #d9d4ff;
    --teal: #0a7b6e;
    --teal-bright: #19c3ad;
    --teal-soft: #e3f7f3;
    --amber: #f2a93b;
    --amber-soft: #fff4e0;
    --amber-ink: #8a5300;
    --green: #12784a;
    --green-soft: #e4f6ec;
    --blue: #2361c8;
    --blue-soft: #e7f0ff;
    --t1: #17153f;
    --t2: #4b4970;
    --t3: #66648a;
    --t4: #8e8cab;
    --hair: #e9e8f3;
    --hair-2: #f1f0f8;
    --surface: #fff;
    --surface-2: #fafafd;
    --shadow-btn: 0 1px 2px rgba(23, 21, 63, 0.08);
    --e: cubic-bezier(0.22, 1, 0.36, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-feature-settings: 'cv11', 'ss01', 'ss03';
    letter-spacing: -0.006em;
    color: var(--t1);
    -webkit-font-smoothing: antialiased;
}
.vk *, .vk *::before, .vk *::after { box-sizing: border-box; }
.vk .num { font-variant-numeric: tabular-nums; }
.vk .i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Stages: flat colour fields that hold a screen or a component ---------- */
.vstage {
    position: relative;
    display: grid; place-items: center;
    padding: clamp(28px, 5vw, 72px) clamp(20px, 5vw, 72px);
    overflow: hidden;
    background: var(--stage, #e9e7f8);
}
.vstage--lav { --stage: #e9e7f8; }
.vstage--ink { --stage: #262262; }
.vstage--mist { --stage: #eceef3; }
.vstage--teal { --stage: #dcefeb; }
.vstage__tag {
    position: absolute; top: 18px; left: 20px;
    font: 500 12px/1 'Inter', sans-serif; letter-spacing: 0.02em;
    color: rgba(23, 21, 63, 0.62);
}
.vstage--ink .vstage__tag { color: rgba(255, 255, 255, 0.7); }
.vstage__replay {
    position: absolute; right: 16px; bottom: 16px; z-index: 5;
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 12px 0 10px;
    font: 550 12.5px/1 'Inter', sans-serif; color: #17153f;
    border: 0; border-radius: 999px; cursor: pointer;
    background: #fff; box-shadow: 0 0 0 1px rgba(23, 21, 63, 0.08), 0 1px 2px rgba(23, 21, 63, 0.1);
    opacity: 0; transition: opacity 0.4s;
}
.vstage__replay svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.vstage.is-done .vstage__replay { opacity: 1; }
.vstage__replay:focus-visible { opacity: 1; outline: 2px solid #5b48e8; outline-offset: 2px; }

/* Full screens on a stage */
.vscreen { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 0 0 1px rgba(23, 21, 63, 0.1); background: #f6f6fb; }
.vstage--ink .vscreen { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); }
.vstage--screen { padding: clamp(24px, 5vw, 80px) clamp(16px, 6vw, 96px) 0; align-items: end; }
.vstage--screen .vscreen { border-radius: 10px 10px 0 0; }

/* Hero: two screens layered on the brand indigo */
.vk-hero { position: relative; aspect-ratio: 16 / 8; overflow: hidden; background: #262262; }
.vk-hero__back, .vk-hero__front { position: absolute; width: 60%; height: auto; border-radius: 12px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14); }
.vk-hero__back { left: 7%; top: 11%; opacity: 0.55; }
.vk-hero__front { right: 7%; top: 22%; }
.js .vk-hero__back, .js .vk-hero__front { transform: translateY(48px); opacity: 0; transition: transform 1.4s var(--e, cubic-bezier(0.22, 1, 0.36, 1)), opacity 1s; }
.vk-hero.is-in .vk-hero__back { transform: none; opacity: 0.55; }
.vk-hero.is-in .vk-hero__front { transform: none; opacity: 1; transition-delay: 0.15s; }

/* ---------- Shared product pieces ---------- */
.vk-card { width: 100%; background: var(--surface); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--hair); }
.vk-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--hair-2); }
.vk-card__title { margin: 0; font-size: 14px; font-weight: 620; letter-spacing: -0.015em; }
.vk-card__sub { font-size: 12.5px; color: var(--t3); }

.vk-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 7px; font-size: 12.5px; font-weight: 550; border-radius: 8px; white-space: nowrap; }
.vk-chip--medrx { color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px #c9ecd8; }
.vk-chip--capture { color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px #cfdffc; }
.vk-status { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 8px; font-size: 12px; font-weight: 550; border-radius: 999px; white-space: nowrap; transition: background 0.35s, color 0.35s; }
.vk-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.vk-status--open { color: var(--amber-ink); background: var(--amber-soft); }
.vk-status--neg { color: var(--violet); background: var(--violet-soft); }
.vk-status--closed { color: var(--green); background: var(--green-soft); }
.vk-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 12px; font: 600 12.5px/1 'Inter', sans-serif; border: 0; border-radius: 9px; white-space: nowrap; cursor: default; transition: transform 0.15s, background 0.3s, color 0.3s, opacity 0.3s; }
.vk-btn--primary { color: #fff; background: var(--violet); box-shadow: var(--shadow-btn); }
.vk-btn--ghost { color: var(--t1); background: #fff; box-shadow: inset 0 0 0 1px var(--hair), var(--shadow-btn); }
.vk-btn--gen { color: var(--violet); background: #fff; box-shadow: inset 0 0 0 1px var(--violet-line), var(--shadow-btn); }
.vk-btn[disabled] { opacity: 0.45; }
.is-press { transform: scale(0.95); }
.vk-spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(91, 72, 232, 0.25); border-top-color: var(--violet); animation: vk-spin 0.8s linear infinite; }
@keyframes vk-spin { to { transform: rotate(360deg); } }
.vk-gen { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; font-size: 12.5px; font-weight: 550; color: var(--violet); border-radius: 8px; background: var(--violet-soft); white-space: nowrap; }

/* Swappable slot: children cross-fade with a small lift */
.vk-swap { position: relative; display: inline-grid; }
.vk-swap > * { grid-area: 1 / 1; transition: opacity 0.35s, transform 0.5s var(--e); }
.vk-swap > :not(.is-on) { opacity: 0; transform: translateY(6px) scale(0.96); pointer-events: none; }

/* Pointer used in the studies */
.vk-cursor { position: absolute; left: 0; top: 0; z-index: 6; width: 22px; height: 22px; pointer-events: none; opacity: 0; transform: translate(var(--x, 60%), var(--y, 110%)); transition: transform 0.8s var(--e), opacity 0.3s; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25)); }
.vk-cursor.is-on { opacity: 1; }
.vk-cursor.is-down svg { transform: scale(0.86); }
.vk-cursor svg { display: block; width: 100%; height: 100%; transition: transform 0.12s; transform-origin: 20% 15%; }

/* ---------- 1. Report states (list rows) ---------- */
.vk-rows { max-width: 560px; }
.vk-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--hair-2); }
.vk-row:last-child { border-bottom: 0; }
.vk-logo { display: grid; place-items: center; width: 34px; height: 34px; font-size: 12px; font-weight: 700; border-radius: 10px; color: color-mix(in srgb, var(--c) 62%, #000); background: color-mix(in srgb, var(--c) 10%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 18%, #fff); }
.vk-row b { display: block; overflow: hidden; font-size: 13.5px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.vk-row small { display: block; overflow: hidden; margin-top: 1px; font-size: 12px; color: var(--t3); white-space: nowrap; text-overflow: ellipsis; }
.vk-row .vk-swap { justify-items: end; }
.vk-row__when { margin-left: 8px; font-size: 12px; color: var(--t3); }
.vk-row.is-flash { animation: vk-flash 1.4s var(--e); }
@keyframes vk-flash { 0% { background: rgba(25, 195, 173, 0.16); } 100% { background: transparent; } }

/* ---------- 2. Stage picker ---------- */
.vk-picker { position: relative; width: 100%; max-width: 380px; }
.vk-picker .vk-card { padding: 18px; }
.vk-field { display: flex; align-items: center; gap: 10px; width: 100%; height: 42px; padding: 0 12px; font-size: 13px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--hair), var(--shadow-btn); transition: box-shadow 0.25s; }
.vk-field.is-open { box-shadow: inset 0 0 0 1.5px var(--violet), 0 0 0 4px rgba(91, 72, 232, 0.12); }
.vk-field__label { width: 64px; font-size: 12.5px; font-weight: 500; color: var(--t3); }
.vk-field__chev { margin-left: auto; color: var(--t4); transition: transform 0.3s var(--e); }
.vk-field.is-open .vk-field__chev { transform: rotate(180deg); }
.vk-field + .vk-field { margin-top: 8px; }
.vk-field--static { box-shadow: inset 0 0 0 1px var(--hair); }
.vk-list { position: absolute; left: 18px; right: 18px; top: 66px; z-index: 3; padding: 6px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--hair), 0 12px 28px -12px rgba(23, 21, 63, 0.35); opacity: 0; transform: translateY(-6px) scale(0.98); transform-origin: top; transition: opacity 0.25s, transform 0.35s var(--e); pointer-events: none; }
.vk-list.is-open { opacity: 1; transform: none; }
.vk-opt { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 8px; font-size: 13px; transition: background 0.2s; }
.vk-opt.is-hover { background: var(--hair-2); }
.vk-opt .i { margin-left: auto; color: var(--violet); opacity: 0; }
.vk-opt.is-sel .i { opacity: 1; }
.vk-toast { position: absolute; left: 50%; bottom: -64px; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; font-size: 12.5px; color: #fff; white-space: nowrap; border-radius: 12px; background: #17153f; opacity: 0; transform: translate(-50%, 10px); transition: opacity 0.3s, transform 0.5s var(--e); }
.vk-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.vk-toast b { font-weight: 600; }
.vk-toast span { padding: 5px 9px; font-weight: 600; border-radius: 7px; background: rgba(255, 255, 255, 0.12); }

/* ---------- 3. Group information ---------- */
.vk-info { max-width: 820px; }
.vk-stats { display: grid; grid-template-columns: 1fr 1.25fr 1fr; }
.vk-stat { display: flex; flex-direction: column; padding: 20px 22px 24px; }
.vk-stat + .vk-stat { border-left: 1px solid var(--hair-2); }
.vk-stat__label { font-size: 12.5px; font-weight: 550; color: var(--t3); }
.vk-stat__value { margin-top: 6px; font-size: 40px; line-height: 1; font-weight: 650; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.vk-stat__value small { margin-left: 6px; font-size: 13.5px; font-weight: 500; letter-spacing: -0.01em; color: var(--t3); }
.vk-stat__viz { margin-top: auto; padding-top: 22px; }
.vk-dots { display: grid; grid-template-columns: repeat(10, 10px); gap: 5px; }
.vk-dots i { aspect-ratio: 1; border-radius: 50%; background: var(--violet); transition: transform 0.4s var(--e), opacity 0.3s; }
.vk-dots i.f { background: var(--teal-bright); }
.vk-hist { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 76px; }
.vk-hist i { flex: 1; height: var(--h); border-radius: 4px 4px 2px 2px; background: #e3dfff; transform-origin: bottom; transition: transform 0.7s var(--e); }
.vk-hist i.on { background: var(--violet); }
.vk-hist__mark { position: absolute; top: -10px; bottom: -6px; left: 85%; border-left: 1.5px dashed var(--ink); transition: opacity 0.4s, transform 0.6s var(--e); }
.vk-hist__mark span { position: absolute; top: -14px; left: 0; transform: translateX(-50%); padding: 2px 6px; font-size: 10.5px; font-weight: 650; color: #fff; border-radius: 5px; background: var(--ink); }
.vk-axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; font-weight: 500; color: var(--t3); }
.vk-donut { display: flex; align-items: center; gap: 16px; }
.vk-donut svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.vk-donut circle.seg { transition: stroke-dasharray 1.1s var(--e); }
.vk-legend { display: grid; gap: 8px; font-size: 13px; color: var(--t2); }
.vk-legend div { display: flex; align-items: center; gap: 8px; }
.vk-legend b { margin-left: auto; padding-left: 12px; color: var(--t1); font-weight: 650; }
.vk-legend i { width: 8px; height: 8px; border-radius: 3px; background: var(--c); }
/* start state while waiting to play */
.vstage.is-armed .vk-dots i { transform: scale(0); opacity: 0; }
.vstage.is-armed .vk-hist i { transform: scaleY(0); }
.vstage.is-armed .vk-hist__mark { opacity: 0; transform: translateY(-8px); }

/* ---------- 4. Census upload ---------- */
.vk-upload { position: relative; max-width: 520px; }
.vk-drop { display: flex; align-items: center; gap: 14px; margin: 16px 18px 0; padding: 16px; border: 1.5px dashed #cfc9fb; border-radius: 14px; background: var(--surface-2); transition: background 0.3s, border-color 0.3s; }
.vk-drop.is-hot { border-color: var(--violet); background: var(--violet-soft); }
.vk-drop__icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 11px; color: var(--violet); background: var(--violet-soft); box-shadow: inset 0 0 0 1px var(--violet-line); }
.vk-drop b { display: block; font-size: 13.5px; font-weight: 600; }
.vk-drop span { font-size: 12px; color: var(--t3); }
.vk-file { position: absolute; top: 0; left: 0; z-index: 4; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 8px; font: 500 12px/1 'JetBrains Mono', ui-monospace, monospace; border-radius: 9px; background: #fff; box-shadow: 0 0 0 1px var(--hair), 0 10px 22px -10px rgba(23, 21, 63, 0.4); opacity: 0; transition: transform 0.9s var(--e), opacity 0.3s; }
.vk-file .i { color: var(--teal); }
.vk-file.is-on { opacity: 1; }
.vk-prog { margin: 12px 18px 0; padding: 14px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--hair); opacity: 0; transform: translateY(8px); transition: opacity 0.35s, transform 0.5s var(--e); }
.vk-prog.is-on { opacity: 1; transform: none; }
.vk-prog__row { display: flex; justify-content: space-between; font-size: 12.5px; }
.vk-prog__row b { font-weight: 600; }
.vk-prog__row span { color: var(--t3); }
.vk-bar { height: 6px; margin-top: 8px; border-radius: 6px; background: var(--hair-2); overflow: hidden; }
.vk-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--teal); transition: width 1.8s cubic-bezier(0.45, 0, 0.2, 1); }
.vk-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 11.5px; color: var(--t3); }
.vk-check { display: inline-flex; align-items: center; gap: 5px; }
.vk-check .ok { display: none; width: 13px; height: 13px; stroke-width: 2.2; }
.vk-check .vk-spin { width: 11px; height: 11px; }
.vk-check.is-ok { color: var(--green); }
.vk-check.is-ok .ok { display: block; }
.vk-check.is-ok .vk-spin, .vk-check.is-wait .vk-spin { display: none; }
.vk-check.is-wait { color: var(--t4); }
.vk-upload__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 18px; font-size: 12.5px; color: var(--t3); }

/* ---------- 5. Column mapping ---------- */
.vk-map { max-width: 760px; }
.vk-map__head { display: grid; grid-template-columns: 1.1fr 28px 1fr 120px; gap: 12px; padding: 10px 20px; font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--t3); background: var(--surface-2); border-bottom: 1px solid var(--hair); }
.vk-mrow { position: relative; display: grid; grid-template-columns: 1.1fr 28px 1fr 120px; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--hair-2); transition: background 0.4s; }
.vk-mrow:last-child { border-bottom: 0; }
.vk-col code { display: block; font: 500 12.5px/1.3 'JetBrains Mono', ui-monospace, monospace; color: var(--t1); }
.vk-col small { display: block; margin-top: 3px; font-size: 11.5px; color: var(--t3); }
.vk-arrow { color: var(--t4); }
.vk-target { position: relative; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; font-size: 13px; border-radius: 9px; background: #fff; box-shadow: inset 0 0 0 1px var(--hair); }
.vk-target__ph { color: var(--t3); }
.vk-target .i { margin-left: auto; color: var(--t4); }
.vk-tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 7px; font-size: 12px; font-weight: 600; border-radius: 999px; white-space: nowrap; }
.vk-tag .i { width: 13px; height: 13px; stroke-width: 2.2; }
.vk-tag--ok { color: var(--green); background: var(--green-soft); }
.vk-tag--need { color: var(--amber-ink); background: var(--amber-soft); }
.vk-tag--skip { color: var(--t3); background: var(--hair-2); }
.vk-tag--scan { color: var(--t3); background: transparent; }
.vk-mrow.is-need { background: #fffaf1; }
.vk-mrow.is-need .vk-target { box-shadow: inset 0 0 0 1.5px var(--amber); }
.vk-mrow.is-skip .vk-col code, .vk-mrow.is-skip .vk-target { opacity: 0.5; }
.vk-mrow.is-fixed { background: rgba(25, 195, 173, 0.08); }
.vk-mrow .vk-list { left: auto; right: auto; top: 46px; width: 220px; z-index: 4; }
.vk-mrow .vk-target-wrap { position: relative; }
.vk-mrow .vk-target-wrap .vk-list { left: 0; }
.vk-map__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--hair); font-size: 12.5px; color: var(--t3); }
.vk-map__foot b { color: var(--t1); font-weight: 600; }
/* scan line that runs down the rows while the file is matched */
.vk-scan { position: absolute; left: 0; right: 0; height: 2px; top: 0; background: var(--violet); opacity: 0; transition: transform 2.4s cubic-bezier(0.45, 0, 0.2, 1), opacity 0.3s; }

/* ---------- Layout inside the case study ---------- */
.shot--stage figcaption { margin-top: 14px; }
.vk-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.vk-pair > figure { display: flex; flex-direction: column; }
.vk-pair .vstage { flex: 1; min-height: 440px; }
.vk-note { margin-top: 24px; font-size: 13px; color: var(--muted); }

@media (max-width: 991px) {
    .vk-stats { grid-template-columns: 1fr 1fr; }
    .vk-stat:nth-child(3) { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--hair-2); }
}
@media (max-width: 767px) {
    .vk-hero { aspect-ratio: 4 / 5; }
    .vk-hero__back { width: 120%; left: 8%; top: 8%; }
    .vk-hero__front { width: 120%; left: 22%; right: auto; top: 30%; }
    .vk-pair { grid-template-columns: 1fr; }
    .vk-pair .vstage { min-height: 380px; }
    .vk-stats { grid-template-columns: 1fr; }
    .vk-stat + .vk-stat { border-left: 0; border-top: 1px solid var(--hair-2); }
    .vk-stat:nth-child(3) { grid-column: auto; }
    .vk-map__head { display: none; }
    .vk-mrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 12px 14px; row-gap: 8px; }
    .vk-arrow { display: none; }
    .vk-mrow .vk-tag { grid-column: 1 / -1; justify-self: start; }
    .vk-row { padding: 12px 14px; }
    .vk-row b { overflow: visible; white-space: normal; text-overflow: clip; }
    /* room for the label above and Replay below, so neither sits on the card */
    .vstage[data-vk] { padding: 52px 16px 68px; }
    .vk-row small { display: none; }
    .vk-row__when { display: none; }
}

/* Reduced motion: every study shows its finished state, no replay */
@media (prefers-reduced-motion: reduce) {
    .vk *, .vk-hero * { transition: none !important; animation: none !important; }
    .vk-cursor, .vstage__replay { display: none !important; }
}
