:root {
  --paper: #fbf7f0;
  --paper-2: #f4ede1;
  --card: #fffdf9;
  --ink: #1f1d1a;
  --ink-2: #4a4640;
  --ink-3: #7a756c;
  --rule: #e4dccd;
  --pip: #f2643d;
  --pip-dark: #c9481f;
  --pip-tint: #ffe0d5;
  --sun: #f5b83d;
  --line: #06c755;
  --line-dark: #05a647;
  --note: #fff3b8;

  --serif: "Noto Serif Thai", "Thonburi", serif;
  --sans: "IBM Plex Sans Thai", "Thonburi", system-ui, sans-serif;
  --en-italic: "Fraunces", Georgia, serif;

  --r: 14px;
  --shadow: 0 1px 0 rgba(31, 29, 26, .06), 0 10px 30px -12px rgba(31, 29, 26, .18);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.75 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.35; margin: 0; letter-spacing: -.005em; }
h2 { font-size: clamp(28px, 4.2vw, 44px); font-weight: 800; }
h3 { font-size: 21px; font-weight: 600; }
p { margin: 0 0 1em; }
strong { font-weight: 600; }
q { quotes: "“" "”"; }

.wrap { width: min(1140px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); }
.center { text-align: center; }
.nb { white-space: nowrap; }
.muted { color: var(--ink-3); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--pip); outline-offset: 3px; border-radius: 6px; }

/* hand-drawn highlighter */
.mark {
  background: linear-gradient(transparent 58%, var(--pip-tint) 58%, var(--pip-tint) 92%, transparent 92%);
  padding: 0 .08em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border-radius: 999px;
  font: 600 17px/1 var(--sans); text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn svg { width: 22px; height: 22px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn-line { background: var(--line); color: #fff; box-shadow: 0 6px 0 -2px var(--line-dark); }
.btn-line:hover { background: var(--line-dark); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #000; }
.btn-ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 15px; box-shadow: none; }
.btn-lg { min-height: 60px; padding: 0 28px; font-size: 19px; }
.btn-block { width: 100%; }
/* once the learner has answered, the button is the only way to the next question: make it ask for the tap */
.btn-line.is-hot { animation: nudge 1.6s ease-in-out 3; }
@keyframes nudge { 0%, 100% { transform: none; } 12% { transform: scale(1.04); } 24% { transform: none; } }

/* header: logo only, nothing to choose */
.site-header { background: var(--paper); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font: 700 20px/1 var(--sans); letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; }
.header-free { font-size: 13px; font-weight: 600; color: #086b33; background: #ddf5e5; padding: 5px 10px; border-radius: 999px; }

/* hero: headline, one question, one button */
.hero { padding: 12px 0 48px; }
.hero-inner { max-width: 520px; }
.hero h1 { font-size: clamp(27px, 7.4vw, 44px); font-weight: 800; line-height: 1.35; margin-bottom: 6px; }
.rotate { display: inline-block; transition: opacity .25s ease, transform .25s ease; }
.rotate.out { opacity: 0; transform: translateY(-6px); }
.lede { font-size: 16px; color: var(--ink-3); margin-bottom: 16px; }
.assure { font-size: 13.5px; color: var(--ink-3); text-align: center; margin: 12px 0 0; }

.quiz { background: var(--card); border: 1px solid var(--rule); border-radius: 20px; padding: 18px 18px 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.quiz-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.quiz-count { font-size: 13px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.quiz-bar { flex: 1; height: 8px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.quiz-bar span { display: block; height: 100%; width: 0; background: var(--pip); border-radius: 999px; transition: width .5s ease; }
.q-prompt { color: var(--ink-2); font-size: 15px; margin-bottom: 4px; }
.q-sentence { font: italic 500 24px/1.45 var(--en-italic); margin: 0 0 16px; }
.blank { display: inline-block; min-width: 3em; border-bottom: 2px solid var(--ink); text-align: center; color: var(--ink-3); font-style: normal; }
.blank.filled { color: var(--pip-dark); font-style: italic; border-color: var(--pip); }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choices button {
  font: 600 18px/1.2 var(--sans); min-height: 52px; padding: 0 8px; border-radius: 14px; border: 2px solid var(--rule);
  background: var(--paper); color: var(--ink); cursor: pointer; transition: border-color .15s, background-color .15s;
}
.choices button:hover:not(:disabled) { border-color: var(--ink); }
.choices button.is-right { border-color: var(--line); background: #e6f8ec; }
.choices button.is-wrong { border-color: var(--pip); background: #fff0ea; }
.choices button:disabled { cursor: default; }
.result { margin-top: 14px; }
.result-big { font: 800 20px/1.4 var(--serif); margin: 0 0 4px; }
.result-sub { font-size: 14.5px; color: var(--ink-2); margin: 0 0 10px; }
.result-next { font-size: 15.5px; margin: 0; padding: 10px 12px; background: var(--note); border-radius: 10px; }

/* why it sticks */
.why { padding: 0 0 48px; }
.why h2 { font-size: 24px; font-weight: 800; margin-bottom: 14px; }
.curve { margin: 0 0 16px; background: var(--card); border: 1px solid var(--rule); border-radius: 18px; padding: 14px 12px 8px; }
.curve svg { width: 100%; height: auto; overflow: visible; }
.axis line { stroke: var(--ink-3); stroke-width: 1.2; }
.axis text { font: 400 11px var(--sans); fill: var(--ink-3); }
.line-forget { fill: none; stroke: var(--ink-3); stroke-width: 2.5; stroke-dasharray: 2 6; stroke-linecap: round; }
.line-review { fill: none; stroke: var(--pip); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.js .curve .line-review { stroke-dasharray: 800; stroke-dashoffset: 800; }
.js .curve.in .line-review { animation: draw 2s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .js .curve .line-review { stroke-dasharray: none; stroke-dashoffset: 0; } }
.dots circle { fill: var(--pip); stroke: var(--card); stroke-width: 2.5; }
.lbl-forget { font: 500 12px var(--sans); fill: var(--ink-3); }
.lbl-review { font: 600 12px var(--sans); fill: var(--pip-dark); }
.tech { list-style: none; padding: 0; margin: 0 0 10px; }
.tech li { position: relative; padding: 5px 0 5px 28px; font-size: 16px; font-weight: 500; }
.tech li::before { content: ""; position: absolute; left: 4px; top: 14px; width: 12px; height: 7px; border-left: 2.5px solid var(--pip); border-bottom: 2.5px solid var(--pip); transform: rotate(-45deg); }
.tag-tech { display: inline-block; font: 600 11.5px/1 var(--sans); letter-spacing: .02em; color: var(--pip-dark); background: var(--pip-tint); padding: 4px 8px; border-radius: 999px; margin-top: 4px; white-space: nowrap; }
.tech .tag-tech { display: table; }
.cite { font-size: 12px; color: var(--ink-3); line-height: 1.6; margin: 0; }

.read-more { display: inline-block; margin-top: 8px; padding: 6px 0; font-size: 14px; color: var(--ink-3); text-underline-offset: 3px; }
.read-more:hover { color: var(--ink); }

/* what happens next */
.next { padding: 48px 0; background: var(--paper-2); }
.next h2, .faq h2 { font-size: 24px; font-weight: 800; margin-bottom: 18px; }
.steps { list-style: none; padding: 0; margin: 0 0 24px; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; padding: 10px 0; }
.steps li::before { content: counter(s); grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; background: var(--pip); color: #fff; font: 700 16px/30px var(--sans); text-align: center; }
.steps b { font-size: 17px; font-weight: 600; line-height: 1.5; }
.steps span { font-size: 14.5px; color: var(--ink-3); line-height: 1.5; }
.chat { display: flex; align-items: flex-end; gap: 8px; background: #8aa3c0; border-radius: 18px; padding: 16px 14px; }
.chat-pip { width: 32px; height: 32px; background: #fff; border-radius: 50%; padding: 3px; flex: none; }
.bubble { background: #fff; padding: 10px 14px; border-radius: 18px 18px 18px 4px; font-size: 15px; line-height: 1.55; }
.quick { display: inline-block; margin-left: 6px; color: #1d7c3f; font-weight: 600; font-size: 13.5px; border: 1px solid #1d7c3f44; border-radius: 999px; padding: 1px 10px; }

/* faq */
.faq { padding: 48px 0 56px; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; padding: 14px 36px 14px 0; position: relative; font: 600 17px/1.5 var(--sans); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font: 400 26px/1 var(--sans); color: var(--pip); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); font-size: 15.5px; padding-bottom: 14px; margin: 0; }
.faq-cta { margin-top: 28px; }

/* footer */
.site-footer { background: var(--ink); color: #cfc8bc; padding: 32px 0 110px; font-size: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; }
.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover { color: #fff; text-decoration: underline; }
.legal { font-size: 12px; color: #958e82; margin: 0; line-height: 1.6; }

/* sticky cta: on phones, the button is always one thumb away once the hero one scrolls off */
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(251, 247, 240, .96); border-top: 1px solid var(--rule); transform: translateY(110%); transition: transform .25s ease; }
.sticky-cta.show { transform: none; }
@media (min-width: 861px) { .sticky-cta { display: none; } }

/* desktop: same single column, just centred and roomier */
@media (min-width: 760px) {
  .hero { padding: 48px 0 72px; }
  .hero-inner { margin-inline: auto; text-align: center; }
  .quiz { text-align: left; }
}

.section { padding: 72px 0; }

/* how-it-works (generated by scripts/build-how-it-works.mjs) */
.principle { margin-top: 18px; padding: 20px 20px 16px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); }
.principle h2 { display: flex; gap: 10px; align-items: baseline; font-size: 20px; font-weight: 600; margin-bottom: 10px; }
.principle-n { font: 800 20px/1 var(--serif); color: var(--pip); }
.principle p { color: var(--ink-2); font-size: 15.5px; }
.in-pip { background: var(--pip-tint); border-radius: 10px; padding: 10px 12px; color: var(--ink) !important; }
.in-pip b { color: var(--pip-dark); margin-right: 4px; }
.sources summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--ink-3); }
.sources ul { margin: 8px 0 0; padding-left: 1.2em; }
.sources li { font-size: 12.5px; line-height: 1.55; margin-bottom: 6px; color: var(--ink-3); }
.sources a { color: inherit; text-underline-offset: 3px; word-break: break-word; }
.how-note { margin: 22px 0; font-size: 13px; color: var(--ink-3); }
.how-page .header-back { margin-left: auto; }
.how-page h1 { font-size: clamp(26px, 6.6vw, 38px); margin-bottom: 10px; }

/* legal pages (terms.html, privacy.html: generated by scripts/build-legal.mjs) */
.header-back { margin-left: auto; }
.legal-page { padding: 40px 0 72px; }
.legal-page h1 { font-size: clamp(30px, 5vw, 42px); font-weight: 800; }
.legal-updated { margin: 8px 0 20px; color: var(--ink-3); font-size: 14px; }
.legal-intro { font-size: 18px; color: var(--ink-2); }
.legal-section { margin-top: 18px; padding: 22px 24px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); }
.legal-section h2 { font-size: 21px; font-weight: 600; margin-bottom: 10px; }
.legal-section p, .legal-section li { color: var(--ink-2); font-size: 16px; }
.legal-section ul { margin: 0 0 1em; padding-left: 1.3em; }
.legal-section li { margin-bottom: .35em; }
.legal-section p:last-child, .legal-section ul:last-child { margin-bottom: 0; }
.legal-other { margin-top: 28px; }
.legal-other a { color: var(--ink); text-underline-offset: 4px; text-decoration-color: var(--pip); }
.site-footer .legal a { color: inherit; text-underline-offset: 4px; }
