/* Intelligence page – intro and the AI search + chat preview.
 * Loaded only on /intelligence/ (inc/intelligence-demo.php).
 * Same tokens as the rest of the site: black/grey panels, cream type,
 * yellow for anything the AI did, orange for off-market.
 */

/* ------------------------------------------------------------------ */
/* Intro                                                                */
/* ------------------------------------------------------------------ */

.v-intel {
	position: relative;
	padding: 200px 0 var(--v-space-section); /* clears the floating nav, like the FAQ header */
	background: var(--wp--preset--color--black);
	color: var(--wp--preset--color--cream);
	overflow: clip;
}

.v-intel > * {
	margin-block: 0 !important;
}

/* Soft yellow-green glow behind the window, same family as the homepage glows. */
.v-intel::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 520px;
	width: 1400px;
	height: 700px;
	margin-left: -700px;
	background: radial-gradient(closest-side, rgba(233, 242, 146, 0.12), rgba(233, 242, 146, 0) 70%);
	pointer-events: none;
}

.v-intel__intro {
	position: relative;
	box-sizing: content-box;
	max-width: 880px;
	margin: 0 auto !important;
	padding: 0 40px; /* fixed: var(--v-edge) is a % of the page width, which squeezed the text to one word per line on wide screens (Oct 19) */
	text-align: center;
}

.v-intel__intro > * {
	margin-block: 0;
}

.v-intel .v-eyebrow {
	justify-content: center;
	color: var(--wp--preset--color--white);
}

.v-intel .v-intel__title {
	margin-top: 20px;
	font-size: clamp(2.5rem, 1.7rem + 3.3vw, 4.5rem); /* 40 → 72 */
	font-weight: 400;
	line-height: 1.02;
	letter-spacing: -0.05em;
	color: var(--wp--preset--color--cream);
}

.v-intel .v-intel__lede {
	max-width: 620px;
	margin: 20px auto 0;
	font-family: var(--wp--preset--font-family--geist);
	font-size: clamp(1.125rem, 1rem + 0.5vw, 1.5rem);
	line-height: 1.3;
	letter-spacing: -0.02em;
	color: var(--wp--preset--color--text-secondary);
	text-wrap: balance;
}

@media (prefers-reduced-motion: no-preference) {
	.v-intel__intro > * {
		animation: v-ai-rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
	}

	.v-intel__intro > :nth-child(2) { animation-delay: 0.08s; }
	.v-intel__intro > :nth-child(3) { animation-delay: 0.16s; }

	.v-intel .v-ai {
		animation: v-ai-rise 0.9s 0.25s cubic-bezier(0.2, 0.7, 0.2, 1) both;
	}
}

@keyframes v-ai-rise {
	from { opacity: 0; transform: translateY(24px); }
	to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------ */
/* Window                                                               */
/* ------------------------------------------------------------------ */

.v-ai {
	position: relative;
	margin-top: 64px !important;
	padding: 0 var(--v-edge);
}

.v-ai__window {
	--v-ai-line: rgba(255, 253, 233, 0.08);
	--v-ai-fill: rgba(255, 249, 229, 0.05);
	--v-ai-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	max-width: 1240px;
	margin: 0 auto;
	border: 1px solid var(--v-ai-line);
	border-radius: var(--v-radius-md);
	background: var(--wp--preset--color--background-grey);
	box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.6);
	overflow: hidden;
	font-family: var(--wp--preset--font-family--geist);
	letter-spacing: -0.01em;
	color: var(--wp--preset--color--cream);
}

.v-ai__window *,
.v-ai__window *::before,
.v-ai__window *::after {
	box-sizing: border-box;
}

.v-ai__window svg {
	display: block;
}

.v-ai__window button {
	font: inherit;
	color: inherit;
	cursor: pointer;
}

.v-ai__window :focus-visible {
	outline: 2px solid var(--wp--preset--color--yellow);
	outline-offset: 2px;
}

.v-ai__top {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 52px;
	padding: 0 20px;
	border-bottom: 1px solid var(--v-ai-line);
}

.v-ai__brand,
.v-ai__badge,
.v-ai__reset {
	white-space: nowrap;
}

.v-ai__brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 15px;
	font-weight: 500;
}

.v-ai__role {
	margin-left: -2px;
	font-weight: 400;
	color: var(--wp--preset--color--grey);
}

.v-ai__role::before {
	content: "·";
	margin-right: 8px;
}

.v-ai__mark,
.v-ai__avatar {
	display: inline-grid;
	place-items: center;
	flex: none;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--wp--preset--color--yellow);
	color: var(--wp--preset--color--black);
}

.v-ai__mark svg,
.v-ai__avatar svg {
	width: 14px;
	height: 14px;
}

.v-ai__badge {
	padding: 4px 10px;
	border: 1px solid var(--v-ai-line);
	border-radius: var(--v-radius-pill);
	font-family: var(--wp--preset--font-family--geist-mono);
	font-size: 11px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--wp--preset--color--grey);
}

.v-ai__reset {
	margin-left: auto;
	padding: 6px 2px;
	border: 0;
	background: none;
	font-size: 14px !important;
	color: rgba(255, 253, 233, 0.7) !important;
	text-decoration: underline;
	text-decoration-color: rgba(255, 253, 233, 0.3);
	text-underline-offset: 4px;
	transition: color 0.2s ease;
}

.v-ai__reset:hover {
	color: var(--wp--preset--color--cream) !important;
}

.v-ai__body {
	display: grid;
	grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
	height: 640px;
}

/* ------------------------------------------------------------------ */
/* Chat                                                                 */
/* ------------------------------------------------------------------ */

.v-ai__chat {
	display: flex;
	flex-direction: column;
	min-height: 0;
	border-right: 1px solid var(--v-ai-line);
}

.v-ai__log {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding: 22px 20px 16px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 253, 233, 0.15) transparent;
}

.v-ai__msg {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	transition: opacity 0.35s ease, transform 0.35s var(--v-ai-ease);
}

.v-ai__msg:not(.is-in):not(.v-ai__msg--intro) {
	opacity: 0;
	transform: translateY(8px);
}

.v-ai__bubble {
	min-width: 0;
	font-size: 15px;
	line-height: 1.45;
}

.v-ai__bubble p {
	margin: 0;
}

.v-ai__bubble p + p,
.v-ai__bubble p + .v-ai__chips {
	margin-top: 10px;
}

.v-ai__msg--ai .v-ai__bubble {
	padding-top: 2px;
}

.v-ai__msg--user {
	justify-content: flex-end;
}

.v-ai__msg--user .v-ai__bubble {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 16px 16px 4px 16px;
	background: var(--wp--preset--color--yellow);
	color: var(--wp--preset--color--black);
}

.v-ai__try {
	font-family: var(--wp--preset--font-family--geist-mono);
	font-size: 11px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--wp--preset--color--grey);
}

.v-ai__bubble.is-used .v-ai__chips--start {
	opacity: 0.55;
}

@keyframes v-ai-fade { from { opacity: 0; } to { opacity: 1; } }

/* Chips (starters and follow-ups) */
.v-ai__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.v-ai__chips--next {
	padding: 0 20px;
}

.v-ai__chips--next:not(:empty) {
	padding-bottom: 12px;
}

.v-ai__chip {
	padding: 8px 13px;
	border: 1px solid rgba(255, 253, 233, 0.22);
	border-radius: var(--v-radius-pill);
	background: transparent;
	font-size: 13px !important;
	line-height: 1.2;
	text-align: left;
	transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease, opacity 0.3s ease;
}

.v-ai__chips:not(.is-in) .v-ai__chip {
	opacity: 0;
}

.v-ai__chips.is-in .v-ai__chip {
	animation: v-ai-rise-sm 0.35s calc(var(--i, 0) * 60ms) var(--v-ai-ease, ease) both;
}

@keyframes v-ai-rise-sm {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

@media (hover: hover) and (pointer: fine) {
	.v-ai__chip:hover {
		border-color: var(--wp--preset--color--yellow);
		background: rgba(233, 242, 146, 0.08);
	}
}

.v-ai__chip:active {
	transform: scale(0.97);
}

.v-ai__app {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 12px;
	padding: 9px 14px;
	border-radius: var(--v-radius-pill);
	background: var(--wp--preset--color--yellow);
	font-size: 14px;
	font-weight: 500;
	color: var(--wp--preset--color--black) !important;
	text-decoration: none !important;
	transition: background-color 0.2s ease;
}

.v-ai__app--quiet {
	padding: 0;
	background: none;
	color: var(--wp--preset--color--yellow) !important;
}

.v-ai__app svg {
	width: 16px;
	height: 16px;
	transition: transform 0.25s var(--v-ai-ease);
}

@media (hover: hover) and (pointer: fine) {
	.v-ai__app:hover svg {
		transform: translateX(3px);
	}

	.v-ai__app:not(.v-ai__app--quiet):hover {
		background: #dbe389;
	}
}

/* Input */
.v-ai__form {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 54px;
	margin: 0 16px 16px;
	padding: 0 6px 0 18px;
	border: 1px solid rgba(255, 253, 233, 0.14);
	border-radius: var(--v-radius-pill);
	background: var(--v-ai-fill);
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

.v-ai__form:focus-within {
	border-color: var(--wp--preset--color--yellow);
	background: rgba(255, 249, 229, 0.07);
}

.v-ai__input {
	flex: 1;
	min-width: 0;
	height: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	font: inherit;
	font-size: 15px;
	color: var(--wp--preset--color--cream);
	outline: none;
}

.v-ai__window .v-ai__input:focus-visible {
	outline: none;
}

.v-ai__input::placeholder {
	color: rgba(255, 253, 233, 0.4);
}

.v-ai__send {
	display: grid;
	place-items: center;
	flex: none;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--yellow);
	color: var(--wp--preset--color--black) !important;
	transition: transform 0.1s ease, background-color 0.2s ease;
}

.v-ai__send svg {
	width: 20px;
	height: 20px;
}

@media (hover: hover) and (pointer: fine) {
	.v-ai__send:hover {
		background: #dbe389;
	}
}

.v-ai__send:active {
	transform: scale(0.94);
}

/* ------------------------------------------------------------------ */
/* Results                                                              */
/* ------------------------------------------------------------------ */

.v-ai__results {
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
	container: v-ai-results / inline-size;
}

.v-ai__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	min-height: 62px;
	padding: 14px 20px;
	border-bottom: 1px solid var(--v-ai-line);
}

.v-ai__count {
	margin: 0;
	font-size: 14px;
	color: var(--wp--preset--color--text-secondary);
}

.v-ai__stage {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

@keyframes v-ai-shimmer {
	from { background-position: 100% 0; }
	to   { background-position: 0 0; }
}


/* ------------------------------------------------------------------ */
/* The brief Riley fills in (Nov 13: replaces the sample listings)      */
/* ------------------------------------------------------------------ */

.v-ai__status {
	margin: 0 0 0 auto;
	font-family: var(--wp--preset--font-family--geist-mono);
	font-size: 11px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--wp--preset--color--grey);
	transition: color 0.3s ease;
}

.v-ai__status.is-ready {
	color: var(--wp--preset--color--yellow);
}

.v-ai__status.is-ready::before {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-right: 8px;
	border-radius: 50%;
	background: currentColor;
	vertical-align: 1px;
}

.v-ai__brief {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 22px;
	min-height: 0;
	padding: 18px 20px 20px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 253, 233, 0.15) transparent;
}

.v-ai__fields {
	margin: 0;
	padding: 2px 16px;
	border-radius: 14px;
	background: var(--v-ai-fill);
}

.v-ai__field {
	position: relative;
	display: grid;
	grid-template-columns: 116px minmax(0, 1fr);
	gap: 12px;
	align-items: baseline;
	padding: 13px 0;
	border-top: 1px solid var(--v-ai-line);
}

.v-ai__field:first-child {
	border-top: 0;
}

.v-ai__field dt {
	font-family: var(--wp--preset--font-family--geist-mono);
	font-size: 11px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--wp--preset--color--grey);
	transition: color 0.3s ease;
}

.v-ai__field dd {
	min-width: 0;
	margin: 0;
	font-size: 15px;
	line-height: 1.35;
	color: var(--wp--preset--color--cream);
}

.v-ai__empty {
	display: inline-block;
	width: 64%;
	max-width: 160px;
	height: 10px;
	border-radius: 5px;
	vertical-align: middle;
	background: linear-gradient(100deg, rgba(255, 249, 229, 0.05) 30%, rgba(255, 249, 229, 0.11) 50%, rgba(255, 249, 229, 0.05) 70%) 0 0 / 300% 100%;
}

@media (prefers-reduced-motion: no-preference) {
	.v-ai__empty {
		animation: v-ai-shimmer 1.6s linear infinite;
	}

	.v-ai__field.is-new dd {
		animation: v-ai-set 0.7s var(--v-ai-ease) both;
	}
}

/* Wide pane (desktop): the brief and "what happens next" side by side */
@container v-ai-results (min-width: 640px) {
	.v-ai__brief {
		display: grid;
		grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
		align-items: start;
		gap: 32px;
		padding: 28px 28px 28px;
	}

	.v-ai__after {
		padding-top: 6px;
	}
}

.v-ai__optional {
	font-size: 14px;
	color: var(--wp--preset--color--grey);
}

/* The line Riley is asking about */
.v-ai__field.is-asking dt {
	color: var(--wp--preset--color--yellow);
}

.v-ai__field.is-asking::before {
	content: "";
	position: absolute;
	top: 13px;
	bottom: 13px;
	left: -16px;
	width: 2px;
	border-radius: 2px;
	background: var(--wp--preset--color--yellow);
}

@keyframes v-ai-set {
	from { opacity: 0; transform: translateY(5px); color: var(--wp--preset--color--yellow); }
	to   { opacity: 1; transform: none; }
}

.v-ai__label {
	margin: 0 0 12px;
	font-family: var(--wp--preset--font-family--geist-mono);
	font-size: 11px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--wp--preset--color--grey);
}

.v-ai__steps {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: v-ai-step;
}

.v-ai__steps li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 14px;
	line-height: 1.4;
	color: var(--wp--preset--color--text-secondary);
	counter-increment: v-ai-step;
}

.v-ai__steps li::before {
	content: counter(v-ai-step);
	flex: none;
	display: grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border: 1px solid rgba(255, 253, 233, 0.16);
	border-radius: 50%;
	font-family: var(--wp--preset--font-family--geist-mono);
	font-size: 10px;
	color: var(--wp--preset--color--grey);
}

.v-ai__app--brief {
	margin-top: 18px;
}

.v-ai__window .v-ai__app[hidden] {
	display: none;
}

.v-ai__note {
	max-width: 1240px;
	margin: 16px auto 0 !important;
	font-size: 13px;
	text-align: center;
	color: var(--wp--preset--color--grey);
}

/* The feature cards follow the preview on this page: less top padding. */
.v-intel + .v-features {
	padding-top: 40px;
}

/* ------------------------------------------------------------------ */
/* Tablets and phones: chat on top, the brief below                    */
/* ------------------------------------------------------------------ */

@media (max-width: 1023px) {
	.v-intel {
		padding-top: 150px;
	}

	.v-ai {
		margin-top: 48px !important;
	}

	.v-ai__body {
		grid-template-columns: minmax(0, 1fr);
		height: auto;
	}

	.v-ai__chat {
		height: 440px;
		border-right: 0;
		border-bottom: 1px solid var(--v-ai-line);
	}
}

@media (max-width: 767px) {
	.v-intel {
		padding-top: 128px;
	}

	.v-intel::before {
		top: 420px;
	}

	.v-intel__intro {
		padding: 0 20px;
	}

	.v-ai {
		margin-top: 36px !important;
		padding: 0 12px;
	}

	.v-ai__window {
		border-radius: 16px;
	}

	.v-ai__top {
		padding: 0 14px;
	}

	.v-ai__badge {
		font-size: 10px;
		padding: 3px 8px;
	}

	.v-ai__role {
		display: none; /* the note under the window says it in full */
	}

	.v-ai__chat {
		height: 540px;
	}

	.v-ai__log {
		padding: 18px 14px 12px;
	}

	.v-ai__chips--next {
		padding: 0 14px;
	}

	.v-ai__form {
		margin: 0 10px 10px;
	}

	.v-ai__input {
		font-size: 16px; /* stops iOS zooming in */
	}

	.v-ai__head {
		padding: 12px 14px;
	}


	.v-ai__note {
		padding: 0 8px;
	}
}

/* ------------------------------------------------------------------ */
/* Feature cards: a sideways row the visitor scrolls (arrows / drag)   */
/* ------------------------------------------------------------------ */

.v-features--row .v-features__intro {
	position: relative;
}

.v-rownav {
	position: absolute;
	right: var(--v-edge);
	bottom: 0;
	display: flex;
	gap: 10px;
}

.v-rownav__btn {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1px solid rgba(255, 253, 233, 0.3);
	border-radius: 50%;
	background: transparent;
	color: var(--wp--preset--color--cream);
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease, transform 0.1s ease;
}

.v-rownav__btn svg {
	width: 20px;
	height: 20px;
}

.v-rownav__btn:disabled {
	opacity: 0.3;
	cursor: default;
}

.v-rownav__btn:focus-visible {
	outline: 2px solid var(--wp--preset--color--yellow);
	outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
	.v-rownav__btn:not(:disabled):hover {
		border-color: var(--wp--preset--color--yellow);
		background: var(--wp--preset--color--yellow);
		color: var(--wp--preset--color--black);
	}

	.v-features--row .v-features__track {
		cursor: grab;
	}
}

.v-rownav__btn:not(:disabled):active {
	transform: scale(0.94);
}

.v-features--row .v-features__track.is-dragging {
	cursor: grabbing;
	scroll-snap-type: none;
	user-select: none;
}

.v-features--row .v-features__track.is-dragging * {
	pointer-events: none;
}

/* Phones swipe; the arrows would crowd the heading. */
@media (max-width: 767px) {
	.v-rownav {
		display: none;
	}
}

/* Intelligence page: the features heading and card row sit on the page's
   centre line, like the intro and the Riley window above (Oct 19). On wide
   screens where all five cards fit, the row is centred and the arrows hide;
   when it doesn't fit, it starts at the content edge and scrolls. */
.v-features--row .v-features__intro {
	text-align: center;
}

.v-features--row .v-eyebrow {
	justify-content: center;
}

.v-features--row .v-features__lede {
	margin-inline: auto !important;
}

.v-features--row.is-fits .v-features__track {
	justify-content: center;
	padding-inline: 40px;
}

.v-features--row.is-fits .v-rownav {
	display: none;
}

/* Arrows under the centred heading rather than off to the side. */
.v-features--row .v-rownav {
	position: static;
	justify-content: center;
	margin-top: 24px;
}

/* Nov 17 (by request): on desktop the feature cards sit in a centred window that shows three whole cards (two below 1280px), lined up with the centred heading and arrows, instead of starting at the left edge and running off the right. Arrows and drag still move the row card by card. */
@media (min-width: 1024px) {
	.v-features.v-features--row > .v-features__track {
		box-sizing: border-box;
		width: min(1256px, calc(100% - 80px));
		margin: 30px auto -20px !important;
		padding-inline: 0;
		scroll-padding-left: 0;
	}

	.v-features--row .v-features__track > .v-feat {
		width: calc((100% - 56px) / 3);
	}
}

@media (min-width: 1024px) and (max-width: 1279px) {
	.v-features.v-features--row > .v-features__track {
		width: min(828px, calc(100% - 80px));
	}

	.v-features--row .v-features__track > .v-feat {
		width: calc((100% - 28px) / 2);
	}
}
