:root {
  --bg: #0f0a22;
  --bg-2: #160f33;
  --surface: #1d1540;
  --surface-2: #261b52;
  --line: rgba(167, 139, 250, 0.28);
  --line-strong: rgba(167, 139, 250, 0.55);
  --text: #f5f3ff;
  --muted: #b3abd6;
  --violet: #8b5cf6;
  --violet-2: #c084fc;
  --gold-1: #ffe27a;
  --gold-2: #fbbf24;
  --gold-3: #f59e0b;
  --ink: #1a1033;
  --pink: #f9a8d4;
  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-head: "Kanit", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Thai", "Leelawadee UI", system-ui, sans-serif;
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --space-section: clamp(64px, 9vw, 120px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-1); text-underline-offset: 3px; }
a:hover { color: #fff; }
code {
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font: 500 0.88em Consolas, "Cascadia Mono", monospace;
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0; }
p { margin: 0 0 0.8em; }
.muted { color: var(--muted); font-size: 0.92em; }
:focus-visible { outline: 3px solid var(--gold-1); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(var(--wrap), 100% - var(--gutter) * 2); margin-inline: auto; }
.wrap.narrow { --wrap: 820px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--gold-2); color: var(--ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border: 0;
  border-radius: 14px;
  font: 700 17px/1.2 var(--font-head);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.btn svg { width: 24px; height: 24px; flex: 0 0 auto; }
.btn small { display: block; font: 500 13px/1.3 var(--font-body); opacity: 0.8; }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2) 55%, var(--gold-3));
  color: var(--ink);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), inset 0 -3px 0 rgba(180, 83, 9, 0.35), 0 8px 24px rgba(245, 158, 11, 0.35);
}
.btn-gold:hover { color: var(--ink); transform: translateY(-2px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), inset 0 -3px 0 rgba(180, 83, 9, 0.35), 0 12px 30px rgba(245, 158, 11, 0.5); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}
.btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, 0.12); transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 16px 24px; font-size: 19px; }
.btn-sm { padding: 8px 16px; font-size: 15px; border-radius: 10px; }
.btn.is-disabled { opacity: 0.6; pointer-events: none; }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 10, 34, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 800 19px var(--font-head); }
.nav nav { display: flex; gap: 22px; margin-left: auto; }
.nav nav a { color: var(--muted); text-decoration: none; font: 500 15px var(--font-head); }
.nav nav a:hover { color: var(--text); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(40px, 7vw, 90px) 0 clamp(56px, 8vw, 110px);
  background:
    linear-gradient(90deg, var(--bg) 0%, rgba(15, 10, 34, 0.92) 38%, rgba(15, 10, 34, 0.35) 100%),
    url("/img/bg-manga.webp") right center / cover no-repeat;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 120px;
  background: linear-gradient(180deg, transparent, var(--bg));
  pointer-events: none;
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: 40px; }
.eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--gold-2);
  background: rgba(251, 191, 36, 0.1);
  color: var(--gold-1);
  font: 600 14px var(--font-head);
}
.hero h1 {
  font-size: clamp(40px, 6.2vw, 76px);
  font-weight: 800;
  letter-spacing: -0.5px;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 0 40px rgba(139, 92, 246, 0.45);
}
.hl {
  position: relative;
  color: var(--gold-2);
  white-space: nowrap;
}
.hl::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.02em;
  height: 0.16em;
  border-radius: 999px;
  background: var(--gold-2);
  opacity: 0.35;
  transform: rotate(-1.5deg);
}
.lead { margin: 22px 0 28px; max-width: 34em; font-size: clamp(17px, 1.6vw, 20px); color: #ddd6fe; }
.lead strong { color: var(--text); }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }
.fine { margin-top: 16px; font-size: 14px; color: var(--muted); }

.hero-art { position: relative; height: clamp(420px, 46vw, 600px); }
.hero-girl {
  position: absolute;
  right: 4%;
  bottom: -40px;
  width: 78%;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.55));
}
.hero-panel {
  position: absolute;
  left: 0;
  top: 8%;
  width: 38%;
  border-radius: 18px;
  box-shadow: 0 0 0 2px var(--line-strong), 0 24px 60px rgba(0, 0, 0, 0.6);
  transform: rotate(-4deg);
  animation: float 6s ease-in-out infinite;
}
.hero-chibi {
  position: absolute;
  right: 0;
  top: 4%;
  width: 24%;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
  animation: float 4.5s ease-in-out infinite reverse;
}
@keyframes float { 50% { translate: 0 -10px; } }

/* ---------- sections ---------- */

.section { padding: var(--space-section) 0; }
.section-alt {
  background:
    radial-gradient(60% 40% at 90% 0%, rgba(139, 92, 246, 0.18), transparent 70%),
    var(--bg-2);
  border-block: 1px solid var(--line);
}
.section-head { max-width: 680px; margin-bottom: clamp(32px, 5vw, 56px); }
.kicker {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 12px;
  background: var(--violet);
  color: #fff;
  font: 700 14px var(--font-head);
  transform: skew(-8deg);
}
.section-head h2 { font-size: clamp(30px, 4.2vw, 48px); font-weight: 800; margin-bottom: 10px; }
.section-head p:not(.kicker) { color: var(--muted); font-size: 18px; }

/* ---------- demo / compare ---------- */

.demo { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.compare {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: 0 0 0 2px var(--line-strong), 0 30px 70px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 560px;
  aspect-ratio: 800 / 1100;
  margin-inline: auto;
  user-select: none;
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-en { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.handle {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--pos);
  width: 4px;
  margin-left: -2px;
  background: var(--gold-2);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.8);
  pointer-events: none;
}
.handle::after {
  content: "⟷";
  position: absolute;
  top: 50%; left: 50%;
  translate: -50% -50%;
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--gold-2);
  color: var(--ink);
  font: 800 20px var(--font-head);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.compare-range {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}
.compare-range:focus-visible + .handle,
.compare:focus-within .handle::after { outline: 3px solid #fff; }
.tag {
  position: absolute; top: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  font: 700 14px var(--font-head);
  pointer-events: none;
}
.tag-en { left: 14px; background: rgba(15, 10, 34, 0.85); }
.tag-th { right: 14px; background: var(--gold-2); color: var(--ink); }

.demo-side { display: flex; flex-direction: column; gap: 18px; }
.demo-label { margin: 0; font: 600 15px var(--font-head); color: var(--muted); }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.thumb {
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: none;
  box-shadow: 0 0 0 2px var(--line);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.thumb img { aspect-ratio: 3 / 4; object-fit: cover; object-position: top; width: 100%; }
.thumb:hover { transform: translateY(-3px); }
.thumb.is-active { box-shadow: 0 0 0 3px var(--gold-2), 0 10px 24px rgba(245, 158, 11, 0.3); }
.quote {
  margin: 0;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.q-en { color: var(--muted); font: 500 15px/1.5 Consolas, monospace; }
.q-th { margin: 0; font: 700 22px/1.4 var(--font-head); color: var(--text); }

/* ---------- features (bento) ---------- */

.features {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.feature {
  position: relative;
  padding: 26px 24px 22px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  overflow: hidden;
}
.feature-wide { grid-column: span 2; }
.feature-full { grid-column: 1 / -1; }
.feature-accent { background: linear-gradient(135deg, rgba(251, 191, 36, 0.16), var(--surface) 60%); border-color: rgba(251, 191, 36, 0.45); }
.f-num { display: block; margin-bottom: 14px; font: 800 44px/1 var(--font-head); color: transparent; -webkit-text-stroke: 1.5px var(--violet-2); }
.feature h3 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.feature p { margin: 0; color: var(--muted); }

/* ---------- requirements ---------- */

.reqs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.req { padding: 26px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.req h3 { font-size: 20px; margin-bottom: 14px; color: var(--gold-1); }
.req ul { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.req li::marker { color: var(--violet-2); }

/* ---------- install steps ---------- */

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(40px, 6vw, 72px); }
.step { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.step:nth-child(even) .step-text { order: 2; }
/* Grid items default to min-width:auto; a long file name would widen the column past a phone screen. */
.step-text, .step-fig { min-width: 0; }
.step-text code { overflow-wrap: anywhere; }
.step-no {
  display: inline-grid; place-items: center;
  width: 52px; height: 52px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-3));
  color: var(--ink);
  font: 800 26px var(--font-head);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
  transform: rotate(-6deg);
}
.step h3 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; margin-bottom: 12px; }
.step-text .btn { margin-top: 6px; }
.ticks { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.step-fig { margin: 0; display: flex; justify-content: center; }
.step-fig.duo { gap: 16px; }
.shot {
  width: min(100%, 300px);
  border-radius: 18px;
  box-shadow: 0 0 0 2px var(--line-strong), 0 24px 50px rgba(0, 0, 0, 0.5);
}
.duo .shot { width: min(48%, 280px); }
.duo .shot:last-child { transform: translateY(28px); }
.wins { position: relative; display: block; width: 100%; max-width: 560px; margin-inline: auto; padding-bottom: 16%; }
.win {
  display: block;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 0 0 1px var(--line-strong), 0 24px 50px rgba(0, 0, 0, 0.5);
}
.wins .win:first-child { width: 84%; }
.wins .win:last-child { position: absolute; right: 0; bottom: 0; width: 70%; }
.store-shot {
  width: min(100%, 520px);
  height: auto;
  border-radius: 16px;
  box-shadow: 0 0 0 2px var(--line-strong), 0 24px 50px rgba(0, 0, 0, 0.5);
}
.shot-icon { width: 180px; border-radius: 40px; filter: drop-shadow(0 20px 40px rgba(124, 58, 237, 0.55)); }

.term {
  width: min(100%, 520px);
  border-radius: 14px;
  overflow: hidden;
  background: #0c0c12;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 24px 50px rgba(0, 0, 0, 0.5);
}
.term-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #1f1f2b; font-size: 13px; color: #a1a1b5; }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a3a4a; }
.term-bar span { margin-left: 8px; }
.term pre {
  margin: 0;
  padding: 16px 18px 20px;
  overflow-x: auto;
  color: #d4d4e0;
  font: 400 13.5px/1.7 Consolas, "Cascadia Mono", "Leelawadee UI", monospace;
}
.term b { color: #4ade80; font-weight: 600; }
.t-gold { color: var(--gold-2); }

/* ---------- api key ---------- */

.keysteps { list-style: none; margin: 0 0 40px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; counter-reset: k; }
.keysteps li {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.keysteps li > span {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--violet);
  font: 800 18px var(--font-head);
}
.keysteps h3 { font-size: 19px; margin-bottom: 6px; }
.keysteps p { margin: 0 0 6px; font-size: 15.5px; }

.cost { margin-bottom: 40px; padding: 26px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); }
.cost h3 { font-size: 21px; margin-bottom: 14px; }
.cost table { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 16px; }
.cost th, .cost td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.cost th { color: var(--muted); font: 600 14px var(--font-head); }
.pill { margin-left: 6px; padding: 1px 9px; border-radius: 999px; background: var(--gold-2); color: var(--ink); font: 700 12px var(--font-head); vertical-align: 2px; }

.help {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  align-items: center;
  padding: 26px 28px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(251, 191, 36, 0.12));
  border: 1.5px dashed var(--gold-2);
}
.help img { width: 150px; }
.help h3 { font-size: 24px; margin-bottom: 10px; }
.help ul { margin: 0 0 18px; padding-left: 20px; display: grid; gap: 6px; }

/* ---------- faq ---------- */

.faq { display: grid; gap: 10px; }
.faq details { border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 52px 18px 20px;
  position: relative;
  font: 600 18px var(--font-head);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute; right: 20px; top: 50%;
  translate: 0 -50%;
  font: 700 26px var(--font-head);
  color: var(--gold-2);
  transition: rotate 0.2s var(--ease);
}
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { margin: 0; padding: 0 20px 18px; color: var(--muted); }

/* ---------- footer ---------- */

.footer { padding: 40px 0 56px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.footer .brand { margin: 0 0 6px; }
.ver { padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font: 600 12px var(--font-head); }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.footer nav a { color: var(--muted); font-size: 15px; }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .nav nav { display: none; }
  .nav .btn { margin-left: auto; }
  .hero-grid, .demo, .step, .reqs { grid-template-columns: 1fr; }
  .hero-art { order: -1; height: clamp(320px, 80vw, 460px); }
  .step:nth-child(even) .step-text { order: 0; }
  .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .features { grid-template-columns: 1fr; }
  .feature-wide, .feature-full { grid-column: auto; }
  .cta-row .btn { width: 100%; justify-content: center; }
  .help { grid-template-columns: 1fr; text-align: left; }
  .help img { width: 110px; }
  .cost table { font-size: 14px; }
  .duo .shot:last-child { transform: none; }
  .wins { display: grid; gap: 14px; padding-bottom: 0; }
  .wins .win:first-child, .wins .win:last-child { position: static; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
