/* Based on ThaiCloud Design System v2 (designmd.ai/teeravee/thaicloud-design-system) */
@font-face { font-family: "Kanit"; font-weight: 400; font-display: swap; src: url(/fonts/kanit-400.woff2) format("woff2"); }
@font-face { font-family: "Kanit"; font-weight: 500; font-display: swap; src: url(/fonts/kanit-500.woff2) format("woff2"); }

:root {
  --primary: #0671B8; --primary-hover: #035897;
  --bg: #FAFAFA; --surface: #FFFFFF; --text: #0A0A0A; --text-2: #6B6B6B; --muted: #9C9C9C; --border: #E8E8EC;
  --success: #00A8A7; --warning: #FAB217;
  --dot: #DCDCE2; --on-primary: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #4DA3E0; --primary-hover: #7BBDEB;
    --bg: #0F1115; --surface: #171A20; --text: #F2F2F4; --text-2: #A3A3AD; --muted: #6E6E78; --border: #2A2E36;
    --dot: #262A31; --on-primary: #0F1115;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.6 "Kanit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
a:focus-visible, .button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-weight: 500; line-height: 1.15; margin: 0; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* Navigation */
.nav { background: var(--surface); border-bottom: 1px solid var(--border); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { color: var(--text); font-weight: 500; font-size: 16px; }
.brand:hover { color: var(--text); text-decoration: none; }
.nav-links { display: flex; gap: 24px; font-size: 13px; font-weight: 500; }
.nav-links a { color: var(--text-2); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--primary); text-decoration: none; }

/* Hero: dot grid is the only decorative element */
.hero {
  padding: 96px 0 80px; border-bottom: 1px solid var(--border);
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px); background-size: 24px 24px;
}
.overline { font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); margin: 0 0 16px; }
.display { font-size: clamp(44px, 9vw, 72px); letter-spacing: -.02em; }
.lead { font-size: 20px; color: var(--text-2); max-width: 36rem; margin: 20px 0 0; }

/* Sections */
section { padding: 64px 0; }
.section-title { font-size: 32px; margin-bottom: 24px; }
.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* Cards: gallery-frame surfaces, shadow only on hover */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.card h3 { font-size: 24px; margin-bottom: 8px; }
.card p { color: var(--text-2); margin: 0; }
.app-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.app-icon {
  width: 64px; height: 64px; border-radius: 16px; border: 1px solid var(--border); flex: none;
  background: var(--bg) radial-gradient(var(--dot) 1.2px, transparent 1.2px) 0 0 / 8px 8px;
}
.app-head > div { min-width: 0; }
.app-head h3 { margin: 0 0 4px; }

/* Chips */
.chip { display: inline-block; white-space: nowrap; font-size: 12px; font-weight: 500; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2); }
.chip-pending { color: #8A5D00; background: #FFF4D6; border-color: #FBE3A0; }
@media (prefers-color-scheme: dark) { .chip-pending { color: var(--warning); background: transparent; border-color: #5A4614; } }

/* Buttons */
.button {
  display: inline-block; font-size: 15px; font-weight: 500; padding: 12px 20px; border-radius: 6px;
  background: var(--primary); color: var(--on-primary); border: 1px solid var(--primary);
}
.button:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); text-decoration: none; box-shadow: 0 4px 12px rgba(6, 113, 184, .25); }
.support { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.support .button { flex: none; }
.support ul { margin: 12px 0 0; padding-left: 20px; color: var(--text-2); }

/* Long-form (privacy) */
.page-head { padding: 64px 0 40px; border-bottom: 1px solid var(--border);
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px); background-size: 24px 24px; }
.page-head h1 { font-size: clamp(36px, 7vw, 60px); letter-spacing: -.02em; }
.meta { color: var(--text-2); font-size: 13px; font-weight: 500; margin: 16px 0 0; }
.doc { display: grid; gap: 40px; grid-template-columns: 220px 1fr; align-items: start; padding-top: 48px; padding-bottom: 80px; }
.toc { position: sticky; top: 24px; font-size: 13px; }
.toc p { margin: 0 0 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.toc a { color: var(--text-2); }
.toc a:hover { color: var(--primary); }
.prose { max-width: 680px; }
.prose h2 { font-size: 24px; margin: 40px 0 12px; scroll-margin-top: 24px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--text); }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 8px; }
.prose strong { font-weight: 500; }
@media (max-width: 760px) { .doc { grid-template-columns: 1fr; } .toc { position: static; } }

/* Footer */
.footer { border-top: 1px solid var(--border); background: var(--surface); padding: 32px 0; font-size: 13px; color: var(--muted); }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer a { color: var(--text-2); }

h1, h2, h3, .brand { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .hero { padding: 64px 0 48px; }
  section { padding: 40px 0; }
  .lead { font-size: 18px; }
  .nav-links { gap: 16px; }
}
