/**
 * Photo Jump - frontend styles
 * 3D scattering fullscreen photo slideshow.
 */

.pj-root {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: #0b0d12;
	color: #fff;
	font-family: inherit;
	-webkit-font-smoothing: antialiased;
	user-select: none;
}

.pj-root * {
	box-sizing: border-box;
}

/* The perspective stage that holds every slide. */
.pj-stage {
	position: absolute;
	inset: 0;
	perspective: 1400px;
	perspective-origin: 50% 50%;
	transform-style: preserve-3d;
}

/* Each photo slide. All slides are stacked; only the active one is fully shown. */
.pj-slide {
	position: absolute;
	inset: 0;
	transform-style: preserve-3d;
	will-change: transform, opacity;
	opacity: 0;
	pointer-events: none;
	backface-visibility: hidden;
}

.pj-slide.is-current {
	opacity: 1;
}

/* The actual image fill. background-image keeps cover behaviour cheap and
   lets us scale it for the mouse-parallax tilt without layout cost. */
.pj-photo {
	position: absolute;
	inset: 0;
	background-position: center center;
	background-size: cover;
	background-repeat: no-repeat;
	transform: scale(1.06);
	transition: transform 0.25s ease-out;
	will-change: transform;
}

/* Thin frame that mostly disappears at full bleed but reads as a photo
   border once a slide is scaled down mid-jump. */
.pj-slide::after {
	content: "";
	position: absolute;
	inset: 0;
	border: 2px solid rgba(255, 255, 255, 0.55);
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.pj-root.is-jumping .pj-slide::after {
	opacity: 0.9;
}

/* Per-slide dark overlay so captions stay legible and the tint rides the
   photo through the 3D tumble. */
.pj-shade {
	position: absolute;
	inset: 0;
	background: var(--pj-overlay, rgba(10, 13, 20, 0.45));
	pointer-events: none;
	z-index: 2;
}

/* ---------- Caption (one per slide, shown only while that slide is current) ---------- */
.pj-caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: clamp(64px, 12vh, 140px);
	z-index: 3;
	text-align: center;
	padding: 0 24px;
	pointer-events: none;
}

.pj-caption.pj-pos-left {
	text-align: left;
	padding-left: clamp(32px, 8vw, 120px);
}

.pj-caption.pj-pos-bottom-left {
	text-align: left;
	bottom: clamp(48px, 10vh, 90px);
	padding-left: clamp(32px, 6vw, 80px);
}

.pj-title {
	margin: 0;
	font-weight: 800;
	line-height: 1.12;
	font-size: clamp(34px, 5.2vw, 84px);
	letter-spacing: -0.01em;
	text-shadow: 0 6px 28px rgba(0, 0, 0, 0.45);
}

.pj-subtitle {
	margin: 14px 0 0;
	font-size: clamp(14px, 1.5vw, 21px);
	font-weight: 400;
	opacity: 0.86;
	text-shadow: 0 3px 16px rgba(0, 0, 0, 0.4);
}

/* Photo metadata row (ISO / shutter / focal). */
.pj-meta {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 10px 22px;
	margin-top: 20px;
	justify-content: center;
	font-size: 13px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.8;
}

.pj-caption.pj-pos-left .pj-meta,
.pj-caption.pj-pos-bottom-left .pj-meta {
	justify-content: flex-start;
}

.pj-meta span {
	display: inline-flex;
	gap: 7px;
	align-items: baseline;
}

.pj-meta b {
	font-weight: 700;
	opacity: 0.55;
	letter-spacing: 0.04em;
}

.pj-cta {
	display: inline-block;
	margin-top: 26px;
	padding: 13px 30px;
	pointer-events: auto;
	border: 1px solid rgba(255, 255, 255, 0.7);
	border-radius: 4px;
	color: #fff;
	text-decoration: none;
	font-size: 14px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	background: rgba(255, 255, 255, 0.06);
	backdrop-filter: blur(4px);
	transition: background 0.25s ease, transform 0.25s ease;
}

.pj-cta:hover {
	background: rgba(255, 255, 255, 0.18);
	transform: translateY(-2px);
}

/* Captions are hidden by default and animate in only on the current slide. */
.pj-caption > * {
	opacity: 0;
	transform: translateY(22px);
}

.pj-root.is-caption-in .pj-slide.is-current .pj-caption > * {
	opacity: 1;
	transform: translateY(0);
	transition: opacity 0.6s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pj-root.is-caption-in .pj-slide.is-current .pj-subtitle { transition-delay: 0.08s; }
.pj-root.is-caption-in .pj-slide.is-current .pj-meta { transition-delay: 0.16s; }
.pj-root.is-caption-in .pj-slide.is-current .pj-cta { transition-delay: 0.24s; }

/* ---------- Navigation chrome ---------- */
.pj-nav {
	position: absolute;
	left: 0;
	right: 0;
	bottom: clamp(18px, 3vh, 34px);
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0 20px;
}

.pj-dots {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	justify-content: center;
}

.pj-dot {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.28);
	background: transparent;
	color: rgba(255, 255, 255, 0.7);
	font-size: 11px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: all 0.25s ease;
	font-family: inherit;
}

.pj-dot:hover {
	border-color: rgba(255, 255, 255, 0.7);
	color: #fff;
}

.pj-dot.is-current {
	background: #fff;
	color: #111;
	border-color: #fff;
	transform: scale(1.08);
}

.pj-arrows {
	position: absolute;
	right: clamp(20px, 4vw, 56px);
	bottom: clamp(18px, 3vh, 34px);
	z-index: 20;
	display: flex;
	gap: 10px;
}

.pj-arrow {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.3);
	background: rgba(255, 255, 255, 0.04);
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: all 0.25s ease;
	padding: 0;
}

.pj-arrow:hover {
	background: rgba(255, 255, 255, 0.16);
	border-color: rgba(255, 255, 255, 0.8);
}

.pj-arrow svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.pj-arrow[disabled] {
	opacity: 0.35;
	cursor: default;
}

/* Thin top progress bar for autoplay. */
.pj-progress {
	position: absolute;
	top: 0;
	left: 0;
	height: 3px;
	width: 0;
	background: rgba(255, 255, 255, 0.85);
	z-index: 25;
	pointer-events: none;
}

/* Loading shimmer before JS boots. */
.pj-root:not(.is-ready) .pj-nav,
.pj-root:not(.is-ready) .pj-arrows {
	opacity: 0;
}

.pj-root:not(.is-ready) .pj-slide:first-child {
	opacity: 1;
}

/* Reduced motion: keep it usable, drop the heavy 3D tumble (handled in JS too). */
@media (prefers-reduced-motion: reduce) {
	.pj-photo {
		transition: none;
	}
}

@media (max-width: 640px) {
	.pj-dot { width: 22px; height: 22px; font-size: 10px; }
	.pj-caption { bottom: clamp(80px, 16vh, 150px); }
	.pj-arrows { bottom: auto; top: 16px; }
}
