/* Cinematic Ken Burns overlay — fullscreen image pan/zoom with crossfade */

#cinematic-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  z-index: 50;
  display: none;
}

#cinematic-overlay.active {
  display: block;
}

/* Two stacked images for double-buffered crossfade */
.cinematic-frame-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform, opacity;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  transform-origin: center center;
}

.cinematic-frame-img.visible {
  opacity: 1;
}

/* Text overlay at bottom with gradient backdrop */
.cinematic-text-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px 40px 28px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(0, 0, 0, 0.85) 20%,
    rgba(0, 0, 0, 0.65) 40%,
    rgba(0, 0, 0, 0.35) 60%,
    rgba(0, 0, 0, 0.1) 80%,
    transparent 100%
  );
  z-index: 51;
}

.cinematic-text-content {
  color: #e8e0d0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.7;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95), 0 0 20px rgba(0, 0, 0, 0.8);
  max-width: 800px;
  margin: 0 auto;
  white-space: pre-wrap;
}

/* Typewriter cursor blink */
.cinematic-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: #e8e0d0;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cinematic-blink 0.8s step-end infinite;
}

@keyframes cinematic-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Advance hint at bottom */
.cinematic-advance-hint {
  color: #aaa;
  font-size: 16px;
  text-align: center;
  margin-top: 12px;
  font-style: italic;
  opacity: 0;
  transition: opacity 0.5s ease-in;
}

.cinematic-advance-hint.visible {
  opacity: 1;
}

/* Fade-in for overlay entry */
#cinematic-overlay.entering {
  animation: cinematic-fade-in 0.8s ease-out;
}

@keyframes cinematic-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Fade-out for overlay exit */
#cinematic-overlay.exiting {
  animation: cinematic-fade-out 0.8s ease-in forwards;
}

@keyframes cinematic-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Input field at bottom of cinematic */
.cinematic-input-form {
  max-width: 800px;
  margin: 12px auto 0;
}

.cinematic-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(232, 224, 208, 0.3);
  color: #e8e0d0;
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  padding: 6px 0;
  outline: none;
  caret-color: #e8e0d0;
}

.cinematic-input::placeholder {
  color: rgba(232, 224, 208, 0.3);
  font-style: italic;
}

.cinematic-input:focus {
  border-bottom-color: rgba(232, 224, 208, 0.5);
}
