/**
 * Nền tảng: reset, kiểu chữ mặc định, khung nội dung, tiện ích dùng chung.
 */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

body {
	margin: 0;
	background-color: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--fs-base);
	font-weight: var(--fw-light); /* chữ nội dung mảnh (300) */
	line-height: var(--lh-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0;
	color: var(--color-heading);
	font-family: var(--font-title);
	font-weight: var(--fw-regular);
	line-height: var(--lh-heading);
}

p,
figure,
blockquote {
	margin: 0;
}

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

a {
	color: inherit;
	text-decoration: none;
}

button {
	font: inherit;
	color: inherit;
}

:focus-visible {
	outline: 2px solid var(--color-gradient-end);
	outline-offset: 3px;
}

/* Neo trong trang không bị header cố định che mất */
[id] {
	scroll-margin-top: var(--header-height);
}

/* ------------------------------------------------------------------------
 * Khung nội dung: tối đa 1920px, màn rộng hơn thì khoảng trắng mở đều hai bên
 * ---------------------------------------------------------------------- */

.container {
	width: 100%;
	max-width: var(--page-max);
	margin-inline: auto;
	padding-inline: var(--page-gutter);
}

/* ------------------------------------------------------------------------
 * Tiện ích
 * ---------------------------------------------------------------------- */

/**
 * Ẩn khỏi mắt nhưng trình đọc màn hình và công cụ tìm kiếm vẫn đọc được.
 * Dùng cho chữ thật đi kèm các số liệu dạng SVG (3.13 ha, 05 tòa NOXH...).
 */
.visually-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.skip-link {
	position: fixed;
	top: var(--space-xs);
	left: var(--space-xs);
	z-index: var(--z-modal);
	padding: var(--space-xs) var(--space-sm);
	background: var(--color-white);
	color: var(--color-heading);
	border-radius: var(--radius-sm);
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: none;
}

.icon {
	flex: none;
	width: 1em;
	height: 1em;
}

/* ------------------------------------------------------------------------
 * Nút
 * ---------------------------------------------------------------------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	padding: 0.8em 1.6em;
	border: 0;
	cursor: pointer;
	font-family: var(--font-body);
	font-weight: var(--fw-bold);
	line-height: 1.2;
	white-space: nowrap;
	transition: filter var(--duration) var(--ease), box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.btn--primary {
	background: var(--gradient-primary);
	color: var(--color-white);
}

.btn--primary:hover {
	filter: brightness(1.06);
	box-shadow: var(--shadow-raised);
}

.btn--primary:active {
	transform: translateY(1px);
}

/* Nội dung trang mặc định (index.php) */
.page-content {
	padding-block: var(--section-space);
}

/* ------------------------------------------------------------------------
 * Số liệu chữ hẹp (Big Shoulders): số lớn, đơn vị nhỏ đặt sát chân số.
 * Cỡ chữ đặt bằng --stat-num / --stat-unit ở từng nơi dùng.
 * ---------------------------------------------------------------------- */

.stat {
	display: inline-flex;
	align-items: flex-end;
	gap: 0.06em;
	font-family: var(--font-display);
	font-weight: var(--fw-extrabold);
	line-height: 0.8;
	text-transform: uppercase;
	white-space: nowrap;
}

.stat__num {
	font-size: var(--stat-num);
}

.stat__unit,
.stat__sep {
	font-size: var(--stat-unit);
}

.stat__unit {
	padding-bottom: 0.08em;
	line-height: 0.95;
}

.stat__sep {
	align-self: center;
	margin-inline: 0.15em;
	font-size: calc(var(--stat-unit) * 2.4);
}

/* ------------------------------------------------------------------------
 * Hiệu ứng xuất hiện khi cuộn tới (JS gắn .is-revealed qua IntersectionObserver).
 *   data-reveal="fade": hiện dần;  data-reveal="fly": bay vào từ trái.
 *   --reveal-i: thứ tự trong nhóm (trễ 80ms mỗi phần tử).
 * Chỉ ẩn khi có JS (html.js), để không mất nội dung nếu JS lỗi.
 * ---------------------------------------------------------------------- */

@keyframes reveal-fade {
	from {
		opacity: 0;
	}
}

@keyframes reveal-fly {
	from {
		opacity: 0;
		translate: -60px 0;
	}
}

/* Dùng animation (không dùng transition) để không ghi đè transition hover sẵn có của phần tử;
   chỉ đụng opacity + translate nên không xung đột với transform của hiệu ứng hover. */
.js [data-reveal]:not(.is-revealed) {
	opacity: 0;
}

.js [data-reveal].is-revealed {
	animation: reveal-fade 900ms var(--ease) calc(var(--reveal-i, 0) * 80ms) backwards;
}

.js [data-reveal="fly"].is-revealed {
	animation-name: reveal-fly;
	animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
	.js [data-reveal]:not(.is-revealed) {
		opacity: 1;
	}

	.js [data-reveal].is-revealed {
		animation: none;
	}
}

/* Trang chủ desktop cuộn theo từng section (site.js): ẩn thanh cuộn để không kéo được,
   vẫn cuộn bằng con lăn chuột / bàn phím / menu. */
html.is-paged {
	scrollbar-width: none;
}

html.is-paged::-webkit-scrollbar {
	display: none;
}
