:root {
    --paper: #faf6eb;
    --ink: #202e3c;
    --muted: #575951;
    --ochre: #895b29;
    --rule: #d7c9ad;
    --art-radius: 14px;
    --display: 'Noto Serif Thai', Georgia, serif;
    font: 400 16px/1.7 Kanit, sans-serif;
    color: var(--ink);
    background: var(--paper);
    color-scheme: light;
}
* { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
.page-width { width: min(420px, calc(100% - 40px)); margin-inline: auto; }
.masthead { display: flex; gap: 10px; align-items: center; padding-block: 17px; border-bottom: 1px solid var(--rule); font-weight: 500; }
.masthead img { object-fit: contain; }
.cover { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding-block: 24px 16px; }
.cover-copy { position: relative; isolation: isolate; }
.cover-art, .chapter img { width: 100%; height: auto; mix-blend-mode: multiply; }
.cover h1 { font: 700 clamp(30px, 8vw, 38px)/1.38 var(--display); margin: 10px 0; text-wrap: balance; }
.eyebrow { font: 500 14px/1.65 Kanit, sans-serif; color: var(--ochre); }
.cover-offer { overflow-wrap: anywhere; }
.cover-offer bdi { color: var(--ink); font-weight: 600; }
.lead { color: var(--muted); }
.cta { display: inline-flex; gap: 18px; align-items: center; justify-content: center; min-height: 48px; padding: 11px 20px; margin: 18px 0 6px; background: linear-gradient(120deg, #145242, #287052 60%, #175c46); box-shadow: inset 0 1px 0 #ffffff45, 0 3px 9px #164e3821; color: #fff; border-radius: 8px; font-weight: 500; text-decoration: none; }
.cta:hover { filter: brightness(1.08); }
.cta:active { background: #133523; }
.cta span { font-size: 1.12em; }
.micro { font-size: 13px; color: var(--muted); }
.reading { border-top: 3px double var(--rule); padding-block: 28px 10px; }
h2 { font: 600 clamp(23px, 6vw, 28px)/1.55 var(--display); }
.chapter { display: grid; grid-template-columns: minmax(76px, 27%) minmax(0, 1fr); align-items: center; gap: 16px; padding: 19px 0; }
.chapter + .chapter { border-top: 1px solid var(--rule); }
.chapter img { border-radius: var(--art-radius); }
.chapter h3 { font: 600 clamp(19px, 4.6vw, 21px)/1.48 var(--display); margin: 4px 0; }
.chapter p:not(.eyebrow) { color: var(--muted); max-width: 52ch; }
.cover-scene { overflow: hidden; border-radius: var(--art-radius); }
.cover-art-layer { position: relative; isolation: isolate; }
.cover-art-layer::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 7% 9% at 17% 20%, #fff3c493, transparent),
        radial-gradient(ellipse 11% 8% at 46% 76%, #ffdc9766, transparent);
    mix-blend-mode: screen;
}
.cover-art { display: block; }
.cover-copy .planet-system {
    --orbit-size: clamp(120px, 32vw, 146px);
    --orbit-top: -18px;
    --orbit-end: -6px;
}
@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal:not(.reveal-pending) { transition: opacity .9s ease, transform 1s cubic-bezier(.25, .5, .35, 1); }
    .scroll-reveal.reveal-pending { opacity: 0; transform: translateY(24px); }
    .scroll-reveal:focus-within { opacity: 1; transform: none; }

    /* ponytail: show the complete layout on WebViews without scroll-driven animation. */
    @supports (animation-timeline: view()) {
        .cover-scene { view-timeline: --cover-scene block; }
        .cover-art-layer {
            transform-origin: center 73%;
            animation: cover-parallax linear both;
            animation-timeline: --cover-scene;
        }
        @keyframes cover-parallax {
            from { transform: translateY(-1.1%) scale(1.045); }
            to { transform: translateY(1.1%) scale(1.045); }
        }
    }
}
.sample {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 24px 20px;
    position: relative; isolation: isolate; overflow: clip; border-radius: var(--art-radius);
    color: #fbf5e8; border-top: 3px solid #bfa372;
    background: radial-gradient(ellipse at 85% 55%, #365558, transparent 54%), #1e303d;
}
.sample .planet-system {
    color: #e4c18e;
    opacity: .25;
}
.sample .eyebrow { color: #e4c18e; }
.sample h2 { margin: 9px 0; }
.phone {
    width: min(100%, 300px); margin-inline: auto; padding: 5px; border: 1px solid #efe3c5;
    border-radius: 31px; background: linear-gradient(125deg, #e0cba5, #65716c 19%, #e6e1d0 48%, #6c726e 78%, #bda98a);
    box-shadow: 0 12px 26px #0a15224d;
}
.phone-screen { overflow: hidden; border: 2px solid #253331; border-radius: 26px; background: #fcf9f1; color: var(--ink); }
.phone-status, .phone-brand { display: flex; align-items: center; }
.phone-status { justify-content: space-between; position: relative; padding: 7px 18px 3px; font: 600 10px/1.2 system-ui,sans-serif; }
.phone-camera, .phone-home { display: block; border-radius: 8px; background: #22312c; }
.phone-camera { position: absolute; inset-inline-start: calc(50% - 19px); width: 38px; height: 7px; }
.phone-battery { width: 15px; height: 7px; border: 1px solid #6f7f72; border-radius: 2px; background: linear-gradient(90deg,#4d6957 76%,transparent 76%); }
.phone-brand { gap: 7px; padding: 10px 16px; font-size: 13px; }
.phone-brand img { object-fit: contain; }
.phone-banner { display: flex; align-items: center; gap: 12px; padding: 17px 16px; background: #623849; color: #fff8e8; }
.phone-banner > span { width: 42px; height: 42px; text-align: center; border: 1px solid #bba879; border-radius: 50%; color: #ebd6a7; font: 32px/42px Georgia,serif; }
.phone-banner small, .phone-banner strong { display: block; }
.phone-banner small { color: #eddfc4; font-size: 12px; }
.phone-banner strong { font-weight: 500; }
.phone-reading { padding: 18px; font-size: 15px; line-height: 1.8; }
.phone-period { font-size: 12px; color: var(--ochre); }
.phone-reading h3 { font: 600 21px/1.55 var(--display); margin: 8px 0; }
.phone-home { width: 66px; height: 3px; margin: 7px auto; }
.invitation { text-align: center; padding-block: 38px; }
.invitation h2 { margin: 5px 0; }
.invitation > p:not(.eyebrow) { color: var(--muted); }
.referral { margin-top: 4px; overflow-wrap: anywhere; }
.referral strong { color: var(--ink); user-select: all; }
details { width: fit-content; max-width: 100%; margin: 12px auto 0; }
summary { color: var(--muted); padding: 8px 0; cursor: pointer; font-size: 14px; }
.qr { width: min(212px, 100%); padding: 8px; background: white; margin: 4px auto; }
.qr svg { display: block; width: 100%; height: auto; }
footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 0 28px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted); }
footer a { color: inherit; }
:focus-visible { outline: 3px solid #b28138; outline-offset: 3px; }
