/* "From the source to the network": scroll-driven WebGL film (cinematic.js) */
.cine {
  position: relative;
  background: #0d0c1d;
  color: #f4f3ff;
}
.cine.is-live {
  height: 520vh;
}
.cine-stage {
  position: relative;
  overflow: hidden;
}
.cine.is-live .cine-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
}
.cine-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.cine:not(.is-live) .cine-canvas,
.cine:not(.is-live) .cine-overlay,
.cine:not(.is-live) .cine-dots,
.cine:not(.is-live) .cine-labels {
  display: none;
}
/* without WebGL or with reduced motion: the five steps as a plain sequence */
.cine-static {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin: 0 auto;
  padding: 72px 0;
  list-style: none;
}
.cine.is-live .cine-static {
  display: none;
}
.cine-static li {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  font: 600 17px/1.3 var(--display, sans-serif);
}
.cine-static .mono {
  font-size: 12px;
  color: #e6ad7c;
}
/* the act's title, set large over the film */
.cine-overlay {
  position: absolute;
  left: 0;
  right: 0;
  top: max(96px, 11vh);
  pointer-events: none;
}
.cine-eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #e6ad7c;
}
.cine-title {
  max-width: 14ch;
  margin: 0;
  font: 760 clamp(34px, 3.4vw + 14px, 68px)/1.0 var(--display, sans-serif);
  letter-spacing: -0.055em;
  color: #fff;
  text-shadow: 0 2px 30px rgba(13, 12, 29, 0.6);
}
.cine-body {
  max-width: 34ch;
  margin: 16px 0 0;
  font-size: clamp(15px, 0.3vw + 14px, 18px);
  line-height: 1.5;
  color: #c9c6e8;
}
.cine-dots {
  position: absolute;
  right: max(24px, 4vw);
  top: 50%;
  display: grid;
  gap: 12px;
  transform: translateY(-50%);
}
.cine-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(230, 173, 124, 0.7);
  transition: background-color 0.4s ease, transform 0.4s ease;
}
.cine-dot.is-on {
  background: #e6ad7c;
}
/* projected labels: definitions in act 4, entity names in act 5 */
.cine-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.cine-card,
.cine-node {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  will-change: transform, opacity;
}
.cine-card {
  width: min(380px, 32vw);
  margin: 0;
  padding: 14px 16px;
  border: 1px solid rgba(230, 173, 124, 0.45);
  border-radius: 14px;
  background: rgba(21, 20, 44, 0.92);
  color: #f4f3ff;
  transition: opacity 0.4s ease;
}
.cine-card strong {
  display: block;
  font: 650 15px/1.2 var(--display, sans-serif);
}
.cine-card-value {
  display: block;
  margin-top: 4px;
  font: 500 13px/1 var(--mono, monospace);
  color: #e6ad7c;
}
.cine-card p {
  margin: 8px 0 6px;
  font-size: 12px;
  line-height: 1.45;
  color: #c9c6e8;
}
.cine-card-source {
  font: 500 11px/1 var(--mono, monospace);
  color: #b1adff;
}
.cine-node {
  transform-origin: 50% 100%;
  padding: 3px 8px;
  margin: -26px 0 0 0;
  border-radius: 999px;
  background: rgba(21, 20, 44, 0.75);
  font: 500 11px/1.2 var(--sans, sans-serif);
  color: #f4f3ff;
  white-space: nowrap;
  translate: -50% 0;
  transition: opacity 0.4s ease;
}
@media (max-width: 800px) {
  .cine-static {
    grid-template-columns: minmax(0, 1fr);
    padding: 48px 0;
  }
  .cine-overlay {
    top: 76px;
  }
  .cine-card {
    width: 180px;
    margin: -130px 0 0 -90px;
    padding: 10px 12px;
  }
  .cine-card p {
    display: none;
  }
  .cine-node {
    font-size: 10px;
  }
}

/* Paper light: the real pages sit on a warm sheet, lit from the upper left */
.cine {
  background: #f4efe6;
  color: #17162b;
}
.cine.is-live .cine-stage {
  background:
    radial-gradient(120% 90% at 30% 10%, #fbf8f2 0%, rgba(251, 248, 242, 0) 60%),
    radial-gradient(80% 70% at 85% 95%, rgba(184, 121, 68, 0.16) 0%, rgba(184, 121, 68, 0) 70%),
    linear-gradient(180deg, #f6f1e8 0%, #ece4d6 100%);
}
.cine-canvas {
  z-index: 0;
}
.cine-title {
  color: #17162b;
  text-shadow: none;
}
.cine-body {
  color: #3b3a52;
}
.cine-eyebrow {
  color: #8a5427;
}
.cine-dot {
  border-color: rgba(23, 22, 43, 0.45);
}
.cine-dot.is-on {
  background: #17162b;
  border-color: #17162b;
}
.cine-card {
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 253, 249, 0.93);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  color: #17162b;
  box-shadow: 0 18px 50px -20px rgba(59, 57, 144, 0.45);
}
.cine-card p {
  color: #4a4962;
}
.cine-card-value {
  color: #8a5427;
}
.cine-card-source {
  color: #3b3990;
}
.cine-node {
  background: rgba(255, 255, 255, 0.82);
  color: #17162b;
  box-shadow: 0 4px 14px -6px rgba(23, 22, 43, 0.35);
}
.cine-static li {
  border-top-color: rgba(23, 22, 43, 0.2);
}
.cine-static .mono {
  color: #8a5427;
}
/* a light veil keeps the act's words readable over the film */
.cine.is-live .cine-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 250, 244, 0.78) 0%, rgba(255, 250, 244, 0.4) 30%, rgba(255, 250, 244, 0) 48%);
}
.cine-overlay,
.cine-dots {
  z-index: 2;
}
@media (max-width: 899px) {
  .cine.is-live .cine-stage::after {
    background: linear-gradient(180deg, rgba(255, 250, 244, 0.85) 0%, rgba(255, 250, 244, 0.5) 34%, rgba(255, 250, 244, 0) 50%);
  }
}
/* phones: the definitions stack at the foot of the scene, the act dots step aside */
.cine.is-narrow .cine-card {
  left: 16px;
  right: 16px;
  top: auto;
  width: auto;
  max-width: none;
  transform: none !important;
  margin: 0;
  padding: 10px 12px;
}
.cine.is-narrow .cine-card p {
  display: none;
}
.cine.is-narrow .cine-card:nth-child(1) { bottom: calc(24px + 2 * 76px); }
.cine.is-narrow .cine-card:nth-child(2) { bottom: calc(24px + 76px); }
.cine.is-narrow .cine-card:nth-child(3) { bottom: 24px; }
.cine.is-narrow .cine-dots {
  display: none;
}
