/* The Grimoire: black leather, candle and blood-red rubrics. Shared by the book and its chapters. */
:root {
  --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --black: 'UnifrakturMaguntia', 'Cormorant Garamond', Georgia, serif;
  --hand: 'Marck Script', 'Segoe Script', cursive;
  --void: #090608; --void-2: #160a0d; --ember: rgba(150, 30, 20, .35);
  --leather: #3b1915; --leather-2: #1e0b0a;
  --blood: #8b1424; --blood-hi: #b8243a;
  --gold: #b8935a; --gold-hi: #e3c486; --gold-dim: rgba(184, 147, 90, .35);
  --parch: #eadcbc; --parch-2: #dcc79e; --parch-edge: #b89c6c;
  --ink: #2a1912; --ink-soft: #5b4433; --rubric: #8a1a20;
  --text: #efe4cf; --text-soft: #b8a88d;
  --chrome: rgba(30, 12, 14, .7); --line: rgba(227, 196, 134, .28);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--void); overflow-x: hidden; overflow-x: clip; }
body {
  min-height: 100vh; font-family: var(--serif); color: var(--text); font-variant-numeric: lining-nums;
  background:
    radial-gradient(90% 55% at 50% 108%, var(--ember), transparent 70%),
    radial-gradient(70% 50% at 50% -10%, rgba(80, 20, 40, .35), transparent 70%),
    linear-gradient(180deg, var(--void-2), var(--void) 60%);
  overflow-x: hidden;
}
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
a { color: inherit; }

/* the room: embers rising and a slow sigil behind the book */
.embers { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.sigil { position: fixed; left: 50%; top: 56%; width: min(1100px, 150vmin); aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; z-index: 0; opacity: .13; }
.sigil g.turn { animation: turn 360s linear infinite; }
.sigil g.back { animation: turn 520s linear infinite reverse; }
.sigil circle, .sigil path, .sigil polygon { fill: none; stroke: var(--gold-hi); stroke-width: 1.2; }
.sigil text { fill: var(--gold-hi); stroke: none; font: 30px var(--serif); text-anchor: middle; dominant-baseline: central; }
@keyframes turn { to { transform: rotate(360deg); } }

/* ---------- header ---------- */
.top { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 14px; max-width: 1240px; margin: 0 auto; padding: 16px 24px; }
.brand { color: var(--gold-hi); text-decoration: none; font: 400 1.75rem/1 var(--black); letter-spacing: .01em; text-shadow: 0 0 18px rgba(227, 196, 134, .25); white-space: nowrap; }
.nav { display: flex; gap: 22px; margin-left: auto; margin-right: 8px; }
.nav a { text-decoration: none; color: var(--text-soft); font-size: 1.05rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; }
.nav a:hover, .nav a[aria-current] { color: var(--gold-hi); }
.controls { display: flex; gap: 10px; align-items: center; }
.lang { appearance: none; font: 500 1rem var(--serif); color: var(--text); background: var(--chrome); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.lang option { color: #231C33; }
.acct { display: inline-flex; align-items: center; gap: 6px; font: 600 1rem var(--serif); color: var(--text); background: var(--chrome); border: 1px solid var(--gold); border-radius: 999px; padding: 7px 14px; text-decoration: none; white-space: nowrap; }
.acct svg { width: 18px; height: 18px; }

/* ---------- the title ---------- */
main { position: relative; z-index: 2; max-width: 1240px; margin: 0 auto; padding: 0 20px 70px; }
.hero { text-align: center; margin: 2vh auto 26px; }
.orn { color: var(--blood-hi); letter-spacing: .6em; margin: 0 0 6px; font-size: 1.1rem; }
h1 { margin: 0; font: 400 clamp(3.4rem, 9vw, 6.6rem)/1 var(--black); color: var(--gold-hi);
     text-shadow: 0 0 30px rgba(227, 196, 134, .25), 0 2px 0 rgba(0, 0, 0, .6); }
h1 .h1b { display: block; margin: 12px 0 0; font: italic 500 clamp(1.3rem, 2.6vw, 1.8rem)/1.25 var(--serif); color: var(--text); text-shadow: none; }
.sub { max-width: 44em; margin: 14px auto 0; color: var(--text-soft); font-size: 1.2rem; line-height: 1.5; }

/* ---------- the book: black leather tooled in gold, worn and stained leaves ---------- */
.book {
  --gold-line: #c9a35a;
  position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 34px 36px 40px; margin-top: 30px;
  border-radius: 8px 14px 14px 8px;
  background: radial-gradient(90% 80% at 50% 45%, transparent 55%, rgba(0, 0, 0, .55)), url(/img/book/leather.webp) 0 0 / 640px;
  box-shadow: 0 50px 110px rgba(0, 0, 0, .9), 0 0 0 1px #000, inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 -2px 4px rgba(0, 0, 0, .7);
}
/* gold fillets pressed into the leather */
.book::before { content: ""; position: absolute; inset: 11px 13px; border: 1px solid var(--gold-line); outline: 1px solid rgba(201, 163, 90, .5); outline-offset: -5px; border-radius: 4px 9px 9px 4px; pointer-events: none; opacity: .85; }
.book::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 60px; transform: translateX(-50%); pointer-events: none; z-index: 2;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .65) 50%, transparent); }
.corner { position: absolute; width: 58px; height: 58px; z-index: 3; pointer-events: none; fill: none; stroke: var(--gold-line); stroke-width: 1.6; color: var(--gold-line); opacity: .9; }
.corner.tl { top: 4px; left: 6px; }
.corner.tr { top: 4px; right: 6px; transform: scaleX(-1); }
.corner.bl { bottom: 4px; left: 6px; transform: scaleY(-1); }
.corner.br { bottom: 4px; right: 6px; transform: scale(-1, -1); }
.ribbon { position: absolute; z-index: 3; top: 26px; left: calc(50% + 22px); width: 14px; height: calc(100% + 10px); pointer-events: none;
  background: linear-gradient(90deg, #2a0309, #6a0c18 35%, #8e1a2b 50%, #5e0a16 65%, #22030a);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 14px), 0 100%); filter: drop-shadow(2px 4px 3px rgba(20, 5, 0, .5)); }
.page {
  position: relative; z-index: 1; min-height: 680px; padding: 64px 46px 92px 72px; color: var(--ink);
  background: url(/img/book/page-left.webp) center / 100% 100% no-repeat;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .55));
}
.page.left { box-shadow: inset -50px 0 50px -36px rgba(45, 20, 0, .65); }
.page.right { padding: 64px 72px 92px 46px; background-image: url(/img/book/page-right.webp); box-shadow: inset 50px 0 50px -36px rgba(45, 20, 0, .65); }
/* the rubricated frame, set by the Van de Graaf margins (inner : top : outer : bottom = 2 : 3 : 4 : 6) */
.page::before { content: ""; position: absolute; top: 40px; bottom: 60px; left: 48px; right: 28px; border: 1px solid rgba(138, 26, 32, .5); outline: 1px solid rgba(166, 124, 52, .55); outline-offset: -5px; pointer-events: none; }
.page.right::before { left: 28px; right: 48px; }
.page::after { content: attr(data-folio); position: absolute; bottom: 30px; left: 0; right: 0; text-align: center; font: italic 500 1rem var(--serif); color: rgba(80, 55, 35, .7); letter-spacing: .08em; }
.spine { display: none; }
/* the closed book, and its cover swinging open on the spine */
.cover { display: none; position: absolute; z-index: 8; top: 0; bottom: 0; left: 50%; right: 0; transform-origin: left center; transform-style: preserve-3d; }
.cover-front, .cover-back { position: absolute; inset: 0; border-radius: 0 14px 14px 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: radial-gradient(100% 80% at 50% 45%, transparent 50%, rgba(0, 0, 0, .6)), url(/img/book/leather.webp) 0 0 / 640px;
  box-shadow: inset 8px 0 14px rgba(0, 0, 0, .8), 0 40px 80px rgba(0, 0, 0, .8); }
.cover-back { transform: rotateY(180deg); border-radius: 14px 0 0 14px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, .7)), radial-gradient(60% 50% at 40% 40%, #3a1a10, #160806); box-shadow: inset 0 0 0 18px #1a0d0b, inset 0 0 0 19px rgba(201, 163, 90, .5); }
.cover-front::before { content: ""; position: absolute; top: 0; bottom: 0; left: 26px; right: 26px; border-left: 2px solid #b8934f; border-right: 2px solid #b8934f; opacity: .85; }
.cover-sigil { position: absolute; left: 50%; top: 46%; width: 70%; aspect-ratio: 1; transform: translate(-50%, -50%); fill: none; stroke: #d2ad62; stroke-width: .9; color: #d9b56a; filter: drop-shadow(0 0 1px rgba(255, 220, 150, .5)) drop-shadow(0 1px 1px rgba(0, 0, 0, .9)); }
.cover-title { position: absolute; left: 0; right: 0; bottom: 9%; margin: 0; text-align: center; font: italic 500 1.5rem var(--serif); color: #d2ad62; letter-spacing: .12em; text-shadow: 0 1px 1px #000; }
.book.closed { transform: translateX(-25%); clip-path: inset(-60px -60px -60px 50%); }
.book.closed .cover, .book.opening .cover { display: block; }
.book.opening { transition: transform 2.4s cubic-bezier(.55, .05, .25, 1), clip-path 2.4s cubic-bezier(.55, .05, .25, 1); clip-path: inset(-60px -60px -60px -60px); }
.book.opening .cover { animation: coveropen 2.9s cubic-bezier(.55, .05, .25, 1) forwards; }
@keyframes coveropen { 0% { transform: perspective(2600px) rotateY(0); } 82%, 100% { transform: perspective(2600px) rotateY(-180deg); } }
.book.opening .cover-back { animation: coverfade 2.9s linear forwards; }
@keyframes coverfade { 0%, 82% { opacity: 1; } 100% { opacity: 0; } }
.book.turning .page { animation: turnpage .7s ease; }
@keyframes turnpage { 0% { opacity: .25; transform: translateX(var(--dir, 20px)); } 100% { opacity: 1; transform: none; } }

.date-row { display: flex; align-items: baseline; gap: 12px; margin: 0 0 8px; color: var(--ink-soft); font-size: 1.05rem; }
.date-pick { position: relative; display: inline-block; }
.entry-date { font: 400 1.6rem var(--hand); color: var(--rubric); border-bottom: 1px dashed rgba(138, 26, 32, .4); padding: 0 4px; }
.date-pick { display: inline-flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.date-face { position: relative; display: inline-block; }
.date-face input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.date-face:hover .entry-date, .date-face:focus-within .entry-date { border-bottom-style: solid; border-color: var(--rubric); }
.day-step { font: 400 1.5rem/1 var(--hand); color: var(--rubric); background: none; border: 0; padding: 0 6px; cursor: pointer; opacity: .7; transition: opacity .2s, transform .2s; }
.day-step:hover:not(:disabled) { opacity: 1; transform: scale(1.2); }
.day-step:disabled { opacity: .2; cursor: default; }
.day-today { font: italic .85rem var(--serif, serif); color: var(--ink-soft); background: none; border: 1px solid rgba(138, 26, 32, .35); border-radius: 2px; padding: 1px 8px; margin-left: 6px; cursor: pointer; }
.day-today:hover { color: var(--rubric); border-color: var(--rubric); }
.lines {
  --lh: 2.05rem; display: block; width: 100%; min-height: calc(var(--lh) * 9); margin: 6px 0 16px; padding: 0 2px;
  font: 400 1.5rem/var(--lh) var(--hand); color: var(--ink); border: 0; outline: none; resize: vertical;
  background: transparent repeating-linear-gradient(180deg, transparent 0, transparent calc(var(--lh) - 1px), rgba(90, 60, 40, .22) calc(var(--lh) - 1px), rgba(90, 60, 40, .22) var(--lh));
}
.lines::placeholder { color: rgba(91, 68, 51, .55); }
.lines.read { white-space: pre-wrap; overflow-wrap: anywhere; min-height: calc(var(--lh) * 6); }
.seal-row { display: flex; align-items: center; gap: 16px; }
.seal { position: relative; width: 96px; height: 96px; flex: none; border: 0; padding: 0; background: none; cursor: pointer; transition: transform .25s; filter: drop-shadow(0 6px 6px rgba(60, 10, 15, .55)); }
.seal svg { width: 100%; height: 100%; display: block; overflow: visible; }
.seal .emb { stroke: rgba(35, 2, 8, .6); stroke-width: 2.6; color: rgba(35, 2, 8, .55); filter: drop-shadow(0 1px 0 rgba(255, 160, 170, .35)); }
.seal:hover { transform: rotate(-8deg) scale(1.04); }
.seal:active { transform: scale(.95); }
.seal.pressing { animation: press .6s ease; }
@keyframes press { 30% { transform: scale(.85); } 100% { transform: none; } }
.seal-label { font: 600 1.2rem var(--serif); color: var(--rubric); letter-spacing: .03em; }
.hint { min-height: 1.4em; color: var(--rubric); font-style: italic; margin: 10px 0 0; }

.kept-cards { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.kept-cards img { width: 46px; aspect-ratio: 3 / 5; object-fit: cover; border-radius: 3px; border: 2px solid #FBF5E8; box-shadow: 0 2px 6px rgba(40, 25, 10, .35); }
.kept-cards img.rev { transform: rotate(180deg); }
.stamp { margin: 34px auto 0; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; text-align: center; color: rgba(138, 26, 32, .55); border: 3px double rgba(138, 26, 32, .45); transform: rotate(-12deg); font: 400 1rem/1.2 var(--serif); letter-spacing: .12em; text-transform: uppercase; }
.stamp b { display: block; font: 400 3rem/1 var(--serif); letter-spacing: 0; }
.kept-tools { margin: 18px 0 0; font-size: 1rem; color: var(--ink-soft); }
.linkish { font: inherit; color: var(--ink-soft); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.linkish.danger { color: var(--rubric); }

/* ---------- the answer ---------- */
.answer { font-size: 1.12rem; line-height: 1.5; }
.epigraph { text-align: center; margin-top: 16%; }
.epigraph .big { font: 400 2.3rem/1.2 var(--black); color: var(--rubric); margin: 0 0 14px; }
.epigraph p { font-style: italic; color: var(--ink-soft); max-width: 22em; margin: 0 auto; font-size: 1.2rem; }
.epigraph svg.flower { width: 230px; height: 230px; margin: 34px auto 0; display: block; overflow: visible; }
.flower circle { fill: none; stroke: #9a6a1c; stroke-width: .7; stroke-dasharray: 1; stroke-dashoffset: 1; animation: compass 1.3s cubic-bezier(.45, 0, .2, 1) forwards; animation-delay: calc(var(--i) * .16s + .3s); }
.flower circle:nth-last-child(-n+2) { stroke: #8a1a20; stroke-width: .9; }
@keyframes compass { to { stroke-dashoffset: 0; } }
.epigraph svg text { fill: var(--rubric); stroke: none; font: 13px var(--serif); text-anchor: middle; dominant-baseline: central; }
.sect { margin: 0 0 18px; animation: inkin 1.1s ease both; }
.sect h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; color: var(--rubric); font: 700 .92rem/1.2 var(--serif); letter-spacing: .14em; text-transform: uppercase; }
.sect h3 .num { font: 700 1.05rem var(--serif); letter-spacing: .04em; }
.sect h3::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(138, 26, 32, .45), transparent); }
.sect p { margin: 0 0 6px; }
.sect .big { font-size: 1.32rem; font-weight: 600; margin-bottom: 2px; }
.sect .quote { font-style: italic; color: var(--ink-soft); }
.sect .small { font-size: .95rem; color: var(--ink-soft); }
.sym { display: grid; grid-template-columns: 34px 1fr; gap: 0 8px; margin: 0 0 9px; }
.sym .g { font-size: 1.3rem; text-align: center; line-height: 1.6; filter: grayscale(1) sepia(1) saturate(3) hue-rotate(-28deg) brightness(.62); font-variant-emoji: text; }
.sym b { color: var(--rubric); }
.cardline { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: start; }
.cardline img { width: 76px; border-radius: 4px; border: 2px solid #FBF5E8; box-shadow: 0 4px 12px rgba(40, 25, 10, .4); }
.cardline img.rev { transform: rotate(180deg); }
.omen { font-size: 1.22rem; font-style: italic; }
.first-letter::first-letter { font: 400 3.1em/.8 var(--black); float: left; color: var(--rubric); margin: 6px 8px 0 0; }
@keyframes inkin { from { opacity: 0; filter: blur(5px); transform: translateY(6px); } to { opacity: 1; filter: none; transform: none; } }

/* ---------- turning pages ---------- */
.turn { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 14px; margin: 58px 0 0; }
.turn button { font: 500 1.05rem var(--serif); color: var(--text); background: var(--chrome); border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px; cursor: pointer; }
.turn button:disabled { opacity: .35; cursor: default; }
.count { color: var(--text-soft); min-width: 10em; text-align: center; }
.turn .toc-open { color: var(--gold-hi); border-color: rgba(227, 196, 134, .55); }
/* ---------- the contents: every sealed page, by year and month ---------- */
.toc { border: 0; padding: 0; background: transparent; max-width: min(720px, calc(100vw - 24px)); width: 100%; max-height: calc(100vh - 40px); }
.toc::backdrop { background: rgba(8, 3, 4, .78); backdrop-filter: blur(3px); }
.toc[open] { animation: tocin .35s ease-out; }
@keyframes tocin { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.toc-sheet { position: relative; background: url(/img/book/page-right.webp) center / 100% 100%, var(--paper, #eadcbc); color: var(--ink); padding: 40px 44px 30px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.toc-sheet::before { content: ''; position: absolute; inset: 14px; border: 1px solid rgba(138, 26, 32, .45); outline: 1px solid rgba(184, 147, 90, .5); outline-offset: -5px; pointer-events: none; }
.toc h2 { font: 400 2.3rem/1 var(--black); color: var(--rubric); text-align: center; margin: 0 0 6px; }
.toc-sub { text-align: center; font-style: italic; color: var(--ink-soft); margin: 0 0 16px; }
.toc-x { position: absolute; top: 18px; right: 22px; z-index: 1; font: 400 1.8rem/1 var(--serif); color: var(--rubric); background: none; border: 0; cursor: pointer; }
#toc-q { font: 400 1.05rem var(--serif); color: var(--ink); background: rgba(255, 250, 235, .5); border: 0; border-bottom: 1px solid rgba(138, 26, 32, .4); padding: 8px 10px; margin: 0 0 14px; outline: none; }
#toc-q:focus { border-bottom-color: var(--rubric); background: rgba(255, 250, 235, .8); }
.toc-list { overflow-y: auto; padding-right: 6px; min-height: 80px; }
.toc-month { font: 600 .82rem var(--serif); letter-spacing: .18em; text-transform: uppercase; color: var(--rubric); margin: 18px 0 6px; padding-bottom: 4px; border-bottom: 1px solid rgba(184, 147, 90, .5); }
.toc-month:first-child { margin-top: 0; }
.toc-row { display: grid; grid-template-columns: 2.4em 1.6em 1fr auto; gap: 10px; align-items: baseline; width: 100%; text-align: left; font: 400 1.02rem var(--serif); color: var(--ink); background: none; border: 0; border-bottom: 1px dotted rgba(91, 68, 51, .3); padding: 7px 4px; cursor: pointer; }
.toc-row:hover, .toc-row:focus-visible { background: rgba(138, 26, 32, .07); outline: none; }
.toc-row.cur { background: rgba(184, 147, 90, .18); }
.toc-d { font: 400 1.35rem/1 var(--hand); color: var(--rubric); text-align: right; }
.toc-g { color: var(--gold); text-align: center; }
.toc-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toc-f { font-style: italic; color: var(--ink-soft); font-size: .85rem; }
.toc-none { text-align: center; font-style: italic; color: var(--ink-soft); padding: 20px 0; }
@media (max-width: 600px) { .toc-sheet { padding: 34px 20px 22px; } .toc-row { grid-template-columns: 2em 1.3em 1fr; } .toc-f { display: none; } }

/* ---------- the card for today ---------- */
/* ---------- the altar: four objects of one size, and the reading below ---------- */
.altar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 60px 0 0; align-items: stretch; }
/* a gilded frame: a double gold rule, corner studs, candlelight from below */
.panel { position: relative; padding: 28px 28px 26px; border-radius: 4px; text-align: left;
  background: radial-gradient(120% 90% at 50% 110%, rgba(170, 60, 30, .22), transparent 60%), linear-gradient(170deg, #241014, #120709 70%);
  border: 1px solid rgba(227, 196, 134, .55); box-shadow: inset 0 0 0 5px #160a0c, inset 0 0 0 6px rgba(227, 196, 134, .32), 0 24px 50px rgba(0, 0, 0, .55); }
.panel::before, .panel::after { content: '✦'; position: absolute; color: var(--gold-hi); font-size: .8rem; line-height: 1; text-shadow: 0 0 8px rgba(227, 196, 134, .6); }
.panel::before { top: -7px; left: 50%; transform: translateX(-50%); background: #120709; padding: 0 8px; }
.panel::after { bottom: -7px; left: 50%; transform: translateX(-50%); background: #120709; padding: 0 8px; }
.shrine { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 24px 16px 18px; transition: box-shadow .3s; }
.shrine[hidden] { display: none; }
.shrine.on { box-shadow: inset 0 0 0 5px #160a0c, inset 0 0 0 6px rgba(227, 196, 134, .7), 0 0 30px rgba(227, 196, 134, .18), 0 24px 50px rgba(0, 0, 0, .55); }
.shrine .obj { height: 230px; display: grid; place-items: center; margin-bottom: 10px; }
.altar .dc-card { width: 138px; }
.shrine .dc-title { font-size: 1.22rem; }
.shrine .dc-name { font-size: 1.25rem; margin: 0; min-height: 0; }
.shrine .dc-name:empty { display: none; }
.shrine .dc-mean { font-size: 1.02rem; line-height: 1.4; margin: 0; }
.orb { display: block; width: 150px; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.orb:not(.up) { animation: skyglow 2.8s ease-in-out infinite; }
@keyframes skyglow { 50% { box-shadow: 0 0 26px 6px rgba(200, 60, 40, .45); } }
.orb svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .6)); }
.orb .rim { fill: #F5EEDD; stroke: #FBF5E8; stroke-width: 3; }
.orb .ln { fill: none; stroke: #a4513f; stroke-width: .8; }
.orb text { text-anchor: middle; dominant-baseline: central; font-family: 'Segoe UI Symbol', 'Noto Sans Symbols', 'DejaVu Sans', serif; }
.astrolabe .tk { stroke: #a4513f; stroke-width: .5; }
.astrolabe .dv { stroke: #a4513f; stroke-width: .6; }
.astrolabe .pm { stroke: #6e2418; stroke-width: 1; }
.astrolabe .sg { font-size: 12px; fill: #a4513f; }
.astrolabe .pl { font-size: 10.5px; fill: #6e2418; }
.astrolabe .pl.lum { font-size: 13px; fill: #b8321e; }
.astrolabe .star { fill: #c9a24a; }
.astrolabe .spin { transform-origin: 0 0; animation: skyspin 240s linear infinite; }
.astrolabe.up .spin { animation: none; }
@keyframes skyspin { to { transform: rotate(-360deg); } }
.seal9 .dg { font: 600 15px var(--serif); fill: #a4513f; }
.seal9 .enn { fill: none; stroke: #b8321e; stroke-width: 1.1; stroke-linejoin: round; opacity: .8; }
.seal9 .core { fill: #7a1a1f; stroke: #e3c486; stroke-width: 1.5; }
.seal9 .qm { font: 600 30px var(--serif); fill: #e3c486; }
.seal9 .big { font: 600 38px var(--serif); fill: #f5e6c4; }
.seal9.up svg { animation: sealturn .9s ease both; }
@keyframes sealturn { from { transform: rotate(-120deg) scale(.9); } }
.nightorb .sky { fill: #1b1638; }
.nightorb .st { fill: #f5e6c4; }
.nightorb .cres { fill: #f3e2b4; filter: drop-shadow(0 0 6px rgba(243, 226, 180, .7)); }
.nightorb .halo { fill: rgba(243, 226, 180, .14); stroke: rgba(243, 226, 180, .55); }
.nightorb .gl { font-size: 46px; fill: #f3e2b4; }
.nightorb.up svg { animation: sealturn .9s ease both; }
.altar-read { margin: 18px 0 0; padding: 26px 30px; }
.altar-read[hidden] { display: none; }
.altar-read.ink { animation: skyin .7s ease both; }
@keyframes skyin { from { opacity: 0; transform: translateY(8px); } }
.altar-read .dc-title { font-size: 1.5rem; margin-bottom: 10px; }
.altar-read p { margin: 0 0 9px; font-size: 1.1rem; line-height: 1.55; color: var(--text-soft); max-width: 62em; }
.altar-read p.lead { color: var(--text); font-size: 1.18rem; }
.altar-read p.q { font-style: italic; color: var(--gold-hi); }
.altar-read .ar-h { margin: 14px 0 4px; font: 600 .82rem var(--serif); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-hi); }
.altar-read .hint { font-style: italic; }
.altar-read .ar-links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 8px 0 0; }
.sky-more { display: inline-block; margin-top: 6px; color: var(--gold-hi); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--gold-dim); }
.sky-more:hover { border-color: var(--gold-hi); }
.sky-more[hidden] { display: none; }
.dc-card { flex: none; width: 112px; aspect-ratio: 3 / 5; border: 0; padding: 0; background: none; cursor: pointer; perspective: 1000px; }
.dc-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 1.1s cubic-bezier(.3,.7,.2,1); }
.dc-card.up .dc-inner { transform: rotateY(180deg); }
.dc-face { position: absolute; inset: 0; border-radius: 6px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 3px solid #FBF5E8; background: #F5EEDD; box-shadow: 0 10px 26px rgba(0, 0, 0, .6); }
.dc-back { background: #F5EEDD url(/img/tarot/back.webp) center/cover; }
.dc-card:not(.up) .dc-back { animation: dcglow 2.8s ease-in-out infinite; }
@keyframes dcglow { 50% { box-shadow: 0 10px 26px rgba(0, 0, 0, .6), 0 0 26px 6px rgba(200, 60, 40, .45); } }
.dc-front { transform: rotateY(180deg); }
.dc-front img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dc-card.rev .dc-front img { transform: rotate(180deg); }
.dc-title { margin: 0; font: 400 1.35rem var(--hand); color: var(--gold-hi); }
.dc-name { margin: 2px 0 4px; font-size: 1.5rem; font-weight: 600; }
.dc-name small { font-weight: 500; font-size: .75em; font-style: italic; color: var(--text-soft); }
.dc-mean { margin: 0 0 10px; font-size: 1.15rem; color: var(--text-soft); max-width: 30em; }

/* ---------- the other chapters ---------- */
.chapters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 56px 0 0; }
.chapter { display: block; padding: 20px 22px; border-radius: 14px; text-decoration: none; color: var(--text); background: linear-gradient(160deg, rgba(60, 22, 24, .55), rgba(20, 8, 10, .75)); border: 1px solid var(--line); transition: transform .25s, border-color .25s; }
.chapter:hover { transform: translateY(-3px); border-color: var(--gold); }
.chapter .glyph { font-size: 1.6rem; color: var(--gold-hi); }
.chapter b { display: block; font-size: 1.35rem; margin: 6px 0 4px; }
.chapter span { color: var(--text-soft); }
.footnote { max-width: 46em; margin: 34px auto 0; text-align: center; color: var(--text-soft); font-size: 1rem; }
.legal { text-align: center; color: var(--text-soft); font-size: .95rem; margin: 16px 0 0; }

@media (max-width: 900px) {
  .nav { display: none; }
  .book { grid-template-columns: 1fr; padding: 22px 16px 26px; margin-top: 44px; } .book::after { display: none; } .ribbon { top: auto; bottom: -24px; left: auto; right: 40px; height: 80px; } .corner { width: 40px; height: 40px; }
  .spine { display: none; }
  .page.left { border-radius: 4px 4px 0 0; box-shadow: inset 0 -26px 34px -24px rgba(55, 25, 5, .6), inset 0 0 18px rgba(80, 40, 10, .3); }
  .page.right { border-radius: 0 0 4px 4px; padding: 30px 22px 46px; box-shadow: inset 0 26px 34px -24px rgba(55, 25, 5, .6), inset 0 0 18px rgba(80, 40, 10, .3); }
  .page, .page.right { min-height: 0; padding: 46px 30px 64px 34px; } .page::before, .page.right::before { top: 24px; bottom: 42px; left: 16px; right: 16px; }
  .epigraph { margin: 18px 0 12px; }
  .chapters { grid-template-columns: 1fr; }
  .altar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .top { padding: 12px 14px; }
  .brand { font-size: 1.4rem; }
  .acct { padding: 9px; } .acct span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .altar { gap: 12px; } .shrine { padding: 18px 8px 14px; } .shrine .obj { height: 175px; } .altar .dc-card { width: 104px; } .orb { width: 118px; } .shrine .dc-title { font-size: 1.05rem; } .shrine .dc-name { font-size: 1.08rem; } .shrine .dc-mean { font-size: .95rem; } .panel { padding: 22px 18px; } .altar-read { padding: 22px 18px; }
  main { padding: 0 10px 60px; }
  .lines { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  .flower circle { stroke-dashoffset: 0; }
  .flower circle, .sigil g.turn, .sigil g.back, .dc-card .dc-back, .orb, .orb svg, .astrolabe .spin, .sect, .book.turning .page, .seal.pressing { animation: none !important; }
  .dc-inner { transition: none; }
}
/* Japanese: the site's fonts have no Japanese glyphs, so the book falls back to the system's Mincho, which keeps the bookish look. */
:root:lang(ja) {
  --serif: 'Cormorant Garamond', 'Hiragino Mincho ProN', 'Yu Mincho', YuMincho, 'Noto Serif JP', 'MS PMincho', serif;
  --black: 'UnifrakturMaguntia', 'Hiragino Mincho ProN', 'Yu Mincho', YuMincho, 'Noto Serif JP', serif;
  --hand: 'Marck Script', 'Hiragino Mincho ProN', 'Yu Mincho', YuMincho, 'Noto Serif JP', serif;
}
:root:lang(ja) body { line-break: strict; word-break: normal; overflow-wrap: anywhere; }
/* Korean: the same fallback, to the system's Myeongjo serif; words are never broken inside. */
:root:lang(ko) {
  --serif: 'Cormorant Garamond', 'Nanum Myeongjo', 'AppleMyungjo', 'Batang', 'Noto Serif KR', serif;
  --black: 'UnifrakturMaguntia', 'Nanum Myeongjo', 'AppleMyungjo', 'Batang', 'Noto Serif KR', serif;
  --hand: 'Marck Script', 'Nanum Myeongjo', 'AppleMyungjo', 'Batang', 'Noto Serif KR', serif;
}
:root:lang(ko) body { word-break: keep-all; overflow-wrap: anywhere; }
