/* MZ Portfolio — Featured Preview
   Interactive "live browser" featured image with per-project background.
   Vanilla, scoped under .mz-preview. */

.mz-preview {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 10;
	border-radius: 16px;
	overflow: hidden;
	perspective: 1400px;
	background: #11151b;
	-webkit-tap-highlight-color: transparent;
}

.mz-pv-stage {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

/* background layers (image mode) */
.mz-pv-bg {
	position: absolute;
	inset: -8%;
	background-size: cover;
	background-position: center;
	transform: scale(1.12);
	z-index: 0;
}
.mz-pv-overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
}

/* shared frame */
.mz-pv-frame {
	position: relative;
	z-index: 2;
	transform-style: preserve-3d;
	transition: transform 0.18s cubic-bezier(0.22, 0.61, 0.36, 1);
	will-change: transform;
}

/* browser window */
.mz-pv-window {
	width: 80%;
	height: 82%;
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow:
		0 2px 5px rgba(0, 0, 0, 0.10),
		0 26px 60px -16px rgba(0, 0, 0, 0.55),
		0 10px 24px -10px rgba(0, 0, 0, 0.40);
}

.mz-pv-bar {
	height: 38px;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 14px;
	background: linear-gradient(#fbfbfc, #f0f0f3);
	border-bottom: 1px solid #e6e6ea;
	position: relative;
	z-index: 3;
}
.mz-pv-lights { display: flex; gap: 7px; }
.mz-pv-lights i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.mz-pv-lights i:nth-child(1) { background: #ff5f57; }
.mz-pv-lights i:nth-child(2) { background: #febc2e; }
.mz-pv-lights i:nth-child(3) { background: #28c840; }

.mz-pv-url {
	flex: 1;
	max-width: 70%;
	margin: 0 auto;
	height: 24px;
	border-radius: 7px;
	background: #ececef;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font: 500 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #5f636b;
	overflow: hidden;
	white-space: nowrap;
}
.mz-pv-url svg { width: 11px; height: 11px; opacity: 0.6; flex: none; }

.mz-pv-live {
	display: flex;
	align-items: center;
	gap: 5px;
	font: 600 10px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	letter-spacing: 0.08em;
	color: #8a8f97;
}
.mz-pv-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--mz-accent, #28c840);
	box-shadow: 0 0 0 0 var(--mz-accent, #28c840);
	animation: mz-pulse 1.9s infinite;
}
@keyframes mz-pulse {
	0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--mz-accent, #28c840) 45%, transparent); }
	70%  { box-shadow: 0 0 0 7px transparent; }
	100% { box-shadow: 0 0 0 0 transparent; }
}

.mz-pv-viewport {
	position: absolute;
	top: 38px;
	left: 0;
	right: 0;
	bottom: 0;
	overflow-y: auto;
	overflow-x: hidden;
	cursor: grab;
	scrollbar-width: thin;
	scrollbar-color: #c9c5be transparent;
}
.mz-pv-viewport.mz-grabbing { cursor: grabbing; }
.mz-pv-viewport::-webkit-scrollbar { width: 6px; }
.mz-pv-viewport::-webkit-scrollbar-thumb { background: #cdc9c2; border-radius: 8px; }
.mz-pv-viewport::-webkit-scrollbar-track { background: transparent; }
.mz-pv-shot { display: block; width: 100%; user-select: none; -webkit-user-drag: none; }

.mz-pv-hint {
	position: absolute;
	bottom: 12px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(18, 20, 24, 0.82);
	color: #fff;
	font: 500 11px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	padding: 6px 11px;
	border-radius: 20px;
	opacity: 0;
	transition: opacity 0.25s;
	pointer-events: none;
	z-index: 4;
	white-space: nowrap;
}
.mz-preview:hover .mz-pv-hint { opacity: 1; }

/* static image mode */
.mz-pv-frame-img { width: 82%; height: 84%; }
.mz-pv-static {
	width: 100%;
	height: 100%;
	border-radius: 12px;
	background-size: cover;
	background-position: top center;
	box-shadow: 0 26px 60px -18px rgba(0, 0, 0, 0.55);
}

@media (max-width: 600px) {
	.mz-pv-window { width: 90%; height: 86%; }
	.mz-pv-frame-img { width: 90%; height: 88%; }
}

@media (prefers-reduced-motion: reduce) {
	.mz-pv-dot { animation: none; }
	.mz-pv-frame { transition: none; }
}
