/* ───────────────────────────────────────────────
   สไตล์กลางของ landing ทั้งสองภาษา (/ และ /en/)

   www คือที่กำหนด "แบรนด์" ของ qrspc — token ใน :root ข้างล่างเป็น source of
   truth (console จะย้ายมาใช้ชุดเดียวกันทีหลัง) อยากเปลี่ยนสีแบรนด์ให้แก้ที่
   --primary* ที่เดียว ห้าม hardcode สีใน rule อื่น

   ภาษาของดีไซน์: เรียบ แต่มี "มิติ" — พื้นโทนอุ่น, เงาซ้อนบางๆ, ปุ่มมีขอบบน
   สว่าง 1px ให้รู้สึกนูนโดยไม่ต้องเป็น gradient (แนว Linear / Stripe)

   Mobile-first: ค่าตั้งต้นทั้งหมดคือจอมือถือ
   จอกว้าง ≥640px ค่อย override ใน media query ท้ายไฟล์
   ─────────────────────────────────────────────── */
/* ───── ฟอนต์: Noto Sans Thai self-host ใน fonts/ (SIL OFL — ดู fonts/LICENSE) ─────
   ไฟล์ woff2 จาก @fontsource/noto-sans-thai แยก subset ไทย/ละติน ต่อน้ำหนัก
   (~9–10 KB ต่อไฟล์) — unicode-range ทำให้ browser โหลดเฉพาะ subset ที่หน้านั้น
   ใช้จริง หน้าไทยโหลด thai+latin หน้าอังกฤษโหลดแค่ latin
   url() resolve เทียบกับไฟล์ CSS นี้ จึงใช้ได้ทั้ง / และ /en/
   font-display: swap → ข้อความขึ้นทันทีด้วยฟอนต์ระบบแล้วค่อยสลับ ไม่มีหน้าขาวรอฟอนต์
   อัปเดตฟอนต์เมื่อไหร่ให้แก้ 404.html ที่ฝัง @font-face ชุดเดียวกันด้วย */
@font-face {
	font-family: 'Noto Sans Thai'; font-style: normal; font-weight: 400; font-display: swap;
	src: url('fonts/noto-sans-thai-thai-400-normal.woff2') format('woff2');
	unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
	font-family: 'Noto Sans Thai'; font-style: normal; font-weight: 500; font-display: swap;
	src: url('fonts/noto-sans-thai-thai-500-normal.woff2') format('woff2');
	unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
	font-family: 'Noto Sans Thai'; font-style: normal; font-weight: 600; font-display: swap;
	src: url('fonts/noto-sans-thai-thai-600-normal.woff2') format('woff2');
	unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
	font-family: 'Noto Sans Thai'; font-style: normal; font-weight: 700; font-display: swap;
	src: url('fonts/noto-sans-thai-thai-700-normal.woff2') format('woff2');
	unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
	font-family: 'Noto Sans Thai'; font-style: normal; font-weight: 400; font-display: swap;
	src: url('fonts/noto-sans-thai-latin-400-normal.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Noto Sans Thai'; font-style: normal; font-weight: 500; font-display: swap;
	src: url('fonts/noto-sans-thai-latin-500-normal.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Noto Sans Thai'; font-style: normal; font-weight: 600; font-display: swap;
	src: url('fonts/noto-sans-thai-latin-600-normal.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Noto Sans Thai'; font-style: normal; font-weight: 700; font-display: swap;
	src: url('fonts/noto-sans-thai-latin-700-normal.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
	color-scheme: light;

	/* ── สีแบรนด์: teal — ต่างจากเครื่องมือ QR ทั่วไปที่เป็นน้ำเงินกันหมด ── */
	--primary: oklch(0.52 0.12 195);        /* #007d7e — ตัวขาวบนสีนี้ contrast 4.96 ผ่าน AA */
	--primary-hover: oklch(0.47 0.12 195);
	--primary-edge: oklch(0.44 0.12 195);   /* เส้นขอบรอบปุ่ม เข้มกว่าพื้นปุ่มนิดเดียวให้ขอบคม */
	--primary-soft: oklch(0.95 0.03 195);   /* พื้นอ่อน: เลขขั้นตอน, glow หลัง hero */
	--primary-ring: oklch(0.52 0.12 195 / 0.22); /* focus ring */

	/* ── neutral โทนอุ่น (stone) — ขาวอมครีม ไม่ใช่เทาฟ้าแบบ zinc ── */
	--bg: oklch(0.985 0.004 80);
	--surface: #ffffff;
	--surface-hover: oklch(0.975 0.004 80);
	--fg: oklch(0.21 0.012 80);
	--muted: oklch(0.5 0.012 80);
	--faint: oklch(0.7 0.01 80);
	--border: oklch(0.9 0.008 80);
	--border-strong: oklch(0.84 0.01 80);
	--error: oklch(0.55 0.2 27);

	/* ── ความมน ── */
	--radius-sm: 8px;
	--radius-md: 12px;
	--radius-lg: 16px;
	--radius-xl: 22px;

	/* ── เงา: ซ้อนหลายชั้นบางๆ (สีเดียวกับ --fg) ให้ดู "ลอย" แบบเนียน
	      ไม่ใช่ drop shadow เทาก้อนเดียว ── */
	--shadow-color: oklch(0.21 0.012 80);
	--shadow-xs: 0 1px 2px oklch(from var(--shadow-color) l c h / 0.06);
	--shadow-md:
		0 1px 2px oklch(from var(--shadow-color) l c h / 0.05),
		0 4px 12px oklch(from var(--shadow-color) l c h / 0.06);
	--shadow-lg:
		0 1px 2px oklch(from var(--shadow-color) l c h / 0.05),
		0 8px 24px oklch(from var(--shadow-color) l c h / 0.08),
		0 24px 48px -12px oklch(from var(--shadow-color) l c h / 0.12);

	/* ── ฟอนต์: Noto Sans Thai ไทย+ละตินชุดเดียว (ไม่มีหัว อ่านบนจอชัด)
	      รหัสเพจใช้ mono ของระบบ ไม่โหลดฟอนต์เพิ่ม ── */
	--font-sans: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
	font-family: var(--font-sans);
	background: var(--bg);
	color: var(--fg);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	/* ตัดไฮไลต์สี่เหลี่ยมเทาเวลาแตะบน iOS/Android */
	-webkit-tap-highlight-color: transparent;
}
::selection { background: var(--primary-soft); }

/* ───── โครงหน้า ───── */
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ───── ปุ่ม: recipe กลางที่ console จะใช้ตามทีหลัง ─────
   primary = พื้นทึบ + ขอบบนสว่าง 1px (inset) + เส้นขอบเข้ม 1px + เงาบาง
   hover เข้มขึ้น, active "ยุบ" (เงากลับด้านเป็น inset) */
.btn-primary {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	border: none; border-radius: var(--radius-md);
	background: var(--primary); color: #fff;
	font-family: inherit; font-weight: 600;
	text-decoration: none; cursor: pointer;
	box-shadow:
		inset 0 1px 0 0 rgb(255 255 255 / 0.16),
		0 0 0 1px var(--primary-edge),
		var(--shadow-xs);
	transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active {
	transform: translateY(1px);
	box-shadow:
		inset 0 1px 2px 0 rgb(0 0 0 / 0.18),
		0 0 0 1px var(--primary-edge);
}
.btn-primary:focus-visible {
	outline: none;
	box-shadow:
		inset 0 1px 0 0 rgb(255 255 255 / 0.16),
		0 0 0 1px var(--primary-edge),
		0 0 0 4px var(--primary-ring);
}
.btn-primary:disabled { opacity: 0.6; cursor: default; transform: none; }

/* secondary = พื้นขาว ขอบบาง ขอบบนสว่าง (นูนเบากว่า primary) */
.btn-secondary {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
	background: var(--surface); color: var(--fg);
	font-family: inherit; font-weight: 500;
	text-decoration: none; cursor: pointer;
	box-shadow: inset 0 1px 0 0 rgb(255 255 255 / 0.8), var(--shadow-xs);
	transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--faint); }
.btn-secondary:active { transform: translateY(1px); box-shadow: none; }
.btn-secondary:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--primary-ring); }

/* ───── Header ───── */
header {
	position: sticky; top: 0; z-index: 10;
	/* พื้นทึบไม่ใช้ backdrop-filter — blur บน sticky ทำ scroll กระตุกบนมือถือ */
	background: var(--bg);
	border-bottom: 1px solid var(--border);
}
.header-inner {
	display: flex; align-items: center; justify-content: space-between;
	height: 56px;
}
.brand {
	display: flex; align-items: center; gap: 8px;
	font-weight: 700; font-size: 18px; letter-spacing: -0.02em;
	color: var(--fg); text-decoration: none;
}
.brand svg { display: block; }
.header-actions { display: flex; align-items: center; gap: 12px; }
/* ปุ่มสลับภาษา TH | EN */
.lang-switch {
	display: flex; align-items: center; gap: 2px;
	font-size: 13px; color: var(--faint);
}
.lang-switch a {
	color: var(--muted); text-decoration: none;
	padding: 6px; border-radius: 6px;
	transition: color 0.15s;
}
.lang-switch a:hover { color: var(--fg); }
.lang-switch a[aria-current='page'] { color: var(--fg); font-weight: 600; }
.btn-console { height: 38px; padding: 0 14px; font-size: 14px; }

/* ───── Hero: search card กลางจอ ───── */
.hero {
	position: relative; isolation: isolate; /* ให้ ::before/::after อยู่หลังเนื้อหาในหน้านี้เท่านั้น */
	min-height: calc(100svh - 57px);
	display: flex; flex-direction: column;
	align-items: center; justify-content: center;
	text-align: center;
	padding: 36px 20px;
	overflow: hidden;
}
/* พื้นหลัง 2 ชั้น: glow สีแบรนด์จางๆ จากขอบบน + dot grid ที่ค่อยๆ จางออกรอบกลางจอ
   ให้ hero มี "บรรยากาศ" โดยไม่ต้องมีรูป */
.hero::before {
	content: ''; position: absolute; inset: 0; z-index: -2;
	background: radial-gradient(ellipse 80% 55% at 50% -10%, var(--primary-soft), transparent 70%);
}
.hero::after {
	content: ''; position: absolute; inset: 0; z-index: -1;
	background-image: radial-gradient(var(--border-strong) 1px, transparent 1.5px);
	background-size: 24px 24px;
	mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
	-webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
	opacity: 0.45;
}
.hero-logo {
	display: flex; align-items: center; gap: 10px;
	font-size: 28px; font-weight: 700; letter-spacing: -0.03em;
	margin-bottom: 22px;
}
.hero-logo svg { width: 32px; height: 32px; }
.hero h1 {
	font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3;
	max-width: 560px; margin-bottom: 10px;
	text-wrap: balance;
}
.hero-sub {
	font-size: 15px; color: var(--muted);
	max-width: 440px; margin-bottom: 28px;
	text-wrap: balance;
}
/* search card: "วัตถุหลัก" ของหน้า — การ์ดขาวลอยด้วยเงาซ้อน, focus ที่ input
   ทำให้ทั้งการ์ดติด ring (ไม่ใช่แค่ช่อง)
   มือถือ: เรียงตั้ง ช่องกรอก + ปุ่มกว้างเต็มแถว นิ้วจิ้มง่าย */
.search {
	display: flex; flex-direction: column; gap: 8px;
	width: 100%; max-width: 480px;
	padding: 8px;
	background: var(--surface);
	border: 1px solid var(--border); border-radius: var(--radius-xl);
	box-shadow: var(--shadow-lg);
	transition: border-color 0.2s, box-shadow 0.2s;
}
.search:focus-within {
	border-color: var(--primary);
	box-shadow: var(--shadow-lg), 0 0 0 4px var(--primary-ring);
}
.search:has(input[aria-invalid='true']) { border-color: var(--error); }
.search:has(input[aria-invalid='true']):focus-within {
	box-shadow: var(--shadow-lg), 0 0 0 4px oklch(from var(--error) l c h / 0.2);
}
.search input {
	width: 100%; min-width: 0;
	height: 52px; padding: 0 14px;
	font-family: var(--font-mono);
	/* ≥16px เสมอ — ต่ำกว่านั้น iOS จะซูมหน้าเองตอน focus */
	font-size: 20px; font-weight: 500; letter-spacing: 0.12em;
	text-align: center;
	border: none; border-radius: var(--radius-lg);
	background: transparent; color: var(--fg);
	outline: none;
	appearance: none; -webkit-appearance: none; /* ตัดเงาใน input ของ iOS */
}
.search input::placeholder {
	font-family: var(--font-sans);
	font-size: 16px; font-weight: 400; letter-spacing: normal; color: var(--faint);
}
.search .btn-primary {
	width: 100%; height: 52px; padding: 0 24px;
	font-size: 17px;
	border-radius: var(--radius-lg);
}
/* ข้อความ error ใต้ช่อง — โผล่ตรงนี้เลย ไม่พาไปหน้า 404 */
.search-msg {
	margin-top: 12px; min-height: 24px;
	font-size: 14px; color: var(--error);
}
.hero-hint { margin-top: 2px; font-size: 13px; color: var(--faint); }

.scroll-cue {
	margin-top: 40px; padding: 8px; /* ขยายพื้นที่แตะ */
	color: var(--faint); text-decoration: none;
	display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
	font-size: 12px;
	transition: color 0.15s;
}
.scroll-cue:hover { color: var(--muted); }

/* ───── Content ใต้ fold ───── */
section.block { padding: 44px 0; border-top: 1px solid var(--border); }
section.block h2 {
	font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
	margin-bottom: 10px;
}
section.block > .wrap > p { color: var(--muted); max-width: 640px; }

.steps {
	display: grid; grid-template-columns: 1fr;
	gap: 14px; margin-top: 24px;
}
.step {
	background: var(--surface); border: 1px solid var(--border);
	border-radius: var(--radius-lg); padding: 20px;
	box-shadow: var(--shadow-xs);
	transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.step:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-strong); }
.step .num {
	display: inline-flex; align-items: center; justify-content: center;
	width: 30px; height: 30px; border-radius: 999px;
	background: var(--primary-soft); color: var(--primary);
	font-weight: 700; font-size: 14px;
	margin-bottom: 10px;
}
.step h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.step p { font-size: 14px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.chip {
	padding: 8px 16px; border-radius: 999px;
	background: var(--surface); border: 1px solid var(--border);
	box-shadow: var(--shadow-xs);
	font-size: 14px; color: var(--fg);
}

/* ───── CTA ปิดท้าย (สมัคร) ───── */
section.cta { text-align: center; }
section.cta > .wrap > p { margin: 0 auto; }
.cta-actions {
	display: flex; flex-direction: column; align-items: center; gap: 14px;
	margin-top: 24px;
}
.btn-cta { height: 48px; padding: 0 24px; font-size: 16px; }
.cta-alt { font-size: 14px; color: var(--muted); }
.cta-alt a { color: var(--fg); font-weight: 500; }

/* ───── Footer ───── */
footer {
	border-top: 1px solid var(--border);
	padding: 28px 0 44px;
	font-size: 13px; color: var(--muted);
}
footer .wrap { display: flex; flex-direction: column; gap: 10px; }
footer a { color: var(--muted); }
footer a:hover { color: var(--fg); }
footer .note { max-width: 640px; }

/* ───── จอกว้าง ≥640px ───── */
@media (min-width: 640px) {
	.hero { padding: 48px 20px; }
	.hero-logo { font-size: 32px; gap: 12px; margin-bottom: 28px; }
	.hero-logo svg { width: 36px; height: 36px; }
	.hero h1 { font-size: 36px; margin-bottom: 12px; }
	.hero-sub { font-size: 17px; margin-bottom: 36px; }

	.search { flex-direction: row; max-width: 520px; padding: 6px; }
	.search input {
		flex: 1; width: auto;
		height: 50px; padding: 0 18px;
		font-size: 18px; text-align: left;
	}
	.search input::placeholder { font-size: 15px; }
	.search .btn-primary {
		width: auto; height: 50px;
		font-size: 16px;
	}

	.scroll-cue { margin-top: 56px; }
	section.block { padding: 56px 0; }
	section.block h2 { font-size: 24px; margin-bottom: 12px; }
	.steps { grid-template-columns: repeat(3, 1fr); gap: 16px; }
	.step { padding: 22px; }
}

/* ลด motion ตามที่ระบบผู้ใช้ขอ */
@media (prefers-reduced-motion: reduce) {
	.step, .btn-primary, .btn-secondary { transition: none; }
	.step:hover { transform: none; }
}
