/* Paid reading as a gilded book (public/stars-gilded.js). Painted material from /images/book, gold foil as a real texture,
   한글 in 마루부리. The page's other parts already take their colours from the --rv variables, which suit dark paper. */
@font-face { font-family: 'MaruBuri'; src: url('/fonts/MaruBuri-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'MaruBuri'; src: url('/fonts/MaruBuri-SemiBold.woff2') format('woff2'); font-weight: 600 700; font-display: swap; }
.book { --book-serif: 'MaruBuri', 'Noto Serif KR', serif; --ink: #efe6d2; --rv-soft: #bcb19b; --rv-line: rgba(226, 195, 135, .22); --rv-panel: rgba(255, 244, 214, .05); --book-paper: #10172f; }

/* Gold foil: the real texture through the letters. A plain gold stays underneath for a browser without clipped backgrounds. */
.foil { color: #e2c387; }
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .foil { color: transparent; background: url('/images/book/foil.webp') 0 50% / 340px auto; -webkit-background-clip: text; background-clip: text; }
}

/* The stage */
.book-stage { position: relative; height: 380svh; margin: 8px 0 0 calc(50% - 50vw); width: 100vw; }
/* 100vw counts the scroll bar on a desktop window with a fixed one, so the page slid about 8px sideways (2026-11-19).
   Clip sideways only, as the free result does (src/result-scroll.css): sticky still works. Toss keeps its reviewed screens. */
html:not([data-host="toss"]):has(.book), html:not([data-host="toss"]) body:has(.book) { overflow-x: clip; }
.book-pin { position: sticky; top: 0; height: 100svh; overflow: hidden; background: #07090f; }
.book-scene { position: absolute; top: 0; bottom: 0; left: 50%; width: min(100vw, 56.25svh); transform: translateX(-50%); }
.book-scene img, .book-scene video, .book-scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.book-scene canvas { visibility: hidden; }
.book-hello { position: absolute; inset: auto 0 0; display: grid; justify-items: center; gap: 4px; padding: 110px 20px 124px; text-align: center; color: #f5edda; background: linear-gradient(transparent, rgba(7, 9, 15, .86) 44%, #07090f); }
.book-hello p { margin: 0; }
.book-hello-say { font-family: var(--book-serif); font-size: 25px; font-weight: 600; line-height: 1.4; }
.book-hello-sub { font-family: var(--book-serif); font-size: 15px; line-height: 1.6; color: #d9cfba; }
/* A hair of gold that falls, in place of an arrow. */
.book-cue { width: 1px; height: 34px; margin-top: 10px; background: linear-gradient(transparent, #e2c387); }
@media (prefers-reduced-motion: no-preference) { .book-cue { transform-origin: top; animation: book-cue 1.9s cubic-bezier(.65, 0, .35, 1) infinite; } }
@keyframes book-cue { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
/* Sits in the empty leather under the crescent, between the corner ornaments; scene width, so it fits the book on a wide screen too. */
.book-title { position: absolute; top: 52%; left: 50%; display: grid; justify-items: center; gap: 8px; width: min(76vw, 42svh); transform: translateX(-50%); opacity: 0; pointer-events: none; text-align: center; font-family: var(--book-serif); }
.book-title p { margin: 0; text-wrap: balance; }
.book-title-name { font-size: clamp(52px, 7svh, 64px); font-weight: 600; line-height: 1.2; }
.book-title-name.is-long { font-size: clamp(38px, 5svh, 46px); }
.book-title-name.is-longer { font-size: clamp(26px, 3.6svh, 32px); }
.book-title-rest { font-size: clamp(20px, 2.8svh, 24px); font-weight: 600; line-height: 1.5; }
/* A title with no short name before a comma: one size, between the two. */
.book-title-whole { font-size: clamp(28px, 3.8svh, 34px); font-weight: 600; line-height: 1.4; }
.book-end { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: var(--book-paper) url('/images/book/paper.webp') 0 0 / 520px auto; }
.book-stage.is-still { height: auto; }
.book-stage.is-still .book-pin { position: relative; }
.book-stage.is-still .book-end, .book-stage.is-still .book-title { display: none; }

/* The pages */
.book-paper { position: relative; margin-left: calc(50% - min(50vw, 290px)); width: min(100vw, 580px); padding: 56px 26px 36px; color: var(--ink); font-size: 17px;
  background: var(--book-paper) url('/images/book/paper.webp') 0 0 / 520px auto; box-shadow: inset 18px 0 22px -18px rgba(0, 0, 0, .75), inset -10px 0 16px -12px rgba(0, 0, 0, .5); }
#report.book :is(.book-paper,.book-stage,.book-close) :is(p,li,dd,dt),#report.book .book-paper :is(p,li,dd,dt) *,.book-paper :is(h2,h3,h4,summary,a) { font-family: var(--book-serif); }
.book-paper a:not(.qchat-jump) { color: #e2c387; }
.book-paper h2 { margin: 8px 0 14px; font-size: 27px; font-weight: 600; line-height: 1.45; text-align: center; text-wrap: balance; color: var(--ink); }
.book-paper > .muted { text-align: center; font-size: 15px; line-height: 1.8; color: var(--rv-soft); }
.book-paper .rv3-recap { margin-top: 30px; border-color: var(--rv-line); background: transparent; }
.book-paper .rv3-recap h3 { font-weight: 600; }
.book-paper details summary { color: #e2c387; }

/* The band showing where you are */
.book-paper .rv3-head { margin: 26px -26px 0; padding: 8px 26px 0; background: rgba(13, 19, 40, .93); }
.book-paper .rv3-head .q { color: var(--ink); font-weight: 400; }
.book-paper .rv3-totoc { border-color: var(--rv-line); }
.book-paper .rv3-bar { height: 1px; }

/* 차례: thin gold hairlines above and below, like the book's own stamped rules */
.book-paper .rv3-toc { margin: 40px 0; padding: 0; border: 0; border-radius: 0; }
.book-paper .rv3-toc::before, .book-paper .rv3-toc::after, .book-paper .rv3-answer::before, .book-paper .rv3-answer::after { content: ""; display: block; height: 22px; background: url('/images/book/rule.webp') center / 100% auto no-repeat; }
.book-paper .rv3-toc-t { margin: 22px 0 4px; font-size: 22px; font-weight: 600; letter-spacing: 0; text-align: center; }
.book-paper .rv3-toc > .muted { margin-bottom: 14px; text-align: center; color: var(--rv-soft); }
.book-paper .rv3-toc a { color: var(--ink); border-color: var(--rv-line); }
.book-paper .rv3-toc .q { font-size: 17px; font-weight: 600; }
.book-paper .rv3-toc .a { color: var(--rv-soft); }
.book-paper .rv3-toc .told { color: #e2c387; }
.book-paper .rv3-toc li:last-child a { padding-bottom: 22px; }

/* A chapter's stamped opening page */
.book-paper .rv3-ch { position: relative; grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 0 0 20px; scroll-margin-top: 44px; }
.book-paper .rv3-ch + .rv3-ch { margin-top: 44px; }
/* The site's header rule (space-between) would leave the column at the left on anything wider than a phone. */
.book-front { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 4px; margin: 0 -26px; padding: 44px 34px 40px; text-align: center; border-top: 1px solid var(--rv-line); border-bottom: 1px solid var(--rv-line); }
.book-front::before, .book-front::after { content: ""; position: absolute; top: 12px; width: 66px; height: 66px; background: url('/images/book/corner.webp') center / contain no-repeat; opacity: .9; }
.book-front::before { left: 12px; }
.book-front::after { right: 12px; transform: scaleX(-1); }
/* Every picture and its clip share one frame, so the numeral sits at the same height in each chapter. The clip is the
   picture on this paper; its faded edge melts it into the page, since a video with a clear background does not play on every phone. */
.book-art { position: relative; width: min(100%, 290px); aspect-ratio: 5 / 4; }
.book-art :is(img, video) { position: absolute; inset: 0; width: 100%; height: 100%; }
.book-art video { opacity: 0; transition: opacity 600ms ease-out;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent), linear-gradient(to bottom, transparent, #000 6%, #000 94%, transparent); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent), linear-gradient(to bottom, transparent, #000 6%, #000 94%, transparent); mask-composite: intersect; }
.book-art video.is-on { opacity: 1; }
.book-num { margin: 6px 0 2px !important; font-family: 'Noto Serif KR', serif !important; font-size: 68px; font-weight: 700; line-height: 1.05; }
.book-front .nth { font-size: 15px; font-weight: 400; letter-spacing: .26em; color: #e2c387; }
.book-paper .book-front h3 { margin: 6px 0 0; font-size: 26px; font-weight: 600; line-height: 1.45; color: var(--ink); text-wrap: balance; }
.book-paper .rv3-open { width: 100%; padding: 0; border: 0; }
.book-paper .rv3-open .hook { font-size: 16px; line-height: 1.9; color: var(--rv-soft); }

/* The answer between two stamped rules, then the plain page */
.book-paper .rv3-answer { gap: 10px; padding: 0; border: 0; text-align: center; }
.book-paper .rv3-answer .lab { font-size: 14px; font-weight: 400; letter-spacing: .3em; color: #e2c387; }
.book-paper .rv3-answer .say { padding: 0 2px; font-size: 21px; font-weight: 600; line-height: 1.7; color: #fbf4e2; text-wrap: pretty; }
.book-paper .rv3-ch > .say { font-size: 17px; line-height: 2.05; color: var(--ink); word-break: keep-all; }
.book-paper .rv3-ch h4 { margin: 16px 0 -4px; font-size: 20px; font-weight: 600; letter-spacing: 0; color: #e2c387; }
.book-paper .rv3-ch h4.no { color: #e9a58a; }
.book-paper .rv3-acts .num { font-family: 'Noto Serif KR', serif !important; color: #e2c387; }
.book-paper .rv3-acts .do, .book-paper .rv3-donts .rule { font-size: 17px; font-weight: 600; line-height: 1.75; color: var(--ink); }
.book-paper .rv3-acts .why { padding: 2px 0 2px 14px; border-left: 1px solid rgba(226, 195, 135, .45); border-radius: 0; background: transparent; line-height: 1.9; color: var(--rv-soft); }
.book-paper .rv3-acts .ex .note { background: var(--rv-panel); color: var(--ink); line-height: 1.8; }
.book-paper .rv3-end { padding-top: 12px; }
.book-paper .rv3-end .next { border-color: var(--rv-line); color: var(--ink); }

/* Eight moons: this chapter lit in gold, those read in a soft gold, those to come dark. */
.book-moons { display: flex; justify-content: center; gap: 10px; margin-top: 8px; }
.book-moons i { width: 12px; height: 12px; border-radius: 50%; background: rgba(226, 195, 135, .12); box-shadow: inset 0 0 0 1px rgba(226, 195, 135, .3); }
.book-moons i.was { background: rgba(226, 195, 135, .5); }
.book-moons i.now { background: url('/images/book/foil.webp') center / 80px auto; box-shadow: 0 0 12px rgba(236, 200, 120, .7); }
.book-folio { margin: 0 !important; font-size: 14px; color: var(--rv-soft); text-align: center; }

/* Rising once, slowly, as a page does in a well-made film title. Finished state is the resting state. */
.book-rise :is(.book-front, .rv3-answer, .rv3-ch > h4, .rv3-ch > .say, .rv3-acts > li, .rv3-donts > li) { transition: opacity 800ms ease-out, transform 900ms cubic-bezier(.16, 1, .3, 1); }
.book-rise :is(.book-front, .rv3-answer, .rv3-ch > h4, .rv3-ch > .say, .rv3-acts > li, .rv3-donts > li):not(.is-in) { opacity: 0; transform: translateY(16px); }

/* The foil is alive: light crosses the numeral and the cover title, and now and then a corner ornament. */
.book-rise .book-num, .book-rise .book-title .foil { animation: book-foil 7s ease-in-out infinite alternate; }
@keyframes book-foil { from { background-position: 100% 50%; } to { background-position: 0 50%; } }
.book-rise .book-front::before, .book-rise .book-front::after {
  background: linear-gradient(115deg, transparent 42%, rgba(255, 244, 214, .95) 50%, transparent 58%) 220% 0 / 300% 100% no-repeat, url('/images/book/corner.webp') center / contain no-repeat;
  -webkit-mask: url('/images/book/corner.webp') center / contain no-repeat; mask: url('/images/book/corner.webp') center / contain no-repeat;
  animation: book-glint 8s ease-in-out infinite; }
.book-rise .book-front::after { animation-delay: 1.2s; }
@keyframes book-glint { 0%, 70% { background-position: 220% 0, center; } 100% { background-position: -120% 0, center; } }

/* A stamped rule spreads from its star when it comes into view. */
.book-rise :is(.rv3-answer, .rv3-toc)::before, .book-rise :is(.rv3-answer, .rv3-toc)::after { transition: transform 1100ms cubic-bezier(.16, 1, .3, 1) 150ms, opacity 500ms ease-out 150ms; }
.book-rise :is(.rv3-answer, .rv3-toc):not(.is-in)::before, .book-rise :is(.rv3-answer, .rv3-toc):not(.is-in)::after { opacity: 0; transform: scaleX(.12); }

/* The eight moons come up one by one, this chapter's last, and it keeps a slow glow. */
.book-rise .book-moons i { transition: opacity 500ms ease-out calc(var(--k) * 80ms), transform 600ms cubic-bezier(.16, 1, .3, 1) calc(var(--k) * 80ms); }
.book-rise .book-moons:not(.is-in) i { opacity: 0; transform: scale(.4); }
.book-rise .book-moons.is-in i.now { animation: book-moon 3.6s ease-in-out infinite alternate; }
@keyframes book-moon { from { filter: brightness(.9); } to { filter: brightness(1.25); } }
/* Only what is near the screen keeps moving (stars-gilded.js sets is-near, 2026-11-18): the foil and the glint repaint on
   every frame, and eight chapters of them at once made a phone stutter while 운보 hands the book over. */
.book-rise .book-front:not(.is-near) .book-num, .book-rise .book-front:not(.is-near)::before, .book-rise .book-front:not(.is-near)::after,
.book-rise .book-title:not(.is-near) .foil, .book-rise .book-moons:not(.is-near) i.now { animation-play-state: paused; }
/* A chapter far from the screen is not laid out until the reader comes near (2026-11-18 owner: the reading opened slowly;
   laying out all eight chapters held the first screen back). The chapter reaches the paper's edges so its stamped page,
   which did so already, is not cut; the size is a guess until the chapter has been seen once. Web only: Toss keeps its own. */
html:not([data-host="toss"]) .book-paper .rv3-ch { margin-left: -26px; margin-right: -26px; padding: 0 26px 20px; content-visibility: auto; contain-intrinsic-size: auto 2200px; }
/* The running head was 93% solid with a blur behind it: the blur showed next to nothing and a phone redid it on every
   scrolled frame. Solid now, so no text shows through it either. Web only: Toss keeps its light head as it was. */
html:not([data-host="toss"]) .book-paper .rv3-head { background: #0d1328; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* A chapter still being written (stars-reading.js streamReading, 2026-11-19): one line in its place, a soft gold dot
   breathing before it. On the plain (tarot) page too, so not under .book-paper. */
.rv3-writing { margin: 18px 0 6px; text-align: center; font-size: 17px; line-height: 1.8; color: #e2c387; word-break: keep-all; text-wrap: balance; }
.rv3-writing::before { content: ""; display: inline-block; width: 8px; height: 8px; margin: 0 10px 2px 0; border-radius: 50%; background: #e2c387; vertical-align: middle; }
@media (prefers-reduced-motion: no-preference) { .rv3-writing::before { animation: rv3-writing 1.6s ease-in-out infinite alternate; } }
@keyframes rv3-writing { from { opacity: .25; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
/* A chapter still to come is a page and a half of paper with its way on hidden: when it is written the chapter after it
   is already below the screen, so nothing the reader sees jumps down. */
.book-paper .rv3-ch:has(> .rv3-writing:not(.rv3-filled)) { min-height: 150svh; align-content: start; }
.book-paper .rv3-ch:has(> .rv3-writing:not(.rv3-filled)) > :is(.rv3-end, .book-moons, .book-folio) { display: none; }
html:not([data-host="toss"]) .book-paper .rv3-ch:has(> .rv3-writing:not(.rv3-filled)) { contain-intrinsic-size: auto 150svh; }

/* She returns once. */
.book-close { position: relative; overflow: hidden; margin: 0 0 0 calc(50% - min(50vw, 290px)); width: min(100vw, 580px); aspect-ratio: 4 / 5; background: #07090f; }
.book-close img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.book-close::before { content: ""; position: absolute; inset: 0 0 auto; z-index: 1; height: 90px; background: linear-gradient(var(--book-paper), transparent); }
.book-close figcaption { position: absolute; inset: auto 0 0; z-index: 1; display: grid; justify-items: center; gap: 6px; padding: 100px 20px 26px; text-align: center; color: #f5edda; background: linear-gradient(transparent, rgba(7, 9, 15, .88) 42%, #07090f); }
.book-close h3 { margin: 0; font-family: var(--book-serif); font-size: 25px; font-weight: 600; line-height: 1.4; color: #f5edda; }
.book-close figcaption p { margin: 0; font-family: var(--book-serif); font-size: 16px; line-height: 1.6; color: #d9cfba; }
