/* RA Master — front-end styles
   1. Tokens
   2. Progress line
   3. Section flow (scroll-linked)
   4. Micro-interactions
   5. Typography polish
   6. Responsive hardening
   7. Proof sections: stats, reviews, work
   8. Reduced motion
*/

/* 1. Tokens ------------------------------------------------------------ */
:root {
	--ra-accent: #4F7CFF;
	--ra-ease-out: cubic-bezier(.16, 1, .3, 1);
	--ra-ease-in-out: cubic-bezier(.65, 0, .35, 1);
	--ra-header-h: 0px;
}

/* 2. Progress line ----------------------------------------------------- */
.ra-progress {
	position: fixed;
	inset: 0 0 auto 0;
	height: 2px;
	z-index: 2147483000;
	pointer-events: none;
	background: var(--ra-accent);
	transform-origin: 0 50%;
	transform: scaleX(var(--ra-p, 0));
}
.admin-bar .ra-progress { top: 32px; }
@media (max-width: 782px) { .admin-bar .ra-progress { top: 46px; } }

@supports (animation-timeline: scroll()) {
	.ra-progress {
		transform: scaleX(0);
		animation: ra-grow linear both;
		animation-timeline: scroll(root block);
	}
}
@keyframes ra-grow { to { transform: scaleX(1); } }

/* 3. Section flow -------------------------------------------------------
   Top-level sections rise 28px and come up from 40% opacity as they enter,
   driven by scroll position. Header, footer, popups and anything that
   already has an Elementor entrance animation are left alone. */
@media (prefers-reduced-motion: no-preference) {
	@supports (animation-timeline: view()) {
		.ra-flow :is(
			.elementor:not(.elementor-location-header):not(.elementor-location-footer):not(.elementor-location-popup) > .e-con,
			.elementor:not(.elementor-location-header):not(.elementor-location-footer):not(.elementor-location-popup) > .elementor-section,
			.elementor:not(.elementor-location-header):not(.elementor-location-footer):not(.elementor-location-popup) > .elementor-section-wrap > .elementor-section
		):not([data-settings*="animation"]):not(:first-child) {
			animation: ra-settle linear both;
			animation-timeline: view();
			animation-range: entry 0px entry 38vh;
		}
	}
	/* Fallback for browsers without scroll-driven animations (set by script). */
	.ra-pre { opacity: .4; translate: 0 28px; }
	.ra-pre.ra-in { opacity: 1; translate: 0 0; transition: opacity .9s var(--ra-ease-out), translate .9s var(--ra-ease-out); }
}
@keyframes ra-settle {
	from { opacity: .4; translate: 0 28px; }
	to   { opacity: 1;  translate: 0 0; }
}

/* Images below the first screen fade in once loaded (class set by script). */
.ra-img-wait { opacity: 0; }
.ra-img-wait.ra-img-ready { opacity: 1; transition: opacity .6s var(--ra-ease-out); }

/* 4. Micro-interactions ------------------------------------------------ */
.ra-micro :is(.elementor-button, .wp-element-button, .wp-block-button__link, button, input[type="submit"]) {
	transition-property: transform, background-color, border-color, color, box-shadow, opacity;
	transition-duration: .18s, .25s, .25s, .25s, .25s, .25s;
	transition-timing-function: var(--ra-ease-out);
	touch-action: manipulation;
}
.ra-micro :is(.elementor-button, .wp-element-button, .wp-block-button__link, button, input[type="submit"]):active {
	transform: scale(.97);
}
.ra-micro :is(.elementor-widget-text-editor, .entry-content, .elementor-widget-theme-post-content) a:not(.elementor-button):not(.wp-element-button) {
	text-decoration-line: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .22em;
	text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
	transition: text-underline-offset .2s var(--ra-ease-out), text-decoration-color .2s;
}
.ra-micro :is(.elementor-widget-text-editor, .entry-content, .elementor-widget-theme-post-content) a:not(.elementor-button):not(.wp-element-button):hover {
	text-underline-offset: .32em;
	text-decoration-color: currentColor;
}

/* 5. Typography polish ------------------------------------------------- */
.ra-polish {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}
.ra-polish :is(h1, h2, h3, h4, .elementor-heading-title) { text-wrap: balance; }
.ra-polish :is(p, li, blockquote, figcaption) { text-wrap: pretty; }
.ra-polish ::selection { background: color-mix(in srgb, var(--ra-accent) 32%, transparent); }
.ra-polish :where(a, button, [role="button"], input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--ra-accent);
	outline-offset: 3px;
}
html:has(body.ra-polish) {
	scrollbar-width: thin;
	scrollbar-color: color-mix(in srgb, var(--ra-accent) 55%, transparent) transparent;
	scroll-padding-top: calc(var(--ra-header-h) + 16px);
}

/* 6. Responsive hardening ---------------------------------------------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.ra-resp { overflow-x: clip; }
.ra-resp :where(img, video) { max-width: 100%; height: auto; }
.ra-resp :where(iframe, embed, object) { max-width: 100%; }
.ra-resp :where(.e-con, .e-con-inner, .elementor-column, .elementor-widget, .elementor-widget-container) { min-width: 0; }
.ra-resp :where(h1, h2, h3, h4, h5, h6, p, li, a, .elementor-heading-title, .elementor-widget-text-editor) { overflow-wrap: break-word; }
.ra-resp :where(.elementor-widget-text-editor, .entry-content) table { display: block; max-width: 100%; overflow-x: auto; }
@media (max-width: 767px) {
	/* iPhones zoom into form fields with text under 16px. */
	.ra-resp input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
	.ra-resp select,
	.ra-resp textarea { font-size: max(16px, 1em); }
	.ra-resp :where(h1, h2, .elementor-heading-title) { hyphens: auto; }
}

/* 7. Proof sections ---------------------------------------------------- */
.ra {
	--ra-muted: color-mix(in srgb, currentColor 64%, transparent);
	--ra-rule: color-mix(in srgb, currentColor 15%, transparent);
	--ra-tint: color-mix(in srgb, currentColor 4%, transparent);
	container-type: inline-size;
	color: inherit;
	font: inherit;
	box-sizing: border-box;
}
.ra *, .ra *::before, .ra *::after { box-sizing: border-box; }
.ra :is(h2, h3, p, ul, dl, dd, figure, blockquote) { margin: 0; padding: 0; }
.ra .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

.ra-proof { display: grid; gap: clamp(3rem, 8vw, 6rem); }
/* Reviews placed where an old testimonial block was. */
.ra-injected { margin-block: clamp(2.5rem, 7vw, 5rem); }

.ra-title {
	font-size: clamp(1.5rem, 1.15rem + 1.6vw, 2.4rem);
	line-height: 1.1;
	font-weight: 600;
	letter-spacing: -.02em;
	text-wrap: balance;
	color: inherit;
}

/* Stats */
.ra-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
	gap: 1.5rem 2rem;
}
.ra-stat {
	display: flex;
	flex-direction: column-reverse;
	justify-content: flex-end;
	gap: .45rem;
	padding-left: 1rem;
	border-left: 1px solid var(--ra-rule);
}
.ra-stat dd {
	font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.9rem);
	font-weight: 600;
	line-height: 1;
	letter-spacing: -.035em;
	font-variant-numeric: tabular-nums;
}
.ra-stat dt { font-size: .875rem; line-height: 1.35; color: var(--ra-muted); }

/* Reviews */
.ra-reviews__grid { display: grid; gap: clamp(1.75rem, 5cqi, 3.5rem); }
@container (min-width: 760px) {
	.ra-reviews__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr); align-items: start; }
	.ra-reviews__more { grid-column: 1 / -1; }
}
.ra-reviews__lead { display: grid; gap: 1.25rem; align-content: start; }
.ra-score { display: grid; gap: .5rem; }
.ra-score__value {
	font-size: clamp(3.25rem, 2.2rem + 5cqi, 5.75rem);
	font-weight: 600;
	line-height: .85;
	letter-spacing: -.045em;
	font-variant-numeric: tabular-nums;
}
.ra-score__text { font-size: .95rem; line-height: 1.45; color: var(--ra-muted); max-width: 26ch; }

.ra-quote { display: grid; gap: .9rem; align-content: start; }
.ra-quote__text p { font-size: 1rem; line-height: 1.6; max-width: 54ch; }
.ra-quote--featured .ra-quote__text { position: relative; }
.ra-quote--featured .ra-quote__text p {
	font-size: clamp(1.25rem, 1rem + 1.35cqi, 1.95rem);
	line-height: 1.32;
	letter-spacing: -.012em;
	max-width: 36ch;
	text-indent: -.42em;
}
.ra-quote--featured .ra-quote__text p::before { content: "\201C"; color: var(--ra-accent); }
.ra-quote--featured .ra-quote__text p::after { content: "\201D"; color: var(--ra-accent); }

.ra-stars { display: flex; gap: 2px; line-height: 0; }
.ra-star svg { display: block; fill: color-mix(in srgb, currentColor 18%, transparent); }
.ra-star.is-on svg { fill: currentColor; }

.ra-cite { display: flex; align-items: center; gap: .75rem; font-size: .875rem; line-height: 1.35; }
.ra-avatar {
	flex: none;
	display: inline-grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	font-size: .72rem;
	font-weight: 600;
	letter-spacing: .03em;
	background: color-mix(in srgb, var(--ra-accent) 16%, transparent);
	border: 1px solid color-mix(in srgb, var(--ra-accent) 30%, transparent);
}
.ra-cite__text { display: grid; }
.ra-cite__who { font-weight: 500; }
.ra-cite__project { color: var(--ra-muted); }

.ra-reviews__more {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
	gap: 1.75rem clamp(1.5rem, 4cqi, 3rem);
	padding-top: clamp(1.5rem, 4cqi, 2.25rem);
	border-top: 1px solid var(--ra-rule);
}
.ra-reviews__more > li { margin: 0; }

/* Work */
.ra-work { display: grid; gap: clamp(1.25rem, 3cqi, 2rem); }
.ra-work__list { list-style: none; border-top: 1px solid var(--ra-rule); }
.ra-work__row {
	position: relative;
	display: grid;
	gap: .5rem 2rem;
	padding: 1.35rem 0;
	border-bottom: 1px solid var(--ra-rule);
}
@container (min-width: 820px) {
	.ra-work__row {
		grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.5fr) minmax(0, 1.05fr) 7.5rem;
		align-items: baseline;
		padding: 1.6rem 0;
	}
	.ra-work__link { justify-self: end; }
}
.ra-work__row::before {
	content: "";
	position: absolute;
	inset: 0 -1rem;
	border-radius: 10px;
	background: var(--ra-tint);
	opacity: 0;
	transition: opacity .25s var(--ra-ease-out);
	pointer-events: none;
}
.ra-work__row.has-link:hover::before,
.ra-work__row.has-link:focus-within::before { opacity: 1; }
.ra-work__name h3 {
	font-size: clamp(1.05rem, .95rem + .45cqi, 1.3rem);
	line-height: 1.25;
	font-weight: 600;
	letter-spacing: -.01em;
	color: inherit;
}
.ra-work__name p { margin-top: .3rem; font-size: .85rem; line-height: 1.4; color: var(--ra-muted); }
.ra-work__did { font-size: .95rem; line-height: 1.55; color: var(--ra-muted); }
.ra-work__result { font-size: .95rem; line-height: 1.5; font-weight: 500; }
.ra-work__link {
	justify-self: start;
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	font-size: .875rem;
	font-weight: 500;
	color: inherit;
	text-decoration: none;
	white-space: nowrap;
}
.ra-work__link::after { content: ""; position: absolute; inset: 0; } /* whole row is the link */
.ra-work__link svg { transition: translate .3s var(--ra-ease-out); }
.ra-work__row.has-link:hover .ra-work__link svg { translate: 2px -2px; }
.ra-work__link:focus-visible { outline: 2px solid var(--ra-accent); outline-offset: 4px; border-radius: 2px; }

/* Apps */
.ra-apps { display: grid; gap: clamp(1.25rem, 3cqi, 2rem); }
.ra-apps__head { display: grid; gap: .6rem; }
.ra-lead { font-size: 1rem; line-height: 1.55; color: var(--ra-muted); max-width: 60ch; }
.ra-apps__list {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr));
	column-gap: clamp(1.5rem, 4cqi, 2.75rem);
	border-top: 1px solid var(--ra-rule);
}
.ra-app {
	position: relative;
	display: grid;
	align-content: start;
	gap: .3rem;
	padding: 1.25rem 0 1.35rem;
	border-bottom: 1px solid var(--ra-rule);
}
.ra-app__name { font-size: 1.05rem; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; color: inherit; }
.ra-app__name a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; }
.ra-app__name a::after { content: ""; position: absolute; inset: 0; }
.ra-app__name svg { transition: translate .3s var(--ra-ease-out); opacity: .6; }
.ra-app.has-link:hover .ra-app__name svg { translate: 2px -2px; opacity: 1; }
.ra-app__name a:focus-visible { outline: 2px solid var(--ra-accent); outline-offset: 4px; border-radius: 2px; }
.ra-app__cat { font-size: .8rem; color: var(--ra-muted); }
.ra-app__about { margin-top: .2rem; font-size: .9rem; line-height: 1.5; color: var(--ra-muted); }

/* 8. Reduced motion ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.ra-progress { animation: none; transform: scaleX(var(--ra-p, 0)); }
	.ra-img-wait { opacity: 1; }
	.ra-micro :is(.elementor-button, .wp-element-button, button):active { transform: none; }
	.ra-work__link svg, .ra-work__row::before { transition: none; }
}
