/*
 * RXFloor — Base layer
 *
 * Reset + document defaults + reusable primitives:
 * .rx-container, .rx-section, .rx-eyebrow, .rx-h1..h4, .rx-lead,
 * .rx-button, .rx-triangle, .rx-reveal (entry-animation hook).
 */

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

html {
	margin: 0;
	padding: 0;
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
	scrollbar-gutter: stable;
}

/*
 * Parent theme (Twenty Twenty-Five) injects spacing tokens onto :root and
 * applies them as block-padding on .wp-site-blocks. Override the tokens AND
 * the rule, with !important, to guarantee edge-to-edge sections.
 */
:root,
html.wp-toolbar,
body.wp-singular {
	--wp--style--root--padding-top: 0 !important;
	--wp--style--root--padding-right: 0 !important;
	--wp--style--root--padding-bottom: 0 !important;
	--wp--style--root--padding-left: 0 !important;
	--wp--style--block-gap: 0 !important;
}

html, body {
	margin: 0 !important;
	padding: 0 !important;
}

.wp-site-blocks,
body > .wp-site-blocks,
.wp-block-template-part,
header.wp-block-template-part {
	margin: 0 !important;
	padding-block-start: 0 !important;
	padding-block-end: 0 !important;
}

.wp-site-blocks > .is-layout-flow,
.wp-site-blocks > .is-layout-constrained,
.wp-site-blocks > * {
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

/*
 * Surgical: kill the 1.2rem block-gap injected by Twenty Twenty-Five's
 * :root :where(.is-layout-flow) > * rule onto our homepage wrapper.
 */
.rx-home,
.is-layout-flow > .rx-home,
.is-layout-constrained > .rx-home,
.wp-block-post-content,
.wp-block-post-content > * {
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

body {
	margin: 0;
	background: var(--rx-surface);
	color: var(--rx-text);
	font-family: var(--rx-font);
	font-size: var(--rx-text-md);
	font-weight: var(--rx-weight-regular);
	line-height: var(--rx-leading-normal);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	overflow-x: clip;
}

img, video, svg, picture {
	display: block;
	max-width: 100%;
	height: auto;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible {
	outline: 2px solid var(--rx-accent);
	outline-offset: 3px;
}

/* ── Skip link (accessibility) ── */
.rx-skip-link {
	position: absolute;
	top: -100px;
	left: var(--rx-space-4);
	z-index: var(--rx-z-modal);
	background: var(--rx-ink);
	color: var(--rx-paper);
	padding: var(--rx-space-3) var(--rx-space-5);
	border-radius: var(--rx-radius-md);
	font-family: var(--rx-font);
	font-size: var(--rx-text-sm);
	font-weight: var(--rx-weight-semibold);
	text-decoration: none;
	transition: top var(--rx-dur-fast) var(--rx-ease-out-expo);
}
.rx-skip-link:focus {
	top: var(--rx-space-4);
	outline: 2px solid var(--rx-accent);
	outline-offset: 3px;
}

/* ── Containers ── */
.rx-container {
	width: 100%;
	max-width: var(--rx-content-max);
	margin-inline: auto;
	padding-inline: var(--rx-section-pad-inline);
}

.rx-section {
	position: relative;
	width: 100%;
	padding-block: var(--rx-section-pad-block);
}

.rx-section.is-dark {
	background: var(--rx-surface-inverse);
	color: var(--rx-text-inverse);
}

.rx-section.is-charcoal {
	background: var(--rx-surface-inverse-soft);
	color: var(--rx-text-inverse);
}

.rx-section.is-soft { background: var(--rx-surface-soft); }

/* ── Eyebrow label — neutral by default, lime is reserved for emphasis ── */
.rx-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: var(--rx-space-3);
	font-size: var(--rx-text-xs);
	font-weight: var(--rx-weight-semibold);
	letter-spacing: var(--rx-tracking-widest);
	text-transform: uppercase;
	color: var(--rx-text-muted);
	margin: 0;
}

.rx-section.is-dark .rx-eyebrow,
.rx-section.is-charcoal .rx-eyebrow { color: var(--rx-text-inverse-muted); }

.rx-eyebrow::before {
	content: "";
	width: 1.5rem;
	height: 1px;
	background: currentColor;
	flex-shrink: 0;
}

/* ── Headings — brand-locked Aptos weights ── */
.rx-h1, .rx-h2, .rx-h3, .rx-h4 {
	margin: 0;
	color: inherit;
	font-family: var(--rx-font);
	text-wrap: balance;
}

.rx-h1 {
	font-size: clamp(2rem, 1rem + 4.2vw, 4.4rem);
	line-height: 0.96;
	letter-spacing: -0.045em;
	font-weight: 800; /* Aptos ExtraBold — brand Titre 2 */
}

.rx-h2 {
	font-size: clamp(1.6rem, 0.9rem + 2.6vw, 3rem);
	line-height: 0.98;
	letter-spacing: -0.04em;
	font-weight: 800; /* Aptos ExtraBold */
}

.rx-h3 {
	font-size: clamp(1.3rem, 0.9rem + 1.4vw, 2rem);
	line-height: 1.1;
	letter-spacing: -0.025em;
	font-weight: 700; /* Aptos Bold — brand Titre 1 */
}

.rx-h4 {
	font-size: clamp(1.05rem, 0.9rem + 0.6vw, 1.3rem);
	line-height: 1.2;
	letter-spacing: -0.01em;
	font-weight: 600; /* Aptos SemiBold — brand Titre 3 */
}

.rx-lead {
	max-width: var(--rx-prose-max);
	margin: 0;
	font-size: var(--rx-text-lg);
	line-height: var(--rx-leading-loose);
	color: var(--rx-text-soft);
	text-wrap: pretty;
}

.rx-section.is-dark .rx-lead,
.rx-section.is-charcoal .rx-lead { color: var(--rx-text-inverse-soft); }

/* ── Buttons ── */
.rx-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--rx-space-2);
	min-height: 3rem;
	padding: 0 var(--rx-space-6);
	border: 1px solid transparent;
	border-radius: var(--rx-radius-md);
	background: transparent;
	color: var(--rx-text);
	font-size: var(--rx-text-sm);
	font-weight: var(--rx-weight-semibold);
	letter-spacing: 0.02em;
	white-space: nowrap;
	cursor: pointer;
	transition:
		background var(--rx-dur-fast) var(--rx-ease-out-expo),
		color var(--rx-dur-fast) var(--rx-ease-out-expo),
		border-color var(--rx-dur-fast) var(--rx-ease-out-expo),
		transform var(--rx-dur-fast) var(--rx-ease-out-expo);
}

.rx-button:hover  { transform: translateY(-1px); }
.rx-button:active { transform: translateY(0); }

.rx-button.is-primary {
	background: var(--rx-accent);
	color: var(--rx-ink);
}
.rx-button.is-primary:hover { background: var(--rx-accent-deep); color: var(--rx-paper); }

.rx-button.is-dark {
	background: var(--rx-ink);
	color: var(--rx-paper);
}
.rx-button.is-dark:hover { background: var(--rx-charcoal); }

.rx-button.is-ghost {
	border-color: var(--rx-border-strong);
	color: var(--rx-text);
}
.rx-button.is-ghost:hover {
	background: var(--rx-ink);
	color: var(--rx-paper);
	border-color: var(--rx-ink);
}

.rx-section.is-dark .rx-button.is-ghost,
.rx-section.is-charcoal .rx-button.is-ghost {
	border-color: var(--rx-border-inverse-strong);
	color: var(--rx-paper);
	background: transparent;
}
.rx-section.is-dark .rx-button.is-ghost:hover,
.rx-section.is-charcoal .rx-button.is-ghost:hover {
	background: var(--rx-paper);
	color: var(--rx-ink);
	border-color: var(--rx-paper);
}

.rx-button__arrow {
	width: 0.65rem;
	aspect-ratio: 1;
	background: currentColor;
	clip-path: var(--rx-triangle-right);
	transition: transform var(--rx-dur-fast) var(--rx-ease-out-expo);
}
.rx-button:hover .rx-button__arrow { transform: translateX(2px); }

/* ── Triangle primitive ── */
.rx-triangle {
	display: block;
	background: var(--rx-accent);
	clip-path: var(--rx-triangle-tl);
}
.rx-triangle.is-tr     { clip-path: var(--rx-triangle-tr); }
.rx-triangle.is-br     { clip-path: var(--rx-triangle-br); }
.rx-triangle.is-bl     { clip-path: var(--rx-triangle-bl); }
.rx-triangle.is-right  { clip-path: var(--rx-triangle-right); }
.rx-triangle.is-ink    { background: var(--rx-ink); }
.rx-triangle.is-paper  { background: var(--rx-paper); }
.rx-triangle.is-deep   { background: var(--rx-accent-deep); }
.rx-triangle.is-glow   { background: var(--rx-accent-glow); }

/* ── Reveal hook (used by both GSAP and IntersectionObserver fallback) ── */
[data-rx-reveal] {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity 720ms var(--rx-ease-out-expo),
				transform 720ms var(--rx-ease-out-expo);
	will-change: opacity, transform;
}

[data-rx-reveal].is-revealed,
.rx-no-js [data-rx-reveal] {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	[data-rx-reveal] {
		opacity: 1;
		transform: none;
		transition: none;
	}
}
