/* AccuraTrials interaction kit (kit.js): switchers, filters, calculators, and
   the few shared figures the content pages reuse. Same palette, type and
   corner language as site.css and home.css; nothing here restyles them. */

/* ── switch: tabs in the homepage preview's grammar ── */
.kit-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--edge);
  border-radius: 14px;
  background: rgba(7, 11, 18, 0.88);
}
.kit-tabs > [data-switch-tab] {
  position: relative;
  min-width: 0;
  padding: 16px 20px 15px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  background: transparent;
  color: var(--muted);
  font: 400 13px/1.45 var(--font-ui);
  text-align: left;
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease;
}
.kit-tabs > [data-switch-tab]:last-child { border-right: 0; }
.kit-tabs > [data-switch-tab] b { display: block; font-weight: 600; color: rgba(255, 255, 255, 0.8); }
.kit-tabs > [data-switch-tab] span { display: block; margin-top: 2px; font-size: 12.5px; }
.kit-tabs > [data-switch-tab]:hover b { color: #fff; }
.kit-tabs > [data-switch-tab].is-active { background: linear-gradient(180deg, var(--accent-faint), transparent); color: #c4cfdd; }
.kit-tabs > [data-switch-tab].is-active b { color: #fff; }
.kit-tabs > [data-switch-tab] > i { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, rgba(92, 200, 255, 0.4), var(--accent)); transform: scaleX(0); transform-origin: left; }
.kit-tabs > [data-switch-tab].is-active > i { transform: scaleX(1); }
.is-auto > .kit-tabs > [data-switch-tab].is-active > i,
.is-auto .kit-tabs > [data-switch-tab].is-active > i { animation: kitDwell var(--dwell, 6s) linear both; }
.is-hold .kit-tabs > [data-switch-tab].is-active > i { animation-play-state: paused; }
@keyframes kitDwell { from { transform: scaleX(0); } to { transform: scaleX(1); } }
[data-switch-tab]:focus-visible { outline: 2px solid #9fd8ff; outline-offset: -2px; }

/* A vertical rail of tabs beside a panel. */
.kit-rail { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 28px 40px; align-items: start; }
.kit-rail > * { min-width: 0; }
.kit-rail .kit-tabs { grid-auto-flow: row; grid-auto-columns: auto; }
.kit-rail .kit-tabs > [data-switch-tab] { border-right: 0; border-bottom: 1px solid var(--line-soft); padding: 18px 20px; }
.kit-rail .kit-tabs > [data-switch-tab]:last-child { border-bottom: 0; }
.kit-rail .kit-tabs > [data-switch-tab] > i { top: 0; bottom: 0; left: 0; right: auto; width: 2px; height: auto; transform: scaleY(0); transform-origin: top; }
.kit-rail .kit-tabs > [data-switch-tab].is-active > i { transform: scaleY(1); }
.is-auto .kit-rail .kit-tabs > [data-switch-tab].is-active > i,
.kit-rail.is-auto .kit-tabs > [data-switch-tab].is-active > i { animation-name: kitDwellY; }
@keyframes kitDwellY { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Panels arrive when chosen; their marked children follow in turn. */
html.kit [data-switch-panel][hidden] { display: none; }
/* A rail's panels, or any .kit-stack, share one cell, so the box keeps the
   tallest panel's height and an auto-playing switch never moves the page
   below it. Hidden panels stay out of view and out of the accessibility tree. */
.kit-rail > div:not(.kit-tabs), .kit-stack { display: grid; }
.kit-rail > div:not(.kit-tabs) > [data-switch-panel], .kit-stack > [data-switch-panel] { grid-area: 1 / 1; }
html.kit .kit-rail > div:not(.kit-tabs) > [data-switch-panel][hidden],
html.kit .kit-stack > [data-switch-panel][hidden] { display: block; visibility: hidden; pointer-events: none; }
html.kit [data-switch-panel].is-active { animation: kitIn 520ms var(--ease-out) both; }
html.kit [data-switch-panel].is-active [data-k] { animation: kitIn 560ms var(--ease-out) both; animation-delay: calc(var(--k, 0) * 90ms + 120ms); }
@keyframes kitIn { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* ── filter chips ── */
.kit-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kit-chips button {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(236, 239, 244, 0.86);
  font: 500 12.5px var(--font-ui);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}
.kit-chips button:hover { border-color: rgba(92, 200, 255, 0.5); color: #fff; }
.kit-chips button[aria-pressed="true"] { border-color: rgba(92, 200, 255, 0.7); background: rgba(92, 200, 255, 0.14); color: #fff; }
.kit-chips button:focus-visible { outline: 2px solid #9fd8ff; outline-offset: 2px; }
.kit-chips small { margin-left: auto; font: 500 10.5px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--label); }
[data-tags] { transition: opacity 260ms ease, filter 260ms ease; }
[data-tags].is-dim { opacity: 0.22; filter: saturate(0.2); }
html.js [data-reveal][data-tags].is-dim { opacity: 0.22; }

/* ── calculator ranges ── */
.kit-range { display: grid; gap: 10px; }
.kit-range label { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--muted); }
.kit-range label b { font: 500 13px var(--font-mono); color: #fff; font-variant-numeric: tabular-nums; }
.kit-range input[type="range"] {
  --fill: 50%;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.kit-range input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(90deg, #1a7dff, #5cc8ff var(--fill), rgba(255, 255, 255, 0.1) var(--fill)); }
.kit-range input[type="range"]::-moz-range-track { height: 4px; border-radius: 99px; background: linear-gradient(90deg, #1a7dff, #5cc8ff var(--fill), rgba(255, 255, 255, 0.1) var(--fill)); }
.kit-range input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border: 2px solid #05080d; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(92, 200, 255, 0.35), 0 4px 14px rgba(0, 0, 0, 0.5); }
.kit-range input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: 2px solid #05080d; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(92, 200, 255, 0.35); }
.kit-range input[type="range"]:focus-visible { outline: 2px solid #9fd8ff; outline-offset: 4px; border-radius: 6px; }

/* ── timeline: a dated line, shared by every page that tells a history ── */
.kit-tl { position: relative; display: grid; grid-template-columns: repeat(var(--tl-n, 4), minmax(0, 1fr)); gap: 0 18px; margin: 56px 0 0; padding: 0; list-style: none; }
.kit-tl::before { content: ""; position: absolute; left: 0; right: 0; top: 32px; height: 1px; background: linear-gradient(90deg, rgba(92, 200, 255, 0.12), rgba(92, 200, 255, 0.6)); }
.kit-tl li { position: relative; min-width: 0; padding-top: 54px; }
.kit-tl li::before { content: ""; position: absolute; left: 0; top: 28px; width: 9px; height: 9px; border: 1px solid rgba(92, 200, 255, 0.85); border-radius: 50%; background: var(--bg); box-shadow: 0 0 10px rgba(92, 200, 255, 0.5); }
.kit-tl time { position: absolute; left: 0; top: 0; font: 500 11px var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: #9fd8ff; }
.kit-tl b { display: block; font: 500 18px/1.25 var(--font-display); letter-spacing: -0.01em; color: var(--fg); text-wrap: balance; }
.kit-tl span { display: block; margin-top: 8px; font-size: 13.5px; line-height: 1.55; color: var(--muted); text-wrap: pretty; }
.kit-tl li.is-now::before { border-color: #5cc8ff; background: #5cc8ff; animation: kitTlPulse 2.4s ease-out infinite; }
@keyframes kitTlPulse { 0% { box-shadow: 0 0 0 0 rgba(92, 200, 255, 0.6); } 100% { box-shadow: 0 0 0 12px rgba(92, 200, 255, 0); } }

/* ── a customer's words ── */
.kit-quote { position: relative; max-width: 900px; margin: 0; padding: 0 0 0 0; }
.kit-quote blockquote { margin: 0; font: 400 clamp(24px, 2.8vw, 38px)/1.28 var(--font-display); letter-spacing: -0.015em; color: var(--fg); text-wrap: balance; }
.kit-quote blockquote::before { content: "“"; display: block; height: 0.5em; margin-bottom: 0.2em; font-size: 2.6em; line-height: 1; color: rgba(92, 200, 255, 0.55); }
.kit-quote figcaption { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 26px; font-size: 14px; color: var(--muted); }
.kit-quote figcaption b { font-weight: 600; color: var(--fg); }

/* ── a status chip in the closed palette ── */
.kit-state { display: inline-flex; align-items: center; gap: 7px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; font: 600 9px/1.4 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--label); white-space: nowrap; }
.kit-state::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.kit-state--live { border-color: rgba(110, 231, 183, 0.4); color: var(--live); }
.kit-state--build { border-color: rgba(92, 200, 255, 0.4); color: #9fd8ff; }
.kit-state--plan { border-style: dashed; color: rgba(236, 239, 244, 0.6); }

/* ── a window onto the running product: screenshots behind tabs ── */
.edcview { margin-top: 44px; }
.edcview .kit-tabs { border-bottom: 0; border-radius: 14px 14px 0 0; }
.edcview__window { overflow: hidden; border: 1px solid var(--edge); border-radius: 0 0 14px 14px; background: #060a12; box-shadow: 0 50px 140px rgba(0, 0, 0, 0.65), 0 0 140px rgba(30, 130, 255, 0.07); }
.edcview__bar { display: flex; align-items: center; gap: 16px; min-height: 42px; padding: 10px 18px; border-bottom: 1px solid var(--line-soft); font: 500 11px var(--font-mono); color: #b6bfcc; }
.edcview__bar small { margin-left: auto; font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: #8c97a6; }
.edcview__dots { display: flex; gap: 5px; }
.edcview__dots i { width: 6px; height: 6px; border-radius: 50%; background: #3a4554; }
.edcview__dots i:first-child { background: var(--accent); }
.edcview__stage { position: relative; aspect-ratio: 16 / 9; background: #0a0f17; }
.edcview__stage figure { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; }
.edcview__stage img { width: 100%; height: 100%; object-fit: contain; }
.edcview__stage figcaption { position: absolute; left: 16px; bottom: 14px; padding: 6px 10px; border: 1px solid var(--edge); border-radius: 8px; background: rgba(5, 8, 13, 0.85); font: 500 10px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: #9fd8ff; }
html:not(.kit) .edcview__stage { aspect-ratio: auto; }
html:not(.kit) .edcview__stage figure { position: static; }
.edcview__export { margin: 18px 0 0; font-size: 13.5px; color: var(--muted); }
.edcview__export b { color: var(--fg); font-weight: 600; }

@media (max-width: 900px) {
  .kit-rail { grid-template-columns: 1fr; }
  .kit-rail .kit-tabs { grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); overflow-x: auto; scrollbar-width: none; }
  .kit-rail .kit-tabs > [data-switch-tab] { border-bottom: 0; border-right: 1px solid var(--line-soft); }
  .kit-rail .kit-tabs > [data-switch-tab] > i { top: 0; bottom: auto; left: 0; right: 0; width: auto; height: 2px; transform: scaleX(0); transform-origin: left; }
  .kit-rail .kit-tabs > [data-switch-tab].is-active > i { transform: scaleX(1); }
  .kit-rail.is-auto .kit-tabs > [data-switch-tab].is-active > i { animation-name: kitDwell; }
  .kit-tl { grid-template-columns: 1fr; gap: 0; }
  .kit-tl::before { left: 4px; right: auto; top: 6px; bottom: 6px; width: 1px; height: auto; background: linear-gradient(180deg, rgba(92, 200, 255, 0.12), rgba(92, 200, 255, 0.6)); }
  .kit-tl li { padding: 0 0 26px 30px; }
  .kit-tl li::before { top: 3px; }
  .kit-tl time { position: static; display: block; margin-bottom: 6px; }
}
@media (max-width: 640px) {
  .kit-tabs:not(.kit-tabs--keep):not(.kit-rail .kit-tabs) { grid-auto-flow: row; }
  .kit-tabs:not(.kit-tabs--keep):not(.kit-rail .kit-tabs) > [data-switch-tab] { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .kit-tabs:not(.kit-tabs--keep):not(.kit-rail .kit-tabs) > [data-switch-tab]:last-child { border-bottom: 0; }
  /* A side rail becomes a strip that scrolls sideways, faded at its edge. */
  .kit-rail .kit-tabs { grid-auto-columns: minmax(148px, 62%); -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
  .kit-rail .kit-tabs > [data-switch-tab] { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html.kit [data-switch-panel].is-active, html.kit [data-switch-panel].is-active [data-k] { animation: kitFade 200ms ease both; }
  .kit-tl li.is-now::before { animation: none; }
}
@keyframes kitFade { from { opacity: 0; } to { opacity: 1; } }
html[data-motion="paused"] [data-switch-panel].is-active, html[data-motion="paused"] [data-switch-panel].is-active [data-k] { animation: none; }

/* Hero figures enter once (heroUp). A paused page pauses every animation at
   its first frame, so they must settle in place instead of staying hidden. */
html[data-motion="paused"] .hero-visual { animation: none; opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .hero-visual { animation: none; } }
