/**
 * Smart Home Demo — house + phone stacks (same aspect as exported WebP), hotspots %.
 */

.shd-root {
	box-sizing: border-box;
	width: 100%;
	max-width: 1200px;
	margin-inline: auto;
	padding: clamp(1rem, 3vw, 2rem);
}

.shd-root *,
.shd-root *::before,
.shd-root *::after {
	box-sizing: border-box;
}

.shd-stage {
	display: grid;
	grid-template-columns: minmax(0, 1.12fr) minmax(200px, 0.4fr);
	align-items: center;
	justify-items: stretch;
	gap: clamp(0.75rem, 2.2vw, 1.75rem);
	position: relative;
}

@media (max-width: 700px) {
	.shd-stage {
		grid-template-columns: 1fr;
		justify-items: center;
		align-items: start;
	}
}

/* --- House: base + full-frame overlays (1536×1024) --- */

.shd-house {
	position: relative;
	width: 100%;
	max-width: min(720px, 100%);
	justify-self: end;
	aspect-ratio: 1536 / 1024;
}

@media (max-width: 700px) {
	.shd-house {
		justify-self: center;
		max-width: 100%;
	}
}

.shd-house__img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.shd-house__layers {
	position: absolute;
	inset: 0;
	pointer-events: none;
	border-radius: 12px;
	overflow: hidden;
}

.shd-overlay {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: fill;
	display: block;
	pointer-events: none;
	opacity: 0;
	will-change: opacity;
	transition: opacity 0.35s ease;
}

.shd-overlay.is-lit {
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.shd-overlay {
		transition: none;
	}
}

/* --- Phone: base + overlays (782×1558), aligned to house row --- */

.shd-phone {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: clamp(200px, 26vw, 270px);
	justify-self: start;
	margin-top: auto;
	margin-bottom: auto;
	filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.45));
}

@media (max-width: 700px) {
	.shd-phone {
		justify-self: center;
		max-width: min(270px, 78vw);
		margin-top: 0.75rem;
	}
}

.shd-phone__bezel {
	padding: 10px;
	border-radius: 36px;
	background: linear-gradient(145deg, #2a2a2e, #0e0e10);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.06),
		inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

.shd-phone__screen {
	position: relative;
	border-radius: 28px;
	overflow: hidden;
	background: #000;
}

/*
 * Single coordinate system: hotspots % match phone_bgnd.webp pixels.
 * Base + overlays fill this box (object-fit: fill) so clicks align with art.
 */
.shd-phone__stack {
	position: relative;
	width: 100%;
	aspect-ratio: 782 / 1558;
}

.shd-phone__base {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: fill;
}

.shd-phone__layers {
	position: absolute;
	inset: 0;
	pointer-events: none;
	overflow: hidden;
	border-radius: inherit;
}

.shd-phone-overlay {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: fill;
	display: block;
	pointer-events: none;
	opacity: 0;
	will-change: opacity;
	transition: opacity 0.35s ease;
}

.shd-phone-overlay.is-lit {
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.shd-phone-overlay {
		transition: none;
	}
}

.shd-phone__hotspots {
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
	border-radius: inherit;
	isolation: isolate;
}

.shd-phone__hotspots .shd-hotspot {
	pointer-events: auto;
}

.shd-hotspot {
	position: absolute;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	/* Default: lower rows above in paint order; per-class z-index corrects overlaps. */
	z-index: 1;
}

.shd-hotspot:focus {
	outline: none;
}

.shd-hotspot:focus-visible {
	outline: 3px solid #6cb3ff;
	outline-offset: 2px;
	border-radius: 6px;
	z-index: 60;
}

/*
 * Hotspots — % of .shd-phone__stack (782×1558), phone_bgnd "Стаи" grid.
 * Grid nudged ~1% up from v1.3.0; height uses % + px for slightly taller tap targets.
 * R1: Коридор | Хол — R2: Спалня | Баня — R3: Стълбище | Двор — R4: Вход | Гараж (3-phase).
 */
.shd-hotspot--hallway {
	top: 70%;
	left: 4.5%;
	width: 44%;
	height: calc(5.35%);
	z-index: 50;
}

.shd-hotspot--living {
	top: 70%;
	left: 51.5%;
	width: 44%;
	height: calc(5.35%);
	z-index: 50;
}

.shd-hotspot--bedroom {
	top: 76%;
	left: 4.5%;
	width: 44%;
	height: calc(5.35%);
	z-index: 45;
}

.shd-hotspot--bathroom {
	top: 76%;
	left: 51.5%;
	width: 44%;
	height: calc(5.35%);
	z-index: 45;
}

.shd-hotspot--stairs {
	top: 82%;
	left: 4.5%;
	width: 44%;
	height: calc(5.35%);
	z-index: 40;
}

.shd-hotspot--outside {
	top: 82%;
	left: 51.5%;
	width: 44%;
	height: calc(5.35%);
	z-index: 40;
}

.shd-hotspot--porch {
	top: 91%;
	left: 4.5%;
	width: 44%;
	height: calc(5.5%);
	z-index: 35;
}

.shd-hotspot--garage {
	top: 91%;
	left: 51.5%;
	width: 44%;
	height: calc(5.5%);
	z-index: 36;
}
