/* Keep the original tablet/mobile layout; the pinned story is desktop only. */
.story-backdrop, .story-scroll-layout, .story-visual, .story-scene, .story-episodes { display: contents; }
.story-desktop-episode { display: none; }
[id^="story-paragraphs"] p + p { margin-top: 15px; }
.story-character-canvas { display: none; pointer-events: none; }

@media (min-width:1200px) {
    .story { --story-portrait-height: calc(100svh - var(--navigation-height)); --story-portrait-width: calc(var(--story-portrait-height) * 646 / 840); --story-content-width: min(calc(var(--story-portrait-width) * .9 + 455px), calc(100% - 64px)); display: grid; padding: 0; min-height: 0; overflow: clip; }
    /* Both layers share the same sticky bounds. Scale an 840px-tall cropped
       portrait composition with the available height, keeping the upper-body
       view consistent instead of fitting the complete character. */
    .story-backdrop { display: block; grid-area: 1 / 1; position: sticky; top: var(--navigation-height); height: calc(100svh - var(--navigation-height)); align-self: start; overflow: clip; isolation: isolate; z-index: 0; }
    .story-backdrop .story-background { bottom: auto; height: max(918px, 100%); }
    .story-scroll-layout { display: grid; grid-area: 1 / 1; grid-template-columns: minmax(0, 1fr) 439px; gap: 16px; align-items: start; width: var(--story-content-width); margin-inline: auto; position: relative; z-index: 1; }
    .story-visual { display: block; position: sticky; top: var(--navigation-height); width: var(--story-portrait-width); height: calc(100svh - var(--navigation-height)); overflow: clip; }
    .story-scene { display: block; position: relative; left: 4.9536%; width: 100%; height: 100%; container-type: inline-size; }
    .story-title { left: 3.4056%; top: 7.619%; font-size: 18.5759cqw; }
    .story-mirai { left: 0; top: 10.7143%; width: 100%; height: 145.2381%; }
    .story-piko { left: 3.4056%; top: 31.5476%; width: 39.0093%; height: 37.8571%; }
    .story-name { width: 13.9319%; height: 26.1905%; padding: 4.9536cqw 0; font-size: 9.9071cqw; }
    .story-name-mirai { left: 65.6347%; top: 40.119%; }
    .story-name-piko { left: -3.096%; top: 45.8333%; }
    .story-episodes { display: grid; gap: 40px; padding: 96px 0 39px; position: relative; z-index: 3; }
    .story-panel { width: 100%; margin: 0; min-height: 0; padding: 28px 0 32px; }
    .story-pagination { display: none; }
    .story-desktop-episode { display: block; }
    .story-strip { left: calc((100% - var(--story-content-width)) / 2 + var(--story-portrait-height) * 54 / 840); top: 0; width: calc(var(--story-portrait-height) * 649 / 840); height: calc(var(--story-portrait-height) * 1038 / 840); transform: none; }
    .story-mirai .story-character-canvas { position: absolute; left: -24.5%; top: 0; width: 133.53%; height: 100%; max-width: none; }
    .story-piko .story-character-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
    .story-rig-ready > img { visibility: hidden; }
    .story-rig-ready .story-character-canvas:not([hidden]) { display: block; }
    .story.has-story-motion:not(.story-entered) [data-story-reveal] { opacity: 0; }
    .story.has-story-motion:not(.story-entered) [data-story-reveal="mirai"] { translate: 0 48px; }
    .story.has-story-motion:not(.story-entered) [data-story-reveal="title"] { translate: 0 32px; }
    .story.has-story-motion:not(.story-entered) [data-story-reveal="piko"] { translate: 48px 0; }
    .story.has-story-motion [data-story-reveal] { transition: opacity 1100ms ease var(--story-delay, 0ms), translate 1300ms cubic-bezier(.28,.45,.35,1) var(--story-delay, 0ms); }
    [data-story-reveal="title"], [data-story-reveal="piko"] { --story-delay: 1000ms; }
    [data-story-reveal="name"] { --story-delay: 2000ms; }
    .story.has-story-motion [data-story-reveal="name"] { transition-duration: 900ms, 1300ms; }
    .story.has-story-motion .story-panel { transition: opacity 1200ms ease; }
    .story.has-story-motion .story-panel:not(.is-revealed) { opacity: 0; }
}
@media (prefers-reduced-motion:reduce) {
    .story [data-story-reveal], .story .story-panel { opacity: 1 !important; translate: none !important; transition: none !important; }
    .story-rig-ready > img { visibility: visible; }
    .story .story-character-canvas { display: none !important; }
}
