/* BookScap — light and friendly: a pale-blue room, white cards, the mascot and its clay icons gathered around the words. */
:root {
  --bg: #f4f7fd;
  --surface: #ffffff;
  --tint: #e8effc;
  --tint-2: #dbe6fa;
  --ink: #1b2130;
  --muted: #5b6476;
  --line: #e2e8f3;
  --blue: #2f66d8;
  --green: #2e9e6b;
  --amber: #e29a2d;
  --coral: #ee7155;
  --yellow: #f5b83d;

  --font-head: "Prompt", "IBM Plex Sans Thai", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Thai", system-ui, -apple-system, sans-serif;

  --text-hero: clamp(2.6rem, 1.6rem + 3.6vw, 4.6rem);
  --text-section: clamp(1.9rem, 1.4rem + 1.8vw, 2.9rem);
  --text-row: clamp(1.7rem, 1.3rem + 1.3vw, 2.4rem);

  --space-block: clamp(4.5rem, 3rem + 5vw, 8.5rem);
  --gutter: clamp(1.25rem, 0.8rem + 2vw, 2.5rem);
  --max: 1100px;

  --r-card: 26px;
  --r-tile: 20px;

  --dur-fast: 160ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 1px 2px rgb(27 33 48 / 0.04), 0 12px 32px -18px rgb(27 33 48 / 0.18);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
/* the mascot and its icons lean past the edges on purpose; clip them at the screen, not at their sections */
main { overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, figure { margin: 0; }
:lang(th) { line-height: 1.7; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  padding: 0.6rem 1rem; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 600;
}
.skip:focus { top: 1rem; }
:focus-visible { outline: 2.5px solid var(--blue); outline-offset: 3px; border-radius: 8px; }

/* ---------- type ---------- */
.h-hero, .h-section, .h-row {
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-wrap: balance;
}
.h-hero { font-size: var(--text-hero); }
.h-hero span { display: block; }
.h-section { font-size: var(--text-section); line-height: 1.12; margin-bottom: clamp(2rem, 4vw, 3rem); }
.h-row { font-size: var(--text-row); line-height: 1.15; }
.center { text-align: center; margin-inline: auto; max-width: 22ch; }
:lang(th) .h-hero, :lang(th) .h-section, :lang(th) .h-row { letter-spacing: -0.01em; line-height: 1.3; }

/* ---------- pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.55rem 1.1rem; border-radius: 999px;
  font-weight: 600; font-size: 0.92rem; text-decoration: none; white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast), box-shadow var(--dur-fast);
}
.pill:hover { transform: translateY(-1px); }
.pill:active { transform: scale(0.97); }
.pill-ink { background: var(--ink); color: #fff; }
.pill-ink:hover { background: #2a3245; box-shadow: 0 10px 24px -12px rgb(27 33 48 / 0.6); }
.pill-soft { background: var(--tint); color: var(--ink); }
.pill-soft:hover { background: var(--tint-2); }
.pill-big { padding: 0.85rem 1.5rem; font-size: 1.02rem; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
}
.top-inner {
  max-width: 1240px; margin: 0 auto; padding: 0.85rem var(--gutter);
  display: flex; align-items: center; gap: 2rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; font: 600 1.08rem var(--font-head); letter-spacing: -0.02em; }
.brand img { border-radius: 8px; }
.top-links { display: flex; gap: 1.6rem; font-size: 0.95rem; font-weight: 500; }
.top-links a { text-decoration: none; color: var(--muted); transition: color var(--dur-fast); }
.top-links a:hover { color: var(--ink); }
.top-actions { margin-left: auto; display: flex; gap: 0.6rem; }
@media (max-width: 820px) { .top-links { display: none; } }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 600px) minmax(0, 1fr);
  align-items: center; gap: 1rem;
  padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(3rem, 6vw, 6rem);
  min-height: min(720px, 86vh);
}
.hero-copy { text-align: center; display: grid; justify-items: center; gap: 1.4rem; padding: 0 var(--gutter); }
.lede { font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem); color: var(--muted); max-width: 30rem; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 0.4rem; }
.cta-note { font-size: 0.85rem; color: var(--muted); }

.cluster { position: relative; height: 560px; }
.cluster > * { position: absolute; }
.blob { border-radius: 50%; background: var(--tint-2); }
.float { animation: bob 6s ease-in-out infinite; }
.float:nth-child(odd) { animation-duration: 7.2s; animation-delay: -2s; }
.float:nth-child(3n) { animation-duration: 5.4s; animation-delay: -3.5s; }
.spark {
  width: 22px; height: 22px; background: var(--yellow);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}
.dot { width: 14px; height: 14px; border-radius: 50%; }

/* left: the mascot scanning, with what it scans with */
.b1 { width: 300px; height: 300px; left: 4%; top: 16%; }
.b2 { width: 150px; height: 150px; right: 2%; top: 4%; background: var(--tint); }
.b3 { width: 96px; height: 96px; left: 0; bottom: 6%; background: var(--tint); }
.m-scan { width: 104%; left: -10%; top: 30%; filter: drop-shadow(0 26px 30px rgb(46 72 130 / 0.22)); }
.i-library { width: 118px; left: 26%; top: 4%; }
.i-camera { width: 104px; right: 6%; top: 10%; }
.i-flash { width: 74px; left: 4%; top: 22%; }
.i-flatten { width: 96px; right: 14%; bottom: 0; }
.s1 { left: 16%; top: 6%; }
.s2 { right: 0; top: 52%; width: 16px; height: 16px; background: var(--blue); }
.d1 { left: 52%; top: 2%; background: var(--coral); }
.d2 { left: 10%; bottom: 20%; background: var(--blue); width: 18px; height: 18px; }

/* right: the finished e-book and where it goes */
.b4 { width: 280px; height: 280px; right: 6%; top: 20%; }
.b5 { width: 130px; height: 130px; left: 6%; top: 2%; background: var(--tint); }
.b6 { width: 110px; height: 110px; right: 0; bottom: 4%; background: var(--tint); }
.m-epub { width: 58%; left: 22%; top: 26%; filter: drop-shadow(0 22px 26px rgb(46 72 130 / 0.22)); }
.i-reader { width: 120px; left: 10%; top: 6%; }
.i-ocr { width: 104px; right: 8%; top: 4%; }
.i-reflow { width: 104px; left: 2%; bottom: 8%; }
.i-share { width: 92px; right: 14%; bottom: 2%; }
.tag {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.45rem 0.85rem; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow-card);
  font-size: 0.85rem; font-weight: 600; white-space: nowrap;
}
.tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.tag-ok { right: 9%; top: 60%; }
.tag-lang { left: 30%; bottom: 0; color: var(--blue); }
.s3 { left: 50%; top: 10%; }
.d3 { right: 30%; top: 22%; background: var(--yellow); }
.d4 { left: 0; top: 52%; background: var(--coral); width: 10px; height: 10px; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 1rem; }
  .cluster-left { order: -1; width: min(460px, 92%); height: 340px; margin: 0 auto; }
  .cluster-right { display: none; }
  .b1 { width: 220px; height: 220px; }
  .i-library { width: 84px; } .i-camera { width: 78px; } .i-flash { width: 56px; } .i-flatten { width: 70px; }
}

/* ---------- blocks and cards ---------- */
.block { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) var(--space-block); }
.card {
  background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-card);
  transition: transform 400ms var(--ease-out), box-shadow 400ms var(--ease-out);
}
.card:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgb(27 33 48 / 0.04), 0 24px 44px -22px rgb(27 33 48 / 0.28); }
.card h3 { font: 600 1.2rem/1.3 var(--font-head); letter-spacing: -0.02em; }
.card p { color: var(--muted); }

/* steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.step { padding: 0.75rem 0.75rem 1.75rem; display: grid; gap: 0.55rem; align-content: start; }
.step > :not(.step-art) { padding: 0 1rem; }
.step-art {
  height: 210px; border-radius: var(--r-tile); background: var(--tint);
  display: grid; place-items: center; margin-bottom: 0.9rem; overflow: hidden;
}
.step-art img { max-height: 160px; width: auto; transition: transform 500ms var(--ease-out); }
.step:hover .step-art img { transform: scale(1.06) rotate(-2deg); }
.step-num {
  justify-self: start; min-width: 2rem; border-radius: 999px; padding: 0.2rem 0.7rem !important; margin-left: 1rem;
  text-align: center; background: var(--blue); color: #fff !important;
  font: 600 0.85rem var(--font-head);
}

/* feature grid */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.feat { padding: 1.75rem; display: grid; gap: 0.45rem; align-content: start; }
.feat img { width: 76px; margin: -0.25rem 0 0.6rem -0.35rem; transition: transform 500ms var(--ease-out); }
.feat:hover img { transform: translateY(-4px) rotate(-6deg) scale(1.06); }

/* screens */
.screens { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.screen { display: grid; gap: 0.9rem; }
.screen-tile {
  height: 440px; overflow: hidden; border-radius: var(--r-card); background: var(--tint);
  display: flex; justify-content: center; padding-top: 2.25rem;
}
.screen-tile img { width: 66%; align-self: flex-start; filter: drop-shadow(0 18px 30px rgb(27 33 48 / 0.25)); transition: transform 600ms var(--ease-out); }
.screen:hover .screen-tile img { transform: translateY(-10px); }
.screen figcaption { display: flex; justify-content: center; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.95rem; }
.ico { width: 18px; height: 18px; border-radius: 6px; }
.ico-blue { background: var(--blue); } .ico-green { background: var(--green); } .ico-amber { background: var(--amber); }

/* rows */
.rows { display: grid; gap: clamp(3rem, 6vw, 5rem); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.row-flip .row-art { order: 2; }
.row-art {
  height: 480px; overflow: hidden; border-radius: var(--r-card); background: var(--tint);
  display: flex; justify-content: center; padding-top: 2.5rem;
}
.row-art img { width: 52%; align-self: flex-start; filter: drop-shadow(0 22px 34px rgb(27 33 48 / 0.25)); }
.row-copy { display: grid; gap: 1rem; align-content: center; }
.row-copy > p { color: var(--muted); font-size: 1.05rem; max-width: 30rem; }
.row-icon { width: 64px; margin-left: -0.3rem; }
.checks { list-style: none; margin: 0.25rem 0 0; padding: 0; display: grid; gap: 0.55rem; }
.checks li { position: relative; padding-left: 1.9rem; font-weight: 500; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 0.2em; width: 1.2rem; height: 1.2rem; border-radius: 50%;
  background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5.5 10.5 3 3 6-6.5' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.checks-green li::before { background-color: var(--green); }

/* privacy */
.privacy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; padding: clamp(1.5rem, 3vw, 2.5rem); }
.privacy-art { position: relative; height: 340px; border-radius: var(--r-tile); background: var(--tint); overflow: hidden; }
.privacy-art > * { position: absolute; }
.b7 { width: 260px; height: 260px; left: 50%; top: 50%; translate: -50% -50%; }
.m-read { width: 64%; left: 18%; bottom: 14%; filter: drop-shadow(0 20px 24px rgb(46 72 130 / 0.2)); }
.i-shield { width: 104px; right: 8%; top: 8%; transform: rotate(8deg); }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; max-width: 860px; margin: 0 auto; }
.plan { padding: 2rem; display: grid; gap: 0.9rem; align-content: start; position: relative; }
.plan h3 { font-size: 1.6rem; }
.plan-sub { font-weight: 500; }
.plan-pro { box-shadow: 0 0 0 2px var(--blue), var(--shadow-card); }
.plan-icon { position: absolute; width: 84px; right: 1.25rem; top: -1.5rem; transform: rotate(8deg); }
.personal { text-align: center; color: var(--muted); font-size: 0.92rem; max-width: 36rem; margin: 2rem auto 0; }

/* faq */
.faq { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: 2rem; align-items: start; }
.faq-list { display: grid; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; position: relative;
  padding: 1.15rem 0 1.15rem 2.1rem; font-weight: 600; font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+"; position: absolute; left: 0; top: 50%; translate: 0 -50%;
  font: 600 1.5rem/1 var(--font-head); color: var(--blue); transition: transform 300ms var(--ease-out);
}
.faq details[open] summary::before { transform: rotate(45deg); }
.faq summary:hover { color: var(--blue); }
.faq details p { color: var(--muted); padding: 0 0 1.25rem 2.1rem; max-width: 52ch; }

/* closing */
.closing {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: 1rem;
  border-radius: 32px; background: var(--tint-2); padding: clamp(2rem, 5vw, 3.5rem); overflow: hidden;
}
.closing-copy { display: grid; gap: 1.5rem; justify-items: start; }
.closing-art { position: relative; height: 260px; }
.closing-art > * { position: absolute; }
.m-process { width: 74%; left: 14%; top: 22%; }
.i-c1 { width: 92px; left: 0; top: 0; }
.i-c2 { width: 84px; right: 0; top: 4%; }
.i-c3 { width: 76px; right: 8%; bottom: 0; }

/* footer */
.foot-inner {
  max-width: var(--max); margin: 0 auto; padding: 2rem var(--gutter) 3rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem;
  border-top: 1px solid var(--line);
}
.foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: 0.92rem; }
.foot nav a { color: var(--muted); text-decoration: none; }
.foot nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.fine { width: 100%; color: var(--muted); font-size: 0.8rem; }

/* ---------- smaller screens ---------- */
@media (max-width: 860px) {
  .steps, .grid, .screens { grid-template-columns: minmax(0, 1fr); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .screens { grid-auto-flow: column; grid-auto-columns: 78%; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.5rem; }
  .screen { scroll-snap-align: start; }
  .row, .privacy, .closing, .faq { grid-template-columns: minmax(0, 1fr); }
  .row-flip .row-art { order: 0; }
  .row-art { height: 400px; }
  .plans { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .closing-art { height: 200px; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .feat { grid-template-columns: 64px minmax(0, 1fr); column-gap: 1rem; padding: 1.25rem; }
  .feat img { width: 64px; grid-row: span 2; margin: 0; }
}

/* ---------- phones: only what helps someone decide, the rest stays on bigger screens ---------- */
@media (max-width: 700px) {
  :root { --space-block: 3.5rem; }
  .top-inner { gap: 0.75rem; }
  .top-actions .pill { padding: 0.45rem 0.9rem; font-size: 0.85rem; }

  .hero { padding: 0.25rem 0 3.25rem; gap: 0.25rem; }
  .cluster-left { width: 270px; height: 190px; }
  .cluster-left > :not(.m-scan) { display: none; }
  .m-scan { width: 100%; left: 0; top: 0; }
  .hero-copy { gap: 1rem; }
  .lede { font-size: 1rem; }
  .cta-row { flex-direction: column; align-items: center; gap: 0.6rem; }

  .h-section { margin-bottom: 1.5rem; }
  .faq { gap: 0; }

  .steps { gap: 0.75rem; }
  .step {
    grid-template-columns: 84px minmax(0, 1fr); column-gap: 1rem; row-gap: 0.2rem;
    align-items: center; padding: 0.75rem;
  }
  .step-art { grid-row: span 2; height: 84px; margin: 0; border-radius: 16px; }
  .step-art img { max-height: 64px; }
  .step-num { display: none; }
  .step > :not(.step-art) { grid-column: 2; padding: 0; }
  .step h3 { font-size: 1.05rem; }
  .step p { font-size: 0.9rem; line-height: 1.5; }

  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .feat { display: grid; grid-template-columns: minmax(0, 1fr); padding: 1rem; gap: 0.35rem; }
  .feat img { width: 52px; margin: 0; grid-row: auto; }
  .feat h3 { font-size: 0.98rem; }
  .feat p { display: none; }

  .screens { grid-auto-columns: 70%; gap: 0.75rem; }
  .screen-tile { height: 330px; padding-top: 1.5rem; }
  .screen-tile img { width: 72%; }

  .rows { gap: 2.5rem; }
  .row-art, .privacy-art { display: none; }
  .row-icon { width: 52px; }
  .row-copy > p { font-size: 1rem; }
  .privacy { padding: 1.5rem; }

  .plan { padding: 1.5rem; }
  .plan-icon { width: 60px; top: -1.1rem; }

  .closing { justify-items: center; text-align: center; padding: 1.75rem 1.5rem 2rem; gap: 0.5rem; }
  .closing-copy { justify-items: center; }
  .closing-art { order: -1; width: 200px; height: 120px; }
  .closing-art > :not(.m-process) { display: none; }
  .m-process { width: 100%; left: 0; top: 0; }
}

/* ---------- reveal on scroll (only once main.js says motion is welcome) ---------- */
.js-motion .reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
.js-motion .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- guide pages ---------- */
.article { max-width: 760px; margin: 0 auto; padding: 1.5rem var(--gutter) var(--space-block); }
.article > h2 { margin: 2.75rem 0 0.9rem; }
.article > p, .article li { font-size: 1.06rem; color: #39404f; }
.article > p + p { margin-top: 0.9rem; }
.article .h-section { text-align: left; margin-bottom: 1rem; max-width: none; }
.article-lede { font-size: 1.2rem !important; color: var(--muted) !important; }
.article-art { width: min(420px, 80%); margin: 2rem auto 0; filter: drop-shadow(0 24px 30px rgb(46 72 130 / 0.2)); }
.crumbs { font-size: 0.88rem; color: var(--muted); margin-bottom: 1.5rem; }
.crumbs a { color: var(--blue); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.steps-list { margin: 1rem 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 0.75rem; }
.steps-list li {
  counter-increment: step; position: relative; padding: 1rem 1.25rem 1rem 3.4rem;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-card);
}
.steps-list li::before {
  content: counter(step); position: absolute; left: 1.1rem; top: 1rem;
  width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--blue); color: #fff; font: 600 0.85rem/1 var(--font-head);
}
.article .checks { margin-top: 0.75rem; }
.article-note { margin-top: 2.5rem !important; padding: 1rem 1.25rem; border-radius: 16px; background: var(--tint); font-size: 0.95rem !important; }
.article-cta { grid-template-columns: minmax(0, 1fr); margin-top: 3rem; text-align: left; }

/* ---------- 404 ---------- */
.notfound { min-height: 90vh; display: grid; place-content: center; justify-items: center; text-align: center; gap: 1rem; padding-top: 3rem; }
.notfound img { width: min(300px, 70vw); }
.notfound .h-section { margin: 0; }
.notfound p { color: var(--muted); }
.nobr { white-space: nowrap; }

.more { text-align: center; margin-top: 1.75rem; }
.more a { color: var(--blue); font-weight: 600; text-decoration: none; }
.more a::after { content: " →"; }
.more a:hover { text-decoration: underline; text-underline-offset: 4px; }
.screens:focus-visible { outline-offset: 6px; }

/* ---------- legal pages ---------- */
.legal > p:first-of-type { color: var(--muted); font-size: 0.95rem; }
.legal ul { margin: 0.75rem 0 0; padding-left: 1.25rem; display: grid; gap: 0.5rem; }
.legal a { color: var(--blue); }
.legal strong { color: var(--ink); }
.legal ul + p, .legal p + ul { margin-top: 1rem; }
