/* ==========================================================================
   Globex Veylo — shared UI primitives: sections, section headers, eyebrows,
   buttons, cards, chips, avatars, reveal motion, count-up.
   ========================================================================== */

/* ---- Base typography ---------------------------------------------------- */
/* The Veylo layer is self-sufficient: it always establishes the sans stack on
   the page root so component typography holds even outside legacy main.css. */
body {
	font-family: var(--gx-font-sans);
	font-size: var(--gx-body);
	line-height: var(--gx-lh-body);
	color: var(--gx-text-2);
	background: var(--gx-bg);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
.gx-section, .gx-card, .gx-btn, .gx-eyebrow, .gx-sechead__title, .gx-sechead__sub,
.gx-hero__title, .gx-hero__sub, .gx-ctab__title, .gx-ctab__sub {
	font-family: var(--gx-font-sans);
}

/* ---- Section shell ------------------------------------------------------ */
.gx-section {
	padding-block: var(--gx-section-y);
	container-type: inline-size;
}
.gx-section--soft {
	background: var(--gx-bg-soft);
}
.gx-container {
	max-width: var(--gx-container);
	margin-inline: auto;
	padding-inline: var(--gx-gutter);
}
.gx-section__glow {
	position: relative;
	overflow: clip;
}
.gx-section__glow::before {
	content: "";
	position: absolute;
	inset-block-start: -20%;
	inset-inline: 0;
	height: 640px;
	background: radial-gradient(closest-side, var(--gx-accent-glow), transparent 70%);
	opacity: .6;
	pointer-events: none;
}
.gx-section__glow > * {
	position: relative;
}

/* ---- Section header ------------------------------------------------------ */
.gx-sechead {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--gx-s-4);
	text-align: center;
	margin-block-end: var(--gx-s-8);
}
.gx-sechead--start {
	align-items: flex-start;
	text-align: start;
}
.gx-sechead__title {
	font-size: var(--gx-h2);
	font-weight: var(--gx-head-weight, 600);
	line-height: var(--gx-lh-tight);
	letter-spacing: var(--gx-ls-head);
	color: var(--gx-text);
	margin: 0;
	max-width: 22ch;
	text-wrap: balance;
}
.gx-sechead__sub {
	font-size: var(--gx-body-lg);
	line-height: var(--gx-lh-body);
	color: var(--gx-text-2);
	margin: 0;
	max-width: 56ch;
}

/* ---- Eyebrow pill --------------------------------------------------------- */
.gx-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	border: 1px solid rgba(10, 17, 114, .14);
	border-radius: var(--gx-r-pill);
	background: var(--gx-accent-100);
	color: var(--gx-accent);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: .01em;
	margin: 0;
}
.gx-eyebrow::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--gx-accent);
	flex: none;
}

/* ---- Buttons --------------------------------------------------------------- */
.gx-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 12px 22px;
	border-radius: var(--gx-r-pill);
	border: 1px solid transparent;
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.25;
	text-decoration: none;
	cursor: pointer;
	transition: transform var(--gx-dur-fast) var(--gx-ease), box-shadow var(--gx-dur-fast) var(--gx-ease), background-color var(--gx-dur-fast) var(--gx-ease), border-color var(--gx-dur-fast) var(--gx-ease);
}
.gx-btn--primary {
	background: var(--gx-accent);
	color: var(--gx-inverse-text);
	border-color: transparent;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 10px 24px -12px rgba(10, 17, 114, .65);
}
.gx-btn--primary:hover {
	background: var(--gx-accent-600);
	transform: translateY(-1px);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), var(--gx-shadow-md);
}
.gx-btn--accent {
	background: var(--gx-accent);
	color: #fff;
}
.gx-btn--accent:hover {
	background: var(--gx-accent-600);
	transform: translateY(-1px);
	box-shadow: var(--gx-shadow-md);
}
.gx-btn--secondary {
	background: var(--gx-surface);
	border-color: var(--gx-border);
	color: var(--gx-text);
	box-shadow: var(--gx-shadow-xs);
}
.gx-btn--secondary:hover {
	border-color: var(--gx-border-strong);
	transform: translateY(-1px);
	box-shadow: var(--gx-shadow-sm);
}
.gx-btn--sm {
	min-height: 40px;
	padding: 8px 16px;
	font-size: 14px;
}
.gx-btn:active {
	transform: scale(.98);
}
.gx-btn:focus-visible {
	outline: 2px solid var(--gx-accent);
	outline-offset: 2px;
}

/* Hover text-roll label (label duplicated in markup, aria-hidden on the clone) */
.gx-btn__roll {
	display: inline-flex;
	flex-direction: column;
	height: 1.25em;
	overflow: hidden;
	line-height: 1.25;
}
.gx-btn__t {
	display: block;
	transition: transform var(--gx-dur) var(--gx-ease);
}
.gx-btn:hover .gx-btn__t {
	transform: translateY(-100%);
}

/* ---- Cards ------------------------------------------------------------------ */
.gx-card {
	background: var(--gx-surface);
	border: 1px solid var(--gx-border);
	border-radius: var(--gx-r-lg);
	padding: var(--gx-s-5);
	box-shadow: var(--gx-shadow-xs);
	transition: box-shadow var(--gx-dur) var(--gx-ease), transform var(--gx-dur) var(--gx-ease), border-color var(--gx-dur) var(--gx-ease);
}
@media (hover: hover) {
	.gx-card:hover {
		transform: translateY(-2px);
		box-shadow: var(--gx-shadow-md);
		border-color: var(--gx-border-strong);
	}
}

/* Bento card: mock-UI illustration area on top, title + copy below */
.gx-bento {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--gx-s-4);
}
.gx-bento__card {
	display: flex;
	flex-direction: column;
	gap: var(--gx-s-4);
}
.gx-bento__card--wide {
	grid-column: span 2;
}
.gx-bento__mock {
	background: var(--gx-surface-2);
	border-radius: var(--gx-r-md);
	border: 1px solid var(--gx-border);
	overflow: hidden;
	min-height: 220px;
	position: relative;
}
.gx-bento__title {
	font-size: 19px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--gx-text);
	margin: 0;
}
.gx-bento__desc {
	font-size: var(--gx-body);
	line-height: var(--gx-lh-body);
	color: var(--gx-text-2);
	margin: 0;
	max-width: 60ch;
}

/* ---- Chips ------------------------------------------------------------------- */
.gx-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 12px;
	border: 1px solid var(--gx-border);
	border-radius: var(--gx-r-pill);
	background: var(--gx-surface);
	font-size: 12.5px;
	font-weight: 500;
	line-height: 1.35;
	color: var(--gx-text-2);
	white-space: nowrap;
}
.gx-chip--accent {
	background: var(--gx-accent-100);
	border-color: transparent;
	color: var(--gx-accent-600);
}
.gx-chip--success {
	background: var(--gx-success-100);
	border-color: transparent;
	color: var(--gx-success);
}
.gx-chip--dark {
	background: var(--gx-inverse-bg);
	border-color: transparent;
	color: var(--gx-inverse-text);
}

/* ---- Avatars ------------------------------------------------------------------- */
.gx-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid var(--gx-surface);
	background: var(--gx-surface-2);
	flex: none;
}
.gx-avatar--initials {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--gx-accent-100);
	color: var(--gx-accent-600);
	font-size: 14px;
	font-weight: 600;
}
.gx-avatar-stack {
	display: flex;
	align-items: center;
}
.gx-avatar-stack .gx-avatar,
.gx-avatar-stack .gx-avatar--initials {
	margin-inline-start: -10px;
}
.gx-avatar-stack > :first-child {
	margin-inline-start: 0;
}
.gx-avatar-more {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	margin-inline-start: -10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--gx-surface-2);
	border: 2px solid var(--gx-surface);
	font-size: 12px;
	font-weight: 600;
	color: var(--gx-text-2);
}

/* ---- Cursor collaborator tag ------------------------------------------------------ */
.gx-cursor-tag {
	position: absolute;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 12px 5px 10px;
	border-radius: var(--gx-r-pill);
	background: var(--gx-inverse-bg);
	color: var(--gx-inverse-text);
	font-size: 12.5px;
	font-weight: 500;
	box-shadow: var(--gx-shadow-md);
	pointer-events: none;
}
.gx-cursor-tag svg {
	width: 12px;
	height: 12px;
	flex: none;
}

/* ---- Mock-UI shared bits --------------------------------------------------------------- */
.gx-mock {
	background: var(--gx-surface-2);
	border: 1px solid var(--gx-border);
	border-radius: var(--gx-r-md);
}
.gx-mock__chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: var(--gx-r-pill);
	background: var(--gx-surface);
	border: 1px solid var(--gx-border);
	font-size: 12.5px;
	font-weight: 500;
	color: var(--gx-text-2);
	white-space: nowrap;
}
.gx-mock__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--gx-success);
	flex: none;
}

/* ---- Count-up numbers ---------------------------------------------------------------------- */
.gx-stat__value {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	line-height: 1;
	letter-spacing: var(--gx-ls-head);
	color: var(--gx-text);
}

/* ---- Reveal motion (attribute API: data-gx-reveal, --gx-i stagger) ---------------------------- */
@media (prefers-reduced-motion: no-preference) {
	html.js [data-gx-reveal] {
		opacity: 0;
		transform: translateY(var(--gx-reveal-distance));
		transition: opacity var(--gx-dur-slow) var(--gx-ease), transform var(--gx-dur-slow) var(--gx-ease);
		transition-delay: calc(var(--gx-i, 0) * 80ms);
	}
	html.js [data-gx-reveal].is-in {
		opacity: 1;
		transform: none;
	}
}

/* ---- Floating widget cards ------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
	html.js .gx-float {
		animation: gx-float 8s ease-in-out infinite alternate;
	}
	html.js .gx-float--slow {
		animation-duration: 11s;
	}
}
@keyframes gx-float {
	from {
		transform: translateY(-8px);
	}
	to {
		transform: translateY(8px);
	}
}

/* ---- Responsive guardrails -------------------------------------------------------------------- */
@container (max-width: 700px) {
	.gx-bento {
		grid-template-columns: 1fr;
	}
	.gx-bento__card--wide {
		grid-column: auto;
	}
}

@media (max-width: 900px) {
	.gx-sechead__title {
		max-width: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gx-btn__t,
	.gx-btn,
	.gx-card {
		transition: none;
	}
}
