/* ============================================================
   Mira verify-walk — scroll-driven verification walkthrough.
   Owned by Agent B. Imports nothing; colors/type/space come ONLY
   from tokens.css custom properties. Animation is transform +
   opacity only. Full prefers-reduced-motion fallback at bottom.
   ============================================================ */

#verify-walk {
  position: relative;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--paper);
}
#verify-walk *,
#verify-walk *::before,
#verify-walk *::after { box-sizing: border-box; margin: 0; padding: 0; }

#verify-walk button {
  font-family: var(--font-ui);
  cursor: pointer;
}
#verify-walk button:focus-visible,
#verify-walk a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.vw-sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- track + pinned stage (scroll mode) ---------- */
.vw-track { position: relative; }
.vw-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.vw-mode-tap .vw-track { height: auto !important; }
.vw-mode-tap .vw-stage {
  position: relative;
  height: auto;
  min-height: 78dvh;
  overflow: visible;
}

/* Layers stack in one grid cell: the container is always as tall as
   its tallest layer, so tap mode never clips content. */
.vw-layers {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
}

/* ---------- layers ---------- */
.vw-layer {
  grid-area: 1 / 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.25rem 3.5rem;
  opacity: 0;
  transform: translateY(34px);
  transition:
    opacity 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
  pointer-events: none;
}
.vw-layer.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition-delay: 0.1s;
}
.vw-layer.is-past { transform: translateY(-26px); }

.vw-eyebrow {
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 0.9rem;
}
.vw-h {
  font-size: var(--fs-h2);
  line-height: 1.15;
  font-weight: 700;
  max-width: 18em;
}
.vw-sub {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink-soft);
  max-width: var(--maxw-prose);
  margin-top: 0.9rem;
}

/* step 1: the question */
.vw-question {
  font-size: var(--fs-hero);
  line-height: 1.12;
  font-weight: 700;
  max-width: 15em;
}

/* ---------- step 2: retrieval slate ---------- */
.vw-slate {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  width: 100%;
  max-width: var(--maxw-wide);
  margin: 1.5rem auto 0;
  text-align: left;
}
.vw-card {
  background: var(--paper-raised);
  border: 1.5px solid var(--line); /* arch-58: match site card borders */
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 0.5rem 0.65rem;
  font-size: var(--fs-small);
  line-height: 1.35;
  min-width: 0;
  opacity: 0;
  transform: translateY(24px) rotate(var(--vw-r, 0deg)) scale(0.95);
  transition:
    opacity 0.5s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: var(--vw-d, 0ms);
}
.vw-layer.is-active .vw-card { opacity: 1; transform: none; }
.vw-card .vw-rank { color: var(--ink-faint); margin-right: 0.35em; }
.vw-card .vw-id {
  color: var(--gold);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.vw-card .vw-snip {
  display: block;
  color: var(--ink-soft);
  margin-top: 0.2rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.vw-card.vw-win {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-card);
}
.vw-card.vw-win .vw-tag {
  display: block;
  color: var(--accent-deep);
  font-weight: 700;
  font-size: var(--fs-small);
  margin-top: 0.25rem;
}

/* ---------- step 3: the claim ---------- */
.vw-claimcard {
  background: var(--paper-raised);
  border: 1.5px solid var(--line); /* arch-58: match site card borders */
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--pad-card);
  width: 100%;
  max-width: var(--maxw-prose);
  margin: 1.5rem auto 0;
  text-align: left;
}
.vw-kv {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin-bottom: 0.9rem;
}
.vw-kv dt {
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.vw-kv dd { font-weight: 700; color: var(--ink); }
.vw-kv dd.vw-id { color: var(--gold); }

.vw-law {
  font-family: var(--font-law);
  font-size: 1.22rem;
  line-height: 1.5;
  border-left: 3px solid var(--gold);
  padding-left: 1rem;
  color: var(--ink);
}

/* ---------- step 4: the five checks ---------- */
.vw-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: var(--maxw-prose);
  margin: 1.4rem auto 0;
  text-align: left;
}
.vw-check {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  background: var(--paper-raised);
  border: 1.5px solid var(--line); /* arch-58: match site card borders */
  border-radius: var(--radius);
  padding: 0.75rem 0.95rem;
  opacity: 0.35;
  transform: translateY(8px);
  transition:
    opacity 0.5s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1),
    border-color 0.5s ease;
}
.vw-check.is-on { opacity: 1; transform: none; }
.vw-check.is-now[data-pass="true"] { border-color: var(--accent); }
.vw-check.is-now[data-pass="false"] { border-color: var(--refuse); }

.vw-lamp {
  flex: none;
  width: 1.45rem;
  height: 1.45rem;
  margin-top: 0.1rem;
  border-radius: 50%;
  border: 2px solid var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--paper-raised);
  transition: background 0.45s ease, border-color 0.45s ease;
}
.vw-check.is-on[data-pass="true"] .vw-lamp {
  background: var(--accent);
  border-color: var(--accent);
}
.vw-check.is-on[data-pass="true"] .vw-lamp::after { content: "\2713"; }
.vw-check.is-on[data-pass="false"] .vw-lamp {
  background: var(--refuse);
  border-color: var(--refuse);
}
.vw-check.is-on[data-pass="false"] .vw-lamp::after { content: "\2715"; }

.vw-check-body { flex: 1; min-width: 0; }
.vw-check-name { font-weight: 700; font-size: var(--fs-body); }
.vw-check-catch {
  display: block;
  color: var(--ink-soft);
  font-size: var(--fs-small);
  margin-top: 0.15rem;
}
.vw-check-code {
  display: block;
  color: var(--ink-faint);
  font-size: var(--fs-small);
  margin-top: 0.15rem;
}
.vw-state {
  flex: none;
  font-weight: 700;
  font-size: var(--fs-small);
  margin-top: 0.25rem;
  opacity: 0;
  transition: opacity 0.45s ease 0.1s;
}
.vw-check.is-on .vw-state { opacity: 1; }
.vw-check[data-pass="true"] .vw-state { color: var(--accent-deep); }
.vw-check[data-pass="false"] .vw-state { color: var(--refuse); }
.vw-check .vw-why {
  display: block;
  color: var(--refuse);
  font-size: var(--fs-small);
  margin-top: 0.25rem;
}

/* ---------- step 5: verdict ---------- */
.vw-verdict-card {
  background: var(--paper-raised);
  border: 1.5px solid var(--line); /* arch-58: match site card borders */
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--pad-card);
  width: 100%;
  max-width: var(--maxw-prose);
  margin: 1.4rem auto 0;
  text-align: left;
}
.vw-seal {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-wash);
  color: var(--accent-deep);
  border-radius: var(--radius-chip);
  padding: 0.4rem 0.95rem 0.4rem 0.5rem;
  font-weight: 700;
  font-size: var(--fs-small);
  margin-bottom: 0.9rem;
}
.vw-seal .vw-tick {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--paper-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}
.vw-verdict-quote {
  font-family: var(--font-law);
  font-size: 1.35rem;
  line-height: 1.5;
  margin: 0.4rem 0 0.8rem;
}
.vw-cite {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  align-items: baseline;
  font-size: var(--fs-small);
  color: var(--ink-soft);
}
.vw-cite .vw-sec { color: var(--gold); font-weight: 700; }
.vw-meta {
  font-size: var(--fs-small);
  color: var(--ink-faint);
  margin-top: 0.8rem;
}
.vw-en-note {
  font-size: var(--fs-small);
  color: var(--ink-soft);
  border-top: 1px dashed var(--line);
  padding-top: 0.7rem;
  margin-top: 0.9rem;
}

/* ---------- step 6: the refusal ---------- */
.vw-seq {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.5s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: var(--vw-d, 0ms);
}
.vw-layer.is-active .vw-seq { opacity: 1; transform: none; }

.vw-fail-q {
  font-family: var(--font-ui);
  font-size: var(--fs-h3);
  font-weight: 700;
  margin-top: 1rem;
  max-width: var(--maxw-prose);
}
.vw-fail-note {
  font-size: var(--fs-small);
  color: var(--ink-faint);
  margin-top: 0.2rem;
}
.vw-fail-steps {
  list-style: none;
  margin: 1.1rem auto 0;
  max-width: var(--maxw-prose);
  color: var(--ink-soft);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}
.vw-fail-steps li { margin-top: 0.2rem; }
.vw-lamps-off {
  display: flex;
  gap: 0.45rem;
  justify-content: center;
  margin-top: 1rem;
}
.vw-lamps-off span {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 2px solid var(--line);
}
.vw-refusal {
  background: var(--refuse-wash);
  border: 1px solid var(--refuse);
  border-radius: var(--radius);
  padding: var(--pad-card);
  width: 100%;
  max-width: var(--maxw-prose);
  margin: 1.2rem auto 0;
  text-align: left;
}
.vw-refusal h4 {
  font-size: var(--fs-h3);
  line-height: 1.3;
  color: var(--ink);
}
.vw-refusal .vw-promise {
  color: var(--refuse);
  font-weight: 700;
  margin-top: 0.6rem;
}

/* ---------- step 7: kicker ---------- */
.vw-kick {
  font-size: var(--fs-hero);
  line-height: 1.1;
  font-weight: 700;
  max-width: 12em;
}
.vw-kick .vw-dot-accent { color: var(--accent); }

/* ---------- hint + rail + nav ---------- */
.vw-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1.1rem;
  text-align: center;
  font-size: var(--fs-small);
  color: var(--ink-faint);
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.vw-hint.vw-hide { opacity: 0; }

.vw-rail {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  list-style: none;
}
.vw-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: var(--radius-chip);
  border: 2px solid var(--ink-faint);
  background: transparent;
  padding: 0;
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.vw-dot[aria-current="step"] {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.2);
}

.vw-nav {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  align-items: center;
  padding: 0.4rem 1.25rem 1.6rem;
}
.vw-btn {
  font-size: var(--fs-body);
  font-weight: 700;
  min-height: 48px;
  padding: 0.6rem 1.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--paper-raised);
}
.vw-btn:hover:not([disabled]) { background: var(--accent-deep); border-color: var(--accent-deep); } /* arch-58 */
.vw-btn:active { background: var(--accent-deep); border-color: var(--accent-deep); }
.vw-btn[disabled] { opacity: 0.4; cursor: default; }
.vw-btn-ghost {
  background: transparent;
  color: var(--accent-deep);
  border: 1px solid var(--line);
}
.vw-btn-ghost:hover:not([disabled]) { background: var(--accent-wash); border-color: var(--accent); } /* arch-58 */
.vw-dot:hover { border-color: var(--accent); } /* arch-58 */
.vw-step-count {
  font-size: var(--fs-small);
  color: var(--ink-faint);
  min-width: 6.5em;
  text-align: center;
}

.vw-error {
  padding: var(--space-section) 1.25rem;
  text-align: center;
  color: var(--ink-soft);
}

/* ---------- narrow screens (tap mode is chosen by JS < 720px) ---------- */
@media (max-width: 719px) {
  .vw-slate { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; }
  .vw-card { padding: 0.4rem 0.55rem; }
  .vw-card .vw-snip { display: none; }
  .vw-card .vw-title { display: none; }
  .vw-layer { padding: 1.75rem 1rem 2.5rem; }
  .vw-mode-tap .vw-layers { padding-right: 1.6rem; }
  .vw-law { font-size: 1.1rem; }
  .vw-verdict-quote { font-size: 1.18rem; }
}

/* ============================================================
   Reduced motion: same content, clean static stepped layout.
   JS also renders .vw-mode-static; this covers both belts.
   ============================================================ */
.vw-mode-static .vw-track { height: auto !important; }
.vw-mode-static .vw-stage {
  position: static;
  height: auto;
  min-height: 0;
  overflow: visible;
  display: block;
}
.vw-mode-static .vw-layers { position: static; display: block; }
.vw-mode-static .vw-layer {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  padding: calc(var(--space-section) / 2) 1.25rem;
  border-top: 1px solid var(--line);
}
.vw-mode-static .vw-layer:first-child { border-top: 0; }
.vw-mode-static .vw-card,
.vw-mode-static .vw-seq { opacity: 1; transform: none; }
.vw-mode-static .vw-check { opacity: 1; transform: none; }
.vw-mode-static .vw-state { opacity: 1; }
.vw-mode-static .vw-hint,
.vw-mode-static .vw-rail,
.vw-mode-static .vw-nav { display: none; }

@media (prefers-reduced-motion: reduce) {
  #verify-walk *,
  #verify-walk *::before,
  #verify-walk *::after {
    transition: none !important;
    animation: none !important;
  }
}
