/* ==========================================================================
   Story scroll (#synopsis) + hero row fix + Seoa portrait window + footer link.
   Loaded after styles.css and release-layout.css.
   Poster crops: every .story-crop holds the full 1920×7610 poster; the
   container's aspect ratio and the image offset select one slice.
   ========================================================================== */

/* ---------- Hero: scroll-cue removed, no reserved empty row ---------- */

#release-top.release-hero {
  grid-template-rows: minmax(0, 1fr);
  padding-bottom: clamp(36px, 6vh, 64px);
}
@media (max-width: 860px), (max-aspect-ratio: 4/5) {
  #release-top.release-hero {
    grid-template-rows: auto auto;
    padding: var(--header-h) 0 clamp(40px, 10vw, 64px);
  }
}

/* ---------- Story scroll: one continuous black / crimson / night-blue band ---------- */

.story-scroll {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(180deg,
      var(--ink) 0%,
      #12060b 14%,
      #1a0810 30%,
      #0c0d18 46%,
      var(--navy) 56%,
      #0b0b14 70%,
      #12070d 84%,
      var(--ink) 100%);
}

.story-panel {
  position: relative;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}

/* Full-bleed atmospheric glow behind each panel */
.story-chapter::before,
.story-fate::before,
.story-ending::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
}
.story-chapter--seoa::before {
  background: radial-gradient(60% 46% at 50% 45%, rgba(168, 18, 44, 0.28), transparent 72%);
}
.story-chapter--gahee::before {
  background: radial-gradient(60% 46% at 50% 45%, rgba(110, 140, 196, 0.2), transparent 72%);
}
.story-fate::before {
  background: radial-gradient(50% 60% at 50% 50%, rgba(61, 14, 27, 0.55), transparent 74%);
}
.story-ending::before {
  background:
    radial-gradient(56% 40% at 50% 40%, rgba(188, 208, 236, 0.1), transparent 72%),
    radial-gradient(70% 40% at 50% 90%, rgba(168, 18, 44, 0.22), transparent 72%);
}

/* ---------- Opening: dim rain street + large line ---------- */

.story-opening {
  max-width: none;
  min-height: 65vh;
  min-height: 65svh;
  display: grid;
  place-items: center;
  padding: clamp(72px, 12vh, 140px) var(--gutter);
  text-align: center;
}
.story-opening__backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("./assets/rain-street.webp") 50% 40% / cover no-repeat;
  filter: grayscale(0.35) brightness(0.34) contrast(1.08);
}
.story-opening__backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, var(--ink) 0%, rgba(10, 7, 9, 0.25) 26%, rgba(10, 7, 9, 0.35) 70%, #12060b 100%),
    radial-gradient(60% 50% at 50% 55%, rgba(168, 18, 44, 0.22), transparent 72%);
}
.story-opening__line {
  max-width: 1100px;
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(26px, 4.4vw, 64px);
  line-height: 1.38;
  letter-spacing: -0.04em;
  color: var(--ivory);
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.85);
  word-break: keep-all;
}

/* ---------- Poster crops ---------- */

.story-crop {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1920 / var(--slice-height);
}
.story-crop img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  max-width: none;
  height: auto;
  transform: translateY(calc(-1 * var(--slice-start)));
}

/* ---------- Chapters ---------- */

.story-chapter {
  --story-accent: var(--crimson);
  padding-bottom: clamp(40px, 7vh, 88px);
}
.story-chapter--gahee { --story-accent: #e4ddd0; }

.story-caption {
  position: relative;
  z-index: 1;
  margin-top: clamp(-80px, -5vw, -24px);
  padding: 0 var(--gutter);
  text-align: center;
}
.story-caption p {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(18px, 0.9rem + 1.3vw, 32px);
  line-height: 1.5;
  letter-spacing: -0.03em;
  color: var(--ivory-2);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.9);
  word-break: keep-all;
}
.story-caption strong {
  font-weight: 900;
  color: var(--story-accent);
}
.story-caption h3 {
  margin: 0.18em 0 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.1;
  letter-spacing: -0.05em;
  color: var(--crimson);
  text-shadow: 0 0 36px rgba(168, 18, 44, 0.45);
}
.story-chapter--gahee .story-caption h3 {
  background: linear-gradient(180deg, #fbf7ef 20%, #c9c0b2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 24px rgba(228, 221, 208, 0.22));
}

/* ---------- Fate narration ---------- */

.story-fate {
  padding: clamp(64px, 12vh, 140px) var(--gutter);
  text-align: center;
}
.story-fate__copy {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: clamp(26px, 5vh, 56px);
}
.story-fate__copy::before {
  content: "";
  justify-self: center;
  width: 1px;
  height: clamp(40px, 8vh, 80px);
  background: linear-gradient(180deg, transparent, var(--hair-blood));
}
.story-fate p {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(19px, 0.9rem + 1.4vw, 34px);
  line-height: 1.72;
  letter-spacing: -0.03em;
  color: var(--ivory-2);
  word-break: keep-all;
}
.story-fate p:first-child { color: var(--ivory); }

/* ---------- Ending ---------- */

.story-ending { padding-bottom: clamp(24px, 6vh, 72px); }

/* ---------- Reveal: upward drift + blur clear (text), drift + clip (art) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .motion-ready [data-reveal="story"] {
    transition:
      opacity 1.1s var(--ease-slow) var(--d, 0ms),
      transform 1.1s var(--ease-slow) var(--d, 0ms),
      filter 1.1s var(--ease-slow) var(--d, 0ms);
  }
  .motion-ready [data-reveal="story"]:not(.is-in) {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
    filter: blur(8px);
  }

  .motion-ready .story-crop[data-reveal="story"] {
    transition:
      opacity 1.1s var(--ease-slow) var(--d, 0ms),
      transform 1.1s var(--ease-slow) var(--d, 0ms),
      clip-path 1.1s var(--ease-slow) var(--d, 0ms);
    clip-path: inset(0 0 0 0);
  }
  .motion-ready .story-crop[data-reveal="story"]:not(.is-in) {
    transform: translate3d(0, 56px, 0);
    filter: none;
    clip-path: inset(10% 0 0 0);
  }

  .motion-ready .story-caption[data-reveal="story"] { --d: 240ms; }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal="story"] {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    clip-path: none !important;
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 860px), (max-aspect-ratio: 4/5) {
  .story-panel { max-width: none; }
  .story-caption { padding: 0 20px; }
  .story-fate { padding-left: 20px; padding-right: 20px; }
}

@media (forced-colors: active) {
  .story-chapter--gahee .story-caption h3 { color: CanvasText; background: none; }
  .story-opening__backdrop { display: none; }
}

/* Waist-up portraits: normalize face scale, fit full artwork width. */
:is(#seoa, #gahee) .chara__stage { container-type: inline-size; }

:is(#seoa, #gahee) .chara__stage::after { content: none; }

:is(#seoa, #gahee) .chara__figure {
  --portrait-h: min(86vh, 860px, 92cqw);
  --portrait-h: min(86svh, 860px, 92cqw);
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  height: var(--portrait-h);
  margin: 0;
  -webkit-mask-image: linear-gradient(180deg, #000 90%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 90%, transparent 100%);
}
:is(#seoa, #gahee) .chara__art {
  position: absolute;
  top: 0;
  left: 50%;
  width: calc(var(--portrait-h) * 1.08);
  height: auto;
  max-width: none;
  object-fit: fill;
  transform: translateX(-50%);
  /* The waist-up crop must not cut off a colored halo around the head. */
  filter: none;
}

@media (max-width: 860px), (max-aspect-ratio: 4/5) {
  :is(#seoa, #gahee) .chara__figure { --portrait-h: min(112vw, 540px, 92cqw); }
  :is(#seoa, #gahee) .chara__art { height: auto; }
}
@media (max-height: 520px) and (orientation: landscape) {
  :is(#seoa, #gahee) .chara__figure { --portrait-h: min(86vh, 92cqw); }
  :is(#seoa, #gahee) .chara__art { height: auto; }
}

#seoa .chara__figure { height: calc(var(--portrait-h) * 0.933); }

/* ---------- Footer partner link ---------- */

.partners__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}
.partners__link:hover .partners__label,
.partners__link:focus-visible .partners__label {
  color: var(--ivory);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Fade the illustration itself into the continuous page background. */
.story-crop {
  -webkit-mask-image:linear-gradient(180deg,transparent 0%,#000 9%,#000 68%,transparent 100%);
  mask-image:linear-gradient(180deg,transparent 0%,#000 9%,#000 68%,transparent 100%);
}
#gahee .chara__art {
  width:calc(var(--portrait-h) * 1.035);
  filter:none;
}
@media(max-width:860px) {
  .story-crop {
    -webkit-mask-image:linear-gradient(180deg,transparent 0%,#000 8%,#000 68%,transparent 100%);
    mask-image:linear-gradient(180deg,transparent 0%,#000 8%,#000 68%,transparent 100%);
  }
}

/* Equal visible logo width (~154px), shared 160×48 frame and label baseline. */
.partners__crop--rplay { display: grid; place-items: center; }
.partners__crop--rplay .partners__logo--rplay {
  width: 157.14px;
  height: auto;
  max-width: none;
}

/* Give the portraits more room without cropping their sides or changing face ratios. */
:is(#seoa, #gahee) .chara__stage {
  width: calc(100% + min(12vw, 180px));
  margin-left: calc(-1 * min(6vw, 90px));
}
@media (max-width: 860px), (max-aspect-ratio: 4/5) {
  :is(#seoa, #gahee) .chara__stage {
    width: calc(100% + 2 * var(--gutter) - 16px);
    margin-left: calc(8px - var(--gutter));
  }
  :is(#seoa, #gahee) .chara__figure {
    --portrait-h: min(112vw, 720px, 92cqw);
  }
}

/* Main campaign message and source-verified character profiles. */
#release-top .release__pitch {
  margin: auto 0 22px;
  font-family: var(--display);
  font-size: clamp(18px, 1.45vw, 24px);
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: -0.045em;
  color: var(--ivory-2);
  word-break: keep-all;
}
#release-top .release__pitch strong,
#release-top .release__pitch span { display: block; }
#release-top .release__pitch strong { color: var(--ivory); font-weight: 900; }
#release-top .release__logo { margin-top: 0; }
.chara__cv {
  margin: 18px 0 0;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
  color: var(--ivory);
}
.chara__cv span { color: var(--accent); }
.chara__stats {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: 12px;
  margin: 18px 0 0;
  padding: 18px 0;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}
.chara__stats dt { font-size: 14px; font-weight: 700; color: var(--ivory-3); }
.chara__stats dd {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: clamp(18px, 1.6vw, 26px);
  font-weight: 800;
  color: var(--ivory);
  white-space: nowrap;
}
.chara__stats dd span { font-size: 0.72em; margin-left: 4px; }
@media(max-width: 400px) {
  .chara__stats { gap: 8px; }
  .chara__stats dd { font-size: 18px; }
}
