:root {
  color-scheme: dark;
  --bg: #0e1328;
  --paper: #171e3a;
  --ink: #f6f4ff;
  --muted: #c1c9e5;
  --purple: #bec8fc;
  --purple-deep: #e0e5ff;
  --line: #8794ce45;
  --gold: #ffdb8a;
  --gold-ink: #30214c;
  --sage: #a5e6c1;
  --shadow: 0 14px 40px #03061750;
  --round: 22px;
  font-family: 'Thonburi', 'Noto Sans Thai', 'Leelawadee UI', Tahoma, sans-serif;
  font-size: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 83% 17%, #24234a 0%, transparent 55%) fixed, var(--bg); color: var(--ink); line-height: 1.65; }
img { display: block; max-width: 100%; object-fit: cover; }
a { text-decoration: none; color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
p, h1, h2, h3 { margin: 0; }
h1, h2, h3 { line-height: 1.27; }
h1 { font-size: clamp(1.9rem, 4.4vw, 3.25rem); }
h2 { font-size: clamp(1.45rem, 2.8vw, 2.13rem); }
h3 { font-size: 1.18rem; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
main:focus { outline: none; }
[hidden] { display: none !important; }
.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.skip { position: fixed; z-index: 20; top: 6px; left: 6px; transform: translateY(-150%); background: var(--gold); color: var(--gold-ink); padding: .55rem 1rem; border-radius: 8px; }
.skip:focus { transform: none; }
.top { background: #11162cf5; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 72px; gap: 1rem; }
.logo { display: block; width: fit-content; max-width: 100%; }
.logo img { width: clamp(155px, 16vw, 222px); height: auto; }
.footer-logo img { width: 150px; }
.nav-links, .nav-actions { display: flex; gap: clamp(.55rem, 2.3vw, 1.8rem); align-items: center; }
.nav-links a { position: relative; white-space: nowrap; padding-block: 1.45rem; color: var(--muted); font-weight: 700; }
.nav-links a[aria-current] { color: var(--purple-deep); }
.nav-links a[aria-current]::after { content: ""; position: absolute; bottom: 0; inset-inline: 0; border-radius: 4px 4px 0 0; height: 3px; background: var(--gold); }
.nav-actions { justify-content: end; gap: .8rem; }
.cart-link { position: relative; color: var(--purple-deep); display: grid; place-items: center; width: 43px; height: 43px; border: 1px solid var(--line); border-radius: 50%; }
.cart-link span { min-width: 1.25rem; height: 1.25rem; padding-inline: .24rem; display: grid; place-items: center; position: absolute; top: -4px; right: -5px; background: var(--gold); color: var(--gold-ink); font-size: .78rem; border-radius: 50%; border: 1px solid var(--bg); }
.account { display: grid; place-items: center; font-size: .94rem; min-height: 42px; text-align: center; border: 1px solid var(--line); border-radius: 999px; padding: .38rem .83rem; font-weight: 700; color: var(--purple-deep); background: #8499de17; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .44em; min-height: 46px; border: 1px solid transparent; border-radius: 999px; color: var(--purple-deep); padding: .58rem 1rem; font-weight: 700; line-height: 1.32; text-align: center; }
.button svg, .pastel svg, .title-icon svg, .offer-icon svg { width: 1.2em; height: 1.2em; flex: none; }
.button:enabled:hover, a.button:hover, .account:hover, .cart-link:hover { filter: brightness(1.13); }
.primary { background: linear-gradient(150deg, #ffe9ac, #f5c674); border-color: #ffdb8a; box-shadow: 0 5px 20px #e1a44c32; color: var(--gold-ink); }
.outline { border-color: var(--line); background: #a6b3f218; }
.plain { background: transparent; }
.small { min-height: 40px; font-size: .91rem; padding-inline: .7rem; }
.wide { width: 100%; }
.eyebrow { display: flex; align-items: center; gap: .38em; font-size: .93rem; color: var(--purple); font-weight: 700; }
.eyebrow span { color: var(--gold); }
.hero { position: relative; isolation: isolate; overflow: hidden; background: #111937; }
.hero-art { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-position: center 52%; }
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, #0c1135e0, #0c113576 34%, transparent 63%), linear-gradient(0deg, var(--bg) 0%, #0e1328b3 9%, transparent 30%);
  pointer-events: none;
}
.hero-inner { min-height: clamp(610px, 83svh, 800px); display: grid; align-content: center; justify-items: start; gap: clamp(1.25rem, 3vw, 2.65rem); padding-block: clamp(3rem, 7vw, 6.5rem) 4.5rem; }
.hero-copy { max-width: min(54%, 510px); }
.hero-copy .eyebrow { color: #e9e3ff; font-weight: 700; }
.hero-copy h1 { margin-block: .8rem 1.05rem; }
.hero-wordmark { width: min(51vw, 525px); height: auto; filter: drop-shadow(0 4px 13px #080b28b3); }
.hero-copy h2 { color: #fcf4eb; font-size: clamp(1.75rem, 3.25vw, 3.1rem); }
.hero-copy > p:not(.eyebrow) { color: #e0e4f8; max-width: 36ch; margin-block: 1rem 1.45rem; }
.hero-actions, .details-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.hero-actions .button { padding-inline: 1.25rem; }
.hero-actions .outline { background: #202854ab; border-color: #d0d9ff65; }
.hero-feature { display: flex; gap: .85rem; align-items: center; min-width: min(100%, 270px); padding: .54rem .9rem .54rem .55rem; border-radius: 16px; border: 1px solid #c2c9ff55; background: linear-gradient(115deg,#222949d9,#242852a8); backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.hero-feature:hover { border-color: var(--gold); }
.hero-feature img { border-radius: 9px; width: 81px; height: auto; flex: none; }
.hero-feature-copy { display: grid; line-height: 1.4; }
.hero-feature-copy > span { font-size: .83rem; color: var(--muted); }
.hero-feature-copy > span:last-child { color: var(--gold); margin-top: .2rem; }
.reader-wordmark { width: 132px; height: auto; margin-bottom: .5rem; }
.pastel, .title-icon { display: inline-grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 15px; font-size: 1.23rem; color: #d9ccff; background: #967acf28; }
.honey { color: var(--gold); background: #b878342f; }
.green { color: var(--sage); background: #4e937831; }
.section { padding-block: 2rem 3.15rem; }
.section-head { display: flex; gap: .85rem; justify-content: space-between; align-items: end; margin-bottom: 1.15rem; }
.section-head p { color: var(--muted); margin-top: .3rem; }
.text-link { font-weight: 700; color: var(--purple-deep); text-decoration: underline; text-underline-offset: 4px; }
.book-grid { display: grid; gap: clamp(1rem, 2.8vw, 1.55rem); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.book-card, .panel { border: 1px solid var(--line); border-radius: var(--round); background: var(--paper); box-shadow: var(--shadow); }
.book-card { padding: .8rem; display: flex; flex-direction: column; }
.cover-link { display: block; border-radius: 14px; }
.cover { overflow: hidden; border-radius: 15px; }
.cover > img { display: block; width: 100%; height: auto; }
.book-meta { padding: .82rem .28rem .28rem; display: flex; flex: 1; flex-direction: column; }
.book-meta > p { color: var(--purple); font-size: .9rem; margin-bottom: .28rem; }
.book-meta h3 { margin-bottom: .58rem; }

.book-actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: auto; }
.book-actions > strong, .large-price, .offer-price strong, .total strong { color: var(--gold); }
.offer { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 1.2rem; border-radius: var(--round); padding: 1rem 1.2rem; margin-block: 1.4rem 3rem; border: 1px solid #e9bf7666; background: radial-gradient(ellipse at 18% 5%, #c9853b2e, transparent 60%), #222544; }
.offer h2 { font-size: 1.5rem; margin-bottom: .28rem; }
.offer p:not(.eyebrow) { color: var(--muted); }
.offer-icon { display: grid; place-items: center; position: relative; background: #fcda9627; color: var(--gold); border-radius: 22px; width: 69px; height: 69px; font-size: 1.8rem; }
.offer-icon svg:nth-child(2) { position: absolute; color: var(--gold); background: #4a3b45; border-radius: 50%; top: -2px; right: -5px; width: .85em; height: .85em; }
.offer-price { display: grid; text-align: center; white-space: nowrap; }
.offer-price strong { font-size: 1.35rem; }
.offer-price del { color: var(--muted); font-size: .85rem; }
.page-title { padding-block: 2rem; border-bottom: 1px solid var(--line); background: radial-gradient(ellipse at 14% 5%, #52437b8f, transparent 65%), linear-gradient(115deg, #222b50, #141a36); }
.title-inner { display: flex; gap: 1rem; align-items: center; }
.title-inner > .title-icon { width: 58px; height: 58px; border: 1px solid var(--line); font-size: 1.55rem; background: #30365a; }
.title-inner p { margin-top: .45rem; color: var(--muted); }
.shop-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: 1.25rem; }
.shop-toolbar > span { color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: .45rem; }
.filter { border: 1px solid var(--line); border-radius: 999px; padding: .46rem .82rem; color: var(--muted); background: var(--paper); font-weight: 700; }
.filter[aria-pressed="true"] { background: #7763ae45; border-color: #b5aaf188; color: var(--purple-deep); }
.upcoming h2 { margin-bottom: .9rem; }
.upcoming-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .75rem; }
.upcoming-card { display: flex; gap: .7rem; align-items: center; background: #191f39; border: 1px dashed var(--line); border-radius: 15px; padding: .72rem; }
.upcoming-card p { color: var(--muted); font-size: .88rem; }
.upcoming-card h3 { font-size: 1rem; }
.crumb { color: var(--muted); margin-bottom: .9rem; }
.crumb a { text-decoration: underline; text-underline-offset: 4px; }
.details { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.2fr); gap: clamp(1rem, 4vw, 3rem); align-items: center; padding: clamp(.9rem, 3vw, 2rem); }
.details h1 { margin-block: .5rem .65rem; }
.details-copy > p:not(.eyebrow) { color: var(--muted); max-width: 44ch; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.tags span { background: #a395d426; color: var(--purple-deep); padding: .3rem .58rem; border-radius: 8px; font-size: .89rem; }
.large-price { font-size: 1.95rem; display: block; margin-block: .8rem; }
.preview-block { padding-bottom: 0; }
.preview-card { display: grid; overflow: hidden; grid-template-columns: 1fr 1fr; align-items: center; }
.preview-card img { width: 100%; max-height: 230px; }
.preview-card div { padding: 1.2rem; }
.preview-card p { color: var(--muted); margin-block: .4rem; }
.empty { margin: 0 auto 1rem; text-align: center; padding: clamp(1.7rem, 5vw, 4rem) 1rem; background: var(--paper); border: 1px dashed var(--line); border-radius: var(--round); }
.empty h2, .summary h2 { margin-top: .5rem; }
.empty p, .summary > p:not(.total) { margin-block: .5rem 1rem; color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.cart-panel, .summary { padding: clamp(1rem, 2.7vw, 1.7rem); }
.cart-panel h2, .summary h2 { font-size: 1.45rem; margin-bottom: .85rem; }
.cart-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: .75rem; padding: .65rem 0; border-top: 1px solid var(--line); }
.cart-row img { border-radius: 6px; width: 62px; height: auto; }
.cart-row p { color: var(--muted); font-size: .87rem; }
.remove { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--purple-deep); font-size: 1.4rem; display: grid; align-content: center; }
.total { display: flex; justify-content: space-between; gap: 1rem; padding-block: .8rem; border-top: 1px solid var(--line); font-weight: 700; }
.total strong { font-size: 1.19rem; }
.summary .saving { color: var(--sage) !important; margin-top: 0 !important; font-weight: 700; }
.summary .primary { margin-block: .4rem; }
.reader-wrap { max-width: 1020px; text-align: center; }
.reader-head { display: grid; grid-template-columns: 1fr minmax(0,2.3fr) 1fr; align-items: center; justify-items: center; gap: .5rem; margin-bottom: 1rem; }
.reader-head h1 { font-size: clamp(1.25rem,3vw,2.35rem); }
.reader-head .eyebrow { justify-content: center; margin-bottom: .2rem; }
.reader-head > a { justify-self: start; }
.contents { position: relative; justify-self: end; z-index: 3; text-align: left; }
.contents summary { cursor: pointer; list-style: none; }
.contents summary::-webkit-details-marker { display: none; }
.contents ol { position: absolute; inset: auto 0 auto auto; min-width: min(245px, 80vw); max-height: 60vh; overflow: auto; margin-top: .4rem; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: .55rem .8rem .55rem 2rem; }
.contents li a { display: block; padding: .35rem 0; }
.contents a[aria-current] { color: var(--purple-deep); font-weight: 700; }
.book-stage { perspective: 1350px; touch-action: pan-y; }
.spread { display: grid; grid-template-columns: repeat(2,minmax(0, 1fr)); background: #eaddbe; gap: 1px; border: 1px solid #d9caaa; border-radius: 18px; overflow: hidden; box-shadow: 0 5px 0 #baaa88, 0 9px 0 #e8d5ab, 0 20px 36px #0008; text-align: left; transform-origin: center; min-height: 320px; }
.spread-art { position: relative; }
.spread-art::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg,transparent 94%,#5f472627); }
.spread-art img { width: 100%; height: 100%; min-height: 320px; }
.spread-copy { display: grid; align-content: center; position: relative; color: #33264b; background: radial-gradient(ellipse at 80% 100%, #f7dfd9, transparent 50%), linear-gradient(90deg, #e9dbc1 0, #fff9ea 7%, #fff9ed 100%); padding: clamp(1rem, 4vw, 3.6rem); }
.spread-copy > p:not(.eyebrow) { margin-top: .6rem; font-size: clamp(1.08rem, 2.2vw, 1.38rem); }
.spread-star { color: #9c691b; margin-top: .7rem; width: fit-content; }
.flip-next { animation: turn-next .35s ease-out; }
.flip-prev { animation: turn-prev .35s ease-out; }
@keyframes turn-next { from { transform: rotateY(-13deg) translateX(1%); opacity: .62; } to { transform: none; opacity: 1; } }
@keyframes turn-prev { from { transform: rotateY(13deg) translateX(-1%); opacity: .62; } to { transform: none; opacity: 1; } }
.reader-controls { margin: 1.25rem auto .1rem; display: flex; align-items: center; justify-content: center; gap: clamp(.4rem,2vw,.95rem); }
.page-count { white-space: nowrap; font-weight: 700; color: var(--purple-deep); }
.reader-hint { color: var(--muted); font-size: .9rem; margin: .5rem 0; }

.help { padding: clamp(1rem, 4vw, 2rem); max-width: 760px; }
.help h2 { font-size: 1.35rem; margin-bottom: .35rem; }
.help p { margin-bottom: 1rem; }
.footer { border-top: 1px solid var(--line); background: #10162e; }
.footer-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.footer-inner p { font-size: .9rem; color: var(--muted); }
.toast { pointer-events: none; visibility: hidden; opacity: 0; position: fixed; z-index: 10; bottom: 1rem; left: 50%; transform: translate(-50%, .4rem); width: max-content; max-width: calc(100% - 2rem); text-align: center; padding: .6rem 1rem; border-radius: 12px; background: #373054; color: white; box-shadow: var(--shadow); transition: opacity .18s, transform .18s; }
.toast.shown { visibility: visible; opacity: 1; transform: translate(-50%,0); }
.no-script { padding: 1rem; }
@media (max-width: 800px) {
  .wrap { width: calc(100% - 32px); }
  .book-card { padding: .55rem; }
}
@media (max-width: 650px) {
  .nav { grid-template-columns: minmax(0,1fr) auto; gap: 0 .5rem; padding-top: .45rem; }
  .nav-actions { grid-column: 2; grid-row: 1; gap: .42rem; }
  .nav-links { grid-column: 1 / -1; justify-content: space-around; gap: .5rem; }
  .nav-links a { padding-block: .48rem; font-size: .91rem; }
  .logo img { width: clamp(135px, 44vw, 190px); }
  .footer-logo img { width: 135px; }
  .cart-link, .account { min-height: 36px; }
  .cart-link { width: 36px; height: 36px; }
  .account { font-size: .84rem; white-space: nowrap; }
  .hero-art { height: clamp(270px, 88vw, 440px); object-position: 72% center; }
  .hero::after { background: linear-gradient(0deg, var(--bg) 2%, #101735 42%, #101735 48%, #10173500 80%); }
  .hero-inner { min-height: 0; padding-block: clamp(235px, 68vw, 390px) 1.75rem; gap: 1.35rem; justify-items: center; }
  .hero-copy { max-width: 100%; text-align: center; }
  .hero-copy .eyebrow, .hero-actions { justify-content: center; }
  .hero-copy h1 { margin-block: .5rem .75rem; }
  .hero-wordmark { width: min(96%, 420px); margin-inline: auto; }
  .hero-copy > p:not(.eyebrow) { margin: .6rem auto 1rem; }
  .hero-feature { width: min(100%, 320px); }
  .book-grid, .upcoming-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .offer { grid-template-columns: auto 1fr; gap: .7rem; }
  .offer-price { text-align: left; }
  .offer .button { justify-self: start; }
  .details, .split { grid-template-columns: 1fr; }
  .preview-card img { height: 100%; }
  .reader-head .button { min-height: 36px; padding-inline: .38rem; font-size: .82rem; }
  .reader-head .button svg { display: none; }
  .spread { grid-template-columns: 1fr; gap: 0; }
  .spread-art img { max-height: 265px; min-height: 0; height: auto; aspect-ratio: 1.48; }
  .spread-art::after { background: linear-gradient(180deg,transparent 92%,#5f472620); }
  .spread-copy { background: radial-gradient(ellipse at 92% 100%, #f7dfd9, transparent 55%), #fff9ec; min-height: 175px; }
  .reader-controls .button { font-size: .88rem; padding-inline: .55rem; }
  .section { padding-block: 1.25rem 2.35rem; }
  .footer-inner { justify-content: flex-start; gap: .55rem .8rem; flex-wrap: wrap; padding-block: .7rem; }
  .footer-inner p { order: 2; width: 100%; }
}
@media (max-width: 355px) {
  .wrap { width: calc(100% - 22px); }
  .section-head { align-items: start; flex-direction: column; }
  .hero-actions .button { padding-inline: .75rem; }
  .book-actions > .button { padding-inline: .36rem; }
  .reader-head .eyebrow { font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.activity { margin-top: 1rem; padding: 1rem; text-align: left; }
.activity fieldset { border: 0; margin: 0; padding: 0; }
.activity legend { font-weight: 700; padding: 0; margin-bottom: .55rem; }
.activity label { display: inline-flex; gap: .35rem; align-items: center; padding: .32rem .75rem; margin: 0 .38rem .45rem 0; border: 1px solid var(--line); border-radius: 10px; }
.activity input { accent-color: var(--purple); }
.activity .answer:not(:empty) { margin-top: .5rem; color: var(--purple-deep); font-weight: 700; }

@media (min-width: 651px) and (max-width: 950px) {
  .hero-art { object-position: 63% center; }
  .hero-copy { max-width: 52%; }
}

/* Collection and category listings */
.account[aria-current], .cart-link[aria-current] { border-color: var(--gold); }
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.category-card { display: flex; gap: .8rem; align-items: center; padding: .9rem; border-radius: 16px; }
.category-card:hover { border-color: var(--gold); }
.category-card h3 { font-size: 1.03rem; }
.category-card p, .collection-card-copy > p:not(.eyebrow) { color: var(--muted); }
.category-card p { font-size: .88rem; margin-top: .2rem; }
.home-collections { padding-top: .25rem; }
.collection-stack { display: grid; gap: 1rem; }
.collection-card { display: grid; grid-template-columns: minmax(130px, .6fr) minmax(0, 1.4fr); overflow: hidden; }
.collection-art { display: grid; align-items: center; background: #141a35; }
.collection-art img { width: 100%; height: auto; }
.collection-card-copy { display: grid; justify-items: start; align-content: center; gap: .55rem; padding: clamp(.85rem, 3vw, 2.1rem); }
.collection-card-copy .button { margin-top: .28rem; }
.catalog-filters { margin-bottom: 1.45rem; }
.filter[aria-current] { background: #7763ae45; border-color: var(--gold); color: var(--ink); }
.catalog-filters + .offer { margin-top: 0; margin-bottom: 1.65rem; }
.catalog-group { margin-top: 1.45rem; }
.catalog-grid { margin-bottom: 1.15rem; }
.upcoming-list { margin: .55rem 0 0; padding: 0; list-style: none; }
.upcoming > h3 { color: var(--muted); font-size: .93rem; }
.upcoming-card .pastel { width: 35px; height: 35px; border-radius: 10px; }
.summary > .sales-status { padding: .7rem .8rem; border: 1px solid #ffdb8a59; border-radius: 12px; background: #ffdb8a13; color: var(--ink); }
@media (max-width: 800px) {
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 500px) {
  .collection-card { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: 1fr; }
  .category-card { padding: .68rem .8rem; }
  .category-card .pastel { width: 40px; height: 40px; }
}
