/* ============================================================
   Stylish Animation 3 — stylish-animation-3.css
   ============================================================ */

/* ── Wrap ── */
.sa3-wrap {
	position: relative;
	width: 100%;
	min-height: 100vh;
	background: #000;
	overflow: hidden;
	font-family: 'EB Garamond', Georgia, serif;
	color: #fff;
	margin: 0;
	padding: 0;
}
.sa3-wrap.sa3-settled {
	overflow-y: auto;
	min-height: 100vh;
}

/* Force the Elementor widget wrapper itself to be truly edge-to-edge on desktop.
   Elementor wraps every widget in .elementor-widget-container which can inherit
   a max-width or padding from the column at desktop breakpoints. */
.elementor-widget-pretpot_stylish_animation_3,
.elementor-widget-pretpot_stylish_animation_3 > .elementor-widget-container {
	width: 100% !important;
	max-width: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* Desktop only: bleed the wrap 5px outside its container on all sides
   to cover any residual column gap. Content inside is unaffected —
   only the black background bleeds outward. Mobile already fills edge-to-edge
   so this only applies above 768px. */
@media (min-width: 768px) {
	.sa3-wrap {
		margin-left: -5px !important;
		margin-right: -5px !important;
		width: calc(100% + 10px) !important;
	}
}

/* ── BG grid lines ── */
.sa3-bg-grid {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 0;
}
.sa3-gl {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 1px;
	border-left: 1px dashed rgba(255, 255, 255, 0.07);
}
.sa3-glh {
	position: absolute;
	left: 0;
	right: 0;
	height: 1px;
	border-top: 1px dashed rgba(255, 255, 255, 0.07);
}

/* ── Film grain ── */
.sa3-grain {
	position: absolute;
	inset: 0;
	z-index: 50;
	pointer-events: none;
	opacity: 0.025;
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	background-size: 128px;
	/* Use background-position shift instead of transform:translate so the
	   element itself never moves — eliminates repaints that caused widget shaking */
	animation: sa3-grain 0.5s steps(1) infinite;
}
@keyframes sa3-grain {
	0%   { background-position: 0 0; }
	20%  { background-position: -2px 1px; }
	40%  { background-position: 1px -1px; }
	60%  { background-position: -1px 2px; }
	80%  { background-position: 2px -2px; }
	100% { background-position: 0 0; }
}

/* ── Flying intro panels ── */
.sa3-panel {
	position: absolute;
	overflow: hidden;
	z-index: 2;
	background: #111;
	transition-property: right, left;
	transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
	transition-duration: 1.2s;
}
.sa3-panel canvas {
	display: block;
	width: 100%;
	height: 100%;
}

.sa3-p-tr { width: 18%; height: 10%; top: 3%;    right: -22%; }
.sa3-p-mr { width: 15%; height:  9%; top: 50%; transform: translateY(-50%); right: -20%; transition-delay: 0.15s; }
.sa3-p-br { width: 16%; height:  9%; bottom: 3%; right: -22%; transition-delay: 0.3s; }
.sa3-p-tl { width: 14%; height:  8%; top: 3%;    left: -18%; transition-delay: 0.1s; }
.sa3-p-ml { width: 13%; height:  8%; top: 50%; transform: translateY(-50%); left: -18%; transition-delay: 0.25s; }
.sa3-p-bl { width: 14%; height:  8%; bottom: 3%; left: -18%; transition-delay: 0.35s; }

.sa3-panel.sa3-in-r  { right: 1%; }
.sa3-panel.sa3-out-r { right: -22%; }
.sa3-panel.sa3-in-l  { left: 1%; }
.sa3-panel.sa3-out-l { left: -18%; }

/* ── Text stage ── */
.sa3-stage {
	position: absolute;
	z-index: 5;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	text-align: center;
	white-space: nowrap;
	transition: top 1s cubic-bezier(0.4, 0, 0.2, 1),
	            transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.sa3-stage.sa3-raised {
	top: 5.5%;
	transform: translate(-50%, 0);
}

.sa3-tagline {
	display: block;
	color: rgba(255, 255, 255, 0.9);
	font-size: clamp(1rem, 2.2vw, 1.5rem);
	font-style: italic;
	line-height: 1.55;
	letter-spacing: 0.02em;
	opacity: 0;
	transition: opacity 0.8s ease;
	margin-bottom: 0.15em;
}
.sa3-tagline.sa3-visible { opacity: 1; }
.sa3-tagline.sa3-hidden  { opacity: 0; }

.sa3-name {
	display: block;
	color: #e8d9a0;
	font-size: clamp(1.6rem, 3.8vw, 3rem);
	font-weight: 400;
	letter-spacing: 0.04em;
	opacity: 0;
	transition: opacity 0.6s ease;
}
.sa3-name.sa3-visible { opacity: 1; }
.sa3-name em { font-style: italic; }

/* ── Portfolio grid section ── */
.sa3-grid-section {
	position: relative;
	z-index: 3;
	width: 100%;
	display: flex;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.8s ease;
	padding-bottom: 0;
}
.sa3-grid-section.sa3-visible { opacity: 1; }

.sa3-portfolio-grid {
	display: grid;
	gap: 5px;
	width: 100%;
}

/* Grid item */
.sa3-grid-item {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	cursor: pointer;
	background: #0a0a0a;
	opacity: 0;
	/* No transform here — scale() on grid items causes trembling when
	   nearby widgets animate and trigger browser repaints. */
	transition: opacity 0.65s ease;
	/* Promote to own compositor layer to isolate from external repaints */
	will-change: opacity;
}
.sa3-grid-item.sa3-visible {
	opacity: 1;
}
.sa3-grid-item canvas,
.sa3-grid-item img,
.sa3-grid-item video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.sa3-grid-item:hover canvas,
.sa3-grid-item:hover img,
.sa3-grid-item:hover video {
	transform: scale(1.065);
}

.sa3-item-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0);
	display: flex;
	align-items: flex-end;
	padding: 10px 12px;
	transition: background 0.3s ease;
}
.sa3-grid-item:hover .sa3-item-overlay,
.sa3-grid-item:focus .sa3-item-overlay {
	background: rgba(0, 0, 0, 0.38);
}
.sa3-item-label {
	color: rgba(255, 255, 255, 0);
	font-size: 0.7rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	transition: color 0.3s ease;
}
.sa3-grid-item:hover .sa3-item-label,
.sa3-grid-item:focus .sa3-item-label {
	color: rgba(255, 255, 255, 0.72);
}

/* ── Lightbox ── */
.sa3-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(0, 0, 0, 0);
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	transition: background 0.45s ease;
}
.sa3-lightbox.sa3-open {
	background: rgba(0, 0, 0, 0.9);
	pointer-events: auto;
}

.sa3-lb-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: min(82vw, 780px);
	opacity: 0;
	transform: translateY(20px) scale(0.97);
	transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
}
.sa3-lightbox.sa3-open .sa3-lb-inner {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.sa3-lb-media {
	position: relative;
	width: 100%;
	/* No fixed aspect-ratio — height follows the actual image/video dimensions */
	background: #111;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 120px;
}
/* The media element itself controls its own size — set by JS inline styles */
.sa3-lb-media .sa3-lb-media-el {
	display: block;
	max-width: 100%;
	max-height: 80vh;
	width: auto;
	height: auto;
	object-fit: contain;
}

.sa3-lb-close {
	position: absolute;
	top: -13px;
	right: -13px;
	width: 30px;
	height: 30px;
	background: rgba(10, 10, 10, 0.85);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: #fff;
	font-size: 18px;
	line-height: 28px;
	text-align: center;
	cursor: pointer;
	z-index: 10;
	transition: background 0.2s;
	font-family: serif;
	padding: 0;
}
.sa3-lb-close:hover,
.sa3-lb-close:focus {
	background: rgba(255, 255, 255, 0.15);
	outline: none;
}

.sa3-lb-info {
	width: 100%;
	padding: 20px 2px 0;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	margin-top: 14px;
}
.sa3-lb-title {
	font-size: clamp(1.1rem, 2vw, 1.55rem);
	color: #e8d9a0;
	letter-spacing: 0.03em;
	margin-bottom: 8px;
}
.sa3-lb-desc {
	font-size: clamp(0.82rem, 1.2vw, 1rem);
	color: rgba(255, 255, 255, 0.5);
	line-height: 1.7;
	font-style: italic;
	max-width: 560px;
}

/* ── Editor placeholder ── */
.sa3-editor-placeholder {
	min-height: 200px;
	display: flex;
	align-items: center;
	justify-content: center;
}