/*
 * Quan Landing - main stylesheet.
 * Phong cách web-app tool: full-bleed tràn viền, hero gradient đỏ, thẻ bo góc
 * lớn đè lên mép hero, badge số, nút pill. Một màu nhấn duy nhất (đỏ) —
 * mọi màu phụ đều là đỏ pha trắng. Không framework, không JS.
 */

:root {
	/* --- Hệ màu suy từ 1 accent đỏ --- */
	--ld-accent: #e02424;
	--ld-accent-deep: #a11212;
	--ld-accent-bright: #ff6a4d;

	--ld-tint-bg: #fdf3f2;
	--ld-tint-bg-soft: #fff8f7;
	--ld-tint-border: #f4cfcb;
	--ld-tint-text: #8f2b26;

	/* --- Trung tính --- */
	--ld-bg: #fbfafa;
	--ld-surface: #ffffff;
	--ld-text: #1a1416;
	--ld-muted: #6d6467;
	--ld-border: #e9e6e6;

	--ld-shadow-sm: 0 2px 10px rgba(90, 20, 16, 0.05);
	--ld-shadow: 0 18px 44px rgba(90, 20, 16, 0.13);
	--ld-shadow-lg: 0 28px 64px rgba(90, 20, 16, 0.21);

	--ld-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
	box-sizing: border-box;
}

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

body {
	margin: 0;
	font-family: var(--ld-font);
	background: var(--ld-bg);
	color: var(--ld-text);
	font-size: 14px;
	line-height: 1.5;

	/* Các lớp nền dùng position: fixed nên chặn tràn ngang cho chắc */
	overflow-x: hidden;
}

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

a {
	color: var(--ld-accent-deep);
	text-decoration: none;
}

ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

h1, h2, h3 {
	margin: 0 0 0.4em;
	line-height: 1.15;
	font-weight: 800;
}

p {
	margin: 0 0 1em;
}

/* ---------- Khung app: FULL-BLEED, không viền, không thẻ nổi ---------- */

.ld-main {
	position: relative;
	isolation: isolate;
	width: 100%;
	min-height: 100vh;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	overflow: hidden;

	/* Nắng đỏ nhạt dần — cố định theo màn hình, không trôi khi cuộn trang */
	background:
		linear-gradient(180deg, rgba(253, 243, 242, 0.78) 0%, rgba(253, 243, 242, 0) 62vh),
		var(--ld-bg);
	background-attachment: fixed, fixed;
}

/* Hình trang trí thuần CSS — chỉ viền mảnh, rất mờ, để nền có cấu trúc
   mà không tranh chỗ với nội dung. Tất cả đứng yên khi cuộn. */
.ld-main::before,
.ld-main::after {
	content: "";
	position: fixed;
	z-index: -1;
	pointer-events: none;
}

/* Vòng tròn viền mảnh bên phải */
.ld-main::before {
	right: -9vw;
	top: 26vh;
	width: 440px;
	height: 440px;
	border: 1px solid rgba(224, 36, 36, 0.11);
	border-radius: 50%;
}

/* Khối bo góc nghiêng bên trái */
.ld-main::after {
	left: -70px;
	top: 64vh;
	width: 260px;
	height: 260px;
	border: 1px solid rgba(224, 36, 36, 0.09);
	border-radius: 68px;
	transform: rotate(18deg);
}

/* ---------- Vệt cong mờ đầu trang ----------
   Bản lật ngược của vệt cong ở đáy trang, để đầu và cuối trang đồng bộ. */

.ld-top {
	position: relative;
	height: 172px;
}

.ld-top::after {
	content: "";
	position: fixed;
	z-index: -1;
	left: 50%;
	top: -150px;
	transform: translateX(-50%);
	width: 160vw;
	height: 310px;
	border-radius: 0 0 50% 50%;
	background: linear-gradient(0deg, rgba(224, 36, 36, 0.015), rgba(224, 36, 36, 0.13));
	pointer-events: none;
}

/* Khung nội dung chung */
.ld-shell {
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 52px;
}

/* ---------- Thẻ giới thiệu bản thân ---------- */

.ld-profile {
	position: relative;
	z-index: 2;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: 34px;
	margin-top: -66px;
	padding: 34px 40px;
	background: var(--ld-surface);
	border: 1px solid var(--ld-border);
	border-radius: 28px;
	box-shadow: var(--ld-shadow);
	color: inherit;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
	animation: ld-rise 0.24s ease both;
}

a.ld-profile:hover,
a.ld-profile:focus-visible {
	transform: translateY(-3px);
	border-color: rgba(224, 36, 36, 0.28);
	box-shadow: var(--ld-shadow-lg);
}

a.ld-profile:focus-visible {
	outline: 3px solid var(--ld-accent);
	outline-offset: 3px;
}

/* Nhấn xuống — có cả khi không gắn đường dẫn (chỉ hiệu ứng, không đi đâu) */
.ld-profile:active {
	transform: scale(0.992);
	box-shadow: var(--ld-shadow-sm);
}

.ld-profile--static {
	cursor: default;
	-webkit-tap-highlight-color: transparent;
}

/* Ảnh tròn bên trái */
.ld-profile__avatar {
	position: relative;
	width: 152px;
	height: 152px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--ld-tint-bg);
	box-shadow:
		0 0 0 4px var(--ld-surface),
		0 0 0 5px rgba(224, 36, 36, 0.16),
		0 10px 26px rgba(90, 20, 16, 0.16);
}

.ld-profile__img,
.ld-profile__placeholder {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ld-profile__placeholder {
	background: linear-gradient(135deg, var(--ld-tint-bg) 0%, #f9dcd8 100%);
}

.ld-profile__body {
	min-width: 0;
}

.ld-profile__role {
	margin: 0 0 8px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ld-accent-deep);
}

.ld-profile__name {
	margin: 0 0 10px;
	font-size: clamp(28px, 3vw + 12px, 42px);
	letter-spacing: -0.045em;
	font-weight: 800;
}

a.ld-profile:hover .ld-profile__name {
	color: var(--ld-accent-deep);
}

.ld-profile__bio {
	margin: 0;
	max-width: 640px;
	font-size: 15px;
	line-height: 1.65;
	color: var(--ld-muted);
}

.ld-profile__cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	margin-top: 18px;
	padding: 0 24px;
	border-radius: 99px;
	background: var(--ld-accent-deep);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	box-shadow: 0 8px 20px rgba(161, 18, 18, 0.24);
	transition: background 0.15s ease, transform 0.15s ease;
}

a.ld-profile:hover .ld-profile__cta {
	background: #8c0f0f;
	transform: translateY(-1px);
}

/* ---------- Khu công cụ ---------- */

.ld-tools {
	position: relative;
	padding: 56px 0 80px;
}

/* Đường kẻ mảnh mờ dần hai đầu — tách thẻ giới thiệu với khu công cụ */
.ld-tools::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 0;
	transform: translateX(-50%);
	width: min(1076px, calc(100% - 104px));
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(224, 36, 36, 0.22), transparent);
}

/* Vệt cong mờ ở đáy màn hình — đối xứng với vệt trên, cũng đứng yên */
.ld-tools::after {
	content: "";
	position: fixed;
	z-index: -1;
	left: 50%;
	bottom: -60px;
	transform: translateX(-50%);
	width: 160vw;
	height: 300px;
	border-radius: 50% 50% 0 0;
	background: linear-gradient(180deg, rgba(224, 36, 36, 0.1), rgba(224, 36, 36, 0.015));
	pointer-events: none;
}

/* Khi tắt thẻ giới thiệu, khu công cụ là phần đầu tiên — bỏ đường kẻ */
.ld-main > .ld-tools:first-child {
	padding-top: 72px;
}

.ld-main > .ld-tools:first-child::before {
	display: none;
}

.ld-tools__head {
	margin-bottom: 28px;
	text-align: center;
}

.ld-tools__eyebrow {
	margin: 0 0 10px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ld-accent-deep);
}

.ld-tools__title {
	margin: 0 0 10px;
	font-size: clamp(26px, 2vw + 14px, 36px);
	letter-spacing: -0.035em;
}

.ld-tools__text {
	margin: 0 auto;
	max-width: 620px;
	font-size: 15px;
	color: var(--ld-muted);
}

/* Tự chia cột theo số thẻ đang bật: 1 thẻ căn giữa, 2-3 thẻ 1 hàng,
   nhiều hơn thì tự xuống hàng. */
.ld-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 28px;
	justify-content: center;
}

.ld-cards--1 {
	grid-template-columns: minmax(0, 520px);
}

/* ---------- Thẻ ---------- */

.ld-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--ld-surface);
	border: 1px solid var(--ld-border);
	border-radius: 26px;
	box-shadow: var(--ld-shadow);
	overflow: hidden;
	color: inherit;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
	animation: ld-rise 0.24s ease both;
}

@keyframes ld-rise {
	from { opacity: 0; transform: translateY(7px); }
	to   { opacity: 1; transform: translateY(0); }
}

a.ld-card:hover,
a.ld-card:focus-visible {
	transform: translateY(-3px);
	border-color: rgba(224, 36, 36, 0.28);
	box-shadow: var(--ld-shadow-lg);
}

a.ld-card:focus-visible {
	outline: 3px solid var(--ld-accent);
	outline-offset: 3px;
}

/* Ảnh thẻ: đúng tỉ lệ ảnh đại diện bài viết (16:9), cắt gọn, không méo */
.ld-card__media {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: var(--ld-tint-bg);
	overflow: hidden;
}

.ld-card__img,
.ld-card__placeholder {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.ld-card__placeholder {
	background: linear-gradient(135deg, var(--ld-tint-bg) 0%, #f9dcd8 100%);
}

a.ld-card:hover .ld-card__img {
	transform: scale(1.035);
}

.ld-card__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: 26px 28px 24px;
}

.ld-card__title {
	margin: 0 0 8px;
	font-size: 24px;
	letter-spacing: -0.035em;
	font-weight: 800;
	color: var(--ld-text);
	transition: color 0.2s ease;
}

a.ld-card:hover .ld-card__title,
a.ld-card:focus-visible .ld-card__title {
	color: var(--ld-accent-deep);
}

.ld-card__desc {
	margin: 0 0 20px;
	color: var(--ld-muted);
	font-size: 14px;
	line-height: 1.6;
}

/* Nút pill giả (cả thẻ đã là link nên đây chỉ là phần hiển thị) */
.ld-card__cta {
	margin-top: auto;
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 24px;
	border-radius: 99px;
	background: var(--ld-accent-deep);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	box-shadow: 0 8px 20px rgba(161, 18, 18, 0.24);
	transition: transform 0.15s ease, background 0.15s ease;
}

a.ld-card:hover .ld-card__cta {
	background: #8c0f0f;
	transform: translateY(-1px);
}

.ld-card--plain .ld-card__cta {
	background: var(--ld-tint-bg);
	color: var(--ld-tint-text);
	box-shadow: none;
}

.ld-empty {
	max-width: 620px;
	margin: 0 auto;
	padding: 20px 24px;
	border: 1px solid var(--ld-tint-border);
	border-radius: 13px;
	background: var(--ld-tint-bg-soft);
	color: var(--ld-tint-text);
	font-size: 13px;
	text-align: center;
}

/* ---------- Bài viết / trang tĩnh ---------- */

.ld-wrap--article {
	max-width: 820px;
	margin: 0 auto;
	padding: 48px 24px 72px;
}

.ld-article {
	background: var(--ld-surface);
	border: 1px solid var(--ld-border);
	border-radius: 26px;
	box-shadow: var(--ld-shadow-sm);
	padding: 31px;
	font-size: 15px;
	line-height: 1.7;
}

.ld-article__title {
	font-size: clamp(26px, 2vw + 16px, 38px);
	letter-spacing: -0.035em;
	margin-bottom: 0.5em;
}

.ld-article__thumb {
	margin: 0 0 24px;
	border-radius: 18px;
	overflow: hidden;
}

.ld-article__content img {
	border-radius: 18px;
}

.ld-article__content h2,
.ld-article__content h3 {
	margin-top: 1.4em;
	letter-spacing: -0.03em;
}

.ld-article__content a {
	text-decoration: underline;
}

.ld-article__content blockquote {
	margin: 1.5em 0;
	padding: 12px 20px;
	border-left: 3px solid var(--ld-tint-border);
	border-radius: 0 13px 13px 0;
	background: var(--ld-tint-bg-soft);
	color: var(--ld-tint-text);
}

.ld-list__item {
	padding: 14px 0;
	border-bottom: 1px solid var(--ld-border);
	font-size: 15px;
}

.ld-back {
	margin: 26px 0 0;
	text-align: center;
}

.ld-back a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 22px;
	border-radius: 99px;
	border: 1px solid var(--ld-tint-border);
	background: #fff;
	color: var(--ld-accent-deep);
	font-weight: 700;
	transition: background 0.15s ease;
}

.ld-back a:hover {
	background: var(--ld-tint-bg-soft);
}

.ld-pagination {
	margin-top: 20px;
	text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 1040px) {
	.ld-shell {
		padding: 0 32px;
	}

	.ld-profile {
		gap: 26px;
		padding: 30px 30px;
	}

	.ld-profile__avatar {
		width: 128px;
		height: 128px;
	}
}

@media (max-width: 720px) {
	.ld-top {
		height: 128px;
	}

	.ld-top::after {
		height: 230px;
		top: -110px;
	}

	.ld-shell {
		padding: 0 22px;
	}

	/* Ảnh tròn lên trên, chữ xuống dưới, căn giữa cho gọn màn hình hẹp */
	.ld-profile {
		grid-template-columns: minmax(0, 1fr);
		justify-items: center;
		text-align: center;
		gap: 18px;
		margin-top: -52px;
		padding: 26px 22px 28px;
	}

	.ld-profile__bio {
		font-size: 14px;
	}

	.ld-tools {
		padding: 44px 0 56px;
	}

	.ld-tools::before {
		width: calc(100% - 44px);
	}

	.ld-tools::after {
		height: 220px;
		bottom: -50px;
	}

	/* iOS Safari xử lý background-attachment: fixed không mượt — trả về mặc
	   định trên màn hẹp, các lớp position: fixed vẫn đứng yên bình thường. */
	.ld-main {
		background-attachment: scroll, scroll;
	}

	/* Màn hẹp: bỏ bớt hình trang trí cho thoáng */
	.ld-main::after {
		display: none;
	}

	.ld-main::before {
		right: -42vw;
		top: 32vh;
		width: 330px;
		height: 330px;
	}

	.ld-main > .ld-tools:first-child {
		padding-top: 52px;
	}

	.ld-cards,
	.ld-cards--1 {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}

	.ld-card__body {
		padding: 22px 22px 20px;
	}

	.ld-card__title {
		font-size: 21px;
	}

	.ld-wrap--article {
		padding: 32px 16px 56px;
	}

	.ld-article {
		padding: 22px;
	}
}
