/**
 * /features scroll story: sticky tour nav, chapters, step panels and layouts.
 * Without JS every step shows its own static phone. js/tour-story.js adds .tour-live
 * to [data-story]; then the inline phones hide and one sticky phone (desktop) or one
 * phone per chapter (mobile, sticky within the chapter) shows the active step.
 * Tokens local to this page are defined here (group colours along the purple → cyan brand).
 */
:root {
  --tour-nav-h: 58px;
  --g1: #7b61ff;
  --g2: #5a6cf5;
  --g3: #2f86e8;
  --g4: #0aa5bd;
  --stage-top: calc(var(--header-h) + var(--tour-nav-h));
}

html {
  scroll-padding-top: calc(var(--stage-top) + 12px);
}

.tour-hero__head { max-width: 820px; margin-inline: auto; }
.tour-hero .hero__actions { justify-content: center; }
.tour-hero h1 { max-width: 20ch; margin-inline: auto; font-size: clamp(2.3rem, 1.4rem + 3.2vw, 4rem); }
.tour-hero { padding-bottom: var(--sp-10); }

/* ---------------------------------------------------------- sticky tour nav */
.tour-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  border-block: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) { .tour-nav { background: var(--bg); } }
.tour-nav__inner { position: relative; display: flex; align-items: center; gap: var(--sp-3); }
.tour-nav__label {
  flex: none; font-size: var(--fs-xs); font-weight: var(--fw-bold);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted);
}
.tour-nav__list {
  flex: 1 1 auto; min-width: 0; display: flex; gap: var(--sp-1);
  margin: 0; padding: var(--sp-2) 0; list-style: none;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  -webkit-mask: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent 100%);
  mask: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent 100%);
}
.tour-nav__list::-webkit-scrollbar { display: none; }
.tour-nav__list a {
  display: inline-flex; align-items: center; gap: 0.4em; min-height: 40px; padding: 0 0.85rem;
  border-radius: var(--r-pill); color: var(--text-2); font-size: var(--fs-sm);
  font-weight: var(--fw-semibold); white-space: nowrap; text-decoration: none;
  transition: background-color var(--dur), color var(--dur);
}
.tour-nav__list a:hover { background: var(--surface-2); color: var(--text); }
.tour-nav__list a[aria-current='true'] { background: var(--cc-midnight); color: #fff; }
.tour-nav__list a span { font-variant-numeric: tabular-nums; opacity: 0.7; font-size: var(--fs-xs); }
.tour-nav__progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
  background: var(--grad-button); transform-origin: left center; transform: scaleX(0);
  transition: transform var(--dur-slow) var(--ease-out);
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .tour-nav__list a[aria-current='true'] { background: #fff; color: var(--cc-midnight); }
}
/* manual dark (theme toggle) */
:root[data-theme="dark"] .tour-nav__list a[aria-current='true'] { background: #fff; color: var(--cc-midnight); }
@media (max-width: 599px) { .tour-nav__label { display: none; } }

/* ---------------------------------------------------------- chapters (all modes) */
.story {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.story__stage { display: none; }
.chapter { --g: var(--g1); padding-block: clamp(3.5rem, 2rem + 5vw, 6.5rem) var(--sp-8); }
.chapter[data-group='2'] { --g: var(--g2); }
.chapter[data-group='3'] { --g: var(--g3); }
.chapter[data-group='4'] { --g: var(--g4); }
.chapter + .chapter { border-top: 1px solid var(--border); }
.chapter__head { max-width: 620px; }
.chapter__eyebrow { margin-bottom: var(--sp-3); color: var(--text-muted); }
.chapter__num {
  display: inline-grid; place-items: center; min-width: 2.2rem; height: 2rem; padding: 0 0.45rem;
  border-radius: 10px; background: var(--grad-button); color: #fff;
  letter-spacing: 0; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--g) 30%, transparent);
}
.chapter__head h2 {
  margin: 0; font-size: var(--fs-3xl); line-height: var(--lh-tight); letter-spacing: var(--tracking-tight);
}
.chapter__lead { margin: var(--sp-4) 0 0; }
.plan-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: var(--sp-5); }
.plan-line__label { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--text-muted); }
.plan-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.plan-row li {
  display: inline-flex; align-items: center; gap: 0.35em; padding: 0.25rem 0.7rem;
  border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: var(--fw-bold);
  background: var(--success-soft); color: var(--success);
}
.plan-row li::before {
  content: ''; width: 0.9em; height: 0.9em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.2 4L19 7' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.2 4L19 7' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.plan-row li.is-off { background: var(--surface-2); color: var(--text-muted); text-decoration: line-through; }
.plan-row li.is-off::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12h12' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12h12' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}
.plan-row li small { font-weight: var(--fw-semibold); }

.chapter__note {
  max-width: 560px; margin: var(--sp-5) 0 0; padding: var(--sp-3) var(--sp-4);
  border-left: 3px solid var(--g); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--surface-2); font-size: var(--fs-sm); color: var(--text-muted);
}

/* static phone screens: shown without JS as a scrollable strip; the live tour reuses them */
.chapter__screens {
  display: flex; gap: var(--sp-5); margin-top: var(--sp-8); padding-bottom: var(--sp-3);
  overflow-x: auto; overscroll-behavior-x: contain;
}
.tscreen { position: relative; margin: 0; flex: none; }
.tscreen .phone { --phone-w: 240px; }
.tour-live .chapter__screens { display: none; }

/* ---------------------------------------------------------- live: desktop, one sticky phone */
@media (min-width: 1024px) {
  .story.tour-live {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    column-gap: clamp(2rem, 4vw, 4.5rem);
  }
  .story.tour-live .story__stage {
    display: block;
    position: sticky;
    top: var(--stage-top);
    height: calc(100vh - var(--stage-top));
    height: calc(100svh - var(--stage-top));
  }
  .tour-live .chapter {
    display: flex; flex-direction: column; justify-content: center;
    min-height: calc(100vh - var(--stage-top));
    min-height: calc(100svh - var(--stage-top));
    padding-block: var(--sp-10);
  }
  .tour-live .chapter-stage { display: none; }
}

/* ---------------------------------------------------------- live: mobile, a phone under each flow */
@media (max-width: 1023.98px) {
  .tour-live .chapter-stage { display: flex; justify-content: center; margin-top: var(--sp-5); }
  .tour-live .chapter { padding-block: var(--sp-10) var(--sp-8); }
}

/* Paid-plan badge beside the chapter eyebrow (hidden when every plan includes the feature). */
.chapter__eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.plan-req {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #6d28d9;
  background: linear-gradient(120deg, rgba(123, 97, 255, 0.14), rgba(27, 255, 255, 0.14));
  border: 1px solid rgba(123, 97, 255, 0.35);
}
.plan-req svg { width: 12px; height: 12px; fill: currentColor; }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .plan-req { color: #c4b5fd; border-color: rgba(196, 181, 253, 0.4); }
}
:root[data-theme="dark"] .plan-req { color: #c4b5fd; border-color: rgba(196, 181, 253, 0.4); }
