/* Public website (phassa-thai.app). Thai flag colours, matching mobile/src/theme.js. */
:root {
  --bg: #ffffff; --panel: #f7f7fa; --text: #2b2a33; --muted: #6e6d78; --line: #e3e3ea;
  --blue: #2d2a4a; --blue-soft: #e4e3ef; --red: #a51931; --red-soft: #f9e1e5; --gold: #e8a800;
  --link: #a51931; --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16151d; --panel: #1f1e28; --text: #ececf1; --muted: #a5a4b0; --line: #2e2d38;
    --blue: #b9b6e6; --blue-soft: #2a2840; --red: #ff7a8a; --red-soft: #3a1d24; --link: #ff8f9c;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Thai", sans-serif; }
a { color: var(--link); }
img { max-width: 100%; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--bg); padding: 6px 10px; z-index: 10; }

/* Header + menu (wraps to a second row on phones; no JS). */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.flag { height: 5px; background: linear-gradient(90deg, #a51931 0 16.6%, #f4f5f8 16.6% 33.3%, #2d2a4a 33.3% 66.6%, #f4f5f8 66.6% 83.3%, #a51931 83.3%); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.15rem; color: var(--blue); text-decoration: none; margin-right: auto; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.nav ul { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; margin: 0; padding: 0; align-items: center; }
.nav ul a { color: var(--text); text-decoration: none; font-weight: 600; }
.nav ul a:hover, .nav ul a[aria-current="page"] { color: var(--red); }
.btn { display: inline-block; background: #a51931; color: #fff !important; font-weight: 800; text-decoration: none; padding: 10px 18px; border-radius: 12px; border-bottom: 4px solid #7a1124; }
.btn:hover { filter: brightness(1.05); }
.btn.secondary { background: transparent; color: var(--blue) !important; border: 2px solid var(--line); border-bottom-width: 4px; }
/* Phones: logo + button on the first row, the menu links on a second row. */
@media (max-width: 640px) {
  .nav { gap: 6px 12px; padding: 8px 16px 6px; }
  .nav > nav { order: 3; width: 100%; }
  .nav ul { justify-content: space-between; font-size: 0.95rem; }
  .nav .btn { padding: 6px 12px; border-bottom-width: 3px; }
  .brand img { width: 30px; height: 30px; }
}

/* Sections */
main { display: block; }
section { padding: 48px 0; }
section + section { border-top: 1px solid var(--line); }
h1, h2, h3 { color: var(--blue); line-height: 1.25; }
h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 12px; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); margin: 0 0 8px; }
h3 { font-size: 1.15rem; margin: 0 0 6px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; }
.muted { color: var(--muted); }
.hero { padding: 56px 0 48px; }
.hero .thai { font-size: 1.3rem; color: var(--red); font-weight: 700; margin: 0 0 8px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 10px; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding: 0; list-style: none; }
.stats li { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; font-size: 0.95rem; }
.stats b { color: var(--red); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 22px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card .icon { font-size: 1.8rem; line-height: 1; margin-bottom: 8px; display: block; }
.card p { margin: 0; color: var(--muted); }
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 22px; }
.steps li { counter-increment: step; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 18px 64px; position: relative; }
.steps li::before { content: counter(step); position: absolute; left: 18px; top: 16px; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: var(--bg); font-weight: 900; display: grid; place-items: center; }
.topics { columns: 2 260px; padding-left: 20px; }
.topics li { break-inside: avoid; margin-bottom: 4px; }

/* Platform cards (Get the app) */
.platform { display: flex; flex-direction: column; gap: 8px; }
.platform .status { align-self: flex-start; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; border-radius: 999px; padding: 2px 10px; }
.status.now { background: #e3f3e9; color: #1f6b40; }
.status.soon { background: var(--red-soft); color: var(--red); }
.status.later { background: var(--blue-soft); color: var(--blue); }
@media (prefers-color-scheme: dark) { .status.now { background: #173524; color: #8fdcaa; } }
.platform .store-badge[hidden] { display: none; }
.platform ol, .platform ul { margin: 6px 0 0; padding-left: 20px; color: var(--muted); }
.platform .btn { align-self: flex-start; margin-top: 6px; }

/* FAQ */
details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-top: 10px; }
summary { cursor: pointer; font-weight: 700; color: var(--blue); }
details p { margin: 8px 0 0; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--panel); padding: 26px 0 36px; font-size: 0.92rem; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.site-footer nav a { color: var(--text); font-weight: 600; text-decoration: none; }
.site-footer p { margin: 4px 0; }

/* Lesson pages (/thai/, built by scripts/site-pages.js) */
.crumbs { margin: 0 0 6px; font-size: 0.95rem; color: var(--muted); }
.crumbs a { font-weight: 600; }
.hero-thai { font-size: 1.2rem; color: var(--red); font-weight: 700; margin: 0 0 8px; }
.lesson { padding: 28px 0 8px; border-top: 1px solid var(--line); margin-top: 28px; }
.lesson h3 { margin-top: 22px; }
.table-wrap { overflow-x: auto; margin: 14px 0; border: 1px solid var(--line); border-radius: 12px; }
table.vocab { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
.vocab th, .vocab td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.vocab th { background: var(--panel); color: var(--blue); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }
.vocab tr:last-child td { border-bottom: 0; }
.vocab td.th { font-size: 1.25rem; font-weight: 700; color: var(--blue); white-space: nowrap; }
.rom { font-style: italic; color: var(--muted); }
.sentences { padding-left: 24px; display: grid; gap: 10px; }
.sentences li { padding-left: 4px; }
.sentences li > span { display: block; }
.sentences .th { font-size: 1.15rem; font-weight: 700; color: var(--blue); }
.sentences .credit { font-size: 0.8rem; color: var(--muted); }
.units { padding-left: 0; list-style: none; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.units li { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.units a { text-decoration: none; }
.units .muted { display: block; font-size: 0.9rem; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.pager a { font-weight: 700; text-decoration: none; }
.source { font-size: 0.9rem; margin-top: 28px; }

/* Plain text pages (privacy) */
.prose { max-width: 720px; padding: 32px 0 56px; }
.prose h2 { font-size: 1.2rem; margin-top: 32px; border-top: 1px solid var(--line); padding-top: 20px; }
.prose ul { padding-left: 20px; }
.updated { color: var(--muted); margin: 0 0 24px; }
