/* --- Device stage (DESKTOP ONLY: a real phone running a live demo) --- */
.device-stage {
	display: none;
}
@media (min-width: 1024px) and (pointer: fine) {
	.device-stage {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 0.9rem;
	}
}
.device {
	position: relative;
	width: 300px;
	height: 610px;
	border-radius: 46px;
	padding: 13px;
	background: linear-gradient(160deg, #1a1a1e, #0a0a0c);
	box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 0 0 2px rgba(255, 255, 255, 0.03);
}
.device::after {
	content: "";
	position: absolute;
	top: 22px;
	left: 50%;
	transform: translateX(-50%);
	width: 104px;
	height: 26px;
	background: #000;
	border-radius: 16px;
	z-index: 5;
}
.device-screen {
	width: 100%;
	height: 100%;
	border-radius: 34px;
	overflow: hidden;
	background: radial-gradient(120% 60% at 50% 0%, #10201a 0%, #0a0f0d 55%, #08080a 100%);
	display: flex;
	flex-direction: column;
	color: #e7e7ea;
}

/* Mini app UI */
.app-status {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 46px 20px 6px;
	font-size: 0.72rem;
}
.pill {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	font-weight: 600;
	font-size: 0.68rem;
}
.pill .dot {
	width: 7px;
	height: 7px;
	border-radius: 999px;
}
.pill--online {
	background: rgba(79, 175, 83, 0.16);
	color: #7fe089;
}
.pill--online .dot {
	background: #4faf53;
}
.pill--offline {
	background: rgba(245, 176, 65, 0.16);
	color: #f5c177;
}
.pill--offline .dot {
	background: #f5b041;
}
.pill--syncing {
	background: rgba(29, 161, 242, 0.16);
	color: #8fd0fb;
}
.pill--syncing .dot {
	background: #1da1f2;
	animation: spin 0.7s linear infinite;
	border-radius: 2px;
}
@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}
.app-head {
	padding: 8px 20px 10px;
}
.app-title {
	font-size: 1.1rem;
	font-weight: 700;
}
.app-sub {
	font-size: 0.68rem;
	opacity: 0.55;
}
.app-list {
	flex: 1;
	overflow: hidden;
	padding: 4px 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.job {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.06);
	animation: jobIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes jobIn {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
}
.job .jdot {
	width: 9px;
	height: 9px;
	border-radius: 999px;
	flex: none;
}
.job .jbody {
	min-width: 0;
	flex: 1;
}
.job .jname {
	font-size: 0.8rem;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.job .jmeta {
	font-size: 0.64rem;
	opacity: 0.55;
}
.job[data-state="synced"] .jdot {
	background: #4faf53;
}
.job[data-state="queued"] .jdot {
	background: #f5b041;
}
.job[data-state="syncing"] .jdot {
	background: #1da1f2;
	animation: spin 0.7s linear infinite;
	border-radius: 2px;
}
.app-foot {
	padding: 12px 16px 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.app-btn {
	width: 100%;
	padding: 0.7rem;
	border-radius: 14px;
	background: #4faf53;
	color: #041206;
	font-weight: 700;
	font-size: 0.85rem;
	transition: transform 0.12s ease, filter 0.2s ease;
}
.app-btn:hover {
	filter: brightness(1.08);
}
.app-btn:active {
	transform: scale(0.98);
}
.app-toggle {
	width: 100%;
	padding: 0.5rem;
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	font-size: 0.72rem;
	color: #cfd3d1;
	transition: all 0.2s ease;
}
.app-toggle:hover {
	border-color: rgba(var(--glow), 0.5);
	color: #fff;
}
.device-caption {
	max-width: 340px;
	text-align: center;
	font-size: 0.7rem;
	opacity: 0.55;
	line-height: 1.5;
}

/* ===== Mobile + Web composition: phone (front) + MacBook (behind) ===== */
.devices {
	position: relative;
	width: 480px;
	max-width: 100%;
	margin-bottom: 26px;
}
/* MacBook - CSS-only: display + a silver deck with an open-groove notch. */
.laptop {
	width: 480px;
}
.laptop-screen {
	width: 100%;
	aspect-ratio: 16 / 10;
	background: #0b100e;
	border: 9px solid #16171b;
	border-radius: 15px 15px 4px 4px;
	overflow: hidden;
	box-shadow: 0 34px 60px -32px rgba(0, 0, 0, 0.85), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.laptop-deck {
	width: 116%;
	margin-left: -8%;
	height: 13px;
	background: linear-gradient(#d8dbdf, #aeb2b8 55%, #83868c);
	border-radius: 0 0 11px 11px;
	position: relative;
	box-shadow: 0 12px 22px -10px rgba(0, 0, 0, 0.6);
}
.laptop-deck::before {
	content: "";
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 84px;
	height: 5px;
	background: #8b8f95;
	border-radius: 0 0 7px 7px;
}
/* Resserra web dashboard inside the MacBook (static, no packages). */
.web {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	background: radial-gradient(120% 80% at 50% 0%, #10201a, #0b100e 60%);
	color: #e7e7ea;
}
.web-top {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 7px 11px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.web-brand {
	font-weight: 700;
	font-size: 11px;
}
.web-tag {
	font-size: 8px;
	opacity: 0.45;
}
.web-sync {
	margin-left: auto;
	font-size: 8px;
	color: #7fe089;
}
.web-body {
	flex: 1;
	display: flex;
	min-height: 0;
}
.web-nav {
	width: 92px;
	padding: 8px 6px;
	display: flex;
	flex-direction: column;
	gap: 3px;
	border-right: 1px solid rgba(255, 255, 255, 0.06);
	font-size: 8.5px;
}
.web-nav span {
	padding: 4px 8px;
	border-radius: 6px;
	opacity: 0.55;
}
.web-nav span.on {
	background: rgba(79, 175, 83, 0.16);
	color: #7fe089;
	opacity: 1;
}
.web-main {
	flex: 1;
	padding: 9px 10px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}
.web-kpis {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;
}
.kpi {
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 8px;
	padding: 6px 7px;
	display: flex;
	flex-direction: column;
	gap: 1px;
}
.kpi b {
	font-size: 13px;
}
.kpi span {
	font-size: 7.5px;
	opacity: 0.55;
}
.kpi-ok b {
	color: #7fe089;
}
.web-table {
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 8px;
	overflow: hidden;
}
.web-table .tr {
	display: grid;
	grid-template-columns: 1.7fr 0.8fr 0.7fr 0.9fr;
	gap: 6px;
	padding: 5px 9px;
	font-size: 8.5px;
	border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.web-table .tr:first-child {
	border-top: none;
}
.web-table .th {
	opacity: 0.5;
	font-weight: 600;
}
.web-table .ok {
	color: #7fe089;
}
.web-table .warn {
	color: #f5c177;
}
.web-table .bad {
	color: #ff8f8f;
}
/* Phone stands in front, mostly beyond the MacBook's right edge so the
   web dashboard stays fully readable. */
.phone-wrap {
	position: absolute;
	right: -78px;
	bottom: -46px;
	transform: scale(0.52);
	transform-origin: bottom right;
	filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.55));
}

/* --- 3D tilt project cards --- */
#project-list article {
	transform-style: preserve-3d;
	transition: transform 0.2s ease-out, box-shadow 0.3s ease, border-color 0.3s ease;
}
#project-list article:hover {
	border-color: rgba(var(--glow), 0.5);
	box-shadow: 0 20px 60px -20px rgba(var(--glow), 0.35);
}

/* --- Scroll scrubber + section reel --- */
.scrubber {
	position: fixed;
	top: 0;
	left: 0;
	height: 3px;
	width: 100%;
	transform: scaleX(var(--progress, 0));
	transform-origin: 0 50%;
	background: linear-gradient(90deg, #4faf53, #1da1f2);
	z-index: 60;
}
.reel {
	position: fixed;
	right: 1rem;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
	z-index: 40;
}
.reel a {
	width: 10px;
	height: 10px;
	border-radius: 999px;
	border: 1.5px solid rgba(var(--glow), 0.5);
	transition: all 0.3s ease;
}
.reel a.active {
	background: #4faf53;
	box-shadow: 0 0 12px rgba(var(--glow), 0.8);
	transform: scale(1.25);
}
@media (max-width: 1023px) {
	.reel {
		display: none;
	}
}
