/* qa-capture site — tokens first, then type, layout, components, motion. */

:root {
  --paper: #f6f7f9;
  --surface: #ffffff;
  --ink: #171a20;
  --ink-2: #454c5a;
  --muted: #6b7280;
  --line: #d9dde5;
  --line-strong: #b8bfcb;
  --accent: #d63a40;
  --accent-ink: #b52d33;
  --accent-soft: rgba(214, 58, 64, 0.10);
  --ok: #2f8f5b;
  --ok-soft: rgba(47, 143, 91, 0.12);
  --code-bg: #eceff4;
  --shadow: 0 12px 32px rgba(23, 26, 32, 0.08);
  --radius: 6px;
  --bezel: #15181d;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #13161b;
    --surface: #1b1f26;
    --ink: #eceef2;
    --ink-2: #b8bec9;
    --muted: #8d94a2;
    --line: #2b3039;
    --line-strong: #3c424d;
    --accent: #ff5b60;
    --accent-ink: #ff7d81;
    --accent-soft: rgba(255, 91, 96, 0.14);
    --ok: #52c283;
    --ok-soft: rgba(82, 194, 131, 0.14);
    --code-bg: #0f1216;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    --bezel: #0b0d10;
  }
}
:root[data-theme="dark"] {
  --paper: #13161b;
  --surface: #1b1f26;
  --ink: #eceef2;
  --ink-2: #b8bec9;
  --muted: #8d94a2;
  --line: #2b3039;
  --line-strong: #3c424d;
  --accent: #ff5b60;
  --accent-ink: #ff7d81;
  --accent-soft: rgba(255, 91, 96, 0.14);
  --ok: #52c283;
  --ok-soft: rgba(82, 194, 131, 0.14);
  --code-bg: #0f1216;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --bezel: #0b0d10;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
code, pre, kbd { font-family: var(--mono); font-size: 0.92em; }
pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.5;
  margin: 0;
}
pre code { font-size: 13.5px; }
:not(pre) > code {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
.muted { color: var(--muted); }
.accent { color: var(--accent-ink); }

/* Type scale */
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.08; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.25rem); }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 36em; }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

/* Nav */
.nav {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.05rem; }
.brand .mark { width: 18px; height: 26px; border: 2px solid var(--accent); border-radius: 3px; position: relative; }
.brand .mark::after { content: ""; position: absolute; left: 3px; right: 3px; top: 6px; height: 4px; background: var(--accent); border-radius: 1px; }
.nav-links { display: flex; gap: 22px; font-size: 0.95rem; }
.nav-links a { text-decoration: none; color: var(--ink-2); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--accent); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius); text-decoration: none;
  font-weight: 600; font-size: 0.98rem; border: 1px solid var(--line-strong);
  color: var(--ink); background: var(--surface);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--ink-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

/* Hero */
.hero { padding-block: 52px 40px; }
.hero .wrap { display: grid; gap: 40px; }
.hero-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr); gap: 48px; align-items: center; }
.hero-copy { display: grid; gap: 22px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.install { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 0.9rem; color: var(--ink-2); }
.install code { background: var(--code-bg); border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; }
.install button {
  font: inherit; font-size: 0.8rem; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 4px; padding: 4px 8px; cursor: pointer;
}
.install button:hover { color: var(--ink); border-color: var(--line-strong); }

/* The session: four screens in a row, a timeline, the cue */
.session { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; max-width: 960px; margin: 0 auto; width: 100%; }
.timeline, .hint { max-width: 960px; margin-inline: auto; width: 100%; }
.shot-card { display: block; margin: 0; padding: 0; border: 0; background: none; text-align: left; cursor: zoom-in; font: inherit; color: inherit; border-radius: 12px; }
.shot-card .shot {
  display: block; position: relative; border-radius: 26px; overflow: hidden;
  border: 6px solid var(--bezel); background: #fff; box-shadow: var(--shadow);
  outline: 2px solid transparent; outline-offset: 4px;
  transition: transform 0.2s ease, outline-color 0.2s ease;
}
.shot-card:hover .shot { transform: translateY(-3px); outline-color: var(--line-strong); }
.shot-card img { width: 100%; height: auto; aspect-ratio: 1080 / 2424; display: block; }
.shot-card .cap { display: block; margin-top: 10px; font-family: var(--mono); font-size: 0.74rem; color: var(--muted); line-height: 1.4; }
.shot-card .cap b { color: var(--ink); font-weight: 500; }
.tap {
  position: absolute; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--accent); transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px var(--accent-soft); opacity: 0.9;
}
.timeline { position: relative; height: 14px; margin-top: 4px; }
.timeline .track { position: absolute; left: 12.5%; right: 12.5%; top: 6px; height: 2px; background: var(--line-strong); border-radius: 1px; }
.timeline .progress { position: absolute; left: 12.5%; top: 6px; height: 2px; width: 0; background: var(--accent); border-radius: 1px; }
.timeline i { position: absolute; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); transform: translateX(-50%); }
.hint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-family: var(--mono); font-size: 0.74rem; color: var(--muted); }
.hint .ring { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--accent); flex: none; }
.hint .sq { width: 11px; height: 11px; border-radius: 2px; border: 2px solid var(--accent); flex: none; }
.replay { font: inherit; color: var(--ink-2); background: none; border: 1px solid var(--line); border-radius: 4px; padding: 3px 9px; cursor: pointer; margin-left: auto; }
.replay:hover { color: var(--ink); border-color: var(--line-strong); }

/* Lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
.lightbox::backdrop { background: rgba(10, 12, 16, 0.78); }
.lightbox img { display: block; height: min(90vh, 1400px); width: auto; max-width: 92vw; object-fit: contain; border-radius: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); background: #fff; }
.lightbox-close {
  position: absolute; top: -4px; right: -4px; transform: translate(0, -100%);
  font: inherit; font-size: 0.85rem; color: #fff; background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px; padding: 6px 12px; cursor: pointer;
}

/* The comment card */
.comment {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  font-size: 0.86rem;
}
.c-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--code-bg); }
.c-avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--ink-2); color: var(--paper); display: grid; place-items: center; font-size: 0.7rem; font-weight: 700; }
.c-head .posted {
  margin-left: auto; font-family: var(--mono); font-size: 0.7rem; color: var(--ok);
  border: 1px solid var(--ok); border-radius: 4px; padding: 2px 7px; background: var(--ok-soft);
}
.c-body { padding: 12px 14px; display: grid; gap: 8px; }
.c-title { font-family: var(--display); font-weight: 700; font-size: 1rem; }
.c-meta { color: var(--muted); font-family: var(--mono); font-size: 0.72rem; }
.c-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.c-list li { display: grid; grid-template-columns: 16px 1fr; gap: 8px; align-items: start; }
.c-list .box { width: 13px; height: 13px; border: 1.5px solid var(--line-strong); border-radius: 3px; margin-top: 3px; }
.c-list small { display: block; color: var(--muted); font-size: 0.74rem; }
.c-line { color: var(--ink-2); }
.c-line b.accent { color: var(--accent-ink); }

/* Sections */
section { padding-block: 56px; }
.section-head { display: grid; gap: 10px; max-width: 46em; margin-bottom: 32px; }
.section-head p { color: var(--ink-2); }
.figures { display: grid; gap: 40px; }
figure.diagram { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px; overflow-x: auto; }
figure.diagram svg { display: block; width: 100%; max-width: 100%; height: auto; min-width: 560px; }
figure.diagram figcaption { margin-top: 14px; color: var(--ink-2); font-size: 0.95rem; max-width: 60em; }
figure.diagram figcaption b { color: var(--ink); }

/* SVG parts */
.d-box { fill: var(--surface); stroke: currentColor; stroke-width: 1.2; }
.d-box.q { stroke-dasharray: 4 3; }
.d-box.hi { stroke: var(--accent); stroke-width: 1.6; fill: var(--accent-soft); }
.d-box.ok { stroke: var(--ok); fill: var(--ok-soft); }
.d-title { font: 600 13px var(--body); fill: currentColor; }
.d-sub { font: 11px var(--mono); fill: var(--muted); }
.d-edge { font: 11px var(--mono); fill: var(--muted); }
.d-edge.yes { fill: var(--ok); font-weight: 600; }
.d-edge.no { fill: var(--accent-ink); font-weight: 600; }
.d-line { stroke: currentColor; stroke-width: 1.2; fill: none; }
.d-flow { stroke: var(--accent); stroke-width: 1.6; fill: none; stroke-dasharray: 5 6; }
.d-clock { fill: var(--accent); }
.d-clock-label { font: 600 11px var(--mono); fill: #fff; }

/* What it is not */
.nots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 40px; }
.nots div { border-left: 2px solid var(--line-strong); padding-left: 16px; display: grid; gap: 6px; }
.nots h3 { font-size: 1.05rem; }
.nots p { color: var(--ink-2); font-size: 0.97rem; }

/* Commands */
.cmds { display: grid; gap: 10px; }
.cmd {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: baseline;
  padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.cmd:hover { transform: translateX(4px); border-color: var(--line-strong); }
.cmd code { font-size: 0.9rem; word-break: break-word; }
.cmd .what { color: var(--ink-2); font-size: 0.95rem; }
.cmd .out { display: block; margin-top: 6px; font-family: var(--mono); font-size: 0.74rem; color: var(--muted); }
.cmd .out b { color: var(--ok); font-weight: 500; }

/* Footer */
footer { border-top: 1px solid var(--line); padding-block: 28px 40px; color: var(--muted); font-size: 0.9rem; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
footer a { color: var(--ink-2); }

/* Docs layout */
.docs { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 48px; padding-block: 40px 80px; }
.toc { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 72px); align-self: start; display: grid; gap: 4px; font-size: 0.92rem; }
.toc a { text-decoration: none; color: var(--ink-2); padding: 5px 10px; border-left: 2px solid transparent; border-radius: 0 4px 4px 0; }
.toc a:hover { color: var(--ink); background: var(--code-bg); }
.toc a.active { color: var(--ink); border-left-color: var(--accent); }
.toc .group { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 14px 0 4px 10px; }
.doc { display: grid; gap: 48px; max-width: 46em; }
.doc article { display: grid; gap: 14px; scroll-margin-top: 90px; }
.doc h2 { font-size: 1.55rem; }
.doc h3 { margin-top: 8px; }
.doc p, .doc li { color: var(--ink-2); }
.doc ul, .doc ol { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.doc th, .doc td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { font-weight: 600; color: var(--ink); font-size: 0.85rem; }
.doc td:first-child { white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.note { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 12px 14px; border-radius: 0 6px 6px 0; }
.note.ok { border-left-color: var(--ok); background: var(--ok-soft); }
.doc-intro { padding-block: 40px 0; display: grid; gap: 10px; }

/* Motion: the session plays once on load - each screen in turn, the timeline
   filling between them, the comment stamped at the end. Everything is visible
   at rest; the animation only moves a highlight across it. */
@keyframes focus {
  0%, 100% { outline-color: transparent; transform: none; }
  12%, 88% { outline-color: var(--accent); transform: translateY(-4px); }
}
@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 0 4px var(--accent-soft); }
  50%      { transform: translate(-50%, -50%) scale(1.4); box-shadow: 0 0 0 12px var(--accent-soft); }
}
@keyframes fill { from { width: 0; } to { width: 75%; } }
@keyframes dot { to { background: var(--accent); border-color: var(--accent); } }
@keyframes stamp {
  0%   { transform: scale(1.6) rotate(-6deg); opacity: 0; }
  60%  { transform: scale(0.95) rotate(0deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes flow { to { stroke-dashoffset: -22; } }

.session.play .shot-card:nth-child(1) .shot { animation: focus 1.6s ease both 0.4s; }
.session.play .shot-card:nth-child(2) .shot { animation: focus 1.6s ease both 2.1s; }
.session.play .shot-card:nth-child(3) .shot { animation: focus 1.6s ease both 3.9s; }
.session.play .shot-card:nth-child(4) .shot { animation: focus 1.6s ease both 5.6s; }
.session.play .shot-card:nth-child(1) .tap { animation: pulse 0.9s ease-out both 0.7s; }
.session.play .shot-card:nth-child(2) .tap { animation: pulse 0.9s ease-out both 2.4s; }
.session.play .shot-card:nth-child(4) .tap { animation: pulse 0.9s ease-out both 5.9s; }
.session.play .timeline .progress { animation: fill 5.2s linear both 0.4s; }
.session.play .timeline i:nth-of-type(1) { animation: dot 0.3s ease-out both 0.4s; }
.session.play .timeline i:nth-of-type(2) { animation: dot 0.3s ease-out both 2.1s; }
.session.play .timeline i:nth-of-type(3) { animation: dot 0.3s ease-out both 3.9s; }
.session.play .timeline i:nth-of-type(4) { animation: dot 0.3s ease-out both 5.6s; }
.posted { animation: stamp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both 7.3s; }
.d-flow { animation: flow 1.4s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .session.play .shot-card .shot, .session.play .tap, .session.play .timeline .progress, .session.play .timeline i, .posted, .d-flow { animation: none; }
  .timeline .progress { width: 75%; }
  .timeline i { background: var(--accent); border-color: var(--accent); }
  .btn:hover, .cmd:hover, .shot-card:hover .shot { transform: none; }
}

/* Responsive */
@media (max-width: 900px) {
  .hero-top { grid-template-columns: 1fr; gap: 28px; }
  .docs { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .toc .group { display: none; }
  .toc a { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; }
  .toc a.active { border-color: var(--accent); }
}
@media (max-width: 700px) {
  .row { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 420px; }
  .timeline { display: none; }
}
@media (max-width: 600px) {
  .nav-links { gap: 14px; font-size: 0.9rem; }
  .nots { grid-template-columns: 1fr; }
  .cmd { grid-template-columns: 1fr; gap: 8px; }
  section { padding-block: 40px; }
}
.doc h3[id] { scroll-margin-top: 90px; }
