/* ─── Walkthrough: chooser → tour → finale ──────────────────────────────────
   The layout follows the app's own onboarding (onboarding-flow.css), built on
   this site's tokens. The tour sizes its screenshot from the viewport height,
   so image and guide fit one screen on desktop. */

:root {
  --wt-bar-h: 52px;
  --wt-gap: 16px;
  --wt-pad: 24px;
  --wt-guide-w: 720px;
  --wt-guide-side-w: 340px;
  --wt-scrim: rgba(0, 0, 0, 0.72);
}

/* This page has its own bar instead of the floating site nav. */
body.wt-page { padding-top: 0; min-height: 100vh; background: var(--bg-chrome); }

.wt-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  height: var(--wt-bar-h); padding: 0 var(--wt-pad);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-elev); border-bottom: 1px solid var(--line);
}
.wt-brand { font-size: 19px; }
.wt-brand .brand-mark-img { width: 28px; height: 28px; }

.wt-main { min-height: 100vh; padding-top: var(--wt-bar-h); display: flex; flex-direction: column; }
.wt-main > [hidden] { display: none; }

/* ─── Chooser ─── */
.wt-chooser {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 28px; padding: var(--wt-pad); text-align: center; background: var(--bg);
}
.wt-chooser__title { font-family: var(--font-sans); font-weight: 400; font-size: clamp(30px, 4vw, 46px); letter-spacing: -0.02em; line-height: 1.1; }
.wt-chooser__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ─── Tour ─── */
.wt-tour {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--wt-gap);
  padding: var(--wt-gap) var(--wt-pad) var(--wt-pad);
}
/* The frame takes the image's own shape (--shot-ratio, set from the loaded image):
   as wide as the height left over by the bar and the guide allows. */
.wt-shot {
  flex: none; margin: 0; aspect-ratio: var(--shot-ratio, 16 / 9);
  width: min(100%, 1400px, calc((100vh - 290px) * var(--shot-ratio, 16 / 9)));
  border: 1px solid var(--line); border-radius: var(--radius-l);
  overflow: hidden; background: var(--bg-elev); box-shadow: var(--shadow-md);
}
.wt-shot img { width: 100%; height: 100%; object-fit: contain; }

.wt-guide {
  flex: none; width: min(100%, var(--wt-guide-w));
  padding: 18px 22px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-l);
}
.wt-count { font-size: 13px; color: var(--hint); font-variant-numeric: tabular-nums; }
.wt-guide h1 { margin: 4px 0; font-size: 22px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.wt-guide p { font-size: 16px; line-height: 1.5; color: var(--hint); max-width: 62ch; }
.wt-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }

.wt-progress { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
/* The dot is small; the padding around it is the click target. */
.wt-progress button { position: relative; width: 6px; height: 6px; border-radius: 999px; background: var(--line-strong); transition: background .15s; }
.wt-progress button::after { content: ''; position: absolute; inset: -9px -2px; }
.wt-progress button.is-done { background: color-mix(in srgb, var(--coral) 45%, var(--line-strong)); }
.wt-progress button.is-active { width: 18px; background: var(--coral); }

/* Wide but short screens (a laptop at 150% zoom): the guide moves beside the
   image, which then gets nearly the full height. */
@media (max-height: 720px) and (min-width: 1000px) {
  .wt-tour { flex-direction: row; }
  .wt-shot { width: min(calc(100% - var(--wt-guide-side-w) - var(--wt-gap)), calc((100vh - 120px) * var(--shot-ratio, 16 / 9))); }
  .wt-guide { width: var(--wt-guide-side-w); }
  .wt-actions { flex-wrap: wrap; }
  .wt-progress { order: 3; width: 100%; }
}
/* Narrow screens: the image takes the width and the page may scroll. */
@media (max-width: 700px) {
  :root { --wt-pad: 14px; }
  .wt-tour { justify-content: flex-start; }
  .wt-shot { width: 100%; }
  .wt-progress { display: none; }
  .wt-chooser__actions { flex-direction: column; width: 100%; max-width: 320px; }
  .wt-actions .btn { height: 44px; }
}

/* ─── Finale: Home dims behind one square card ─── */
@keyframes wt-finale-in { from { opacity: 0; } to { opacity: 1; } }
.wt-finale {
  position: relative; flex: 1; overflow: hidden;
  display: flex; align-items: center; justify-content: center; padding: var(--wt-pad);
  animation: wt-finale-in .2s ease both;
}
.wt-finale__backdrop { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: top left; }
.wt-finale::before { content: ''; position: absolute; inset: 0; z-index: 1; background: var(--wt-scrim); }
.wt-finale__card {
  position: relative; z-index: 2;
  width: 340px; max-width: 100%; aspect-ratio: 1; padding: 32px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
}
.wt-finale__name { margin-top: 12px; font-size: 42px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.wt-finale__line { margin-top: 4px; font-size: 20px; color: var(--hint); }
.wt-finale__cta { width: 100%; margin-top: 20px; }

/* Keyboard focus is always visible on this page's controls. */
.wt-page .btn:focus-visible, .wt-progress button:focus-visible, .wt-brand:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }

.wt-noscript { padding: 96px var(--wt-pad); text-align: center; }
.wt-noscript a { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .wt-finale { animation: none; }
  .wt-progress button { transition: none; }
}
