/* ============================================================
   KODIF — COMPONENTS
   Tokens (--primary, --white, …) are declared in css/style.css.
   Order: components → @media (breakpoints at the end of the file).
   ============================================================ */

/* ============ CONTAINER ============ */
.container {
	width: 100%;
	max-width: 1500px;
	margin: 0 auto;
	padding-left: 16px;
	padding-right: 16px;
}

/* ============ TITLE ============ */
.title {
	font-size: 72px;
	line-height: 1;
	font-weight: 700;
	color: var(--text-title);
}

/* Emphasis wrapped in <span> -> brand color */
.title span {
	color: var(--primary);
}

/* Dark-background variant: white text, <span> keeps --primary */
.title--reverse {
	color: var(--white);
}

.title--reverse span {
	color: var(--primary);
}

/* Centered */
.title--center {
	text-align: center;
}

/* Gray variant: <span> turns white */
.title--gray {
	color: var(--white);
}
.title--gray span {
	color: var(--text-title);
}

/* Small variant: a tighter heading (e.g. FAQ) */
.title--small {
	font-size: 48px;
}

/* ============ BUTTON ============ */
.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	padding: 0 28px;
	font-family:
		"TWK Lausanne",
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		sans-serif;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	color: var(--white);
	background: var(--primary);
	border: 1px solid var(--primary);
	border-radius: 12px;
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.4s ease;
}

.button:hover {
	background: var(--primary-soft);
	border-color: var(--primary-soft);
	transform: translateY(-1px);
}

/* White background, dark text */
.button--white {
	background: var(--white);
	border-color: var(--white);
	color: var(--bg-reverse);
}

.button--white:hover {
	background: #ececec;
	border-color: #ececec;
}

/* Black background, white text (for light cards / dark accents) */
.button--black {
	background: var(--bg-reverse);
	border-color: var(--bg-reverse);
	color: var(--white);
}

.button--black:hover {
	background: #1f1f1f;
	border-color: #1f1f1f;
}

/* Outlined, transparent background, --primary text */
.button--outline {
	background: transparent;
	border-color: var(--primary);
	color: var(--primary);
}

.button--outline:hover {
	background: var(--primary);
	color: var(--white);
}

/* Combined: white outline (for dark / --primary backgrounds) */
.button--white.button--outline {
	background: transparent;
	border-color: var(--white);
	color: var(--white);
}

.button--white.button--outline:hover {
	background: var(--white);
	color: var(--bg-reverse);
}

/* Combined: muted gray outline, dark text (for light cards) */
.button--black.button--outline {
	background: transparent;
	border-color: #c7cfce;
	color: #383838;
}

.button--black.button--outline:hover {
	background: var(--bg-reverse);
	border-color: var(--bg-reverse);
	color: var(--white);
}

/* Ghost: transparent background, no border, --primary text */
.button--ghost {
	background: transparent;
	border-color: transparent;
	color: var(--primary);
}

.button--ghost:hover {
	background: transparent;
	border-color: transparent;
	color: var(--primary-soft);
	transform: none;
}

/* White ghost: white text (for dark / --primary backgrounds) */
.button--ghost.button--white {
	color: var(--white);
}

.button--ghost.button--white:hover {
	background: transparent;
	border-color: transparent;
	color: var(--white);
	opacity: 0.85;
}

/* ============ TYPING ============ */
/* Wraps the alternating <span>s, inline with the preceding text */
.typing {
	display: inline-flex;
}

/* Hide all spans by default (avoids a flash of content before JS runs) */
.typing span {
	display: none;
}

/* JS adds .is-active to reveal the span currently being typed */
.typing.is-typing span.is-active {
	display: inline;
}

/* Per-word colors (caret inherits via currentColor) */
.typing__word--orange {
	color: var(--type-orange) !important;
}
.typing__word--pink {
	color: var(--type-pink) !important;
}
.typing__word--yellow {
	color: var(--type-yellow) !important;
}

/* Blinking caret after the span being typed */
.typing.is-typing span.is-active::after {
	content: "";
	display: inline-block;
	width: 2px;
	height: 0.8em;
	margin-left: 3px;
	background: currentColor;
	transform: translateY(0.12em);
	animation: typing-caret 1s steps(1) infinite;
}

@keyframes typing-caret {
	50% {
		opacity: 0;
	}
}

/* ============ DEMO / SHOWCASE (components.html only) ============ */
.demo {
	font-family:
		"TWK Lausanne",
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		sans-serif;
	padding: 64px 0;
}

.demo__heading {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--text-mute);
	margin-bottom: 24px;
}

.demo__panel {
	padding: 48px 40px;
	border-radius: 18px;
	margin-bottom: 40px;
}

.demo__panel--light {
	background: #f4f1ea;
	border: 1px solid rgba(0, 0, 0, 0.08);
}

.demo__panel--dark {
	background: var(--bg-reverse);
}

.demo__panel--primary {
	background: var(--primary);
}

/* ============ ORBIT (logo constellation) ============ */
/* A center hub with brand logos orbiting on concentric rings. Rings spin
   slowly (alternating direction); hovering a ring pauses it, and hovering a
   logo draws a spoke from the hub to that logo. CSS-only, fluid off --size. */
.orbit {
	--size: min(822px, 92vw);
	position: relative;
	width: var(--size);
	height: var(--size);
	border-radius: 50%;
	/* Own stacking context so the hovered ring, the tooltip, and the other
	   rings can be layered against each other (hovered ring > tooltip > rest). */
	isolation: isolate;
}

/* Center hub: white disc with a soft radial glow radiating behind it */
.orbit__center {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 5;
	width: calc(var(--size) * 0.1671);
	height: calc(var(--size) * 0.1671);
	transform: translate(-50%, -50%);
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: #fff;
}

.orbit__center::before {
	content: "";
	position: absolute;
	width: calc(var(--size) * 0.2342);
	height: calc(var(--size) * 0.2342);
	z-index: -1;
	border-radius: 50%;
	background: rgba(255, 255, 255, 1);
}

.orbit__center::after {
	content: "";
	position: absolute;
	width: calc(var(--size) * 0.2928);
	height: calc(var(--size) * 0.2928);
	z-index: -1;
	border-radius: 50%;
	background: rgba(255, 255, 255, 1);
}

.orbit__center-mark {
	width: calc(var(--size) * 0.0971);
	height: calc(var(--size) * 0.0971);
	object-fit: contain;
}

/* Each ring is a faint circle (radius --r) rotating around the hub. Its
   transparent fill makes the whole disc a hover target; rings are ordered
   outer -> inner in the DOM so each owns the band out to the next ring in.
   Centered via margin (not transform) so the spin keyframe stays free. */
.orbit__ring {
	position: absolute;
	top: 50%;
	left: 50%;
	width: calc(var(--r) * 2);
	height: calc(var(--r) * 2);
	margin: calc(var(--r) * -1);
	border-radius: 50%;
	animation: orbit-spin var(--dur, 48s) linear infinite;
}

.orbit__ring:before {
	content: "";
  pointer-events: none;
	position: absolute;
  border-radius: 50%;
	inset: 0;
	--dash: 1deg;
	--gap: 1deg;
	background: repeating-conic-gradient(rgba(255, 255, 255, 0.5) 0 var(--dash), transparent var(--dash) calc(var(--dash) + var(--gap)));
	-webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
	mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  z-index: -1;
}

/* Reverse rings spin the other way (counters flip with them, see below) */
.orbit__ring--rev {
	animation-direction: reverse;
}

.orbit__ring--outer {
	background: rgba(255, 255, 255, 0.12);
}

.orbit__ring--mid {
	background: rgba(255, 255, 255, 0.16);
}

/* Pause only when a logo (not the empty band) is hovered — keyed off the
   logo via :has() so hovering the ring itself keeps it spinning. */
.orbit__ring:has(.orbit__logo:hover),
.orbit__ring:has(.orbit__logo:hover) .orbit__logo {
	animation-play-state: paused;
}

/* Lift that ring above the product tooltip (z-index 8) so the hovered logo
   sits on top of its own product card, while the card stays above the other
   rings (z-index auto). */
.orbit__ring:has(.orbit__logo:hover) {
	z-index: 10;
}

/* A slot sits on the ring at angle --a, radius --r from the hub */
.orbit__slot {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(var(--r) * -1));
}

/* Connector overlay: one SVG covering the whole orbit. JS rewrites the path
   on hover to link the hub to the hovered logo (see js/components.js). Sits
   above the discs but ignores pointer events so logos stay hoverable. */
.orbit__lines {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 6;
	overflow: visible;
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none;
}

.orbit.is-linking .orbit__lines {
	opacity: 1;
}

/* Undo the slot's angular tilt so the logo content stays upright */
.orbit__deslant {
	display: block;
	transform: rotate(calc(var(--a) * -1));
}

/* Logo chip: counter-spins the ring (same duration, opposite direction) so it
   stays level while orbiting. Size = --size * --z, where --z is set per slot
   to vary the chip sizes across the constellation (falls back to 0.092). */
.orbit__logo {
	position: relative;
	display: grid;
	place-items: center;
	width: calc(var(--size) * var(--z, 0.1314));
	height: calc(var(--size) * var(--z, 0.1314));
	border-radius: 50%;
	background: #fff;
	animation: orbit-spin var(--dur, 48s) linear infinite reverse;
	transition:
		transform 0.3s ease,
		box-shadow 0.3s ease;
}

.orbit__ring--rev .orbit__logo {
	animation-direction: normal;
}

/* Two stacked marks per chip: black shown by default, colour crossfades in on
   hover. Stacking (not a src swap) lets us transition the swap smoothly. */
.orbit__logo-img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: contain;
	transition: opacity 0.3s ease;
}

.orbit__logo-img--color {
	/* Sit on top of the black mark, hidden until hover */
	position: absolute;
	inset: 0;
	opacity: 0;
}

.orbit__logo:hover {
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.orbit__logo:hover .orbit__logo-img--color {
	opacity: 1;
}

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

/* Reduced motion: hold everything still (logos stay upright via .orbit__deslant) */
@media (prefers-reduced-motion: reduce) {
	.orbit__ring,
	.orbit__logo {
		animation: none;
	}
}

/* ============ TOOLTIP (TinyTooltip) ============ */
/* Floating card positioned + clamped by js/tooltip.js. The source content
   lives in .products (hidden) and is cloned in on hover. */
.products {
	display: none;
}

.tooltip {
	position: fixed;
	left: 0;
	top: 0;
	z-index: 100;
	width: 297px;
	padding: 16px;
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.5);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.14);
	/* Hidden until JS adds .is-visible */
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition:
		opacity 0.2s ease,
		transform 0.2s ease,
		visibility 0.2s;
	pointer-events: none;
}

.tooltip.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
}

/* Inside the orbit the tooltip joins the orbit's stacking context: it sits
   above the resting rings/logos but below the hovered ring (z-index 10). */
.orbit .tooltip {
	z-index: 8;
}

/* ----- Product card (tooltip content) ----- */
.orbit__product__lead {
	margin-bottom: 14px;
	font-size: 16px;
	line-height: 1.35;
	color: var(--text-title);
	text-align: center;
}

.orbit__product__card {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px;
	background: #fff;
	border-radius: 12px;
}

.orbit__product__thumb {
	width: 80px;
	height: 80px;
	flex-shrink: 0;
	border-radius: 10px;
	object-fit: contain;
	background: var(--chat-bg);
}

.orbit__product__body {
	flex: 1;
	min-width: 0;
}

.orbit__product__title {
	font-size: 14px;
	font-weight: 600;
	color: #1c1c1c;
	margin-bottom: 10px;
	width: 100%;
	text-align: left;
}

.orbit__product__line {
	display: block;
	height: 1px;
	width: 100%;
	background: rgba(0, 0, 0, 0.1);
}

.orbit__product__meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding-top: 4px;
	font-size: 10px;
	color: var(--text-mute);
	align-items: flex-start;
	text-align: left;
}

/* ============ COUNTER ============ */
/* Animates its own text from 0 up to the value held in its content.
   Driven by js/components.js (attrs: counter-duration, counter-step). */
.counter {
	font-variant-numeric: tabular-nums; /* steady width while the digits change */
}

/* ============ SECTION CTA ============ */
/* Standalone CTA band that leads into the footer (was .footer__cta). Carries
   its own dark background since it no longer inherits the footer's. */
.section-cta {
	background: var(--bg-reverse);
	color: var(--white);
}

.section-cta__inner {
	padding-top: 80px;
	padding-bottom: 60px;
	text-align: center;
}

.section-cta__eyebrow {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--text-dim);
	margin-bottom: 18px;
}

.section-cta__title {
	font-size: 64px;
	line-height: 1.04;
	font-weight: 600;
	letter-spacing: -1.5px;
	color: var(--white);
}

/* Second line of the headline is brand-colored */
.section-cta__title span {
	color: var(--primary);
}

.section-cta__lead {
	max-width: 720px;
	margin: 22px auto 0;
	font-size: 16px;
	line-height: 1.55;
	color: var(--text-dim);
}

.section-cta__actions {
	display: flex;
	justify-content: center;
	gap: 16px;
	margin-top: 36px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1680px) {
	.container {
		max-width: 1392px;
	}
	.title {
		font-size: 60px;
	}
	.title--small {
		font-size: 44px;
	}
}

@media (max-width: 1199px) {
	.container {
		max-width: 960px;
	}
	.title {
		font-size: 48px;
	}
	.title--small {
		font-size: 40px;
	}
	/* Cap the orbit so it doesn't dominate the narrower layout */
	.orbit {
		--size: min(640px, 92vw);
	}
	.section-cta__title {
		font-size: 52px;
	}
}

@media (max-width: 991px) {
	.container {
		max-width: 760px;
	}
	.title {
		font-size: 36px;
	}
	.title--small {
		font-size: 34px;
	}
	.button {
		height: 44px;
		border-radius: 8px;
		padding: 16px;
	}
	/* Orbit (and everything sized off --size) leans on more viewport width */
	.orbit {
		--size: min(600px, 94vw);
	}
	.section-cta__title {
		font-size: 40px;
	}
}

@media (max-width: 767px) {
	.container {
		max-width: 690px;
		padding-left: 16px;
		padding-right: 16px;
	}
	.title {
		font-size: 32px;
	}
	.title--small {
		font-size: 28px;
	}
	.demo {
		padding: 40px 0;
	}
	.demo__panel {
		padding: 32px 24px;
	}
	.orbit {
		--size: min(480px, 96vw);
	}
	/* CTA buttons stack; tighter padding */
	.section-cta__inner {
		padding-top: 48px;
		padding-bottom: 24px;
	}
	.section-cta__title {
		font-size: 32px;
	}
	.section-cta__lead {
		margin-top: 16px;
		font-size: 14px;
	}
	.section-cta__actions {
		align-items: center;
		margin-top: 20px;
	}
}

@media (max-width: 539px) {
	.container {
		max-width: 100%;
	}
	.title {
		font-size: 28px;
	}
	.title--small {
		font-size: 24px;
	}
	.button {
		height: 40px;
	}
	/* Use nearly the full width so orbiting logos stay legible/tappable */
	.orbit {
		--size: 85vw;
	}
	.section-cta__title {
		font-size: 28px;
	}
}
