/*
  Hub styles — deliberately plain CSS with no build step and no framework,
  so it stays visually distinct from the sub-sites it links to.
*/

/*
  The hub is dark-only by design — no light variant, no toggle, no
  prefers-color-scheme. data-theme="dark" on <html> (index.html) is what
  selects this palette; keep it there rather than moving these tokens to a
  bare :root, which would make the page themeable again by accident.
*/
:root[data-theme="dark"] {
	--bg: #131211;
	--surface: #1c1b19;
	--border: #2b2926;
	--fg: #f2efea;
	--muted: #8f8a82;
	--accent: #e08a5c;

	/* Scrim over the hero photo, fading from opaque (text side) to clear. */
	--scrim-strong: rgb(14 13 12 / 82%);
	--scrim-soft: rgb(14 13 12 / 48%);
	--scrim-clear: rgb(14 13 12 / 8%);

	/* Cards sit on the photo, so they need their own translucent backing. */
	--card-bg: rgb(28 27 25 / 82%);
	--card-bg-hover: rgb(34 33 30 / 94%);

	--radius: 18px;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: "Noto Sans Thai", -apple-system, BlinkMacSystemFont, "Segoe UI",
		system-ui, sans-serif;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

/* ─── Hero background photo ───
   Fixed behind the page, with a scrim that fades from opaque on the left
   (where the text sits) to clear on the right, so the lotus stays visible. */
.backdrop {
	position: fixed;
	inset: 0;
	z-index: -1;
	overflow: hidden;
}

.backdrop img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	/* Push the lotus right of the text column and below the card row. */
	object-position: 22% 72%;
}

.backdrop::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		100deg,
		var(--scrim-strong) 0%,
		var(--scrim-strong) 26%,
		var(--scrim-soft) 48%,
		var(--scrim-clear) 78%
	);
}

/* Content sits above the fixed backdrop. */
.hero,
main,
footer {
	position: relative;
}

/* ─── Hero ─── */
.hero {
	max-width: 62rem;
	margin: 0 auto;
	padding: clamp(4rem, 12vw, 8rem) clamp(1.25rem, 5vw, 2.5rem)
		clamp(2.5rem, 6vw, 4rem);
}

.eyebrow {
	margin: 0 0 1.25rem;
	font-size: 0.75rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--fg);
	opacity: 0.75;
}

.hero h1 {
	margin: 0 0 1.5rem;
	font-size: clamp(2.25rem, 7vw, 4.25rem);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.02em;
	/* Pure white rather than inherited --fg, plus a soft shadow, so the
	   title stays sharp over the busiest and brightest part of the photo. */
	color: #fff;
	text-shadow: 0 2px 20px rgb(0 0 0 / 55%);
}

/* "By" reads as a lead-in, not part of the name — its own line, smaller,
   lighter weight, and less prominent than "Chaiyun Damkaew Photography". */
.hero-by {
	display: block;
	margin-bottom: 0.25em;
	font-size: 0.4em;
	font-weight: 500;
	letter-spacing: 0;
	opacity: 0.7;
}

.lede {
	/* Kept narrow so it clears the lotus rather than running across it. */
	max-width: 26rem;
	margin: 0;
	color: var(--fg);
	opacity: 0.82;
	font-size: clamp(0.95rem, 2vw, 1.05rem);
	text-wrap: balance;
}

/* ─── QR button + dialog ─── */
.cards li {
	display: flex;
	flex-direction: column;
}

.cards li .card {
	flex: 1;
}

.qr-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 0.6rem;
	padding: 0.6rem 1rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--card-bg);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	color: var(--fg);
	font: inherit;
	font-size: 0.8rem;
	cursor: pointer;
	transition:
		border-color 0.18s ease,
		background-color 0.18s ease;
}

.qr-btn:hover,
.qr-btn:focus-visible {
	border-color: var(--accent);
	background: var(--card-bg-hover);
}

.qr-btn svg {
	width: 1.05em;
	height: 1.05em;
	flex: none;
}

.qr-dialog {
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--fg);
	padding: clamp(1.5rem, 4vw, 2rem);
	max-width: min(24rem, calc(100vw - 2rem));
}

.qr-dialog::backdrop {
	background: rgb(0 0 0 / 55%);
	backdrop-filter: blur(3px);
}

.qr-dialog h2 {
	margin: 0 0 1.25rem;
	font-size: 1.1rem;
	font-weight: 700;
	text-align: center;
}

/* White plate behind the code so it scans in either theme. */
.qr-canvas {
	background: #fff;
	border-radius: 12px;
	padding: 0.75rem;
}

.qr-canvas svg {
	display: block;
	width: 100%;
	height: auto;
}

.qr-url {
	margin: 1rem 0 0;
	color: var(--muted);
	font-size: 0.75rem;
	text-align: center;
	word-break: break-all;
}

.qr-actions {
	display: flex;
	justify-content: center;
	margin-top: 1.25rem;
}

.qr-close {
	padding: 0.5rem 1.5rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
	transition: border-color 0.18s ease;
}

.qr-close:hover,
.qr-close:focus-visible {
	border-color: var(--accent);
}

/* ─── Cards ─── */
main {
	max-width: 62rem;
	margin: 0 auto;
	padding: 0 clamp(1.25rem, 5vw, 2.5rem) clamp(4rem, 10vw, 7rem);
}

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.card {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 1.75rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--card-bg);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	color: inherit;
	text-decoration: none;
	transition:
		transform 0.18s ease,
		border-color 0.18s ease,
		background-color 0.18s ease,
		box-shadow 0.18s ease;
}

.card:hover,
.card:focus-visible {
	transform: translateY(-3px);
	border-color: var(--accent);
	background: var(--card-bg-hover);
	box-shadow: 0 12px 28px rgb(0 0 0 / 14%);
}

.card h2 {
	margin: 0 0 0.6rem;
	font-size: 1.3rem;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.card p {
	flex: 1;
	margin: 0 0 1.5rem;
	color: var(--muted);
	font-size: 0.9rem;
}

.card-status {
	display: inline-block;
	align-self: flex-start;
	margin-bottom: 1rem;
	padding: 0.15rem 0.7rem;
	border-radius: 999px;
	background: var(--accent);
	color: #fff;
	font-size: 0.7rem;
	font-weight: 600;
}

.card-status.is-soon {
	background: transparent;
	border: 1px solid var(--border);
	color: var(--muted);
	font-weight: 400;
}

.card-tech {
	font-size: 0.75rem;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

/* ─── Footer ─── */
footer {
	border-top: 1px solid var(--border);
	padding: 2rem clamp(1.25rem, 5vw, 2.5rem);
	background: var(--scrim-strong);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
}

footer span {
	display: block;
	max-width: 62rem;
	margin: 0 auto;
	color: var(--muted);
	font-size: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
	.card {
		transition: none;
	}
	.card:hover,
	.card:focus-visible {
		transform: none;
	}
}
