/* ขานยอด website. Colours follow the app (ui/theme/Color.kt). */
:root {
  --page: #f3ebd3;
  --card: #fff9e8;
  --soft: #d9f6a7;
  --lime: #7ed321;
  --green: #16803c;
  --yellow: #ffc247;
  --text: #2e3a23;
  --muted: #5b6650;
  --line: #e4d9b8;
  --shadow: 0 1px 2px rgb(46 58 35 / 6%), 0 8px 24px rgb(46 58 35 / 8%);
  --radius: 20px;
  --max: 1080px;
  color-scheme: light;
}

/* Dark: follows the phone unless the visitor picked a theme with the header button (theme.js). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #111a1b;
    --card: #1a2627;
    --soft: #25393a;
    --lime: #7ed321;
    --green: #d9f6a7;
    --yellow: #ffc247;
    --text: #edf2e6;
    --muted: #b3c0aa;
    --line: #2c4142;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #111a1b;
  --card: #1a2627;
  --soft: #25393a;
  --lime: #7ed321;
  --green: #d9f6a7;
  --yellow: #ffc247;
  --text: #edf2e6;
  --muted: #b3c0aa;
  --line: #2c4142;
  --shadow: none;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family:
    "Noto Sans Thai",
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  font-size: 17px;
  line-height: 1.75;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: var(--green);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: min(var(--max), 100% - 32px);
  margin-inline: auto;
}

/* Header */
.site-header {
  padding: 14px 0;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 20px;
}
.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}
.nav {
  margin-left: auto;
  display: flex;
  gap: 4px 18px;
  flex-wrap: wrap;
}
.nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
}
.nav a:hover {
  color: var(--green);
}
.theme-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  padding: 0;
}
.theme-toggle:hover {
  border-color: var(--green);
}
.theme-toggle svg {
  width: 22px;
  height: 22px;
}
.theme-toggle .moon {
  display: none;
}
:root[data-theme-effective="dark"] .theme-toggle .sun {
  display: none;
}
:root[data-theme-effective="dark"] .theme-toggle .moon {
  display: block;
}

/* Hero */
.hero {
  padding: 28px 0 56px;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  background: var(--soft);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  padding: 4px 12px;
  border-radius: 999px;
}
h1 {
  font-size: clamp(34px, 5.4vw, 54px);
  line-height: 1.3;
  margin: 14px 0 12px;
  letter-spacing: -0.01em;
}
h1 .accent {
  color: var(--green);
}
.lead {
  font-size: 19px;
  color: var(--muted);
  margin: 0 0 22px;
  max-width: 34em;
}
.bubble {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 2px solid var(--lime);
  border-radius: 18px 18px 18px 4px;
  padding: 10px 16px;
  font-weight: 600;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.bubble .wave {
  width: 22px;
  height: 22px;
  flex: none;
}
.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  font-family: inherit;
}
.btn-primary {
  background: var(--lime);
  color: #1b2a12;
}
.btn-primary:hover {
  filter: brightness(1.05);
}
.btn-ghost {
  color: var(--text);
  border: 2px solid var(--line);
}
.btn[aria-disabled="true"] {
  cursor: default;
}
.note {
  font-size: 14px;
  color: var(--muted);
}
.hero-art {
  justify-self: center;
  width: min(420px, 100%);
}

/* Sections */
section {
  padding: 56px 0;
}
section.alt {
  background: var(--card);
}
h2 {
  font-size: clamp(26px, 3.6vw, 34px);
  line-height: 1.35;
  margin: 0 0 10px;
}
.section-lead {
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 40em;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
}
.steps li {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  counter-increment: step;
}
section.alt .steps li {
  background: var(--page);
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--lime);
  color: #1b2a12;
  font-weight: 700;
  margin-bottom: 10px;
}
.steps h3,
.features h3,
.plan h3 {
  margin: 0 0 4px;
  font-size: 19px;
}
.steps p,
.features p {
  margin: 0;
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 32px;
  align-items: center;
}
.split img {
  width: min(360px, 100%);
  justify-self: center;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.features div {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--line);
}
section.alt .features div {
  background: var(--page);
}

.checks {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
  gap: 10px;
}
.checks li {
  position: relative;
  padding-left: 32px;
}
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--lime)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3 3 7-7' fill='none' stroke='%231B2A12' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center/16px no-repeat;
}
.checks li.no::before {
  background: var(--line)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 6l8 8M14 6l-8 8' fill='none' stroke='%232E3A23' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E")
    center/14px no-repeat;
}

.banks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.banks li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 15px;
}
section.alt .banks li {
  background: var(--page);
}

.plans {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 820px;
}
.plan {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  border: 2px solid var(--line);
}
section.alt .plan {
  background: var(--page);
}
.plan.pro {
  border-color: var(--lime);
}
.price {
  font-size: 32px;
  font-weight: 700;
  margin: 6px 0 2px;
}
.price small {
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
}
.plan .other {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 14px;
}
.was {
  text-decoration: line-through;
  color: var(--muted);
  font-weight: 500;
}
.promo-banner {
  display: inline-block;
  background: var(--yellow);
  color: #2e3a23;
  border-radius: 12px;
  padding: 8px 14px;
  margin: 0;
  font-size: 16px;
}
/* Prices as in the app's paywall: one period at a time, full price struck through after the offer. */
.period-tabs {
  display: inline-flex;
  border: 1px solid var(--green);
  border-radius: 999px;
  overflow: hidden;
  margin: 0;
}
.period-tabs button {
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  background: transparent;
  border: 0;
  padding: 8px 18px;
  min-height: 44px;
  cursor: pointer;
}
.period-tabs button + button {
  border-left: 1px solid var(--green);
}
.period-tabs button[aria-checked="true"] {
  background: var(--soft);
}
.period-tabs button[aria-checked="true"]::before {
  content: "✓ ";
}
.plans .offer {
  display: none;
}
.plans[data-period="m"] .offer[data-p="m"],
.plans[data-period="h"] .offer[data-p="h"],
.plans[data-period="y"] .offer[data-p="y"] {
  display: block;
}
.trial-badge,
.promo-badge {
  color: var(--green);
  font-size: 14px;
  font-weight: 600;
}
.trial-badge {
  margin-left: 4px;
}
.offer .price {
  font-size: 24px;
  margin: 10px 0 0;
}
.offer .price .was {
  font-size: 17px;
  margin-left: 8px;
}
.promo-badge {
  margin: 0 0 14px;
}
.plan ul {
  margin: 0;
  padding-left: 20px;
}

.callout {
  background: var(--soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 24px;
}
.callout p {
  margin: 0;
}

/* Policy pages */
.doc {
  padding: 24px 0 64px;
}
.doc .wrap {
  max-width: 760px;
}
.doc h1 {
  font-size: clamp(30px, 4.6vw, 40px);
  margin-top: 6px;
}
.doc h2 {
  font-size: 23px;
  margin: 40px 0 8px;
  scroll-margin-top: 16px;
}
.doc h3 {
  font-size: 19px;
  margin: 24px 0 6px;
}
.meta {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 0 0 24px;
  border: 1px solid var(--line);
}
.meta p {
  margin: 0;
}
.toc {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 20px 16px 40px;
  margin: 0 0 8px;
  border: 1px solid var(--line);
}
.toc li {
  margin: 2px 0;
}
.doc ol:not(.toc),
.doc ul {
  padding-left: 24px;
}
.doc li {
  margin: 4px 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 36px;
  font-size: 15px;
  color: var(--muted);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
}
.site-footer nav {
  display: flex;
  gap: 8px 20px;
  flex-wrap: wrap;
}
.site-footer p {
  margin: 0;
}

/* Thai has no spaces between words: keep short phrases whole, and avoid one-word last lines. */
.nb {
  white-space: nowrap;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
p,
li {
  text-wrap: pretty;
}

/* Promo banner and period switcher share a row and wrap together. */
.pricing-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 0 0 20px;
}

/* Tablet and below: one-column hero, centred art. */
@media (max-width: 860px) {
  .hero {
    padding-top: 12px;
  }
  .hero .wrap,
  .split {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .hero-art {
    grid-row: 1;
    width: min(260px, 64%);
  }
  .split img {
    width: min(240px, 60%);
  }
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Steps and plans side by side while there is room. */
@media (max-width: 639px) {
  .steps,
  .plans {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 640px) and (max-width: 860px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .steps li {
    padding: 18px;
  }
}

/* Phones. */
@media (max-width: 559px) {
  body {
    font-size: 16px;
  }
  section {
    padding: 44px 0;
  }
  .features {
    grid-template-columns: 1fr;
  }
  /* Brand and theme button on the first row, the menu on its own row below. */
  .site-header .wrap {
    gap: 10px 12px;
  }
  .theme-toggle {
    margin-left: auto;
  }
  .nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 4px 20px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }
  .lead {
    font-size: 17px;
  }
  .bubble {
    font-size: 15px;
    padding: 10px 14px;
  }
  .cta-row .btn {
    flex: 1 1 100%;
    justify-content: center;
  }
  .offer .price {
    font-size: 22px;
  }
}
@media (min-width: 1001px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 861px) and (max-width: 1000px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
