/* ==========================================================================
   Real app screens + animated walkthrough
   Loaded after redesign.css. Brings the site's accents in line with the app
   (indigo/violet primary, amber highlights) and styles the phone frames.
   ========================================================================== */

:root {
  --app: #6c63ff;          /* app primary (Start Reading, cards) */
  --app-2: #8f7cff;
  --app-deep: #5146d8;
  --app-soft: #efe9fd;     /* app background lavender */
  --accent-3: #8f86ff;
  --shot-ratio: 1284 / 2643;
}

/* Primary buttons use the app's indigo gradient */
.button--primary {
  background: linear-gradient(135deg, var(--app), var(--app-2));
  color: #fff;
  box-shadow: 0 14px 34px -12px rgba(108, 99, 255, 0.7);
}
.button--primary:hover,
.button--primary:focus-visible {
  background: linear-gradient(135deg, #7a72ff, #a292ff);
}
.checklist li::before,
.flow-row-copy .mini-list li::before {
  background: linear-gradient(135deg, var(--app-2), var(--accent));
}
.step-num { background: linear-gradient(135deg, var(--app), var(--app-2)); color: #fff; }
.brand-mark img { border-radius: 12px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Phone frame for a screenshot ---------- */
.shot {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 9px;
  border-radius: 40px;
  background: linear-gradient(160deg, #262a36, #07080c 60%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 40px 80px -30px rgba(0, 0, 0, 0.85);
}
.shot img {
  width: 100%;
  height: auto;
  aspect-ratio: var(--shot-ratio);
  object-fit: cover;
  object-position: top;
  border-radius: 31px;
  background: var(--app-soft);
}

/* ---------- Walkthrough section ---------- */
.demo {
  margin-top: 24px;
  padding: 34px;
  scroll-margin-top: 120px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 18% 30%, rgba(108, 99, 255, 0.2), transparent 40%),
    linear-gradient(180deg, rgba(16, 22, 31, 0.84), rgba(10, 14, 19, 0.92));
  box-shadow: var(--shadow);
}
.wt-side { display: grid; gap: 24px; align-content: center; }
.wt-side .section-heading { padding: 0; }
.wt-side .demo-foot { margin: 0; }

.wt {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
.wt-device { position: relative; justify-self: center; width: 100%; max-width: 300px; }
.wt-phone { padding: 10px; border-radius: 44px; }
.wt-screen {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--shot-ratio);
  border-radius: 34px;
  background: var(--app-soft);
  isolation: isolate;
}
.wt-poster { width: 100%; height: 100%; object-fit: cover; }
.wt--ready .wt-poster { display: none; }
.wt-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  visibility: hidden;
  will-change: transform, opacity;
  box-shadow: -18px 0 40px rgba(0, 0, 0, 0.18);
}
.wt-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #0b0f14;
  opacity: 0;
  pointer-events: none;
}
.wt-finger,
.wt-ring {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
}
.wt-finger {
  width: 13%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 34%, rgba(108, 99, 255, 0.55) 36% 60%, rgba(108, 99, 255, 0) 62%);
  box-shadow: 0 6px 18px rgba(40, 30, 120, 0.35);
}
.wt-ring {
  width: 20%;
  aspect-ratio: 1;
  border: 3px solid rgba(108, 99, 255, 0.9);
}

.wt-toggle {
  position: absolute;
  right: -14px;
  bottom: 38px;
  z-index: 6;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(12, 16, 23, 0.9);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  transition: transform 160ms ease, border-color 160ms ease;
}
.wt-toggle:hover,
.wt-toggle:focus-visible { transform: scale(1.06); border-color: var(--app-2); outline: none; }
.wt-toggle span {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-left: 12px solid currentColor;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}
.wt-toggle.is-playing span {
  width: 12px;
  height: 14px;
  margin-left: 0;
  border: 0;
  border-left: 4px solid currentColor;
  border-right: 4px solid currentColor;
}

.wt-chapters {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.wt-chapters button {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 4px 14px;
  width: 100%;
  padding: 14px 18px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: background-color 220ms ease, border-color 220ms ease, transform 220ms ease;
}
.wt-chapters button:hover,
.wt-chapters button:focus-visible { border-color: var(--border-strong); outline: none; }
.wt-chapters button:focus-visible { box-shadow: 0 0 0 3px rgba(143, 124, 255, 0.45); }
.wt-num {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
  color: var(--muted);
  transition: background 220ms ease, color 220ms ease;
}
.wt-copy { align-self: center; }
.wt-copy strong { display: block; font-size: 1.05rem; line-height: 1.25; }
.wt-copy small {
  display: block;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.5;
  transition: max-height 320ms ease, opacity 320ms ease, margin 320ms ease;
}
.wt-bar {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 8px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.wt-bar i {
  display: block;
  height: 100%;
  transform-origin: left;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--app), var(--accent));
}
.wt-chapters li.is-active button {
  border-color: rgba(143, 124, 255, 0.45);
  background: rgba(108, 99, 255, 0.1);
}
.wt-chapters li.is-active .wt-num {
  background: linear-gradient(135deg, var(--app), var(--app-2));
  color: #fff;
}
.wt-chapters li.is-active .wt-copy small { max-height: 6em; opacity: 1; margin-top: 4px; }

.demo-foot {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.demo-foot a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Step cards with screenshots (homepage "How it works") ---------- */
.flow-step--shot {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0;
  padding: 22px 22px 0;
  overflow: hidden;
}
.flow-step--shot > span { justify-self: start; margin-bottom: 4px; }
.flow-step--shot .shot-peek {
  margin: 20px auto 0;
  width: 78%;
  height: 300px;
  overflow: hidden;
}
.flow-step--shot .shot {
  padding-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.flow-step--shot .shot img { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

/* ---------- Split section media ---------- */
.split-media--shots {
  display: grid;
  place-items: center;
  padding: 36px 20px 110px;
  background:
    radial-gradient(circle at 30% 30%, rgba(108, 99, 255, 0.35), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(247, 178, 103, 0.18), transparent 50%),
    rgba(17, 24, 34, 0.6);
}
.split-media--shots::after { display: none; }
.split-media--shots .pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  width: min(100%, 460px);
}
.split-media--shots .pair .shot:last-child { transform: translateY(34px); }

/* ---------- Feature cards with screenshot thumbs ---------- */
.feature-card .ft-shot {
  align-self: stretch;
  height: 100%;
  min-height: 220px;
  padding: 18px 18px 0;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(108, 99, 255, 0.28), transparent 60%),
    rgba(17, 24, 34, 0.6);
  border-right: 1px solid var(--border);
}
.feature-card .ft-shot .shot { padding: 6px 6px 0; border-radius: 22px 22px 0 0; }
.feature-card .ft-shot .shot img { border-radius: 17px 17px 0 0; height: auto; min-height: 0; }
.cards--six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feature-card { min-height: 220px; }

/* ---------- Screenshot gallery (horizontal scroller) ---------- */
.screens-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 220px;
  gap: 22px;
  margin: 26px -30px 0;
  padding: 6px 30px 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.screens-strip figure {
  margin: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: none;
  scroll-snap-align: start;
}
.screens-strip figcaption { padding: 14px 4px 0; color: var(--muted); font-size: 0.92rem; }
.screens-strip figcaption strong { display: block; color: var(--text); font-size: 0.98rem; }
.gallery .shot img { aspect-ratio: var(--shot-ratio); }

@media (max-width: 1080px) {
  .wt { grid-template-columns: 1fr; gap: 30px; }
  .wt-side { display: contents; }
  .wt-side .section-heading { order: -1; }
  .wt-device { max-width: 280px; }
  .feature-card .ft-shot { border-right: none; border-bottom: 1px solid var(--border); min-height: 0; height: 240px; }
  .feature-card .ft-shot .shot { width: 60%; margin: 0 auto; }
  .cards--six { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .demo { padding: 20px; border-radius: 28px; }
  .wt-device { max-width: 250px; }
  .wt-toggle { right: -8px; }
  .screens-strip { margin: 20px -20px 0; padding: 6px 20px 20px; grid-auto-columns: 180px; }
  .split-media--shots { padding: 26px 16px 110px; }
}

@media (prefers-reduced-motion: reduce) {
  .wt-layer { transition: none; }
}

/* ---------- Homepage hero tour video (vertical) ---------- */
.hero-visual#tour { animation: none; isolation: isolate; display: grid; justify-items: center; gap: 14px; scroll-margin-top: 120px; }
.hero-visual#tour::before {
  content: "";
  position: absolute;
  inset: 6% 0 10%;
  z-index: -1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 40%, rgba(108, 99, 255, 0.45), transparent 60%),
    radial-gradient(circle at 70% 75%, rgba(247, 178, 103, 0.2), transparent 55%);
  filter: blur(40px);
}
.video-frame {
  position: relative;
  overflow: hidden;
  width: min(100%, 390px);
  border-radius: 28px;
  border: 1px solid var(--border-strong);
  background: #0b0f14;
  box-shadow: 0 40px 90px -40px rgba(108, 99, 255, 0.6), 0 24px 60px rgba(0, 0, 0, 0.35);
}
.video-frame video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  background: #0b0f14;
}
.video-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
.video-caption strong { color: var(--text); }
.video-caption a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* On small screens show the video right after the headline and buttons */
@media (max-width: 1080px) {
  .hero-copy { display: contents; }
  .hero-copy > * { order: 1; }
  .hero-copy > .cta-row,
  .hero-copy > .store-links,
  .hero-copy > .stats { order: 3; }
  .hero-visual#tour { order: 2; margin: 6px 0; }
  .hero .store-links { margin-top: 0; }
}
@media (max-width: 720px) {
  .video-frame { width: min(100%, 340px); border-radius: 22px; }
}
