/*
 * infiDive Product Demo — final projector layer
 *
 * Loaded after product-demo.css. This is the only desktop composition layer:
 * four hard-edged editorial panels, one complete phone and one short statement
 * per panel. The rail itself supplies the motion; nothing inside a panel flies,
 * floats or cross-fades.
 */

.pd {
  --pd-projector-bg: #eeeff2;
  --pd-projector-ink: #101114;
  --pd-projector-muted: #5b5d67;
  --pd-projector-line: rgba(16, 17, 20, 0.09);
  --pd-projector-purple: #3e119d;
  background: var(--pd-projector-bg);
}

.pd-shell {
  width: 100%;
  max-width: none;
  padding: 0;
}

/* The title is a normal document section. It leaves before the projector pins. */
.pd > .pd-shell > .pd-intro {
  width: min(1180px, calc(100% - 48px));
  /* The title needs presence, not a viewport to itself — at 68svh the stretch
     from the stage's exit line to the first rail panel was two nearly-empty
     screens in a row. */
  min-height: clamp(360px, 48svh, 540px);
  margin: 0 auto;
  padding: clamp(56px, 8svh, 96px) 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 0;
  text-align: center;
}

.pd > .pd-shell > .pd-intro h2 {
  max-width: 1120px;
  margin-top: 24px;
  font-size: clamp(68px, 7vw, 112px);
  line-height: 0.92;
  letter-spacing: -0.052em;
}

.pd > .pd-shell > .pd-intro p {
  max-width: 30ch;
  margin-top: 22px;
  color: var(--pd-projector-muted);
  font-size: 17px;
  line-height: 1.5;
}

/* Historical editorial fragments never enter the final projector. */
.pd .pd-editorial-visual,
.pd .pd-evidence-group,
.pd .pd-scene-card,
.pd .pd-stage-wash {
  display: none !important;
}

.pd-return-gate {
  color: var(--pd-light);
}

@media (min-width: 992px) {
  .pd-scroll-story.is-horizontal-ready {
    --pd-panel-width: min(64vw, 1320px);
    --pd-panel-gap: clamp(24px, 2vw, 32px);
    --pd-panel-stride: calc(var(--pd-panel-width) + var(--pd-panel-gap));
    --pd-panel-phone-scale: 0.82;
    min-height: 430svh;
    margin-inline: 0;
  }

  .pd-scroll-story.is-horizontal-ready .pd-demo {
    position: sticky;
    z-index: 2;
    top: 0;
    width: 100vw;
    height: 100svh;
    min-height: 720px;
    margin: 0;
    padding: 0;
    display: block;
    overflow: hidden;
    isolation: isolate;
    background: var(--pd-projector-bg);
  }

  /* JS measures the rendered panel centres and writes this one rail transform. */
  .pd-scroll-story.is-horizontal-ready .pd-horizontal-track {
    position: absolute;
    z-index: 3;
    left: calc((100vw - var(--pd-panel-width)) / 2);
    top: 50%;
    width: max-content !important;
    height: clamp(640px, calc(100svh - 132px), 900px);
    display: flex;
    align-items: stretch;
    gap: var(--pd-panel-gap);
    transform: translate3d(var(--pd-track-shift, 0), -50%, 0);
    will-change: auto;
  }

  .pd-scroll-story.is-horizontal-ready.is-in-view.is-scrubbing
    .pd-horizontal-track {
    will-change: transform;
  }

  .pd-scroll-story.is-horizontal-ready .pd-rail-panel {
    --pd-panel-focus: 0.54;
    position: relative;
    flex: 0 0 var(--pd-panel-width);
    width: var(--pd-panel-width);
    height: 100%;
    overflow: hidden;
    isolation: isolate;
    contain: layout paint;
    border-inline: 1px solid var(--pd-projector-line);
    border-radius: 0;
    box-shadow: none;
    background: #e9e8e5;
  }

  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel[data-pd-panel="meet"] {
    --pd-mat-tint: 203 195 212;
    background: #ece6f1;
  }

  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel[data-pd-panel="talk"] {
    --pd-mat-tint: 193 187 210;
    background: #ded9e8;
  }

  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel[data-pd-panel="remember"] {
    --pd-mat-tint: 220 220 212;
    background: #f2f0ed;
  }

  /* Discover establishes the original low-weight photographic atmosphere. */
  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel[data-pd-panel="discover"]::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0 auto 0 0;
    width: 48%;
    display: block;
    border-radius: 0;
    background: url("characters/stage-plate.webp") center / cover no-repeat;
    opacity: 0.25;
    filter: saturate(0.7) contrast(0.94);
    pointer-events: none;
  }

  /* The remaining chapters keep the same 48% stage geometry. Their low-chroma
     tints carry only six percent of the plate, so the material stays alive
     without turning the rail into four unrelated colour cards. */
  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel[data-pd-panel="meet"]::before,
  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel[data-pd-panel="talk"]::before,
  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel[data-pd-panel="remember"]::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0 auto 0 0;
    width: 48%;
    display: block;
    border-radius: 0;
    background:
      linear-gradient(
        rgb(var(--pd-mat-tint) / 0.94),
        rgb(var(--pd-mat-tint) / 0.94)
      ),
      url("characters/stage-plate.webp") center / cover no-repeat;
    opacity: 1;
    filter: none;
    pointer-events: none;
  }

  /* Active/inactive remains readable now; motion can continuously overwrite it. */
  .pd-scroll-story.is-horizontal-ready[data-active="discover"]
    .pd-rail-panel[data-pd-panel="discover"],
  .pd-scroll-story.is-horizontal-ready[data-active="meet"]
    .pd-rail-panel[data-pd-panel="meet"],
  .pd-scroll-story.is-horizontal-ready[data-active="talk"]
    .pd-rail-panel[data-pd-panel="talk"],
  .pd-scroll-story.is-horizontal-ready[data-active="remember"]
    .pd-rail-panel[data-pd-panel="remember"] {
    --pd-panel-focus: 1;
  }

  .pd-scroll-story.is-horizontal-ready .pd-panel-device-wrap,
  .pd-scroll-story.is-horizontal-ready[data-active]
    .pd-rail-panel
    .pd-panel-device-wrap {
    position: absolute;
    z-index: 2;
    left: 27%;
    top: 51%;
    width: 390px;
    height: 844px;
    margin: 0;
    opacity: var(--pd-panel-focus);
    visibility: visible;
    transform: translate(-50%, -50%) scale(var(--pd-panel-phone-scale));
    transform-origin: center;
    transition: opacity 160ms linear;
    pointer-events: auto;
    filter:
      drop-shadow(0 36px 40px rgba(12, 10, 20, 0.2))
      drop-shadow(0 8px 12px rgba(12, 10, 20, 0.12));
  }

  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel[data-pd-panel="meet"]
    .pd-panel-device-wrap,
  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel[data-pd-panel="remember"]
    .pd-panel-device-wrap {
    left: 29%;
  }

  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel[data-pd-panel="talk"]
    .pd-panel-device-wrap {
    left: 27%;
  }

  .pd-scroll-story.is-horizontal-ready .pd-panel-device-wrap .pd-device {
    margin: 0;
    transform: none;
    border-radius: 44px;
    box-shadow:
      0 0 0 10px #202126,
      0 0 0 11px #34363d,
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }

  .pd-scroll-story.is-horizontal-ready
    .pd-panel-device-wrap
    .pd-screen,
  .pd-scroll-story.is-horizontal-ready
    .pd-panel-device-wrap
    .pd-screen.is-active {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }

  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel--chapter
    .pd-chapter-panel,
  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel--chapter
    .pd-chapter-panel.is-active {
    position: absolute;
    z-index: 3;
    inset: 24% auto auto 55%;
    width: min(34%, 360px);
    max-width: 360px;
    height: auto;
    display: flex;
    justify-content: flex-start;
    opacity: var(--pd-panel-focus);
    visibility: visible;
    transform: none;
    transition: opacity 160ms linear;
    pointer-events: none;
  }

  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel[data-pd-panel="meet"]
    .pd-chapter-panel,
  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel[data-pd-panel="remember"]
    .pd-chapter-panel {
    inset: 55% auto auto 57%;
    transform: translateY(-50%);
  }

  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel[data-pd-panel="talk"]
    .pd-chapter-panel {
    inset: 22% auto auto 55%;
  }

  .pd-scroll-story.is-horizontal-ready .pd-chapter-meta {
    color: var(--pd-projector-purple);
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .pd-scroll-story.is-horizontal-ready .pd-chapter-panel h3 {
    max-width: 6.8ch;
    margin-top: 20px;
    font-family: var(--font-display);
    font-size: clamp(56px, 4.6vw, 84px);
    font-weight: 500;
    line-height: 0.92;
    letter-spacing: -0.045em;
    text-wrap: balance;
  }

  .pd-scroll-story.is-horizontal-ready .pd-chapter-panel p {
    max-width: 24ch;
    margin-top: 17px;
    color: var(--pd-projector-muted);
    font-size: 16px;
    line-height: 1.5;
    text-wrap: pretty;
  }

  /* One fixed four-slot chapter instrument. */
  .pd-scroll-story.is-horizontal-ready .pd-guide {
    position: absolute;
    z-index: 10;
    left: 50%;
    bottom: clamp(22px, 3.5svh, 38px);
    width: var(--pd-panel-width);
    max-width: none;
    margin: 0;
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%);
    pointer-events: none;
  }

  .pd-scroll-story.is-horizontal-ready .pd-tabs {
    position: relative;
    width: 100%;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    pointer-events: auto;
  }

  .pd-scroll-story.is-horizontal-ready .pd-tabs::before {
    display: none;
  }

  .pd-scroll-story.is-horizontal-ready .pd-tab,
  .pd-scroll-story.is-horizontal-ready .pd-tab + .pd-tab {
    appearance: none;
    position: relative;
    width: 100%;
    min-height: 48px;
    padding: 12px 0 0;
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 8px;
    align-items: start;
    border: 0;
    border-top: 1px solid rgba(16, 17, 20, 0.2);
    border-radius: 0;
    background: transparent;
    color: var(--pd-projector-ink);
    text-align: left;
    opacity: 0.5;
    cursor: pointer;
    transition:
      border-color 160ms linear,
      opacity 160ms linear;
  }

  .pd-scroll-story.is-horizontal-ready .pd-tab::before,
  .pd-scroll-story.is-horizontal-ready .pd-tab::after,
  .pd-scroll-story.is-horizontal-ready .pd-tab.is-active::before {
    display: none;
  }

  .pd-scroll-story.is-horizontal-ready .pd-tab.is-active {
    border-top: 2px solid var(--pd-projector-purple);
    opacity: 1;
  }

  .pd-scroll-story.is-horizontal-ready .pd-tab .pd-index {
    color: currentColor;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: 0.04em;
  }

  .pd-scroll-story.is-horizontal-ready .pd-tab strong {
    display: block;
    color: currentColor;
    font-family: var(--pd-font-ios);
    font-size: 13px;
    line-height: 1;
    font-weight: 600;
  }

  .pd-scroll-story.is-horizontal-ready .pd-live-note,
  .pd-scroll-story.is-horizontal-ready .pd-restart,
  .pd-scroll-story.is-horizontal-ready .pd-mobile-nav,
  .pd-scroll-story.is-horizontal-ready > .pd-scroll-beats,
  .pd-scroll-story.is-horizontal-ready .pd-visual-stage {
    display: none !important;
  }
}

/* 992–1279: keep the rail, reduce the object before reducing legibility. */
@media (min-width: 992px) and (max-width: 1279px) {
  .pd-scroll-story.is-horizontal-ready {
    --pd-panel-width: 72vw;
    --pd-panel-phone-scale: 0.72;
  }

  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel--chapter
    .pd-chapter-panel,
  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel--chapter
    .pd-chapter-panel.is-active {
    inset-inline-start: 54%;
    width: min(38%, 290px);
  }

  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel[data-pd-panel="meet"]
    .pd-chapter-panel,
  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel[data-pd-panel="remember"]
    .pd-chapter-panel {
    inset-inline-start: 55%;
  }

  .pd-scroll-story.is-horizontal-ready .pd-chapter-panel h3 {
    font-size: clamp(48px, 5vw, 60px);
  }
}

/* Exact middle density: 819px panel at 1280, 922px panel at 1440. */
@media (min-width: 1280px) and (max-width: 1439px) {
  .pd-scroll-story.is-horizontal-ready {
    --pd-panel-phone-scale: 0.77;
  }
}

@media (min-width: 1800px) {
  .pd-scroll-story.is-horizontal-ready {
    --pd-panel-phone-scale: 0.9;
  }
}

@media (min-width: 992px) and (max-height: 820px) {
  .pd-scroll-story.is-horizontal-ready {
    --pd-panel-phone-scale: 0.74;
  }
}

@media (min-width: 992px) and (min-height: 741px) and (max-height: 920px) {
  .pd-scroll-story.is-horizontal-ready {
    --pd-panel-phone-scale: 0.78;
  }

  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel[data-pd-panel]
    .pd-panel-device-wrap {
    top: 49%;
    filter: drop-shadow(0 18px 18px rgba(12, 10, 20, 0.18));
  }
}

@media (min-width: 992px) and (max-height: 740px) {
  .pd-scroll-story.is-horizontal-ready .pd-demo {
    min-height: 0;
  }

  .pd-scroll-story.is-horizontal-ready {
    --pd-panel-phone-scale: 0.62;
  }

  .pd-scroll-story.is-horizontal-ready
    .pd-rail-panel[data-pd-panel]
    .pd-panel-device-wrap {
    top: 48%;
    filter: drop-shadow(0 16px 16px rgba(12, 10, 20, 0.17));
  }
}

/*
 * Compact layouts are natural documents. The projector, neighbour peeks and
 * fixed bottom instrument all go away; each complete product state gets its own
 * quiet vertical chapter.
 */
@media (max-width: 991.98px) {
  .pd > .pd-shell > .pd-intro {
    width: min(680px, calc(100% - 32px));
    min-height: auto;
    padding: 72px 20px 52px;
  }

  .pd > .pd-shell > .pd-intro h2 {
    font-size: clamp(48px, 10vw, 72px);
  }

  .pd-scroll-story.is-horizontal-ready,
  .pd-scroll-story {
    min-height: 0;
    margin: 0;
  }

  .pd-scroll-story.is-horizontal-ready .pd-demo,
  .pd-scroll-story .pd-demo {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
    background: var(--pd-projector-bg);
  }

  .pd-scroll-story.is-horizontal-ready .pd-horizontal-track,
  .pd-scroll-story .pd-horizontal-track {
    position: relative;
    inset: auto;
    order: 1;
    width: 100% !important;
    height: auto;
    padding: 0 18px 68px;
    display: grid;
    gap: 20px;
    transform: none !important;
  }

  .pd-scroll-story.is-horizontal-ready .pd-rail-panel,
  .pd-scroll-story .pd-rail-panel,
  .pd-scroll-story.is-horizontal-ready .pd-rail-panel--chapter {
    --pd-panel-focus: 1;
    position: relative;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 46px 20px 32px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    contain: layout paint;
    border-block: 1px solid var(--pd-projector-line);
    border-inline: 0;
    border-radius: 0;
    box-shadow: none;
    background: #e9e8e5;
    scroll-margin-top: 84px;
  }

  .pd-scroll-story
    .pd-rail-panel[data-pd-panel="meet"] {
    --pd-mat-tint: 203 195 212;
    background: #ece6f1;
  }

  .pd-scroll-story
    .pd-rail-panel[data-pd-panel="talk"] {
    --pd-mat-tint: 193 187 210;
    background: #ded9e8;
  }

  .pd-scroll-story
    .pd-rail-panel[data-pd-panel="remember"] {
    --pd-mat-tint: 220 220 212;
    background: #f2f0ed;
  }

  .pd-scroll-story
    .pd-rail-panel[data-pd-panel="discover"]::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0 auto 0 0;
    width: 48%;
    display: block;
    border-radius: 0;
    background: url("characters/stage-plate.webp") center / cover no-repeat;
    opacity: 0.2;
    pointer-events: none;
  }

  .pd-scroll-story
    .pd-rail-panel[data-pd-panel="meet"]::before,
  .pd-scroll-story
    .pd-rail-panel[data-pd-panel="talk"]::before,
  .pd-scroll-story
    .pd-rail-panel[data-pd-panel="remember"]::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0 auto 0 0;
    width: 48%;
    display: block;
    border-radius: 0;
    background:
      linear-gradient(
        rgb(var(--pd-mat-tint) / 0.94),
        rgb(var(--pd-mat-tint) / 0.94)
      ),
      url("characters/stage-plate.webp") center / cover no-repeat;
    opacity: 1;
    filter: none;
    pointer-events: none;
  }

  .pd-scroll-story .pd-rail-panel .pd-chapter-panel,
  .pd-scroll-story .pd-rail-panel .pd-chapter-panel.is-active {
    position: relative;
    z-index: 3;
    inset: auto;
    order: 1;
    width: min(100%, 480px);
    max-width: 480px;
    height: auto;
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: none;
  }

  .pd-scroll-story .pd-chapter-panel h3 {
    max-width: 7ch;
    margin-top: 17px;
    font-size: clamp(46px, 9vw, 64px);
    line-height: 0.94;
  }

  .pd-scroll-story .pd-chapter-panel p {
    max-width: 25ch;
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.5;
  }

  .pd-scroll-story .pd-panel-device-wrap {
    --pd-compact-phone-scale: 0.68;
    position: relative;
    z-index: 2;
    left: auto;
    top: auto;
    order: 2;
    width: 390px;
    height: 844px;
    margin: 26px auto -270px !important;
    display: block !important;
    opacity: 1;
    visibility: visible;
    transform: scale(var(--pd-compact-phone-scale));
    transform-origin: top center;
    filter:
      drop-shadow(0 28px 34px rgba(12, 10, 20, 0.18))
      drop-shadow(0 6px 10px rgba(12, 10, 20, 0.1));
  }

  /* The desktop story shifts the shared phone left as each chapter advances:
     meet 45%, talk 43%, remember 34%. Those state selectors are more specific
     than the mobile wrapper rule above, so every cloned chapter phone was
     offset from its normal position and then clipped by the panel — exactly why
     Discover looked centred while the remaining three phones fell off the
     right edge. Mobile is a natural vertical document: every chapter owns its
     own phone and all four stay centred, regardless of the active tab. */
  .pd-scroll-story.is-horizontal-ready[data-active]
    .pd-rail-panel
    .pd-panel-device-wrap,
  .pd-scroll-story[data-active]
    .pd-rail-panel
    .pd-panel-device-wrap {
    left: auto;
    right: auto;
    align-self: center;
  }

  .pd-scroll-story .pd-panel-device-wrap .pd-device {
    /* These are framed product models, not the full-bleed mobile demo used by
       the older layout. That layout clamps the device to `100svh - 112px`;
       inside WeChat this resolves near 650px while the width remains 390px,
       flattening the 390x844 phone into a wide 390x650 slab. Preserve the app's
       real design viewport here and scale the complete object at its wrapper. */
    width: 390px;
    height: 844px;
    min-height: 844px;
    max-height: none;
    aspect-ratio: 390 / 844;
    flex: none;
    margin: 0;
    transform: none;
    border-radius: 44px;
    box-shadow:
      0 0 0 10px #202126,
      0 0 0 11px #34363d,
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }

  .pd-scroll-story .pd-guide {
    position: sticky;
    z-index: 12;
    top: 0;
    order: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 14px 18px 10px;
    display: block;
    opacity: 1;
    visibility: visible;
    transform: none;
    /* The hairline separates the bar from the phone sliding beneath it —
       without it the mock reads as clipped rather than passing under. */
    border-bottom: 1px solid var(--pd-projector-line);
    background: #eeeff2;
    pointer-events: auto;
  }

  .pd-scroll-story .pd-tabs {
    width: min(680px, 100%);
    margin: 0 auto;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .pd-scroll-story .pd-tabs::before,
  .pd-scroll-story .pd-tab::before,
  .pd-scroll-story .pd-tab::after {
    display: none;
  }

  .pd-scroll-story .pd-tab,
  .pd-scroll-story .pd-tab + .pd-tab {
    min-height: 48px;
    padding: 8px 0 5px;
    display: grid;
    align-content: start;
    gap: 2px;
    border: 0;
    border-top: 1px solid rgba(16, 17, 20, 0.18);
    border-radius: 0;
    background: transparent;
    text-align: left;
    opacity: 0.48;
  }

  .pd-scroll-story .pd-tab.is-active {
    border-top: 2px solid var(--pd-projector-purple);
    opacity: 1;
  }

  .pd-scroll-story .pd-tab .pd-index {
    color: var(--pd-projector-ink);
    font-size: 11px;
  }

  .pd-scroll-story .pd-tab strong {
    display: block;
    color: var(--pd-projector-ink);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;
  }

  .pd-scroll-story .pd-live-note,
  .pd-scroll-story .pd-restart,
  .pd-scroll-story .pd-mobile-nav,
  .pd-scroll-story > .pd-scroll-beats,
  .pd-scroll-story .pd-visual-stage {
    display: none !important;
  }
}

/* Phone-sized viewports need the product to read as an object within the
   chapter, not as a second full-screen page. The wrapper keeps its native
   390x844 layout so all of the simulated iOS measurements stay untouched;
   only the presentation scale changes. The negative bottom margin compensates
   for the unscaled layout box, so shrinking the phone also shortens the panel
   instead of leaving a tall invisible gap underneath it. */
@media (max-width: 600px) {
  .pd-scroll-story .pd-panel-device-wrap {
    --pd-compact-phone-scale: 0.56;
    margin: 22px auto -371px !important;
  }
}

@media (max-width: 420px) {
  .pd-scroll-story .pd-panel-device-wrap {
    --pd-compact-phone-scale: 0.52;
    margin: 22px auto -405px !important;
  }
}

/* Reduced motion uses the same readable vertical document at desktop sizes. */
@media (min-width: 992px) and (prefers-reduced-motion: reduce) {
  .pd-scroll-story.is-horizontal-ready.is-reduced-story {
    min-height: 0;
  }

  .pd-scroll-story.is-horizontal-ready.is-reduced-story .pd-demo {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .pd-scroll-story.is-horizontal-ready.is-reduced-story
    .pd-horizontal-track {
    position: relative;
    left: auto;
    top: auto;
    width: 100% !important;
    height: auto;
    padding: 0 clamp(24px, 6vw, 96px) 96px;
    order: 1;
    display: grid;
    gap: 72px;
    transform: none !important;
  }

  .pd-scroll-story.is-horizontal-ready.is-reduced-story .pd-rail-panel {
    --pd-panel-focus: 1;
    width: 100%;
    min-height: 760px;
    height: min(860px, 90svh);
    scroll-margin-top: 84px;
  }

  .pd-scroll-story.is-horizontal-ready.is-reduced-story .pd-guide {
    position: sticky;
    z-index: 12;
    top: 0;
    bottom: auto;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 14px clamp(24px, 6vw, 96px) 10px;
    order: 0;
    display: block;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: #eeeff2;
    pointer-events: auto;
  }

  .pd-scroll-story.is-horizontal-ready.is-reduced-story .pd-tabs {
    width: min(1120px, 100%);
    margin: 0 auto;
  }
}

/* Product Preview capabilities are rendered as mutually exclusive states
   inside the existing phone. Nothing from this layer changes rail geometry. */
.pd-feed-video {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: var(--pd-dark);
}

.pd-save {
  appearance: none;
  border: 0;
  font-family: var(--pd-font-ios);
  cursor: pointer;
  transition: background 180ms ease, transform 120ms ease;
}

.pd-save:active { transform: scale(0.94); }
.pd-save.is-saved { background: rgba(80, 35, 181, 0.78); }
.pd-save.is-saved .ico { fill: currentColor; }

.pd-meet .pd-vio-scene { inset: 0 0 220px; }

.pd-idle-video,
.pd-touch-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.82) saturate(0.9);
  opacity: 1;
  transition: opacity 260ms ease;
}

.pd-idle-video { z-index: 2; }
.pd-touch-video { z-index: 3; }

.pd-idle-video.is-paused-for-action {
  opacity: 0;
}

/* The reaction is a gesture, not an ambient loop. Once its single playback
   finishes, dissolve back to the looping idle performance underneath. */
.pd-touch-video.is-complete {
  opacity: 0;
  pointer-events: none;
}

.pd-vio-touch {
  appearance: none;
  position: absolute;
  z-index: 6;
  top: 31%;
  left: 35%;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(22, 19, 31, 0.16);
  color: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.08), 0 8px 22px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.pd-vio-touch::before {
  content: "";
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  background: currentColor;
}

.pd-vio-touch span {
  position: absolute;
  top: 48px;
  left: 50%;
  width: max-content;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 700;
  transform: translateX(-50%);
  text-shadow: 0 2px 9px rgba(0, 0, 0, 0.55);
}

.pd-vio-touch:hover,
.pd-vio-touch:focus-visible { transform: scale(1.04); }
.pd-device[data-light-touched="true"] .pd-vio-touch { opacity: 0; pointer-events: none; }

.pd-meet .pd-prompt { overflow: hidden; padding: 16px 0 13px; }
.pd-meet .pd-prompt > p { margin: 0 18px 13px; font-size: 15px; }

.pd-direction-rail {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 0 18px 7px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.pd-direction-rail::-webkit-scrollbar { display: none; }

.pd-direction-rail .pd-choice {
  flex: 0 0 248px;
  min-height: 104px;
  margin: 0;
  padding: 12px 14px;
  scroll-snap-align: center;
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(37, 33, 53, 0.86), rgba(23, 20, 35, 0.78));
}

.pd-direction-hint {
  display: block;
  min-height: 13px;
  padding: 1px 18px 0;
  color: rgba(235, 235, 245, 0.48);
  font-size: 11px;
  font-weight: 650;
}

.pd-touch-result,
.pd-lyric-game {
  position: absolute;
  z-index: 15;
  left: 14px;
  right: 14px;
  bottom: 22px;
  padding: 18px;
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background: rgba(25, 22, 34, 0.92);
  color: var(--pd-light);
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}

.pd-touch-result > span,
.pd-game-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--pd-purple-bright);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pd-touch-result > strong { display: block; font-size: 16px; line-height: 1.25; }
.pd-touch-result > p { margin: 8px 0 16px; color: rgba(235, 235, 245, 0.7); font-size: 13px; line-height: 1.4; }

.pd-touch-result > button,
.pd-game-actions button {
  appearance: none;
  min-height: 44px;
  padding: 0 14px;
  border: 0.5px solid rgba(186, 151, 255, 0.42);
  border-radius: 17px;
  background: rgba(126, 75, 225, 0.2);
  color: var(--pd-light);
  font: 750 12px/1 var(--pd-font-ios);
  cursor: pointer;
}

.pd-lyric-game > p { margin: 9px 0 14px; color: rgba(235, 235, 245, 0.68); font-size: 13px; }
.pd-lyric-game blockquote { margin: 0 0 17px; font-size: 18px; font-weight: 730; line-height: 1.3; }
.pd-game-actions { display: grid; gap: 8px; }
.pd-game-actions button { width: 100%; text-align: left; }

.pd-thread {
  max-height: 62%;
  overflow-y: auto;
  scrollbar-width: none;
  overscroll-behavior: contain;
}

.pd-thread::-webkit-scrollbar,
.pd-skillbar::-webkit-scrollbar { display: none; }
.pd-live-reply { display: contents; }
.pd-live-reply .pd-bubble { flex: none; }
.pd-skill-reply { border: 0.5px solid rgba(177, 139, 255, 0.26); }

.pd-skillbar {
  flex: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.pd-skillbar button {
  appearance: none;
  flex: none;
  min-height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--pd-light-2);
  font: 650 11px/1 var(--pd-font-ios);
  white-space: nowrap;
  cursor: pointer;
}

.pd-skillbar button:hover,
.pd-skillbar button:focus-visible {
  border-color: rgba(177, 139, 255, 0.48);
  background: rgba(148, 110, 254, 0.13);
}

.pd-skillbar button.is-active {
  border-color: rgba(190, 158, 255, 0.48);
  background: rgba(148, 110, 254, 0.2);
  color: var(--pd-white);
}

.pd-skillbar button svg {
  width: 16px;
  height: 16px;
  display: block;
  flex: none;
  fill: none;
  stroke: var(--pd-purple-bright);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--pd-purple-bright);
}

.pd-skillbar .pd-skill-add {
  width: 38px;
  padding: 0;
  justify-content: center;
  color: var(--pd-purple-bright);
  font-size: 19px;
}

.pd-inputbar { gap: 6px; }

input.pd-input-field {
  appearance: none;
  min-width: 0;
  outline: 0;
  font-family: var(--pd-font-ios);
}

input.pd-input-field::placeholder { color: rgba(235, 235, 245, 0.4); }

.pd-inputbar > button {
  appearance: none;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--pd-purple);
  color: var(--pd-white);
  font: 800 17px/1 var(--pd-font-ios);
  cursor: pointer;
}

.pd-skill-sheet {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64%;
  padding: 28px 18px 24px;
  overflow-y: auto;
  border: 0.5px solid rgba(255, 255, 255, 0.15);
  border-bottom: 0;
  border-radius: 30px 30px 0 0;
  background: linear-gradient(180deg, rgba(31, 27, 46, 0.985), rgba(18, 16, 29, 0.995));
  color: var(--pd-light);
  box-shadow: 0 -22px 70px rgba(3, 3, 10, 0.48);
  scrollbar-width: none;
}

.pd-skill-sheet::-webkit-scrollbar { display: none; }

.pd-sheet-handle {
  appearance: none;
  position: absolute;
  top: 0;
  left: 50%;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 17px;
  background: transparent;
  transform: translateX(-50%);
  cursor: pointer;
}

.pd-sheet-handle::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  transform: translateX(-50%);
}

.pd-skill-sheet > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
}

.pd-skill-sheet > header span,
.pd-skill-sheet > header strong,
.pd-skill-sheet > header small { display: block; }
.pd-skill-sheet > header strong { font-size: 18px; }
.pd-skill-sheet > header small { margin-top: 3px; color: rgba(235, 235, 245, 0.56); font-size: 11px; }
.pd-skill-sheet > header > b { color: rgba(247, 244, 255, 0.82); font-size: 13px; }
.pd-skill-sheet > header i { color: var(--pd-white); font-size: 15px; font-style: normal; }
.pd-skill-sheet > header > b { display: inline-flex; align-items: center; gap: 5px; }
.pd-energy-mark { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linejoin: round; }
.pd-sheet-label { margin: 15px 0 9px; color: rgba(235, 235, 245, 0.56); font-size: 11px; font-weight: 750; }

.pd-core-skills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pd-core-skills > span {
  min-height: 76px;
  padding: 11px 9px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--pd-purple-bright);
  font-size: 16px;
}

.pd-core-skills b { color: var(--pd-light); font-size: 11px; line-height: 1.2; }

.pd-skill-unlock {
  min-height: 68px;
  margin-top: 8px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.055);
}

.pd-skill-unlock > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: rgba(148, 110, 254, 0.14);
  color: var(--pd-light);
  font-size: 17px;
}

.pd-skill-unlock > span svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pd-skill-unlock small,
.pd-skill-unlock strong,
.pd-skill-unlock p { display: block; margin: 0; }
.pd-skill-unlock small { color: var(--pd-purple-bright); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.pd-skill-unlock strong { margin-top: 2px; font-size: 12px; }
.pd-skill-unlock p { margin-top: 3px; overflow: hidden; color: rgba(235, 235, 245, 0.5); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }

.pd-skill-unlock > button {
  appearance: none;
  min-width: 64px;
  min-height: 36px;
  padding: 0 10px;
  border: 0.5px solid rgba(190, 158, 255, 0.34);
  border-radius: 999px;
  background: rgba(148, 110, 254, 0.14);
  color: var(--pd-light);
  font: 750 11px/1 var(--pd-font-ios);
  cursor: pointer;
}

.pd-skill-unlock.is-library { border-color: rgba(190, 158, 255, 0.32); background: rgba(148, 110, 254, 0.08); }
.pd-skill-unlock.is-locked { opacity: 0.5; }
.pd-skill-unlock button:disabled { cursor: default; }

button.pd-whisper {
  appearance: none;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  font-family: var(--pd-font-ios);
  text-align: left;
  cursor: pointer;
}

button.pd-memory-card {
  appearance: none;
  width: 100%;
  color: var(--pd-ink);
  font-family: var(--pd-font-ios);
  text-align: left;
  cursor: pointer;
}

.pd-return-detail {
  position: absolute;
  z-index: 28;
  inset: 0;
  padding: 64px 24px 38px;
  display: flex;
  flex-direction: column;
  color: var(--pd-light);
  background:
    radial-gradient(circle at 72% 12%, rgba(148, 110, 254, 0.26), transparent 30%),
    linear-gradient(180deg, #191521 0%, #0e0d13 100%);
}

.pd-return-detail > button {
  appearance: none;
  width: 44px;
  height: 44px;
  margin-bottom: auto;
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--pd-light);
  font: 700 20px/1 var(--pd-font-ios);
  cursor: pointer;
}

.pd-return-detail > span {
  color: var(--pd-purple-bright);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pd-return-detail h4 {
  max-width: 18ch;
  margin: 12px 0 18px;
  font: 800 18px/1.2 var(--pd-font-ios);
  letter-spacing: -0.018em;
}

.pd-return-detail p {
  margin: 0 0 18px;
  color: rgba(245, 243, 250, 0.9);
  font-size: 15px;
  font-weight: 560;
  line-height: 1.5;
}

.pd-return-points {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  gap: 8px;
}

.pd-return-points li {
  padding: 12px 13px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(245, 243, 250, 0.9);
  font-size: 13px;
  font-weight: 620;
  line-height: 1.4;
}

.pd-return-tags {
  gap: 7px;
  margin: 0 0 18px;
}

.pd-return-tags span {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(148, 110, 254, 0.14);
  color: rgba(221, 207, 255, 0.88);
  font-size: 10px;
  font-weight: 750;
}

.pd-return-detail > small { color: rgba(235, 235, 245, 0.48); font-size: 11px; line-height: 1.45; }

.pd-device[data-screen="remember"][data-return-detail]:not([data-return-detail=""]) .pd-status {
  color: var(--pd-light);
}

.pd-device[data-screen="remember"][data-return-detail]:not([data-return-detail=""]) .pd-home {
  color: rgba(255, 255, 255, 0.82);
}

.pd-device[data-choice="game"] .pd-branch--game,
.pd-device[data-choice="light"] .pd-branch--light { display: block; }

.pd-device[data-choice="game"] .pd-memory-card strong.pd-branch--game,
.pd-device[data-choice="light"] .pd-memory-card strong.pd-branch--light { display: block; }

.pd-device[data-choice="game"] .pd-direction.pd-branch--game,
.pd-device[data-choice="light"] .pd-direction.pd-branch--light { display: inline-flex; }

@media (prefers-reduced-motion: reduce) {
  .pd-vio-touch,
  .pd-save { transition: none; }
}
