/* THE BOOK OF THE REALM (2026-10-13): the website dressed as an illuminated book, after the owner's pages of a book of hours, a missal and an alchemist's codex,
   and kept in the game's own dress: the dark walnut and the double gilt frame of the in-game pages (ui/common.css) hold the leaves, and every leaf is the game's
   own parchment (ui/allegiance/screen.css, the reading panel: #ead9ae to #c9ab6c, ink #2b1d0d) illuminated - acanthus in lapis and rose at the corners, penwork
   with gold ivy in the margins, gilt initials, red rubrics, miniatures in gold frames. The art is drawn by tools/ms-art (make_ms_art.js: the illumination;
   export_game_art.js: the realm's own in-game pictures). Loaded after site.css, which keeps the page's workings (the map, the trailers, the pigeon, the reveal). */
:root {
  --vellum-1: #ead9ae; --vellum-2: #d6bd85; --vellum-3: #c9ab6c;
  --ms-ink: #2b1d0d; --ms-ink-soft: #5a4426; --ms-kick: #7a5a2a;
  --rubric: #a12a18; --rubric-dk: #7a1e10;
  --lapis: #24418f; --lapis-dk: #15275c;
  --rose: #a5465f;
  --leaf-gold: linear-gradient(135deg, #f6dc84 0%, #d4a93a 42%, #a97c1c 58%, #f0d070 100%);
  --frame-gold: #9a7420;
}

/* ---------- the bar: eleven entries since The Work; they stay on one line, and the menu folds into the burger below 1640 px (the line wants 1626 px: below that,
   from 1361 px, the name ran into THE REALM and the Discord button was squeezed to nothing - found 2026-10-15) ---------- */
#nav nav a { white-space: nowrap; }
#nav > .brand, #nav > .btn { flex: none; }
/* (2026-10-17: the bar holds five things now - four groups that drop down and the patronage - so it stands open down to 1200 px; it held eleven before, and folded below 1640) */
@media (min-width: 1201px) { #nav { gap: 24px; } #nav nav { gap: 22px; } #nav nav a, .nav-top { letter-spacing: .14em; font-size: 12px; } }
@media (max-width: 1200px) {
  #nav nav { position: fixed; inset: 0; z-index: -1; flex-direction: column; justify-content: safe center; align-items: center; gap: 22px; padding: 76px 16px 36px; overflow-y: auto; background: rgba(7, 5, 3, .97); opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s; }
  .nav-group { display: flex; flex-direction: column; align-items: center; gap: 6px; }
  .nav-top { padding: 0; font-size: 12px; color: var(--gold-dim); pointer-events: none; }
  .nav-top::after { display: none; }
  .nav-drop { position: static; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 20px; min-width: 0; padding: 0; background: none; border: 0; box-shadow: none; opacity: 1; visibility: inherit; transform: none; }
  .nav-drop::before { display: none; }
  #nav nav .nav-drop a { padding: 4px 0; font-size: 17px; letter-spacing: .16em; }
  #nav nav .nav-drop a:hover, #nav nav .nav-drop a.here { background: none; }
  #nav nav a { font-size: 18px; }
  #nav nav a::after { display: none; }
  #nav nav a.nav-dc { display: block; margin-top: 10px; padding: 12px 26px; border: 1px solid var(--gold); color: var(--gold); }
  #nav.open nav { opacity: 1; visibility: visible; }
  #nav > .btn { margin-left: auto; }
  .burger { display: block; margin-left: 0; }
  #nav.open .burger i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  #nav.open .burger i:nth-child(2) { opacity: 0; }
  #nav.open .burger i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}
@media (max-width: 560px) { .burger { margin-left: auto; } }

/* ---------- the dark of the book's binding between the leaves (the game's walnut) ---------- */
.leaf-sec { background: radial-gradient(ellipse 80% 60% at 50% 30%, #1d150c, #0b0805 75%); }
.leaf-sec .sec-head .sub { color: var(--cream); }

/* ---------- THE LEAF: the game's parchment in the game's gilt frame ---------- */
.folio { position: relative; color: var(--ms-ink); isolation: isolate;
  background:
    url('../img/ms/vellum.svg') center / 400px auto,
    radial-gradient(ellipse at 22% 18%, rgba(255, 248, 225, .65), transparent 55%),
    radial-gradient(ellipse at 80% 88%, rgba(120, 82, 36, .22), transparent 60%),
    linear-gradient(176deg, var(--vellum-1), var(--vellum-2) 60%, var(--vellum-3));
  box-shadow: 0 30px 70px rgba(0, 0, 0, .65), inset 0 0 60px rgba(110, 76, 30, .38); }
.folio.orn { border-color: rgba(246, 232, 144, .95); }
.folio.orn::before { border-color: rgba(122, 90, 42, .55); }
article.folio { padding: clamp(40px, 6vw, 84px) clamp(24px, 7vw, 104px); }
.folio-in { position: relative; z-index: 2; }
.folio .cn { border-color: #f1dc8a; }
.folio .cn::after { background: #f1dc8a; }
/* the acanthus at the corners (corner.svg drawn for the top left; the others turned) */
.ms-corner { position: absolute; z-index: 3; width: clamp(70px, 9vw, 132px); height: clamp(70px, 9vw, 132px); pointer-events: none; background: url('../img/ms/corner.svg') center / contain no-repeat;
  filter: drop-shadow(0 2px 2px rgba(60, 36, 10, .35)); }
.ms-corner.tl { left: -14px; top: -14px; }
.ms-corner.tr { right: -14px; top: -14px; transform: scaleX(-1); }
.ms-corner.bl { left: -14px; bottom: -14px; transform: scaleY(-1); }
.ms-corner.br { right: -14px; bottom: -14px; transform: scale(-1, -1); }
/* the penwork in a margin: hairline vines with gold ivy and small flowers */
.penwork { position: absolute; z-index: 1; top: clamp(70px, 9vw, 120px); bottom: clamp(70px, 9vw, 120px); width: 62px; pointer-events: none; opacity: .92;
  background: url('../img/ms/penwork-v.svg') center top / 62px auto repeat-y; }
.penwork.l { left: 18px; } .penwork.r { right: 18px; transform: scaleX(-1); }
@media (max-width: 900px) { .penwork { display: none; } }

/* ---------- the writing on a leaf ---------- */
.folio .eyebrow { color: var(--lapis); letter-spacing: .3em; font-weight: 600; }
.folio .h2 { color: var(--rubric); text-shadow: none; }
.folio h3 { color: #241608; }
.folio p { color: var(--ms-ink); }
.folio b { color: #3a2410; font-weight: 600; }
.folio em { color: var(--rubric); font-style: italic; }
.folio a { color: var(--lapis); }
.folio code { font-family: inherit; color: var(--rubric-dk); background: rgba(161, 42, 24, .08); border: 1px solid rgba(161, 42, 24, .25); padding: 0 5px; white-space: nowrap; }
.folio .sig { color: var(--ms-kick) !important; }
/* a red rule with a blue fleuron, as a rubricator draws a line under a heading */
.rubric-rule { position: relative; height: 14px; width: 230px; margin: 18px 0 24px; }
.rubric-rule::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: linear-gradient(90deg, var(--rubric), rgba(161, 42, 24, .15)); }
.rubric-rule::after { content: "\2766"; position: absolute; left: 0; top: -8px; font-size: 20px; line-height: 1; color: var(--lapis); background: transparent; }
.rubric-rule.c { margin-left: auto; margin-right: auto; }
.rubric-rule.c::before { background: linear-gradient(90deg, rgba(161, 42, 24, .15), var(--rubric), rgba(161, 42, 24, .15)); }
.rubric-rule.c::after { left: 50%; margin-left: -8px; }
/* the lists: the paragraph marks of the rubricator, red and blue in turn */
.folio .marks { border-top: 1px solid rgba(122, 90, 42, .35); }
.folio .marks li { color: var(--ms-ink-soft); padding-left: 24px; }
.folio .marks li::before { content: "\00B6"; width: auto; height: auto; background: none; transform: none; top: -.05em; left: 0; font-size: 1.15em; line-height: 1.3; color: var(--rubric); font-weight: 600; }
.folio .marks li:nth-child(even)::before { color: var(--lapis); }

/* ---------- THE GILT INITIAL: a letter of lapis on gold leaf, its field of rose with white penwork, an ink frame ---------- */
.initial { float: left; position: relative; width: 1.9em; height: 1.9em; margin: 6px 14px 2px 0; display: grid; place-items: center; font: 600 48px/1 var(--serif);
  color: var(--lapis); border: 1px solid #2a1c0c;
  background: radial-gradient(circle at 50% 50%, transparent 52%, rgba(255, 255, 255, .0) 53%), var(--leaf-gold);
  box-shadow: inset 0 0 0 3px rgba(255, 246, 210, .5), inset 0 0 0 5px rgba(122, 90, 42, .35), 0 3px 6px rgba(40, 24, 8, .3);
  text-shadow: 1px 1px 0 #fff3cc, -1px 0 0 #fff3cc, 0 2px 2px rgba(30, 20, 60, .35); }
.initial::before { content: ""; position: absolute; inset: 7px; z-index: -1; background:
  radial-gradient(circle at 25% 25%, rgba(255, 255, 255, .55) 0 1.5px, transparent 2px) 0 0 / 12px 12px,
  linear-gradient(135deg, #b5566e, #8c3348); border: 1px solid rgba(40, 20, 10, .5); }
.initial { z-index: 0; }
.drop { font-size: 20px; }
/* the old dark initial of site.css (the lore) is the gilt one now */
.lore .initial { color: var(--lapis); }

/* ---------- THE MINIATURE: a picture in a gold frame with a red inner line, as the illuminators framed their scenes ---------- */
.mini { position: relative; margin: 0; padding: 7px; background: var(--leaf-gold); box-shadow: 0 0 0 1px #2a1c0c, 0 18px 36px rgba(0, 0, 0, .45); }
.mini::before { content: ""; position: absolute; inset: 5px; border: 2px solid var(--rubric); pointer-events: none; z-index: 2; }
.mini > img { display: block; width: 100%; height: auto; border: 1px solid #1d140a; background: radial-gradient(ellipse at 50% 40%, #241a10, #0b0805 80%); }   /* (the game's own dark behind a picture drawn for it) */
.mini-tall { padding: 26px 22px 18px; background:
  url('../img/ms/vellum.svg') center / 400px auto, linear-gradient(176deg, #1d1610, #120d08); box-shadow: 0 0 0 1px #2a1c0c, 0 0 0 7px #c9a23e, 0 0 0 8px #2a1c0c, 0 24px 50px rgba(0, 0, 0, .55); }
.mini-tall::before { inset: 8px; border-color: rgba(246, 232, 144, .25); }

/* ---------- the rubric band: the realm's sayings, written red and blue in turn on a strip of parchment ---------- */
.ticker { background: linear-gradient(180deg, #e3cf9c, #cdb27a); border-top: 2px solid #8a6514; border-bottom: 2px solid #8a6514; box-shadow: inset 0 1px 0 rgba(255, 250, 230, .5), 0 6px 16px rgba(0, 0, 0, .5); }
.ticker::before { background: linear-gradient(90deg, #d9c38c, transparent); }
.ticker::after { background: linear-gradient(-90deg, #d9c38c, transparent); }
.ticker-track span { color: var(--rubric); font-weight: 600; }
.ticker-track span:nth-of-type(even) { color: var(--lapis); }
.ticker-track b { color: #8a6514; font-size: 16px; }

/* ---------- the hero: the moving picture framed as the book's great miniature, acanthus in its corners ---------- */
.hero-frame { position: absolute; inset: clamp(70px, 9vh, 96px) clamp(12px, 2.4vw, 34px) clamp(14px, 3vh, 30px); z-index: 1; pointer-events: none;
  border: 1px solid rgba(246, 232, 144, .55); box-shadow: inset 0 0 0 6px rgba(11, 8, 5, .35), inset 0 0 0 7px rgba(246, 232, 144, .22); }
.hero-frame .ms-corner { width: clamp(80px, 10vw, 150px); height: clamp(80px, 10vw, 150px); opacity: .95; }
@media (max-width: 700px) { .hero-frame { display: none; } }
/* the title's kicker: no stray characters (the old page showed a broken dot) */

/* ---------- the realm's leaf ---------- */
.realm .folio .two { align-items: center; }
.realm .castle-card .mini-tall dd { color: #d8cba4; }
.realm .castle-card .mini-tall dt { color: #f6e890; }
.realm .lore p:not(.sig) { color: var(--ms-ink); }

/* ---------- the chapters: each a miniature and a leaf of text ---------- */
.chapters { background: radial-gradient(ellipse 80% 50% at 50% 20%, #1d150c, #0b0805 80%); }
.chapter .ch-img.mini { padding: 9px; border: 0; }
.chapter .ch-img.mini::after { display: none; }   /* (no fade into the dark: the miniature stands framed) */
.chapter .ch-img.mini::before { inset: 6px; border: 2px solid var(--rubric); }
.chapter .ch-img.mini > img { width: 100%; height: 118%; object-fit: cover; filter: saturate(.92) sepia(.08) brightness(.95); }   /* (the chapter's own fill and parallax: site.css) */
.chapter .ch-text.folio { border: 1px solid rgba(246, 232, 144, .95); padding: 46px 46px 34px; }
.chapter .ch-text.folio::before { inset: 7px; border: 1px solid rgba(122, 90, 42, .55); }
.chapter .ch-text.folio h3 { color: var(--rubric); }
.chapter .ch-text.folio p { color: var(--ms-ink); }
.chapter .ch-text .initial { font-size: 40px; }
.chapter .vs { color: var(--ms-kick); }
@media (max-width: 900px) { .chapter .ch-text.folio { padding: 46px 22px 26px; } }

/* ---------- the work of the realm: the trades, with the game's own pictures ---------- */
.trade { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 150px; gap: clamp(18px, 3vw, 38px); align-items: center; padding: 26px 0; border-bottom: 1px solid rgba(122, 90, 42, .3); }
.trade:last-child { border-bottom: 0; }
.trade.r { grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1.25fr); }
.trade.r > .mini:first-child { grid-column: 3; grid-row: 1; }
.trade.r > .trade-t { grid-column: 2; grid-row: 1; }
.trade.r > .mini-sm { grid-column: 1; grid-row: 1; }
.trade.r:not(:has(.mini-sm)) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.trade.r:not(:has(.mini-sm)) > .mini:first-child { grid-column: 2; }
.trade.r:not(:has(.mini-sm)) > .trade-t { grid-column: 1; }
.trade h3 { margin: 0 0 10px; font-weight: 400; font-size: clamp(24px, 2.4vw, 32px); color: var(--rubric); line-height: 1.15; }
.trade .eyebrow { margin-bottom: 6px; }
.trade p { margin: 0; font-size: 17px; line-height: 1.62; }
.trade .initial { font-size: 36px; }
.mini-sm { align-self: center; }
.trade.crafts { grid-template-columns: 1fr; }
.crafts-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.crafts-row.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* (six workshops: two rows of three, 2026-10-22) */
@media (max-width: 1000px) {
  .trade, .trade.r, .trade.r:not(:has(.mini-sm)) { grid-template-columns: 1fr; }
  .trade.r > .mini:first-child, .trade.r > .trade-t, .trade.r > .mini-sm, .trade.r:not(:has(.mini-sm)) > .mini:first-child, .trade.r:not(:has(.mini-sm)) > .trade-t { grid-column: auto; grid-row: auto; }
  .mini-sm { max-width: 170px; }
  .crafts-row, .crafts-row.c3 { grid-template-columns: 1fr 1fr; }
}

/* ---------- the codex (the ways): the alchemist's book, ink and wash, the moon's phases down the margin ---------- */
.folio.codex { background:
    url('../img/ms/vellum.svg') center / 300px auto,
    radial-gradient(ellipse at 70% 12%, rgba(120, 82, 36, .25), transparent 50%),
    radial-gradient(ellipse at 18% 80%, rgba(90, 110, 70, .18), transparent 55%),
    linear-gradient(176deg, #e4d2a2, #d1b67c 60%, #c2a265); }
.codex-moons { position: absolute; z-index: 1; left: clamp(10px, 2vw, 30px); top: 60px; width: 52px; height: calc(100% - 120px); max-height: 560px; background: url('../img/ms/moons.svg') center top / 52px auto no-repeat; opacity: .9; pointer-events: none; }
.folio.codex::after { content: ""; position: absolute; z-index: 1; right: 26px; bottom: 22px; width: 190px; height: 220px; background: url('../img/ms/alembic.svg') center / contain no-repeat; opacity: .55; pointer-events: none; }
.codex .folio-in { padding-left: clamp(0px, 4vw, 60px); }
.codex .way { position: relative; background: rgba(255, 248, 225, .28); border: 1px solid rgba(90, 62, 26, .45); box-shadow: inset 0 0 0 4px rgba(255, 248, 225, .18), inset 0 0 0 5px rgba(90, 62, 26, .2); }
.codex .way:hover { border-color: rgba(161, 42, 24, .6); }
.codex .way h3 { color: var(--rubric); font-size: 21px; }
.codex .way h3::first-letter { color: var(--lapis); font-size: 1.25em; }
.codex .way p { color: var(--ms-ink); }
@media (max-width: 900px) { .codex-moons, .folio.codex::after { display: none; } .codex .folio-in { padding-left: 0; } }

/* ---------- the laws: each numbered with a great initial, red and blue in turn, with its penwork ---------- */
.laws .folio .steps { margin: 0; }
.laws .steps .n { width: 60px; height: 60px; font: 600 26px/1 var(--serif); color: #fff8e0; }
.laws .steps .n::before { z-index: -1; inset: 4px; transform: none; border: 1px solid #2a1c0c; background: linear-gradient(135deg, #c33a24, var(--rubric) 55%, var(--rubric-dk)); box-shadow: inset 0 0 0 3px rgba(255, 236, 200, .35); }
.laws .steps .n::after { z-index: -1; inset: -6px; transform: none; border: 0; background: url('../img/ms/sun.svg') right -6px top -6px / 22px no-repeat, url('../img/ms/sun.svg') left -6px bottom -6px / 18px no-repeat; }
.laws .steps li:nth-child(even) .n::before { background: linear-gradient(135deg, #3a5cb0, var(--lapis) 55%, var(--lapis-dk)); }
.laws .steps .n { z-index: 0; }
.laws .steps h3 { color: var(--rubric); }
.laws .steps li:nth-child(even) h3 { color: var(--lapis); }
.laws .steps p { color: var(--ms-ink); }

/* ---------- the decree (join): the Chancery's word on parchment, as the game's decrees are ---------- */
.decree.folio { text-align: center; }
.decree.folio .steps { text-align: left; }
.decree.folio .steps .n { color: var(--rubric); }
.decree.folio .steps .n::before { border-color: var(--rubric); background: rgba(161, 42, 24, .06); }
.decree.folio .steps .n::after { border-color: rgba(36, 65, 143, .45); }
.decree.folio .steps h3 { color: #241608; }
.decree.folio .steps p { color: var(--ms-ink); }
.decree.folio .counts { color: var(--ms-ink-soft); }
.decree.folio .counts b { color: var(--rubric); }
.decree.folio .counts i { color: #8a6514; }
.decree.folio .invite { color: var(--ms-kick); }

/* ---------- the launcher's leaf ---------- */
.launch-text.folio { padding: clamp(30px, 4vw, 52px) clamp(24px, 4vw, 50px); border: 1px solid rgba(246, 232, 144, .95); }
.launch-text.folio::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(122, 90, 42, .5); pointer-events: none; }
.launch-text.folio .launch-fine { color: var(--ms-ink-soft); }
.launch-text.folio .launch-fine a { color: var(--lapis); }
.launch-text.folio .btn-ghost { color: #3a2410; border-color: #7a5a2a; background: rgba(255, 248, 225, .35); }
.launch-text.folio .btn-ghost .bk { border-color: #3a2410; }
.launch-shot .tilt { background: var(--leaf-gold); padding: 8px; border: 1px solid #2a1c0c; }

/* ---------- the drolleries in the margins (manuscript.js): the realm's own trophy pictures, as the illuminators' little jokes ---------- */
.drollery { position: absolute; z-index: 2; width: 58px; height: 58px; pointer-events: none; opacity: .95; filter: drop-shadow(0 1px 1px rgba(60, 36, 10, .3)); }
@media (max-width: 1100px) { .drollery { display: none; } }

/* ---------- small screens: the leaves keep their gilt, lose the margins ---------- */
@media (max-width: 700px) {
  article.folio { padding: 46px 18px 34px; }
  .ms-corner { width: 58px; height: 58px; left: -8px; top: -8px; }
  .ms-corner.tr { left: auto; right: -8px; } .ms-corner.bl { top: auto; bottom: -8px; } .ms-corner.br { left: auto; top: auto; right: -8px; bottom: -8px; }
  .initial { font-size: 38px; }
  .ticker-track span { font-size: 12px; }
}
