/*--------------------------------------------------------------
# Camera look: clapperboard intro + viewfinder frame (from gena-preview)
--------------------------------------------------------------*/
:root {
	--cam-rec: #ff3b2f;
	--cam-inset: clamp(8px, 1.6vw, 18px);   /* distance of the frame from the screen edge */
	--cam-osd-h: calc(var(--cam-inset) + 36px); /* top info strip: sits inside the frame */
	--cam-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Make room for the info strip: the whole site sits under it */
body { padding-top: var(--cam-osd-h); }
body.cam-locked { overflow: hidden; }
.header.fixed-top { top: var(--cam-osd-h); }

/* ---------- Top info strip (REC + timecode left, quality right) ---------- */
.cam-osd {
	position: fixed;
	top: 0; left: 0; right: 0;
	height: var(--cam-osd-h);
	z-index: 998;
	background: #000;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: var(--cam-inset) calc(var(--cam-inset) + 22px) 0;
	font-family: var(--cam-mono);
	font-size: clamp(11px, 1.1vw, 13px);
	letter-spacing: .04em;
	color: #fff;
	pointer-events: none;
}
.cam-osd .rec { display: flex; align-items: center; gap: 8px; }
.cam-osd .rec b {
	width: 10px; height: 10px; border-radius: 50%;
	background: var(--cam-rec);
	animation: cam-blink 1.2s steps(1) infinite;
}
/* Scene label: pinned to the exact middle of the screen, whatever the
   widths of the left and right groups are */
.cam-osd .mid {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	white-space: nowrap;
	opacity: .6;
}
.cam-osd .spec { display: flex; align-items: center; gap: 14px; }
.cam-osd .batt {
	position: relative; width: 22px; height: 11px;
	border: 1.5px solid #fff; border-radius: 2px;
}
.cam-osd .batt::before {            /* charge level */
	content: ""; position: absolute; inset: 1.5px; right: 30%;
	background: #fff;
}
.cam-osd .batt::after {             /* terminal nub */
	content: ""; position: absolute; right: -4px; top: 2.5px;
	width: 2px; height: 4px; background: #fff;
}
@keyframes cam-blink { 50% { opacity: 0; } }

/* ---------- Viewfinder corners around the whole screen ---------- */
.cam-vf {
	position: fixed;
	inset: var(--cam-inset);
	z-index: 999;
	pointer-events: none;
}
.cam-vf i {
	position: absolute;
	width: clamp(22px, 3.4vw, 44px);
	height: clamp(22px, 3.4vw, 44px);
	border: 0 solid rgba(255, 255, 255, .85);
}
.cam-vf i:nth-child(1) { top: 0;    left: 0;  border-top-width: 2px;    border-left-width: 2px; }
.cam-vf i:nth-child(2) { top: 0;    right: 0; border-top-width: 2px;    border-right-width: 2px; }
.cam-vf i:nth-child(3) { bottom: 0; left: 0;  border-bottom-width: 2px; border-left-width: 2px; }
.cam-vf i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }

/* Frame "opens" once the slate has clapped */
.cam-vf, .cam-osd { opacity: 0; transition: opacity .9s ease; }
.cam-vf { transform: scale(1.04); transition: opacity .9s ease, transform 1.1s cubic-bezier(.2, .7, .2, 1); }
body.cam-ready .cam-vf { opacity: 1; transform: none; }
body.cam-ready .cam-osd { opacity: 1; }

/* ---------- Clapperboard intro ---------- */
.cam-intro {
	position: fixed; inset: 0;
	z-index: 100000;                 /* above everything, incl. scroll-top button */
	background: #000;
	display: grid; place-items: center;
	transition: opacity .7s ease .1s;
	cursor: pointer;
}
.cam-intro.done { opacity: 0; pointer-events: none; }
.cam-slate { width: min(360px, 72vw); color: #fff; font-family: var(--cam-mono); font-size: 12px; }
.cam-slate .stick {
	height: 28px;
	transform-origin: left bottom;
	transform: rotate(-24deg);
	background: repeating-linear-gradient(135deg, #fff 0 22px, #000 22px 44px);
	border: 2px solid #fff;
}
.cam-slate .board { border: 2px solid #fff; border-top: 0; padding: 14px 16px 16px; }
.cam-slate .board div {
	display: flex; justify-content: space-between;
	border-bottom: 1px solid rgba(255, 255, 255, .3);
	padding: 6px 0;
}
.cam-slate .board strong {
	display: block;
	font-family: var(--font-secondary, Georgia, serif);
	font-weight: 400; font-size: 40px; line-height: 1.1;
	padding-top: 10px;
}
.cam-intro.clap .stick { transform: rotate(0); transition: transform .16s cubic-bezier(.6, 0, 1, 1); }

/* ---------- Desktop menu: exact middle too, so it lines up with the scene label ---------- */
@media (min-width: 1280px) {
	.header .navbar {
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
	}
	.header .navbar > ul > li:first-child > a { padding-left: 0; }
}

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
	:root { --cam-osd-h: calc(var(--cam-inset) + 30px); }
	.cam-osd { padding: var(--cam-inset) calc(var(--cam-inset) + 16px) 0; }
	.cam-osd .mid, .cam-osd .city { display: none; }
}

/* ---------- Visitors who turn off animations ---------- */
@media (prefers-reduced-motion: reduce) {
	.cam-vf, .cam-osd { opacity: 1; transform: none; transition: none; }
	.cam-osd .rec b { animation: none; }
}
