/* ==========================================================================
   Homepage hero, live layer (inc/hero-live.php).

   Adds the mini estimate card and the ad-to-enquiry story to .hero__art.
   site-home.css is left untouched; this file loads after it, so equal
   selectors here win.
   ========================================================================== */

/* The estimate card takes the top-right corner, so the Meta Ads tag moves to
   sit on the ad card's top edge. */
.hero__art .pill--a { top: 0; right: auto; left: 34%; z-index: 4; }
.hero__art .pill--b { z-index: 4; }

/* ---------- the mini estimate ---------- */
.shot--calc {
	width: min(228px, 40%);
	right: 1.5%;
	top: 3%;
	padding: 14px 15px;
	transform: rotate(2.5deg);
	z-index: 3;
}

.hcalc__k {
	display: block;
	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--dim);
}

.hcalc__b {
	margin: 5px 0 0;
	font-family: var(--font-display);
	font-weight: 800;
	font-size: 1.55rem;
	line-height: 1;
	letter-spacing: -.035em;
	font-variant-numeric: tabular-nums;
	color: var(--accent-text);
}

.hcalc__b span {
	font-family: var(--font-body);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0;
	color: var(--dim);
}

.hcalc__slider {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	height: 24px;
	margin: 8px 0 0;
	background: none;
	cursor: pointer;
	--fill: 5%;
}

.hcalc__slider::-webkit-slider-runnable-track {
	height: 6px;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--lime) var(--fill), rgba(var(--ink-rgb), .14) var(--fill));
}

.hcalc__slider::-moz-range-track { height: 6px; border-radius: 999px; background: rgba(var(--ink-rgb), .14); }
.hcalc__slider::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--lime); }

.hcalc__slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	margin-top: -7px;
	border-radius: 50%;
	border: 3px solid var(--bg);
	background: var(--lime);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}

.hcalc__slider::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 3px solid var(--bg);
	background: var(--lime);
}

.hcalc__slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(124, 224, 42, .45); }
.hcalc__slider:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(124, 224, 42, .45); }

.hcalc__r {
	margin: 6px 0 0;
	font-size: 12px;
	line-height: 1.35;
	color: var(--muted-hi);
}

.hcalc__r b {
	font-family: var(--font-display);
	font-size: 1.15rem;
	font-weight: 800;
	letter-spacing: -.03em;
	font-variant-numeric: tabular-nums;
	color: var(--ink);
}

.hcalc__n {
	margin: 3px 0 0;
	font-size: 10px;
	line-height: 1.4;
	color: var(--dim);
}

.hcalc__go {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: 11px;
	padding: 9px 12px;
	border-radius: 999px;
	background: var(--lime);
	color: var(--on-accent);
	font-size: 12px;
	font-weight: 800;
	text-decoration: none;
	transition: filter .2s var(--ease);
}

.hcalc__go:hover { filter: brightness(1.07); }
.hcalc__go:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

/* ---------- the story ---------- */
.chat__now {
	margin-left: auto;
	font-style: normal;
	font-size: 10px;
	font-weight: 700;
	color: var(--accent-text);
}

.bub--typing {
	display: none;
	gap: 3px;
	align-items: center;
	justify-self: start;
	padding: 9px 11px;
	background: rgba(var(--ink-rgb), .09);
	border-bottom-left-radius: 4px;
}

.bub--typing i {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: currentColor;
	opacity: .45;
	animation: hl-dot 1s ease-in-out infinite;
}

.bub--typing i:nth-child(2) { animation-delay: .15s; }
.bub--typing i:nth-child(3) { animation-delay: .3s; }

.bub--typing.is-out {
	justify-self: end;
	background: rgba(124, 224, 42, .2);
	border-bottom-left-radius: 13px;
	border-bottom-right-radius: 4px;
}

.hl-on .bub--typing.is-on { display: inline-flex; }
.hl-on .shot--chat .bub { transition: opacity .5s var(--ease); }
.hl-on .shot--chat .bub.is-wait { display: none; }
.hl-on .shot--chat .bub.is-new { animation: hl-pop .5s var(--ease) both; }
.hl-on .shot--chat.is-fade .bub { opacity: 0; }

.hl-on .shot__btn.is-tap { animation: hl-tap .75s var(--ease); }
.hl-on .shot--chat.is-ping { animation: hl-ping 1s var(--ease); }
.hl-on .shot--chat.is-live .chat__av { animation: hl-live 1.6s ease-in-out infinite; }
.hl-on .pill--b.is-pulse { animation: hl-pill 1.3s var(--ease); }

@keyframes hl-dot {
	0%, 80%, 100% { transform: translateY(0); opacity: .35; }
	40% { transform: translateY(-3px); opacity: .9; }
}

@keyframes hl-pop {
	from { opacity: 0; transform: translateY(6px) scale(.96); }
	to { opacity: 1; transform: none; }
}

@keyframes hl-tap {
	0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(124, 224, 42, .65); }
	35% { transform: scale(.9); }
	100% { transform: scale(1); box-shadow: 0 0 0 16px rgba(124, 224, 42, 0); }
}

@keyframes hl-ping {
	0% { box-shadow: 0 36px 90px rgba(var(--shadow-rgb), .62), 0 0 0 0 rgba(124, 224, 42, .5); border-color: rgba(124, 224, 42, .7); }
	100% { box-shadow: 0 36px 90px rgba(var(--shadow-rgb), .62), 0 0 0 18px rgba(124, 224, 42, 0); }
}

@keyframes hl-live {
	0%, 100% { box-shadow: 0 0 0 0 rgba(124, 224, 42, .55); }
	50% { box-shadow: 0 0 0 5px rgba(124, 224, 42, 0); }
}

@keyframes hl-pill {
	0% { transform: scale(1); }
	30% { transform: scale(1.08); box-shadow: 0 12px 34px rgba(var(--shadow-rgb), .5), 0 0 0 0 rgba(124, 224, 42, .55); }
	100% { transform: scale(1); box-shadow: 0 12px 34px rgba(var(--shadow-rgb), .5), 0 0 0 14px rgba(124, 224, 42, 0); }
}

/* ---------- smaller screens ---------- */
@media (max-width: 1080px) {
	.hero__art { aspect-ratio: 1 / .92; }
}

/* Narrow two-column desktops: the art column is short, so give it more
   height and the estimate card more width (narrow, it wraps and grows tall). */
@media (min-width: 1081px) and (max-width: 1279px) {
	.hero__art { aspect-ratio: 1 / 1.06; }
	.shot--calc { width: min(228px, 46%); }
	.shot--ad { width: min(300px, 54%); }
	.shot--chat { width: min(236px, 43%); }
}

/* Phones: three absolutely placed cards cannot avoid each other at this
   width, so they stack in normal flow and overlap only by design. The chat
   card keeps a fixed minimum height, so the story playing inside it never
   moves the estimate card below. */
@media (max-width: 680px) {
	.hero__art {
		aspect-ratio: auto;
		display: flex;
		flex-direction: column;
		padding: 30px 0 10px;
	}
	.hero__art .shot {
		position: relative;
		inset: auto;
	}
	.shot--ad { width: min(80%, 320px); align-self: flex-start; transform: rotate(-2deg); }
	.shot--chat { width: min(74%, 290px); align-self: flex-end; margin-top: 12px; min-height: 205px; transform: rotate(2deg); z-index: 2; }
	.shot--calc { width: min(78%, 300px); align-self: flex-start; margin-top: -26px; transform: rotate(-1.5deg); }
	.hero__art .pill--a { top: 0; left: auto; right: 0; }
	.hero__art .pill--b { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.bub--typing i,
	.hl-on .shot--chat .bub.is-new,
	.hl-on .shot__btn.is-tap,
	.hl-on .shot--chat.is-ping,
	.hl-on .shot--chat.is-live .chat__av,
	.hl-on .pill--b.is-pulse { animation: none; }
	.hcalc__go { transition: none; }
}
