/* --------------------------------------------------------------------------
   AI brief section — focal "ink band" wrapper.
   Tokens scoped to this section so descendant components (Display, Label,
   the brief card, etc.) inherit correct contrast without prop changes.
   -------------------------------------------------------------------------- */
.lwh-section--ai-demo {
	/* Band tokens — paper-derived warm dark surface. Single palette. */
	--ai-band-bg:     #15110B;
	--ai-band-fg:     #F4EEE0;
	--ai-band-line:   #2A2520;
	--ai-band-grid:   rgba(244, 238, 224, 0.045);
	--ai-band-glow:   rgba(255, 61, 127, 0.22);
	--ai-band-glow-2: rgba(255, 61, 127, 0.08);

	/* Rebind core tokens INSIDE the band so descendants pick up correct contrast.
	   Mute by blending fg toward the band bg (opaque) — not toward transparent —
	   so muted text doesn't pick up the grid/glow textures behind it and keeps
	   crisp AA/AAA contrast against the dark surface. */
	--bg:   var(--ai-band-bg);
	--bg-2: color-mix(in oklab, var(--ai-band-bg) 88%, var(--ai-band-fg) 4%);
	--fg:   var(--ai-band-fg);
	--fg-2: color-mix(in oklab, var(--ai-band-fg) 85%, var(--ai-band-bg));
	--fg-3: color-mix(in oklab, var(--ai-band-fg) 70%, var(--ai-band-bg));
	--line: var(--ai-band-line);

	padding: 110px 0 120px;
	position: relative;
	background: var(--ai-band-bg);
	color: var(--ai-band-fg);
	border-top: 1px solid var(--ai-band-line);
	border-bottom: 1px solid var(--ai-band-line);
	isolation: isolate;
}

/* Subtle grid texture so the band feels like its own surface */
.lwh-section--ai-demo::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image:
		linear-gradient(var(--ai-band-grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--ai-band-grid) 1px, transparent 1px);
	background-size: 56px 56px;
	mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 30%, transparent 90%);
	z-index: 0;
}

/* Soft accent corner glows */
.lwh-section--ai-demo::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		radial-gradient(ellipse 60% 50% at 75% 0%, var(--ai-band-glow), transparent 60%),
		radial-gradient(ellipse 50% 40% at 10% 100%, var(--ai-band-glow-2), transparent 60%);
	z-index: 0;
}

.lwh-section--ai-demo > .lwh-container,
.lwh-section--ai-demo > * { position: relative; z-index: 1; }

/* Heading + kicker */
.ai-brief--heading {
	margin-bottom: 44px;
	max-width: 1100px;
}

.ai-brief--display {
	margin-top: 16px;
	max-width: 900px;
}

.ai-brief--kicker {
	margin-top: 24px;
	display: flex;
	gap: 14px;
	align-items: flex-start;
	font-size: 15px;
	line-height: 1.55;
	color: var(--fg-2);
	max-width: 640px;
}

.ai-brief--kicker-arrow {
	font-family: var(--font-mono, monospace);
	font-size: 18px;
	line-height: 1;
	color: var(--accent);
	margin-top: 2px;
	animation: ai-demo-bounce 1.8s ease-in-out infinite;
}

@keyframes ai-demo-bounce {
	0%, 100% { transform: translateY(0);  opacity: 0.7; }
	50%      { transform: translateY(4px); opacity: 1;   }
}

@media (prefers-reduced-motion: reduce) {
	.ai-brief--kicker-arrow { animation: none; opacity: 1; }
}

/* Card — lifted off the dark band */
.lwh-ai-brief {
	border: 1px solid var(--line);
	background:
		linear-gradient(180deg,
			color-mix(in oklab, var(--ai-band-fg) 4%, transparent) 0%,
			transparent 40%),
		var(--bg-2);
	padding: 40px 44px 44px;
	border-radius: 2px;
	position: relative;
	overflow: hidden;
	box-shadow:
		0 1px 0 0 color-mix(in oklab, var(--ai-band-fg) 8%, transparent) inset,
		0 30px 60px -30px rgba(0, 0, 0, 0.6),
		0 80px 120px -60px color-mix(in oklab, var(--accent) 30%, transparent);
}

.lwh-ai-brief__scanline {
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 2px;
	background: linear-gradient(90deg, transparent, var(--accent), transparent);
	animation: sweep 1.2s ease-in-out infinite;
}

.lwh-ai-brief__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
}

.lwh-ai-brief__slug {
	font-family: var(--font-mono, monospace);
	font-size: 10px;
	color: var(--fg-3);
}

.lwh-ai-brief__status {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--font-mono, monospace);
	font-size: 10px;
	color: var(--fg-3);
	letter-spacing: 0.05em;
}

.lwh-ai-brief__status-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--accent);
	box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 60%, transparent);
	animation: lwh-ai-pulse 2s ease-out infinite;
}

.lwh-ai-brief__status.is-offline {
	color: var(--fg-3);
	opacity: 0.7;
}

.lwh-ai-brief__status.is-offline .lwh-ai-brief__status-dot {
	background: var(--fg-3);
	animation: none;
	box-shadow: none;
}

@keyframes lwh-ai-pulse {
	0%   { box-shadow: 0 0 0 0   color-mix(in oklab, var(--accent) 60%, transparent); }
	70%  { box-shadow: 0 0 0 8px color-mix(in oklab, var(--accent)  0%, transparent); }
	100% { box-shadow: 0 0 0 0   color-mix(in oklab, var(--accent)  0%, transparent); }
}

.lwh-ai-brief__title {
	font-family: 'Instrument Serif', serif;
	font-size: clamp(24px, 3vw, 32px);
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: var(--fg);
	margin-bottom: 16px;
	max-width: 620px;
	text-wrap: balance;
}

.lwh-ai-brief__pitch {
	font-size: 15px;
	color: var(--fg-2);
	margin-bottom: 28px;
	max-width: 620px;
	line-height: 1.5;
}

/* Form */
.lwh-ai-form {
	display: flex;
	gap: 10px;
	margin-bottom: 18px;
}

.lwh-ai-form__input {
	flex: 1;
	padding: 16px 18px;
	background: var(--bg);
	border: 1px solid transparent;
	color: var(--fg);
	font-family: var(--font-body, 'Inter', sans-serif);
	font-size: 15px;
	outline: none;
	border-radius: 2px;
	box-shadow:
		0 0 0 1.5px var(--accent),
		0 0 0 6px color-mix(in oklab, var(--accent) 25%, transparent);
	transition: box-shadow 0.2s ease;
}

.lwh-ai-form__input:focus {
	box-shadow:
		0 0 0 1.5px var(--ai-band-fg, var(--fg)),
		0 0 0 6px color-mix(in oklab, var(--ai-band-fg, var(--fg)) 25%, transparent);
}

/* Examples */
.lwh-ai-examples {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.lwh-ai-examples__heading {
	font-family: var(--font-mono, monospace);
	font-size: 11px;
	color: var(--fg-3);
	align-self: center;
	margin-right: 4px;
}

.lwh-ai-error {
	color: var(--accent);
	font-family: var(--font-mono, monospace);
	font-size: 13px;
	margin-top: 14px;
}

/* Loading state — pulsed scanline hint while waiting on the model */
.lwh-ai-brief.is-loading .lwh-ai-brief__scanline {
	animation-duration: 0.6s;
	opacity: 1;
}
.lwh-ai-brief .lwh-ai-brief__scanline {
	opacity: 0;
	transition: opacity 0.2s ease;
}
.lwh-ai-brief.is-loading .lwh-ai-form__input,
.lwh-ai-brief.is-loading button[type="submit"] {
	opacity: 0.6;
	pointer-events: none;
}

/* Output slot */
.lwh-ai-output {
	margin-top: 28px;
	padding-top: 28px;
	border-top: 1px solid var(--line);
	animation: fadeUp 0.5s ease;
}

.lwh-ai-output__row {
	display: grid;
	grid-template-columns: 160px 1fr;
	gap: 20px;
	margin-bottom: 24px;
	align-items: baseline;
}

.lwh-ai-output__row:last-of-type { margin-bottom: 0; }

.lwh-ai-output__angle {
	font-family: 'Instrument Serif', serif;
	font-size: 26px;
	line-height: 1.25;
	color: var(--fg);
	letter-spacing: -0.01em;
}

.lwh-ai-output__features {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.lwh-ai-output__feature {
	display: flex;
	gap: 14px;
	padding-bottom: 14px;
	border-bottom: 1px dashed var(--line);
}

.lwh-ai-output__feature:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.lwh-ai-output__feature-num {
	font-family: var(--font-mono, monospace);
	font-size: 11px;
	color: var(--accent);
	min-width: 20px;
}

.lwh-ai-output__feature-name {
	font-weight: 600;
	font-size: 15px;
	margin-bottom: 4px;
}

.lwh-ai-output__feature-desc {
	font-size: 13px;
	color: var(--fg-2);
}

.lwh-ai-output__timeline {
	font-family: var(--font-mono, monospace);
	font-size: 14px;
	color: var(--fg);
}

.lwh-ai-output__timeline-muted { color: var(--fg-3); }

.lwh-ai-output__footer {
	margin-top: 28px;
	display: flex;
	gap: 12px;
}

/* Responsive */
@media (max-width: 820px) {
	.lwh-section--ai-demo { padding-top: 72px !important; padding-bottom: 80px !important; }
	.lwh-ai-brief { padding: 28px 24px 32px; }
	.lwh-ai-form { flex-direction: column; gap: 12px; }
	.lwh-ai-form > * { width: 100%; }
	.lwh-ai-output__row { grid-template-columns: 1fr; gap: 12px; }
}
