/* CROSS 2026 – foundations: tokens, typography, buttons, header, footer. Presets come from theme.json. */

:root {
	--x-primary: var(--wp--preset--color--primary);
	--x-deep: var(--wp--preset--color--primary-deep);
	--x-crimson: var(--wp--preset--color--crimson);
	--x-coral: var(--wp--preset--color--coral);
	--x-cobalt: var(--wp--preset--color--cobalt);
	--x-cobalt-soft: var(--wp--preset--color--cobalt-soft);
	--x-mint: var(--wp--preset--color--mint);
	--x-ink: var(--wp--preset--color--ink);
	--x-text: var(--wp--preset--color--ink-soft);
	--x-muted: var(--wp--preset--color--muted);
	--x-line: var(--wp--preset--color--line);
	--x-paper: var(--wp--preset--color--paper);
	--x-paper-deep: var(--wp--preset--color--paper-deep);
	--x-display: var(--wp--preset--font-family--display);
	--x-mono: var(--wp--preset--font-family--mono);
	--x-wide: 1240px;
	--x-radius: 20px;
	--x-radius-sm: 12px;
	--x-shadow-sm: 0 1px 2px rgba(21, 18, 27, 0.05), 0 2px 8px -4px rgba(21, 18, 27, 0.08);
	--x-shadow: 0 1px 2px rgba(21, 18, 27, 0.04), 0 18px 40px -22px rgba(21, 18, 27, 0.28);
	--x-shadow-lift: 0 2px 4px rgba(21, 18, 27, 0.04), 0 30px 60px -28px rgba(74, 0, 8, 0.4);
	--x-ease: cubic-bezier(0.22, 0.75, 0.2, 1);
	--x-header-h: 76px;
	--x-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	--x-i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4.5 10.5l3.5 3.5 7.5-8' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	--x-i-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 6l8 8M14 6l-8 8' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
	--x-i-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 10h11M11 5.5l4.5 4.5L11 14.5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	--x-i-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6.6 3.5l1.6 3.2-1.4 1.4a10 10 0 004.9 4.9l1.4-1.4 3.2 1.6v2.6c0 .7-.6 1.2-1.3 1.2A13.6 13.6 0 012.4 4.8c0-.7.5-1.3 1.2-1.3h3z' fill='%23000'/%3E%3C/svg%3E");
	--x-i-chat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M3 5.5A2.5 2.5 0 015.5 3h9A2.5 2.5 0 0117 5.5v6a2.5 2.5 0 01-2.5 2.5H9l-4 3v-3h0A2 2 0 013 12V5.5z' fill='%23000'/%3E%3C/svg%3E");
}

/* ---------- Globals ---------- */
html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--x-header-h) + 20px);
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	font-feature-settings: "ss01";
}

body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 100;
	pointer-events: none;
	background-image: var(--x-grain);
	opacity: 0.045;
	mix-blend-mode: multiply;
}

.wp-site-blocks > * + * {
	margin-block-start: 0;
}

:where(h1, h2, h3) {
	font-optical-sizing: auto;
	text-wrap: balance;
}

:where(p) {
	text-wrap: pretty;
}

::selection {
	background: var(--x-primary);
	color: #fff;
}

:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
	outline: 2px solid var(--x-cobalt);
	outline-offset: 3px;
	border-radius: 6px;
}

.x-mono {
	font-family: var(--x-mono);
	font-size: 0.8125rem;
	letter-spacing: 0;
}

/* Kicker: short line above a heading. Mono, sentence case, with the brand square. */
.x-kicker {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0 0 1rem;
	font-family: var(--x-mono);
	font-size: 0.8125rem;
	color: var(--x-muted);
}

.x-kicker::before {
	content: "";
	width: 0.55rem;
	height: 0.55rem;
	background: var(--x-primary);
	transform: rotate(45deg);
}

.is-dark .x-kicker,
.has-ink-background-color .x-kicker {
	color: rgba(255, 255, 255, 0.62);
}

.is-dark .x-kicker::before,
.has-ink-background-color .x-kicker::before {
	background: var(--x-coral);
}

/* Hand-drawn underline for the one emotional phrase in a heading. */
.x-scribble {
	position: relative;
	white-space: nowrap;
	color: var(--x-primary);
}

.x-scribble::after {
	content: "";
	position: absolute;
	left: -2%;
	right: -2%;
	bottom: -0.12em;
	height: 0.32em;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 20' preserveAspectRatio='none'%3E%3Cpath d='M3 14C60 6 120 4 178 7c40 2 80 5 119 2' fill='none' stroke='%23FF6B57' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
	transform-origin: left;
	animation: x-draw 1.1s 0.5s var(--x-ease) both;
}

@keyframes x-draw {
	from { transform: scaleX(0); }
	to { transform: scaleX(1); }
}

/* Registration marks from the CROSS emblem, on section corners. */
.x-marks {
	position: relative;
}

.x-marks::before,
.x-marks::after {
	content: "";
	position: absolute;
	width: 15px;
	height: 15px;
	pointer-events: none;
	background:
		linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat,
		linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
	color: rgba(21, 18, 27, 0.28);
}

.x-marks::before {
	top: 22px;
	left: max(16px, calc((100% - var(--x-wide)) / 2 - 28px));
}

.x-marks::after {
	top: 22px;
	right: max(16px, calc((100% - var(--x-wide)) / 2 - 28px));
}

.is-dark.x-marks::before,
.is-dark.x-marks::after {
	color: rgba(255, 255, 255, 0.28);
}

/* ---------- Buttons ---------- */
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	transition: background-color 0.25s var(--x-ease), color 0.25s, border-color 0.25s, transform 0.25s var(--x-ease), box-shadow 0.25s;
}

.wp-block-button:not(.is-style-outline, .is-style-zalo, .is-style-ghost-light) .wp-block-button__link {
	background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 55%);
	box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18), 0 10px 24px -14px rgba(128, 0, 0, 0.9);
}

.wp-block-button:not(.is-style-outline, .is-style-zalo, .is-style-ghost-light) .wp-block-button__link::after {
	content: "";
	width: 1.05em;
	height: 1.05em;
	background: currentColor;
	mask: var(--x-i-arrow) center / contain no-repeat;
	transition: transform 0.25s var(--x-ease);
}

.wp-block-button__link:hover {
	transform: translateY(-2px);
}

.wp-block-button__link:hover::after {
	transform: translateX(3px);
}

.wp-block-button__link:active {
	transform: translateY(0);
}

.wp-block-button.is-style-outline > .wp-block-button__link {
	color: var(--x-ink);
	background: transparent;
	border: 1.5px solid rgba(21, 18, 27, 0.22);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	color: var(--x-ink);
	background: #fff;
	border-color: var(--x-ink);
}

.wp-block-button.is-style-zalo > .wp-block-button__link {
	color: var(--x-ink);
	background: #fff;
	border: 1.5px solid var(--x-line);
	box-shadow: var(--x-shadow-sm);
}

.wp-block-button.is-style-zalo > .wp-block-button__link::before {
	content: "Zalo";
	display: grid;
	place-items: center;
	width: 1.9rem;
	height: 1.9rem;
	margin: -0.35rem 0 -0.35rem -0.6rem;
	font-size: 0.6rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: #fff;
	background: #0068ff;
	border-radius: 50%;
}

.wp-block-button.is-style-zalo > .wp-block-button__link:hover {
	border-color: #0068ff;
}

.wp-block-button.is-style-ghost-light > .wp-block-button__link {
	color: #fff;
	background: rgba(255, 255, 255, 0.06);
	border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.wp-block-button.is-style-ghost-light > .wp-block-button__link:hover {
	background: rgba(255, 255, 255, 0.14);
	border-color: #fff;
}

.x-link a,
a.x-link {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-weight: 700;
	color: var(--x-ink);
	text-decoration: none;
	background: linear-gradient(currentColor, currentColor) left bottom / 100% 1.5px no-repeat;
	padding-bottom: 2px;
	transition: background-size 0.3s var(--x-ease), color 0.2s;
}

.x-link a::after,
a.x-link::after {
	content: "";
	width: 1em;
	height: 1em;
	background: currentColor;
	mask: var(--x-i-arrow) center / contain no-repeat;
	transition: transform 0.25s var(--x-ease);
}

.x-link a:hover,
a.x-link:hover {
	color: var(--x-primary);
	background-size: 0 1.5px;
}

.x-link a:hover::after,
a.x-link:hover::after {
	transform: translateX(4px);
}

.is-dark .x-link a {
	color: #fff;
}

/* ---------- Header ---------- */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 60;
}

@media (min-width: 601px) {
	.admin-bar .wp-site-blocks > header.wp-block-template-part {
		top: var(--wp-admin--admin-bar--height, 32px);
	}
}

.x-header {
	background: rgba(250, 248, 245, 0.86);
	-webkit-backdrop-filter: saturate(1.4) blur(14px);
	backdrop-filter: saturate(1.4) blur(14px);
	border-bottom: 1px solid transparent;
	transition: border-color 0.3s, box-shadow 0.3s;
}

.is-scrolled .x-header {
	border-bottom-color: var(--x-line);
	box-shadow: 0 10px 30px -24px rgba(21, 18, 27, 0.4);
}

.x-header__inner {
	min-height: var(--x-header-h);
	gap: 1.5rem;
}

.x-header .wp-block-image {
	margin: 0;
	flex-shrink: 0;
}

.x-header .wp-block-image img {
	display: block;
	width: 132px;
	height: 51px;
	border-radius: 4px;
}

.x-header__right {
	gap: 1.5rem !important;
}

.x-nav .wp-block-navigation-item__content {
	color: var(--x-ink);
	text-decoration: none;
	padding: 0.4rem 0;
	transition: color 0.2s;
}

.x-nav .wp-block-navigation-item__content:hover {
	color: var(--x-primary);
}

.x-nav .wp-block-navigation__submenu-container {
	min-width: 290px !important;
	padding: 0.5rem !important;
	background: #fff !important;
	border: 1px solid var(--x-line) !important;
	border-radius: 16px;
	box-shadow: var(--x-shadow);
}

.x-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 0.65rem 0.8rem !important;
	border-radius: 10px;
	font-weight: 600;
}

.x-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
	background: var(--x-paper);
}

.x-nav .wp-block-navigation__responsive-container.is-menu-open {
	padding: 1.5rem;
	background: var(--x-paper) !important;
}

.x-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-family: var(--x-display);
	font-size: 1.6rem;
	font-weight: 700;
}

.x-header__phone {
	margin: 0;
	white-space: nowrap;
}

.x-header__phone a {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-family: var(--x-mono);
	font-size: 0.875rem;
	color: var(--x-ink);
	text-decoration: none;
}

.x-header__phone a::before {
	content: "";
	width: 0.95rem;
	height: 0.95rem;
	background: var(--x-primary);
	mask: var(--x-i-phone) center / contain no-repeat;
}

.x-header__cta .wp-block-button__link {
	padding: 0.7rem 1.15rem;
	font-size: 0.9rem;
}

@media (max-width: 1100px) {
	.x-header__phone {
		display: none !important;
	}
}

@media (max-width: 781px) {
	.x-header .x-header__cta {
		display: none !important;
	}

	.x-header .wp-block-image img {
		width: 112px;
		height: 44px;
	}
}

/* ---------- Footer ---------- */
.x-footer {
	position: relative;
	overflow: hidden;
	color: rgba(255, 255, 255, 0.72);
	font-size: 0.9375rem;
}

.x-footer::after {
	content: "";
	position: absolute;
	right: -6%;
	bottom: -18%;
	width: min(520px, 60vw);
	aspect-ratio: 1;
	background: url("../images/cross-emblem-800.webp") center / contain no-repeat;
	opacity: 0.16;
	filter: grayscale(0.2);
	pointer-events: none;
}

.x-footer a {
	color: rgba(255, 255, 255, 0.82);
	text-decoration: none;
}

.x-footer a:hover {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.x-footer__big {
	margin: 0;
	font-family: var(--x-display);
	font-size: clamp(2rem, 1.2rem + 3vw, 3.75rem);
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -0.03em;
	color: #fff;
}

.x-footer__big a {
	color: var(--x-coral);
	text-decoration: underline;
	text-decoration-thickness: 3px;
	text-underline-offset: 0.12em;
}

.x-footer__title {
	margin: 0 0 1rem;
	font-family: var(--x-mono);
	font-size: 0.75rem !important;
	font-weight: 400;
	letter-spacing: 0.04em;
	color: rgba(255, 255, 255, 0.45);
}

.x-footer__links {
	display: grid;
	gap: 0.55rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.x-footer__logo {
	margin-bottom: 1.75rem !important;
}

.x-footer__logo img {
	width: 150px;
	height: 59px;
}

.x-footer__legal {
	margin: 0;
	font-family: var(--x-mono);
	font-size: 0.75rem;
	color: rgba(255, 255, 255, 0.45);
}

.x-footer__rule {
	width: 100% !important;
	max-width: none !important;
	border: 0 !important;
	border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
	opacity: 1;
}

@media (max-width: 781px) {
	.x-footer .wp-block-columns {
		row-gap: 2.25rem;
	}
}

/* ---------- Mobile contact bar ---------- */
.wp-site-blocks .x-mobilebar {
	display: none !important;
}

@media (max-width: 781px) {
	.wp-site-blocks .x-mobilebar {
		position: fixed;
		right: 0.6rem;
		bottom: calc(0.6rem + env(safe-area-inset-bottom));
		left: 0.6rem;
		z-index: 70;
		display: flex !important;
		gap: 0.4rem !important;
		padding: 0.4rem;
		background: rgba(21, 18, 27, 0.94);
		border-radius: 18px;
		box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.55);
		-webkit-backdrop-filter: blur(10px);
		backdrop-filter: blur(10px);
	}

	.x-mobilebar p {
		flex: 1;
		margin: 0;
	}

	.x-mobilebar .x-mobilebar__primary {
		flex: 1.6;
	}

	.x-mobilebar a {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 0.4rem;
		height: 46px;
		font-size: 0.875rem;
		font-weight: 700;
		color: #fff;
		text-decoration: none;
		border-radius: 13px;
	}

	.x-mobilebar__call a::before,
	.x-mobilebar__zalo a::before {
		content: "";
		width: 1rem;
		height: 1rem;
		background: currentColor;
		mask: var(--x-i-phone) center / contain no-repeat;
	}

	.x-mobilebar__zalo a::before {
		mask-image: var(--x-i-chat);
	}

	.x-mobilebar__primary a {
		background: var(--x-primary);
	}

	body {
		padding-bottom: calc(76px + env(safe-area-inset-bottom));
	}
}

/* ---------- Reveal on scroll (JS adds .is-in) ---------- */
.js .x-reveal {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.8s var(--x-ease), transform 0.8s var(--x-ease);
}

.js .x-reveal.is-in {
	opacity: 1;
	transform: none;
}

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

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition: none !important;
	}

	.js .x-reveal {
		opacity: 1;
		transform: none;
	}
}
