/* Justsay — เว็บ static
   สี: ground #F3F5F2 (เขียวอ่อนเย็น) · ink #14262E · accent #0E8A6B · key #FFD166 · muted #5F6E74 · paper #FFFFFF
   ฟอนต์: IBM Plex Sans Thai ตัวเดียว (400/500/600) */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Thai:wght@400;500;600&display=swap');

:root {
  --ground: #f3f5f2;
  --paper: #ffffff;
  --ink: #14262e;
  --muted: #5f6e74;
  --line: #d9dfdb;
  --accent: #0e8a6b;
  --accent-ink: #0a6a52;
  --key: #ffd166;
  --key-shadow: #d9a93c;
  --danger: #b4382b;
  --max: 1040px;
  --radius: 10px;
  font-family: 'IBM Plex Sans Thai', 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: var(--ground);
  font-size: 17px;
  line-height: 1.6;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); }
img { max-width: 100%; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--key); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; max-width: 60ch; }
.muted { color: var(--muted); }

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: 20px; }

/* nav */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); display: grid; place-items: center; }
.brand-mark span { width: 6px; height: 14px; border-radius: 3px; background: var(--key); display: block; }
.nav ul { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; flex-wrap: wrap; }
.nav a:not(.brand):not(.btn) { color: var(--ink); text-decoration: none; }
.nav a:not(.brand):not(.btn):hover { text-decoration: underline; }
.nav a.btn { padding: 9px 16px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: var(--radius); border: 1.5px solid var(--ink); background: var(--ink); color: #fff; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; }
.btn:hover { background: #0e1a20; }
.btn.secondary { background: transparent; color: var(--ink); }
.btn.secondary:hover { background: #e8ece9; }
.btn.accent { background: var(--accent); border-color: var(--accent); }
.btn.accent:hover { background: var(--accent-ink); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-note { display: block; margin-top: 8px; font-size: 0.92rem; color: var(--muted); }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-block: 56px 64px; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 42ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; }

/* demo: keycap + chat */
.demo { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 1px 0 var(--line); }
.demo-row { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; }
.keycap { width: 92px; height: 92px; border-radius: 14px; background: var(--key); border: 2px solid var(--key-shadow); box-shadow: 0 6px 0 var(--key-shadow); display: grid; place-items: center; text-align: center; font-weight: 600; font-size: 0.85rem; line-height: 1.2; color: var(--ink); transition: transform 120ms, box-shadow 120ms; user-select: none; }
.keycap.pressed { transform: translateY(5px); box-shadow: 0 1px 0 var(--key-shadow); }
.keycap small { display: block; font-weight: 400; color: #5a4a12; }
.chat { display: grid; gap: 10px; }
.bubble { background: var(--ground); border-radius: 14px; padding: 12px 14px; min-height: 48px; max-width: 100%; font-size: 1.02rem; }
.bubble.mine { background: #e3f3ee; justify-self: end; }
.caret { display: inline-block; width: 2px; height: 1.1em; background: var(--ink); vertical-align: -0.2em; margin-left: 1px; animation: blink 1s steps(2, start) infinite; }
.status { font-size: 0.92rem; color: var(--muted); min-height: 1.5em; }
.wave { display: inline-flex; gap: 3px; align-items: center; height: 14px; vertical-align: middle; margin-right: 6px; }
.wave i { width: 3px; height: 4px; background: var(--accent); border-radius: 2px; }
.wave.on i { animation: wave 700ms ease-in-out infinite; }
.wave.on i:nth-child(2) { animation-delay: 100ms; }
.wave.on i:nth-child(3) { animation-delay: 200ms; }
.wave.on i:nth-child(4) { animation-delay: 300ms; }
.wave.on i:nth-child(5) { animation-delay: 400ms; }
@keyframes wave { 0%, 100% { height: 4px; } 50% { height: 14px; } }
@keyframes blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  .caret, .wave.on i { animation: none; }
  .keycap { transition: none; }
}

/* sections */
section { padding-block: 40px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; counter-reset: step; }
.step { border-top: 2px solid var(--ink); padding-top: 14px; }
.step::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; }
.step p { margin: 0; color: var(--muted); }

.apps { font-size: 1.15rem; line-height: 1.9; max-width: 70ch; }
.apps b { font-weight: 500; }

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; }
.sample { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.sample .said { color: var(--muted); font-size: 0.95rem; margin-bottom: 6px; }
.sample .typed { font-size: 1.05rem; margin: 0; }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.plan { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.plan.featured { border: 2px solid var(--accent); }
.plan .price { font-size: 2rem; font-weight: 600; line-height: 1.1; }
.plan .price small { font-size: 1rem; font-weight: 400; color: var(--muted); }
.plan .was { color: var(--muted); font-size: 0.95rem; }
.plan ul { margin: 0; padding-left: 1.2em; color: var(--muted); display: grid; gap: 6px; }
.plan ul li::marker { color: var(--accent); }
.plan .btn { margin-top: auto; }
.toggle { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; margin-bottom: 24px; }
.toggle button { font: inherit; padding: 8px 18px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.toggle button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* forms */
.form { display: grid; gap: 12px; max-width: 420px; }
.form input { font: inherit; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); }
.notice { padding: 12px 14px; border-radius: var(--radius); background: #e3f3ee; color: var(--accent-ink); }
.notice.error { background: #f8e4e1; color: var(--danger); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.meter { height: 8px; background: #e2e8e4; border-radius: 4px; overflow: hidden; max-width: 420px; }
.meter span { display: block; height: 100%; background: var(--accent); }

/* faq */
details { border-top: 1px solid var(--line); padding: 14px 0; }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 500; }
details p { margin: 10px 0 0; color: var(--muted); }

/* footer */
footer { padding-block: 40px 56px; color: var(--muted); font-size: 0.95rem; }
footer ul { list-style: none; display: flex; gap: 18px; padding: 0; margin: 0 0 10px; flex-wrap: wrap; }
footer a { color: var(--muted); }

.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.6em; font-size: 1.3rem; }
.prose ul { padding-left: 1.2em; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-block: 32px 40px; }
  .steps, .pair, .plans { grid-template-columns: 1fr; }
  .demo-row { grid-template-columns: 1fr; }
  .keycap { width: 76px; height: 76px; }
}
