/* ==========================================================================
   Verdant Hollow — dark green, rustic, vintage, whimsical.
   ========================================================================== */
:root {
  --f0: #050d09; --f1: #0a1812; --f2: #0f2219; --f3: #163024; --f4: #1f3d2d;
  --moss: #34533a; --sage: #93aa83; --lichen: #c5cfa3; --fern: #5f8a4f;
  --gold: #c9a45a; --gold2: #ead08c; --gold3: #8a6a2c; --gold-glow: rgba(234, 208, 140, .35);
  --parch: #ecdfbf; --parch2: #dccaa0; --parch3: #c9b381;
  --ink: #2a1f13; --ink2: #5b4531; --ink3: #7d6448;
  --rust: #8f4b2c; --berry: #7b2d3b; --wax: #8e2320; --mist: #a9c3b7; --teal: #7fe0c0;
  --display: 'Uncial Antiqua', 'IM Fell English SC', serif;
  --sc: 'IM Fell English SC', 'Cormorant Garamond', serif;
  --body: 'IM Fell English', 'Cormorant Garamond', Georgia, serif;
  --serif2: 'Cormorant Garamond', Georgia, serif;
  --script: 'Pinyon Script', 'IM Fell English', cursive;
  --ogham: 'Noto Sans Ogham', sans-serif;
  --top: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--f1); color: var(--parch);
  font-family: var(--body); font-size: 18px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--gold2); text-decoration-color: rgba(234, 208, 140, .4); text-underline-offset: 3px; }
a:hover { color: #fff3cf; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold2); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(201, 164, 90, .45); color: #fff; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- the 3D world behind everything */
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; display: block; z-index: 0; touch-action: pan-y; }
#veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 1.1s var(--ease);
  background:
    radial-gradient(120% 90% at 50% 40%, rgba(5, 13, 9, .15), rgba(5, 13, 9, .85) 80%),
    linear-gradient(rgba(10, 24, 18, .45), rgba(10, 24, 18, .7));
}
body.reading #veil { opacity: 1; }
body.no-gl { background: var(--f1) url(../img/leather.jpg) center / 512px; }
body.no-gl #gl { display: none; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 30;
  display: flex; align-items: center; gap: 18px; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: linear-gradient(rgba(5, 13, 9, .92), rgba(5, 13, 9, .55) 70%, transparent);
}
body.reading .topbar { background: linear-gradient(rgba(5, 13, 9, .96), rgba(5, 13, 9, .82)); border-bottom: 1px solid rgba(201, 164, 90, .18); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold2); flex: none; }
.brand-sigil { width: 34px; height: 34px; color: var(--gold); filter: drop-shadow(0 0 6px var(--gold-glow)); transition: transform 1.2s var(--ease); }
.brand:hover .brand-sigil { transform: rotate(180deg); }
.brand-name { font-family: var(--display); font-size: 22px; letter-spacing: .02em; text-shadow: 0 0 18px rgba(234, 208, 140, .3); white-space: nowrap; }
.crumbs { flex: 1; min-width: 0; font-family: var(--sc); font-size: 15px; color: var(--sage); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a { color: var(--sage); text-decoration: none; }
.crumbs a:hover { color: var(--gold2); }
.crumbs .sep { margin: 0 8px; color: var(--gold3); }
.tools { display: flex; gap: 8px; flex: none; }
.tool {
  height: 40px; min-width: 40px; padding: 0 10px; border-radius: 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid rgba(201, 164, 90, .45); color: var(--gold2); background: rgba(10, 24, 18, .55);
  transition: background .25s, border-color .25s, transform .25s;
}
.tool svg { width: 20px; height: 20px; }
.tool:hover { background: rgba(201, 164, 90, .18); border-color: var(--gold2); }
.tool-label { font-family: var(--sc); font-size: 15px; }
#btn-sound[aria-pressed="false"] .wave { opacity: .2; }
@media (max-width: 720px) { .brand-name { font-size: 17px; } .brand-sigil { width: 28px; height: 28px; } .crumbs { display: none; } .tool-label { display: none; } .topbar { gap: 8px; } .tool { height: 36px; min-width: 36px; padding: 0 8px; } .tools { gap: 6px; } }
@media (max-width: 360px) { .brand-name { display: none; } }

/* ---------------------------------------------------------------- hotspot labels over the 3D hollow */
.labels { position: fixed; inset: 0; z-index: 5; pointer-events: none; opacity: 0; transition: opacity .8s; }
.labels.on { opacity: 1; }
.labels.on .hs { pointer-events: auto; }
.hs {
  position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 0 0 18px;
  color: var(--parch); text-align: center; transition: opacity .5s; will-change: transform;
}
.hs-dot { order: 3; width: 9px; height: 9px; border-radius: 50%; background: var(--gold2); box-shadow: 0 0 0 4px rgba(234, 208, 140, .18), 0 0 16px 3px rgba(234, 208, 140, .6); animation: pulse 2.6s ease-in-out infinite; position: absolute; bottom: 0; }
.hs::after { content: ''; position: absolute; bottom: 8px; left: 50%; width: 1px; height: 12px; background: linear-gradient(rgba(234, 208, 140, .7), transparent); }
.hs-name {
  font-family: var(--sc); font-size: 17px; letter-spacing: .04em; color: var(--gold2); white-space: nowrap;
  padding: 3px 12px 1px; border-radius: 3px; background: rgba(6, 16, 11, .72); border: 1px solid rgba(201, 164, 90, .35);
  transition: background .3s, color .3s, transform .3s var(--ease);
}
.hs-sub { font-style: italic; font-size: 14px; color: var(--lichen); white-space: nowrap; opacity: 0; transform: translateY(-4px); transition: opacity .3s, transform .3s; text-shadow: 0 1px 6px #000, 0 0 12px #000; }
.hs.hover .hs-name, .hs:focus-visible .hs-name { background: rgba(201, 164, 90, .92); color: var(--f0); transform: scale(1.06); }
.hs.hover .hs-sub, .hs:focus-visible .hs-sub { opacity: 1; transform: none; }
@media (max-width: 720px) { .hs-sub { display: none; } .hs-name { font-size: 13.5px; padding: 2px 9px 1px; } .hs { padding-bottom: 14px; } .hs::after { height: 8px; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(234, 208, 140, .06), 0 0 22px 6px rgba(234, 208, 140, .75); } }

/* ---------------------------------------------------------------- view container */
.view { position: relative; z-index: 10; min-height: 100vh; padding-top: var(--top); outline: none; }
.view.enter > * { animation: leafIn .7s var(--ease) both; }
@keyframes leafIn { from { opacity: 0; transform: translateY(18px) scale(.985); filter: blur(3px); } }
.page { width: min(1180px, 100% - 32px); margin: 0 auto; padding: 26px 0 110px; }
.page.narrow { width: min(860px, 100% - 32px); }

/* ---------------------------------------------------------------- home overlay (the clearing) */
.home { position: fixed; inset: var(--top) 0 0 0; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; padding: 8px max(20px, 3vw) 22px; }
.home > * { pointer-events: auto; }
.home-title { max-width: 440px; margin-top: 1vh; }
.home-title .kicker { font-family: var(--sc); color: var(--sage); letter-spacing: .12em; font-size: 14px; margin: 0; }
.home-title h1 { font-family: var(--display); font-weight: 400; font-size: clamp(38px, 4.8vw, 66px); line-height: 1; margin: 6px 0 8px; color: var(--gold2); text-shadow: 0 0 30px rgba(234, 208, 140, .35), 0 2px 0 rgba(0, 0, 0, .5); }
.home-title p.line { font-style: italic; font-size: 20px; color: var(--lichen); margin: 0; text-shadow: 0 1px 8px #000; }
.home-title .hint { margin-top: 14px; font-size: 15px; color: var(--mist); opacity: .85; display: flex; gap: 8px; align-items: center; }
.home-bottom { display: flex; gap: 14px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.tonight {
  display: flex; gap: 14px; align-items: center; padding: 10px 16px 10px 10px; border-radius: 60px 14px 14px 60px; max-width: 520px;
  background: rgba(6, 16, 11, .72); border: 1px solid rgba(201, 164, 90, .3); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); text-decoration: none; color: var(--parch);
}
.tonight:hover { border-color: var(--gold2); color: var(--parch); }
.tonight .moon-svg { width: 58px; height: 58px; flex: none; }
.tonight b { font-family: var(--sc); font-weight: 400; color: var(--gold2); font-size: 17px; display: block; }
.tonight span { font-size: 14.5px; color: var(--lichen); display: block; line-height: 1.35; }
.rooms { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 640px; }
.rooms a { font-family: var(--sc); font-size: 14px; padding: 5px 12px; border-radius: 20px; color: var(--lichen); text-decoration: none; background: rgba(6, 16, 11, .6); border: 1px solid rgba(147, 170, 131, .3); }
.rooms a:hover { color: var(--f0); background: var(--gold2); border-color: var(--gold2); }
@media (max-width: 720px) {
  .home-title { margin-top: 0; } .home-title p.line { font-size: 17px; } .home-title .hint { font-size: 13.5px; }
  .rooms { display: none; } .tonight { max-width: none; width: 100%; }
}

/* ---------------------------------------------------------------- binding & folio (leather + parchment) */
.binding {
  position: relative; padding: 14px; border-radius: 12px;
  background: #173024 url(../img/leather.jpg) center / 420px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .6), inset 0 0 40px rgba(0, 0, 0, .55);
}
.binding::before { content: ''; position: absolute; inset: 5px; border: 1.5px solid rgba(201, 164, 90, .55); border-radius: 9px; pointer-events: none; }
.binding::after { content: ''; position: absolute; inset: 9px; border: .75px solid rgba(201, 164, 90, .35); border-radius: 7px; pointer-events: none; }
.folio {
  position: relative; color: var(--ink); border-radius: 4px; padding: clamp(22px, 4vw, 54px);
  background: var(--parch) url(../img/parchment.jpg) center / 700px;
  box-shadow: inset 0 0 70px rgba(110, 72, 26, .42), inset 0 0 8px rgba(80, 50, 20, .35);
}
.folio a { color: var(--berry); text-decoration-color: rgba(123, 45, 59, .35); }
.folio a:hover { color: var(--rust); }
.spread { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.spread > .leaf { padding: clamp(22px, 3.4vw, 50px); position: relative; min-width: 0; }
.spread > .leaf:first-child { box-shadow: inset -34px 0 40px -30px rgba(70, 40, 10, .5); }
.spread > .leaf:last-child { box-shadow: inset 34px 0 40px -30px rgba(70, 40, 10, .5); }
.spread.folio { padding: 0; }
@media (max-width: 900px) { .spread { grid-template-columns: 1fr; } .spread > .leaf:first-child, .spread > .leaf:last-child { box-shadow: none; } .spread > .leaf + .leaf { border-top: 1px dashed rgba(90, 69, 49, .35); } }

/* corner flourishes on folios */
.corner { position: absolute; width: 64px; height: 64px; color: var(--ink3); opacity: .55; pointer-events: none; }
.corner.tl { top: 8px; left: 8px; } .corner.tr { top: 8px; right: 8px; transform: scaleX(-1); }
.corner.bl { bottom: 8px; left: 8px; transform: scaleY(-1); } .corner.br { bottom: 8px; right: 8px; transform: scale(-1, -1); }
@media (max-width: 720px) { .corner { width: 40px; height: 40px; } }

/* ---------------------------------------------------------------- typography inside the book */
.kicker { font-family: var(--sc); letter-spacing: .14em; font-size: 14px; color: var(--ink3); margin: 0 0 4px; }
.dark .kicker, .section-head .kicker { color: var(--sage); }
.title { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 4.6vw, 58px); line-height: 1.02; margin: 0 0 10px; color: var(--ink); }
.title.gold { color: var(--gold2); text-shadow: 0 0 26px rgba(234, 208, 140, .28); }
.subtitle { font-style: italic; font-size: 20px; color: var(--ink2); margin: 0 0 18px; }
.aka { font-style: italic; color: var(--ink3); font-size: 16px; margin: -4px 0 14px; }
h2.h { font-family: var(--sc); font-weight: 400; font-size: 25px; letter-spacing: .03em; margin: 28px 0 8px; color: var(--ink); display: flex; align-items: center; gap: 12px; }
h2.h::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(90, 69, 49, .55), transparent); }
h3.h { font-family: var(--sc); font-weight: 400; font-size: 19px; margin: 18px 0 4px; color: var(--ink2); }
.prose p { margin: 0 0 14px; hyphens: auto; }
.prose p.drop::first-letter {
  float: left; font-family: var(--display); font-size: 4.1em; line-height: .78; padding: 8px 10px 0 2px; margin-top: 2px;
  color: var(--berry); text-shadow: 1px 1px 0 rgba(201, 164, 90, .6);
}
.script { font-family: var(--script); font-size: 1.6em; line-height: 1.2; color: var(--ink2); }
.quote { margin: 22px 0; padding: 4px 0 4px 22px; border-left: 2px solid var(--gold3); font-style: italic; font-size: 19px; color: var(--ink2); }
.quote cite { display: block; font-style: normal; font-family: var(--sc); font-size: 14px; margin-top: 6px; color: var(--ink3); }
.divider { display: block; width: 220px; max-width: 70%; height: 22px; margin: 22px auto; color: var(--ink3); opacity: .65; }
.dark .divider { color: var(--gold); }
ul.bul { list-style: none; padding: 0; margin: 0 0 12px; }
ul.bul li { position: relative; padding-left: 24px; margin: 0 0 6px; }
ul.bul li::before { content: '❧'; position: absolute; left: 0; top: 0; color: var(--fern); font-size: .95em; }
.dark ul.bul li::before { color: var(--gold); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 12px 0 8px; font-size: 16px; }
.facts dt { font-family: var(--sc); color: var(--ink3); }
.facts dd { margin: 0; }
.tale { margin: 22px 0; padding: 20px 22px; border: 1px solid rgba(90, 69, 49, .35); border-radius: 3px; background: rgba(255, 248, 225, .35); position: relative; }
.tale::before { content: 'a tale'; position: absolute; top: -12px; left: 18px; padding: 0 8px; font-family: var(--script); font-size: 22px; color: var(--berry); background: #e7d7b1; border-radius: 4px; line-height: 1.1; }
.tale h3 { font-family: var(--sc); font-weight: 400; margin: 0 0 6px; font-size: 19px; }
.tale p { margin: 0; font-style: italic; }
.src { font-size: 14.5px; color: var(--ink3); }
.src li { margin-bottom: 3px; }

/* the healing / honesty panels */
.twin { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 12px 0; }
@media (max-width: 640px) { .twin { grid-template-columns: 1fr; } }
.panel { padding: 16px 18px; border-radius: 4px; border: 1px solid rgba(90, 69, 49, .28); background: rgba(255, 250, 232, .32); }
.panel h4 { margin: 0 0 6px; font-family: var(--sc); font-weight: 400; font-size: 17px; color: var(--ink2); display: flex; align-items: center; gap: 8px; }
.panel.science { background: rgba(214, 232, 214, .38); border-color: rgba(60, 100, 70, .3); }
.meter { display: flex; gap: 3px; margin: 2px 0 8px; }
.meter i { width: 22px; height: 7px; border-radius: 3px; background: rgba(90, 69, 49, .18); }
.meter i.on { background: var(--fern); }
.meter.toxic i.on { background: var(--wax); }
.warnbox {
  position: relative; margin: 16px 0; padding: 16px 18px 16px 72px; border-radius: 4px;
  background: rgba(142, 35, 32, .09); border: 1px solid rgba(142, 35, 32, .35); color: #4a1612;
}
.warnbox .wax { position: absolute; left: 14px; top: 14px; }
.warnbox h4 { margin: 0 0 4px; font-family: var(--sc); font-weight: 400; font-size: 18px; color: var(--wax); }
.warnbox ul { margin: 0; padding-left: 18px; }
.wax {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #f5d7c8; font-family: var(--display); font-size: 20px;
  background: radial-gradient(circle at 35% 30%, #c2463a, #7e1a16 60%, #5c100d); box-shadow: 0 2px 4px rgba(0, 0, 0, .35), inset 0 -3px 6px rgba(0, 0, 0, .35), inset 0 2px 3px rgba(255, 180, 160, .35);
  clip-path: polygon(50% 0, 61% 6%, 74% 3%, 80% 14%, 93% 18%, 94% 31%, 100% 42%, 95% 55%, 99% 68%, 88% 76%, 85% 90%, 71% 93%, 60% 100%, 48% 95%, 35% 99%, 26% 89%, 12% 86%, 9% 72%, 0 62%, 5% 49%, 1% 35%, 11% 26%, 15% 12%, 29% 9%, 38% 1%);
}
.wax.green { background: radial-gradient(circle at 35% 30%, #5d8a4a, #2e5230 60%, #1c3620); color: #e6f0d0; }
.wax.gold { background: radial-gradient(circle at 35% 30%, #f1d88f, #b88d3e 60%, #7a5a22); color: #3a2a10; }
.wax.sm { width: 30px; height: 30px; font-size: 14px; }

/* ---------------------------------------------------------------- section heads (on dark) */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin: 12px 0 22px; }
.section-head .title { color: var(--gold2); text-shadow: 0 0 24px rgba(234, 208, 140, .25); margin: 0; }
.section-head p.lede { margin: 6px 0 0; max-width: 640px; font-style: italic; color: var(--lichen); font-size: 19px; }
.dark { color: var(--parch); }

/* chips & filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 22px; }
.filters .grp { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filters .lbl { font-family: var(--sc); font-size: 14px; color: var(--sage); margin-right: 2px; }
.chip {
  font-family: var(--sc); font-size: 14.5px; padding: 4px 13px 3px; border-radius: 20px; color: var(--lichen);
  border: 1px solid rgba(147, 170, 131, .35); background: rgba(6, 16, 11, .45); transition: all .2s; white-space: nowrap; text-decoration: none; display: inline-block;
}
.chip:hover { border-color: var(--gold2); color: var(--gold2); }
.chip.on { background: var(--gold2); color: var(--f0); border-color: var(--gold2); }
.folio .chip { color: var(--ink2); border-color: rgba(90, 69, 49, .35); background: rgba(255, 250, 232, .4); }
.folio .chip:hover { color: var(--berry); border-color: var(--berry); }
.filter-search { flex: 1 1 220px; max-width: 320px; margin-left: auto; }
.input {
  width: 100%; font: inherit; font-size: 16px; color: var(--parch); padding: 8px 14px; border-radius: 22px;
  background: rgba(6, 16, 11, .6); border: 1px solid rgba(201, 164, 90, .35);
}
.input::placeholder { color: rgba(197, 207, 163, .55); font-style: italic; }
.input:focus { outline: none; border-color: var(--gold2); box-shadow: 0 0 0 3px rgba(234, 208, 140, .15); }
.count { font-family: var(--sc); color: var(--sage); font-size: 14px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--sc); font-size: 17px; letter-spacing: .04em;
  padding: 9px 20px 7px; border-radius: 30px; border: 1px solid var(--gold); color: var(--gold2); background: rgba(6, 16, 11, .55);
  text-decoration: none; transition: all .25s var(--ease);
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { background: rgba(201, 164, 90, .2); color: #fff3cf; }
.btn-gold { background: linear-gradient(#ecd38f, #c29a4c); color: #2a1d0b; border-color: #f3dfa5; box-shadow: 0 6px 22px rgba(201, 164, 90, .25), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-gold:hover { background: linear-gradient(#f6e2a8, #d4ab5c); color: #1c1306; }
.btn:disabled { opacity: .55; cursor: default; }
.folio .btn { color: var(--ink); border-color: rgba(90, 69, 49, .5); background: rgba(255, 250, 232, .4); }
.folio .btn:hover { background: rgba(123, 45, 59, .08); color: var(--berry); border-color: var(--berry); }
.folio .btn-gold { color: #2a1d0b; background: linear-gradient(#ecd38f, #c29a4c); border-color: #b48a3c; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.gather[aria-pressed="true"] { color: var(--berry); border-color: var(--berry); }

/* ---------------------------------------------------------------- the Library (shelves of volumes) */
.shelves { display: grid; gap: 38px; margin-top: 8px; }
.shelf { position: relative; display: flex; align-items: flex-end; gap: 12px; padding: 0 22px; min-height: 250px; perspective: 1400px; }
.shelf::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -18px; height: 22px; border-radius: 3px;
  background: linear-gradient(#6a4b30, #3d2a1a 60%, #231709); box-shadow: 0 16px 26px rgba(0, 0, 0, .6), inset 0 2px 0 rgba(255, 220, 160, .18);
}
.vol {
  --c: #1f4030; --h: 230px; --w: 64px;
  position: relative; width: var(--w); height: var(--h); flex: none; border-radius: 4px 4px 2px 2px; text-decoration: none; color: var(--gold2);
  background: linear-gradient(90deg, rgba(0, 0, 0, .45), rgba(255, 255, 255, .06) 22%, rgba(0, 0, 0, .1) 55%, rgba(0, 0, 0, .5)), var(--c) url(../img/leather.jpg) center / 300px;
  background-blend-mode: normal, soft-light; box-shadow: 0 10px 18px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(0, 0, 0, .5);
  transform-origin: bottom center; transition: transform .45s var(--ease), box-shadow .45s;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 14px 0;
}
.vol::before, .vol::after { content: ''; position: absolute; left: 6px; right: 6px; height: 3px; border-top: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold); opacity: .8; }
.vol::before { top: 30px; } .vol::after { bottom: 30px; }
.vol .spine-title { writing-mode: vertical-rl; transform: rotate(180deg); font-family: var(--sc); font-size: 18px; letter-spacing: .08em; white-space: nowrap; text-shadow: 0 1px 0 #000; }
.vol .spine-num { font-family: var(--display); font-size: 15px; }
.vol .spine-orn { width: 26px; height: 26px; color: var(--gold); }
.vol:hover, .vol:focus-visible { transform: translateY(-22px) rotateX(4deg); box-shadow: 0 30px 30px rgba(0, 0, 0, .55), 0 0 30px rgba(234, 208, 140, .18); color: #fff3cf; }
.vol.lean { transform: rotate(-7deg); margin-left: 12px; }
.vol.lean:hover { transform: rotate(-7deg) translateY(-18px); }
.shelf-card { flex: 1; min-width: 0; align-self: center; margin-left: 12px; }
.shelf-card .folio { padding: 20px 24px; }
.shelf-card h3 { font-family: var(--sc); font-weight: 400; margin: 0 0 4px; font-size: 22px; }
.shelf-card p { margin: 0; font-size: 16px; }
.shelf-props { display: flex; align-items: flex-end; gap: 10px; margin-left: auto; }
.shelf-props svg { height: 120px; width: auto; }
@media (max-width: 760px) {
  .shelf { flex-wrap: wrap; min-height: 0; padding: 0 8px; gap: 8px; }
  .vol { --h: 180px; --w: 52px; } .vol .spine-title { font-size: 15px; }
  .shelf-card { flex-basis: 100%; margin: 12px 0 0; order: -1; } .shelf-props { display: none; }
}

/* today strip on the library page */
.today { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 0 0 40px; }
.today > * { min-width: 0; }
.tcard { display: block; padding: 16px 16px 14px; border-radius: 8px; text-decoration: none; color: var(--parch); background: rgba(6, 16, 11, .62); border: 1px solid rgba(201, 164, 90, .25); transition: border-color .25s, transform .25s; }
.tcard:hover { border-color: var(--gold2); transform: translateY(-3px); color: var(--parch); }
.tcard .k { font-family: var(--sc); color: var(--sage); font-size: 13.5px; letter-spacing: .08em; }
.tcard .v { font-family: var(--sc); color: var(--gold2); font-size: 21px; line-height: 1.15; margin: 3px 0 4px; }
.tcard .d { font-size: 15px; color: var(--lichen); line-height: 1.4; }
.tcard .art { float: right; width: 58px; height: 58px; margin: -2px -2px 6px 8px; }
@media (max-width: 900px) { .today { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .today { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- bestiary cards */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.fcard {
  position: relative; display: flex; flex-direction: column; text-decoration: none; color: var(--parch); border-radius: 10px; overflow: hidden;
  background: linear-gradient(180deg, rgba(20, 44, 32, .9), rgba(8, 20, 14, .95)); border: 1px solid rgba(201, 164, 90, .3);
  box-shadow: 0 16px 32px rgba(0, 0, 0, .4); transition: transform .45s var(--ease), box-shadow .45s, border-color .3s;
  transform-style: preserve-3d;
}
.fcard::before { content: ''; position: absolute; inset: 6px; border: 1px solid rgba(201, 164, 90, .28); border-radius: 6px; pointer-events: none; z-index: 2; }
.fcard:hover { transform: translateY(-6px) rotateX(3deg); border-color: var(--gold2); box-shadow: 0 26px 44px rgba(0, 0, 0, .55), 0 0 36px rgba(127, 224, 192, .12); color: var(--parch); }
.fcard .art { aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 18px; background: radial-gradient(circle at 50% 45%, rgba(127, 224, 192, .12), transparent 65%); }
.fcard .art svg { width: 100%; height: 100%; transition: transform 1.4s var(--ease); }
.fcard:hover .art svg { transform: rotate(8deg) scale(1.04); }
.fcard .body { padding: 2px 18px 18px; text-align: center; }
.fcard h3 { margin: 0; font-family: var(--sc); font-weight: 400; font-size: 22px; color: var(--gold2); line-height: 1.15; }
.fcard .meta { font-size: 14px; color: var(--sage); font-style: italic; margin-top: 2px; }
.fcard .sum { font-size: 15px; color: var(--lichen); margin: 8px 0 0; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.temper { position: absolute; top: 14px; right: 14px; z-index: 3; }
.temper .wax { width: 30px; height: 30px; font-size: 13px; }
.groupname { grid-column: 1 / -1; font-family: var(--sc); color: var(--sage); font-size: 18px; letter-spacing: .1em; margin: 18px 0 -4px; display: flex; gap: 14px; align-items: center; }
.groupname::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(201, 164, 90, .4), transparent); }

/* ---------------------------------------------------------------- herbarium specimen sheets */
.hgrid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.hcard {
  position: relative; display: block; text-decoration: none; color: var(--ink); padding: 14px 14px 12px; border-radius: 2px;
  background: #e9dcb9 url(../img/parchment.jpg) center / 500px; box-shadow: 0 14px 26px rgba(0, 0, 0, .45), inset 0 0 30px rgba(110, 72, 26, .3);
  transform: rotate(var(--rot, 0deg)); transition: transform .4s var(--ease), box-shadow .4s;
}
.hcard::before, .hcard::after { content: ''; position: absolute; width: 56px; height: 18px; background: rgba(236, 226, 190, .72); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); top: -7px; }
.hcard::before { left: 16px; transform: rotate(-6deg); } .hcard::after { right: 16px; transform: rotate(5deg); }
.hcard:hover { transform: rotate(0) translateY(-6px) scale(1.02); box-shadow: 0 24px 40px rgba(0, 0, 0, .55), inset 0 0 30px rgba(110, 72, 26, .3); color: var(--ink); z-index: 2; }
.hcard .plate { aspect-ratio: 3 / 4; display: grid; place-items: center; }
.hcard .plate svg { width: 100%; height: 100%; }
.hcard .label { border-top: 1px solid rgba(90, 69, 49, .35); padding-top: 6px; margin-top: 6px; }
.hcard h3 { font-family: var(--sc); font-weight: 400; font-size: 20px; margin: 0; line-height: 1.1; }
.hcard .latin { font-style: italic; font-size: 14.5px; color: var(--ink3); }
.hcard .badge { position: absolute; top: 12px; right: 12px; }
.hcard .kw { font-size: 13px; color: var(--ink3); margin-top: 3px; font-family: var(--sc); letter-spacing: .04em; }
.plate-big { background: rgba(255, 250, 232, .35); border: 1px solid rgba(90, 69, 49, .25); padding: 10px; border-radius: 2px; position: relative; }
.plate-big svg { width: 100%; height: auto; }
.plate-tag { position: absolute; right: 12px; bottom: 12px; padding: 8px 14px; background: #f3e9cc; border: 1px solid rgba(90, 69, 49, .45); font-size: 14px; transform: rotate(-2deg); box-shadow: 0 2px 5px rgba(0, 0, 0, .15); max-width: 70%; }
.plate-tag b { font-family: var(--sc); font-weight: 400; display: block; font-size: 16px; }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin: 10px 0; }
.months span { text-align: center; font-family: var(--sc); font-size: 12.5px; padding: 3px 0; border-radius: 3px; color: var(--ink3); background: rgba(90, 69, 49, .08); }
.months span.on { background: var(--fern); color: #f3f0dc; }
.months span.now { outline: 1.5px solid var(--berry); outline-offset: 1px; }

/* link chips with mini art */
.links { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.lchip { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 4px; border-radius: 22px; border: 1px solid rgba(90, 69, 49, .3); background: rgba(255, 250, 232, .45); text-decoration: none; color: var(--ink) !important; font-family: var(--sc); font-size: 15px; transition: all .2s; }
.lchip:hover { border-color: var(--berry); background: rgba(255, 250, 232, .8); }
.lchip svg, .lchip .og { width: 28px; height: 28px; flex: none; }
.lchip .og { font-family: var(--ogham); font-size: 20px; display: grid; place-items: center; color: var(--fern); }

/* ---------------------------------------------------------------- detail nav (prev / next) */
.detail-nav { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0 0; }
.detail-nav a { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--sc); color: var(--lichen); font-size: 16px; max-width: 48%; }
.detail-nav a:hover { color: var(--gold2); }
.detail-nav svg { width: 20px; height: 20px; flex: none; }
.detail-top { display: flex; justify-content: space-between; align-items: center; margin: 0 0 12px; gap: 12px; }
.back { display: inline-flex; align-items: center; gap: 8px; font-family: var(--sc); color: var(--sage); text-decoration: none; }
.back svg { width: 18px; height: 18px; }
.back:hover { color: var(--gold2); }

/* the turning leaf (page flip between entries) */
.book-stage { position: relative; perspective: 2600px; }
.flip-leaf {
  position: absolute; top: 14px; bottom: 14px; width: calc(50% - 14px); z-index: 20; pointer-events: none; transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.45, .05, .3, 1);
}
.flip-leaf.fwd { left: 50%; transform-origin: left center; }
.flip-leaf.back { right: 50%; transform-origin: right center; }
.flip-leaf .face { position: absolute; inset: 0; backface-visibility: hidden; background: var(--parch) url(../img/parchment.jpg) center / 700px; box-shadow: inset 0 0 70px rgba(110, 72, 26, .45); }
.flip-leaf .face.b { transform: rotateY(180deg); }
.flip-leaf .face::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .2), transparent 30%); }
@media (max-width: 900px) { .flip-leaf { width: calc(100% - 28px); left: 14px !important; right: auto !important; transform-origin: left center !important; } }

/* ---------------------------------------------------------------- the grove (3D) overlay */
.grove-ui { position: fixed; inset: var(--top) 0 0 0; pointer-events: none; }
.grove-ui > * { pointer-events: auto; }
.grove-intro { position: absolute; left: max(20px, 3vw); top: 16px; max-width: 440px; }
.grove-intro h1 { font-family: var(--display); font-weight: 400; color: var(--gold2); font-size: clamp(34px, 4vw, 52px); margin: 0; text-shadow: 0 0 22px rgba(234, 208, 140, .3), 0 2px 8px #000; line-height: 1; }
.grove-intro p { color: var(--lichen); font-style: italic; margin: 8px 0 0; text-shadow: 0 1px 8px #000; }
.ogham-strip { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 4px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); overflow-x: auto; background: linear-gradient(transparent, rgba(5, 13, 9, .9)); scrollbar-width: none; justify-content: safe center; }
.ogham-strip::-webkit-scrollbar { display: none; }
.ogham-strip button { flex: none; width: 54px; padding: 6px 0 4px; border-radius: 8px; border: 1px solid rgba(201, 164, 90, .25); background: rgba(6, 16, 11, .7); color: var(--lichen); display: flex; flex-direction: column; align-items: center; gap: 2px; transition: all .2s; }
.ogham-strip button .og { font-family: var(--ogham); font-size: 26px; color: var(--teal); line-height: 1; text-shadow: 0 0 10px rgba(127, 224, 192, .6); }
.ogham-strip button .nm { font-family: var(--sc); font-size: 11.5px; }
.ogham-strip button:hover, .ogham-strip button.on { border-color: var(--gold2); color: var(--gold2); background: rgba(31, 61, 45, .85); }
.tree-panel {
  position: absolute; right: 16px; top: 16px; bottom: 110px; width: min(470px, calc(100% - 32px)); overflow: auto; border-radius: 12px;
  transform: translateX(calc(100% + 30px)); transition: transform .6s var(--ease); overscroll-behavior: contain;
}
.tree-panel.open { transform: none; }
.tree-panel .folio { min-height: 100%; }
.tree-panel .close { position: absolute; top: 20px; right: 20px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--ink2); background: rgba(255, 250, 232, .6); border: 1px solid rgba(90, 69, 49, .3); }
.tree-panel .close svg { width: 18px; height: 18px; }
.og-big { font-family: var(--ogham); font-size: 64px; line-height: 1; color: var(--fern); float: right; margin: 0 0 8px 14px; writing-mode: vertical-rl; transform: rotate(180deg); }
.grove-hint { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); font-style: italic; color: var(--mist); font-size: 15px; text-shadow: 0 1px 8px #000; white-space: nowrap; pointer-events: none; transition: opacity .6s; }
@media (max-width: 720px) { .tree-panel { top: auto; bottom: 96px; height: 62vh; } .grove-intro p { font-size: 15px; } .grove-hint { bottom: 92px; font-size: 13.5px; } }

/* ---------------------------------------------------------------- wheel of the year */
.wheel-wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 34px; align-items: start; }
@media (max-width: 960px) { .wheel-wrap { grid-template-columns: 1fr; } }
.wheel-svg { width: 100%; max-width: 620px; margin: 0 auto; overflow: visible; }
.wheel-svg .sab { cursor: pointer; }
.wheel-svg .sab:hover .sab-gem, .wheel-svg .sab.on .sab-gem { filter: url(#glow); }
.wheel-svg text { font-family: var(--sc); }
.hemi { display: inline-flex; border: 1px solid rgba(201, 164, 90, .4); border-radius: 22px; overflow: hidden; }
.hemi button { padding: 5px 14px; font-family: var(--sc); font-size: 14.5px; color: var(--lichen); }
.hemi button.on { background: var(--gold2); color: var(--f0); }

/* ---------------------------------------------------------------- almanac */
.alm-top { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: center; }
@media (max-width: 760px) { .alm-top { grid-template-columns: 1fr; text-align: center; } }
.big-moon { width: 100%; max-width: 280px; margin: 0 auto; filter: drop-shadow(0 0 40px rgba(200, 235, 220, .25)); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 10px; }
.cal .dow { font-family: var(--sc); font-size: 13px; text-align: center; color: var(--ink3); }
.cal .day { min-height: 70px; padding: 4px; border-radius: 4px; background: rgba(255, 250, 232, .35); border: 1px solid rgba(90, 69, 49, .15); font-size: 13px; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cal .day .n { align-self: flex-start; font-family: var(--sc); color: var(--ink2); }
.cal .day svg { width: 24px; height: 24px; }
.cal .day.today { outline: 2px solid var(--berry); }
.cal .day .ev { font-size: 10.5px; text-align: center; line-height: 1.1; color: var(--berry); font-family: var(--sc); }
.cal .day.blank { background: none; border: 0; }
@media (max-width: 560px) { .cal .day { min-height: 50px; } .cal .day .ev { display: none; } .cal .day svg { width: 18px; height: 18px; } }
.phase-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.phase-list .pi { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 6px; background: rgba(255, 250, 232, .35); }
.phase-list svg { width: 34px; height: 34px; flex: none; }
.phase-list b { font-family: var(--sc); font-weight: 400; display: block; font-size: 15px; }
.phase-list span { font-size: 13.5px; color: var(--ink3); }

/* ---------------------------------------------------------------- remedies: recipe cards */
.rgrid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.rcard {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 22px 22px 18px; text-decoration: none; color: var(--ink); border-radius: 3px;
  background: #efe3c3 url(../img/parchment.jpg) center / 520px; box-shadow: 0 14px 26px rgba(0, 0, 0, .45), inset 0 0 26px rgba(110, 72, 26, .28);
  background-image: repeating-linear-gradient(transparent 0 27px, rgba(80, 110, 140, .16) 27px 28px), url(../img/parchment.jpg);
  transition: transform .35s var(--ease);
}
.rcard::before { content: ''; position: absolute; top: 0; bottom: 0; left: 36px; width: 1px; background: rgba(160, 60, 60, .25); }
.rcard:hover { transform: translateY(-5px) rotate(-.6deg); color: var(--ink); }
.rcard .kind { font-family: var(--sc); font-size: 13px; letter-spacing: .1em; color: var(--berry); padding-left: 24px; }
.rcard h3 { margin: 0; padding-left: 24px; font-family: var(--script); font-weight: 400; font-size: 32px; line-height: 1.05; color: var(--ink); }
.rcard p { margin: 0; padding-left: 24px; font-size: 15.5px; font-style: italic; color: var(--ink2); }
.rcard .meta { padding-left: 24px; font-family: var(--sc); font-size: 13.5px; color: var(--ink3); margin-top: auto; padding-top: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.rcard .pin { position: absolute; top: -8px; left: 50%; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #d9b35e, #7a5a22); box-shadow: 0 3px 5px rgba(0, 0, 0, .45); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 12px 46px; }
.steps li::before { content: counter(s, lower-roman); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-family: var(--sc); font-size: 15px; color: var(--berry); border: 1px solid rgba(123, 45, 59, .45); background: rgba(255, 250, 232, .5); }
.ingredients { list-style: none; padding: 0; margin: 0 0 8px; }
.ingredients li { padding: 3px 0; border-bottom: 1px dotted rgba(90, 69, 49, .3); }
.ingredients label { display: flex; gap: 10px; align-items: baseline; cursor: pointer; }
.ingredients input { accent-color: var(--fern); transform: translateY(2px); }
.ingredients input:checked + span { text-decoration: line-through; color: var(--ink3); }
.charm { text-align: center; font-family: var(--script); font-size: 30px; line-height: 1.25; color: var(--berry); margin: 24px 0 8px; }

/* ---------------------------------------------------------------- oracle */
.oracle-table { display: flex; justify-content: center; gap: clamp(10px, 3vw, 34px); flex-wrap: wrap; margin: 20px 0 10px; perspective: 1600px; min-height: 380px; }
.ocard { width: clamp(150px, 26vw, 240px); aspect-ratio: 5 / 8; position: relative; cursor: pointer; perspective: 1400px; }
.ocard .inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 1.1s cubic-bezier(.3, .8, .25, 1); }
.ocard.flipped .inner { transform: rotateY(180deg); }
.ocard.deal { animation: deal .8s var(--ease) both; }
@keyframes deal { from { transform: translateY(-60px) rotate(-8deg) scale(.9); opacity: 0; } }
.ocard .face { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: 12px; overflow: hidden; box-shadow: 0 22px 40px rgba(0, 0, 0, .55); transform: rotateY(0deg); }
.ocard .face svg { width: 100%; height: 100%; }
.ocard .face.front { transform: rotateY(180deg); }
.ocard .pos { position: absolute; bottom: -30px; left: 0; right: 0; text-align: center; font-family: var(--sc); color: var(--sage); font-size: 15px; }
.ocard:not(.flipped):hover .inner { transform: translateY(-8px) rotateZ(-1deg); }
.reading { margin-top: 48px; }
.reading .rc { display: grid; grid-template-columns: 120px 1fr; gap: 22px; padding: 18px 0; border-bottom: 1px dashed rgba(90, 69, 49, .3); }
.reading .rc svg { width: 120px; border-radius: 8px; box-shadow: 0 8px 16px rgba(0, 0, 0, .3); }
@media (max-width: 560px) { .reading .rc { grid-template-columns: 1fr; } .reading .rc svg { width: 110px; } }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 30px; background: rgba(6, 16, 11, .6); border: 1px solid rgba(201, 164, 90, .3); }
.tabs button, .tabs a { padding: 6px 16px; border-radius: 24px; font-family: var(--sc); font-size: 15.5px; color: var(--lichen); text-decoration: none; }
.tabs .on { background: var(--gold2); color: var(--f0); }
.staves { display: flex; justify-content: center; gap: 20px; margin: 30px 0; min-height: 260px; align-items: flex-end; }
.stave { width: 56px; height: 240px; border-radius: 6px; position: relative; background: linear-gradient(90deg, #6e5234, #a3825a 30%, #8a6a45 60%, #5a4128); box-shadow: 0 16px 24px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(0, 0, 0, .3); display: grid; place-items: center; animation: cast 1s var(--ease) both; }
.stave::before { content: ''; position: absolute; top: 12px; bottom: 12px; left: 50%; width: 2px; background: rgba(40, 25, 10, .6); }
.stave .og { font-family: var(--ogham); font-size: 64px; color: #2c1c0c; writing-mode: vertical-rl; transform: rotate(180deg); text-shadow: 0 1px 0 rgba(255, 230, 190, .3); position: relative; }
.stave .nm { position: absolute; bottom: -28px; left: 50%; transform: translateX(-50%); font-family: var(--sc); color: var(--gold2); white-space: nowrap; font-size: 15px; }
@keyframes cast { from { transform: translateY(-120px) rotate(40deg); opacity: 0; } 60% { transform: translateY(8px) rotate(-4deg); opacity: 1; } }

/* ---------------------------------------------------------------- journal */
.jgrid { display: grid; grid-template-columns: 330px 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .jgrid { grid-template-columns: 1fr; } }
.entry { padding: 16px 0; border-bottom: 1px dashed rgba(90, 69, 49, .35); position: relative; }
.entry .when { font-family: var(--sc); font-size: 14px; color: var(--ink3); display: flex; gap: 8px; align-items: center; }
.entry .when svg { width: 18px; height: 18px; }
.entry h3 { margin: 2px 0 4px; font-family: var(--script); font-weight: 400; font-size: 30px; line-height: 1.1; }
.entry p { margin: 0; white-space: pre-wrap; }
.entry .del { position: absolute; top: 14px; right: 0; font-family: var(--sc); font-size: 13px; color: var(--ink3); opacity: 0; transition: opacity .2s; }
.entry:hover .del, .entry .del:focus { opacity: 1; }
@media (pointer: coarse) { .entry .del { opacity: .8; } }
.form { display: grid; gap: 10px; }
.form label { font-family: var(--sc); font-size: 14.5px; color: var(--ink2); display: grid; gap: 4px; }
.form input, .form textarea, .form select { font-family: var(--body) !important;
  font: inherit; font-size: 17px; color: var(--ink); padding: 8px 12px; border-radius: 3px; border: 1px solid rgba(90, 69, 49, .35);
  background: rgba(255, 252, 240, .55); width: 100%;
}
.form textarea { min-height: 150px; resize: vertical; line-height: 1.5; background-image: repeating-linear-gradient(transparent 0 25px, rgba(90, 69, 49, .15) 25px 26px); background-attachment: local; }
.form input:focus, .form textarea:focus, .form select:focus { outline: none; border-color: var(--fern); box-shadow: 0 0 0 3px rgba(95, 138, 79, .2); }
.seals { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px; }
.seal { text-align: center; font-size: 13px; line-height: 1.2; color: var(--ink2); }
.seal .wax { margin: 0 auto 6px; width: 54px; height: 54px; font-size: 22px; }
.seal.locked { opacity: .38; filter: grayscale(1); }
.satchel { display: flex; flex-wrap: wrap; gap: 8px; }
.stat { display: flex; gap: 18px; flex-wrap: wrap; margin: 8px 0; }
.stat div { font-family: var(--sc); font-size: 14px; color: var(--ink3); }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 28px; color: var(--berry); line-height: 1; }

/* ---------------------------------------------------------------- contents drawer (a parchment scroll) */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(3, 8, 6, .55); opacity: 0; pointer-events: none; transition: opacity .4s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.contents {
  position: fixed; z-index: 41; top: 10px; right: 10px; bottom: 10px; width: min(420px, calc(100% - 20px));
  transform: translateX(110%); transition: transform .6s var(--ease); display: flex; flex-direction: column;
}
.contents.on { transform: none; }
.contents::before, .contents::after {
  content: ''; position: absolute; left: -8px; right: -8px; height: 30px; z-index: 2; border-radius: 15px;
  background: linear-gradient(#8a6a44, #d7bf8e 35%, #f1e2b8 50%, #b8966a 75%, #6d5033); box-shadow: 0 6px 14px rgba(0, 0, 0, .5);
}
.contents::before { top: 0; } .contents::after { bottom: 0; }
.contents-scroll { flex: 1; overflow: auto; margin: 14px 0; padding: 34px 30px 30px; color: var(--ink); background: var(--parch) url(../img/parchment.jpg) center / 600px; box-shadow: inset 0 0 50px rgba(110, 72, 26, .45); overscroll-behavior: contain; }
.contents-kicker { margin: 0; font-family: var(--sc); letter-spacing: .16em; color: var(--ink3); font-size: 14px; text-align: center; }
.contents-title { margin: 2px 0 18px; font-family: var(--display); font-weight: 400; font-size: 36px; text-align: center; color: var(--ink); }
.toc { list-style: none; padding: 0; margin: 0; counter-reset: t; }
.toc li { counter-increment: t; }
.toc a { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; text-decoration: none; color: var(--ink); }
.toc a::before { content: counter(t, upper-roman) '.'; font-family: var(--sc); color: var(--berry); min-width: 38px; }
.toc a .t { font-family: var(--sc); font-size: 19px; }
.toc a .dots { flex: 1; border-bottom: 1.5px dotted rgba(90, 69, 49, .45); transform: translateY(-5px); }
.toc a .p { font-style: italic; color: var(--ink3); font-size: 15px; }
.toc a small { display: block; font-style: italic; color: var(--ink3); font-size: 14px; }
.toc a:hover .t { color: var(--berry); }
.toc a.on .t { color: var(--berry); text-decoration: underline; text-decoration-color: rgba(123, 45, 59, .4); }
.contents-foot { margin-top: 22px; font-size: 14px; color: var(--ink3); font-style: italic; text-align: center; }

/* ---------------------------------------------------------------- search */
.search { position: fixed; inset: 0; z-index: 50; background: rgba(3, 8, 6, .72); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.search[hidden] { display: none; }
.search-box { width: min(680px, 100%); border-radius: 14px; padding: 14px; background: #10261b url(../img/leather.jpg) center / 400px; border: 1px solid rgba(201, 164, 90, .5); box-shadow: 0 40px 80px rgba(0, 0, 0, .6); }
.search-box input { width: 100%; font: inherit; font-size: 22px; padding: 12px 18px; border-radius: 10px; color: var(--parch); background: rgba(5, 13, 9, .7); border: 1px solid rgba(201, 164, 90, .35); }
.search-box input:focus { outline: none; border-color: var(--gold2); }
.search-results { max-height: 58vh; overflow: auto; margin-top: 8px; }
.sr-item { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--parch); }
.sr-item:hover, .sr-item.sel { background: rgba(201, 164, 90, .16); color: var(--parch); }
.sr-item .ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; }
.sr-item .ic svg { width: 36px; height: 36px; }
.sr-item b { font-family: var(--sc); font-weight: 400; color: var(--gold2); font-size: 18px; display: block; }
.sr-item span { font-size: 14px; color: var(--lichen); font-style: italic; }
.sr-item .typ { margin-left: auto; font-family: var(--sc); font-size: 12.5px; color: var(--sage); letter-spacing: .08em; }
.sr-empty { padding: 18px; color: var(--lichen); font-style: italic; text-align: center; }

/* ---------------------------------------------------------------- intro curtain */
.intro { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; text-align: center; padding: 24px; background: radial-gradient(circle at 50% 45%, #10261b, #050d09 70%); transition: opacity 1.4s var(--ease), visibility 1.4s; }
.intro.gone { opacity: 0; visibility: hidden; }
.intro-sigil { width: 84px; height: 84px; margin: 0 auto 10px; color: var(--gold); animation: spin 40s linear infinite; filter: drop-shadow(0 0 14px var(--gold-glow)); }
@keyframes spin { to { transform: rotate(360deg); } }
.intro-kicker { font-family: var(--sc); letter-spacing: .24em; color: var(--sage); margin: 0; font-size: 15px; }
.intro-title { font-family: var(--display); font-weight: 400; font-size: clamp(48px, 10vw, 110px); line-height: 1; margin: 8px 0; color: var(--gold2); text-shadow: 0 0 40px rgba(234, 208, 140, .35); }
.intro-line { font-style: italic; color: var(--lichen); font-size: 21px; margin: 0 0 28px; }
.intro-hint { margin-top: 18px; font-size: 14.5px; color: var(--sage); font-style: italic; }

/* ---------------------------------------------------------------- toast & alert */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 80; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  display: flex; gap: 12px; align-items: center; padding: 10px 18px 10px 12px; border-radius: 6px; max-width: calc(100% - 32px);
  color: var(--ink); background: var(--parch) url(../img/parchment.jpg) center / 500px; box-shadow: 0 18px 40px rgba(0, 0, 0, .55); transition: all .5s var(--ease); font-size: 16px;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast b { font-family: var(--sc); font-weight: 400; display: block; font-size: 17px; color: var(--berry); }
.alert { position: fixed; left: 16px; right: 16px; top: calc(var(--top) + 8px); z-index: 85; max-width: 640px; margin: 0 auto; padding: 14px 18px; border-radius: 8px; background: #3b0f0c; border: 1px solid #b0453a; color: #ffe6de; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); font-size: 16px; }
.alert b { font-family: var(--sc); font-weight: 400; font-size: 18px; }
.alert .row { margin-top: 10px; }
.alert code { display: block; margin-top: 8px; font-size: 12.5px; opacity: .75; word-break: break-all; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: var(--f1); color: var(--parch); z-index: 100; }

/* ---------------------------------------------------------------- misc */
.muted { color: var(--ink3); }
.dark .muted { color: var(--sage); }
.center { text-align: center; }
.mt0 { margin-top: 0; } .mt { margin-top: 22px; } .mb { margin-bottom: 22px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.gloss dt { font-family: var(--sc); font-size: 18px; color: var(--ink); margin-top: 10px; }
.gloss dd { margin: 0 0 4px; }
.biblio li { margin-bottom: 8px; }
.biblio i { color: var(--ink2); }
.empty { text-align: center; padding: 40px 16px; font-style: italic; color: var(--lichen); }
.folio .empty { color: var(--ink3); }
.pill { display: inline-block; font-family: var(--sc); font-size: 13px; padding: 1px 10px; border-radius: 12px; border: 1px solid rgba(90, 69, 49, .35); color: var(--ink2); margin: 0 4px 4px 0; }
.pill.danger { color: var(--wax); border-color: rgba(142, 35, 32, .5); background: rgba(142, 35, 32, .07); }
.pill.care { color: #7a5412; border-color: rgba(160, 110, 30, .5); background: rgba(200, 150, 50, .1); }
.pill.good { color: #2f5a30; border-color: rgba(60, 110, 60, .45); background: rgba(95, 138, 79, .1); }
.footer-note { text-align: center; margin: 44px auto 0; max-width: 640px; font-size: 14px; color: var(--sage); font-style: italic; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* in the 3D modes the page layer lets pointer events fall through to the world */
body[data-mode="hollow"] .view, body[data-mode="grove"] .view { pointer-events: none; min-height: 0; }
body[data-mode="hollow"] .view .home > *, body[data-mode="grove"] .view .grove-ui > * { pointer-events: auto; }
body[data-mode="hollow"], body[data-mode="grove"] { overflow: hidden; }

body[data-mode="hollow"] #gl, body[data-mode="grove"] #gl { touch-action: none; }
body[data-mode="hollow"] #gl:active { cursor: grabbing; }
