/* นิทานของหนู — storefront. Palette is taken from the books' own art: paper, night sky, star, rose, brown ink. */
:root {
  --paper: #fbf6ec; --sheet: #fffdf8; --ink: #3b2f2a; --ink-2: #6f5a4b; --night: #2b3a67; --star: #f2c14e;
  --rose: #e9a6a1; --line: #eadfcd; --action: #2b3a67;
  --head: "Mali", "IBM Plex Sans Thai", system-ui, sans-serif; --body: "IBM Plex Sans Thai", system-ui, sans-serif;
  --wrap: min(1100px, 100% - 32px);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.7 var(--body); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--star); outline-offset: 3px; border-radius: 6px; }
.wrap { width: var(--wrap); margin-inline: auto; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; line-height: 1.5; margin: 0 0 .4em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
p { margin: 0 0 1em; }
.muted { color: var(--ink-2); }
.top { padding-block: 16px; border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 16px; }
.brand { font: 700 1.15rem/1 var(--head); text-decoration: none; }
.brand span { color: var(--rose); }
.top nav { margin-left: auto; display: flex; gap: 18px; font-size: .95rem; }
.top nav a { text-decoration: none; color: var(--ink-2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 24px; border-radius: 999px;
  background: var(--action); color: #fff; font: 600 1rem/1 var(--body); text-decoration: none; border: 2px solid var(--action); cursor: pointer; }
.btn.ghost { background: transparent; color: var(--action); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: .9rem; }
.hero { padding-block: 40px 56px; }
.hero .wrap { display: grid; grid-template-columns: 1fr 1.05fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 34em; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
/* the signature: before/after spread — the same page, preset hero vs "your" hero */
.swap { position: relative; border-radius: 18px; overflow: hidden; box-shadow: 0 30px 60px -36px rgba(43, 58, 103, .55); aspect-ratio: 1; }
.swap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.swap .after { clip-path: inset(0 0 0 var(--cut, 50%)); }
.swap .handle { position: absolute; top: 0; bottom: 0; left: var(--cut, 50%); width: 3px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.swap .handle::after { content: "↔"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%;
  background: #fff; color: var(--night); display: grid; place-items: center; font-weight: 700; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.swap input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.swap-cap { display: flex; justify-content: space-between; font-size: .85rem; color: var(--ink-2); margin-top: 8px; }
.section { padding-block: 48px 0; }
.books { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .books { grid-template-columns: 1fr; } }
.book { background: var(--sheet); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; text-decoration: none; display: flex; flex-direction: column; }
.book img { aspect-ratio: 1; object-fit: cover; }
.book .body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.book .tag { align-self: flex-start; font: 600 .8rem/1 var(--body); background: var(--star); color: var(--ink); padding: 6px 10px; border-radius: 999px; }
.book .more { margin-top: auto; font-weight: 600; color: var(--night); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.steps li { list-style: none; background: var(--sheet); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.steps li::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--night); color: #fff; font: 700 1rem/1 var(--head); margin-bottom: 10px; }
.steps { padding: 0; margin: 0; }
.prices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 700px) { .prices { grid-template-columns: 1fr; } }
.price { background: var(--sheet); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.price strong { font: 700 2rem/1.2 var(--head); }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 10px 0 0; color: var(--ink-2); }
.foot { margin-top: 72px; border-top: 1px solid var(--line); padding-block: 32px 48px; font-size: .88rem; color: var(--ink-2); }
/* flip-through viewer */
.viewer { background: var(--night); border-radius: 22px; padding: 22px; }
.track { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 12px; }
.track::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .track { grid-auto-columns: 50%; } }
.track img { scroll-snap-align: start; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--paper); }
.vbar { display: flex; align-items: center; gap: 12px; margin-top: 14px; color: #fff; }
.vbar .count { margin-inline: auto; font-variant-numeric: tabular-nums; }
.vbar button { all: unset; cursor: pointer; width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.14); display: grid; place-items: center; font-size: 1.3rem; }
.vbar button:focus-visible { outline: 3px solid var(--star); }
.note { font-size: .9rem; color: var(--ink-2); }
.order { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
@media (max-width: 700px) { .order { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .track { scroll-behavior: auto; } }
.price .btn { margin-top: auto; }
