:root {
  --brand-red: #c0392b;
  --brand-red-dark: #922b21;
  --ink: #1c1c1c;
  --muted: #6b7280;
  --bg: #ffffff;
  --bg-soft: #faf9f8;
  --card-bg: #ffffff;
  --border: #ececec;
  --font-kanit: "Kanit";
  --font-outfit: "Outfit";
  color-scheme: light;
}

:root[data-theme="dark"] {
  --brand-red: #e0574a;
  --brand-red-dark: #c0392b;
  --ink: #f2f2f2;
  --muted: #9aa1ac;
  --bg: #121316;
  --bg-soft: #1b1d21;
  --card-bg: #1b1d21;
  --border: #2c2f34;
  color-scheme: dark;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-outfit), var(--font-kanit), sans-serif;
  color: var(--ink);
  line-height: 1.6;
  background: var(--bg);
  transition: background-color 0.25s ease, color 0.25s ease;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 40px;
  background: var(--bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.nav-logo-link {
  display: flex;
  align-items: center;
}

.nav-logo {
  height: 30px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  margin-left: 28px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a:first-child {
  margin-left: 0;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-pill {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--ink);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.toggle-pill:hover {
  border-color: var(--brand-red);
  color: var(--brand-red);
}

.toggle-icon {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-icon:hover {
  border-color: var(--brand-red);
}

@media (max-width: 560px) {
  nav {
    flex-direction: column;
    gap: 10px;
    padding: 14px 20px;
  }

  .nav-right {
    flex-direction: column;
    gap: 10px;
  }

  .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 18px;
  }

  .nav-links a {
    margin-left: 0;
  }

  .hero-logo {
    width: 110px;
  }

  .hero-hook {
    font-size: 1.7rem;
  }

  .hero-headline {
    font-size: 1.15rem;
  }
}

.nav-links a:hover {
  color: var(--brand-red);
}

.hero {
  text-align: center;
  padding: 70px 20px 60px;
  background: radial-gradient(circle at top, var(--bg) 0%, var(--bg-soft) 100%);
  transition: background-color 0.25s ease;
}

.hero-logo {
  width: 140px;
  margin-bottom: 24px;
}

.hero-hook {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 0 auto 18px;
  max-width: 760px;
  color: var(--ink);
}

.hero-headline {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--brand-red);
}

.subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 30px;
}

.cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.btn-line {
  background: #06c755;
  color: #fff;
}

.btn-outline {
  background: var(--card-bg);
  color: var(--brand-red);
  border: 2px solid var(--brand-red);
}

.btn-fastwork {
  background: #0569ff;
  color: #fff;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 20px;
}

section {
  margin: 80px 0;
}

h2 {
  text-align: center;
  margin-bottom: 14px;
  font-size: 1.8rem;
  color: var(--ink);
}

.packages h2 {
  margin-bottom: 36px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 22px;
  text-align: center;
  background: var(--card-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.card.featured {
  border-color: var(--brand-red);
  box-shadow: 0 6px 20px rgba(192, 57, 43, 0.15);
}

.badge-pop {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-red);
  color: #fff;
  font-size: 0.75rem;
  padding: 4px 14px;
  border-radius: 20px;
  font-weight: 600;
}

.card h3 {
  margin-bottom: 8px;
  color: var(--brand-red);
  font-size: 1.15rem;
}

.card .price {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.card .hosting {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.card .desc {
  font-size: 0.88rem;
  color: var(--muted);
}

.demos-intro {
  text-align: center;
  color: var(--muted);
  margin-bottom: 40px;
}

.demo-group {
  margin-bottom: 40px;
}

.demo-group-title {
  font-size: 1.1rem;
  color: var(--brand-red);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.demo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 0 18px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-soft);
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.demo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  border-color: var(--brand-red);
}

.demo-thumb {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  object-position: top center;
  display: block;
  border-bottom: 1px solid var(--border);
}

.demo-group-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.demo-name {
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  padding: 0 12px;
}

.demo-status {
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
}

.demo-status.live {
  background: var(--brand-red);
  color: #fff;
}

.how {
  background: var(--bg-soft);
  border-radius: 16px;
  padding: 50px 20px;
  transition: background-color 0.25s ease;
}

.how ol {
  max-width: 520px;
  margin: 0 auto;
  padding-left: 20px;
}

.how li {
  margin-bottom: 10px;
}

.how code {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
}

.contact {
  text-align: center;
}

.contact p {
  color: var(--muted);
  margin-bottom: 24px;
}

footer {
  text-align: center;
  padding: 40px 20px;
  border-top: 1px solid var(--border);
  transition: border-color 0.25s ease;
}

.footer-logo {
  height: 26px;
  margin-bottom: 12px;
  opacity: 0.85;
}

footer p {
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--brand-red);
}

/* Home page demo teaser */

.demos-teaser .see-all {
  display: block;
  width: fit-content;
  margin: 30px auto 0;
}

/* Home page packages teaser */

.packages-teaser .see-all {
  display: block;
  width: fit-content;
  margin: 30px auto 0;
}

/* Packages page (packages.html) */

.package-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  align-items: stretch;
}

.package-detail-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 26px;
  background: var(--card-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
}

.package-detail-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.package-detail-card.featured {
  border-color: var(--brand-red);
  box-shadow: 0 6px 20px rgba(192, 57, 43, 0.15);
}

.package-detail-card h3 {
  text-align: center;
  margin-bottom: 8px;
  color: var(--brand-red);
  font-size: 1.2rem;
}

.package-detail-card .price {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.package-detail-card .hosting {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  flex-grow: 1;
}

.feature-list li {
  position: relative;
  padding: 6px 0 6px 26px;
  font-size: 0.9rem;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
}

.feature-list li:last-child {
  border-bottom: none;
}

.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 6px;
  color: var(--brand-red);
  font-weight: 700;
}

.suited-for {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 22px;
  line-height: 1.6;
}

.suited-for strong {
  color: var(--ink);
}

.package-detail-card .btn {
  text-align: center;
  align-self: stretch;
}

.package-notes {
  max-width: 720px;
  margin: 40px auto;
  text-align: center;
}

.package-notes p {
  color: var(--muted);
}

.package-notes a {
  color: var(--brand-red);
}

/* Page header (demos.html, qa.html, blog/index.html) */

.page-header {
  text-align: center;
  padding: 60px 20px 20px;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.page-header .subtitle {
  margin-bottom: 0;
}

/* Q&A accordion */

.qa-list {
  max-width: 720px;
  margin: 0 auto;
}

.qa-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  background: var(--card-bg);
  overflow: hidden;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.qa-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 18px 22px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  position: relative;
  padding-right: 40px;
}

.qa-question::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand-red);
  font-size: 1.3rem;
}

.qa-item.open .qa-question::after {
  content: "−";
}

.qa-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.qa-item.open .qa-answer {
  max-height: 400px;
}

.qa-answer p {
  padding: 0 22px 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* Blog listing */

.blog-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.blog-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  background: var(--card-bg);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.25s ease;
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  border-color: var(--brand-red);
}

.blog-date {
  font-size: 0.8rem;
  color: var(--muted);
}

.blog-card h2 {
  text-align: left;
  font-size: 1.25rem;
  margin: 8px 0 10px;
}

.blog-card p {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 10px;
}

.blog-read-more {
  color: var(--brand-red);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Blog post article */

.blog-post {
  max-width: 720px;
  margin: 0 auto;
  padding: 50px 20px 80px;
}

.blog-post h1 {
  font-size: 1.9rem;
  margin: 10px 0 30px;
}

.blog-post h2 {
  text-align: left;
  font-size: 1.3rem;
  margin: 34px 0 14px;
}

.blog-post p,
.blog-post li {
  color: var(--ink);
  margin-bottom: 14px;
}

.blog-post ul,
.blog-post ol {
  padding-left: 22px;
  margin-bottom: 14px;
}

.blog-post code {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
}

.blog-post a {
  color: var(--brand-red);
}

.blog-cta {
  margin-top: 50px;
  padding: 30px;
  background: var(--bg-soft);
  border-radius: 14px;
  text-align: center;
}

.blog-cta p {
  margin-bottom: 16px;
  font-weight: 600;
}

/* AI chat widget (nong deedee) */

.ai-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

.ai-chat-toggle {
  position: relative;
  height: 34px;
  padding: 0 22px;
  border: none;
  border-radius: 50px;
  background: #0d0d1a;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.ai-chat-toggle:hover {
  transform: scale(1.06);
}

.ai-chat-toggle:active {
  transform: scale(0.96);
}

.ai-chat-toggle::before,
.ai-chat-toggle::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50px;
  background: linear-gradient(90deg, #ff3b30, #ff9500, #ffcc00, #34c759, #32ade6, #af52de, #ff3b30);
  background-size: 200% 100%;
  animation: aurora-slide 4s linear infinite;
  pointer-events: none;
}

.ai-chat-toggle::before {
  z-index: -2;
}

.ai-chat-toggle::after {
  z-index: -3;
  filter: blur(12px);
  opacity: 0.85;
}

@keyframes aurora-slide {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.ai-chat-toggle-text {
  position: relative;
  z-index: 1;
  font-family: var(--font-kanit), sans-serif;
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

.ai-chat-panel {
  width: 320px;
  max-width: calc(100vw - 48px);
  height: 420px;
  max-height: calc(100vh - 120px);
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

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

.ai-chat-panel:not([hidden]) {
  display: flex;
}

.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}

.ai-chat-header-title {
  font-weight: 700;
  color: var(--ink);
}

.ai-chat-close {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1;
}

.ai-chat-close:hover {
  color: var(--brand-red);
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-chat-msg p {
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 85%;
  white-space: pre-wrap;
}

.ai-chat-msg-bot p {
  background: var(--bg-soft);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}

.ai-chat-msg-user {
  align-self: flex-end;
}

.ai-chat-msg-user p {
  background: var(--brand-red);
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.ai-chat-typing p {
  opacity: 0.6;
  font-style: italic;
}

.ai-chat-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.ai-chat-link-btn {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.ai-chat-link-line {
  background: #06c755;
  color: #fff;
}

.ai-chat-link-fastwork {
  background: #0569ff;
  color: #fff;
}

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

.ai-chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.88rem;
  background: var(--bg);
  color: var(--ink);
}

.ai-chat-input:focus {
  outline: none;
  border-color: var(--brand-red);
}

.ai-chat-send {
  border: none;
  background: var(--brand-red);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
}

.ai-chat-send:hover {
  background: var(--brand-red-dark);
}

@media (max-width: 560px) {
  .ai-chat-widget {
    right: 16px;
    bottom: 16px;
  }

  .ai-chat-panel {
    width: calc(100vw - 32px);
    height: 60vh;
  }
}
