/*
 * Prompt Engine — Post-purchase landing page styles.
 *
 * Loaded on top of vstack.css for the guest gate (templates/guest.php).
 * Every selector is namespaced .pe-land__* so it never collides with the
 * existing .vstack-gate__* gate styles. Header (nav), modal layer, and
 * footer all stay on the original gate styles — only the inner <main>
 * content uses these rules.
 *
 * Design notes
 * ------------
 *   - Section rhythm follows the same vertical scale as the dashboard
 *     (`clamp(3rem, 6vw, 5rem)` between sections).
 *   - Color is driven by per-section accent variables so a whitelabel
 *     customer's primary color flows through automatically once
 *     `inject_brand_styles()` rewrites `--pe-brand-primary*`.
 *   - All animations honor `prefers-reduced-motion`.
 */

/* ============ BASE / WRAPPERS =================================== */
.pe-land { position: relative; isolation: isolate; }

.pe-land__inner {
	position: relative;
	z-index: 1;
	padding-top: clamp(2rem, 5vw, 3.5rem);
	padding-bottom: clamp(3rem, 6vw, 5rem);
	display: flex;
	flex-direction: column;
	gap: clamp(3rem, 6vw, 5rem);
}

/* ============ ANIMATED BACKGROUND ================================ */
.pe-land__bg {
	position: absolute;
	inset: 0;
	overflow: hidden;
	z-index: 0;
	pointer-events: none;
}
.pe-land__orb {
	position: absolute;
	border-radius: 50%;
	filter: blur(90px);
	opacity: 0.42;
	animation: peLandOrbFloat 18s ease-in-out infinite alternate;
	will-change: transform;
}
.pe-land__orb--1 {
	width: 480px; height: 480px; top: -120px; left: -100px;
	background: radial-gradient(circle, var(--pe-brand-primary, #6366f1) 0%, transparent 70%);
}
.pe-land__orb--2 {
	width: 560px; height: 560px; top: 28%; right: -180px;
	background: radial-gradient(circle, #14b8a6 0%, transparent 70%);
	animation-delay: -6s;
}
.pe-land__orb--3 {
	width: 420px; height: 420px; bottom: -120px; left: 30%;
	background: radial-gradient(circle, #a855f7 0%, transparent 70%);
	animation-delay: -12s;
}
.pe-land__grid {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(99, 102, 241, 0.05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
	background-size: 60px 60px;
	-webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, #000 0%, transparent 80%);
	mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, #000 0%, transparent 80%);
}

@keyframes peLandOrbFloat {
	0%   { transform: translate(0, 0) scale(1); }
	100% { transform: translate(60px, -40px) scale(1.1); }
}

/* ============ SECTION HEADS ===================================== */
.pe-land__sec-head {
	text-align: center;
	max-width: 720px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}
.pe-land__sec-eyebrow {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--vstack-muted, #94a3b8);
	margin: 0;
}
.pe-land__sec-title {
	font-family: var(--vstack-font-display, 'Inter', system-ui, sans-serif);
	font-size: clamp(1.6rem, 3vw, 2.4rem);
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--vstack-ink, #f1f5f9);
	margin: 0;
	line-height: 1.15;
}
.pe-land__sec-lede {
	font-size: 1rem;
	color: var(--vstack-muted, #94a3b8);
	line-height: 1.6;
	margin: 0;
}

/* ============ HERO ============================================== */
.pe-land__hero {
	position: relative;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.2rem;
	padding: clamp(1rem, 3vw, 2rem) 1rem 0;
}
.pe-land__chip {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.42rem 0.95rem;
	border-radius: 999px;
	background: rgba(99, 102, 241, 0.14);
	border: 1px solid rgba(99, 102, 241, 0.32);
	color: #c7d2fe;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}
.pe-land__chip-dot {
	width: 8px; height: 8px;
	border-radius: 50%;
	background: #818cf8;
	animation: peLandPulse 1.8s ease-out infinite;
}
@keyframes peLandPulse {
	0%   { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0.55); }
	70%  { box-shadow: 0 0 0 14px rgba(129, 140, 248, 0); }
	100% { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0); }
}

.pe-land__h1 {
	font-family: var(--vstack-font-display, 'Inter', system-ui, sans-serif);
	font-size: clamp(2.2rem, 5.5vw, 3.6rem);
	line-height: 1.05;
	letter-spacing: -0.03em;
	font-weight: 800;
	color: var(--vstack-ink, #f8fafc);
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	max-width: 920px;
}
.pe-land__h1-grad {
	background: linear-gradient(110deg, var(--pe-brand-primary, #6366f1) 0%, #a855f7 50%, #14b8a6 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.pe-land__lede {
	font-size: clamp(1rem, 1.5vw, 1.1rem);
	line-height: 1.65;
	color: #cbd5e1;
	max-width: 640px;
	margin: 0;
}

.pe-land__hero-cta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	justify-content: center;
	margin-top: 0.4rem;
}

.pe-land__btn {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.18rem;
	padding: 0.85rem 1.7rem;
	min-width: 220px;
	border-radius: 14px;
	font-family: inherit;
	font-weight: 700;
	font-size: 0.95rem;
	letter-spacing: -0.01em;
	cursor: pointer;
	border: 1px solid transparent;
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, filter 0.18s ease;
}
.pe-land__btn-sub {
	font-size: 0.72rem;
	font-weight: 500;
	opacity: 0.88;
	letter-spacing: 0;
}
.pe-land__btn--primary {
	background: linear-gradient(135deg, var(--pe-brand-primary, #6366f1) 0%, #14b8a6 100%);
	color: #fff;
	box-shadow: 0 12px 32px -10px rgba(99, 102, 241, 0.55);
}
.pe-land__btn--primary:hover,
.pe-land__btn--primary:focus-visible {
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 18px 38px -10px rgba(99, 102, 241, 0.7);
	filter: brightness(1.06);
	outline: none;
}
.pe-land__btn--ghost {
	background: rgba(255, 255, 255, 0.04);
	color: #f1f5f9;
	border-color: rgba(255, 255, 255, 0.16);
}
.pe-land__btn--ghost:hover,
.pe-land__btn--ghost:focus-visible {
	background: rgba(255, 255, 255, 0.09);
	border-color: rgba(255, 255, 255, 0.28);
	transform: translateY(-2px);
	color: #fff;
	outline: none;
}

.pe-land__trust,
.pe-land__notice {
	font-size: 0.85rem;
	border-radius: 12px;
	padding: 0.7rem 1.1rem;
	max-width: 560px;
	line-height: 1.5;
	margin: 0;
}
.pe-land__trust {
	color: #cbd5e1;
	background: rgba(15, 23, 42, 0.6);
	border: 1px solid rgba(255, 255, 255, 0.08);
}
.pe-land__trust strong { color: #f1f5f9; font-weight: 700; }
.pe-land__notice {
	color: #fda4af;
	background: rgba(244, 63, 94, 0.08);
	border: 1px solid rgba(244, 63, 94, 0.24);
}

/* ============ ENGINES (3 cards) ================================= */
.pe-land__engine-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.25rem;
}
@media (max-width: 980px) { .pe-land__engine-grid { grid-template-columns: 1fr; } }

.pe-land__engine {
	position: relative;
	padding: 1.65rem 1.45rem 1.55rem;
	border-radius: 18px;
	background: linear-gradient(180deg, rgba(15, 23, 42, 0.78) 0%, rgba(15, 23, 42, 0.55) 100%);
	border: 1px solid rgba(255, 255, 255, 0.08);
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	overflow: hidden;
	isolation: isolate;
	transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.pe-land__engine::after {
	content: "";
	position: absolute;
	inset: -1px;
	border-radius: 19px;
	padding: 1px;
	background: var(--peLandEngineGrad, linear-gradient(135deg, #6366f1, #14b8a6));
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	opacity: 0.32;
	pointer-events: none;
	z-index: -1;
}
.pe-land__engine:hover {
	transform: translateY(-4px);
	box-shadow: 0 20px 40px -16px var(--peLandEngineShadow, rgba(99, 102, 241, 0.4));
}
.pe-land__engine:hover::after { opacity: 0.7; }

.pe-land__engine--vstack { --peLandEngineGrad: linear-gradient(135deg, #6366f1, #a855f7); --peLandEngineShadow: rgba(99,102,241,0.45); }
.pe-land__engine--mot    { --peLandEngineGrad: linear-gradient(135deg, #14b8a6, #06b6d4); --peLandEngineShadow: rgba(20,184,166,0.45); }
.pe-land__engine--edac   { --peLandEngineGrad: linear-gradient(135deg, #a855f7, #ec4899); --peLandEngineShadow: rgba(168,85,247,0.45); }

.pe-land__engine-num {
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.18em;
	color: #94a3b8;
}
.pe-land__engine-icon {
	display: inline-grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border-radius: 12px;
	background: var(--peLandEngineGrad, linear-gradient(135deg, #6366f1, #14b8a6));
	color: #fff;
	box-shadow: 0 8px 20px -10px var(--peLandEngineShadow, rgba(99, 102, 241, 0.45));
	margin-bottom: 0.2rem;
}
.pe-land__engine-icon svg { display: block; }
.pe-land__engine-title {
	font-family: var(--vstack-font-display, 'Inter', system-ui, sans-serif);
	font-size: 1.12rem;
	font-weight: 700;
	margin: 0;
	color: var(--vstack-ink, #f8fafc);
	letter-spacing: -0.01em;
}
.pe-land__engine-text {
	font-size: 0.92rem;
	color: #cbd5e1;
	line-height: 1.6;
	margin: 0;
}
.pe-land__engine-list {
	list-style: none;
	margin: 0.4rem 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.42rem;
}
.pe-land__engine-list li {
	position: relative;
	padding-left: 1.25rem;
	font-size: 0.85rem;
	color: #e2e8f0;
	line-height: 1.45;
}
.pe-land__engine-list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.45rem;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--peLandEngineGrad, linear-gradient(135deg, #6366f1, #14b8a6));
}

/* ============ FOUR STEPS ======================================== */
.pe-land__steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1rem;
}
@media (max-width: 980px) { .pe-land__steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .pe-land__steps { grid-template-columns: 1fr; } }

.pe-land__step {
	position: relative;
	padding: 1.4rem 1.2rem 1.2rem;
	border-radius: 14px;
	background: rgba(15, 23, 42, 0.62);
	border: 1px solid rgba(255, 255, 255, 0.07);
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.pe-land__step-num {
	display: inline-grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--pe-brand-primary, #6366f1), #14b8a6);
	color: #fff;
	font-weight: 800;
	font-size: 1rem;
	box-shadow: 0 6px 16px -8px rgba(99, 102, 241, 0.5);
}
.pe-land__step h3 {
	font-size: 1rem;
	font-weight: 700;
	margin: 0;
	color: var(--vstack-ink, #f1f5f9);
}
.pe-land__step p {
	font-size: 0.88rem;
	color: #cbd5e1;
	line-height: 1.55;
	margin: 0;
}

/* ============ FEATURE GRID ======================================
 * 8 feature tiles laid out as a balanced 4×2 / 2×4 / 1× grid. The
 * 3-column layout is intentionally skipped because it would leave
 * an awkward 3+3+2 last row with eight cards. */
.pe-land__feat-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1rem;
}
@media (max-width: 1180px) { .pe-land__feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px)  { .pe-land__feat-grid { grid-template-columns: 1fr; } }

.pe-land__feat {
	position: relative;
	padding: 1.35rem 1.2rem;
	border-radius: 14px;
	background: rgba(15, 23, 42, 0.55);
	border: 1px solid rgba(255, 255, 255, 0.07);
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.pe-land__feat:hover {
	transform: translateY(-3px);
	border-color: var(--peLandFeatColor, rgba(99, 102, 241, 0.45));
	box-shadow: 0 14px 30px -14px var(--peLandFeatColor, rgba(99, 102, 241, 0.45));
}
.pe-land__feat-icon {
	display: inline-grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: color-mix(in srgb, var(--peLandFeatColor, #6366f1) 18%, transparent);
	color: var(--peLandFeatColor, #6366f1);
}
.pe-land__feat-icon svg { display: block; }
.pe-land__feat h3 {
	font-family: var(--vstack-font-display, 'Inter', system-ui, sans-serif);
	font-size: 1rem;
	font-weight: 700;
	margin: 0;
	color: var(--vstack-ink, #f1f5f9);
	letter-spacing: -0.01em;
}
.pe-land__feat p {
	font-size: 0.86rem;
	color: #cbd5e1;
	line-height: 1.55;
	margin: 0;
}

.pe-land__feat--hub          { --peLandFeatColor: #6366f1; }
.pe-land__feat--templates    { --peLandFeatColor: #f59e0b; }
.pe-land__feat--kb           { --peLandFeatColor: #ec4899; }
.pe-land__feat--leads        { --peLandFeatColor: #10b981; }
.pe-land__feat--agency       { --peLandFeatColor: #8b5cf6; }
.pe-land__feat--whitelabel   { --peLandFeatColor: #a855f7; }
.pe-land__feat--integrations { --peLandFeatColor: #06b6d4; }
.pe-land__feat--theme        { --peLandFeatColor: #38bdf8; }
.pe-land__feat--support      { --peLandFeatColor: #ef4444; }

/* ============ FINAL CTA ========================================= */
.pe-land__finalcta {
	position: relative;
	text-align: center;
	padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2.5rem);
	border-radius: 22px;
	background:
		radial-gradient(ellipse 60% 100% at 50% 0%, rgba(99, 102, 241, 0.22) 0%, transparent 70%),
		linear-gradient(180deg, rgba(15, 23, 42, 0.85) 0%, rgba(15, 23, 42, 0.6) 100%);
	border: 1px solid rgba(255, 255, 255, 0.08);
	display: flex;
	flex-direction: column;
	gap: 1rem;
	align-items: center;
	overflow: hidden;
}
.pe-land__finalcta::before {
	content: "";
	position: absolute;
	inset: -1px;
	border-radius: 23px;
	padding: 1px;
	background: linear-gradient(135deg, rgba(99, 102, 241, 0.5) 0%, rgba(168, 85, 247, 0.4) 50%, rgba(20, 184, 166, 0.5) 100%);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	opacity: 0.65;
	pointer-events: none;
}
.pe-land__finalcta-title {
	font-family: var(--vstack-font-display, 'Inter', system-ui, sans-serif);
	font-size: clamp(1.6rem, 3.5vw, 2.4rem);
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--vstack-ink, #f8fafc);
	margin: 0;
}
.pe-land__finalcta-lede {
	font-size: 1rem;
	color: #cbd5e1;
	line-height: 1.6;
	margin: 0;
	max-width: 540px;
}

/* ============ LIGHT-MODE FRIENDLINESS ==========================
 * The plugin's inner pages use [data-pe-theme="light"] to flip into
 * a white-surface theme. The gate inherits that the moment a user
 * is logged in on the platform, and some whitelabel customers force
 * light mode globally. Override the dark surfaces here so the
 * landing page is readable in either theme. */

[data-pe-theme="light"] .pe-land__hero,
[data-pe-theme="light"] .pe-land__sec-title,
[data-pe-theme="light"] .pe-land__engine-title,
[data-pe-theme="light"] .pe-land__step h3,
[data-pe-theme="light"] .pe-land__feat h3,
[data-pe-theme="light"] .pe-land__finalcta-title,
[data-pe-theme="light"] .pe-land__h1 {
	color: #0f172a;
}
[data-pe-theme="light"] .pe-land__lede,
[data-pe-theme="light"] .pe-land__sec-lede,
[data-pe-theme="light"] .pe-land__engine-text,
[data-pe-theme="light"] .pe-land__step p,
[data-pe-theme="light"] .pe-land__feat p,
[data-pe-theme="light"] .pe-land__finalcta-lede,
[data-pe-theme="light"] .pe-land__engine-list li {
	color: #475569;
}
[data-pe-theme="light"] .pe-land__engine,
[data-pe-theme="light"] .pe-land__step,
[data-pe-theme="light"] .pe-land__feat,
[data-pe-theme="light"] .pe-land__trust {
	background: #ffffff;
	border-color: rgba(15, 23, 42, 0.08);
	color: #0f172a;
}
[data-pe-theme="light"] .pe-land__finalcta {
	background:
		radial-gradient(ellipse 60% 100% at 50% 0%, rgba(99, 102, 241, 0.16) 0%, transparent 70%),
		#ffffff;
	border-color: rgba(15, 23, 42, 0.08);
}
[data-pe-theme="light"] .pe-land__btn--ghost {
	background: #ffffff;
	color: #0f172a;
	border-color: rgba(15, 23, 42, 0.16);
}
[data-pe-theme="light"] .pe-land__btn--ghost:hover,
[data-pe-theme="light"] .pe-land__btn--ghost:focus-visible {
	background: #f8fafc;
	border-color: rgba(15, 23, 42, 0.32);
	color: #0f172a;
}
[data-pe-theme="light"] .pe-land__chip {
	background: rgba(99, 102, 241, 0.10);
	color: #4338ca;
	border-color: rgba(99, 102, 241, 0.25);
}

/* ============ MODAL THEME-BLEED GUARDS ==========================
 * The login / register dialog's scrim and close-X are <button>
 * elements. Many WP themes ship broad rules like
 * `button { background: <theme-pink>; border: 1px solid <theme>; ... }`
 * that override our modal styling — when the user hovers outside the
 * dialog they end up looking at a fullscreen pink scrim instead of
 * the intended translucent backdrop. This re-applies the canonical
 * vstack.css values with !important so no opinionated theme can
 * bleed through, regardless of domain (main host or whitelabel).
 *
 * Values mirror products/vstack/assets/vstack.css; !important is
 * the only addition so theme rules can't win on specificity. */
.vstack-gate__modal-layer { background: transparent !important; }
.vstack-gate__modal-scrim {
	background: rgba(7, 10, 16, 0.72) !important;
	border: 0 !important;
	box-shadow: none !important;
	color: transparent !important;
}
.vstack-gate__modal-sheet { background: #ffffff !important; }
.vstack-gate__modal-x {
	background: #f8fafc !important;
	color: #475569 !important;
	border: 1px solid #e2e8f0 !important;
	box-shadow: none !important;
}
.vstack-gate__modal-x:hover,
.vstack-gate__modal-x:focus-visible {
	background: #0f172a !important;
	border-color: #0f172a !important;
	color: #fff !important;
}

/* ============ REDUCED MOTION ==================================== */
@media (prefers-reduced-motion: reduce) {
	.pe-land__orb,
	.pe-land__chip-dot { animation: none !important; }
	.pe-land__btn:hover,
	.pe-land__engine:hover,
	.pe-land__feat:hover { transform: none !important; }
}
