:root {
  --ink: #090a0b;
  --paper: #efe4cf;
  --gold: #c6a15d;
  --gold-bright: #f0d29a;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  overflow: clip;
  background: var(--ink);
}

body {
  color: var(--paper);
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
}

button { color: inherit; font: inherit; }

.story-app {
  width: 100vw;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  overflow: clip;
  background: #050607;
  user-select: none;
}

.stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overflow: clip;
  background: #050607;
}

#scenes-root {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.018);
  pointer-events: none;
}

.scene.is-active,
.scene.is-leaving { visibility: visible; }

.scene.is-active {
  z-index: 2;
  opacity: 1;
  animation: scene-enter 1.35s cubic-bezier(0.22, 0.78, 0.26, 1) both;
}

.scene.is-leaving {
  z-index: 1;
  opacity: 1;
  animation: scene-leave 1.35s cubic-bezier(0.45, 0, 0.35, 1) both;
}

.direction-backward .scene.is-active { animation-name: scene-enter-backward; }
.direction-backward .scene.is-leaving { animation-name: scene-leave-backward; }

.scene-image,
.scene-image img {
  position: absolute;
  inset: -2.5%;
  width: 105%;
  height: 105%;
}

.scene-image {
  transform-origin: var(--focal-point, 50% 50%);
  animation-duration: var(--scene-duration, 5000ms);
  animation-timing-function: linear;
  animation-fill-mode: both;
  animation-play-state: paused;
}

.scene.is-active .scene-image { animation-play-state: running; }
.story-app.is-paused .scene.is-active .scene-image { animation-play-state: paused; }

.scene-image img {
  object-fit: cover;
  object-position: var(--focal-point, 50% 50%);
  filter: saturate(0.93) contrast(1.04);
  transform: translateZ(0);
}

.motion-aerial { animation-name: aerial-descent; }
.motion-push { animation-name: camera-push; }
.motion-still-push { animation-name: still-push; }
.motion-drift-left { animation-name: drift-left; }
.motion-drift-right { animation-name: drift-right; }
.motion-macro { animation-name: macro-push; }
.motion-pull { animation-name: camera-pull; }

.scene-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 4, 4, 0.86) 0%, rgba(4, 5, 5, 0.14) 38%, rgba(3, 4, 4, 0.06) 62%, rgba(3, 4, 4, 0.28) 100%),
    linear-gradient(0deg, rgba(3, 4, 4, 0.83) 0%, transparent 35%, rgba(3, 4, 4, 0.2) 100%),
    radial-gradient(circle at 53% 42%, transparent 20%, rgba(3, 4, 4, 0.25) 100%);
}

.transition-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.transition-fade {
  background: #080908;
  animation: transition-fade 1.35s ease-out both;
}

.transition-flare {
  background: radial-gradient(circle at 62% 44%, rgba(255, 224, 160, 0.95), rgba(212, 143, 55, 0.3) 20%, transparent 56%);
  mix-blend-mode: screen;
  animation: transition-flare 1.4s ease-out both;
}

.transition-dark {
  background: linear-gradient(90deg, #030403 0 34%, transparent 72%);
  animation: transition-wipe 1.35s cubic-bezier(0.62, 0, 0.25, 1) both;
}

.transition-glint {
  background: linear-gradient(108deg, transparent 39%, rgba(255, 240, 201, 0.85) 50%, transparent 61%);
  mix-blend-mode: screen;
  animation: transition-glint 1.25s ease-out both;
}

.transition-shadow {
  background: linear-gradient(112deg, transparent 0 26%, rgba(1, 2, 3, 0.95) 44% 62%, transparent 78%);
  animation: transition-shadow 1.6s cubic-bezier(0.3, 0.75, 0.35, 1) both;
}

.transition-dissolve {
  background: radial-gradient(circle at 50% 50%, rgba(229, 204, 157, 0.32), transparent 44%);
  mix-blend-mode: screen;
  animation: transition-dissolve 1.4s ease-out both;
}

.film-grain {
  position: absolute;
  inset: -50%;
  z-index: 5;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
  animation: grain 0.28s steps(2) infinite;
  mix-blend-mode: soft-light;
}

.frame-lines {
  position: absolute;
  inset: 18px;
  z-index: 6;
  pointer-events: none;
  border: 1px solid rgba(238, 218, 181, 0.12);
}

.frame-lines::before,
.frame-lines::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: rgba(235, 209, 160, 0.48);
}

.frame-lines::before {
  top: -1px;
  right: -1px;
  border-top: 1px solid;
  border-right: 1px solid;
}

.frame-lines::after {
  bottom: -1px;
  left: -1px;
  border-bottom: 1px solid;
  border-left: 1px solid;
}

.masthead {
  position: absolute;
  z-index: 10;
  top: 42px;
  right: 48px;
  left: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  direction: rtl;
}

.brand {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
}

.brand-mark {
  grid-row: 1 / span 2;
  color: var(--gold-bright);
  font-family: serif;
  font-size: 31px;
  line-height: 1;
  text-shadow: 0 0 22px rgba(212, 164, 84, 0.28);
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.brand-latin {
  color: rgba(244, 233, 212, 0.54);
  font-family: Georgia, serif;
  font-size: 8px;
  letter-spacing: 0.42em;
  line-height: 1.2;
}

.masthead-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(244, 232, 211, 0.6);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
}

.scene-index {
  position: absolute;
  z-index: 10;
  top: 50%;
  left: 47px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: rgba(244, 232, 211, 0.45);
  font-family: Georgia, serif;
  font-size: 9px;
  letter-spacing: 0.12em;
  transform: translateY(-50%);
}

.scene-index .current-number { color: var(--paper); font-size: 15px; }

.index-line {
  width: 1px;
  height: 52px;
  background: linear-gradient(var(--gold), rgba(198, 161, 93, 0.08));
}

.story-caption {
  position: absolute;
  z-index: 10;
  right: clamp(44px, 7vw, 130px);
  bottom: clamp(130px, 18vh, 195px);
  width: min(560px, 48vw);
  padding-right: 26px;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.58);
  transition: opacity 0.35s ease, transform 0.45s ease;
}

.story-caption.is-hidden {
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}

.story-caption.is-visible {
  animation: caption-enter 1s 0.25s cubic-bezier(0.22, 0.8, 0.26, 1) both;
}

.caption-rule {
  position: absolute;
  top: 3px;
  right: 0;
  width: 2px;
  height: 100%;
  max-height: 186px;
  background: linear-gradient(var(--gold-bright), rgba(198, 161, 93, 0));
  box-shadow: 0 0 24px rgba(198, 161, 93, 0.38);
}

.chapter,
.eyebrow,
.story-copy { margin: 0; }

.chapter {
  margin-bottom: 8px;
  color: var(--gold-bright);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.eyebrow {
  color: rgba(246, 234, 213, 0.62);
  font-size: 11px;
  line-height: 1.7;
}

.story-caption h1 {
  max-width: 620px;
  margin: 7px 0 11px;
  font-size: clamp(32px, 4.1vw, 68px);
  font-weight: 700;
  line-height: 1.17;
  letter-spacing: -0.045em;
}

.story-copy {
  max-width: 520px;
  color: rgba(247, 237, 220, 0.84);
  font-size: clamp(13px, 1.08vw, 17px);
  line-height: 1.95;
}

.date-stamp {
  position: absolute;
  right: calc(100% + 30px);
  bottom: 5px;
  color: rgba(241, 217, 173, 0.68);
  font-family: Georgia, serif;
  font-size: clamp(32px, 4.8vw, 76px);
  letter-spacing: -0.03em;
  opacity: 0.52;
}

.story-controls {
  position: absolute;
  z-index: 12;
  right: 48px;
  bottom: 61px;
  display: flex;
  align-items: center;
  gap: 9px;
  direction: rtl;
}

.round-button,
.play-button,
.icon-button,
.text-button {
  display: grid;
  place-items: center;
  border: 1px solid rgba(240, 219, 181, 0.22);
  outline: none;
  background: rgba(8, 9, 9, 0.3);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.round-button:hover,
.play-button:hover,
.icon-button:hover,
.text-button:hover,
.round-button:focus-visible,
.play-button:focus-visible,
.icon-button:focus-visible,
.text-button:focus-visible {
  border-color: rgba(240, 210, 151, 0.68);
  background: rgba(22, 19, 15, 0.7);
  transform: translateY(-2px);
}

.round-button,
.play-button,
.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.round-button { font-size: 16px; }

.play-button {
  width: 46px;
  height: 46px;
  border-color: rgba(235, 198, 127, 0.62);
  background: rgba(198, 161, 93, 0.16);
}

.pause-icon {
  width: 10px;
  height: 14px;
  border-right: 3px solid var(--paper);
  border-left: 3px solid var(--paper);
}

.play-icon {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 11px solid var(--paper);
}

.timecode {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 8px 0 13px;
  direction: ltr;
  color: rgba(246, 234, 214, 0.74);
  font-family: Georgia, serif;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.time-divider { color: rgba(246, 234, 214, 0.26); }

.text-button {
  height: 34px;
  padding: 0 13px;
  border-radius: 18px;
  color: rgba(246, 234, 214, 0.7);
  font-size: 10px;
}

.text-button[aria-pressed="true"] {
  border-color: rgba(235, 198, 127, 0.52);
  color: var(--paper);
}

.icon-button { width: 34px; height: 34px; }

.fullscreen-icon {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(246, 234, 214, 0.8);
  box-shadow: inset 0 0 0 3px rgba(8, 9, 9, 0.6);
}

.timeline {
  position: absolute;
  z-index: 12;
  right: 48px;
  bottom: 25px;
  left: 48px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 7px;
  direction: ltr;
}

.timeline button {
  position: relative;
  height: 20px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  cursor: pointer;
}

.timeline-track {
  position: absolute;
  top: 4px;
  right: 0;
  left: 0;
  height: 2px;
  overflow: hidden;
  background: rgba(241, 226, 201, 0.22);
}

.timeline-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, #9c773f, var(--gold-bright));
  box-shadow: 0 0 9px rgba(237, 199, 125, 0.45);
}

.timeline-label {
  position: absolute;
  top: 9px;
  left: 0;
  color: rgba(244, 231, 209, 0.34);
  font-family: Georgia, serif;
  font-size: 7px;
  transition: color 0.2s ease;
}

.timeline button:hover .timeline-label,
.timeline button:focus-visible .timeline-label,
.timeline button.is-current .timeline-label { color: var(--gold-bright); }

.paused-state {
  position: absolute;
  z-index: 11;
  top: 50%;
  left: 50%;
  padding: 9px 15px;
  border: 1px solid rgba(240, 219, 181, 0.2);
  border-radius: 30px;
  background: rgba(5, 6, 6, 0.55);
  color: rgba(246, 234, 214, 0.75);
  font-size: 10px;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(12px);
  animation: paused-enter 0.25s ease-out both;
}

@keyframes scene-enter {
  from { opacity: 0; transform: scale(1.035); filter: blur(5px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes scene-leave {
  from { opacity: 1; transform: scale(1); filter: blur(0); }
  to { opacity: 0; transform: scale(0.99); filter: blur(2px); }
}

@keyframes scene-enter-backward {
  from { opacity: 0; transform: scale(0.985); filter: blur(5px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes scene-leave-backward {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.025); filter: blur(2px); }
}

@keyframes aerial-descent {
  from { transform: scale(1.025) translate3d(0, -0.7%, 0); }
  to { transform: scale(1.11) translate3d(0, 1.2%, 0); }
}

@keyframes camera-push {
  from { transform: scale(1.015); }
  to { transform: scale(1.1); }
}

@keyframes still-push {
  from { transform: scale(1.04) translate3d(-0.5%, 0, 0); }
  to { transform: scale(1.105) translate3d(0.7%, -0.3%, 0); }
}

@keyframes drift-left {
  from { transform: scale(1.08) translate3d(1.3%, 0, 0); }
  to { transform: scale(1.1) translate3d(-1.3%, -0.25%, 0); }
}

@keyframes drift-right {
  from { transform: scale(1.08) translate3d(-1.25%, 0.25%, 0); }
  to { transform: scale(1.105) translate3d(1.25%, -0.25%, 0); }
}

@keyframes macro-push {
  from { transform: scale(1.045); }
  to { transform: scale(1.135) translate3d(-0.5%, 0, 0); }
}

@keyframes camera-pull {
  from { transform: scale(1.12); }
  to { transform: scale(1.025); }
}

@keyframes transition-fade {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}

@keyframes transition-flare {
  0% { opacity: 0; transform: scale(0.7); }
  24% { opacity: 0.9; }
  100% { opacity: 0; transform: scale(1.6); }
}

@keyframes transition-wipe {
  0% { opacity: 0.95; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(-38%); }
}

@keyframes transition-glint {
  0% { opacity: 0; transform: translateX(45%); }
  25% { opacity: 0.7; }
  100% { opacity: 0; transform: translateX(-45%); }
}

@keyframes transition-shadow {
  0% { opacity: 0; transform: translateX(48%); }
  30% { opacity: 0.92; }
  100% { opacity: 0; transform: translateX(-52%); }
}

@keyframes transition-dissolve {
  0% { opacity: 0.8; transform: scale(0.72); }
  100% { opacity: 0; transform: scale(1.45); }
}

@keyframes grain {
  0% { transform: translate3d(-2%, -1%, 0); }
  25% { transform: translate3d(1%, 2%, 0); }
  50% { transform: translate3d(2%, -1%, 0); }
  75% { transform: translate3d(-1%, 1%, 0); }
  100% { transform: translate3d(0, -2%, 0); }
}

@keyframes caption-enter {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes paused-enter {
  from { opacity: 0; transform: translate(-50%, -46%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

@media (max-width: 820px) {
  .story-app { min-height: 480px; }
  .frame-lines { inset: 10px; }
  .masthead { top: 25px; right: 25px; left: 25px; }
  .masthead-meta, .scene-index { display: none; }
  .story-caption {
    right: 25px;
    bottom: 132px;
    width: calc(100vw - 50px);
    padding-right: 17px;
  }
  .story-caption h1 {
    max-width: 92%;
    margin-top: 5px;
    font-size: clamp(29px, 8vw, 48px);
  }
  .story-copy { max-width: 92%; font-size: 12px; line-height: 1.8; }
  .date-stamp { right: auto; left: 0; bottom: 8px; font-size: 36px; }
  .story-controls { right: 25px; bottom: 53px; }
  .timecode { display: none; }
  .timeline { right: 25px; bottom: 19px; left: 25px; gap: 4px; }
  .timeline-label { display: none; }
  .scene-vignette {
    background:
      linear-gradient(0deg, rgba(3, 4, 4, 0.94) 0%, rgba(3, 4, 4, 0.42) 48%, rgba(3, 4, 4, 0.1) 100%),
      radial-gradient(circle at 54% 38%, transparent 10%, rgba(3, 4, 4, 0.26) 100%);
  }
}

@media (max-height: 650px) and (min-width: 821px) {
  .masthead { top: 27px; }
  .story-caption { bottom: 112px; }
  .story-caption h1 { font-size: clamp(30px, 3.5vw, 54px); }
  .story-copy { font-size: 12px; line-height: 1.75; }
  .story-controls { bottom: 49px; }
  .timeline { bottom: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .scene,
  .scene-image,
  .story-caption,
  .transition-layer,
  .film-grain {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
