/* Chart scroll scene — loaded only on the Presence teaching pages.
   The official Chart stays pinned, slowly enlarges toward the Light above the figure, gold and violet light
   fades in behind it, then a few lines of the page's own teaching appear one at a time. */
.chart-scene { position: relative; margin: 8px 0 26px; }
.chart-scene .cs-stage { position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 18px; padding: 18px 0 8px; }
.chart-scene .cs-glow { position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background: radial-gradient(ellipse 55% 45% at 50% 22%, rgba(242,217,141,.95), rgba(242,217,141,0) 70%),
              radial-gradient(ellipse 90% 80% at 50% 30%, rgba(123,79,171,.35), rgba(123,79,171,0) 75%); }
.chart-scene .cs-figure { position: relative; z-index: 1; width: fit-content; max-width: 88%; line-height: 0; cursor: pointer; }
.chart-scene .cs-chart { display: block; width: auto; height: min(70vh, 620px); max-width: 100%; border-radius: 16px; box-shadow: 0 24px 50px -24px rgba(74,45,122,.5); }
/* the moving Chart: same frame as the still, faded in over it on a click */
.chart-scene .cs-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: 16px; opacity: 0; transition: opacity .8s ease; pointer-events: none; }
.chart-scene .cs-video.on { opacity: 1; }
/* "Clic para animar": quiet, gold on a translucent veil */
.chart-scene .cs-play { display: none; position: absolute; z-index: 3; top: 20px; left: 50%; transform: translateX(-50%); padding: 8px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(201,162,74,.65); background: rgba(255,252,248,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: #7a5710; font: 800 13px var(--sans); letter-spacing: .04em; white-space: nowrap; transition: opacity .5s ease, background .25s ease; }
html.js .chart-scene .cs-play { display: block; }
.chart-scene .cs-play:hover { background: rgba(255,252,248,.8); }
.chart-scene .cs-lines { position: relative; z-index: 2; list-style: none; margin: 14px auto 0; padding: 0; max-width: 640px; text-align: center; }
.chart-scene .cs-lines li { margin: 0 0 10px; font-family: var(--serif); font-size: clamp(22px, 3vw, 30px); line-height: 1.3; color: var(--ink); }

/* pinned, scroll-driven version (only when JavaScript runs and motion is allowed) */
html.js.cs-on .chart-scene { height: 360vh; margin: 0 0 26px; }
html.js.cs-on .chart-scene .cs-stage { position: sticky; top: 64px; height: calc(100vh - 64px); padding: 0; border-radius: 0; flex-direction: column; justify-content: center; }
html.js.cs-on .chart-scene .cs-glow { opacity: 0; }
html.js.cs-on .chart-scene .cs-figure { max-width: none; align-self: center; transform-origin: 50% 16%; will-change: transform; }
html.js.cs-on .chart-scene .cs-chart { height: min(72vh, 640px); }
html.js.cs-on .chart-scene .cs-play { opacity: 0; pointer-events: none; }
html.js.cs-on .chart-scene .cs-play.show { opacity: 1; pointer-events: auto; }
/* the caption: one language, each sentence on its own translucent cream veil, lower centre, grown to fit the whole sentence */
html.js.cs-on .chart-scene .cs-lines { position: absolute; left: 50%; bottom: 4vh; transform: translateX(-50%); z-index: 2; width: min(92%, 760px); margin: 0; padding: 0;
  display: grid; align-items: end; justify-items: center; pointer-events: none; opacity: 0; transition: opacity .8s ease; }
html.js.cs-on .chart-scene .cs-lines.show { opacity: 1; }
html.js.cs-on .chart-scene .cs-lines li { grid-area: 1 / 1; position: static; margin: 0; max-width: 100%; padding: 14px 26px; text-align: center; overflow-wrap: break-word;
  font-size: clamp(17px, 2.1vw, 24px); line-height: 1.38; color: #2d1b69; text-shadow: 0 0 12px rgba(255,252,248,.85);
  background: rgba(255,252,248,.42); -webkit-backdrop-filter: blur(7px) brightness(1.08); backdrop-filter: blur(7px) brightness(1.08);
  border-radius: 24px; box-shadow: 0 14px 44px -20px rgba(45,27,105,.45), inset 0 0 0 1px rgba(255,255,255,.4);
  opacity: 0; transition: opacity .9s ease; }
html.js.cs-on .chart-scene .cs-lines li.on { opacity: 1; }

/* while the scene is pinned the stage breaks out of the reading column to the window width, so the zoom is clipped only at the window */
@media (prefers-reduced-motion: no-preference) {
  html.js.cs-on { overflow-x: clip; }
  html.js.cs-on .chart-scene { width: 100vw; margin-left: calc(50% - 50vw); }
}

body.reading .chart-scene { display: none; }
@media (prefers-reduced-motion: reduce) {
  html.js.cs-on .chart-scene { height: auto; }
}
