/* ============================================================
   SiamWord — main.css
   สไตล์หลักของเว็บไซต์ ยึดตาม Design System (.claude/docs/DESIGN.md)
   หมายเหตุ: ใช้ Tailwind เป็นหลัก ไฟล์นี้เก็บเฉพาะ token / component
   ที่ Tailwind ไม่ครอบคลุม และ animation ต่าง ๆ
   ============================================================ */

/* ---------- ตัวแปรสี + ค่า design token จาก DESIGN.md ---------- */
:root {
  /* สีแบรนด์ (เหลืองสีเดียวเป็น accent) */
  --c-primary: #fcd535;
  --c-primary-active: #f0b90b;
  --c-primary-soft: #fff7d6;

  /* สีข้อความ */
  --c-ink: #181a20;
  --c-ink-soft: #2b3139;
  --c-body: #3d4451;
  --c-muted: #707a8a;
  --c-muted-strong: #5a626e;

  /* พื้นผิว */
  --c-canvas: #ffffff;
  --c-surface-soft: #fafafa;
  --c-surface-strong: #f5f5f5;
  --c-surface-dark: #181a20;

  /* เส้นคั่น */
  --c-hairline: #eaecef;
  --c-hairline-strong: #d6dae0;

  /* สีเฉพาะหน้าที่ */
  --c-on-primary: #181a20;
  --c-on-dark: #ffffff;
  --c-success: #0ecb81;
  --c-line-green: #06c755;

  /* เงาการ์ดตอน hover */
  --shadow-card: 0 12px 28px rgba(24, 26, 32, 0.10);

  /* ฟอนต์ */
  --font-display: "Anuphan", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "IBM Plex Sans Thai", -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- พื้นฐาน ---------- */
html {
  scroll-behavior: smooth;
  /* เผื่อระยะให้ sticky nav สูง 72px เวลา anchor scroll */
  scroll-padding-top: 88px;
}

body {
  font-family: var(--font-body);
  color: var(--c-body);
  background-color: var(--c-canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* หัวข้อ/ปุ่ม/ตัวเลข ใช้ Anuphan */
h1, h2, h3, h4, h5, h6,
.font-display {
  font-family: var(--font-display);
  color: var(--c-ink);
}

/* ---------- Type token (ตรงตาม DESIGN.md) ---------- */
.t-hero-display {
  font-family: var(--font-display);
  font-size: 60px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.t-display-lg {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.3px;
}
.t-display-md {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.2;
}
.t-display-sm {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
}
.t-title-lg {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}
.t-title-md {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
}
.t-title-sm {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}
.t-stat-number {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.3px;
}
.t-body-lg {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.7;
}
.t-body-md {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
}
.t-body-sm {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
}
.t-caption {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.3px;
}

/* ---------- Eyebrow pill (ป้ายหัวข้อย่อย) ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background-color: var(--c-primary-soft);
  color: var(--c-ink);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 28px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease,
    box-shadow 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}
/* ปุ่มหลัก ดำบนเหลือง (signature) */
.btn-primary {
  background-color: var(--c-primary);
  color: var(--c-on-primary);
  border: 1px solid var(--c-primary);
}
.btn-primary:hover {
  background-color: var(--c-primary-active);
  border-color: var(--c-primary-active);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(240, 185, 11, 0.32);
}
/* ปุ่มรอง ขาวมีกรอบ */
.btn-secondary {
  background-color: var(--c-canvas);
  color: var(--c-ink);
  border: 1px solid var(--c-hairline-strong);
}
.btn-secondary:hover {
  border-color: var(--c-ink);
  transform: translateY(-2px);
}
/* ปุ่ม LINE สีเขียวเฉพาะ LINE เท่านั้น */
.btn-line {
  background-color: var(--c-line-green);
  color: var(--c-on-dark);
  border: 1px solid var(--c-line-green);
}
.btn-line:hover {
  filter: brightness(0.95);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(6, 199, 85, 0.3);
}
/* ปุ่มทรงแคปซูล */
.btn-pill {
  border-radius: 9999px;
  padding: 0 32px;
}
/* ปุ่มเต็มความกว้าง (ใช้ตอนมือถือ/การ์ดราคา) */
.btn-block {
  width: 100%;
}

/* ---------- ไอคอนชิป (มน พื้นเหลืองอ่อน) ---------- */
.icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background-color: var(--c-primary-soft);
  color: var(--c-ink);
  font-size: 22px;
  flex-shrink: 0;
}

/* ---------- Stat callout (ตัวเลขสถิติ + เส้นใต้เหลือง) ---------- */
.stat-underline::after {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  margin-top: 8px;
  border-radius: 2px;
  background-color: var(--c-primary);
}

/* ---------- การ์ดบริการ (hover ยกขึ้น + เส้นบนเหลือง) ---------- */
.service-card {
  position: relative;
  background-color: var(--c-canvas);
  border: 1px solid var(--c-hairline);
  border-radius: 14px;
  padding: 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}
/* แถบสีเหลืองด้านบนที่จะโผล่ตอน hover */
.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--c-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
  border-color: transparent;
}
.service-card:hover::before {
  transform: scaleX(1);
}

/* ---------- Trust badge ---------- */
.trust-badge {
  background-color: var(--c-surface-soft);
  border: 1px solid var(--c-hairline);
  border-radius: 10px;
  padding: 20px 24px;
}

/* ---------- การ์ดผลงาน (placeholder + overlay ตอน hover) ---------- */
.portfolio-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background-color: var(--c-surface-strong);
  aspect-ratio: 4 / 3;
  cursor: pointer;
}
.portfolio-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.portfolio-card:hover img {
  transform: scale(1.06);
}
/* overlay มืดด้านล่าง เผยชื่อโปรเจกต์ (เป็น overlay ของรูป ไม่ใช่พื้นแบรนด์) */
.portfolio-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  background: linear-gradient(
    to top,
    rgba(24, 26, 32, 0.82) 0%,
    rgba(24, 26, 32, 0.35) 45%,
    rgba(24, 26, 32, 0) 75%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}
.portfolio-card:hover .portfolio-overlay {
  opacity: 1;
}

/* ---------- การ์ดราคา ---------- */
.price-card {
  position: relative;
  background-color: var(--c-canvas);
  border: 1px solid var(--c-hairline);
  border-radius: 14px;
  padding: 32px 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.price-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}
/* การ์ดแนะนำ ขอบเหลืองเด่น */
.price-card--featured {
  border: 2px solid var(--c-primary);
  box-shadow: var(--shadow-card);
}

/* ---------- Step card (ขั้นตอนทำงาน) ---------- */
.step-card {
  position: relative;
  background-color: var(--c-surface-soft);
  border-radius: 14px;
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.step-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

/* ---------- Review card ---------- */
.review-card {
  background-color: var(--c-canvas);
  border: 1px solid var(--c-hairline);
  border-radius: 14px;
  padding: 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.review-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--c-primary-soft);
  color: var(--c-ink);
  font-family: var(--font-display);
  font-weight: 700;
  flex-shrink: 0;
}

/* ---------- FAQ accordion ---------- */
.faq-row {
  border-bottom: 1px solid var(--c-hairline);
}
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 22px 0;
  text-align: left;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--c-ink);
}
.faq-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: var(--c-primary-soft);
  color: var(--c-ink);
  transition: transform 0.3s ease, background-color 0.3s ease;
}
/* ส่วนคำตอบ ใช้ max-height ทำ transition เปิด/ปิด */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.3s ease;
  opacity: 0;
}
.faq-row.open .faq-answer {
  opacity: 1;
  padding-bottom: 22px;
}
.faq-row.open .faq-icon {
  transform: rotate(45deg);
  background-color: var(--c-primary);
}

/* ---------- Top nav ---------- */
.site-nav {
  transition: box-shadow 0.25s ease, background-color 0.25s ease;
}
/* เพิ่มเงาเมื่อ scroll ลงมา (เพิ่ม class ด้วย JS) */
.site-nav.scrolled {
  box-shadow: 0 6px 20px rgba(24, 26, 32, 0.06);
}
.nav-link {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--c-ink-soft);
  position: relative;
  transition: color 0.18s ease;
}
.nav-link:hover {
  color: var(--c-ink);
}
/* เส้นใต้เหลืองตอน hover */
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background-color: var(--c-primary);
  transition: width 0.22s ease;
}
.nav-link:hover::after {
  width: 100%;
}

/* เมนูมือถือ (เลื่อนลงจากด้านบน) */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.mobile-menu.open {
  max-height: 560px;
}

/* ---------- Scroll reveal (ค่อย ๆ จาง+เลื่อนขึ้น) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- จุดลายตกแต่งใน hero (วงกลมเหลืองอ่อนเบลอ ๆ) ---------- */
.hero-blob {
  position: absolute;
  border-radius: 9999px;
  background-color: var(--c-primary-soft);
  filter: blur(6px);
  z-index: 0;
  pointer-events: none;
}

/* ---------- Responsive ---------- */
/* แท็บเล็ต/มือถือ: ลดขนาดหัวข้อใหญ่ + ระยะ section */
@media (max-width: 1024px) {
  .t-hero-display { font-size: 46px; }
  .t-display-lg { font-size: 36px; }
  .t-display-md { font-size: 28px; }
}

@media (max-width: 767px) {
  html { scroll-padding-top: 76px; }
  .t-hero-display { font-size: 34px; }
  .t-display-lg { font-size: 30px; }
  .t-display-md { font-size: 26px; }
  .t-display-sm { font-size: 22px; }
  .t-stat-number { font-size: 32px; }

  /* ปุ่มในกลุ่ม CTA ขยายเต็มความกว้างบนมือถือ */
  .cta-stack .btn {
    width: 100%;
  }
}

/* เคารพผู้ใช้ที่ปิด motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
