/* Public reader */
:root {
  --gold: #e8c46a;
  --gold-lo: #a87a28;
  --ink: #2f2212;
  --paper: #f6eed8;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 72px; }
body {
  margin: 0; min-height: 100vh; color: #efe6d2;
  font-family: 'EB Garamond', 'Cormorant Garamond', Georgia, serif;
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, .7), transparent 60%),
    radial-gradient(1px 1px at 72% 12%, rgba(255, 255, 255, .6), transparent 60%),
    radial-gradient(1.4px 1.4px at 85% 64%, rgba(255, 240, 210, .7), transparent 60%),
    radial-gradient(1px 1px at 28% 78%, rgba(210, 225, 255, .6), transparent 60%),
    radial-gradient(1px 1px at 52% 42%, rgba(255, 255, 255, .5), transparent 60%),
    radial-gradient(120% 80% at 50% -10%, #241653 0%, #0e0a28 45%, #05040d 100%) fixed;
  background-color: #05040d;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.r-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: linear-gradient(180deg, rgba(8, 6, 22, .94), rgba(8, 6, 22, .82));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(232, 196, 106, .18);
}
.r-home, .r-toc-btn {
  font: 700 12px/1 'Cinzel', Georgia, serif; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold); text-decoration: none; background: none; border: 1px solid rgba(232, 196, 106, .35);
  border-radius: 999px; padding: 9px 14px;
}
.r-home:hover, .r-toc-btn:hover { background: rgba(232, 196, 106, .1); }
.r-title {
  font: 700 clamp(15px, 2.6vw, 20px)/1 'Cinzel', Georgia, serif; letter-spacing: .22em; text-transform: uppercase;
  color: #f3dfa6; text-decoration: none; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.r-toc-btn { display: none; }

.r-wrap { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 32px; max-width: 1180px; margin: 0 auto; padding: 28px 16px 40px; }
.r-toc { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; padding: 4px 4px 4px 0; }
.r-toc-head { margin: 0 0 10px; font: 700 12px 'Cinzel', Georgia, serif; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.r-toc ol { list-style: none; margin: 0; padding: 0; }
.r-toc a {
  display: block; padding: 7px 10px; border-radius: 6px; border-left: 2px solid transparent;
  color: #d9ccb0; text-decoration: none; font-size: 17px; line-height: 1.25;
}
.r-toc .depth-1 a { padding-left: 24px; font-size: 15.5px; font-style: italic; }
.r-toc .depth-2 a, .r-toc .depth-3 a { padding-left: 38px; font-size: 15px; }
.r-toc a:hover { background: rgba(232, 196, 106, .08); color: #fff3d6; }
.r-toc a[aria-current] { border-left-color: var(--gold); background: rgba(232, 196, 106, .12); color: #fff3d6; }
.r-toc .r-edit { display: inline-block; padding: 0; border: 0; margin-top: 18px; font: 700 11px 'Cinzel', Georgia, serif; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); text-decoration: none; opacity: .75; }
.r-toc .r-edit:hover { opacity: 1; background: none; }

.r-article {
  position: relative; color: var(--ink);
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, .5), transparent 70%),
    linear-gradient(180deg, #f8f1dc, #f1e5c6);
  border-radius: 6px;
  padding: clamp(26px, 6vw, 64px) clamp(20px, 7vw, 76px) clamp(30px, 6vw, 56px);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(232, 196, 106, .25), 0 0 80px rgba(150, 110, 255, .12);
  font-size: clamp(18px, 2.2vw, 20.5px); line-height: 1.7;
}
.r-loading, .r-empty { font-style: italic; color: #6f5a3a; margin: 0; }
.r-kicker { margin: 0 0 8px; text-align: center; font: 700 12px 'Cinzel', Georgia, serif; letter-spacing: .3em; text-transform: uppercase; color: var(--gold-lo); }
.r-h { margin: 0; text-align: center; font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: clamp(26px, 4.4vw, 40px); line-height: 1.15; letter-spacing: .04em; color: #3d2a10; text-wrap: balance; }
h2.r-h { font-size: clamp(22px, 3.6vw, 32px); }
.r-orn { text-align: center; color: var(--gold-lo); font-size: 22px; margin: 10px 0 18px; }
.r-body > :first-child { margin-top: 0; }
.r-body p { margin: 0 0 1em; }
.r-body > p:first-of-type { display: flow-root; } /* contain the drop cap */
.r-body > p:first-of-type::first-letter {
  float: left; font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: 3.3em; line-height: .85;
  padding: .06em .08em 0 0; color: #7a4f12;
}
.r-body h1, .r-body h2, .r-body h3, .r-body h4 { font-family: 'Cinzel', Georgia, serif; color: #4a3212; line-height: 1.25; margin: 1.6em 0 .5em; }
.r-body h1 { font-size: 1.6em; } .r-body h2 { font-size: 1.35em; } .r-body h3 { font-size: 1.15em; } .r-body h4 { font-size: 1em; }
.r-body a { color: #8a4f0a; text-decoration-color: rgba(138, 79, 10, .4); text-underline-offset: 3px; }
.r-body blockquote { margin: 1.2em 0; padding: .2em 1.2em; border-left: 3px solid var(--gold); color: #5a4425; font-style: italic; background: rgba(232, 196, 106, .1); }
.r-body blockquote p:last-child { margin-bottom: .4em; }
.r-body img, .r-body video { max-width: 100%; height: auto; border-radius: 4px; display: block; margin: 0 auto; box-shadow: 0 10px 30px -12px rgba(60, 40, 10, .6); }
.r-body audio { width: 100%; }
.r-body figure { margin: 1.6em 0; }
.r-body figcaption { text-align: center; font-size: .85em; font-style: italic; color: #7a6342; margin-top: .5em; }
.r-body code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; background: rgba(120, 90, 40, .12); padding: .1em .35em; border-radius: 3px; }
.r-body pre { overflow: auto; background: #2a2016; color: #f1e5c6; padding: 1em; border-radius: 6px; font-size: .8em; }
.r-body pre code { background: none; padding: 0; }
.r-body hr { border: 0; text-align: center; margin: 2em 0; }
.r-body hr::after { content: '✦ ✦ ✦'; color: var(--gold-lo); letter-spacing: .6em; }
.r-body ul, .r-body ol { padding-left: 1.4em; }
.r-meta { margin: 2em 0 0; text-align: right; font-size: .8em; font-style: italic; color: #8a7350; }

.r-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.r-pager a {
  flex: 1 1 0; max-width: 48%; display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; border-radius: 8px; text-decoration: none;
  border: 1px solid rgba(232, 196, 106, .25); background: rgba(20, 15, 45, .6);
}
.r-pager a:hover { background: rgba(232, 196, 106, .1); }
.r-pager small { font: 700 11px 'Cinzel', Georgia, serif; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.r-pager span { font-size: 18px; color: #efe6d2; }
.r-next { margin-left: auto; text-align: right; }
.r-foot { text-align: center; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); font: 10px 'Cinzel', Georgia, serif; letter-spacing: .3em; text-transform: uppercase; color: rgba(230, 215, 180, .4); }

@media (max-width: 860px) {
  .r-wrap { grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
  .r-toc-btn { display: inline-block; }
  .r-home-label { display: none; }
  .r-toc {
    position: fixed; top: 58px; left: 0; right: 0; z-index: 15; max-height: 70vh;
    padding: 16px; background: rgba(10, 8, 28, .97); border-bottom: 1px solid rgba(232, 196, 106, .25);
    box-shadow: 0 20px 40px rgba(0, 0, 0, .6);
    transform: translateY(-110%); visibility: hidden; transition: transform .3s ease, visibility .3s;
  }
  body.toc-open .r-toc { transform: none; visibility: visible; }
}
