/* ==========================================================================
   ตุ้บตุ้บ — Design tokens
   Display: Mali (rounded, warm, Thai)  |  Body: IBM Plex Sans Thai
   Palette derived from brand logo (hugging heart + heartbeat lines)
   ========================================================================== */

:root {
  --coral: #FF8072;
  --coral-deep: #C43D2F;
  --coral-ink: #B33A2F;
  --sky: #5B9EE6;
  --sky-deep: #2F6BB0;
  --cream: #FFF8F1;
  --cream-soft: #FFEFE2;
  --peach: #FFE3D0;
  --peach-soft: #FFF1E7;
  --sky-soft: #E8F2FD;
  --white: #FFFFFF;
  --ink: #3A2C2A;
  --ink-soft: #7A6B67;
  --ink-faint: #7E6F6A;
  --border: #F0E0D4;

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 10px rgba(179, 90, 70, 0.08);
  --shadow-md: 0 12px 30px rgba(179, 90, 70, 0.12);
  --shadow-lg: 0 20px 50px rgba(179, 90, 70, 0.16);

  --font-display: 'Mali', 'Segoe UI', sans-serif;
  --font-body: 'IBM Plex Sans Thai', 'Segoe UI', sans-serif;

  --container: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.2rem; margin-bottom: 0.4em; }

p { margin: 0 0 1em; color: var(--ink-soft); }

a { color: var(--sky-deep); text-decoration: none; }

img { max-width: 100%; display: block; }

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

.eyebrow {
  display: inline-block;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--coral-ink);
  background: var(--peach-soft);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}
.eyebrow--sky { color: var(--sky-deep); background: var(--sky-soft); }
.eyebrow--coral { color: var(--coral-ink); background: var(--peach-soft); }

.section { padding: 88px 0; }
.section-head { max-width: 620px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { margin-bottom: 0.3em; }
.section-sub { color: var(--ink-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

.btn-primary { background: var(--coral-deep); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--coral-ink); box-shadow: var(--shadow-md); }

.btn-outline { background: var(--white); color: var(--coral-deep); border-color: var(--coral-deep); }
.btn-outline:hover { background: var(--peach-soft); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { background: var(--white); }

.btn-lg { padding: 15px 30px; font-size: 1.02rem; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 248, 241, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header.is-scrolled { border-color: var(--border); box-shadow: 0 2px 16px rgba(179,90,70,0.06); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; color: var(--coral-deep); }
.brand-name em { font-style: normal; color: var(--sky-deep); }

.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a { color: var(--ink); font-weight: 500; font-size: 0.96rem; }
.main-nav a:hover { color: var(--coral-deep); }

.btn-nav-cta { padding: 10px 20px; font-size: 0.9rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { position: relative; overflow: hidden; padding: 64px 0 40px; }

.hero-blob { position: absolute; border-radius: 50%; filter: blur(2px); z-index: 0; }
.hero-blob--peach { width: 480px; height: 480px; background: var(--peach); top: -220px; right: -140px; opacity: 0.6; }
.hero-blob--sky { width: 320px; height: 320px; background: var(--sky-soft); bottom: -160px; left: -120px; opacity: 0.7; }

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.hero-sub { font-size: 1.08rem; max-width: 52ch; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 14px; }
.hero-note { font-size: 0.88rem; color: var(--ink-faint); margin: 0; }

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  min-height: 380px;
}
.hero-logo { width: min(240px, 56%); flex-shrink: 0; animation: pulse 3.6s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}
@media (prefers-reduced-motion: reduce) { .hero-logo { animation: none; } }

.heartbeat-flank { position: absolute; top: 50%; transform: translateY(-50%); width: 110px; opacity: 0.55; }
.heartbeat-flank--left { left: -10px; }
.heartbeat-flank--right { right: -10px; }
.heartbeat-svg { width: 100%; height: auto; }
.heartbeat-svg path { fill: none; stroke: var(--coral); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.chat-mock {
  position: relative;
  width: 208px;
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: 26px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-bubble--user {
  align-self: flex-end;
  background: var(--sky-deep);
  color: var(--white);
  padding: 9px 16px;
  border-radius: 18px 18px 4px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.chat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.chat-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.chat-card-tag { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); }
.chat-card-ok { font-size: 0.78rem; font-weight: 700; color: #276840; background: #E7F5EC; padding: 3px 10px; border-radius: var(--radius-pill); }
.chat-card-value { font-family: var(--font-body); font-weight: 700; font-size: 1.7rem; color: var(--coral-deep); margin-bottom: 4px; }
.chat-card-value span { color: var(--ink-faint); font-weight: 400; }
.chat-card-value small { font-size: 0.85rem; font-weight: 500; color: var(--ink-faint); }
.chat-card-note { font-size: 0.8rem; margin: 0; color: var(--ink-soft); }

/* ---------- Heartbeat divider ---------- */
.divider { padding: 6px 0; overflow: hidden; }
.divider-svg { width: 100%; height: 32px; display: block; }
.divider-svg path { fill: none; stroke: var(--border); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.divider-svg.is-visible path {
  stroke: var(--coral);
  stroke-dasharray: 700;
  stroke-dashoffset: 700;
  animation: draw 1.4s ease forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ==========================================================================
   Why / stats
   ========================================================================== */
.why-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.why-copy p { max-width: 52ch; }

.why-stat { display: flex; flex-direction: column; gap: 16px; }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px 28px; box-shadow: var(--shadow-sm); }
.stat-card--sky { background: var(--sky-soft); border-color: transparent; }
.stat-number { font-family: var(--font-display); font-weight: 700; font-size: 2.4rem; color: var(--coral-deep); margin: 0; }
.stat-card--sky .stat-number { color: var(--sky-deep); }
.stat-number span { font-size: 1.1rem; font-weight: 600; }
.stat-label { margin: 4px 0 0; color: var(--ink-soft); font-size: 0.95rem; }
.stat-source { font-size: 0.78rem; color: var(--ink-faint); margin: 4px 0 0; }

/* ==========================================================================
   How it works
   ========================================================================== */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.step {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  position: relative;
}
.step-num { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; color: var(--peach); display: block; margin-bottom: 12px; }

/* ==========================================================================
   Spotlight (multi-profile)
   ========================================================================== */
.spotlight-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 56px; align-items: center; }
.spotlight-copy p { max-width: 56ch; }

.check-list { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.check-list li { position: relative; padding-left: 30px; color: var(--ink); font-weight: 500; }
.check-list li::before {
  content: "✓";
  position: absolute; left: 0; top: -1px;
  width: 22px; height: 22px;
  background: var(--coral-deep);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
}

.profile-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 26px;
  max-width: 340px;
  margin: 0 auto;
}
.profile-card-title { font-weight: 700; color: var(--ink); margin-bottom: 14px; }
.profile-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  margin-bottom: 8px;
}
.profile-row--active { background: var(--peach-soft); }
.profile-pill { font-size: 0.72rem; font-weight: 700; color: var(--coral-ink); background: var(--white); padding: 3px 10px; border-radius: var(--radius-pill); }
.profile-card-hint { font-size: 0.82rem; color: var(--ink-faint); margin: 10px 0 0; }

/* ==========================================================================
   Features
   ========================================================================== */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  position: relative;
}
.feature-icon { font-size: 1.9rem; margin-bottom: 12px; }
.feature-card p { font-size: 0.92rem; margin-bottom: 0; }
.disclaimer-inline { text-align: center; font-size: 0.82rem; color: var(--ink-faint); margin: 36px 0 0; }

/* ==========================================================================
   Pricing
   ========================================================================== */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: stretch; }
.price-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.price-card--highlight {
  background: var(--coral-deep);
  border-color: var(--coral-deep);
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}
.price-card--highlight h3,
.price-card--highlight .price-amount,
.price-card--highlight .price-amount span,
.price-card--highlight .price-features li { color: var(--white); }
.price-card--highlight .price-features li em { color: #FFE3D0; }
.price-badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--sky-deep); color: var(--white);
  font-size: 0.75rem; font-weight: 700;
  padding: 5px 16px; border-radius: var(--radius-pill);
}
.price-amount { font-family: var(--font-display); font-weight: 700; font-size: 2.1rem; color: var(--coral-deep); margin-bottom: 20px; }
.price-amount span { font-size: 0.95rem; font-weight: 500; color: var(--ink-faint); }
.price-features { list-style: none; margin: 0 0 28px; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.price-features li { font-size: 0.92rem; padding-left: 22px; position: relative; }
.price-features li::before { content: "•"; position: absolute; left: 4px; color: var(--coral-deep); font-weight: 700; }
.price-card--highlight .price-features li::before { color: var(--peach); }
.price-features li em { font-style: normal; font-size: 0.75rem; color: var(--sky-deep); font-weight: 600; }
.payment-note { font-size: 0.8rem; color: var(--sky-deep); font-weight: 600; text-align: center; margin: 0 0 12px; }
.price-card--highlight .payment-note { color: var(--peach); }
.price-card .btn { align-self: stretch; text-align: center; }
.price-note { text-align: center; font-size: 0.86rem; color: var(--ink-faint); margin-top: 28px; }

/* ==========================================================================
   Trust band
   ========================================================================== */
.trust { background: var(--sky-soft); }
.trust-inner { display: flex; align-items: flex-start; gap: 28px; max-width: 760px; }
.trust-icon { font-size: 2.2rem; flex-shrink: 0; }
.trust h2 { font-size: 1.5rem; }
.link-underline { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   FAQ
   ========================================================================== */
.accordion { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.accordion-item { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.accordion-trigger {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 18px 22px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.accordion-icon { position: relative; width: 16px; height: 16px; flex-shrink: 0; }
.accordion-icon::before, .accordion-icon::after {
  content: ""; position: absolute; background: var(--coral-deep); border-radius: 2px;
}
.accordion-icon::before { width: 16px; height: 2px; top: 7px; left: 0; }
.accordion-icon::after { width: 2px; height: 16px; top: 0; left: 7px; transition: transform 0.2s ease; }
.accordion-item.is-open .accordion-icon::after { transform: rotate(90deg); opacity: 0; }

.accordion-panel { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.accordion-item.is-open .accordion-panel { max-height: 220px; }
.accordion-panel p { padding: 0 22px 20px; margin: 0; font-size: 0.94rem; }

/* ==========================================================================
   Final CTA
   ========================================================================== */
.final-cta { padding-top: 40px; }
.final-cta-inner {
  text-align: center;
  background: linear-gradient(160deg, var(--peach-soft), var(--sky-soft));
  border-radius: var(--radius-lg);
  padding: 64px 32px;
  max-width: 720px;
  margin: 0 auto;
}
.final-cta-inner img { margin: 0 auto 18px; }
.final-cta-inner p { max-width: 44ch; margin-left: auto; margin-right: auto; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--white); border-top: 1px solid var(--border); padding-top: 56px; }
.footer-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; padding-bottom: 32px; }
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.footer-brand img { margin-bottom: 2px; }
.footer-brand p { max-width: 40ch; font-size: 0.9rem; }
.footer-links { display: flex; gap: 56px; }
.footer-links > div { display: flex; flex-direction: column; gap: 10px; }
.footer-heading { font-weight: 700; color: var(--ink); font-size: 0.9rem; margin-bottom: 2px; }
.footer-links a { color: var(--ink-soft); font-size: 0.9rem; }
.footer-links a:hover { color: var(--coral-deep); }

.footer-bottom { border-top: 1px solid var(--border); padding: 20px 24px 28px; }
.footer-bottom p { font-size: 0.8rem; color: var(--ink-faint); margin: 0 0 4px; }

/* ==========================================================================
   Reveal on scroll
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; min-height: 320px; }
  .why-grid, .spotlight-grid { grid-template-columns: 1fr; }
  .spotlight-visual { order: -1; }
  .steps { grid-template-columns: 1fr 1fr; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .price-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .price-card--highlight { transform: none; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .main-nav { display: none; }
  .btn-nav-cta { display: none; }
  .nav-toggle { display: flex; }

  .main-nav.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--white);
    padding: 20px 24px 28px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    gap: 18px;
  }

  .section { padding: 60px 0; }
  .steps { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .trust-inner { flex-direction: column; }
  .chat-mock { position: static; align-self: center; margin-top: 20px; margin-bottom: 0; width: 100%; max-width: 280px; }
  .hero-visual { flex-direction: column; }
  .heartbeat-flank { display: none; }
}

/* ==========================================================================
   Legal / Privacy policy page
   ========================================================================== */
.legal-hero { padding: 48px 0 20px; }
.legal-hero h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.legal-updated { font-size: 0.9rem; color: var(--ink-faint); }

.callout {
  border-radius: var(--radius-md);
  padding: 22px 26px;
  margin: 0 0 40px;
  border: 1px solid transparent;
}
.callout--warning {
  background: #FFF6DE;
  border-color: #F3D98A;
}
.callout--warning h2 {
  font-size: 1.05rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.callout--warning ul { margin: 0; padding-left: 20px; }
.callout--warning li { margin-bottom: 6px; font-size: 0.94rem; color: var(--ink); }
.callout--info { background: var(--sky-soft); }
.callout--info p:last-child { margin-bottom: 0; }

.placeholder {
  background: #FFEFAF;
  color: #6B5100;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 5px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.toc {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 48px;
}
.toc p.toc-title { font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; }
.toc li { margin-bottom: 8px; font-size: 0.92rem; break-inside: avoid; }
.toc a { color: var(--ink-soft); }
.toc a:hover { color: var(--coral-deep); }

.legal-content { max-width: 780px; margin: 0 auto; }
.legal-section { padding: 34px 0; border-top: 1px solid var(--border); }
.legal-section:first-of-type { border-top: none; padding-top: 0; }
.legal-section h2 { font-size: 1.35rem; display: flex; gap: 10px; align-items: baseline; }
.legal-section h2 .legal-num { color: var(--coral-deep); font-size: 1rem; }
.legal-section h3 { font-size: 1rem; margin-top: 20px; }
.legal-section p, .legal-section li { font-size: 0.96rem; }
.legal-section ul, .legal-section ol.legal-list { padding-left: 22px; }
.legal-section li { margin-bottom: 8px; }

.legal-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.legal-table th, .legal-table td { text-align: left; padding: 10px 14px; border: 1px solid var(--border); vertical-align: top; }
.legal-table th { background: var(--cream-soft); font-weight: 700; color: var(--ink); white-space: nowrap; }
.legal-table td a { font-weight: 600; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 18px 0; border-radius: var(--radius-sm); }
.table-scroll .legal-table { min-width: 640px; margin: 0; }

.rights-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 18px 0; padding: 0; list-style: none; }
.rights-grid li {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 0.9rem;
}
.rights-grid strong { display: block; color: var(--coral-deep); margin-bottom: 4px; font-family: var(--font-display); }

.contact-card {
  background: var(--peach-soft);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-top: 14px;
}
.contact-card p { margin-bottom: 6px; }

@media (max-width: 640px) {
  .toc ol { columns: 1; }
  .rights-grid { grid-template-columns: 1fr; }
}
