/* ============================================================================
   Walkthrough hero — steps beside an HTML phone that plays them (wordpress-app-site
   skill kit, restyled with the theme tokens). The phone is a 320 × 695 canvas (the app
   captures × 4/9) scaled into the device by ONE factor, --k. Screens: the two
   walkthrough-phone-*.css files.
   ========================================================================== */

/* ---------- hero grid: copy + steps left, phone right (mobile: copy → phone → steps) */
.fmd-hero { position: relative; overflow: clip; padding-block: clamp(30px, 5vw, 64px) clamp(36px, 5vw, 64px); }
.fmd-hero__grid {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  grid-template-areas: "copy phone" "tour phone"; column-gap: clamp(28px, 4vw, 60px); align-items: center;
}
.fmd-hero__copy { grid-area: copy; align-self: end; }
.fmd-hero__phone { grid-area: phone; position: relative; display: grid; place-items: center; padding-block: 8px; }
.fmd-tour { grid-area: tour; align-self: start; min-width: 0; max-width: 540px; margin-top: 34px; }

/* A slow warm light behind the phone — the old hero's glow, now clipped by the section. */
.fmd-hero__halo {
  position: absolute; inset: 4% -8%; z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 138, 93, .34), transparent 72%);
  animation: wGlowDrift 9s ease-in-out infinite;
}

/* ---------- the steps: all in ONE grid cell, so switching never moves the page */
.fmd-tour__eyebrow {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
}
.fmd-tour__eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(255, 106, 77, .5); animation: fmdPulse 2s ease-out infinite; }
@keyframes fmdPulse { 70% { box-shadow: 0 0 0 8px rgba(255, 106, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 106, 77, 0); } }

.fmd-tour__list { display: grid; margin: 14px 0 0; padding: 0; list-style: none; }
.fmd-tour__item {
  grid-area: 1 / 1; display: flex; gap: 16px; align-items: flex-start;
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .4s ease, transform .4s cubic-bezier(.2, .8, .2, 1);
}
.fmd-tour__item.is-active { opacity: 1; transform: none; pointer-events: auto; }
.fmd-tour__num {
  flex: none; min-width: 50px; font-size: 40px; line-height: 1; font-weight: 900; letter-spacing: -.03em;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.fmd-tour__text { min-width: 0; }
/* A highlighter stroke under the title, like a note in the margin. */
.fmd-tour__title {
  display: inline; font-size: 25px; line-height: 1.3; font-weight: 900; color: var(--ink);
  background: linear-gradient(transparent 60%, var(--fmd-marker) 60%, var(--fmd-marker) 92%, transparent 92%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 4px; margin: 0 -4px;
}
.fmd-tour { --fmd-marker: rgba(255, 138, 93, .3); }
:root[data-theme="dark"] .fmd-tour { --fmd-marker: rgba(255, 106, 77, .34); }
.fmd-tour__desc { display: block; margin-top: 9px; font-size: 15.5px; line-height: 1.62; color: var(--ink-2); font-weight: 500; }

/* ---------- step results (tags): hidden until the phone gets there — only once the engine is
   live, so without JS they read as plain text. .is-flying hands motion to the scripted flight. */
.fmd-tour__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.fmd-tour__tag {
  display: inline-flex; align-items: baseline; flex-wrap: wrap; column-gap: 6px; max-width: 100%;
  padding: 7px 13px; border-radius: 14px; background: var(--surface); border: 1px solid var(--card-border);
  box-shadow: var(--shadow-pill); font-weight: 700; font-size: 13.5px; line-height: 1.35; color: var(--ink-2);
}
.fmd-tour__tag b { font-size: 15px; font-weight: 900; color: var(--accent); }
.fmd-tour.is-live .fmd-tour__tag { opacity: 0; transform: translateY(6px) scale(.92); }
.fmd-tour.is-live .fmd-tour__tag.is-in { opacity: 1; transform: none; transition: opacity .3s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.fmd-tour__tag.is-flying { position: relative; z-index: 6; transition: none; }
/* The phone element a tag comes from: one ring, outward (outline keeps the card's own shadow). */
.fmd-app .is-spot { animation: fmdSpot 1.5s ease-out; }
@keyframes fmdSpot {
  0% { outline: 2.5px solid rgba(255, 176, 32, .95); outline-offset: 0; }
  100% { outline: 2.5px solid rgba(255, 176, 32, 0); outline-offset: 12px; }
}

/* ---------- rail + pause */
.fmd-tour__controls { display: flex; align-items: center; gap: 14px; margin-top: 24px; }
.fmd-tour__rail { flex: 1; display: grid; grid-template-columns: repeat(var(--steps, 5), minmax(0, 1fr)); gap: 10px; }
.fmd-tour__dot {
  appearance: none; display: flex; flex-direction: column; gap: 7px; min-width: 0; padding: 6px 0; margin: 0;
  border: 0; background: none; cursor: pointer; text-align: left;
  font-family: inherit; font-weight: 800; font-size: 13px; line-height: 1; color: var(--ink-3);
}
.fmd-tour__dot:hover, .fmd-tour__dot[aria-current="step"] { color: var(--ink); }
.fmd-tour__dot:focus-visible, .fmd-tour__pause:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.fmd-tour__dot-bar { display: block; height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.fmd-tour__dot-bar i { display: block; width: 100%; height: 100%; background: var(--grad-brand); transform: scaleX(0); transform-origin: 0 50%; }
.fmd-tour__dot.is-done .fmd-tour__dot-bar i { transform: none; }
.fmd-tour__pause {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; cursor: pointer;
  border: 1px solid var(--card-border); border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pill);
}
/* Pause bars ↔ play triangle, drawn so no icon font is needed. */
.fmd-tour__pause-i { position: relative; display: block; width: 12px; height: 14px; }
.fmd-tour__pause-i::before, .fmd-tour__pause-i::after { content: ""; position: absolute; top: 0; width: 4px; height: 14px; border-radius: 1.5px; background: currentColor; }
.fmd-tour__pause-i::before { left: 0; }
.fmd-tour__pause-i::after { right: 0; }
.fmd-tour__pause[aria-pressed="true"] .fmd-tour__pause-i::before {
  left: 2px; width: 0; height: 0; border-radius: 0; background: none;
  border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent currentColor;
}
.fmd-tour__pause[aria-pressed="true"] .fmd-tour__pause-i::after { display: none; }
.fmd-tour.is-static .fmd-tour__pause { display: none; } /* nothing plays under reduced motion */
.fmd-tour:not(.is-live) .fmd-tour__controls { display: none; } /* without JS the rail can't do anything */
.fmd-tour__note { margin: 14px 0 0; font-weight: 600; font-size: 12.5px; color: var(--ink-3); }
.fmd-tour__note a { font-weight: 800; white-space: nowrap; }

/* ---------- the device */
.fmd-hero__phone, .fmd-device { --pw: 300; }
.fmd-device {
  position: relative; z-index: 1; flex: none; width: calc(var(--pw) * 1px); padding: 6px;
  background: #15110E; border-radius: calc(var(--pw) * 1px / 6.6);
  box-shadow: 0 0 0 2px #2A221C, 0 0 0 3.5px #4A3D33, var(--shadow-phone);
  animation: wFloat 7s ease-in-out infinite;
}
.fmd-device__island {
  position: absolute; z-index: 5; left: 50%; top: calc(var(--pw) * 1px / 30); width: 28%; height: calc(var(--pw) * 1px / 12);
  transform: translateX(-50%); border-radius: 99px; background: #000;
}
.fmd-device__screen {
  --k: calc((var(--pw) - 12) / 320);
  position: relative; overflow: hidden; isolation: isolate; width: 100%; aspect-ratio: 640 / 1390;
  border-radius: calc(var(--pw) * 1px / 7.6); background: #191512;
}

/* The visitor's finger. */
.fmd-app__finger {
  position: absolute; left: 0; top: 0; z-index: 40; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  background: rgba(255, 255, 255, .5); border: 2px solid rgba(255, 255, 255, .85); box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  transform: translate(var(--fx, 160px), var(--fy, 420px)) scale(.6); opacity: 0; pointer-events: none;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .2s;
}
.fmd-app__finger.is-on { opacity: 1; transform: translate(var(--fx), var(--fy)) scale(1); }
.fmd-app__finger.is-down { transform: translate(var(--fx), var(--fy)) scale(.8); background: rgba(255, 255, 255, .75); }

/* Confetti the engine drops for a celebration. */
.fmd-confetti { position: absolute; inset: 0; z-index: 38; overflow: hidden; pointer-events: none; }
.fmd-confetti i { position: absolute; width: 7px; height: 10px; border-radius: 2px; animation: fmdFall var(--fall) ease-in var(--delay) forwards; }
@keyframes fmdFall { to { transform: translate(var(--drift), var(--drop)) rotate(var(--spin)); opacity: 0; } }

/* ---------- smaller screens */
@media (max-width: 1100px) { .fmd-hero__phone, .fmd-device { --pw: 284; } .fmd-tour__title { font-size: 23px; } }
@media (max-width: 900px) {
  .fmd-hero__grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "phone" "tour"; }
  .fmd-hero__copy { align-self: auto; text-align: center; }
  .fmd-hero__copy .hero__subtitle { margin-inline: auto; }
  .fmd-hero__copy .stores, .fmd-hero__copy .hero__meta { justify-content: center; }
  .fmd-hero__phone { margin-top: 26px; }
  .fmd-hero__phone, .fmd-device { --pw: 264; }
  .fmd-tour { margin: 26px auto 0; max-width: 560px; }
  .fmd-tour__num { font-size: 32px; min-width: 42px; }
  .fmd-tour__title { font-size: 21px; }
  .fmd-tour__desc { font-size: 15px; }
  .fmd-tour__rail { gap: 7px; }
}
@media (max-width: 380px) { .fmd-hero__phone, .fmd-device { --pw: 244; } .fmd-tour__item { gap: 12px; } }
@media (prefers-reduced-motion: reduce) {
  .fmd-tour__item, .fmd-tour__tag { transition: none; }
  .fmd-app__finger { display: none; }
}
