/* Portfolio Video block */
.pvg-v {
	--pvg-v-radius: 12px;
	--pvg-v-accent: #fff;
	--pvg-v-scale: 1.03;
	position: relative;
	margin: 0;
	border-radius: var(--pvg-v-radius);
	transition: transform .4s cubic-bezier(.2, .7, .2, 1);
}

.pvg-v-frame {
	position: relative;
	overflow: hidden;
	border-radius: inherit;
	box-shadow: var(--pvg-v-shadow, none);
	isolation: isolate;
	line-height: 0;
}

.pvg-v-video {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	margin: 0;
	border-radius: inherit;
	transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}

/* Fixed shape: crop (cover) or letterbox (contain). */
.pvg-v--ratio .pvg-v-frame { aspect-ratio: var(--pvg-v-ratio); }
.pvg-v--ratio .pvg-v-video { position: absolute; inset: 0; height: 100%; object-fit: cover; }
.pvg-v--ratio.pvg-v--contain .pvg-v-video { object-fit: contain; background: #000; }

/* Download protection: no long-press menu or dragging. */
.pvg-v--protect .pvg-v-video {
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	user-select: none;
	-webkit-user-drag: none;
}

/* Hover animations (computers only). */
@media (hover: hover) and (pointer: fine) {
	.pvg-v-fx-lift:hover { transform: translateY(-6px); }
	.pvg-v-fx-zoom:hover { transform: scale(var(--pvg-v-scale)); }
	.pvg-v-fx-zoom-inside:hover .pvg-v-video { transform: scale(var(--pvg-v-scale)); }
}

/* ------------------------------------------------------------ Custom controls */
.pvg-v-ui {
	position: absolute;
	inset: 0;
	z-index: 2;
	line-height: 1;
	color: var(--pvg-v-accent);
	font: 500 12px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
	-webkit-tap-highlight-color: transparent;
}

.pvg-v-ui button {
	appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.pvg-v-ui button:focus { outline: none; }
.pvg-v-ui button:focus-visible,
.pvg-v-progress:focus-visible { outline: 2px solid var(--pvg-v-accent); outline-offset: 2px; border-radius: 6px; }

.pvg-i { display: block; }

/* Big centre play button (frosted glass) */
.pvg-v-big {
	position: absolute;
	top: 50%;
	left: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	border-radius: 50% !important;
	background: rgba(20, 20, 20, .28) !important;
	-webkit-backdrop-filter: blur(14px) saturate(140%);
	backdrop-filter: blur(14px) saturate(140%);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 8px 30px rgba(0, 0, 0, .18);
	transform: translate(-50%, -50%);
	transition: transform .35s cubic-bezier(.2, .7, .2, 1.4), opacity .3s ease;
}

.pvg-v-big .pvg-i { width: 28px; height: 28px; margin-left: 3px; }
.pvg-v-big:hover { transform: translate(-50%, -50%) scale(1.08); }

.pvg-v.is-playing .pvg-v-big,
.pvg-v.is-started .pvg-v-big {
	opacity: 0;
	transform: translate(-50%, -50%) scale(.85);
	pointer-events: none;
}

/* Bottom bar */
.pvg-v-bar {
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 12px;
	display: flex;
	align-items: center;
	gap: 10px;
	height: 40px;
	padding: 0 10px;
	box-sizing: border-box;
	border-radius: 14px;
	background: rgba(20, 20, 20, .32);
	-webkit-backdrop-filter: blur(14px) saturate(140%);
	backdrop-filter: blur(14px) saturate(140%);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
	opacity: 0;
	transform: translateY(6px);
	transition: opacity .3s ease, transform .3s ease;
}

.pvg-v.is-started .pvg-v-bar { opacity: 1; transform: none; }
.pvg-v.is-started.is-idle .pvg-v-bar { opacity: 0; transform: translateY(6px); }
.pvg-v.is-idle.is-playing .pvg-v-ui { cursor: none; }

.pvg-v-btn {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 8px !important;
	opacity: .9;
	transition: opacity .15s, background-color .15s;
}

.pvg-v-btn:hover { opacity: 1; background: rgba(255, 255, 255, .12) !important; }

.pvg-v-play .pvg-i-pause,
.pvg-v.is-playing .pvg-v-play .pvg-i-play,
.pvg-v-mute .pvg-i-muted,
.pvg-v.is-muted .pvg-v-mute .pvg-i-sound,
.pvg-v-fs .pvg-i-shrink,
.pvg-v.is-fullscreen .pvg-v-fs .pvg-i-expand { display: none; }

.pvg-v.is-playing .pvg-v-play .pvg-i-pause,
.pvg-v.is-muted .pvg-v-mute .pvg-i-muted,
.pvg-v.is-fullscreen .pvg-v-fs .pvg-i-shrink { display: block; }

.pvg-v-time {
	flex: none;
	min-width: 76px;
	text-align: center;
	font-variant-numeric: tabular-nums;
	opacity: .85;
}

/* Progress: thin line that thickens on hover */
.pvg-v-progress {
	position: relative;
	flex: 1;
	height: 24px;
	display: flex;
	align-items: center;
	cursor: pointer;
	touch-action: none;
}

.pvg-v-track {
	position: relative;
	width: 100%;
	height: 3px;
	border-radius: 3px;
	background: rgba(255, 255, 255, .25);
	overflow: hidden;
	transition: height .15s ease;
}

.pvg-v-buffer,
.pvg-v-fill {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 0;
}

.pvg-v-buffer { background: rgba(255, 255, 255, .3); }
.pvg-v-fill { background: var(--pvg-v-accent); }

.pvg-v-knob {
	position: absolute;
	top: 50%;
	left: 0;
	width: 12px;
	height: 12px;
	margin: -6px 0 0 -6px;
	border-radius: 50%;
	background: var(--pvg-v-accent);
	box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
	transform: scale(0);
	transition: transform .15s ease;
}

.pvg-v-progress:hover .pvg-v-track,
.pvg-v.is-seeking .pvg-v-track { height: 5px; }
.pvg-v-progress:hover .pvg-v-knob,
.pvg-v.is-seeking .pvg-v-knob { transform: scale(1); }

.pvg-v-tip {
	position: absolute;
	bottom: 26px;
	left: 0;
	padding: 4px 6px;
	border-radius: 6px;
	background: rgba(20, 20, 20, .7);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	transform: translateX(-50%);
	opacity: 0;
	pointer-events: none;
	transition: opacity .15s;
}

.pvg-v-progress:hover .pvg-v-tip { opacity: 1; }

/* Small screens: a little more compact */
@media (max-width: 480px) {
	.pvg-v-bar { left: 8px; right: 8px; bottom: 8px; gap: 6px; padding: 0 6px; }
	.pvg-v-time { min-width: 0; }
	.pvg-v-big { width: 60px; height: 60px; }
}

/* Full screen keeps the rounded look off and fills the screen */
.pvg-v.is-fullscreen,
.pvg-v.is-fullscreen .pvg-v-frame { border-radius: 0; width: 100%; height: 100%; }
.pvg-v.is-fullscreen .pvg-v-frame { aspect-ratio: auto; background: #000; }
.pvg-v.is-fullscreen .pvg-v-video { position: absolute; inset: 0; height: 100%; object-fit: contain; }

@media (prefers-reduced-motion: reduce) {
	.pvg-v,
	.pvg-v-video,
	.pvg-v-big,
	.pvg-v-bar { transition: none; }
}

/* ------------------------------------------------------------ Chapters */
.pvg-v-mark {
	position: absolute;
	top: 50%;
	width: 3px;
	height: 9px;
	margin: -4.5px 0 0 -1.5px;
	border-radius: 2px;
	background: var(--pvg-v-accent);
	opacity: .75;
	pointer-events: none;
}

.pvg-v-chapter {
	flex: 0 1 auto;
	min-width: 0;
	max-width: 30%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	opacity: .85;
}

.pvg-v-chapters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
	line-height: 1.2;
}

.pvg-v-chapters li { margin: 0; }

.pvg-v-chapters button {
	display: inline-flex;
	gap: 8px;
	align-items: baseline;
	padding: 8px 12px;
	border: 1px solid rgba(0, 0, 0, .12);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: .9em;
	cursor: pointer;
	transition: background-color .15s, border-color .15s;
}

.pvg-v-chapters button:hover { background: rgba(0, 0, 0, .05); }
.pvg-v-chapters button.is-current { border-color: currentColor; }
.pvg-v-ct { font-variant-numeric: tabular-nums; opacity: .6; }

/* ------------------------------------------------------- Playback speed */
.pvg-v-speedwrap { position: relative; flex: none; }
.pvg-v-speed { width: auto; min-width: 34px; padding: 0 6px !important; font-variant-numeric: tabular-nums; font-weight: 600 !important; }

.pvg-v-speedmenu {
	position: absolute;
	right: -6px;
	bottom: 38px;
	display: flex;
	flex-direction: column;
	min-width: 72px;
	padding: 6px;
	border-radius: 12px;
	background: rgba(20, 20, 20, .55);
	-webkit-backdrop-filter: blur(14px) saturate(140%);
	backdrop-filter: blur(14px) saturate(140%);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}

.pvg-v-speedmenu[hidden] { display: none; }

.pvg-v-speedmenu button {
	padding: 7px 10px !important;
	border-radius: 8px !important;
	text-align: left;
	font-variant-numeric: tabular-nums;
	opacity: .85;
}

.pvg-v-speedmenu button:hover { background: rgba(255, 255, 255, .12) !important; opacity: 1; }
.pvg-v-speedmenu button[aria-checked="true"] { font-weight: 700 !important; opacity: 1; }

/* Frame step buttons */
.pvg-v-prev .pvg-i,
.pvg-v-next .pvg-i { width: 17px; height: 17px; }

/* ------------------------------------------------------- Before / after */
.pvg-v-compare {
	--pvg-v-pos: 50%;
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
}

.pvg-v-before {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	clip-path: inset(0 calc(100% - var(--pvg-v-pos)) 0 0);
}

.pvg-v--contain .pvg-v-before { object-fit: contain; }

.pvg-v-label {
	position: absolute;
	top: 12px;
	padding: 5px 10px;
	border-radius: 999px;
	background: rgba(20, 20, 20, .35);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	color: #fff;
	font: 500 12px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
	letter-spacing: .02em;
	transition: opacity .2s;
}

.pvg-v-label-before { left: 12px; }
.pvg-v-label-after { right: 12px; }

.pvg-v-handle {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--pvg-v-pos);
	width: 44px;
	margin-left: -22px;
	cursor: ew-resize;
	pointer-events: auto;
	touch-action: none;
	outline: none;
}

.pvg-v-handle::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 2px;
	margin-left: -1px;
	background: #fff;
	box-shadow: 0 0 6px rgba(0, 0, 0, .35);
}

.pvg-v-grip {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .9);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
	transform: translate(-50%, -50%);
	transition: transform .2s cubic-bezier(.2, .7, .2, 1.4);
}

.pvg-v-grip::before,
.pvg-v-grip::after {
	content: "";
	position: absolute;
	top: 50%;
	border: 6px solid transparent;
	margin-top: -6px;
}

.pvg-v-grip::before { left: 5px; border-right: 7px solid #222; border-left: 0; }
.pvg-v-grip::after { right: 5px; border-left: 7px solid #222; border-right: 0; }

.pvg-v-handle:hover .pvg-v-grip,
.pvg-v.is-comparing .pvg-v-grip { transform: translate(-50%, -50%) scale(1.1); }
.pvg-v-handle:focus-visible .pvg-v-grip { box-shadow: 0 0 0 3px rgba(255, 255, 255, .6), 0 4px 14px rgba(0, 0, 0, .25); }

/* The controls stay above the comparison */
.pvg-v--compare .pvg-v-big { top: auto; bottom: 64px; left: 50%; }
.pvg-v--compare .pvg-v-ui { pointer-events: none; }
.pvg-v--compare .pvg-v-ui > * { pointer-events: auto; }

/* ------------------------------------------------------- Scroll scrub */
.pvg-v--scrub .pvg-v-video { pointer-events: none; }

@media (max-width: 480px) {
	.pvg-v-chapter { display: none; }
}
