/* Ciencia Escénica — complements Tailwind */
.material-symbols-outlined {
	font-family: "Material Symbols Outlined", sans-serif;
	font-weight: normal;
	font-style: normal;
	font-size: 24px;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	display: inline-block;
	white-space: nowrap;
	word-wrap: normal;
	direction: ltr;
	font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.scrim-gradient {
	background: linear-gradient(
		to top,
		rgba(19, 19, 19, 1) 0%,
		rgba(19, 19, 19, 0.45) 50%,
		rgba(19, 19, 19, 0) 100%
	);
}

/* Distribution grid — rotating primary border on hover */
.ce-dist-card {
	position: relative;
	display: block;
	border-radius: 0.25rem;
	padding: 2px;
	background: #1f1f1f;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
}

/* Force select options to be white on dark bg */
select[data-ce-filter] {
	color: #ffffff !important;
	background-color: #1F1F1F !important;
}
select[data-ce-filter] option {
	color: #ffffff !important;
	background-color: #1F1F1F !important;
}

.ce-dist-card::before {
	content: "";
	position: absolute;
	inset: -50%;
	background: conic-gradient(from 0deg, transparent 0%, transparent 70%, #33b0a3 85%, transparent 100%);
	opacity: 0;
	transition: opacity 0.25s ease;
	animation: ce-spin 4s linear infinite;
	animation-play-state: paused;
	z-index: 0;
}

.ce-dist-card:hover::before,
.ce-dist-card:focus-visible::before {
	opacity: 1;
	animation-play-state: running;
}

@keyframes ce-spin {
	to {
		transform: rotate(360deg);
	}
}

.ce-dist-card-inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	background: #131313;
	border-radius: 0.125rem;
	overflow: hidden;
}

.ce-dist-image-wrap {
	display: block;
	overflow: hidden;
	width: 100%;
}

.ce-dist-image-wrap img {
	width: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	display: block;
	transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.ce-dist-card:hover .ce-dist-image-wrap img,
.ce-dist-card:focus-visible .ce-dist-image-wrap img {
	transform: scale(1.05);
}

.ce-dist-title-wrap {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 3rem 1.5rem 1.5rem 1.5rem;
	background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0) 100%);
	pointer-events: none;
	z-index: 2;
}

.ce-dist-title {
	display: block;
	font-family: Epilogue, system-ui, sans-serif;
	font-weight: 700;
	font-size: 1.85rem;
	line-height: 1.1;
	color: #ffffff;
	text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.ce-dist-card.is-hidden {
	display: none;
}

/* Hover effect (like distribution) for other cards */
.ce-hover-card {
	position: relative;
	display: block;
	border-radius: 0.25rem;
	padding: 2px;
	background: #1f1f1f;
	overflow: hidden;
}
.ce-hover-card::before {
	content: "";
	position: absolute;
	inset: -50%;
	background: conic-gradient(from 0deg, transparent 0%, transparent 70%, #33b0a3 85%, transparent 100%);
	opacity: 0;
	transition: opacity 0.25s ease;
	animation: ce-spin 3s linear infinite;
	animation-play-state: paused;
	z-index: 0;
}
.ce-hover-card:hover::before,
.ce-hover-card:focus-within::before {
	opacity: 1;
	animation-play-state: running;
}
.ce-hover-card-inner {
	position: relative;
	z-index: 1;
	display: block;
	background: #1f1f1f;
	border-radius: 0.125rem;
	overflow: hidden;
}

/* Transparency (match BigBang structure: description + logos left/bottom) */
.ce-transparency-item-logos {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 18px;
}

.ce-transparency-item-logo img {
	max-height: 96px;
	max-width: 220px;
	height: auto;
	width: auto;
}

.ce-transparency-item-logos-left {
	display: flex;
	flex-direction: row-reverse; /* logos on the left, description on the right */
	gap: 24px;
	align-items: flex-start;
}

.ce-transparency-item-logos-left .ce-transparency-item-description {
	flex: 1;
	margin-top: 0;
}

.ce-transparency-item-logos-left .ce-transparency-item-logos {
	flex-direction: column;
	align-items: flex-start;
	margin-top: 0;
}

.ce-transparency-item-logos-bottom .ce-transparency-item-logos {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	padding-top: 18px;
}

@media (max-width: 768px) {
	.ce-transparency-item-logos-left {
		flex-direction: column;
	}
	.ce-transparency-item-logos-left .ce-transparency-item-logos {
		flex-direction: row;
	}
}

/* ============================================
   SYNOPSIS SECTION ANIMATIONS
   ============================================ */
.ce-synopsis-section {
	position: relative;
	overflow: hidden;
}

/* ============================================
   SPOTLIGHT ANIMATION
   ============================================ */

/* Text starts dark (no light), becomes white when fully lit */
.ce-synopsis-section[data-ce-anim="spotlight"] .ce-synopsis-text,
.ce-synopsis-section[data-ce-anim="spotlight"] .ce-synopsis-text * {
	color: #2a2a2a !important;
	-webkit-text-fill-color: #2a2a2a;
	transition: color 0.05s ease-out, -webkit-text-fill-color 0.05s ease-out;
}

/* During flicker: every text node animates — strong white flashes synced with the bulb */
.ce-synopsis-section[data-ce-anim="spotlight"].is-flickering .ce-synopsis-text,
.ce-synopsis-section[data-ce-anim="spotlight"].is-flickering .ce-synopsis-text * {
	animation: ce-text-flicker 0.85s steps(1, end) forwards;
}

.ce-synopsis-section[data-ce-anim="spotlight"].is-lit .ce-synopsis-text,
.ce-synopsis-section[data-ce-anim="spotlight"].is-lit .ce-synopsis-text * {
	color: #ffffff !important;
	-webkit-text-fill-color: #ffffff;
	transition: color 0.15s ease-out, -webkit-text-fill-color 0.15s ease-out;
}

/* Keyframe % aligned with bulb/lens/cone — many steps go to pure white */
@keyframes ce-text-flicker {
	0%   { color: #1a1a1a; -webkit-text-fill-color: #1a1a1a; }
	5%   { color: #ffffff; -webkit-text-fill-color: #ffffff; }
	7%   { color: #1f1f1f; -webkit-text-fill-color: #1f1f1f; }
	14%  { color: #ffffff; -webkit-text-fill-color: #ffffff; }
	16%  { color: #1a1a1a; -webkit-text-fill-color: #1a1a1a; }
	24%  { color: #fffef8; -webkit-text-fill-color: #fffef8; }
	33%  { color: #222222; -webkit-text-fill-color: #222222; }
	42%  { color: #ffffff; -webkit-text-fill-color: #ffffff; }
	50%  { color: #ffffff; -webkit-text-fill-color: #ffffff; }
	53%  { color: #4a4a4a; -webkit-text-fill-color: #4a4a4a; }
	62%  { color: #181818; -webkit-text-fill-color: #181818; }
	66%  { color: #ffffff; -webkit-text-fill-color: #ffffff; }
	78%  { color: #ffffff; -webkit-text-fill-color: #ffffff; }
	86%  { color: #f5f0e8; -webkit-text-fill-color: #f5f0e8; }
	90%  { color: #ffffff; -webkit-text-fill-color: #ffffff; }
	100% { color: #ffffff; -webkit-text-fill-color: #ffffff; }
}

/* Theater spotlight fixture (Fresnel-style hanging from a truss) */
.ce-synopsis-section[data-ce-anim="spotlight"] .ce-spotlight-fixture {
	position: absolute;
	top: 4%;
	right: 5%;
	width: 130px;
	height: 150px;
	z-index: 12;
	pointer-events: none;
}

/* Truss / mounting bar (horizontal pipe) */
.ce-synopsis-section[data-ce-anim="spotlight"] .ce-spotlight-bar {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 8px;
	background: linear-gradient(180deg, #555 0%, #2a2a2a 45%, #1a1a1a 100%);
	border-radius: 2px;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
}

/* Yoke pin: short vertical drop from the bar */
.ce-synopsis-section[data-ce-anim="spotlight"] .ce-spotlight-yoke-pin {
	position: absolute;
	top: 8px;
	right: 48px;
	width: 5px;
	height: 14px;
	background: linear-gradient(180deg, #3a3a3a 0%, #151515 100%);
	border-radius: 1px;
}

/* Body of the spotlight (Fresnel-style, hanging at angle, pointing left) */
.ce-synopsis-section[data-ce-anim="spotlight"] .ce-spotlight-body {
	position: absolute;
	top: 22px;
	right: 30px;
	width: 50px;
	height: 70px;
	transform: rotate(45deg);
	transform-origin: top center;
	filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.6));
}

/* Body shell (tapered trapezoid for Fresnel look) */
.ce-synopsis-section[data-ce-anim="spotlight"] .ce-spotlight-body::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		95deg,
		#0a0a0a 0%,
		#2a2a2a 25%,
		#3a3a3a 50%,
		#2a2a2a 75%,
		#0a0a0a 100%
	);
	clip-path: polygon(20% 0%, 80% 0%, 96% 100%, 4% 100%);
}

/* Cooling fins on top half of body */
.ce-synopsis-section[data-ce-anim="spotlight"] .ce-spotlight-fins {
	position: absolute;
	top: 18%;
	left: 26%;
	right: 26%;
	height: 38%;
	background: repeating-linear-gradient(
		180deg,
		rgba(0, 0, 0, 0.65) 0,
		rgba(0, 0, 0, 0.65) 1px,
		transparent 1.5px,
		transparent 5px
	);
	pointer-events: none;
}

/* Lens hood (wider ring at the front of the body) */
.ce-synopsis-section[data-ce-anim="spotlight"] .ce-spotlight-lens {
	position: absolute;
	bottom: -6px;
	left: -10%;
	right: -10%;
	height: 22px;
	background: radial-gradient(ellipse at center, #161616 0%, #050505 70%);
	border-radius: 50%;
	border: 1.5px solid #2c2c2c;
	box-shadow:
		inset 0 2px 5px rgba(0, 0, 0, 0.7),
		0 2px 4px rgba(0, 0, 0, 0.5);
	overflow: visible;
}

/* Bulb (the actual light source — sits centered inside the lens hood) */
.ce-synopsis-section[data-ce-anim="spotlight"] .ce-spotlight-bulb {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 32px;
	height: 14px;
	border-radius: 50%;
	background: radial-gradient(ellipse at 50% 40%, #2c2c2c 0%, #0a0a0a 80%);
	transition: background 0.4s ease-out, box-shadow 0.4s ease-out;
}

/*
 * Cone covers the full section as a clip-path trapezoid.
 * Polygon coordinates are set via CSS custom properties updated by JS on resize.
 * --ce-cone-on  = lit polygon
 * --ce-cone-off = collapsed polygon (no visible cone)
 */
:root {
	--ce-cone-on:  polygon(89% 14%, 90% 21%, 30% 452%, -35% 95%);
	--ce-cone-off: polygon(89% 14%, 90% 21%, 90% 21%, 89% 14%);
}
.ce-synopsis-section[data-ce-anim="spotlight"] .ce-spotlight-cone {
	position: absolute;
	inset: 0;
	z-index: 5;
	pointer-events: none;
	mix-blend-mode: screen;
	clip-path: var(--ce-cone-off);
	background: linear-gradient(
		220deg,
		rgba(255, 245, 200, 0) 0%,
		rgba(255, 225, 150, 0) 30%,
		rgba(255, 200, 120, 0) 70%,
		transparent 100%
	);
	transition: clip-path 0.05s, background 0.05s;
}

/* Flickering ON state: bulb + lens glow + cone variations */
.ce-synopsis-section[data-ce-anim="spotlight"].is-flickering .ce-spotlight-bulb {
	animation: ce-bulb-flicker 0.85s steps(1, end) forwards;
}
.ce-synopsis-section[data-ce-anim="spotlight"].is-flickering .ce-spotlight-lens {
	animation: ce-lens-flicker 0.85s steps(1, end) forwards;
}
.ce-synopsis-section[data-ce-anim="spotlight"].is-flickering .ce-spotlight-cone {
	animation: ce-cone-flicker 0.85s steps(1, end) forwards;
}

/* Stable lit state */
.ce-synopsis-section[data-ce-anim="spotlight"].is-lit .ce-spotlight-bulb {
	background: radial-gradient(ellipse at 50% 40%, #ffffff 0%, #fff5dc 25%, #ffd285 60%, #ff8a3d 90%, #cc4a00 100%);
	box-shadow:
		0 0 12px 2px rgba(255, 240, 200, 1),
		0 0 25px 4px rgba(255, 220, 150, 0.85),
		0 0 50px 8px rgba(255, 180, 80, 0.6),
		0 0 90px 14px rgba(255, 140, 40, 0.45),
		0 0 140px 20px rgba(255, 120, 30, 0.25);
}
.ce-synopsis-section[data-ce-anim="spotlight"].is-lit .ce-spotlight-lens {
	background: radial-gradient(ellipse at center, #fff5dc 0%, #ffd285 30%, #5a2400 75%, #050505 100%);
	border-color: #4a3a20;
}
.ce-synopsis-section[data-ce-anim="spotlight"].is-lit .ce-spotlight-cone {
	clip-path: var(--ce-cone-on);
	background: linear-gradient(
		220deg,
		rgba(255, 248, 210, 0.75) 0%,
		rgba(255, 232, 165, 0.5) 20%,
		rgba(255, 210, 130, 0.3) 45%,
		rgba(255, 185, 100, 0.14) 70%,
		transparent 100%
	);
}

@keyframes ce-bulb-flicker {
	0%   { background: radial-gradient(ellipse at 50% 40%, #2c2c2c 0%, #0a0a0a 80%); box-shadow: none; }
	5%   { background: radial-gradient(ellipse at 50% 40%, #ffd285 0%, #ff8a3d 60%, #5a2000 100%); box-shadow: 0 0 8px 1px rgba(255, 200, 120, 0.7), 0 0 18px 3px rgba(255, 150, 60, 0.4); }
	7%   { background: radial-gradient(ellipse at 50% 40%, #2c2c2c 0%, #0a0a0a 80%); box-shadow: none; }
	14%  { background: radial-gradient(ellipse at 50% 40%, #fff5dc 0%, #ffd285 50%, #ff8a3d 100%); box-shadow: 0 0 12px 2px rgba(255, 240, 200, 0.85), 0 0 28px 5px rgba(255, 180, 80, 0.55); }
	16%  { background: radial-gradient(ellipse at 50% 40%, #2c2c2c 0%, #0a0a0a 80%); box-shadow: none; }
	24%  { background: radial-gradient(ellipse at 50% 40%, #ffd285 0%, #ff8a3d 80%); box-shadow: 0 0 8px 1px rgba(255, 200, 120, 0.7), 0 0 18px 3px rgba(255, 150, 60, 0.4); }
	33%  { background: radial-gradient(ellipse at 50% 40%, #2c2c2c 0%, #0a0a0a 80%); box-shadow: none; }
	42%  { background: radial-gradient(ellipse at 50% 40%, #fff5dc 0%, #ffd285 40%, #ff8a3d 100%); box-shadow: 0 0 12px 2px rgba(255, 240, 200, 0.9), 0 0 30px 6px rgba(255, 180, 80, 0.6), 0 0 60px 10px rgba(255, 140, 40, 0.35); }
	50%  { background: radial-gradient(ellipse at 50% 40%, #ffffff 0%, #fff5dc 30%, #ffd285 70%); box-shadow: 0 0 12px 2px rgba(255, 240, 200, 1), 0 0 25px 4px rgba(255, 220, 150, 0.85), 0 0 50px 8px rgba(255, 180, 80, 0.6), 0 0 90px 14px rgba(255, 140, 40, 0.45); }
	53%  { background: radial-gradient(ellipse at 50% 40%, #4a4a4a 0%, #1a1a1a 70%); box-shadow: 0 0 5px 1px rgba(255, 180, 80, 0.25); }
	62%  { background: radial-gradient(ellipse at 50% 40%, #2c2c2c 0%, #0a0a0a 80%); box-shadow: none; }
	66%  { background: radial-gradient(ellipse at 50% 40%, #ffffff 0%, #fff5dc 25%, #ffd285 70%); box-shadow: 0 0 12px 2px rgba(255, 240, 200, 1), 0 0 25px 4px rgba(255, 220, 150, 0.85), 0 0 50px 8px rgba(255, 180, 80, 0.6); }
	78%  { background: radial-gradient(ellipse at 50% 40%, #ffffff 0%, #fff5dc 25%, #ffd285 60%, #ff8a3d 90%, #cc4a00 100%); box-shadow: 0 0 12px 2px rgba(255, 240, 200, 1), 0 0 25px 4px rgba(255, 220, 150, 0.85), 0 0 50px 8px rgba(255, 180, 80, 0.6), 0 0 90px 14px rgba(255, 140, 40, 0.45); }
	100% { background: radial-gradient(ellipse at 50% 40%, #ffffff 0%, #fff5dc 25%, #ffd285 60%, #ff8a3d 90%, #cc4a00 100%); box-shadow: 0 0 12px 2px rgba(255, 240, 200, 1), 0 0 25px 4px rgba(255, 220, 150, 0.85), 0 0 50px 8px rgba(255, 180, 80, 0.6), 0 0 90px 14px rgba(255, 140, 40, 0.45), 0 0 140px 20px rgba(255, 120, 30, 0.25); }
}

@keyframes ce-lens-flicker {
	0%   { background: radial-gradient(ellipse at center, #161616 0%, #050505 70%); border-color: #2c2c2c; }
	5%   { background: radial-gradient(ellipse at center, #ffd285 0%, #5a2400 60%, #050505 100%); border-color: #4a3a20; }
	7%   { background: radial-gradient(ellipse at center, #161616 0%, #050505 70%); border-color: #2c2c2c; }
	14%  { background: radial-gradient(ellipse at center, #ffeac0 0%, #ffd285 30%, #5a2400 80%); border-color: #4a3a20; }
	16%  { background: radial-gradient(ellipse at center, #161616 0%, #050505 70%); border-color: #2c2c2c; }
	24%  { background: radial-gradient(ellipse at center, #ffd285 0%, #5a2400 60%); border-color: #4a3a20; }
	33%  { background: radial-gradient(ellipse at center, #161616 0%, #050505 70%); border-color: #2c2c2c; }
	42%  { background: radial-gradient(ellipse at center, #fff5dc 0%, #ffd285 35%, #5a2400 80%); border-color: #4a3a20; }
	50%  { background: radial-gradient(ellipse at center, #fff5dc 0%, #ffd285 30%, #5a2400 75%, #050505 100%); border-color: #4a3a20; }
	53%  { background: radial-gradient(ellipse at center, #2a2a2a 0%, #0a0a0a 60%); border-color: #2c2c2c; }
	62%  { background: radial-gradient(ellipse at center, #161616 0%, #050505 70%); border-color: #2c2c2c; }
	66%  { background: radial-gradient(ellipse at center, #fff5dc 0%, #ffd285 30%, #5a2400 75%); border-color: #4a3a20; }
	78%  { background: radial-gradient(ellipse at center, #fff5dc 0%, #ffd285 30%, #5a2400 75%, #050505 100%); border-color: #4a3a20; }
	100% { background: radial-gradient(ellipse at center, #fff5dc 0%, #ffd285 30%, #5a2400 75%, #050505 100%); border-color: #4a3a20; }
}

/* Cone flicker: toggle between --ce-cone-off and --ce-cone-on (JS keeps them updated on resize) */
@keyframes ce-cone-flicker {
	0%   { clip-path: var(--ce-cone-off); background: linear-gradient(220deg, transparent 0%, transparent 100%); }
	5%   { clip-path: var(--ce-cone-on); background: linear-gradient(220deg, rgba(255, 245, 200, 0.3) 0%, rgba(255, 210, 140, 0.15) 40%, transparent 80%); }
	7%   { clip-path: var(--ce-cone-off); background: linear-gradient(220deg, transparent 0%, transparent 100%); }
	14%  { clip-path: var(--ce-cone-on); background: linear-gradient(220deg, rgba(255, 248, 210, 0.48) 0%, rgba(255, 225, 155, 0.28) 35%, transparent 75%); }
	16%  { clip-path: var(--ce-cone-off); background: linear-gradient(220deg, transparent 0%, transparent 100%); }
	24%  { clip-path: var(--ce-cone-on); background: linear-gradient(220deg, rgba(255, 245, 200, 0.3) 0%, rgba(255, 210, 140, 0.15) 40%, transparent 80%); }
	33%  { clip-path: var(--ce-cone-off); background: linear-gradient(220deg, transparent 0%, transparent 100%); }
	42%  { clip-path: var(--ce-cone-on); background: linear-gradient(220deg, rgba(255, 248, 210, 0.62) 0%, rgba(255, 228, 160, 0.4) 25%, rgba(255, 200, 120, 0.2) 55%, transparent 85%); }
	50%  { clip-path: var(--ce-cone-on); background: linear-gradient(220deg, rgba(255, 248, 210, 0.72) 0%, rgba(255, 232, 165, 0.48) 20%, rgba(255, 210, 130, 0.28) 45%, rgba(255, 185, 100, 0.12) 70%, transparent 95%); }
	53%  { clip-path: var(--ce-cone-on); background: linear-gradient(220deg, rgba(255, 240, 190, 0.14) 0%, transparent 60%); }
	62%  { clip-path: var(--ce-cone-off); background: linear-gradient(220deg, transparent 0%, transparent 100%); }
	66%  { clip-path: var(--ce-cone-on); background: linear-gradient(220deg, rgba(255, 248, 210, 0.68) 0%, rgba(255, 230, 162, 0.44) 22%, rgba(255, 208, 128, 0.26) 48%, transparent 82%); }
	78%  { clip-path: var(--ce-cone-on); background: linear-gradient(220deg, rgba(255, 248, 210, 0.74) 0%, rgba(255, 232, 165, 0.5) 20%, rgba(255, 210, 130, 0.3) 45%, rgba(255, 185, 100, 0.14) 70%, transparent 95%); }
	100% { clip-path: var(--ce-cone-on); background: linear-gradient(220deg, rgba(255, 248, 210, 0.75) 0%, rgba(255, 232, 165, 0.5) 20%, rgba(255, 210, 130, 0.3) 45%, rgba(255, 185, 100, 0.14) 70%, transparent 100%); }
}

/* Off state (when scrolled out of view) */
.ce-synopsis-section[data-ce-anim="spotlight"]:not(.is-flickering):not(.is-lit) .ce-spotlight-bulb {
	background: radial-gradient(ellipse at 50% 40%, #2c2c2c 0%, #0a0a0a 80%);
	box-shadow: none;
	transition: background 0.7s ease-out, box-shadow 0.7s ease-out;
}
.ce-synopsis-section[data-ce-anim="spotlight"]:not(.is-flickering):not(.is-lit) .ce-spotlight-lens {
	background: radial-gradient(ellipse at center, #161616 0%, #050505 70%);
	border-color: #2c2c2c;
	transition: background 0.7s ease-out, border-color 0.7s ease-out;
}
.ce-synopsis-section[data-ce-anim="spotlight"]:not(.is-flickering):not(.is-lit) .ce-spotlight-cone {
	clip-path: var(--ce-cone-off);
	background: transparent;
	transition: background 0.7s ease-out;
}

/* ============================================
   GLITCH/HACKING ANIMATION
   ============================================ */

/* Wrap synopsis content for glitch effects */
.ce-synopsis-section[data-ce-anim="glitch"] .ce-glitch-content {
	position: relative;
	z-index: 2;
}

/* Active glitch wrapping */
.ce-synopsis-section[data-ce-anim="glitch"].is-glitching .ce-glitch-content {
	animation: ce-content-shake 0.3s steps(2, end) infinite;
}

@keyframes ce-content-shake {
	0%   { transform: translate(0, 0); }
	20%  { transform: translate(-2px, 1px); }
	40%  { transform: translate(2px, -1px); }
	60%  { transform: translate(-1px, 2px); }
	80%  { transform: translate(1px, -2px); }
	100% { transform: translate(0, 0); }
}

/* RGB chromatic aberration on h2/text via clones */
.ce-synopsis-section[data-ce-anim="glitch"] .ce-glitch-clone {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	opacity: 0;
	z-index: 3;
	mix-blend-mode: screen;
}

.ce-synopsis-section[data-ce-anim="glitch"].is-glitching .ce-glitch-clone-red {
	opacity: 1;
	color: rgba(255, 50, 50, 0.85) !important;
	animation: ce-rgb-shift-red 0.4s steps(3, end) infinite;
	clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.ce-synopsis-section[data-ce-anim="glitch"].is-glitching .ce-glitch-clone-cyan {
	opacity: 1;
	color: rgba(0, 220, 255, 0.85) !important;
	animation: ce-rgb-shift-cyan 0.45s steps(3, end) infinite;
	clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.ce-synopsis-section[data-ce-anim="glitch"] .ce-glitch-clone * {
	color: inherit !important;
	background: transparent !important;
}

@keyframes ce-rgb-shift-red {
	0%   { transform: translate(-3px, 0); }
	33%  { transform: translate(-5px, 1px); }
	66%  { transform: translate(-2px, -1px); }
	100% { transform: translate(-4px, 0); }
}

@keyframes ce-rgb-shift-cyan {
	0%   { transform: translate(3px, 0); }
	33%  { transform: translate(5px, -1px); }
	66%  { transform: translate(2px, 1px); }
	100% { transform: translate(4px, 0); }
}

/* Horizontal slice glitch overlay */
.ce-synopsis-section[data-ce-anim="glitch"] .ce-glitch-slice {
	position: absolute;
	inset: 0;
	z-index: 8;
	pointer-events: none;
	opacity: 0;
	background: inherit;
	overflow: hidden;
}

.ce-synopsis-section[data-ce-anim="glitch"].is-glitching .ce-glitch-slice {
	opacity: 1;
}

.ce-synopsis-section[data-ce-anim="glitch"] .ce-glitch-slice::before,
.ce-synopsis-section[data-ce-anim="glitch"] .ce-glitch-slice::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	height: 12px;
	background: rgba(200, 200, 200, 0.08);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.ce-synopsis-section[data-ce-anim="glitch"].is-glitching .ce-glitch-slice::before {
	animation: ce-slice-1 0.6s steps(8, end) infinite;
}

.ce-synopsis-section[data-ce-anim="glitch"].is-glitching .ce-glitch-slice::after {
	animation: ce-slice-2 0.45s steps(7, end) infinite;
}

@keyframes ce-slice-1 {
	0%   { top: 10%; transform: translateX(0); height: 8px; }
	20%  { top: 35%; transform: translateX(-12px); height: 22px; }
	40%  { top: 60%; transform: translateX(8px); height: 4px; }
	60%  { top: 22%; transform: translateX(-6px); height: 30px; }
	80%  { top: 75%; transform: translateX(15px); height: 10px; }
	100% { top: 45%; transform: translateX(-3px); height: 16px; }
}

@keyframes ce-slice-2 {
	0%   { top: 80%; transform: translateX(0); height: 6px; }
	25%  { top: 15%; transform: translateX(10px); height: 28px; }
	50%  { top: 55%; transform: translateX(-14px); height: 12px; }
	75%  { top: 30%; transform: translateX(7px); height: 4px; }
	100% { top: 65%; transform: translateX(-9px); height: 20px; }
}

/* Scanlines + noise overlay */
.ce-synopsis-section[data-ce-anim="glitch"] .ce-glitch-scanlines {
	position: absolute;
	inset: 0;
	z-index: 9;
	pointer-events: none;
	opacity: 0;
	background:
		repeating-linear-gradient(
			0deg,
			rgba(0, 0, 0, 0) 0px,
			rgba(0, 0, 0, 0) 2px,
			rgba(255, 255, 255, 0.04) 3px,
			rgba(0, 0, 0, 0) 4px
		);
	transition: opacity 0.3s ease-out;
}

.ce-synopsis-section[data-ce-anim="glitch"].is-glitching .ce-glitch-scanlines {
	opacity: 1;
	animation: ce-scanline-move 8s linear infinite;
}

@keyframes ce-scanline-move {
	0%   { background-position: 0 0; }
	100% { background-position: 0 100px; }
}

/* Static noise (TV-style) */
.ce-synopsis-section[data-ce-anim="glitch"] .ce-glitch-noise {
	position: absolute;
	inset: -10%;
	z-index: 7;
	pointer-events: none;
	opacity: 0;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.65'/%3E%3C/svg%3E");
	mix-blend-mode: overlay;
	transition: opacity 0.3s ease-out;
}

.ce-synopsis-section[data-ce-anim="glitch"].is-glitching .ce-glitch-noise {
	opacity: 0.45;
	animation: ce-noise-shift 0.18s steps(4, end) infinite;
}

@keyframes ce-noise-shift {
	0%   { transform: translate(0, 0); }
	25%  { transform: translate(-8%, -6%); }
	50%  { transform: translate(7%, 5%); }
	75%  { transform: translate(-5%, 7%); }
	100% { transform: translate(6%, -4%); }
}

/* Subtle entry/exit glitch burst — strong before settling */
.ce-synopsis-section[data-ce-anim="glitch"].is-bursting .ce-glitch-content {
	animation: ce-burst-shake 0.08s steps(2, end) 8;
}

@keyframes ce-burst-shake {
	0%   { transform: translate(0, 0); }
	25%  { transform: translate(-8px, 3px); filter: blur(0.5px); }
	50%  { transform: translate(6px, -4px); filter: blur(0); }
	75%  { transform: translate(-3px, 5px); filter: blur(0.3px); }
	100% { transform: translate(0, 0); filter: blur(0); }
}

/* ============================================
   CURTAINS ANIMATION
   ============================================ */

.ce-synopsis-section[data-ce-anim="curtains"] {
	/* Ensure content is above the background but below curtains if needed */
}

/* Center content and add padding to avoid overlapping with curtains */
.ce-synopsis-section[data-ce-anim="curtains"] .ce-glitch-content {
	text-align: center;
	padding-left: 20%;
	padding-right: 20%;
	margin-left: auto;
	margin-right: auto;
}
.ce-synopsis-section[data-ce-anim="curtains"] .ce-synopsis-title-wrapper {
	justify-content: center;
}
.ce-synopsis-section[data-ce-anim="curtains"] .ce-synopsis-text {
	text-align: center;
}
@media (max-width: 768px) {
	.ce-synopsis-section[data-ce-anim="curtains"] .ce-glitch-content {
		padding-left: 12%;
		padding-right: 12%;
	}
}

/* Base curtain style */
.ce-synopsis-section[data-ce-anim="curtains"] .ce-curtain {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 50.5%; /* Slight overlap to prevent gap in the middle */
	z-index: 20;
	pointer-events: none;
	display: flex;
	flex-direction: column;
	transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.ce-synopsis-section[data-ce-anim="curtains"] .ce-curtain-left {
	left: 0;
}

.ce-synopsis-section[data-ce-anim="curtains"] .ce-curtain-right {
	right: 0;
}

.ce-synopsis-section[data-ce-anim="curtains"] .ce-curtain-top {
	position: relative;
	width: 100%;
	height: 50%;
	overflow: hidden;
	transition: -webkit-clip-path 1.5s cubic-bezier(0.25, 1, 0.5, 1), clip-path 1.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.ce-synopsis-section[data-ce-anim="curtains"] .ce-curtain-left .ce-curtain-top {
	-webkit-clip-path: ellipse(150% 150% at 35% 0%);
	clip-path: ellipse(150% 150% at 35% 0%);
}

.ce-synopsis-section[data-ce-anim="curtains"] .ce-curtain-right .ce-curtain-top {
	-webkit-clip-path: ellipse(150% 150% at 65% 0%);
	clip-path: ellipse(150% 150% at 65% 0%);
}

.ce-synopsis-section[data-ce-anim="curtains"] .ce-curtain-bottom {
	position: relative;
	width: 100%;
	height: 50%;
	overflow: hidden;
	transition: -webkit-clip-path 1.5s cubic-bezier(0.25, 1, 0.5, 1), clip-path 1.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.ce-synopsis-section[data-ce-anim="curtains"] .ce-curtain-left .ce-curtain-bottom {
	-webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 30%, 100% 60%, 100% 85%, 100% 100%, 0% 100%);
	clip-path: polygon(0% 0%, 100% 0%, 100% 30%, 100% 60%, 100% 85%, 100% 100%, 0% 100%);
}

.ce-synopsis-section[data-ce-anim="curtains"] .ce-curtain-right .ce-curtain-bottom {
	-webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 85%, 0% 60%, 0% 30%);
	clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 85%, 0% 60%, 0% 30%);
}

/* Folds */
.ce-synopsis-section[data-ce-anim="curtains"] .ce-curtain-folds {
	position: absolute;
	top: -20%;
	left: -20%;
	right: -20%;
	bottom: -20%;
	box-shadow: inset 0 -50px 100px -20px rgba(0,0,0,0.9);
	transition: transform 1.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.ce-synopsis-section[data-ce-anim="curtains"] .ce-curtain-left .ce-curtain-top .ce-curtain-folds {
	background: repeating-radial-gradient(ellipse at 0% 0%, #3e0000 0%, #8b0000 1.5%, #d11111 3%, #8b0000 4.5%, #3e0000 6%);
	transform-origin: top left;
}
.ce-synopsis-section[data-ce-anim="curtains"] .ce-curtain-right .ce-curtain-top .ce-curtain-folds {
	background: repeating-radial-gradient(ellipse at 100% 0%, #3e0000 0%, #8b0000 1.5%, #d11111 3%, #8b0000 4.5%, #3e0000 6%);
	transform-origin: top right;
}
.ce-synopsis-section[data-ce-anim="curtains"] .ce-curtain-left .ce-curtain-bottom .ce-curtain-folds {
	/* Vertical lines that slightly curve towards the tieback */
	background: repeating-radial-gradient(ellipse 50% 150% at 100% 0%, #3e0000 0%, #8b0000 2%, #d11111 4%, #8b0000 6%, #3e0000 8%);
	transform-origin: bottom left;
}
.ce-synopsis-section[data-ce-anim="curtains"] .ce-curtain-right .ce-curtain-bottom .ce-curtain-folds {
	/* Vertical lines that slightly curve towards the tieback */
	background: repeating-radial-gradient(ellipse 50% 150% at 0% 0%, #3e0000 0%, #8b0000 2%, #d11111 4%, #8b0000 6%, #3e0000 8%);
	transform-origin: bottom right;
}

/* Open State */
.ce-synopsis-section[data-ce-anim="curtains"].is-open .ce-curtain {
	width: 26%;
}

/* Left Top */
.ce-synopsis-section[data-ce-anim="curtains"].is-open .ce-curtain-left .ce-curtain-top {
	-webkit-clip-path: ellipse(60% 100% at 15% 2%);
	clip-path: ellipse(60% 100% at 15% 2%);
}
.ce-synopsis-section[data-ce-anim="curtains"].is-open .ce-curtain-left .ce-curtain-top .ce-curtain-folds {
	transform: skewX(-15deg);
}

/* Right Top */
.ce-synopsis-section[data-ce-anim="curtains"].is-open .ce-curtain-right .ce-curtain-top {
	-webkit-clip-path: ellipse(60% 100% at 85% 2%);
	clip-path: ellipse(60% 100% at 85% 2%);
}
.ce-synopsis-section[data-ce-anim="curtains"].is-open .ce-curtain-right .ce-curtain-top .ce-curtain-folds {
	transform: skewX(15deg);
}

/* Left Bottom */
.ce-synopsis-section[data-ce-anim="curtains"].is-open .ce-curtain-left .ce-curtain-bottom {
	-webkit-clip-path: polygon(0% 0%, 35% 0%, 38% 30%, 42% 60%, 48% 85%, 55% 100%, 0% 100%);
	clip-path: polygon(0% 0%, 35% 0%, 38% 30%, 42% 60%, 48% 85%, 55% 100%, 0% 100%);
}
.ce-synopsis-section[data-ce-anim="curtains"].is-open .ce-curtain-left .ce-curtain-bottom .ce-curtain-folds {
	transform: skewX(8deg);
}

/* Right Bottom */
.ce-synopsis-section[data-ce-anim="curtains"].is-open .ce-curtain-right .ce-curtain-bottom {
	-webkit-clip-path: polygon(65% 0%, 100% 0%, 100% 100%, 45% 100%, 52% 85%, 58% 60%, 62% 30%);
	clip-path: polygon(65% 0%, 100% 0%, 100% 100%, 45% 100%, 52% 85%, 58% 60%, 62% 30%);
}
.ce-synopsis-section[data-ce-anim="curtains"].is-open .ce-curtain-right .ce-curtain-bottom .ce-curtain-folds {
	transform: skewX(-8deg);
}

/* Tiebacks (Ropes) */
.ce-synopsis-section[data-ce-anim="curtains"] .ce-curtain-tie {
	position: absolute;
	top: 50%;
	width: 10%;
	height: 4%;
	background: linear-gradient(to bottom, #f9d976 0%, #e9c176 50%, #a67c00 100%);
	box-shadow: 0 5px 15px rgba(0,0,0,0.5);
	opacity: 0;
	transition: opacity 0.3s ease, left 1.5s cubic-bezier(0.25, 1, 0.5, 1), right 1.5s cubic-bezier(0.25, 1, 0.5, 1), width 1.5s cubic-bezier(0.25, 1, 0.5, 1);
	z-index: 25;
}

.ce-synopsis-section[data-ce-anim="curtains"] .ce-curtain-left .ce-curtain-tie {
	left: -2%;
	border-radius: 0 0 40% 50%;
	transform: translateY(-50%) rotate(-8deg);
	border-bottom: 4px solid #8a6300;
	border-right: 2px solid #8a6300;
}

.ce-synopsis-section[data-ce-anim="curtains"] .ce-curtain-right .ce-curtain-tie {
	right: -2%;
	border-radius: 0 0 50% 40%;
	transform: translateY(-50%) rotate(8deg);
	border-bottom: 4px solid #8a6300;
	border-left: 2px solid #8a6300;
}

.ce-synopsis-section[data-ce-anim="curtains"].is-open .ce-curtain-left .ce-curtain-tie {
	left: -2%;
	width: 42%;
	opacity: 1;
	transition: opacity 0.5s ease 0.8s, left 1.5s cubic-bezier(0.25, 1, 0.5, 1), width 1.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.ce-synopsis-section[data-ce-anim="curtains"].is-open .ce-curtain-right .ce-curtain-tie {
	right: -2%;
	width: 42%;
	opacity: 1;
	transition: opacity 0.5s ease 0.8s, right 1.5s cubic-bezier(0.25, 1, 0.5, 1), width 1.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Tassels */
.ce-synopsis-section[data-ce-anim="curtains"] .ce-curtain-tie::after {
	content: "";
	position: absolute;
	top: 100%;
	width: 20px;
	height: 40px;
	background: repeating-linear-gradient(to right, transparent, transparent 2px, rgba(0,0,0,0.2) 3px), linear-gradient(to right, #e9c176 0%, #f9d976 50%, #a67c00 100%);
	border-radius: 50% 50% 20% 20%;
	box-shadow: 2px 5px 10px rgba(0,0,0,0.5);
}

.ce-synopsis-section[data-ce-anim="curtains"] .ce-curtain-left .ce-curtain-tie::after {
	right: 10%;
}

.ce-synopsis-section[data-ce-anim="curtains"] .ce-curtain-right .ce-curtain-tie::after {
	left: 10%;
}
