/* Sustain theme — layout & block style variations */

body {
	margin: 0;
}

main.wp-block-group {
	margin-block-start: 0;
}

.content-wrapper {
	max-width: var(--wp--style--global--content-size, 1344px);
	margin-inline: auto;
	padding: var(--wp--preset--spacing--50, 3rem) var(--wp--preset--spacing--30, 1.5rem);
}

/* Header — glass, sticky, blurred over whatever scrolls underneath */
.site-header {
	position: sticky;
	top: 0;
	z-index: 999;
	background-color: rgba(255, 255, 255, 0.72) !important;
	backdrop-filter: blur(14px) saturate(160%);
	-webkit-backdrop-filter: blur(14px) saturate(160%);
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.site-header__inner {
	max-width: var(--wp--style--global--wide-size, 1344px);
	margin-inline: auto;
	width: 100%;
	padding-inline: var(--wp--preset--spacing--30);
}

.site-header__inner .wp-block-site-logo img {
	max-height: 46px;
	width: auto;
}

.site-header__nav-list {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--30, 1.5rem);
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-header__burger {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 28px;
	height: 22px;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
}

.site-header__burger span {
	display: block;
	height: 2px;
	background: #000;
	border-radius: 2px;
}

@media (max-width: 781px) {
	.site-header__burger {
		display: flex;
	}

	.site-header__nav-list {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		background: var(--wp--preset--color--base, #fff);
		padding: 0.5rem 1.5rem 1rem;
		box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
	}

	.site-header__nav.is-open .site-header__nav-list {
		display: flex;
	}

	.site-header__nav-list li a {
		display: block;
		padding: 0.85rem 0;
		border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	}
}

.site-header__nav .wp-block-navigation-item a {
	text-decoration: none;
	color: rgba(0, 0, 0, 0.65);
	font-weight: 500;
	font-size: 14px;
	transition: color 0.25s ease-in-out;
}

.site-header__nav .wp-block-navigation-item a:hover {
	color: var(--wp--preset--color--primary);
}

.site-header__lang-switcher {
	display: flex;
	align-items: center;
	gap: 0.5em;
	list-style: none;
	margin: 0;
	padding-left: 1.25rem;
	border-left: 1px solid rgba(0, 0, 0, 0.12);
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.8125rem;
	font-weight: 600;
}

.site-header__lang-switcher li {
	display: inline-flex;
}

.site-header__lang-switcher li + li::before {
	content: "/";
	margin-right: 0.5em;
	color: rgba(0, 0, 0, 0.25);
}

.site-header__lang-switcher a {
	text-decoration: none;
	text-transform: uppercase;
	color: rgba(0, 0, 0, 0.4);
	transition: color 0.25s ease-in-out;
}

.site-header__lang-switcher a:hover {
	color: rgba(0, 0, 0, 0.7);
}

.site-header__lang-switcher li.current-lang a {
	color: var(--wp--preset--color--primary);
}

/* Footer — dark, understated */
.site-footer p {
	margin: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	letter-spacing: 0.03em;
	opacity: 0.6;
}

/* Eyebrow — small tech "badge" label instead of a plain caps line */
.is-style-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	font-family: var(--wp--preset--font-family--mono);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	font-size: 0.75rem;
	/* Dark text by default — the green (#7CDA24) badge background is only ~12%
	   opacity, so green-on-that-background computes to ~1.65:1 contrast, well
	   under the 3:1 minimum. Green text only reads fine over the dark sections
	   (see override below), where the same badge background is closer to black. */
	color: var(--wp--preset--color--foreground);
	background: rgba(124, 218, 36, 0.12);
	border: 1px solid rgba(124, 218, 36, 0.3);
	border-radius: 999px;
	padding: 0.4em 1em;
}

.is-style-eyebrow::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
	flex-shrink: 0;
}

/* Dark sections: layered gradient + faint dot-grid, evokes data/network rather than a flat block color */
.is-style-section-dark {
	position: relative;
	z-index: 0;
	background: var(--wp--preset--color--background-dark);
	background: linear-gradient(135deg, #0a0c0a 0%, #1b1f1a 45%, #16301a 100%);
	overflow: hidden;
}

.is-style-section-dark::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
	background-size: 28px 28px;
	pointer-events: none;
}

.is-style-section-light {
	background-color: var(--wp--preset--color--base);
}

/* Cover blocks (alignfull) never get WP's auto constrained-layout CSS on their
   inner container (they default to is-layout-flow) — the background image can
   stretch full-bleed but the content inside must still respect the site's max width. */
.wp-block-cover.alignfull > .wp-block-cover__inner-container {
	max-width: var(--wp--style--global--content-size, 1344px);
	width: 100%;
	margin-inline: auto;
	box-sizing: border-box;
}

/* Hero — real background photo, plain dark dim (like production) so text stays crisp,
   plus a faint drifting green glow confined to the edges only (never behind the text column). */
.is-style-mesh {
	position: relative;
	overflow: hidden;
}

.is-style-mesh::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background-image: radial-gradient(circle at 15% 15%, rgba(124, 218, 36, 0.3), transparent 30%);
	animation: sustain-drift 20s ease-in-out infinite alternate;
	pointer-events: none;
}

.is-style-mesh .wp-block-cover__inner-container {
	position: relative;
	z-index: 2;
}

.is-style-mesh .wp-block-cover__inner-container h1,
.is-style-mesh .wp-block-cover__inner-container p {
	text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

@keyframes sustain-drift {
	from {
		transform: translate3d(0, 0, 0) scale(1);
	}
	to {
		transform: translate3d(3%, -4%, 0) scale(1.1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.is-style-mesh::after {
		animation: none;
	}
}

/* Card style variation — rounded, soft border, lift on hover (bento-style content blocks) */
.wp-block-column.is-style-card,
.is-style-card {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--background-light);
	border-radius: 20px;
	padding: var(--wp--preset--spacing--40);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.wp-block-column.is-style-card:hover,
.is-style-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
}

/* Cards are always a white island, even inside a dark section that forces white
   text on its ancestor (and its higher-specificity ".is-style-section-dark .is-style-muted"
   rule below) — text inside a card must stay dark regardless of where it's nested. */
.is-style-card,
.is-style-card :where(h1, h2, h3, h4, h5, h6, p, a) {
	color: var(--wp--preset--color--foreground);
}

.is-style-section-dark .is-style-card .is-style-muted {
	color: var(--wp--preset--color--foreground);
}

/* Green only reads fine on the near-black badge/circle background this
   produces over a dark section — same reasoning as the base .is-style-eyebrow
   rule above. */
.is-style-section-dark .is-style-eyebrow {
	color: var(--wp--preset--color--primary);
}

/* Service card — full-bleed photo, number badge top-left, title pinned bottom over a gradient scrim */
.is-style-service-card {
	position: relative;
	overflow: hidden;
	border-radius: 20px;
	min-height: 420px;
	isolation: isolate;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.is-style-service-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
}

.is-style-service-card .service-card__image {
	position: absolute;
	inset: 0;
	z-index: 0;
	margin: 0;
}

.is-style-service-card .service-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.is-style-service-card:hover .service-card__image img {
	transform: scale(1.06);
}

.is-style-service-card .service-card__badge {
	position: absolute;
	z-index: 2;
	top: var(--wp--preset--spacing--20, 1rem);
	left: var(--wp--preset--spacing--20, 1rem);
	margin: 0;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--foreground);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	padding: 0.35em 0.85em;
	border-radius: 999px;
}

.is-style-service-card .service-card__caption {
	position: absolute;
	z-index: 1;
	inset: auto 0 0 0;
	padding: 3.5rem 1.5rem 1.5rem;
	background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.78) 100%);
}

.is-style-service-card .service-card__title {
	margin: 0;
	color: var(--wp--preset--color--base) !important;
	font-size: 1.125rem;
	letter-spacing: -0.01em;
	text-shadow: 0 1px 12px rgba(0, 0, 0, 0.3);
}

@media (max-width: 781px) {
	.is-style-service-card {
		min-height: 320px;
	}
}

/* Highlight card — gradient callout (AI/news blocks) */
.is-style-highlight {
	background: linear-gradient(135deg, #7cda24 0%, #4fae3a 100%);
	color: #0a0c0a;
	border-radius: 20px;
	padding: var(--wp--preset--spacing--60);
}

.is-style-highlight h2,
.is-style-highlight h3,
.is-style-highlight h4 {
	color: #0a0c0a !important;
}

/* Avatar — CSS-only initials circle for team members without a photo */
.is-style-avatar {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, rgba(124, 218, 36, 0.25), rgba(124, 218, 36, 0.08));
	border: 1px solid rgba(124, 218, 36, 0.35);
	margin-bottom: var(--wp--preset--spacing--10);
}

.is-style-avatar p {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	font-size: 1.1rem;
	/* Dark text — same ~1.7:1 contrast failure as .is-style-eyebrow otherwise
	   (pale green gradient circle, always sits inside a white .is-style-card). */
	color: var(--wp--preset--color--foreground);
}

/* Muted paragraph — replaces one-off inline opacity/color overrides */
.is-style-muted {
	opacity: 0.65;
}

.is-style-section-dark .is-style-muted {
	color: var(--wp--preset--color--base);
}

/* Subheading — normal-case heading variant (h3 defaults to the mono eyebrow treatment) */
.is-style-subheading {
	font-family: var(--wp--preset--font-family--heading) !important;
	text-transform: none !important;
	letter-spacing: -0.01em !important;
	font-weight: 600 !important;
	color: inherit !important;
	font-size: var(--wp--preset--font-size--large) !important;
}

/* Media & Text — rounded media, no inline border hacks */
.wp-block-media-text.is-style-rounded .wp-block-media-text__media img {
	border-radius: 20px;
}

/* Media & Text responsive — stack into a single column earlier than WP core's
   default 600px (two cramped columns look bad on tablet), image always first
   regardless of mediaPosition (core only guarantees that via is-stacked-on-mobile
   below 600px; same grid-row technique, wider breakpoint). */
@media (max-width: 781px) {
	.wp-block-media-text {
		grid-template-columns: 100% !important;
	}

	.wp-block-media-text > .wp-block-media-text__media {
		grid-column: 1 !important;
		grid-row: 1 !important;
	}

	.wp-block-media-text > .wp-block-media-text__content {
		grid-column: 1 !important;
		grid-row: 2 !important;
		padding-top: var(--wp--preset--spacing--30);
	}
}

/* Stat — big number + label, for the key-figures band */
.is-style-stat {
	text-align: center;
}

.is-style-stat .wp-block-heading {
	font-size: clamp(2.5rem, 4vw, 3.25rem);
	color: var(--wp--preset--color--primary);
	margin: 0;
}

.is-style-stat p {
	margin: 0.25rem 0 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	opacity: 0.7;
}

/* Scroll reveal — fades/lifts content in as it enters the viewport (see main.js) */
.is-style-reveal {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.6s ease, transform 0.6s ease;
}

.is-style-reveal.is-in-view {
	opacity: 1;
	transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
	.is-style-reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

/* Service icon chips — fixed-size, centered, on card backgrounds */
.service-icon img {
	width: 48px;
	height: 48px;
	object-fit: contain;
}

/* Buttons */
.wp-block-button:not(.is-style-outline-light) .wp-block-button__link {
	transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.wp-block-button:not(.is-style-outline-light) .wp-block-button__link:hover {
	box-shadow: 0 8px 24px rgba(124, 218, 36, 0.35);
	transform: translateY(-2px);
}

.wp-block-button.is-style-outline-light .wp-block-button__link {
	background-color: transparent;
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 4px;
	color: var(--wp--preset--color--base);
	transition: all 0.25s ease;
}

.wp-block-button.is-style-outline-light .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--contrast);
	transform: translateY(-2px);
}

/* Section anchor sidebar — fixed scrollspy nav, desktop only (onepager) */
.section-nav {
	position: fixed;
	left: var(--wp--preset--spacing--30, 1.5rem);
	top: 50%;
	transform: translateY(-50%);
	z-index: 500;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1.1rem;
}

.section-nav::before {
	content: "";
	position: absolute;
	left: 4px;
	top: 4px;
	bottom: 4px;
	width: 1px;
	background: rgba(0, 0, 0, 0.12);
	z-index: -1;
}

.section-nav__item {
	display: flex;
	align-items: center;
	gap: 0.7em;
	text-decoration: none;
	line-height: 1;
}

.section-nav__dot {
	flex-shrink: 0;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--wp--preset--color--base, #fff);
	border: 1px solid rgba(124, 218, 36, 0.5);
	transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.section-nav__label {
	font-family: var(--wp--preset--font-family--mono);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 0.7rem;
	/* Solid white/black/green, no transparency or blur — a translucent blurred
	   background over a dark section (e.g. on hover/active) let the black
	   bleed through and dropped the text well below readable contrast. */
	color: #000000;
	background: #ffffff;
	padding: 0.35em 0.8em;
	border-radius: 999px;
	border: 2px solid var(--wp--preset--color--primary);
	opacity: 0;
	transform: translateX(-6px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	white-space: nowrap;
	pointer-events: none;
}

.section-nav__item:hover .section-nav__label,
.section-nav__item:focus-visible .section-nav__label,
.section-nav__item.is-active .section-nav__label {
	opacity: 1;
	transform: translateX(0);
}

.section-nav__item:hover .section-nav__dot,
.section-nav__item:focus-visible .section-nav__dot {
	border-color: var(--wp--preset--color--primary);
	transform: scale(1.2);
}

.section-nav__item.is-active .section-nav__dot {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	transform: scale(1.3);
}

.section-nav__item.is-active .section-nav__label {
	border-width: 3px;
}

/* Docked state (see main.js) — stays position:fixed, main.js overrides `top`
   (desktop) or `bottom` (tablet/mobile) inline, in viewport px, to stop the
   nav right above the footer instead of floating on top of it. */

@media (max-width: 1279px) {
	/* Header nav is fixed at the top on this breakpoint too — a second fixed
	   nav pinned to the left would fight it for attention/space. Move it to a
	   floating bottom bar instead, like a mobile tab bar. */
	.section-nav {
		left: 50%;
		top: auto;
		bottom: var(--wp--preset--spacing--20, 1rem);
		transform: translateX(-50%);
		flex-direction: row;
		align-items: center;
		gap: 0.9rem;
		background: rgba(255, 255, 255, 0.85);
		backdrop-filter: blur(10px);
		-webkit-backdrop-filter: blur(10px);
		padding: 0.6rem 1.1rem;
		border-radius: 999px;
		box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
	}

	.section-nav::before {
		left: 4px;
		right: 4px;
		top: 50%;
		bottom: auto;
		width: auto;
		height: 1px;
		transform: translateY(-50%);
	}

	/* Not enough horizontal room for the label pill without it landing on top
	   of the section content (e.g. the hero heading) — dots + active color/scale
	   stay as the only indicator below desktop width. */
	.section-nav__label {
		display: none;
	}
}

/* Slightly tighter root gutter on small phones than the sitewide 1.5rem
   (theme.json styles.spacing.padding) — that value is what keeps full-width
   section content off the viewport edges everywhere below the 1344px content size. */
@media (max-width: 480px) {
	body {
		--wp--style--root--padding-left: var(--wp--preset--spacing--20);
		--wp--style--root--padding-right: var(--wp--preset--spacing--20);
	}
}
