/* Walkthrough frame — shared by every sample funnel. Carries its own minimal
   reset (sample pages do not load styles/base.css). Frame classes are jvf-*. */
.jvf { margin: 0; }
/* Focused fields must not hide under the sticky bar (height set by frame.js). */
html { scroll-padding-top: var(--jvf-chrome-h, 110px); }
.jvf-chrome, .jvf-chrome *, .jvf-chrome *::before, .jvf-chrome *::after,
.jvf-end, .jvf-end * { box-sizing: border-box; }

/* One step at a time when JS runs; without JS every section stacks. */
.jvf--js [data-step]:not(.jvf-current) { display: none; }

/* ---- Top chrome ---- */
.jvf-chrome {
  position: sticky; top: 0; z-index: 50;
  font-family: var(--font-body); font-size: 14px; line-height: 1.4;
}
.jvf-steps {
  display: flex; gap: var(--space-2); align-items: center;
  background: var(--color-primary); padding: var(--space-2) var(--space-3);
  overflow-x: auto; scrollbar-width: none;
}
.jvf-steps::-webkit-scrollbar { display: none; }
.jvf-step {
  position: relative; display: inline-flex; align-items: center; gap: var(--space-2); flex: none;
  min-height: 36px; padding: 0 var(--space-3) 0 var(--space-2);
  border-radius: var(--radius-full); color: var(--color-on-dark);
  text-decoration: none; font-weight: 500; white-space: nowrap;
}
.jvf-step:hover { background: var(--color-primary-ink); }
.jvf-step:focus-visible, .jvf-back:focus-visible,
.jvf-cta:focus-visible, .jvf-end-link:focus-visible {
  outline: 3px solid var(--color-accent); outline-offset: 2px;
}
.jvf-step-n {
  display: inline-grid; place-items: center; width: 24px; height: 24px;
  border-radius: var(--radius-full); border: 1px solid currentColor; font-size: 12px;
}
.jvf-step[aria-current="step"] { background: var(--color-accent); color: var(--color-accent-ink); }
.jvf-step[aria-current="step"] .jvf-step-n { border-color: var(--color-accent-ink); }

.jvf-strip {
  display: flex; align-items: center; justify-content: flex-end;
  padding: var(--space-3);
  background: var(--color-highlight); color: var(--color-highlight-ink);
  border-bottom: 1px solid var(--color-border);
}
.jvf-tools { display: flex; align-items: center; gap: var(--space-3); }
.jvf-back { color: var(--color-link); font-weight: 500; text-decoration: underline; }

@media (max-width: 720px) {
  /* Hidden visually, still read by screen readers. */
  .jvf-step:not([aria-current="step"]) .jvf-step-label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .jvf-step:not([aria-current="step"]) { padding-right: var(--space-2); }
}

/* ---- Closing card ---- */
.jvf-end {
  min-height: 70vh; min-height: calc(100dvh - var(--jvf-chrome-h, 110px)); display: grid; place-items: center; padding: var(--space-5) var(--space-3);
  background: var(--color-primary); color: var(--color-on-dark); font-family: var(--font-body);
}
.jvf-end-card { max-width: 520px; text-align: center; }
.jvf-end-title { margin: 0 0 var(--space-3); font: 700 clamp(26px, 5vw, 36px)/1.2 var(--font-display); }
.jvf-end-text { margin: 0 0 var(--space-4); font-size: 17px; line-height: 1.6; }
.jvf-cta {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap);
  padding: 0 var(--space-4); border-radius: var(--radius-full);
  background: var(--color-accent); color: var(--color-accent-ink);
  font: 500 16px/1 var(--font-body); text-decoration: none;
}
.jvf-cta:hover { filter: brightness(1.06); }
.jvf-end-link { display: block; margin-top: var(--space-3); color: var(--color-on-dark); text-decoration: underline; }

/* Each step fades in gently when it is shown. */
.jvf--js [data-step].jvf-current { animation: jvf-step-in 0.4s ease both; }
@keyframes jvf-step-in { from { opacity: 0; } to { opacity: 1; } }

/* Scroll reveal: frame.js adds .jvf--reveal only when motion is allowed. */
.jvf--reveal [data-reveal] > * { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.jvf--reveal [data-reveal].jvf-revealed > * { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .jvf-step, .jvf-cta, .jvf--js [data-step].jvf-current { animation: none; transition: none; }
}
