:root { --vellum:#e7c48e; --ink:#402314; --page-border:#906039 }
body { background:radial-gradient(ellipse at 50% 0%, #4d302d,transparent 65%),repeating-linear-gradient(100deg,#1c1314 0 3px,#261a18 4px 7px,#2a1c19 7px 19px); min-height:100vh }
#shell { max-width:1450px; margin:auto }
#shell[data-chapter]:not([data-chapter="home"]) .masthead { display:none }
.masthead {
  min-height:144px; justify-content:center; text-align:center; position:relative; overflow:hidden; isolation:isolate;
  margin:.65rem auto; width:calc(100% - 1.1rem); padding:1.35rem 1.15rem;
  background:radial-gradient(ellipse,#2b1729ee,#0d0913cc),url(art/leather.webp);
  box-shadow:inset 0 0 0 4px #27171b,inset 0 0 0 6px #896033,inset 0 0 34px #0c0709,0 5px 15px #090608;
  border:2px solid #ad783b; border-radius:18px;
}
.masthead::before,.masthead::after {
  content:""; position:absolute; z-index:-1; inset:0 auto 0 0; width:27%;
  background:linear-gradient(90deg,transparent 10%,#1e101b),url(art/botanical-left.webp) left center/cover;
  opacity:.73; mask-image:linear-gradient(90deg,#000 15%,transparent 100%);
}
.masthead::after { inset:0 0 0 auto; transform:scaleX(-1); background-image:linear-gradient(90deg,transparent,#1e101b),url(art/botanical-right.webp) }
.masthead .brand strong,.masthead .brand span { display:block }
.masthead .brand strong { color:#edc582; text-shadow:0 2px 2px #000,0 0 19px #a46736a0; font:clamp(1.75rem,5vw,3.7rem)/1.12 "Berkshire Swash",Georgia,serif }
.masthead .brand span { color:#f2d6a7; margin:.45rem 0 0; font-size:clamp(.9rem,2.6vw,1.22rem) }
.masthead .brand::before { content:"☾  ·  ✧  ·  ☽"; color:#dfb376; letter-spacing:.34em; margin-bottom:.35rem }
.layout { align-items:start }
#nav { background:linear-gradient(90deg,#221024,#472736 50%,#231525),url(art/leather.webp); box-shadow:0 5px 12px #120a0b; border-image:none; border:1px solid #805a35; padding:.55rem .35rem }
#nav button[aria-current="page"] { background:linear-gradient(90deg,#713e60,#4a2739); box-shadow:inset 3px 0 #d8ac69 }
#nav::after { display:none }
#page { min-width:0 }
#page > .frame { color:var(--ink); background:linear-gradient(105deg,#b46e343d,transparent 11%),url(art/paper.webp) center/180px 34px; border:1px solid #9b6843; border-image:none; border-radius:10px 16px 15px 8px; box-shadow:inset 0 0 36px #7944253d,0 4px #947451,0 7px #c4a16a,0 10px #593627,0 13px 16px #1b1111; margin:.28rem .25rem 1.5rem; padding:clamp(.9rem,2vw,1.75rem) }
#page > .frame > h1 { color:#4b271b; text-shadow:none; margin-bottom:.9rem; position:relative; padding-bottom:.7rem; border-bottom:3px double #986633 }
#page > .frame > h1::before,#page > .frame > h1::after { color:#8b5236 }
#page > .frame .frame { background:#f0d2a972; color:var(--ink); border:1px solid #ae7950; border-image:none; box-shadow:none }
#page > .frame .frame > h2 { text-shadow:none; color:#573324 }
#page > .frame .paper { background-color:#f2d2a2 }
.book-spread { display:grid; grid-template-columns:1fr 1fr; position:relative; }
.book-leaf { min-width:0; position:relative; padding:.25rem clamp(.75rem,2.1vw,1.7rem) 1rem }
.book-leaf:first-child { border-right:1px solid #85563778; box-shadow:inset -14px 0 20px -13px #48250f }
.book-leaf:nth-child(2) { box-shadow:inset 14px 0 20px -15px #48250f }
.book-leaf h2 { font-family:"Berkshire Swash",Georgia,serif; border-bottom:1px solid #ad7954; padding:.4rem 0 }
.chapter-link { text-align:left; display:grid; grid-template-columns:2.3rem 1fr; align-items:center; width:100%; min-height:48px; border:0; border-bottom:1px solid #88593875; background:none; color:#452615; border-radius:3px; gap:.35rem }
.chapter-link:hover,.chapter-link:focus-visible { color:#542341; background:#fff0bf70 }
.chapter-link .chapter-seal { width:1.8rem; height:1.8rem; display:grid; place-items:center; border:1px solid #a4774f; border-radius:50%; color:#80502d; background:#f7dca8; font-weight:bold }
.chapter-link strong { font-family:"Berkshire Swash",Georgia,serif; font-size:1.08rem }
.chapter-link small { display:block; color:#63422a }
.bookmark { display:inline-block; width:max-content; background:#5e3049; color:#ffe5ac; padding:.3rem .8rem; border:1px solid #8d6147; border-radius:2px 2px 7px 7px; margin-bottom:.5rem }
.book-insert { margin:.9rem 0 0; padding:.75rem; border:1px solid #ac7646; background:#f3dbaa; box-shadow:2px 4px 5px #59341b32 }
.book-insert p { margin:.3rem 0 }
.closed-book { position:relative; isolation:isolate; transform-origin:15% 50%; perspective:900px }
.closed-book img { max-height:72svh; max-width:min(94vw,650px); }
.cover-light { position:absolute; inset:0; pointer-events:none; background:radial-gradient(ellipse at 57% 93%,#ffb14755,transparent 18%),radial-gradient(ellipse at 58% 70%,#e27bff50,transparent 17%); mix-blend-mode:screen; animation:cauldron-glow 4s ease-in-out infinite alternate }
#cover.opening .closed-book { animation:open-book 450ms ease-in forwards }
@keyframes cauldron-glow { from {opacity:.24} to {opacity:.68} }
@keyframes open-book { to {transform:perspective(900px) rotateY(-65deg) scale(.94); opacity:0} }
@media(max-width:740px) {
  .masthead { min-height:105px; padding:.7rem .45rem; width:calc(100% - .7rem) }
  #page > .frame { margin:.35rem 0 1rem; padding:.75rem }
  .book-leaf { padding:.25rem .34rem .7rem }
  .chapter-link { grid-template-columns:1.55rem 1fr; gap:.2rem; padding:.26rem .12rem }
  .chapter-link .chapter-seal { width:1.35rem; height:1.35rem }
  .chapter-link strong { font-size:.91rem; line-height:1.08 }
  .chapter-link small { font-size:.69rem }
}
@media(max-width:420px) { .book-insert { font-size:.82rem; padding:.4rem } }
@media(prefers-reduced-motion:reduce) { .cover-light,#cover.opening .closed-book { animation:none } }
@media print { #page > .frame { box-shadow:none; border:0; background:#fff; color:#000; margin:0; padding:0 } }
.coven-ledger { margin-top:1rem }
.coven-ledger section,.coven-ledger details { margin:.5rem 0 }
.coven-ledger input[readonly] { width:min(100%, 39rem) }
#shell[data-chapter="public"] .layout { display:block; width:min(960px,100%); margin:auto }
#shell[data-chapter="recipes"] .row { padding:.7rem; background:linear-gradient(115deg,#f9e2b478,#ecd09b8c),url(art/paper.webp); border-color:#a57448; }
#shell[data-chapter="create"] #page > .frame:first-child { padding-bottom:.45rem }
#shell[data-chapter="oracle"] #page > .frame { background-image:radial-gradient(ellipse at 50% 0%,#d5a9c6a6,transparent 10rem),url(art/paper.webp) }
#shell[data-chapter="coven"] #page > .frame { background-image:linear-gradient(105deg,#a86a4d58,transparent 25%),url(art/paper.webp) }
.recipe-bookmarks { padding-top:.45rem }
.recipe-bookmarks button { border-radius:.25rem .25rem .65rem .65rem; box-shadow:0 2px 3px #512e2350 }
.recipe-spread { border:1px solid #ad7954; border-radius:7px; background:#efcea0a0; margin-bottom:.6rem }
.recipe-spread .book-leaf { padding-top:.65rem }
.recipe-left > label { display:flex; align-items:baseline; gap:.4rem; padding:.27rem 0; border-bottom:1px solid #9466424f }
.recipe-right li { padding:.2rem 0 }
@media(max-width:740px) {
  .recipe-spread { grid-template-columns:1fr }
  .recipe-spread[data-tab="ingredients"] .recipe-right,.recipe-spread[data-tab="steps"] .recipe-left { display:none }
  .recipe-spread .book-leaf { border:0; box-shadow:none; padding:.55rem }
}
@media(min-width:741px) {
  .layout { max-width:1190px; display:flex; flex-direction:column; gap:.15rem }
  #page { width:100% }
  #nav { width:100%; display:flex; justify-content:center; gap:.24rem; padding:.05rem .4rem; border:0; border-radius:0; box-shadow:none; background:none }
  #nav button:not([data-mobile]):not([aria-current="page"]) { display:none }
  #nav button { width:auto; min-height:38px; border:1px solid #916642; border-bottom-color:#422919; border-radius:.35rem .35rem .65rem .65rem; background:#36202c; padding:.31rem .61rem; box-shadow:0 3px 7px #0f0a0a9e }
  #nav button[aria-current="page"] { background:linear-gradient(#6a3d56,#4c293c); box-shadow:inset 0 -2px #c08e57 }
  #nav small { display:none }
  #nav button:hover { background:#643b50 }
}
.masthead::before,.masthead::after { width:23%; background-size:auto 140%,auto 155%; background-repeat:no-repeat; background-position:left center; opacity:.92 }
#page > .frame { background-image:linear-gradient(90deg,#a5643630,transparent 9% 90%,#92532935),linear-gradient(#f0d5a7b8,#e6ba88a0),url(art/paper.webp); background-size:100% 100%,100% 100%,230px 57px }
.book-leaf:first-child { background:linear-gradient(90deg,transparent 93%,#71402519 98%,#60301b26) }
.book-leaf:nth-child(2) { background:linear-gradient(90deg,#5c352924,transparent 8%) }
@media(max-width:740px) {
  .layout { padding-bottom:calc(82px + env(safe-area-inset-bottom)) }
  #nav button { min-height:46px }
}
.cover-light::after { content:""; position:absolute; width:4px; height:4px; top:69%; left:59%; border-radius:50%; background:#fedd9e; box-shadow:-18px 19px #fff0b3,28px -12px #dda8ed,-25px -29px #efc87f; animation:cover-sparks 3.4s ease-out infinite }
@keyframes cover-sparks { 0%,100% { opacity:0; transform:translateY(14px) scale(.45) } 48% { opacity:.72 } 85% {opacity:0;transform:translateY(-24px) scale(1) } }
.cover-preferences { margin:.5rem 0; font-size:.9rem }
.oracle-reading { display:grid; grid-template-columns:minmax(68px,150px) 1fr; align-items:start; gap:.45rem }
.oracle-crystal { width:min(100%,130px); aspect-ratio:1; border-radius:50%; margin:.6rem auto; position:relative; background:radial-gradient(ellipse at 39% 32%,#ffe7ff,#c778d6 15%,#6f3788 40%,#311647 66%,#190f23 75%); box-shadow:0 0 12px #f49dbe,inset 0 0 6px #e9c9f5 }
.oracle-crystal::after { content:""; position:absolute; bottom:-11%; left:15%; width:70%; height:18%; border-radius:40% 40% 20% 20%; border:1px solid #764320; background:linear-gradient(#edbd77,#84512e 48%,#b17944 75%,#56341b); z-index:-1 }
.oracle-candidates { max-height:12rem; overflow:auto; margin:.4rem 0 }
@media(prefers-reduced-motion:reduce) { .cover-light::after { animation:none } }
.recipe-results { display:grid; gap:.7rem; margin-top:.6rem }
.recipe-card { border:1px solid #a87047; padding:.55rem; background:linear-gradient(105deg,#f4d69d,#f8e1b2 70%,#e7ba84); border-radius:6px 8px 8px 4px; box-shadow:2px 3px 5px #68402341 }
.recipe-card-line { display:flex; flex-wrap:wrap; align-items:center; gap:.65rem }
.recipe-card-caption { flex:1; min-width:8rem }
.recipe-card-caption p { margin:.15rem 0 }
.recipe-card .recipe-card-title { display:block; padding:.12rem 0; font:1.22rem "Berkshire Swash",Georgia,serif; border:0; background:none; color:#4d2b1d; text-align:left }
.recipe-card-title:hover,.recipe-card-title:focus-visible { text-decoration:underline }
.recipe-card-thumb { width:clamp(50px,10vw,100px); aspect-ratio:1.35; object-fit:cover; border:1px solid #9a6540; border-radius:50% 45% 47% 44%; }
.recipe-card-seal { display:grid; place-items:center; width:3rem; aspect-ratio:1; background:#c79361; color:#673b27; border:3px double #845030; border-radius:50%; }
.recipe-card .recipe-management { margin:.35rem 0 0; padding:.24rem; border:0 }
.recipe-card .recipe-management .actions { flex-wrap:wrap; }
.recipe-collections { text-align:left; padding:.3rem }
.illustrated-leaf-title { display:flex; align-items:center; gap:.55rem }
.illustrated-leaf-title h2 { flex:1; margin-bottom:0 }
.leaf-illustration { width:clamp(42px,8vw,96px); height:auto; object-fit:contain; filter:drop-shadow(0 2px 2px #63361755) }
.illustrated-contents .book-spread { background:
  radial-gradient(ellipse at 4% 96%,#99582020,transparent 20%),
  radial-gradient(ellipse at 98% 95%,#99582020,transparent 20%); }
.illustrated-contents .book-spread::after { content:""; position:absolute; left:50%; top:-.5px; bottom:0; width:1px; pointer-events:none; box-shadow:0 0 15px 2px #4e2d2245; }
.recipe-card .recipe-card-ornament { object-fit:contain; border:0; border-radius:0; filter:drop-shadow(0 1px 2px #7d543b69) }
#shell[data-chapter="oracle"] .folio-ornament,#shell[data-chapter="coven"] .folio-ornament { float:right; width:clamp(88px,20vw,190px); margin:0 .15rem .45rem .65rem; filter:drop-shadow(0 3px 5px #5b2e3658); }
#shell[data-chapter="oracle"] .folio-ornament ~ .frame,#shell[data-chapter="coven"] .coven-ledger { clear:both }
.oracle-crystal { background:none; box-shadow:none }
.oracle-crystal::after { display:none }
.oracle-illustration { width:100%; height:auto; filter:drop-shadow(0 3px 5px #82328a70) }
@media(max-width:420px) { .illustrated-leaf-title { gap:.17rem } .leaf-illustration { width:32px } .illustrated-leaf-title h2 { font-size:1.05rem } }
.quiet-cover .cover-light { display:none }
