.landing-demo-screen {
  position: relative;
  aspect-ratio: 362 / 787;
  overflow: hidden;
  isolation: isolate;
  border-radius: 43px;
  background: #fff;
}
.landing-demo-frame {
  position: absolute;
  inset: 0 auto auto 0;
  width: 362px;
  height: 787px;
  border: 0;
  transform: scale(var(--landing-demo-scale, 1));
  transform-origin: top left;
  pointer-events: none;
}
.landing-demo-visual .landing-hero-phone,
.landing-demo-visual:hover .landing-hero-phone { transform: none; }

/* Keep the book and player layout from the shared app styles. */
html:has(.landing-demo-reader-page) { scroll-behavior: auto; scrollbar-width: none; }
/* A highlighted word that wraps paints its own line pieces, not the union of both lines. */
.landing-demo-reader-page .word.word-pill-inline.word-pill-highlighted {
  background: rgba(255, 220, 100, .6);
  border-radius: 4px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  color: inherit !important;
}
html.theme-dark .landing-demo-reader-page .word.word-pill-inline.word-pill-highlighted {
  background: rgba(255, 255, 255, .9);
  color: #202124 !important;
}
.landing-demo-thumb {
  position: fixed;
  z-index: 100000;
  inset: 0 auto auto 0;
  width: 26px;
  height: 26px;
  margin: -13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
/* Press only the dot. `scale` on the positioned element would also scale its
   translate, pulling the finger toward the top-left corner on every tap. */
.landing-demo-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #6668;
  box-shadow: 0 1px 6px #0005;
  transition: scale .12s ease;
}
.landing-demo-thumb-visible { opacity: 1; }
.landing-demo-thumb-pressed::before { scale: .74; }

@media (max-width: 860px) {
  .landing-hero-visual.landing-demo-visual {
    height: auto;
    padding-top: 22px;
    padding-bottom: 80px;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }
  /* Paint page bg over the bezel — extra padding below is where the fade finishes. */
  .landing-hero-visual.landing-demo-visual::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    height: 120px;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent 0%, var(--page-bg) 58%, var(--page-bg) 100%);
  }
  .landing-page:has(.landing-demo-visual) > #body_wrap > .container {
    padding-top: 4px;
  }
  .landing-page:has(.landing-demo-visual) #instant_summary > #for_you_list + h2.instant-index-list-heading {
    margin-top: 0;
    padding-top: 4px;
  }
}
@media (max-width: 600px) {
  .landing-demo-screen { border-radius: 34px; }
}

/* Feature scenes after the audio demo: text card, scene frames and one finger. */
.landing-demo-scene-frame { visibility: hidden; }
.landing-demo-scene-frame.landing-demo-scene-shown { visibility: visible; }
.landing-demo-card {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 0 14%;
  background: #faf6ef;
  color: #242722;
  font: 700 clamp(18px, 6.4cqi, 25px)/1.22 var(--font-sans, system-ui);
  letter-spacing: -.02em;
  text-align: center;
  text-wrap: balance;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.landing-demo-screen { container-type: inline-size; }
.landing-demo-card.landing-demo-card-visible { opacity: 1; }
.landing-demo-finger {
  position: absolute;
  z-index: 4;
  inset: 0 auto auto 0;
  width: 26px;
  height: 26px;
  margin: -13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .55s cubic-bezier(.22,.72,.2,1);
}
.landing-demo-finger::before {
  content: "";
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #6668;
  box-shadow: 0 1px 6px #0005;
  transition: scale .12s ease;
}
.landing-demo-finger.landing-demo-finger-dragging { transition: opacity .18s ease; }
.landing-demo-finger.landing-demo-finger-visible { opacity: 1; }
.landing-demo-finger.landing-demo-finger-pressed::before { scale: .74; }

/* Inside a scene frame (the real page, locked down). */
html.landing-scene-document { scroll-behavior: auto !important; overflow-anchor: none; scrollbar-width: none; }
.landing-scene-document .book-cta, .landing-scene-document .book-toc-header-cta,
.landing-scene-document .takeaways-paywall-overlay, .landing-scene-document #purchase_card_below_gate,
.landing-scene-document #goodreads_import_cta_landing, .landing-scene-document #streak_card_landing,
.landing-scene-document a[href="/app"], .landing-scene-document a[href$="/pricing"] { display: none !important; }
.landing-scene-document .scrollable-list { scroll-snap-type: none !important; scroll-behavior: auto !important; }
.landing-scene-document .demo-search-typing { color: var(--text-color, #222) !important; }
.landing-scene-document #input_placeholder[hidden] { display: none !important; }
.demo-request-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 14px;
  margin: 22px 16px;
  padding: 14px;
  color: var(--text-color);
  background: var(--bg2);
  border: 1px solid #8884;
  border-radius: 16px;
  text-align: start;
}
.demo-request-cover {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 118px;
  padding: 10px 8px;
  border-inline-start: 4px solid #d28d45;
  border-radius: 3px 6px 6px 3px;
  background: radial-gradient(circle at 78% 76%, #f5c169 0 11%, transparent 12%), linear-gradient(150deg, #34495f 48%, #506b73 49% 63%, #a96849 64%);
  color: #fff6dc;
  box-shadow: 0 4px 10px #0004;
  font: 600 12px/1.16 Georgia, serif;
}
.demo-request-cover small { font: 9px/1.15 system-ui, sans-serif; }
.demo-request-details h2 { margin: 0; font-size: 17px; line-height: 1.22; }
.demo-request-details p { margin: 6px 0 0; font-size: 12px; }
.demo-request-rating span { margin-inline-end: 6px; color: #f4bf4c; letter-spacing: .04em; }
.demo-request-action {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid #8884;
}
.demo-request-status { color: var(--text-color2); }
.demo-request-button {
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  color: #261b03;
  background: #ffcf5c;
  font: 700 13px system-ui, sans-serif;
}
.demo-request-button:disabled { color: var(--text-color); background: #8883; }
#import_demo_video_wrap.demo-bookshelf-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  place-items: center;
  margin: 0;
  background: #080808;
  animation: demo-bookshelf-reveal .24s ease-out;
}
#import_demo_video_wrap.demo-bookshelf-fullscreen video {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  border-radius: 0;
}
@keyframes demo-bookshelf-reveal { from { opacity: 0; } }
.demo-goodreads-shelves section { margin: 22px 0; }
.demo-goodreads-shelves h2 { margin: 0 0 8px; font-size: 17px; }
.demo-goodreads-books {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0 0 6px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.demo-goodreads-books li {
  position: relative;
  display: flex;
  flex: 0 0 98px;
  flex-direction: column;
  justify-content: space-between;
  min-height: 143px;
  padding: 10px;
  overflow: hidden;
  border-radius: 8px;
  background: #304337;
  color: #fff;
  text-align: left;
  font-size: 13px;
  line-height: 1.25;
  animation: demo-goodreads-book-in .42s ease-out backwards;
  animation-delay: calc(var(--book-index) * 90ms);
}
.demo-goodreads-books li:nth-child(even) { background: #554246; }
.demo-goodreads-books li img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@keyframes demo-goodreads-book-in { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
  #import_demo_video_wrap.demo-bookshelf-fullscreen, .demo-goodreads-books li { animation: none; }
}
.landing-demo-scenes-on .landing-demo-frame:not(.landing-demo-scene-frame) { visibility: hidden; }
