/* The original articles and figures remain the readable, accessible story. */
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  .story-stage-ready .story-stage {
    position: sticky;
    top: clamp(86px, 13vh, 130px);
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: min(70vh, 660px);
    margin-bottom: calc(-1 * min(70vh, 660px));
    pointer-events: none;
    isolation: isolate;
  }

  /* Sahne yapışkan ve alt boşluğu eksi; hikaye bitince "Dene" bölümünün üstüne taşmasın diye
     hikaye alanında kırpılır (overflow: clip kaydırma kabı yaratmaz, yapışkanlık bozulmaz). */
  .zaman-tuneli.story-stage-ready { overflow: clip; overflow-clip-margin: 2rem; }

  .story-stage { --scene-light: #719bc0; }
  .story-stage[data-chapter="2"] { --scene-light: #a1bda2; }
  .story-stage[data-chapter="3"] { --scene-light: #9286b2; }
  .story-stage[data-chapter="4"] { --scene-light: #e1a24e; }
  .story-stage[data-chapter="5"] { --scene-light: #76abaa; }
  .story-stage[data-chapter="6"] { --scene-light: #6bd9ba; }
  .story-stage-ready .story-stage::before {
    content: '';
    position: absolute;
    right: -8%;
    width: 67%;
    height: 112%;
    border-radius: 50%;
    background-color: var(--scene-light);
    mask-image: radial-gradient(ellipse, black 5%, transparent 72%);
    transition: background-color .55s ease;
    opacity: .32;
  }

  .story-stage-frame {
    position: relative;
    width: 58%;
    aspect-ratio: 1.64;
    max-height: min(65vh, 610px);
    overflow: hidden;
    border: 1px solid rgba(177, 226, 216, 0.25);
    border-radius: clamp(.6rem, 1vw, .9rem);
    background: #111b20;
    box-shadow: 0 35px 100px rgba(0, 0, 0, 0.62), 0 0 45px rgba(69, 185, 167, 0.12);
  }

  .story-stage-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(4, 13, 17, 0.02) 55%, rgba(4, 13, 17, 0.26));
  }

  .story-stage-layer {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform-origin: center;
    will-change: opacity, transform;
  }

  .story-stage-layer:first-child { opacity: 1; }
  .story-stage-layer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  /* Sahne videosu resmin üstünde; oynamaya başlayınca yumuşakça belirir. */
  .story-stage-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease;
  }
  .story-stage-layer.video-oynuyor .story-stage-video { opacity: 1; }

  .story-stage-ready .bolum {
    z-index: 1;
    min-height: clamp(600px, 85vh, 950px);
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  }

  .story-stage-ready .bolum:nth-of-type(even) .bolum-metin { order: 0; }
  .story-stage-ready .bolum-metin {
    grid-column: 1;
    max-width: 36rem;
    padding: clamp(1rem, 2vw, 2rem);
    margin-left: calc(-1 * clamp(1rem, 2vw, 2rem));
    border-radius: 20px;
    background: linear-gradient(90deg, rgba(11, 20, 25, 0.91), rgba(11, 20, 25, 0.67) 74%, transparent);
  }

  .story-stage-ready .bolum-gorsel {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (max-width: 899px) and (prefers-reduced-motion: no-preference) {
  .story-motion-ready .bolum-gorsel img {
    transform: translate3d(0, var(--story-image-y, 0px), 0) scale(1.18);
    will-change: transform;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-stage { display: none !important; }
  .bolum-gorsel img { transform: none !important; }
}

/* Hikâye biterken sahne çizgi gibi kesilmesin: bölümün sonu ekranın altına gelince sahne yukarı süzülüp
   kırpılma başlamadan tamamen solar. (Desteklemeyen tarayıcıda eski kırpma aynen kalır.) */
@supports (animation-timeline: view()) {
  @media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
    .zaman-tuneli.story-stage-ready { view-timeline-name: --tunel; }
    .story-stage-ready .story-stage {
      animation: sahne-cikis linear both;
      animation-timeline: --tunel;
      animation-range: exit -8% exit 16%;
    }
  }
}
@keyframes sahne-cikis {
  0% { opacity: 1; translate: 0 0; scale: 1; filter: blur(0); }
  100% { opacity: 0; translate: 0 -6vh; scale: 0.94; filter: blur(6px); }
}
