/* ==========================================================================
   /preview — the build-it-yourself workbench.
   A two-pane tool: the brief on the left, the page assembling on the right.

   Every class here is prefixed .pv- on purpose. design-motion-20260919.js
   sets opacity:0 on a fixed list of shared class names (.campaign-board,
   .section-heading, .campaign-example …) and reveals them on a scroll
   trigger. This page barely scrolls, so borrowing any of those names would
   leave content invisible. Keep this file's classes unique to this page.
   ========================================================================== */

/* --- nav ------------------------------------------------------------------
   .campaign-nav lives in start-20260920.css, which only /start loads. This
   page needs its own, or the flex row collapses and the wordmark stacks above
   the links. */
.pv-nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 88px; }
.pv-nav__links { display: flex; align-items: center; gap: 30px; }

/* --- progress rule across the very top ----------------------------------- */
.pv-progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 320;
  background: color-mix(in srgb, var(--border) 65%, transparent);
}
.pv-progress i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--brand-deep), var(--brand-lift), var(--signal));
  transition: width .55s var(--ease);
}

/* --- the stage ------------------------------------------------------------ */
.pv-stage {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: clamp(28px, 4.5vw, 74px);
  align-items: center;
  min-height: calc(100svh - var(--nav-h));
  padding-block: clamp(30px, 5vh, 58px) clamp(38px, 6vh, 70px);
}

/* --- left: the brief ------------------------------------------------------ */
.pv-tag {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .17em;
  color: var(--text-2);
}
.pv-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--brand-lift);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 17%, transparent);
  animation: pv-pulse 2.8s ease-in-out infinite;
}
@keyframes pv-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }

.pv-panel h1 {
  font-size: clamp(2.05rem, 3.4vw, 3.45rem);
  line-height: 1.07; letter-spacing: -.052em; margin-block: 20px 16px;
  max-width: 16ch;
}
.pv-hl {
  background: linear-gradient(106deg, var(--text) -25%, var(--brand-deep) 52%, var(--brand-lift));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pv-lede { max-width: 46ch; color: var(--text-2); margin-bottom: 30px; }

/* --- the question card ---------------------------------------------------- */
.pv-form {
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface-solid); padding: clamp(18px, 2vw, 24px);
  box-shadow: var(--shadow-card);
}
.pv-meta { display: flex; align-items: baseline; gap: 13px; margin-bottom: 15px; }
.pv-counter {
  flex: 0 0 auto; font-family: var(--font-mono); font-size: .64rem;
  letter-spacing: .15em; color: var(--text-3);
}
.pv-question {
  font-family: var(--font-display); font-size: 1rem; font-weight: 600;
  letter-spacing: -.012em;
}

/* Fixed height so the card does not jump as controls swap between steps. */
.pv-control { min-height: 122px; }

.pv-input {
  width: 100%; padding: 14px 16px; font-size: 1.02rem;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--bg-2);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.pv-input::placeholder { color: var(--text-3); }
.pv-input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 13%, transparent);
}

.pv-options { display: flex; flex-wrap: wrap; gap: 10px; }
.pv-opt {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 16px; font-size: .9rem; text-align: left;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--bg-2);
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.pv-opt:hover { border-color: var(--brand); transform: translateY(-1px); }
.pv-opt[aria-pressed='true'] {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 11%, transparent);
  color: var(--brand-pale);
}
.pv-opt__tick { color: var(--brand-lift); font-size: .82rem; opacity: 0; transform: scale(.6); transition: all .2s var(--ease); }
.pv-opt[aria-pressed='true'] .pv-opt__tick { opacity: 1; transform: scale(1); }

.pv-swatch { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px 8px 8px; }
.pv-swatch i {
  width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto;
  background: var(--sw, var(--brand));
  box-shadow: inset 0 0 0 1px #0000001f;
}
.pv-swatch[aria-pressed='true'] i { box-shadow: inset 0 0 0 1px #0000001f, 0 0 0 3px color-mix(in srgb, var(--sw) 30%, transparent); }

.pv-error { margin-top: 13px; font-size: .84rem; color: #b3261e; }
[data-theme='dark'] .pv-error { color: #ff9c92; }

.pv-actions-row { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.pv-back { font-size: .85rem; color: var(--text-2); padding: 10px 2px; transition: color .2s var(--ease); }
.pv-back:hover { color: var(--brand-pale); }
.pv-next { margin-left: auto; }

.pv-footnote {
  margin-top: 26px; font-family: var(--font-mono); font-size: .6rem;
  letter-spacing: .17em; color: var(--text-3);
}

/* --- right: the frame the page builds inside ------------------------------ */
/* The glow below reaches 7% past the preview on each side; clip it at the page
   edge so phones do not scroll sideways (was +5px at 390px wide). */
main { overflow-x: clip; }
.pv-view { position: relative; display: flex; flex-direction: column; gap: 16px; }
.pv-view::before {
  content: ''; position: absolute; left: -7%; right: -7%; top: -11%; height: 76%;
  z-index: 0; pointer-events: none;
  background: radial-gradient(54% 54% at 50% 34%, color-mix(in srgb, var(--brand) 24%, transparent), transparent 72%);
  filter: blur(46px);
}

.pv-browser {
  position: relative; z-index: 1; overflow: hidden;
  border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  background: var(--surface-solid); box-shadow: var(--shadow-lg);
}
.pv-browser__bar {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-2) 90%, var(--surface-solid));
}
.pv-lights { display: flex; gap: 5px; flex: 0 0 auto; }
.pv-lights i { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.pv-url {
  flex: 1; min-width: 0; padding: 5px 13px; overflow: hidden;
  font-family: var(--font-mono); font-size: .68rem; color: var(--text-2);
  text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.pv-badge {
  flex: 0 0 auto; font-family: var(--font-mono); font-size: .55rem;
  letter-spacing: .13em; color: var(--brand-pale);
}

.pv-browser__screen { position: relative; aspect-ratio: 16 / 10.4; background: #fff; }
.pv-browser__screen iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }

/* Sweep shown while the next version is being written. */
.pv-scan { position: absolute; inset: 0; overflow: hidden; pointer-events: none; opacity: 0; }
.pv-scan::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 32%;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--brand) 30%, transparent), transparent);
}
.pv-browser.is-building .pv-scan { opacity: 1; }
.pv-browser.is-building .pv-scan::before { animation: pv-sweep .55s linear; }
@keyframes pv-sweep { from { transform: translateX(-45%) } to { transform: translateX(330%) } }

.pv-view__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pv-view__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pv-action {
  padding: 10px 16px; font-size: .85rem;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface-solid);
  transition: border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease), opacity .2s;
}
.pv-action:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-pale); transform: translateY(-1px); }
.pv-action:disabled { opacity: .42; cursor: not-allowed; }
.pv-hint { font-size: .78rem; color: var(--text-3); max-width: 36ch; }

/* --- narrow --------------------------------------------------------------- */
@media (max-width: 1080px) {
  .pv-stage { gap: 34px; }
  .pv-panel h1 { max-width: none; }
}
@media (max-width: 900px) {
  .pv-nav { min-height: 76px; }
  .pv-nav__links { gap: 18px; }
  .pv-nav .text-link { font-size: .78rem; }
  .pv-stage {
    grid-template-columns: minmax(0, 1fr);
    align-items: start; min-height: 0;
    padding-block: 34px 52px; gap: 40px;
  }
  .pv-control { min-height: 0; }
  .pv-view { order: 2; }
  .pv-lede { max-width: none; }
  .pv-browser__screen { aspect-ratio: 16 / 11.5; }
  .pv-view__foot { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .pv-badge { display: none; }
  .pv-opt { padding: 10px 14px; font-size: .85rem; }
  .pv-actions-row { flex-wrap: wrap; }
  .pv-next { margin-left: 0; width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .pv-dot { animation: none; }
  .pv-browser.is-building .pv-scan::before { animation: none; }
  .pv-progress i { transition: none; }
  .pv-opt:hover, .pv-action:hover:not(:disabled) { transform: none; }
}
