/* Bestiary theme. Swap fonts by changing the three --font-* variables (or the data-fonts presets below). */
:root {
  --font-display: "Cinzel", "Trajan Pro", serif;
  --font-body: "EB Garamond", Garamond, Georgia, serif;
  --font-stat: "Cinzel", serif;

  --ink: #2b1d12;
  --ink-soft: #5a4330;
  --accent: #7a1f12;          /* rubric red for headings and rules */
  --rule: #8a6a3f;
  --paper: #efe2c3;
  --paper-deep: #e2cfa3;
  --stat-bg: rgba(122, 31, 18, 0.06);
}

/* Font pairing presets (used by the specimen switcher; pick one and copy its values into :root) */
[data-fonts="handbook"]  { --font-display: "Cinzel", serif; --font-body: "EB Garamond", serif; --font-stat: "Cinzel", serif; }
[data-fonts="fell"]      { --font-display: "IM Fell English SC", serif; --font-body: "IM Fell English", serif; --font-stat: "IM Fell English SC", serif; }
[data-fonts="scholar"]   { --font-display: "Cormorant SC", serif; --font-body: "Crimson Pro", serif; --font-stat: "Cormorant SC", serif; }
[data-fonts="alegreya"]  { --font-display: "Alegreya SC", serif; --font-body: "Alegreya", serif; --font-stat: "Alegreya Sans SC", sans-serif; }
[data-fonts="marcellus"] { --font-display: "Marcellus SC", serif; --font-body: "Libre Baskerville", serif; --font-stat: "Marcellus SC", serif; }
[data-fonts="almendra"]  { --font-display: "Almendra SC", serif; --font-body: "Spectral", serif; --font-stat: "Almendra SC", serif; }

* { box-sizing: border-box; }

html { background: #3b2a1c; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
  /* Parchment: warm base, uneven darkening toward the edges, fine fibre noise. */
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(255, 250, 235, .55), transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(150, 110, 60, .22), transparent 60%),
    radial-gradient(ellipse at center, transparent 55%, rgba(110, 75, 35, .35) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .25  0 0 0 0 .12  0 0 0 .12 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  min-height: 100vh;
}

/* The page: a framed folio with a double rule and corner ornaments. */
.folio {
  position: relative;
  max-width: 1100px;
  margin: 32px auto;
  padding: 56px 64px;
  border: 2px solid var(--rule);
  outline: 1px solid var(--rule);
  outline-offset: -10px;
  box-shadow: inset 0 0 60px rgba(110, 75, 35, .25);
}
.folio::before, .folio::after, .folio > .corner-bl, .folio > .corner-br {
  content: "";
  position: absolute;
  width: 46px; height: 46px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 46'><g fill='none' stroke='%237a1f12' stroke-width='1.6'><path d='M2 44 V14 Q2 2 14 2 H44'/><path d='M8 44 V18 Q8 8 18 8 H44'/><circle cx='15' cy='15' r='4' fill='%237a1f12'/><path d='M15 15 L30 30'/></g></svg>") no-repeat;
}
.folio::before { top: -2px; left: -2px; }
.folio::after { top: -2px; right: -2px; transform: scaleX(-1); }
.folio > .corner-bl { bottom: -2px; left: -2px; transform: scaleY(-1); }
.folio > .corner-br { bottom: -2px; right: -2px; transform: scale(-1, -1); }

h1, h2, h3 { font-family: var(--font-display); color: var(--accent); font-weight: 600; letter-spacing: .03em; margin: 0 0 .3em; }
h1 { font-size: 2.6rem; line-height: 1.1; }
h2 { font-size: 1.35rem; border-bottom: 2px solid var(--accent); padding-bottom: 2px; margin-top: 1.4em; }
.subtitle { font-style: italic; color: var(--ink-soft); margin-bottom: 1.2em; }

/* Ornamental divider */
.divider { height: 14px; margin: 18px 0; background:
  linear-gradient(var(--rule), var(--rule)) center / 100% 1px no-repeat,
  url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 14'><path d='M30 1 L37 7 L30 13 L23 7 Z' fill='%237a1f12'/><circle cx='12' cy='7' r='2' fill='%238a6a3f'/><circle cx='48' cy='7' r='2' fill='%238a6a3f'/></svg>") center / 60px 14px no-repeat; }

/* Drop cap on the first paragraph of lore */
.lore > p:first-of-type::first-letter {
  font-family: var(--font-display);
  float: left; font-size: 3.4em; line-height: .85; padding: 4px 8px 0 0; color: var(--accent);
}

/* System selector */
.systems { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 16px; }
.systems button {
  font-family: var(--font-stat); font-size: .85rem; letter-spacing: .06em;
  background: transparent; color: var(--ink); border: 1px solid var(--rule);
  padding: 6px 12px; cursor: pointer; border-radius: 2px;
}
.systems button[aria-pressed="true"] { background: var(--accent); color: var(--paper); border-color: var(--accent); }

/* Stat block */
.statblock { background: var(--stat-bg); border-top: 3px solid var(--accent); border-bottom: 3px solid var(--accent); padding: 14px 18px; }
.statblock .line { margin: 2px 0; }
.statblock .label { font-family: var(--font-stat); font-weight: 700; color: var(--accent); font-size: .9em; letter-spacing: .04em; }
.statblock ul { margin: 8px 0 0; padding-left: 1.1em; }
.statblock li { margin: 4px 0; }

/* Art presentations */
.art-float { float: right; width: 42%; margin: -20px -20px 10px 24px; shape-outside: url(); filter: drop-shadow(2px 4px 6px rgba(60, 35, 10, .35)); }
.art-frame { display: block; width: 100%; border: 6px double var(--rule); margin-bottom: 18px; }
.art-line { float: right; width: 38%; margin: 0 0 10px 24px; mix-blend-mode: multiply; }

@media (max-width: 720px) {
  .folio { margin: 0; padding: 28px 16px; }
  .art-float, .art-line { float: none; width: 100%; margin: 0 0 12px; }
  h1 { font-size: 2rem; }
}
