/* ------------------------------------------------------------------
   Onest Motion - presentation layer
   Tokens come from theme.json; this file adds section behaviour,
   micro-animation and the few composite components patterns rely on.
------------------------------------------------------------------- */

:root {
	--onest-accent: #ff4d1c;
	--onest-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--onest-hairline: rgba(242, 238, 231, 0.14);
}

html {
	scroll-behavior: smooth;
}

body {
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

/* --- Full-viewport sectioned scroll -------------------------------- */

html:has(.onest-scroller) {
	scroll-snap-type: y proximity;
}

.onest-section {
	position: relative;
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	scroll-snap-align: start;
	scroll-snap-stop: normal;
	padding-block: clamp(5rem, 12vh, 9rem);
	overflow: clip;
}

@media (max-width: 781px) {
	html:has(.onest-scroller) {
		scroll-snap-type: none;
	}
	.onest-section {
		min-height: auto;
		padding-block: 4.5rem;
	}
}

/* Hairline between sections */
.onest-section + .onest-section::before {
	content: "";
	position: absolute;
	inset-inline: 0;
	top: 0;
	height: 1px;
	background: var(--onest-hairline);
}

/* --- Eyebrow / index numerals -------------------------------------- */

.onest-eyebrow {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.7rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--onest-accent);
}

.onest-index {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.7rem;
	letter-spacing: 0.22em;
	color: var(--wp--preset--color--bone-muted);
}

.onest-lede {
	max-width: 46ch;
	color: var(--wp--preset--color--bone-muted);
}

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

.onest-header {
	position: sticky;
	top: 0;
	z-index: 40;
	backdrop-filter: blur(14px);
	background: rgba(10, 10, 12, 0.55);
	border-bottom: 1px solid transparent;
	transition: background 0.4s var(--onest-ease), border-color 0.4s var(--onest-ease),
		padding 0.4s var(--onest-ease);
}

.onest-header.is-condensed {
	background: rgba(10, 10, 12, 0.92);
	border-bottom-color: var(--onest-hairline);
}

.onest-header .wp-block-navigation-item__content {
	position: relative;
	padding-block: 0.35rem;
}

.onest-header .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	height: 1px;
	width: 100%;
	background: var(--onest-accent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.35s var(--onest-ease);
}

.onest-header .wp-block-navigation-item__content:hover::after {
	transform: scaleX(1);
}

/* --- Section progress rail ------------------------------------------ */

.onest-rail {
	position: fixed;
	right: clamp(0.75rem, 2vw, 1.75rem);
	top: 50%;
	transform: translateY(-50%);
	z-index: 30;
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
}

.onest-rail__dot {
	width: 7px;
	height: 7px;
	border-radius: 999px;
	background: rgba(242, 238, 231, 0.25);
	transition: transform 0.4s var(--onest-ease), background 0.4s var(--onest-ease);
}

.onest-rail__dot.is-active {
	background: var(--onest-accent);
	transform: scale(1.9);
}

@media (max-width: 781px) {
	.onest-rail {
		display: none;
	}
}

/* --- Reveal animation ------------------------------------------------ */

.onest-js .onest-will-reveal > * {
	opacity: 0;
	transform: translateY(22px);
	transition: opacity 0.85s var(--onest-ease), transform 0.85s var(--onest-ease);
}

.onest-js .onest-will-reveal.is-visible > * {
	opacity: 1;
	transform: none;
}

.onest-js .onest-will-reveal.is-visible > *:nth-child(2) { transition-delay: 0.08s; }
.onest-js .onest-will-reveal.is-visible > *:nth-child(3) { transition-delay: 0.16s; }
.onest-js .onest-will-reveal.is-visible > *:nth-child(4) { transition-delay: 0.24s; }
.onest-js .onest-will-reveal.is-visible > *:nth-child(5) { transition-delay: 0.32s; }

.onest-reduced .onest-will-reveal > * {
	opacity: 1 !important;
	transform: none !important;
}

/* --- Media / parallax ------------------------------------------------ */

.onest-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 18px;
	transform: translate3d(0, var(--onest-drift, 0px), 0) scale(1.02);
	transition: transform 0.9s var(--onest-ease), filter 0.9s var(--onest-ease);
	filter: saturate(1.05) contrast(1.05);
}

.onest-media:hover img {
	filter: saturate(1.2) contrast(1.1);
}

.onest-hero-media img {
	border-radius: 0;
}

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

.onest-hero {
	position: relative;
	isolation: isolate;
}

.onest-hero__bg {
	position: absolute;
	inset: 0;
	z-index: -2;
}

.onest-hero__bg img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.75;
	animation: onest-slow-zoom 26s ease-in-out infinite alternate;
}

.onest-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(180deg, rgba(10, 10, 12, 0.72) 0%, rgba(10, 10, 12, 0.35) 45%, #0a0a0c 100%);
}

@keyframes onest-slow-zoom {
	from { transform: scale(1); }
	to { transform: scale(1.09); }
}

.onest-reduced .onest-hero__bg img {
	animation: none;
}

.onest-hero h1 .onest-underline {
	position: relative;
	color: var(--onest-accent);
}

/* Scroll cue */
.onest-cue {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.68rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--wp--preset--color--bone-muted);
}

.onest-cue::before {
	content: "";
	width: 1px;
	height: 40px;
	background: linear-gradient(180deg, var(--onest-accent), transparent);
	animation: onest-cue 2.4s var(--onest-ease) infinite;
}

@keyframes onest-cue {
	0%, 100% { transform: scaleY(0.4); opacity: 0.4; transform-origin: top; }
	50% { transform: scaleY(1); opacity: 1; transform-origin: top; }
}

/* --- Three paths ----------------------------------------------------- */

.onest-paths {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.25rem;
}

@media (max-width: 900px) {
	.onest-paths {
		grid-template-columns: 1fr;
	}
}

.onest-path {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
	padding: clamp(1.5rem, 3vw, 2.25rem);
	border: 1px solid var(--onest-hairline);
	border-radius: 20px;
	background: #131317;
	overflow: hidden;
	transition: transform 0.5s var(--onest-ease), border-color 0.5s var(--onest-ease);
	min-height: 340px;
}

.onest-path::before {
	content: "";
	position: absolute;
	inset: 0;
	opacity: 0;
	background: radial-gradient(
		420px circle at var(--onest-x, 50%) var(--onest-y, 0%),
		color-mix(in srgb, var(--onest-path-accent, #ff4d1c) 26%, transparent),
		transparent 65%
	);
	transition: opacity 0.5s var(--onest-ease);
	pointer-events: none;
}

.onest-path:hover {
	transform: translateY(-6px);
	border-color: color-mix(in srgb, var(--onest-path-accent, #ff4d1c) 55%, transparent);
}

.onest-path:hover::before {
	opacity: 1;
}

.onest-path__num {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.7rem;
	letter-spacing: 0.2em;
	color: var(--onest-path-accent, #ff4d1c);
}

.onest-path h3 {
	margin: 0;
	font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.onest-path p {
	color: var(--wp--preset--color--bone-muted);
	margin: 0;
	font-size: 0.98rem;
}

.onest-path .onest-path__go {
	margin-top: auto;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.7rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--wp--preset--color--bone);
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	text-decoration: none;
}

.onest-path .onest-path__go::after {
	content: "→";
	transition: transform 0.4s var(--onest-ease);
	color: var(--onest-path-accent, #ff4d1c);
}

.onest-path:hover .onest-path__go::after {
	transform: translateX(7px);
}

.onest-path--design { --onest-path-accent: #ff4d1c; }
.onest-path--programming { --onest-path-accent: #2bd9c7; }
.onest-path--marketing { --onest-path-accent: #ffc53d; }

/* --- Split section (image + copy) ------------------------------------ */

.onest-split {
	display: grid;
	grid-template-columns: 1.05fr 1fr;
	gap: clamp(2rem, 5vw, 4.5rem);
	align-items: center;
}

.onest-split--flip > .onest-media {
	order: 2;
}

@media (max-width: 900px) {
	.onest-split {
		grid-template-columns: 1fr;
	}
	.onest-split--flip > .onest-media {
		order: 0;
	}
}

.onest-media {
	position: relative;
	aspect-ratio: 4 / 3;
	border-radius: 18px;
	overflow: hidden;
	border: 1px solid var(--onest-hairline);
}

.onest-points {
	list-style: none;
	margin: 1.5rem 0 0;
	padding: 0;
	display: grid;
	gap: 0.85rem;
}

.onest-points li {
	position: relative;
	padding-left: 1.6rem;
	color: var(--wp--preset--color--bone-muted);
	font-size: 0.98rem;
}

.onest-points li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.62em;
	width: 9px;
	height: 1px;
	background: var(--onest-accent);
}

/* --- Blog area -------------------------------------------------------- */

.onest-posts .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.25rem;
}

@media (max-width: 900px) {
	.onest-posts .wp-block-post-template {
		grid-template-columns: 1fr;
	}
}

.onest-posts .wp-block-post {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	padding: clamp(1.35rem, 2.5vw, 1.9rem);
	border: 1px solid var(--onest-hairline);
	border-radius: 18px;
	background: #131317;
	transition: transform 0.5s var(--onest-ease), border-color 0.5s var(--onest-ease);
}

.onest-posts .wp-block-post:hover {
	transform: translateY(-5px);
	border-color: rgba(255, 77, 28, 0.5);
}

.onest-posts .wp-block-post-title {
	font-size: 1.3rem;
	line-height: 1.15;
	margin: 0;
}

.onest-posts .wp-block-post-date {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.68rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--wp--preset--color--bone-muted);
}

.onest-posts .wp-block-post-excerpt__excerpt {
	color: var(--wp--preset--color--bone-muted);
	font-size: 0.95rem;
	margin: 0;
}

.onest-posts .wp-block-post-excerpt__more-text {
	margin-top: auto;
}

.onest-posts .wp-block-post-excerpt__more-link,
.onest-readmore {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.68rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--wp--preset--color--bone);
	text-decoration: none;
	border-bottom: 1px solid var(--onest-accent);
	padding-bottom: 3px;
	align-self: flex-start;
}

.onest-posts .wp-block-post-excerpt__more-link:hover,
.onest-readmore:hover {
	color: var(--onest-accent);
}

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

.onest-cta {
	position: relative;
	text-align: center;
}

.onest-cta__glow {
	position: absolute;
	inset: 0;
	z-index: -1;
	background: radial-gradient(60% 55% at 50% 55%, rgba(255, 77, 28, 0.2), transparent 70%);
	pointer-events: none;
}

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

.onest-footer {
	border-top: 1px solid var(--onest-hairline);
	font-size: 0.9rem;
}

.onest-footer a {
	color: var(--wp--preset--color--bone-muted);
	text-decoration: none;
}

.onest-footer a:hover {
	color: var(--onest-accent);
}

/* --- Editor niceties --------------------------------------------------- */

.editor-styles-wrapper .onest-section {
	min-height: auto;
}

/* --- Spacing for the raw markup used inside the section patterns ------- */

.onest-split > div > .onest-eyebrow,
.onest-path__num {
	display: block;
	margin: 0 0 0.9rem;
}

.onest-split > div > h2 {
	margin: 0 0 1.25rem;
}

.onest-split > div > p {
	margin: 0;
}

.onest-split > div > .onest-lede + .onest-points {
	margin-top: 1.75rem;
}

.onest-posts .wp-block-query > .wp-block-post-template {
	list-style: none;
	margin: 0;
	padding: 0;
}
