/* Sherpa marketing site. Tokens from design/rebrand.html + design/logo (Pace6/sherpa).
   Brand #2545d3; neutrals #f3f5fa / #ffffff / #131829 / #5c6479.
   Widget illustration colours come from DESIGN.md (widget counter). */
:root {
  --brand: #2545d3;
  --brand-hover: #1d39b8;      /* brand, one step darker for hover */
  --brand-ink: #16308f;        /* repo LIFF --brand-ink */
  --brand-soft: #e6ebfb;       /* repo LIFF --brand-soft */
  --paper: #f3f5fa;
  --surface: #ffffff;
  --ink: #131829;
  --muted: #5c6479;
  --hairline: #e6e8ec;         /* repo widget hairline */
  --widget-canvas: #f7f8fa;
  --agent-bubble: #e8f0fe;
  --online: #6ee7a0;
  --human: #ffd35c;
  --danger: #c4373c;
  --danger-soft: #fdecec;
  --warn-ink: #7a5300;
  --warn-soft: #fff4d6;
  --ok-ink: #1d6b45;
  --ok-soft: #e3f6ec;

  --font-display: 'Anuphan', 'Sarabun', system-ui, sans-serif;
  --font-body: 'Sarabun', 'Anuphan', system-ui, sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-float: 0 12px 40px rgba(19, 24, 41, .14);
  --container: 1160px;
  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:lang(en) body, html:lang(en) body { line-height: 1.6; }
img, svg { display: block; max-width: 100%; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 3px solid rgba(37, 69, 211, .55); outline-offset: 3px; border-radius: 6px; }
.nb { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

h1, h2, h3 { font-family: var(--font-display); color: var(--ink); margin: 0; text-wrap: balance; }
h1 { font-weight: 700; font-size: clamp(36px, 6.2vw, 60px); line-height: 1.22; letter-spacing: -0.015em; }
h2 { font-weight: 700; font-size: clamp(27px, 3.6vw, 40px); line-height: 1.3; letter-spacing: -0.01em; }
h3 { font-weight: 600; font-size: 20px; line-height: 1.4; }
p { margin: 0; text-wrap: pretty; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 72px 0; }
.section--paper { background: var(--paper); }
.section-head { max-width: 760px; margin-bottom: 40px; }
.section-head p { margin-top: 14px; color: var(--muted); font-size: 18px; }

.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-weight: 600; font-size: 16px; line-height: 1;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-hover); color: #fff; }
.btn--outline { background: var(--surface); color: var(--ink); border-color: #cfd5e2; }
.btn--outline:hover { border-color: var(--brand); color: var(--brand); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn--block { width: 100%; }
.link-arrow { font-family: var(--font-display); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; }
.link-arrow:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--hairline); }
.site-header .container { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand-peaks { width: 34px; height: 34px; color: var(--brand); flex: none; }
.brand-words { display: flex; flex-direction: column; line-height: 1; }
.brand-th { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--brand); line-height: 1.15; }
.brand-en { font-family: var(--font-display); font-weight: 600; font-size: 10px; letter-spacing: .2em; color: var(--ink); margin-top: 2px; }
.nav { display: none; }
.nav a { color: var(--ink); text-decoration: none; font-size: 15.5px; padding: 8px 10px; border-radius: 8px; }
.nav a:hover { color: var(--brand); background: var(--paper); }
.lang { display: inline-flex; border: 1px solid #cfd5e2; border-radius: 999px; padding: 3px; font-family: var(--font-display); font-weight: 600; font-size: 13px; }
.lang a, .lang span { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 30px; padding: 0 8px; border-radius: 999px; text-decoration: none; color: var(--muted); }
.lang [aria-current="true"] { background: var(--ink); color: #fff; }
.lang a:hover { color: var(--brand); }
.header-cta { display: none; }

/* ---------- Hero ---------- */
.hero { background: var(--paper); padding: 48px 0 72px; overflow: hidden; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
.hero-sub { margin-top: 18px; font-family: var(--font-display); font-weight: 600; font-size: clamp(21px, 2.3vw, 27px); line-height: 1.4; color: var(--brand-ink); text-wrap: balance; }
.hero-copy .lede { margin-top: 16px; font-size: 17px; color: var(--muted); max-width: 34em; }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.hero-visual { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; }

/* Widget illustration */
.widget {
  width: 100%; max-width: 360px; background: var(--surface); border-radius: 16px;
  box-shadow: var(--shadow-float); overflow: hidden; font-size: 14px; line-height: 1.5;
  border: 1px solid rgba(19,24,41,.06);
}
.widget-head { background: var(--brand); color: #fff; display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.widget-head .avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.16); display: grid; place-items: center; flex: none; }
.widget-head .avatar svg { width: 18px; height: 18px; color: #fff; }
.widget-head b { font-family: var(--font-display); font-weight: 600; font-size: 15px; display: block; line-height: 1.3; }
.widget-head small { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .92; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot--online { background: var(--online); }
.dot--human { background: var(--human); }
.widget-body { background: var(--widget-canvas); padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 84%; padding: 9px 13px; border-radius: 14px; }
.bubble--user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.bubble--bot { align-self: flex-start; background: #fff; color: #1a1a1a; border: 1px solid var(--hairline); border-bottom-left-radius: 4px; }
.bubble--agent { align-self: flex-start; background: var(--agent-bubble); color: #1a1a1a; border-bottom-left-radius: 4px; }
.bubble-label { font-size: 11.5px; color: var(--muted); margin: 0 0 -6px 4px; }
.tool-chip { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 11.5px; color: var(--brand-ink); background: var(--brand-soft); border-radius: 999px; padding: 1px 9px; }
.tool-chip svg { width: 12px; height: 12px; }
.widget-banner { display: flex; align-items: center; gap: 8px; background: #fff7e0; color: var(--warn-ink); font-size: 12.5px; padding: 8px 14px; border-top: 1px solid #f3e3b5; }
.widget-compose { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--hairline); background: #fff; }
.widget-compose span { flex: 1; color: #8a91a3; font-size: 13px; background: var(--widget-canvas); border-radius: 999px; padding: 7px 12px; }
.widget-compose i { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; }
.widget-compose i svg { width: 15px; height: 15px; color: #fff; }

/* LINE case card illustration */
.case-card {
  width: 100%; max-width: 300px; background: var(--surface); border-radius: 14px;
  box-shadow: var(--shadow-float); border: 1px solid rgba(19,24,41,.06);
  font-size: 13.5px; line-height: 1.5; overflow: hidden; margin-top: -12px; position: relative; z-index: 2; align-self: flex-end; width: calc(100% - 28px);
}
.case-card .src { display: flex; align-items: center; gap: 8px; padding: 9px 14px; font-size: 12px; color: var(--muted); background: var(--paper); border-bottom: 1px solid var(--hairline); }
.line-badge { font-family: var(--font-display); font-weight: 700; font-size: 10.5px; letter-spacing: .04em; color: #fff; background: var(--ink); border-radius: 5px; padding: 1px 6px; }
.case-card .bd { padding: 12px 14px 4px; display: grid; gap: 3px; }
.case-card .bd b { font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.case-card .meta { color: var(--muted); font-size: 12.5px; }
.case-card .sum { margin-top: 4px; }
.case-card .ft { padding: 10px 14px 14px; }
.case-card .ft span { display: flex; align-items: center; justify-content: center; min-height: 38px; border-radius: 8px; background: var(--brand); color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: .92em; letter-spacing: 0; }

/* ---------- Problem ---------- */
.grid-2 { display: grid; gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 28px; }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--muted); }
.icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 18px; flex: none; }
.icon svg { width: 22px; height: 22px; }

/* ---------- Steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; }
.step-num { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--brand); display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.step-num::before { content: ""; width: 24px; height: 2px; background: var(--brand); display: inline-block; }
.step h3 { margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 16px; }
.mini { margin-top: auto; padding-top: 20px; }
.mini-frame { background: var(--paper); border-radius: 12px; padding: 14px; font-size: 12.5px; line-height: 1.5; display: grid; gap: 8px; min-height: 150px; align-content: start; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 10px; font-size: 12px; background: #fff; border: 1px solid var(--hairline); color: var(--ink); white-space: nowrap; }
.chip svg { width: 12px; height: 12px; color: var(--brand); }
.chip--warn { background: var(--warn-soft); border-color: #f1dea6; color: var(--warn-ink); }
.chip--danger { background: var(--danger-soft); border-color: #f5c9cb; color: var(--danger); }
.chip--ok { background: var(--ok-soft); border-color: #bfe6d0; color: var(--ok-ink); }
.chip--blue { background: var(--brand-soft); border-color: #cdd7f6; color: var(--brand-ink); }
.mini .bubble { font-size: 12.5px; padding: 7px 11px; max-width: 92%; }
.mini-card { background: #fff; border: 1px solid var(--hairline); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; }
.mini-card b { font-family: var(--font-display); font-weight: 600; font-size: 13px; }
.mini-btn { display: flex; align-items: center; justify-content: center; min-height: 30px; border-radius: 7px; background: var(--brand); color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 12.5px; margin-top: 6px; }
.mini-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mini-btn--ghost { background: #fff; color: var(--ink); border: 1px solid #cfd5e2; }
.diff { border-radius: 8px; overflow: hidden; border: 1px solid var(--hairline); background: #fff; }
.diff div { padding: 5px 10px; }
.diff .del { background: var(--danger-soft); color: #8a2328; }
.diff .add { background: var(--ok-soft); color: #165536; }

/* ---------- Features ---------- */
.features { display: grid; gap: 20px; }
.feature { display: flex; flex-direction: column; }
.feature p { font-size: 16px; }
.queue { margin-top: 20px; border: 1px solid var(--hairline); border-radius: 12px; overflow: hidden; font-size: 13px; }
.queue-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 14px; border-top: 1px solid var(--hairline); align-items: center; background: #fff; }
.queue-row:first-child { border-top: 0; }
.queue-row .r { color: var(--ink); }
.queue-row .r small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- Trust ---------- */
.trust { display: grid; gap: 20px; }

/* ---------- Channels ---------- */
.channels { display: grid; gap: 20px; }
.channel { display: flex; gap: 16px; align-items: flex-start; }
.channel .icon { margin-bottom: 0; }
.channel h3 { margin-bottom: 4px; }
.fineprint { margin-top: 24px; color: var(--muted); font-size: 15.5px; display: flex; gap: 10px; align-items: flex-start; }
.fineprint svg { width: 20px; height: 20px; color: var(--brand); flex: none; margin-top: 3px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 20px; align-items: start; }
.form-card { padding: 28px; }
.form-grid { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label, .field .label { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.field .opt { font-family: var(--font-body); font-weight: 400; color: var(--muted); font-size: 14px; }
.field input:not([type=checkbox]), .field select, .field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff;
  border: 1px solid #c9d0de; border-radius: var(--radius-sm); padding: 10px 14px; min-height: 48px;
}
.field textarea { min-height: 112px; resize: vertical; line-height: 1.6; }
.field input:not([type=checkbox]):focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid rgba(37,69,211,.45); outline-offset: 1px; border-color: var(--brand); }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235c6479' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--ink); }
.consent { font-family: var(--font-body) !important; font-weight: 400 !important; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 4px 0 0; accent-color: var(--brand); flex: none; cursor: pointer; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-status { display: none; border-radius: var(--radius-sm); padding: 14px 16px; font-size: 15.5px; }
.form-status.is-ok { display: block; background: var(--ok-soft); color: var(--ok-ink); border: 1px solid #bfe6d0; }
.form-status.is-err { display: block; background: var(--danger-soft); color: #8a2328; border: 1px solid #f5c9cb; }
.btn[aria-busy="true"] { opacity: .7; cursor: progress; }

.line-card h3 { margin-bottom: 8px; }
.line-card p { color: var(--muted); }
.qr { margin: 20px 0; width: 168px; height: 168px; border: 2px dashed #b9c2d6; border-radius: 12px; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 13px; padding: 10px; background: var(--paper); }
.qr img { width: 100%; height: 100%; object-fit: contain; }
.qr.has-img { border-style: solid; border-color: var(--hairline); background: #fff; padding: 8px; }
.line-id { font-size: 15px; color: var(--muted); margin-top: 12px; }
.line-id b { color: var(--ink); }
.ph { background: #fff4d6; color: #6b4a00; border-radius: 4px; padding: 0 4px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--hairline); padding: 40px 0 48px; font-size: 15px; color: var(--muted); }
.footer-grid { display: grid; gap: 20px; align-items: center; }
.footer-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.footer-meta .sep { color: #b3bacb; }
.footer-meta a { color: var(--muted); }
.footer-meta a:hover { color: var(--brand); }
.footer-line { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Breakpoints ---------- */
@media (min-width: 640px) {
  :root { --gutter: 28px; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
  .feature--wide { grid-column: span 2; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .field--full { grid-column: 1 / -1; }
  .header-cta { display: inline-flex; }
}
@media (min-width: 900px) {
  .section { padding: 104px 0; }
  .hero { padding: 72px 0 104px; }
  .hero-grid { grid-template-columns: 1.08fr .92fr; gap: 56px; }
  .hero-visual { align-items: stretch; padding: 0 0 0 8px; }
  .hero-visual .widget { margin-right: 64px; }
  .case-card { margin-top: -64px; margin-right: -4px; width: 100%; }
  .trust { grid-template-columns: repeat(3, 1fr); }
  .channels { grid-template-columns: repeat(3, 1fr); }
  .contact-grid { grid-template-columns: 1.55fr 1fr; gap: 24px; }
  .footer-grid { grid-template-columns: auto 1fr; gap: 32px; }
  .footer-meta { justify-content: flex-end; }
  .footer-line { justify-content: flex-end; }
}
@media (min-width: 1080px) {
  .nav { display: flex; gap: 2px; }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .features { grid-template-columns: repeat(4, 1fr); }
  .form-card { padding: 36px; }
}
.mini-card b.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-weight: 600; font-size: 12.5px; }
