/* ==========================================================================
   HQDM: video reviews. Shared pattern (snap carousel, home + service pages) and the /reviews page cards.
   v5: /reviews frames follow the video ratio (16:9 videos, 9:16 shorts; no letterbox bars); the shared pattern is all
   16:9 (round 2, G4). /reviews cards are translucent over one fixed light field; disabled carousel arrows read as
   inactive (not broken).
   A card opens the video full screen in an overlay (native <dialog>, site.js).
   ========================================================================== */
.hq-reviews { isolation: isolate; }
.hq-reviews::before {
	/* old hqdm.io dot grid, faint, behind the cards */
	content: "";
	position: absolute;
	left: 50%;
	top: 40%;
	width: 520px;
	aspect-ratio: 1;
	translate: -50% -50%;
	background: url("../../img/dots.webp") center / contain no-repeat;
	opacity: .18;
	z-index: -1;
	pointer-events: none;
}
.hq-vreviews { position: relative; max-width: var(--wide); margin-inline: auto; }
.hq-vreviews__track {
	/* one row of frames with a common height; each card is as wide as its video ratio (shorts narrow, 16:9 wide) */
	--vr-h: clamp(300px, 26vw, 380px);
	display: flex;
	align-items: flex-start;
	gap: var(--sp-5);
	margin: calc(-1 * var(--sp-3)) 0;
	padding: var(--sp-3) 0;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}
.hq-vreviews__track::-webkit-scrollbar { display: none; }
/* round 3 (B3, Milan): every card is a 16:9 frame; N whole cards plus a peek of the next one tell the visitor the
   row scrolls: 3 + peek from 1024px, 2 + peek on tablets, 1 + peek on phones. Card width = (row - N gaps) / (N + peek).
   The peeking card fades out at the row edge (mask); the fade moves to the left edge once the row is scrolled to its
   end (site.js sets data-edge), so a cut card never sits on a hard line. */
.hq-vreviews__track { --vr-n: 3; --vr-peek: .22; --vr-gap: var(--sp-5); gap: var(--vr-gap); }
.hq-vreviews__track > .hq-vreview { flex: none; width: calc((100% - var(--vr-n) * var(--vr-gap)) / (var(--vr-n) + var(--vr-peek))); }
@media (max-width: 1023px) { .hq-vreviews__track { --vr-n: 2; --vr-peek: .24; --vr-gap: var(--sp-4); } }
@media (max-width: 600px) {
	/* phones: the row bleeds to the screen edge, the first card starts on the text edge */
	.hq-vreviews__track { --vr-n: 1; --vr-peek: .2; --vr-gap: var(--sp-3); margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
	.hq-vreviews__track > .hq-vreview { width: calc((100vw - var(--gutter) - var(--vr-gap)) / (1 + var(--vr-peek))); }
}
.hq-vreviews__track {
	--vr-fade: clamp(28px, 4%, 56px);
	-webkit-mask-image: linear-gradient(90deg, #000 calc(100% - var(--vr-fade)), transparent);
	mask-image: linear-gradient(90deg, #000 calc(100% - var(--vr-fade)), transparent);
}
.hq-vreviews__track[data-edge="end"] {
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--vr-fade));
	mask-image: linear-gradient(90deg, transparent, #000 var(--vr-fade));
}
.hq-vreviews__track[data-edge="none"] { -webkit-mask-image: none; mask-image: none; }
.hq-vreview { scroll-snap-align: start; max-width: none; margin: 0 !important; }   /* no prose cap on the card (base.css caps li at 33em) */
.hq-vreview__btn {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	font: inherit;
	font-size: 1rem;
	color: inherit;
	text-align: left;
	cursor: pointer;
	background: none;
	border: 0;
	border-radius: var(--r-3);
}
.hq-vreview__frame {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--r-3);
	background: var(--c-surface);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 24px 48px -28px rgba(0, 0, 0, .8);
	transition: transform var(--d-1) var(--ease-out);
}
.hq-vreview__frame::after {
	/* glass rim + lit top edge over the video still */
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: var(--photo-rim), inset 0 1px 0 rgba(255, 255, 255, .22);   /* phase 4: cyan rim, the burned-in captions read as part of the card */
	pointer-events: none;
}
.hq-vreview__thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.85) brightness(.8); }
/* shorts: portrait frame; cover crops the still to the speaker (the baked-in pillar bars of some stills fall outside) */
:is(.hq-vreview--short, .hq-rv--short) .hq-vreview__frame { aspect-ratio: 9 / 16; }
.hq-vreview--short .hq-vreview__meta { grid-template-columns: minmax(0, 1fr); padding-inline: var(--sp-4); row-gap: 2px; }
.hq-vreview--short .hq-vreview__stars { grid-row: auto; grid-column: 1; margin: var(--sp-2) 0 0; }
.hq-vreview__play {
	position: absolute;
	top: 46%;
	left: 50%;
	z-index: 1;
	width: 64px;
	height: 64px;
	translate: -50% -50%;
	border-radius: 50%;
	background: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .04)), rgba(14, 7, 30, .55);   /* dark enough not to take on the still's skin tones */
	-webkit-backdrop-filter: blur(12px) saturate(170%);
	backdrop-filter: blur(12px) saturate(170%);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .4), 0 10px 30px -10px rgba(0, 0, 0, .8);
	transition: background-color var(--d-2) var(--ease), box-shadow var(--d-3) var(--ease), scale var(--d-3) var(--ease-out);
}
.hq-vreview__play::before { content: ""; position: absolute; left: 55%; top: 50%; translate: -50% -50%; border-left: 16px solid #fff; border-block: 10px solid transparent; }
.hq-vreview__meta {
	/* name, company and stars sit on the still, over a dark scrim (as on the old site) */
	position: absolute;
	inset: auto 0 0;
	z-index: 1;
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: end;
	column-gap: var(--sp-3);
	padding: var(--sp-7) var(--sp-5) var(--sp-4);
	border-radius: 0 0 var(--r-3) var(--r-3);
	background: linear-gradient(180deg, transparent, rgba(8, 3, 20, .55) 40%, rgba(8, 3, 20, .88));
	pointer-events: none;
}
.hq-vreview__name { color: #fff; font-family: var(--ff-heading); font-size: 1.1875rem; font-weight: var(--fw-heading); line-height: 1.25; letter-spacing: -.01em; }
.hq-vreview__company { grid-row: 2; color: rgba(255, 255, 255, .7); font-size: var(--fs-ui); line-height: 1.4; }
.hq-vreview__stars { grid-row: 1 / span 2; grid-column: 2; align-self: end; width: 84px; height: auto; margin-bottom: 3px; border-radius: 0; filter: drop-shadow(0 0 6px rgba(151, 71, 255, .7)); }
/* round 3 (B3): with N + peek per view a card can be 270 to 320px wide (1024px screens, tablets, phones); the card
   is a size container, so a narrow card gets a smaller play disc set higher and a tighter caption that never
   meets the disc */
.hq-vreviews__track > .hq-vreview { container-type: inline-size; }
@container (max-width: 330px) {
	.hq-vreview__play { top: 40%; width: 52px; height: 52px; }
	.hq-vreview__play::before { border-left-width: 13px; border-block-width: 8px; }
	.hq-vreview__meta { padding: var(--sp-6) var(--sp-4) var(--sp-3); column-gap: var(--sp-2); }
	.hq-vreview__name { font-size: 1rem; }
	.hq-vreview__company { font-size: .8125rem; }
	.hq-vreview__stars { width: 64px; margin-bottom: 2px; }
}
@media (hover: hover) {
	.hq-vreview__btn:hover .hq-vreview__play { scale: 1.08; background: linear-gradient(180deg, #8a5cf7, #6534d6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 0 0 8px rgba(151, 71, 255, .18), 0 12px 36px -8px rgba(151, 71, 255, .95); }
}
.hq-vreview__btn:active .hq-vreview__frame { transform: scale(.985); }
.hq-vreview__btn:focus-visible { outline: none; }
.hq-vreview__btn:focus-visible .hq-vreview__frame { outline: 2px solid var(--c-accent); outline-offset: 3px; }
/* phase 4: an inner ring too, so the focus stays visible where the scrolling track clips the outer outline */
.hq-vreview__btn:focus-visible .hq-vreview__frame::after { box-shadow: inset 0 0 0 2px var(--c-accent), inset 0 0 0 5px rgba(6, 2, 16, .55); }

/* Arrows: a centred pair of glass discs under the track, on every width (Milan) */
.hq-vreviews__nav { display: flex; justify-content: center; gap: var(--sp-3); margin-top: var(--sp-6); }
.hq-carousel-btn {
	position: relative;
	width: 48px;
	height: 48px;
	font-size: 1rem;
	border: 0;
	border-radius: 50%;
	color: var(--c-text-strong);
	background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03)), rgba(18, 10, 38, .6);
	-webkit-backdrop-filter: blur(16px) saturate(170%);
	backdrop-filter: blur(16px) saturate(170%);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), inset 0 1px 0 rgba(255, 255, 255, .22), 0 12px 30px -12px rgba(0, 0, 0, .9);
	cursor: pointer;
	transition: box-shadow var(--d-2) var(--ease), color var(--d-2) var(--ease), background-color var(--d-2) var(--ease), transform var(--d-1) var(--ease-out);
}
.hq-carousel-btn::before { content: ""; position: absolute; top: 50%; left: 50%; width: 9px; height: 9px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; translate: -65% -50%; rotate: 45deg; }
.hq-carousel-btn[data-dir="-1"]::before { rotate: -135deg; translate: -35% -50%; }
@media (hover: hover) { .hq-carousel-btn:not(:disabled):hover { box-shadow: inset 0 0 0 1px rgba(196, 173, 255, .5), inset 0 1px 0 rgba(255, 255, 255, .3), 0 0 28px -6px rgba(151, 71, 255, .9); transition-duration: var(--d-hover); } }
.hq-carousel-btn:active:not(:disabled) { transform: scale(.94); }
/* disabled (start / end of the track): an empty outline with a faint chevron, no glass, no hover (audit P8) */
.hq-carousel-btn:disabled { color: rgba(221, 218, 231, .32); background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); cursor: default; }
.hq-carousel-btn:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }

/* --------------------------------------------------------------------------
   /reviews: a wall of translucent cards over ONE fixed light field (cosmoq). The field is fixed to the viewport,
   so every card picks up a different mix of violet and cyan as it scrolls through it. Masonry columns keep the
   bento without holes; frames follow the video ratio. Only the video button reacts to the pointer.
   -------------------------------------------------------------------------- */
.hq-reviews-grid > * { max-width: var(--wide); }
.hq-field { isolation: isolate; }
.hq-field::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		radial-gradient(34vmax 30vmax at 10% 30%, rgba(151, 71, 255, .3), transparent 70%) fixed,
		radial-gradient(30vmax 28vmax at 92% 70%, rgba(58, 209, 255, .17), transparent 70%) fixed,
		radial-gradient(26vmax 20vmax at 52% 104%, rgba(91, 46, 214, .22), transparent 70%) fixed;
	-webkit-mask: linear-gradient(180deg, transparent, #000 160px, #000 calc(100% - 160px), transparent);
	mask: linear-gradient(180deg, transparent, #000 160px, #000 calc(100% - 160px), transparent);
}
.hq-rvlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--sp-5); padding: 0; margin-block: 0; list-style: none; }
/* phase 4: masonry in reading order. DOM order = row-major (Tab moves left to right); site.js sets each card's row
   span on a 4px row grid. Hidden (not just transparent) until laid out, so the reflow never counts as a layout shift;
   without JS it is a plain grid. */
.hq-reviews-grid .hq-rvlist { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); column-gap: var(--sp-5); row-gap: var(--sp-5); align-items: start; }
.hq-reviews-grid .hq-rvlist.is-masonry { grid-auto-rows: 4px; row-gap: 0; }
.hq-reviews-grid .hq-rvlist.is-masonry > .hq-rv { margin-bottom: var(--sp-5); }
html.hq-js .hq-reviews-grid .hq-rvlist:not(.is-masonry) { visibility: hidden; }
.hq-rv {
	position: relative;
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: var(--sp-2);
	font-size: 1rem;
	border-radius: var(--r-3);
	background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015) 60%), rgba(16, 8, 34, .22);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.hq-rv__video { width: 100%; }
.hq-rv .hq-vreview__frame { border-radius: calc(var(--r-3) - var(--sp-2)); }
.hq-rv__quote { margin: var(--sp-5) var(--sp-3) 0; padding: 0; border: 0; }
.hq-rv__quote p { margin: 0; color: var(--c-text); font-size: 1rem; line-height: 1.65; }
.hq-rv__who { display: grid; gap: 2px; margin: auto var(--sp-3) var(--sp-3); padding-top: var(--sp-5); }
.hq-rv__name { font-family: var(--ff-heading); font-weight: var(--fw-heading-sm); color: var(--c-text-strong); letter-spacing: -.008em; }
.hq-rv__company { color: var(--c-text-faint); font-size: var(--fs-ui); overflow-wrap: anywhere; }
@media (max-width: 600px) {
	/* phones: a portrait card puts its 9:16 frame beside the quote (a full-width 9:16 frame would be 600px tall) */
	.hq-rv--short { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: var(--sp-4); }
	.hq-rv--short .hq-rv__video { grid-row: 1 / span 2; align-self: start; }
	.hq-rv--short .hq-rv__quote { margin: var(--sp-2) var(--sp-2) 0 0; }
	.hq-rv--short .hq-rv__quote p { font-size: .9375rem; line-height: 1.6; }
	.hq-rv--short .hq-rv__who { margin: 0 var(--sp-2) var(--sp-2) 0; padding-top: var(--sp-4); align-self: end; }
	.hq-rv--short .hq-vreview__play { width: 48px; height: 48px; }
}
@media (prefers-reduced-transparency: reduce) { .hq-rv { background: var(--c-surface); } }

/* Full-screen video overlay */
.hq-lightbox {
	width: 100vw;
	max-width: 100vw;
	height: 100dvh;
	max-height: 100dvh;
	margin: 0;
	padding: clamp(16px, 4vw, 48px);
	border: 0;
	background: transparent;
	display: none;     /* closed dialog must not cover the page (author display would override the UA rule) */
	place-items: center;
	opacity: 0;
	transition: opacity 200ms var(--ease), overlay 200ms allow-discrete, display 200ms allow-discrete;
}
.hq-lightbox[open] { display: grid; opacity: 1; transition-duration: var(--d-2); }
@starting-style { .hq-lightbox[open] { opacity: 0; } }
.hq-lightbox::backdrop { background: rgba(6, 2, 15, .86); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.hq-lightbox__frame {
	position: relative;
	width: min(100%, calc((100dvh - 2 * clamp(16px, 4vw, 48px)) * 16 / 9), 1280px);
	aspect-ratio: 16 / 9;
	font-size: 1rem;
	border-radius: var(--r-2);
	overflow: hidden;
	background: #000;
	box-shadow: var(--shadow-2), 0 0 0 1px var(--c-line-2);
	transform: scale(1);
	transition: transform 300ms var(--ease-out);
}
@starting-style { .hq-lightbox[open] .hq-lightbox__frame { transform: scale(.98); } }
.hq-lightbox__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* phase 4: YouTube Shorts play in a 9:16 frame (site.js sets .is-portrait from the card's data-ratio) */
.hq-lightbox.is-portrait .hq-lightbox__frame { width: min(100%, calc((100dvh - 2 * clamp(16px, 4vw, 48px)) * 9 / 16), 480px); aspect-ratio: 9 / 16; }
.hq-lightbox__close {
	position: fixed;
	top: max(16px, env(safe-area-inset-top));
	right: max(16px, env(safe-area-inset-right));
	width: 44px;
	height: 44px;
	font-size: 1rem;
	border-radius: var(--r-pill);
	border: 1px solid var(--c-line-2);
	background: rgba(19, 11, 39, .55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='white' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M3 3l10 10M13 3 3 13'/%3E%3C/svg%3E") center no-repeat;
	-webkit-backdrop-filter: blur(18px) saturate(150%);
	backdrop-filter: blur(18px) saturate(150%);
	box-shadow: var(--shadow-1);
	cursor: pointer;
	transition: background-color var(--d-2) var(--ease), border-color var(--d-2) var(--ease);
}
@media (hover: hover) { .hq-lightbox__close:hover { background-color: var(--c-surface-2); border-color: rgba(221, 218, 231, .28); transition-duration: var(--d-1); } }
.hq-lightbox__close:active { transform: scale(.96); }
