/*
 * AI API Gateway — Glass Landing Page
 * Light mode is the default. Dark mode is opt-in through
 * [data-aiapi-home-theme="dark"].
 *
 * All visible UI copy is supplied by PHP translation functions.
 * Visual language: translucent glass surfaces, blur, soft depth and a
 * restrained violet -> blue -> cyan accent gradient used sparingly.
 */

.aiapi-home {
	--aiapih-bg: #f4f6fb;
	--aiapih-bg-soft: #eef1fa;
	--aiapih-surface: rgba(255, 255, 255, .60);
	--aiapih-surface-strong: rgba(255, 255, 255, .82);
	--aiapih-surface-solid: #ffffff;
	--aiapih-border: rgba(76, 90, 158, .14);
	--aiapih-border-strong: rgba(90, 99, 210, .26);
	--aiapih-text: #12152b;
	--aiapih-text-muted: #5b6178;
	--aiapih-text-faint: #8d92ab;

	--aiapih-accent-1: #6d5bf9;
	--aiapih-accent-2: #4d7bf3;
	--aiapih-accent-3: #22c7c0;
	--aiapih-gradient: linear-gradient(135deg, var(--aiapih-accent-1), var(--aiapih-accent-2) 55%, var(--aiapih-accent-3));

	--aiapih-primary: #5b63e6;
	--aiapih-primary-strong: #4247c4;
	--aiapih-primary-soft: rgba(91, 99, 230, .10);
	--aiapih-primary-glass: rgba(109, 91, 249, .16);
	--aiapih-success: #1fa97e;
	--aiapih-success-soft: rgba(31, 169, 126, .12);
	--aiapih-danger: #e2536a;

	--aiapih-radius-xl: 30px;
	--aiapih-radius-lg: 24px;
	--aiapih-radius: 18px;
	--aiapih-radius-sm: 12px;

	--aiapih-shadow-sm: 0 6px 20px rgba(30, 34, 78, .06);
	--aiapih-shadow-md: 0 18px 46px rgba(30, 34, 78, .10);
	--aiapih-shadow-lg: 0 34px 90px rgba(30, 34, 78, .15);
	--aiapih-glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .75), 0 18px 55px rgba(40, 46, 110, .10);

	--aiapih-container: 1180px;
	--aiapih-header-height: 76px;

	position: relative;
	min-height: 100vh;
	overflow-x: clip;
	background:
		radial-gradient(720px 420px at 12% -10%, rgba(109, 91, 249, .10), transparent 60%),
		radial-gradient(760px 460px at 100% 10%, rgba(34, 199, 192, .09), transparent 55%),
		var(--aiapih-bg);
	color: var(--aiapih-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Vazirmatn, Roboto, sans-serif;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

.aiapi-home[data-aiapi-home-theme="dark"] {
	--aiapih-bg: #0a0d16;
	--aiapih-bg-soft: #0f1320;
	--aiapih-surface: rgba(22, 26, 44, .62);
	--aiapih-surface-strong: rgba(26, 30, 50, .88);
	--aiapih-surface-solid: #171b2c;
	--aiapih-border: rgba(150, 158, 235, .14);
	--aiapih-border-strong: rgba(130, 140, 240, .30);
	--aiapih-text: #eef0fb;
	--aiapih-text-muted: #a5abc8;
	--aiapih-text-faint: #6c7292;

	--aiapih-primary: #5b63e6;
	--aiapih-primary-strong: #a7abfb;
	--aiapih-primary-soft: rgba(139, 144, 247, .14);
	--aiapih-primary-glass: rgba(139, 144, 247, .18);
	--aiapih-success: #4fcaa0;
	--aiapih-success-soft: rgba(79, 202, 160, .14);

	--aiapih-shadow-sm: 0 6px 20px rgba(0, 0, 0, .30);
	--aiapih-shadow-md: 0 18px 46px rgba(0, 0, 0, .38);
	--aiapih-shadow-lg: 0 34px 90px rgba(0, 0, 0, .46);
	--aiapih-glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 18px 55px rgba(0, 0, 0, .40);
}

.aiapi-home *,
.aiapi-home *::before,
.aiapi-home *::after { box-sizing: border-box; }

.aiapi-home img,
.aiapi-home svg { display: block; max-width: 100%; }

.aiapi-home a { color: inherit; text-decoration: none; }
.aiapi-home button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
.aiapi-home ul { margin: 0; padding: 0; list-style: none; }
.aiapi-home h1, .aiapi-home h2, .aiapi-home h3, .aiapi-home p { margin: 0; }
.aiapi-home ::selection { background: var(--aiapih-primary-soft); color: var(--aiapih-primary-strong); }

[dir="rtl"] .aiapi-home {
	font-family: Vazirmatn, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.aiapih-container {
	width: min(var(--aiapih-container), calc(100% - 48px));
	margin-inline: auto;
}

.aiapih-section { padding: 100px 24px; }

.aiapih-section-head {
	width: min(700px, 100%);
	margin: 0 auto 46px;
	text-align: center;
}

.aiapih-eyebrow,
.aiapih-section-kicker {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--aiapih-primary-strong);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.aiapih-section-head h2 {
	margin: 10px 0 12px;
	font-size: clamp(28px, 3.6vw, 42px);
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -.01em;
}

.aiapih-section-head p {
	color: var(--aiapih-text-muted);
	font-size: 16px;
	line-height: 1.7;
}

/* ---------- Glass building blocks ---------- */

.aiapih-glass {
	background: var(--aiapih-surface);
	border: 1px solid var(--aiapih-border);
	border-radius: var(--aiapih-radius-lg);
	backdrop-filter: blur(22px) saturate(150%);
	-webkit-backdrop-filter: blur(22px) saturate(150%);
	box-shadow: var(--aiapih-glass-shadow);
}

/* ---------- Buttons ---------- */

.aiapih-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 20px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
	border: 1px solid transparent;
	transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.aiapih-btn svg { width: 15px; height: 15px; }

.aiapih-btn-primary {
	color: #fff !important;
    background: var(--aiapih-primary) !important;
    box-shadow: 0 10px 28px rgba(91, 99, 230, .30);
}

.aiapih-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(91, 99, 230, .38); }
.aiapih-btn-primary:active { transform: translateY(0); }

.aiapih-btn-ghost {
	color: var(--aiapih-text);
	background: var(--aiapih-surface);
	border-color: var(--aiapih-border);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
}

.aiapih-btn-ghost:hover { border-color: var(--aiapih-border-strong); transform: translateY(-2px); }

.aiapih-btn-lg { padding: 14px 26px; font-size: 15px; }
.aiapih-btn-block { width: 100%; }

.aiapih-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--aiapih-surface);
	border: 1px solid var(--aiapih-border);
	color: var(--aiapih-text-muted);
	transition: background .18s ease, color .18s ease, transform .18s ease;
}

.aiapih-icon-btn:hover { color: var(--aiapih-primary-strong); transform: translateY(-1px); }

/* ---------- Header ---------- */

.aiapih-nav-scrim {
	position: fixed;
	inset: 0;
	background: rgba(10, 12, 24, .45);
	backdrop-filter: blur(3px);
	opacity: 0;
	pointer-events: none;
	transition: opacity .25s ease;
	z-index: 60;
}

.aiapih-nav-scrim.is-open { opacity: 1; pointer-events: auto; }

.aiapih-header {
	position: sticky;
	top: 0;
	z-index: 70;
	padding: 16px 24px;
	transition: padding .25s ease;
}

.aiapih-header-inner {
	max-width: var(--aiapih-container);
	margin-inline: auto;
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 10px 16px 10px 20px;
	border-radius: 999px;
	background: var(--aiapih-surface);
	border: 1px solid var(--aiapih-border);
	backdrop-filter: blur(20px) saturate(160%);
	-webkit-backdrop-filter: blur(20px) saturate(160%);
	box-shadow: var(--aiapih-shadow-sm);
	transition: box-shadow .25s ease, background .25s ease;
}

.aiapih-header--scrolled .aiapih-header-inner {
	background: var(--aiapih-surface-strong);
	box-shadow: var(--aiapih-shadow-md);
}

.aiapih-logo {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	font-weight: 800;
	font-size: 16px;
	flex-shrink: 0;
}

.aiapih-logo-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 10px;
	color: #fff;
	background: transparent;
	box-shadow: none;
	overflow: hidden;
}

.aiapih-nav {
	display: flex;
	align-items: center;
	gap: 26px;
	margin-inline-start: 10px;
}

.aiapih-nav a {
	font-size: 14px;
	font-weight: 600;
	color: var(--aiapih-text-muted);
	transition: color .18s ease;
}

.aiapih-nav a:hover { color: var(--aiapih-text); }

.aiapih-header-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-inline-start: auto;
}

/* ---- Language dropdown ---- */
.aiapih-dropdown { position: relative; }

.aiapih-lang-trigger {
	width: auto;
	border-radius: 999px;
	padding: 0 14px 0 10px;
	gap: 6px;
	font-size: 12.5px;
	font-weight: 700;
}
.aiapih-lang-current { font-size: 12px; }

.aiapih-dropdown-panel {
	position: absolute;
	inset-inline-end: 0;
	top: calc(100% + 10px);
	min-width: 150px;
	padding: 6px;
	border-radius: var(--aiapih-radius-sm);
	background: var(--aiapih-surface-solid);
	border: 1px solid var(--aiapih-border);
	backdrop-filter: blur(20px) saturate(160%);
	-webkit-backdrop-filter: blur(20px) saturate(160%);
	box-shadow: var(--aiapih-shadow-lg);
	opacity: 0;
	transform: translateY(-6px) scale(.97);
	pointer-events: none;
	transition: opacity .16s ease, transform .16s ease;
	z-index: 80;
}

.aiapih-dropdown.is-open .aiapih-dropdown-panel {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.aiapih-dropdown-item {
	display: block;
	padding: 9px 12px;
	border-radius: var(--aiapih-radius-sm);
	font-size: 13px;
	font-weight: 600;
	color: var(--aiapih-text);
	transition: background .15s ease;
}
.aiapih-dropdown-item:hover { background: var(--aiapih-primary-soft); }
.aiapih-dropdown-item.is-active { color: var(--aiapih-primary); background: var(--aiapih-primary-soft); }

/* ---- Sign in | Sign up ---- */
.aiapih-auth-links { display: flex; align-items: center; gap: 10px; }

.aiapih-auth-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13.5px;
	font-weight: 700;
	color: var(--aiapih-text-muted);
	transition: color .15s ease;
}
.aiapih-auth-link:hover { color: var(--aiapih-text); }
.aiapih-auth-link svg { width: 15px; height: 15px; }

.aiapih-auth-sep { width: 1px; height: 16px; background: var(--aiapih-border); }

.aiapih-btn-sm { padding: 8px 16px; font-size: 13px; }

.aiapih-theme-icon-dark { display: none; }
.aiapi-home[data-aiapi-home-theme="dark"] .aiapih-theme-icon-light { display: none; }
.aiapi-home[data-aiapi-home-theme="dark"] .aiapih-theme-icon-dark { display: inline-flex; }

.aiapih-menu-toggle { display: none; }

.aiapih-burger { position: relative; display: inline-block; width: 18px; height: 13px; }
.aiapih-burger-bar {
	position: absolute;
	inset-inline-start: 0;
	width: 100%;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
	transition: transform .28s cubic-bezier(.4,0,.2,1), opacity .2s ease, top .28s ease;
}
.aiapih-burger-bar:nth-child(1) { top: 0; }
.aiapih-burger-bar:nth-child(2) { top: 5.5px; }
.aiapih-burger-bar:nth-child(3) { top: 11px; }

[data-aiapi-home-menu-toggle][aria-expanded="true"] .aiapih-burger-bar:nth-child(1) { top: 5.5px; transform: rotate(45deg); }
[data-aiapi-home-menu-toggle][aria-expanded="true"] .aiapih-burger-bar:nth-child(2) { opacity: 0; }
[data-aiapi-home-menu-toggle][aria-expanded="true"] .aiapih-burger-bar:nth-child(3) { top: 5.5px; transform: rotate(-45deg); }

/* User menu / logout dropdown */

.aiapih-user-menu { position: relative; }

.aiapih-user-caret { transition: transform .18s ease; }
.aiapih-user-menu.is-open .aiapih-user-caret { transform: rotate(180deg); }

.aiapih-user-dropdown {
	position: absolute;
	inset-inline-end: 0;
	top: calc(100% + 10px);
	min-width: 200px;
	padding: 8px;
	border-radius: var(--aiapih-radius);
	background: var(--aiapih-surface-solid);
	border: 1px solid var(--aiapih-border);
	backdrop-filter: blur(20px) saturate(160%);
	-webkit-backdrop-filter: blur(20px) saturate(160%);
	box-shadow: var(--aiapih-shadow-lg);
	opacity: 0;
	transform: translateY(-6px) scale(.97);
	pointer-events: none;
	transition: opacity .16s ease, transform .16s ease;
	z-index: 80;
}

.aiapih-user-menu.is-open .aiapih-user-dropdown {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.aiapih-user-dropdown a {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 10px 12px;
	border-radius: var(--aiapih-radius-sm);
	font-size: 13.5px;
	font-weight: 600;
	color: var(--aiapih-text);
	transition: background .15s ease;
}

.aiapih-user-dropdown a:hover { background: var(--aiapih-primary-soft); }
.aiapih-user-dropdown-danger { color: var(--aiapih-danger) !important; }
.aiapih-user-dropdown-danger:hover { background: rgba(226, 83, 106, .10) !important; }

.aiapih-user-dropdown-divider {
	height: 1px;
	margin: 6px 4px;
	background: var(--aiapih-border);
}

/* ---------- Reveal-on-scroll ---------- */

.aiapih-reveal {
	opacity: 0;
	transform: translateY(22px);
	transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1);
}

.aiapih-reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
	.aiapih-reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Hero ---------- */

.aiapih-hero { padding: 64px 24px 40px; }

.aiapih-hero-grid {
	max-width: var(--aiapih-container);
	margin-inline: auto;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 50px;
	align-items: center;
}

.aiapih-badge {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 14px;
	border-radius: 999px;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--aiapih-primary-strong);
	background: var(--aiapih-primary-glass);
	border: 1px solid var(--aiapih-border-strong);
	margin-bottom: 20px;
}

.aiapih-hero-copy h1 {
	font-size: clamp(34px, 4.6vw, 54px);
	font-weight: 800;
	line-height: 1.14;
	letter-spacing: -.02em;
}

.aiapih-hero-copy h1 span {
	display: block;
	background: var(--aiapih-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.aiapih-lead {
	margin-top: 20px;
	max-width: 520px;
	font-size: 16.5px;
	line-height: 1.75;
	color: var(--aiapih-text-muted);
}

.aiapih-hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 30px;
}

.aiapih-hero-trust {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	margin-top: 26px;
}

.aiapih-hero-trust span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--aiapih-text-faint);
}

.aiapih-hero-trust svg { color: var(--aiapih-success); }

/* Hero visual */

.aiapih-hero-visual { perspective: 1400px; }

.aiapih-hero-stage {
	position: relative;
	transform: rotateY(-8deg) rotateX(4deg);
	transform-style: preserve-3d;
	animation: aiapih-stage-float 7s ease-in-out infinite;
}

@keyframes aiapih-stage-float {
	0%, 100% { transform: rotateY(-8deg) rotateX(4deg) translateY(0); }
	50% { transform: rotateY(-5deg) rotateX(2deg) translateY(-10px); }
}

.aiapih-hero-card {
	position: relative;
	border-radius: var(--aiapih-radius-xl);
	background: var(--aiapih-surface-strong);
	border: 1px solid var(--aiapih-border);
	backdrop-filter: blur(24px) saturate(160%);
	-webkit-backdrop-filter: blur(24px) saturate(160%);
	box-shadow: var(--aiapih-shadow-lg);
	overflow: hidden;
}

.aiapih-hero-card-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 20px;
	border-bottom: 1px solid var(--aiapih-border);
	font-size: 12.5px;
	font-weight: 700;
	color: var(--aiapih-text-muted);
}

.aiapih-window-dots { display: flex; gap: 6px; }
.aiapih-window-dots i {
	width: 9px; height: 9px; border-radius: 50%;
	background: var(--aiapih-border-strong);
}

.aiapih-live {
	margin-inline-start: auto;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--aiapih-success);
}

.aiapih-live i {
	width: 7px; height: 7px; border-radius: 50%;
	background: var(--aiapih-success);
	box-shadow: 0 0 0 0 var(--aiapih-success-soft);
	animation: aiapih-pulse-dot 1.8s ease-out infinite;
}

@keyframes aiapih-pulse-dot {
	0% { box-shadow: 0 0 0 0 rgba(31, 169, 126, .45); }
	100% { box-shadow: 0 0 0 9px rgba(31, 169, 126, 0); }
}

body {
    margin: 0;
}

.aiapih-hero-card-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }

.aiapih-api-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 11px 14px;
	border-radius: var(--aiapih-radius-sm);
	background: var(--aiapih-primary-soft);
	border: 1px solid var(--aiapih-border);
	font-size: 12.5px;
}

.aiapih-method {
	padding: 3px 8px;
	border-radius: 6px;
	font-weight: 800;
	font-size: 11px;
	color: #fff;
	background: var(--aiapih-accent-2);
}

.aiapih-api-row code { flex: 1; font-family: ui-monospace, monospace; color: var(--aiapih-text); }
.aiapih-status { font-weight: 700; color: var(--aiapih-success); }

.aiapih-code-panel {
	display: flex;
	flex-direction: column;
	gap: 9px;
	padding: 14px;
	border-radius: var(--aiapih-radius-sm);
	background: var(--aiapih-bg-soft);
	border: 1px solid var(--aiapih-border);
}

.aiapih-code-panel div { display: flex; gap: 8px; }
.aiapih-code-panel span { height: 7px; border-radius: 4px; background: var(--aiapih-border-strong); opacity: .6; }
.aiapih-code-panel div:nth-child(1) span:nth-child(1) { width: 46px; }
.aiapih-code-panel div:nth-child(1) span:nth-child(2) { width: 70px; }
.aiapih-code-panel div:nth-child(1) span:nth-child(3) { width: 30px; }
.aiapih-code-panel div:nth-child(2) span:nth-child(1) { width: 90px; }
.aiapih-code-panel div:nth-child(2) span:nth-child(2) { width: 40px; }
.aiapih-code-panel div:nth-child(3) span { width: 34px; }
.aiapih-code-panel div:nth-child(4) span:nth-child(1) { width: 60px; }
.aiapih-code-panel div:nth-child(4) span:nth-child(2) { width: 26px; }

.aiapih-routing-mini {
	display: flex;
	align-items: center;
	gap: 6px;
}

.aiapih-mini-node {
	flex: 1;
	padding: 10px;
	border-radius: var(--aiapih-radius-sm);
	background: var(--aiapih-surface);
	border: 1px solid var(--aiapih-border);
	text-align: center;
}

.aiapih-mini-node strong { display: block; font-size: 11.5px; font-weight: 700; }
.aiapih-mini-node span { display: block; margin-top: 2px; font-size: 10px; color: var(--aiapih-text-faint); }
.aiapih-mini-node.is-active { border-color: var(--aiapih-border-strong); background: var(--aiapih-primary-soft); }

.aiapih-mini-line { flex-shrink: 0; width: 20px; height: 2px; background: var(--aiapih-border-strong); position: relative; overflow: hidden; }
.aiapih-mini-line i {
	position: absolute; inset-block: 0; width: 8px;
	background: var(--aiapih-gradient);
	animation: aiapih-line-run 2.4s linear infinite;
}

@keyframes aiapih-line-run {
	0% { inset-inline-start: -20%; }
	100% { inset-inline-start: 120%; }
}

.aiapih-hero-stat-row {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	padding-top: 4px;
}

.aiapih-hero-stat {
	text-align: center;
	padding: 10px 6px;
	border-radius: var(--aiapih-radius-sm);
	background: var(--aiapih-bg-soft);
	border: 1px solid var(--aiapih-border);
}

.aiapih-hero-stat b { display: block; font-size: 15px; font-weight: 800; }
.aiapih-hero-stat span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--aiapih-text-faint); }

.aiapih-float {
	position: absolute;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 9px 13px;
	border-radius: 999px;
	font-size: 11.5px;
	font-weight: 700;
	background: var(--aiapih-surface-strong);
	border: 1px solid var(--aiapih-border);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	box-shadow: var(--aiapih-shadow-md);
	animation: aiapih-float-bob 5s ease-in-out infinite;
}

.aiapih-float svg { color: var(--aiapih-success); }
.aiapih-float-1 { top: -18px; inset-inline-start: -14px; animation-delay: 0s; }
.aiapih-float-2 { bottom: 32px; inset-inline-end: -22px; animation-delay: .7s; }
.aiapih-float-3 { bottom: -16px; inset-inline-start: 30px; animation-delay: 1.4s; }

@keyframes aiapih-float-bob {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-9px); }
}

@media (prefers-reduced-motion: reduce) {
	.aiapih-hero-stage, .aiapih-float, .aiapih-live i, .aiapih-mini-line i { animation: none; }
}

/* ---------- Provider marquee ---------- */

.aiapih-provider-section { padding: 46px 0 20px; }

.aiapih-section-kicker { display: flex; justify-content: center; margin-bottom: 22px; }

.aiapih-provider-marquee {
	overflow: hidden;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.aiapih-provider-track {
	display: flex;
	width: max-content;
	gap: 14px;
	animation: aiapih-marquee 32s linear infinite;
}

.aiapi-home[dir="rtl"] .aiapih-provider-track,
[dir="rtl"] .aiapih-provider-track { animation-direction: reverse; }

@keyframes aiapih-marquee {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}

.aiapih-provider-item {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 20px;
	border-radius: 999px;
	background: var(--aiapih-surface);
	border: 1px solid var(--aiapih-border);
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
}

.aiapih-provider-logo { display: inline-flex; width: 20px; height: 20px; }
.aiapih-provider-logo img { width: 100%; height: 100%; object-fit: contain; }

.aiapih-provider-marquee:hover .aiapih-provider-track { animation-play-state: paused; }

/* ---------- Features ---------- */

.aiapih-features {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

.aiapih-feature-card {
	padding: 26px;
	border-radius: var(--aiapih-radius-lg);
	background: var(--aiapih-surface);
	border: 1px solid var(--aiapih-border);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.aiapih-feature-card:hover {
	transform: translateY(-5px);
	box-shadow: var(--aiapih-shadow-md);
	border-color: var(--aiapih-border-strong);
}

.aiapih-feature-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: var(--aiapih-radius-sm);
	margin-bottom: 16px;
	color: #fff;
	background: var(--aiapih-gradient);
}

.aiapih-feature-card h3 { font-size: 16.5px; font-weight: 700; margin-bottom: 8px; }
.aiapih-feature-card p { font-size: 14px; line-height: 1.7; color: var(--aiapih-text-muted); }

.aiapih-stats-strip {
	margin-top: 56px;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	border-radius: var(--aiapih-radius-lg);
	background: var(--aiapih-surface);
	border: 1px solid var(--aiapih-border);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	overflow: hidden;
}

.aiapih-stats-strip > div {
	padding: 26px 12px;
	text-align: center;
	border-inline-start: 1px solid var(--aiapih-border);
}

.aiapih-stats-strip > div:first-child { border-inline-start: 0; }

.aiapih-stats-strip b {
	display: block;
	font-size: 24px;
	font-weight: 800;
	background: var(--aiapih-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

/* Scoped to the direct label <span> only (sibling of <b>) — must NOT
   match the <span class="aiapih-counter"> nested inside <b>, or the
   counter would inherit this smaller, non-gradient label styling and
   look shrunk/gray instead of matching the big gradient number. */
.aiapih-stats-strip > div > span { display: block; margin-top: 4px; font-size: 12px; color: var(--aiapih-text-faint); }

.aiapih-stats-strip span {
    display: block;
    margin-top: 4px;
    font-size: 24px;
}

.aiapih-counter { font: inherit; color: inherit; }

/* ---------- Orbit / merged 3D routing showcase ---------- */

.aiapih-orbit-section {
	background: var(--aiapih-surface);
	border-block: 1px solid var(--aiapih-border);
}

.aiapih-orbit-inner {
	max-width: var(--aiapih-container);
	margin-inline: auto;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 56px;
	align-items: center;
}

.aiapih-orbit-copy p {
	margin-top: 12px;
	font-size: 15.5px;
	line-height: 1.75;
	color: var(--aiapih-text-muted);
	max-width: 480px;
}

.aiapih-orbit-tabs {
	display: inline-flex;
	gap: 4px;
	margin-top: 26px;
	padding: 4px;
	border-radius: 999px;
	background: var(--aiapih-bg-soft);
	border: 1px solid var(--aiapih-border);
}

.aiapih-orbit-tab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border-radius: 999px;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--aiapih-text-muted);
	transition: background .18s ease, color .18s ease;
}

.aiapih-orbit-tab.is-active { color: #fff; background: var(--aiapih-gradient); }

.aiapih-orbit-status {
	display: flex;
	align-items: center;
	gap: 9px;
	margin: 20px 0 28px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--aiapih-text-muted);
}

.aiapih-orbit-status-dot {
	width: 8px; height: 8px; border-radius: 50%;
	background: var(--aiapih-success);
	box-shadow: 0 0 0 0 rgba(31, 169, 126, .45);
	animation: aiapih-pulse-dot 1.8s ease-out infinite;
	flex-shrink: 0;
}

.aiapih-orbit-visual {
	position: relative;
	height: 420px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.aiapih-orbit-rings { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

.aiapih-orbit-ring {
	position: absolute;
	border-radius: 50%;
	border: 1px dashed var(--aiapih-border-strong);
	opacity: .55;
}

.aiapih-orbit-ring-1 { width: 190px; height: 190px; }
.aiapih-orbit-ring-2 { width: 280px; height: 280px; }
.aiapih-orbit-ring-3 { width: 370px; height: 370px; }

.aiapih-orbit-beam {
	position: absolute;
	width: 370px;
	height: 370px;
	border-radius: 50%;
	background: conic-gradient(from 0deg, transparent 0deg, rgba(109, 91, 249, .22) 40deg, transparent 90deg);
	animation: aiapih-orbit-rotate 6s linear infinite;
}

.aiapih-orbit-core {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 148px;
	height: 148px;
	border-radius: 50%;
	text-align: center;
	background: var(--aiapih-surface-strong);
	border: 1px solid var(--aiapih-border-strong);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	box-shadow: var(--aiapih-shadow-lg);
	animation: aiapih-core-breathe 4.5s ease-in-out infinite;
}

.aiapih-orbit-core-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	margin-bottom: 4px;
	color: #fff;
	background: transparent;
	overflow: hidden;
}

.aiapih-orbit-core strong { font-size: 13px; font-weight: 800; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aiapih-orbit-core span { font-size: 10.5px; color: var(--aiapih-text-faint); }

.aiapih-orbit-track {
	position: absolute;
	inset: 0;
	animation: aiapih-orbit-rotate 40s linear infinite;
}

.aiapih-orbit-chip {
	position: absolute;
	top: 50%;
	inset-inline-start: 50%;
	width: 0;
	height: 0;
	transform: rotate(var(--orbit-angle));
}

.aiapih-orbit-chip-inner {
	position: absolute;
	top: -19px;
	inset-inline-start: 166px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--aiapih-surface-strong);
	border: 1px solid var(--aiapih-border);
	box-shadow: var(--aiapih-shadow-sm);
	animation: aiapih-orbit-counter 40s linear infinite;
}

.aiapih-orbit-chip-inner img { width: 20px; height: 20px; object-fit: contain; }

@keyframes aiapih-orbit-rotate { to { transform: rotate(360deg); } }
@keyframes aiapih-orbit-counter { to { transform: rotate(-360deg); } }

@keyframes aiapih-core-breathe {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.035); }
}

@media (prefers-reduced-motion: reduce) {
	.aiapih-orbit-track, .aiapih-orbit-chip-inner, .aiapih-orbit-beam, .aiapih-orbit-core { animation: none; }
}

/* ---------- How it works ---------- */

.aiapih-steps {
	max-width: var(--aiapih-container);
	margin-inline: auto;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

.aiapih-step {
	position: relative;
	padding: 30px 26px;
	border-radius: var(--aiapih-radius-lg);
	background: var(--aiapih-surface);
	border: 1px solid var(--aiapih-border);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
}

.aiapih-step-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin-bottom: 16px;
	border-radius: 50%;
	font-weight: 800;
	color: #fff;
	background: var(--aiapih-gradient);
}

.aiapih-step h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.aiapih-step p { font-size: 14px; line-height: 1.7; color: var(--aiapih-text-muted); }

/* ---------- Pricing ---------- */

.aiapih-pricing {
	max-width: var(--aiapih-container);
	margin-inline: auto;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 20px;
}

.aiapih-price-card {
	position: relative;
	padding: 30px 26px;
	border-radius: var(--aiapih-radius-lg);
	background: var(--aiapih-surface);
	border: 1px solid var(--aiapih-border);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	display: flex;
	flex-direction: column;
	gap: 18px;
	transition: transform .22s ease, box-shadow .22s ease;
}

.aiapih-price-card:hover { transform: translateY(-4px); box-shadow: var(--aiapih-shadow-md); }

.aiapih-price-card.is-featured {
	background: var(--aiapih-surface-strong);
	border-color: var(--aiapih-border-strong);
	box-shadow: var(--aiapih-shadow-lg);
}

.aiapih-price-badge {
	position: absolute;
	top: -13px;
	inset-inline-start: 26px;
	padding: 5px 12px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 800;
	color: #fff;
	background: var(--aiapih-gradient);
}

.aiapih-price-card h3 { font-size: 17px; font-weight: 700; }

.aiapih-price-amount {
	font-size: 30px;
	font-weight: 800;
	display: flex;
	align-items: baseline;
	gap: 6px;
}

.aiapih-price-amount span { font-size: 13px; font-weight: 600; color: var(--aiapih-text-faint); }

.aiapih-price-features { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.aiapih-price-features li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--aiapih-text-muted); }
.aiapih-price-features svg { color: var(--aiapih-success); flex-shrink: 0; }

/* ---------- CTA ---------- */

.aiapih-cta-section { padding-top: 20px; }

.aiapih-cta {
	max-width: 720px;
	margin-inline: auto;
	text-align: center;
	padding: 56px 32px;
	border-radius: var(--aiapih-radius-xl);
	background: var(--aiapih-surface-strong);
	border: 1px solid var(--aiapih-border-strong);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	box-shadow: var(--aiapih-shadow-lg);
}

.aiapih-cta-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin-bottom: 18px;
	border-radius: 18px;
	color: #fff;
	background: var(--aiapih-gradient);
}

.aiapih-cta h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; margin-bottom: 10px; }
.aiapih-cta p { color: var(--aiapih-text-muted); font-size: 15px; margin-bottom: 26px; }

/* ---------- Footer ---------- */

.aiapih-footer { padding: 50px 24px 34px; border-top: 1px solid var(--aiapih-border); }

.aiapih-footer-grid {
	max-width: var(--aiapih-container);
	margin-inline: auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
}

.aiapih-footer-brand p { margin-top: 8px; font-size: 13px; color: var(--aiapih-text-faint); }

.aiapih-footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.aiapih-footer-links a { font-size: 13.5px; font-weight: 600; color: var(--aiapih-text-muted); }
.aiapih-footer-links a:hover { color: var(--aiapih-text); }

.aiapih-footer-copy { font-size: 12.5px; color: var(--aiapih-text-faint); }

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
	.aiapih-hero-grid,
	.aiapih-orbit-inner { grid-template-columns: 1fr; }
	.aiapih-orbit-visual { order: -1; height: 320px; }
	.aiapih-orbit-ring-1 { width: 150px; height: 150px; }
	.aiapih-orbit-ring-2 { width: 220px; height: 220px; }
	.aiapih-orbit-ring-3 { width: 290px; height: 290px; }
	.aiapih-orbit-beam { width: 290px; height: 290px; }
	.aiapih-orbit-chip-inner { inset-inline-start: 130px; }
	.aiapih-features { grid-template-columns: repeat(2, 1fr); }
	.aiapih-steps { grid-template-columns: 1fr; }
	.aiapih-stats-strip { grid-template-columns: repeat(2, 1fr); }
	.aiapih-stats-strip > div:nth-child(3) { border-inline-start: 0; }
}

@media (max-width: 760px) {
	.aiapih-nav { display: none; }

	.aiapih-header-actions { display: flex; }
	.aiapih-user-menu,
	.aiapih-auth-links { display: none; }
	.aiapih-lang-current { display: none; }
	.aiapih-lang-trigger { width: 38px; padding: 0; border-radius: 50%; justify-content: center; }

	.aiapih-menu-toggle { display: inline-flex; }

	.aiapih-header-inner {
		border: 0;
        display: flex;
        justify-content: space-between;
        border-radius: 0;
        border-bottom: 1px solid var(--aiapih-border);
	}

	.aiapih-header {
		padding: 0;
	}

	.aiapih-features { grid-template-columns: 1fr; }
	.aiapih-hero-actions .aiapih-btn { flex: 1; }
	.aiapih-section { padding: 72px 20px; }
}

/* ==================================================================
   Mobile off-canvas menu — fade/scale only, no directional slide
   (keeps it correct regardless of LTR/RTL, and it opens the same
   way as the Theme Settings / API Keys drawers in the panel).
   ================================================================== */
.aiapih-mobile-menu {
	position: fixed;
	top: 0;
	bottom: 0;
	inset-inline-end: 0;
	width: min(320px, 86vw);
	background: var(--aiapih-surface-solid);
	border-inline-start: 1px solid var(--aiapih-border);
	box-shadow: var(--aiapih-shadow-lg);
	z-index: 96;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	padding: 18px;
	opacity: 0;
	visibility: hidden;
	transform: scale(.98);
	transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
.aiapih-mobile-menu.is-open {
	opacity: 1;
	visibility: visible;
	transform: scale(1);
	transition: opacity .18s ease, transform .18s ease, visibility 0s linear 0s;
}

.aiapih-mobile-menu-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 16px;
	margin-bottom: 6px;
	border-bottom: 1px solid var(--aiapih-border);
}

.aiapih-mobile-nav {
	display: flex;
	flex-direction: column;
	padding: 10px 0;
	border-bottom: 1px solid var(--aiapih-border);
}
.aiapih-mobile-nav a {
	padding: 12px 6px;
	font-size: 14.5px;
	font-weight: 600;
	color: var(--aiapih-text);
	border-radius: var(--aiapih-radius-sm);
}
.aiapih-mobile-nav a:hover { background: var(--aiapih-primary-soft); }

.aiapih-mobile-section {
	padding: 16px 0;
	border-bottom: 1px solid var(--aiapih-border);
}
.aiapih-mobile-section:last-child { border-bottom: none; }

.aiapih-mobile-section-title {
	font-size: 12px;
	font-weight: 700;
	color: var(--aiapih-text-faint);
	margin-bottom: 10px;
}

.aiapih-mobile-lang { display: flex; gap: 8px; }
.aiapih-mobile-lang a {
	flex: 1;
	text-align: center;
	padding: 9px;
	border-radius: var(--aiapih-radius-sm);
	font-size: 13px;
	font-weight: 700;
	background: var(--aiapih-bg-soft);
	border: 1px solid var(--aiapih-border);
	color: var(--aiapih-text-muted);
}
.aiapih-mobile-lang a.is-active { background: var(--aiapih-primary); border-color: var(--aiapih-primary); color: #fff; }

.aiapih-mobile-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 11px 6px;
	border-radius: var(--aiapih-radius-sm);
	font-size: 13.5px;
	font-weight: 600;
	color: var(--aiapih-text);
}
.aiapih-mobile-row:hover { background: var(--aiapih-primary-soft); }
.aiapih-mobile-row svg { margin-inline-end: 8px; }
.aiapih-mobile-row-danger { color: var(--aiapih-danger); }

[data-aiapi-home-theme-toggle].aiapih-mobile-row .aiapih-theme-icon-dark,
.aiapi-home[data-aiapi-home-theme="dark"] [data-aiapi-home-theme-toggle].aiapih-mobile-row .aiapih-theme-icon-light { display: none; }
.aiapi-home[data-aiapi-home-theme="dark"] [data-aiapi-home-theme-toggle].aiapih-mobile-row .aiapih-theme-icon-dark { display: inline-flex; align-items: center; }

.aiapih-mobile-auth { display: flex; flex-direction: column; gap: 10px; }

@media (max-width: 520px) {
	.aiapih-stats-strip { grid-template-columns: 1fr; }
	.aiapih-stats-strip > div { border-inline-start: 0; border-top: 1px solid var(--aiapih-border); }
	.aiapih-stats-strip > div:first-child { border-top: 0; }
}