:root {
  --blue: #1E4DFF;
  --blue-dark: #1536C9;
  --cyan: #00C8FF;
  --ink: #0B1220;
  --ink-2: #121B2E;
  --text: #14181F;
  --muted: #5B6472;
  --bg: #F6F8FB;
  --surface: #FFFFFF;
  --border: #E3E8EF;
  --gradient: linear-gradient(135deg, #1E4DFF 0%, #00C8FF 100%);
  --radius: 16px;
  --shadow: 0 1px 2px rgba(11, 18, 32, 0.05), 0 12px 32px rgba(11, 18, 32, 0.08);
  --font: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-logo: "Quicksand", "IBM Plex Sans Thai", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

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

a {
  color: var(--blue);
}

h1, h2, h3, h4 {
  line-height: 1.25;
  margin: 0 0 0.5em;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; }

p {
  margin: 0 0 1em;
}

.container {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

/* ---------- Logo ---------- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.logo-word {
  font-family: var(--font-logo);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}

.logo-word sup {
  font-size: 0.55em;
  margin-left: 1px;
  vertical-align: top;
  position: relative;
  top: -2px;
}

.site-footer .logo-word,
.on-dark .logo-word {
  color: #fff;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 8px 20px rgba(30, 77, 255, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 10px 26px rgba(30, 77, 255, 0.35);
}

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

.btn-ghost:hover {
  background: #fff;
  border-color: var(--blue);
  color: var(--blue);
}

.btn-light {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-light:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-sm { padding: 9px 16px; font-size: 0.92rem; }
.btn-lg { padding: 14px 30px; font-size: 1.05rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 70px;
}

.brand {
  text-decoration: none;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  gap: 26px;
}

.main-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--blue);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-phone {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  margin-right: 6px;
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.menu-button span {
  width: 20px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s, opacity 0.2s;
}

.menu-button[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-button[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-button[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px 20px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.mobile-menu.is-open {
  display: flex;
}

.mobile-menu a:not(.btn) {
  padding: 12px 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  border-radius: 10px;
}

.mobile-menu a:not(.btn):hover {
  background: var(--bg);
}

.mobile-menu .btn {
  margin-top: 8px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background-color: var(--ink);
  background-image:
    radial-gradient(at 15% 20%, rgba(30, 77, 255, 0.45) 0, transparent 50%),
    radial-gradient(at 85% 15%, rgba(0, 200, 255, 0.28) 0, transparent 45%),
    radial-gradient(at 70% 90%, rgba(30, 77, 255, 0.25) 0, transparent 45%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding: 88px 0 80px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 18px;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.hero h1 {
  color: #fff;
}

.hero h1 .accent {
  background: linear-gradient(90deg, #1E4DFF, #00C8FF, #7AB8FF, #1E4DFF);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: text-shimmer 6s linear infinite;
  white-space: nowrap;
}

.hero-lead {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.78);
  max-width: 560px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 28px;
  margin: 44px 0 0;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  max-width: 520px;
}

.hero-stats div {
  display: flex;
  flex-direction: column;
}

.hero-stats dt {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--cyan);
  line-height: 1.1;
}

.hero-stats dd {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

/* demo chat card in hero */
.demo-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 18px;
  backdrop-filter: blur(10px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
}

.demo-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.demo-head .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2EE59D;
  box-shadow: 0 0 10px #2EE59D;
}

.demo-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 0 6px;
  font-size: 0.92rem;
}

.demo-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.55;
}

.demo-msg.user {
  align-self: flex-end;
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.demo-msg.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-bottom-left-radius: 4px;
}

.demo-msg.tool {
  align-self: flex-start;
  font-size: 0.78rem;
  color: var(--cyan);
  background: rgba(0, 200, 255, 0.08);
  border: 1px dashed rgba(0, 200, 255, 0.35);
  font-family: ui-monospace, "SF Mono", Menlo, monospace, var(--font);
}

.demo-footer {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ---------- Sections ---------- */
.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-dark {
  background: var(--ink);
  color: #fff;
}

.section-dark h2,
.section-dark h3 {
  color: #fff;
}

.section-head {
  max-width: 720px;
  margin-bottom: 44px;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-head .eyebrow {
  color: var(--blue);
  margin-bottom: 10px;
}

.section-dark .section-head .eyebrow {
  color: var(--cyan);
}

.section-head p {
  color: var(--muted);
  font-size: 1.05rem;
}

.section-dark .section-head p {
  color: rgba(255, 255, 255, 0.7);
}

/* tech strip: รายชื่อเทคโนโลยีเลื่อนวน */
.tech-strip {
  padding: 18px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.tech-strip-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}

.tech-label {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.marquee {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-group {
  display: flex;
  gap: 40px;
  padding-right: 40px;
}

.marquee-group strong {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
}

/* grids and cards */
.grid {
  display: grid;
  gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.card p:last-child {
  margin-bottom: 0;
}

.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.card-link:hover {
  transform: translateY(-3px);
  border-color: rgba(30, 77, 255, 0.4);
  box-shadow: 0 18px 40px rgba(30, 77, 255, 0.12);
}

.card-link .more {
  display: inline-block;
  margin-top: 14px;
  color: var(--blue);
  font-weight: 600;
  font-size: 0.92rem;
}

.card p {
  color: var(--muted);
  font-size: 0.97rem;
}

.icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(30, 77, 255, 0.12), rgba(0, 200, 255, 0.16));
  color: var(--blue);
  margin-bottom: 18px;
}

.icon-box svg {
  width: 24px;
  height: 24px;
}

/* problems */
.problem-card {
  display: grid;
  gap: 8px;
}

.problem-card .problem {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}

.problem-card .arrow {
  color: var(--cyan);
  font-weight: 700;
}

/* how it works */
.flow {
  display: grid;
  grid-template-columns: 1fr auto 1.2fr auto 1fr;
  align-items: center;
  gap: 18px;
}

.flow-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: 24px;
}

.flow-box.center {
  background: linear-gradient(135deg, rgba(30, 77, 255, 0.35), rgba(0, 200, 255, 0.18));
  border-color: rgba(0, 200, 255, 0.4);
}

.flow-box h3 {
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.flow-box ul {
  margin: 0;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.93rem;
}

.flow-box li + li {
  margin-top: 4px;
}

.flow-arrow {
  position: relative;
  justify-self: center;
  width: 56px;
  height: 2px;
  background: linear-gradient(90deg, rgba(0, 200, 255, 0.1), rgba(0, 200, 255, 0.55));
}

/* หัวลูกศร */
.flow-arrow::before {
  content: "";
  position: absolute;
  right: -2px;
  top: -4px;
  border-left: 8px solid var(--cyan);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

/* จุดข้อมูลวิ่งตามเส้น */
.flow-arrow::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: flow-dot 1.8s linear infinite;
}

/* work */
.work-card .industry {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
}

.work-metrics {
  display: flex;
  gap: 24px;
  margin: 16px 0;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.work-metrics div strong {
  display: block;
  font-size: 1.3rem;
  color: var(--ink);
  line-height: 1.2;
}

.work-metrics div span {
  font-size: 0.82rem;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tags span {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* process */
.step-card {
  position: relative;
}

.step-card .step-no {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.1em;
}

.step-card h3 {
  margin-top: 6px;
}

/* values */
.value-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
}

.value-item .check {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.value-item p {
  color: var(--muted);
  margin: 0;
}

/* FAQ */
.faq-list {
  max-width: 820px;
  margin: 0 auto;
}

.faq-list details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0 22px;
  margin-bottom: 10px;
}

.faq-list summary {
  cursor: pointer;
  padding: 18px 0;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  color: var(--blue);
  font-size: 1.3rem;
  line-height: 1;
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-list details p {
  color: var(--muted);
  padding-bottom: 18px;
  margin: 0;
}

/* CTA band */
.cta-band {
  background: var(--gradient);
  color: #fff;
  border-radius: 24px;
  padding: 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cta-band h2 {
  color: #fff;
  margin-bottom: 6px;
}

.cta-band p {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
}

.cta-band .btn-primary {
  background: #fff;
  color: var(--blue);
  box-shadow: none;
}

/* ---------- Contact form ---------- */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 40px;
  align-items: start;
}

.contact-info h3 {
  margin-top: 0;
}

.contact-info ul {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.contact-info li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.contact-info li strong {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.contact-form label {
  display: block;
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.contact-form .req {
  color: #E23D5A;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 77, 255, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.contact-form fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 16px;
}

.contact-form legend {
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.88rem;
  margin: 0 !important;
  cursor: pointer;
}

.chip:has(input:checked) {
  border-color: var(--blue);
  background: rgba(30, 77, 255, 0.06);
  color: var(--blue);
}

.radio-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 16px;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 400;
  cursor: pointer;
}

.contact-form input[type="checkbox"],
.contact-form input[type="radio"] {
  accent-color: var(--blue);
}

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

.form-error {
  color: #B4213B;
  background: #FDECEF;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.92rem;
}

.form-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 12px 0 0;
}

.contact-form button[disabled] {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.contact-success {
  text-align: center;
  padding: 24px 0;
}

.contact-success strong {
  display: block;
  font-size: 1.25rem;
  color: var(--blue);
  margin-bottom: 8px;
}

/* ---------- Inner pages ---------- */
.page-hero {
  background: var(--ink);
  color: #fff;
  padding: 64px 0 56px;
  background-image:
    radial-gradient(at 10% 10%, rgba(30, 77, 255, 0.4) 0, transparent 45%),
    radial-gradient(at 90% 80%, rgba(0, 200, 255, 0.2) 0, transparent 45%);
}

.page-hero h1 {
  color: #fff;
  max-width: 820px;
}

.page-hero p {
  color: rgba(255, 255, 255, 0.75);
  max-width: 680px;
  font-size: 1.1rem;
  margin: 0;
}

.breadcrumb {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 18px;
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--cyan);
}

.service-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

.service-content h2 {
  font-size: 1.5rem;
  margin-top: 40px;
}

.service-content h2:first-child {
  margin-top: 0;
}

.service-content .lead {
  font-size: 1.1rem;
  color: var(--muted);
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.check-list li {
  position: relative;
  padding-left: 32px;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-aside {
  position: sticky;
  top: 90px;
}

.service-aside .card h3 {
  margin-top: 0;
}

.service-aside ul {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  border-top: 1px solid var(--border);
}

.service-aside li a {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-size: 0.93rem;
}

.service-aside li a:hover,
.service-aside li a.is-active {
  color: var(--blue);
}

/* blog */
.post-card time {
  font-size: 0.82rem;
  color: var(--muted);
}

.post-card .category {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue);
  margin-right: 10px;
}

.article {
  max-width: 760px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.article h2 {
  font-size: 1.45rem;
  margin-top: 36px;
}

.article ul {
  padding-left: 22px;
}

.article li {
  margin-bottom: 6px;
}

.article-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* about */
.about-numbers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.about-numbers .card {
  text-align: center;
}

.about-numbers strong {
  display: block;
  font-size: 2rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.about-numbers span {
  color: var(--muted);
  font-size: 0.9rem;
}

.prose {
  max-width: 760px;
  font-size: 1.05rem;
}

.prose p {
  color: var(--text);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.7);
  padding: 56px 0 24px;
  margin-top: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1.2fr 1fr 1fr;
  gap: 32px;
}

.footer-brand p {
  font-size: 0.93rem;
  max-width: 340px;
  margin-top: 16px;
}

.footer-address {
  color: rgba(255, 255, 255, 0.5);
}

.site-footer h3 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li {
  margin-bottom: 8px;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.92rem;
}

.site-footer a:hover {
  color: var(--cyan);
}

.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.45);
}

.footer-bottom p {
  margin: 0;
}

/* ---------- Chat widget ---------- */
.chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--gradient);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(30, 77, 255, 0.4);
}

.chat-launcher:hover {
  transform: translateY(-2px);
}

body.chat-open .chat-launcher {
  display: none;
}

.chat-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
  width: min(400px, calc(100% - 24px));
  height: min(600px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(11, 18, 32, 0.3);
  overflow: hidden;
}

.chat-panel[hidden] {
  display: none;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--ink);
  color: #fff;
}

.chat-head-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-head-title strong {
  display: block;
  line-height: 1.2;
}

.chat-head-title small {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.78rem;
}

.chat-close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
}

.chat-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg-bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-msg-user {
  align-self: flex-end;
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg-typing {
  color: var(--muted);
  font-style: italic;
}

.chat-suggestions {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 12px 0;
  background: var(--bg);
}

.chat-suggestions button {
  flex-shrink: 0;
  font: inherit;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--blue);
  cursor: pointer;
}

.chat-suggestions button:hover {
  border-color: var(--blue);
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.chat-form input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font: inherit;
}

.chat-form .btn {
  padding: 10px 18px;
}

.chat-note {
  margin: 0;
  padding: 0 12px 10px;
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--bg);
  text-align: center;
}

/* ---------- Mobile sticky bar ---------- */
.mobile-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  grid-template-columns: 1fr 1fr 1.4fr;
  background: #fff;
  border-top: 1px solid var(--border);
}

.mobile-bar a {
  padding: 13px 0;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--ink);
  border-right: 1px solid var(--border);
}

.mobile-bar a:last-child {
  border-right: 0;
}

.mobile-bar-primary {
  background: var(--gradient);
  color: #fff !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .header-phone { display: none; }
}

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .about-numbers { grid-template-columns: repeat(2, 1fr); }
  .main-nav,
  .header-actions {
    display: none;
  }
  .menu-button {
    display: flex;
  }
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    padding: 56px 0 48px;
  }
  .flow {
    grid-template-columns: 1fr;
  }
  .flow-arrow {
    transform: rotate(90deg);
    margin: 26px 0;
  }
  .contact-layout,
  .service-layout {
    grid-template-columns: 1fr;
  }
  .service-aside {
    position: static;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: 52px;
  }
  .section {
    padding: 56px 0;
  }
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  .footer-grid,
  .about-numbers,
  .form-row,
  .radio-group {
    grid-template-columns: 1fr;
  }
  .mobile-bar {
    display: grid;
  }
  .chat-launcher {
    bottom: 66px;
    right: 14px;
  }
  .chat-panel {
    right: 12px;
    bottom: 60px;
    height: min(560px, calc(100vh - 80px));
  }
  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .cta-band {
    padding: 32px 24px;
  }
  .contact-card {
    padding: 22px;
  }
}

/* ---------- Language switch ---------- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

.lang-switch:hover {
  color: var(--blue);
  border-color: var(--blue);
}

/* ---------- Animations ---------- */

/* header มีเงาเมื่อเลื่อนหน้า */
.site-header {
  transition: box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 6px 24px rgba(11, 18, 32, 0.08);
}

/* hero: เครือข่าย AI บน canvas และแสงเรืองลอยไปมา */
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.75;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
}

.hero-orb-1 {
  width: 420px;
  height: 420px;
  top: -140px;
  left: -100px;
  background: #1E4DFF;
  opacity: 0.45;
  animation: orb-float 16s ease-in-out infinite;
}

.hero-orb-2 {
  width: 360px;
  height: 360px;
  right: -80px;
  bottom: -160px;
  background: #00C8FF;
  opacity: 0.28;
  animation: orb-float 20s ease-in-out infinite reverse;
}

.hero-inner {
  z-index: 1;
}

/* เนื้อหา hero ค่อย ๆ โผล่ทีละส่วนตอนโหลด */
.hero-anim {
  animation: fade-up 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 0.12s);
}

/* เดโม AI Agent: ข้อความโผล่ทีละขั้น (JS ใส่คลาส is-playing / is-shown) */
.demo-head .dot {
  animation: live-pulse 2s ease-in-out infinite;
}

.demo-msg {
  position: relative;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.demo-card.is-playing .demo-msg:not(.is-shown) {
  opacity: 0;
  transform: translateY(10px);
}

.demo-msg.user.is-typing::after {
  content: "▍";
  margin-left: 1px;
  animation: caret-blink 0.8s steps(2) infinite;
}

.tool-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: -3px;
  border-radius: 50%;
  background: rgba(0, 200, 255, 0.2);
  color: var(--cyan);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font);
}

.tool-status::before {
  content: "✓";
}

.demo-msg.tool.is-running .tool-status {
  background: transparent;
  border: 2px solid rgba(0, 200, 255, 0.25);
  border-top-color: var(--cyan);
  animation: spin 0.7s linear infinite;
}

.demo-msg.tool.is-running .tool-status::before {
  content: "";
}

/* bot กำลังพิมพ์: ซ่อนข้อความไว้ก่อนแต่จองพื้นที่ไว้ หน้าจะได้ไม่กระตุก */
.demo-msg.bot.is-typing {
  background: transparent;
  color: transparent;
}

.demo-msg.bot.is-typing::after {
  content: "•  •  •";
  position: absolute;
  top: 0;
  left: 0;
  padding: 6px 14px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  animation: typing-pulse 1s ease-in-out infinite;
}

/* การ์ด: แสงตามเมาส์ + ไอคอนขยับเมื่อ hover */
.card-link {
  position: relative;
  overflow: hidden;
}

.card-link > * {
  position: relative;
}

.card-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 200, 255, 0.14), transparent 45%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card-link:hover::before {
  opacity: 1;
}

.icon-box {
  transition: transform 0.3s ease;
}

.card-link:hover .icon-box {
  transform: rotate(-6deg) scale(1.08);
}

/* กล่อง AI Agent ตรงกลาง flow เรืองแสงเป็นจังหวะ */
.flow-box.center {
  animation: agent-glow 3.2s ease-in-out infinite;
}

/* ปุ่มแชทมีวงแสงกระจายเบา ๆ */
.chat-launcher::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  animation: ring 2.8s ease-out infinite;
  pointer-events: none;
}

/* เนื้อหาโผล่ขึ้นเมื่อเลื่อนมาถึง (JS ใส่คลาส reveal ให้เอง ถ้าไม่มี JS เนื้อหาแสดงปกติ) */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--delay, 0s);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

@keyframes text-shimmer {
  to { background-position: 200% center; }
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.12); }
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

@keyframes flow-dot {
  0% { transform: translateX(0); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateX(48px); opacity: 0; }
}

@keyframes agent-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(0, 200, 255, 0); }
  50% { box-shadow: 0 0 44px rgba(0, 200, 255, 0.28); }
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 4px #2EE59D; }
  50% { box-shadow: 0 0 14px #2EE59D, 0 0 0 4px rgba(46, 229, 157, 0.2); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes caret-blink {
  50% { opacity: 0; }
}

@keyframes typing-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes ring {
  0% { box-shadow: 0 0 0 0 rgba(30, 77, 255, 0.45); }
  70%, 100% { box-shadow: 0 0 0 14px rgba(30, 77, 255, 0); }
}

@media (max-width: 768px) {
  .tech-strip-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .tech-label {
    text-align: center;
  }
  .hero-stats dt { font-size: 1.3rem; }
  .hero-orb-1 { width: 280px; height: 280px; }
  .hero-orb-2 { width: 240px; height: 240px; }
}

/* ผู้ใช้ที่ตั้งค่าลดการเคลื่อนไหวในเครื่อง: ปิด animation ทั้งหมด */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-canvas,
  .hero-orb,
  .flow-arrow::after {
    display: none;
  }
  .marquee {
    -webkit-mask-image: none;
    mask-image: none;
  }
  .marquee-track {
    width: auto;
  }
  .marquee-group {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 28px;
    padding-right: 0;
  }
  .marquee-group[aria-hidden="true"] {
    display: none;
  }
}
