/* IL SOLE — her face while she says it (js/dialogue-scenes/scene-il-sole-faces.js).
   One picture over the room, the confession on the strip beneath it; the
   light changes in the same photograph, the camera pulls focus to the
   glass and back, and red comes in from the window when the word turns
   out to be alive. */

#ilSole {
  position: fixed;
  inset: 0;
  z-index: 1000020;               /* under the strip (#overlayDialogue 1000095), over the room */
  background: #050404;
  overflow: hidden;
  opacity: 0;
  transition: opacity 2.2s ease;
  pointer-events: none;
}
#ilSole.ils-in { opacity: 1; }

/* a stack = one shot: the faces share a framing, the wine shares another */
#ilSole .ils-stack {
  position: absolute;
  inset: 0;
  transform-origin: 50% 36%;
  transition: opacity 1.1s ease, filter 1.1s ease;
  will-change: transform, opacity, filter;
}
#ilSole .ils-stack.ils-zoom { animation: ilsPush 150s linear forwards; }
/* the wine shot sits 8% higher: the pin camera lies at the bottom of the
   table, under the strip otherwise (the lamp shade's top edge goes instead) */
#ilSole .ils-wine { transform-origin: 30% 45%; inset: -8% 0 8% 0; }
#ilSole .ils-wine.ils-zoom { animation: ilsPush 60s linear forwards; }
@keyframes ilsPush {
  from { transform: scale(1.0) translate(0, 0); }
  to   { transform: scale(1.1) translate(-0.6%, 0.4%); }
}
/* the camera pulls focus: the shot it leaves goes soft and out */
#ilSole .ils-stack.ils-soft { filter: blur(14px); opacity: 0; }
#ilSole .ils-stack.ils-hidden { opacity: 0; }

#ilSole .ils-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 36%;
  opacity: 0;
  transition: opacity 2.6s ease;
}
#ilSole .ils-frame.ils-on { opacity: 1; }

/* the cold of the window, a little stronger on the split frames */
#ilSole .ils-cold {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 45%, rgba(70, 105, 150, 0.32) 100%);
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity 3s ease;
  pointer-events: none;
}
#ilSole.ils-split .ils-cold { opacity: 1; }

/* red from the window: the brothers' word is still out there */
#ilSole .ils-red {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 75% at 96% 40%, rgba(220, 20, 40, 0.55), transparent 70%),
    linear-gradient(90deg, transparent 60%, rgba(160, 0, 20, 0.22) 100%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 3.6s ease;
  pointer-events: none;
}
#ilSole.ils-red-on .ils-red { opacity: 1; animation: ilsNeon 4.2s ease-in-out 3.6s infinite; }
#ilSole.ils-red-low .ils-red { opacity: 0.45; animation: none; transition: opacity 4s ease; }
@keyframes ilsNeon {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.78; }
}

/* the room's edges stay dark; the strip below stays readable */
#ilSole .ils-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 75% at 50% 42%, transparent 55%, rgba(0, 0, 0, 0.6) 100%),
    linear-gradient(180deg, transparent 62%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  #ilSole .ils-stack.ils-zoom, #ilSole .ils-wine.ils-zoom { animation: none; }
  #ilSole.ils-red-on .ils-red { animation: none; }
}

/* her face is the whole screen — the strip's portrait chip beside it only
   doubled her (a different photograph of the same woman); the speaker's
   name stays */
body:has(#ilSole) #overlayDialogue .ovd-portrait { display: none; }

/* the capsule drops in: quicker than a change of light */
#ilSole .ils-frame.ils-drop { transition: opacity 1.2s ease; }

/* THE SUPPER'S ECHO — the pill → a coffin → the grave, over Sal's table
   (the table's layers sit at 1000038–1000040; the strip at 1000095) */
#ilSoleEcho {
  position: fixed;
  inset: 0;
  z-index: 1000060;
  background: #050404;
  overflow: hidden;
  opacity: 0;
  transition: opacity 1.4s ease;
  pointer-events: none;
}
#ilSoleEcho.ise-in { opacity: 1; }
#ilSoleEcho .ise-stack {
  position: absolute;
  inset: 0;
  transform-origin: 50% 45%;
  animation: ilsPush 30s linear forwards;
}
#ilSoleEcho .ise-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
  opacity: 0;
  transition: opacity 2.4s ease;
}
#ilSoleEcho .ise-frame.ise-grave { transition: opacity 1.8s ease; }
#ilSoleEcho .ise-frame.ise-on { opacity: 1; }
#ilSoleEcho .ise-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 75% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.6) 100%),
    linear-gradient(180deg, transparent 62%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  #ilSoleEcho .ise-stack { animation: none; }
}
