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

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', 'Noto Sans Thai', sans-serif;
  transition: background .2s ease, color .2s ease;
}

/* ===== Light/dark toggle button ===== */
.theme-toggle-wrap { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.theme-toggle-label { font-size: 13px; font-weight: 500; color: var(--sub); white-space: nowrap; }
.theme-toggle-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid #f6dbe4;
  background: #fdf3f6;
  color: #2b1a20;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: transform .15s ease, box-shadow .15s ease;
}
.theme-toggle-btn:hover { transform: scale(1.08); box-shadow: 0 4px 14px rgba(0,0,0,0.18); }

/* ===== Theme tokens ===== */
body[data-theme="dashboard"] {
  --bg: #0a0e17;
  --bg-header: rgba(13,17,27,0.7);
  --card-bg: #232a3d;
  --border: #3a4258;
  --fg: #f4f5f7;
  --sub: #a3a8b5;
  --accent: #4c6ef5;
  --accent-dark: #3b5bdb;
  --font-head: 'Inter', 'Noto Sans Thai', sans-serif;
  --title-weight: 700;
  --card-radius: 16px;
  --icon-radius: 20px;
  --logo-radius: 7px;
  --glow-opacity: 0.45;
}

/* [NEW 2026-08-11] studio theme — light editorial theme from design handoff, replaces the dark/neon "dashboard" look that got mistaken for a gambling site */
body[data-theme="studio"] {
  --bg: #f6f4f0;
  --bg-header: rgba(255,253,250,0.85);
  --card-bg: #ffffff;
  --border: #e2ddd4;
  --fg: #1c1a17;
  --sub: #6b655c;
  --accent: #2f6f5e;
  --accent-dark: #245446;
  --font-head: 'Inter', 'Noto Sans Thai', sans-serif;
  --title-weight: 700;
  --card-radius: 14px;
  --icon-radius: 0px;
  --logo-radius: 7px;
  --glow-opacity: 0;
  --dim-bg: #efece6;
  --dim-fg: #8c857a;
  --badge-ready-bg: #e2efe8;   --badge-ready-fg: #2f5f4c;
  --badge-locked-bg: #f5e6de;  --badge-locked-fg: #8a4a2c;
  --badge-soon-bg: #ece9e3;    --badge-soon-fg: #7c766c;
}

/* [NEW 2026-08-11] candy theme — white-pink bg, pink accent, tried as an alternative to studio */
body[data-theme="candy"] {
  --bg: #fdf3f6;
  --bg-header: rgba(255,248,250,0.85);
  --card-bg: #ffffff;
  --border: #f6dbe4;
  --fg: #2b1a20;
  --sub: #8a6b74;
  --accent: #e2588f;
  --accent-dark: #c53f74;
  --font-head: 'Inter', 'Noto Sans Thai', sans-serif;
  --title-weight: 700;
  --card-radius: 16px;
  --icon-radius: 0px;
  --logo-radius: 7px;
  --glow-opacity: 0.35;
  --dim-bg: #f8ecf0;
  --dim-fg: #b78e98;
  --badge-ready-bg: #2f9e5c;   --badge-ready-fg: #ffffff;
  --badge-locked-bg: #fdeee0;  --badge-locked-fg: #a8622a;
  --badge-soon-bg: #f6e9ec;    --badge-soon-fg: #97747d;
}

body[data-theme="premium"] {
  --bg: #0d0b14;
  --bg-header: rgba(16,14,22,0.7);
  --card-bg: #241f30;
  --border: rgba(150,130,175,0.5);
  --fg: #f2f0f5;
  --sub: #a79fb0;
  --accent: #d4a94a;
  --accent-dark: #a67c32;
  --font-head: 'Fraunces', 'Noto Sans Thai', serif;
  --title-weight: 600;
  --card-radius: 20px;
  --icon-radius: 50%;
  --logo-radius: 50%;
  --glow-opacity: 0.3;
}

body {
  background: var(--bg);
  color: var(--fg);
}

/* [NEW 2026-08-11] pastel gradient bg for candy theme only — cards/text/logo untouched */
body[data-theme="candy"] {
  background: linear-gradient(160deg, #eaf1ff 0%, #f1e9fb 35%, #fbe9f2 70%, #fdf3f6 100%);
  background-attachment: fixed;
}

a { text-decoration: none; color: inherit; }

/* ===== Header ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 56px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-header);
  position: sticky;
  top: 0;
  backdrop-filter: blur(6px);
  z-index: 10;
}
.logo-wrap { display: flex; align-items: center; gap: 12px; }
.logo-mark { width: 26px; height: 26px; border-radius: var(--logo-radius); object-fit: cover; display: block; }
.logo-text { font-family: var(--font-head); font-weight: 700; font-size: 18px; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav-link { color: var(--sub); font-size: 14.5px; font-weight: 500; }
.theme-toggle {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--sub);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Hero banner — full-bleed strip that fades into the page bg, per design handoff (no floating card/shadow) ===== */
.hero-section { padding: 0; }
.hero-cover-wrap { position: relative; width: 100%; overflow: hidden; }
.hero-banner {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
  object-position: center 35%;
}
.hero-cover-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, var(--bg) 96%);
  pointer-events: none;
}
.hero-profile-left { padding: 32px 56px 8px; text-align: left; display: flex; align-items: center; gap: 18px; }
.hero-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid var(--card-bg); box-shadow: 0 0 0 1px var(--border), 0 6px 16px rgba(0,0,0,0.15); flex-shrink: 0; margin-top: -36px; }
.hero-profile-text { display: flex; flex-direction: column; }
.hero-name { font-family: var(--font-head); font-size: 28px; font-weight: 800; letter-spacing: -0.01em; color: var(--fg); margin: 0 0 6px; }
.hero-desc { font-size: 15px; line-height: 1.55; color: var(--sub); max-width: 520px; margin: 0; }
@media (max-width: 560px) {
  .hero-profile-left { padding-left: 20px; padding-right: 20px; gap: 12px; }
  .hero-avatar { width: 56px; height: 56px; margin-top: -28px; }
  .hero-name { font-size: 22px; }
}

/* ===== Hero language support strip — 7-language narration badge (left-aligned, follows the tagline) ===== */
.hero-langs {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.hero-langs-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent-dark, var(--accent));
  margin: 0;
  white-space: nowrap;
}
.hero-langs-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 14px;
}
.lang-item { display: inline-flex; align-items: center; gap: 6px; }
.lang-flag { width: 20px; height: 15px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px var(--border); }
.lang-label { font-size: 12.5px; font-weight: 600; color: var(--sub); white-space: nowrap; }
.hero-langs-note {
  flex-basis: 100%;
  font-size: 15px;
  font-weight: 700;
  color: var(--sub);
  margin: 6px 0 0;
}

@media (max-width: 820px) {
  .hero-banner { height: 180px; }
}

/* ===== Tab bar [NEW 2026-08-14] — 4 sections split into tabs to fix long-scroll as card count grows ===== */
.tab-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 56px 0;
}
.tab-btn {
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--sub);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.tab-btn:hover { color: var(--fg); border-color: var(--accent); }
.tab-btn.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 45%, transparent);
}
@media (max-width: 560px) {
  .tab-bar { padding-left: 20px; padding-right: 20px; }
  .tab-btn { padding: 9px 16px; font-size: 13.5px; }
}

/* ===== Tool grid ===== */
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.grid-section { padding: 40px 56px 96px; flex: 1; }
.demo-section { padding-top: 0; }
.section-title { font-size: 22px; font-weight: 700; color: var(--fg); max-width: 1280px; margin: 0 auto 24px; }
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  max-width: 1280px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
  text-align: left;
  box-shadow: 0 1px 2px rgba(28,26,23,0.04), 0 8px 24px -16px rgba(28,26,23,0.18),
              0 0 0 2px color-mix(in srgb, var(--dark, var(--accent)) calc(var(--glow-opacity, 0) * 180%), transparent),
              0 0 30px 4px color-mix(in srgb, var(--dark, var(--accent)) calc(var(--glow-opacity, 0) * 140%), transparent);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 1px 2px rgba(28,26,23,0.04), 0 12px 28px -16px rgba(28,26,23,0.22),
              0 0 0 2.5px color-mix(in srgb, var(--dark, var(--accent)) calc(var(--glow-opacity, 0) * 220%), transparent),
              0 0 40px 6px color-mix(in srgb, var(--dark, var(--accent)) calc(var(--glow-opacity, 0) * 200%), transparent);
}
.card-dimmed { border-color: var(--border); box-shadow: 0 1px 2px rgba(28,26,23,0.04), 0 8px 24px -16px rgba(28,26,23,0.18); }

/* [NEW 2026-08-14] scroll-reveal — mobile-friendly substitute for :hover glow (touch devices don't get real hover).
   Cards start slightly down + faded, animate in once as they enter the viewport (JS toggles .is-visible via IntersectionObserver). */
.card.reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.card.reveal.is-visible { opacity: 1; transform: translateY(0); }
.card:active { transform: scale(0.97); }
.card.reveal.is-visible:active { transform: scale(0.97); }

.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  z-index: 2;
}
.badge-ready  { background: var(--badge-ready-bg, #15803d); color: var(--badge-ready-fg, #dcfce7); }
.badge-locked { background: var(--badge-locked-bg, #9a3412); color: var(--badge-locked-fg, #fed7aa); }
.badge-soon   { background: var(--badge-soon-bg, #33384a); color: var(--badge-soon-fg, var(--sub)); }

.icon-wrap { position: relative; width: 100%; aspect-ratio: 16 / 10; margin-bottom: 0; display: block; transition: none; }
.icon-tile { overflow: hidden; }
.card:hover .icon-image,
.card:hover .icon-video { transform: scale(1.06); }
.icon-glow { display: none; }
.icon-tile {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: linear-gradient(145deg, var(--light), var(--dark));
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-dimmed .icon-tile {
  filter: saturate(0.25);
}
.icon-slot { width: 100%; height: 100%; border-radius: 0; background: linear-gradient(145deg, var(--light), var(--dark)); display: flex; align-items: center; justify-content: center; font-size: 34px; line-height: 1; }
/* [NEW 2026-08-18] การ์ดดูดวงมูเตลู — ไอคอนอีโมจิใหญ่เต็มการ์ด + ดาวระยิบพื้นหลังให้ได้อารมณ์มูเตลู */
.fortune-slot {
  font-size: 72px;
  position: relative;
  text-shadow: 0 6px 22px rgba(0,0,0,.35);
}
.fortune-slot::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.8px 1.8px at 18% 24%, rgba(255,255,255,.9), transparent),
    radial-gradient(1.5px 1.5px at 76% 18%, rgba(255,240,200,.85), transparent),
    radial-gradient(1.6px 1.6px at 30% 78%, rgba(255,255,255,.7), transparent),
    radial-gradient(2px 2px at 84% 70%, rgba(255,255,255,.8), transparent),
    radial-gradient(1.4px 1.4px at 58% 42%, rgba(255,240,200,.65), transparent);
}
.card:hover .fortune-slot { transform: scale(1.06); transition: transform .35s ease; }
.icon-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; transition: transform 0.35s ease; }
.icon-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; transition: transform 0.35s ease; }
.lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: rgba(28,26,23,0.35);
  border-radius: 0;
}

.card-body { display: flex; flex-direction: column; gap: 8px; width: 100%; flex: 1; padding: 18px; }
.title-row { display: flex; align-items: center; justify-content: flex-start; gap: 8px; }
.card-title { font-size: 17px; font-weight: var(--title-weight); margin: 0; font-family: var(--font-head); }
.card-desc { color: var(--sub); font-size: 13px; line-height: 1.55; margin: 0; }

.tag-pill { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--tagBg); color: var(--tagFg); }

.cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: 8px;
  margin-top: auto;
  color: #fff;
  background: var(--cta-bg, #e2588f);
  cursor: pointer;
}
.cta-btn.cta-disabled {
  color: var(--dim-fg, var(--sub));
  background: var(--dim-bg, #1c2130);
  cursor: default;
}

.demo-link {
  display: block;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 6px;
  padding: 6px;
}
.demo-link:hover { text-decoration: underline; }

.unlock-price-banner {
  display: block;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #ff6b9d 0%, #e2588f 100%);
  border-radius: 8px;
  padding: 9px 10px;
  margin-top: 8px;
  box-shadow: 0 4px 14px rgba(226, 88, 143, 0.35);
  animation: unlock-pulse 1.8s ease-in-out infinite;
}
.unlock-price-banner:hover { filter: brightness(1.08); }
@keyframes unlock-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}

/* ===== Footer ===== */
.footer {
  padding: 36px 56px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links { display: flex; gap: 26px; flex-wrap: wrap; align-items: center; }
.footer-link { color: var(--sub); font-size: 13.5px; }
.footer-social { color: var(--sub); display: flex; align-items: center; transition: color .2s ease; }
.footer-social:hover { color: var(--accent); }
.footer-bottom { color: var(--sub); font-size: 12.5px; opacity: 0.8; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .header, .grid-section, .footer { padding-left: 20px; padding-right: 20px; }
  .grid { grid-template-columns: 1fr; }
  .nav { gap: 16px; }
}
