/* ZapTH — brand palette from Zappy/brand/canva-brand-kit.md
   Navy #0D1B2A · Navy Light #132842 · Gold #F5C518 · Gold Bright #FFF176 · Gold Dark #C17A10 */

:root {
  --navy: #0d1b2a;
  --navy-light: #132842;
  --navy-lift: #1b3557;
  --gold: #f5c518;
  --gold-bright: #fff176;
  --gold-dark: #c17a10;
  --text: #eef3f9;
  --text-dim: #9fb0c4;
  --line: rgba(245, 197, 24, 0.16);
  --radius: 14px;
  --wrap: 1080px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--navy);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai",
    "Sarabun", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* Thai renders better with a touch more line height */
:lang(th), [data-lang="th"] { line-height: 1.9; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); text-decoration: underline; }

/* ── header ─────────────────────────────────────────────── */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 27, 42, 0.92);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 20px; padding: 14px 24px; max-width: var(--wrap); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--text); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; color: var(--text); }
/* logo.png is a flat RGB app-icon export (no alpha), so round it like an icon */
.brand img { width: 32px; height: 32px; display: block; border-radius: 22%; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 22px; font-size: 15px; }
.nav-links a { color: var(--text-dim); }
.nav-links a:hover { color: var(--gold); text-decoration: none; }

.langtoggle {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
}
.langtoggle button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: var(--text-dim); font: inherit; font-size: 14px; font-weight: 600;
  padding: 5px 13px; line-height: 1.4;
}
.langtoggle button[aria-pressed="true"] { background: var(--gold); color: var(--navy); }

/* ── hero ───────────────────────────────────────────────── */
.hero { padding: 84px 0 64px; border-bottom: 1px solid var(--line); }
.hero-logo {
  width: 88px; height: 88px; margin-bottom: 26px;
  border-radius: 22%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
h1 { font-size: clamp(34px, 5.2vw, 52px); line-height: 1.2; margin: 0 0 18px; letter-spacing: -0.02em; font-weight: 800; }
.lede { font-size: clamp(18px, 2.2vw, 21px); color: var(--text-dim); max-width: 62ch; margin: 0 0 34px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--gold); color: var(--navy);
  font-weight: 700; font-size: 16px;
  padding: 13px 24px; border-radius: var(--radius);
  border: 1px solid var(--gold);
}
.btn:hover { background: var(--gold-bright); border-color: var(--gold-bright); color: var(--navy); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--gold); }
.btn-ghost:hover { background: rgba(245, 197, 24, 0.1); color: var(--gold-bright); }
.btn-muted {
  background: transparent; color: var(--text-dim);
  border: 1px dashed rgba(159, 176, 196, 0.35); cursor: default; font-weight: 600;
}
.btn-muted:hover { background: transparent; color: var(--text-dim); text-decoration: none; }

/* ── sections ───────────────────────────────────────────── */
section { padding: 64px 0; border-bottom: 1px solid var(--line); }
h2 { font-size: clamp(24px, 3vw, 31px); margin: 0 0 12px; letter-spacing: -0.015em; font-weight: 750; }
h3 { font-size: 19px; margin: 0 0 8px; font-weight: 700; }
.section-lede { color: var(--text-dim); max-width: 62ch; margin: 0 0 36px; }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--navy-light);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
}
.card p { color: var(--text-dim); margin: 0; font-size: 16px; }
.card .ico { font-size: 24px; line-height: 1; display: block; margin-bottom: 14px; }

.stats { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { background: var(--navy-light); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; text-align: center; }
.stat b { display: block; font-size: 34px; color: var(--gold); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.stat span { color: var(--text-dim); font-size: 15px; }

/* ── legal / long-form pages ────────────────────────────── */
.doc { padding-top: 56px; padding-bottom: 72px; }
.doc h1 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 8px; }
.doc .updated { color: var(--text-dim); font-size: 15px; margin: 0 0 40px; }
.doc h2 { font-size: 21px; margin: 40px 0 10px; padding-top: 8px; }
.doc p, .doc li { color: #cfdae7; }
.doc ul { padding-left: 22px; }
.doc li { margin-bottom: 7px; }
.doc .callout {
  background: var(--navy-light); border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 10px; padding: 20px 22px; margin: 28px 0;
}
.doc .callout p { margin: 0; }
.contact-box {
  background: var(--navy-light); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; margin-top: 22px;
}
.contact-box p { margin: 0 0 6px; }

/* ── footer ─────────────────────────────────────────────── */
footer { padding: 48px 0 60px; color: var(--text-dim); font-size: 15px; }
.foot-grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 34px; }
.foot-grid h4 { color: var(--text); font-size: 15px; margin: 0 0 12px; font-weight: 700; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin-bottom: 8px; }
.foot-grid a { color: var(--text-dim); }
.foot-grid a:hover { color: var(--gold); text-decoration: none; }
.foot-legal { border-top: 1px solid var(--line); padding-top: 26px; font-size: 14px; line-height: 1.8; }

/* ── language switching ─────────────────────────────────── */
[data-lang] { display: none; }
html[lang="th"] [data-lang="th"] { display: revert; }
html[lang="en"] [data-lang="en"] { display: revert; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 56px 0 48px; }
  section { padding: 48px 0; }
  .nav { gap: 12px; padding: 12px 18px; }
  .nav-links { gap: 14px; font-size: 14px; }
  /* !important is required: the language rules below use attribute selectors
     (html[lang="th"] [data-lang="th"]) which out-specify a plain class rule. */
  .nav-links .hide-sm { display: none !important; }
  .wrap { padding-left: 18px; padding-right: 18px; }
  .btn { width: 100%; justify-content: center; }
}

/* utility classes so pages carry no inline style= (strict CSP style-src) */
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.anchor-target { scroll-margin-top: 80px; }
