@charset "UTF-8";

/* Locally bundled manuscript-style initials; license in assets/fonts. */
@font-face {
  font-family: "Uncial Antiqua";
  src: url("assets/fonts/UncialAntiqua-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}


:root {
  color-scheme: dark;
  --bg: #101312;
  --bg-deep: #0b0e0e;
  --surface: #171b19;
  --ink: #e7e3d7;
  --muted: #a8a99d;
  --faint: #90978c;
  --gold: #d1b982;
  --gold-bright: #edd49b;
  --rule: rgba(215, 201, 165, .17);
  --display: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --body: Georgia, "Times New Roman", serif;
  --ui: "Trebuchet MS", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body { margin: 0; min-width: 300px; background: var(--bg); color: var(--ink); font-family: var(--body); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; background: radial-gradient(ellipse 68% 45% at 68% -10%, rgba(102, 90, 57, .14), transparent 70%), repeating-linear-gradient(0deg, rgba(255,255,255,.008) 0, rgba(255,255,255,.008) 1px, transparent 1px, transparent 5px); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
::selection { color: #121410; background: #d5c28e; }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 4px; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; left: 1rem; top: 1rem; z-index: 100; background: var(--gold-bright); color: var(--bg); padding: .7rem 1rem; }

.site-header { position: sticky; top: 0; z-index: 20; background: rgba(14, 17, 16, .94); border-bottom: 1px solid var(--rule); backdrop-filter: blur(16px); }
.header-inner { max-width: 1440px; min-height: 76px; margin: 0 auto; padding: 0 48px; display: flex; align-items: center; gap: 52px; }
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.brand img { width: 43px; height: 37px; object-fit: contain; }
.main-nav { display: flex; align-items: center; gap: 31px; align-self: stretch; }
.main-nav a { display: flex; align-items: center; position: relative; font: 14px var(--ui); color: var(--muted); letter-spacing: .025em; transition: color .2s; }
.main-nav a:hover, .main-nav a.active { color: #f1e9d5; }
.main-nav a.active::after { content: ""; position: absolute; height: 2px; background: var(--gold); bottom: -1px; left: 0; right: 0; }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 26px; }
.header-search { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid rgba(212, 199, 165, .25); padding: 5px 0; width: 185px; }
.search-glyph { font: 24px/1 var(--display); color: var(--gold); transform: rotate(-15deg); }
.header-search input { min-width: 0; width: 100%; color: var(--ink); border: 0; outline: 0; background: transparent; font: 12px var(--ui); }
.header-search input:focus-visible, .character-filter input:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 4px; }
.header-search:focus-within, .character-filter:focus-within { border-bottom-color: var(--gold-bright); }
.header-search input::placeholder { color: #858b81; opacity: 1; }
.header-search button { border: 0; background: none; color: #7a8178; padding: 0; font: 14px var(--ui); }

.wrap { width: min(100% - 96px, 1320px); margin-inline: auto; }
.text-link { display: inline-flex; align-items: center; gap: 16px; color: var(--gold-bright); font: 12px/1.4 var(--ui); letter-spacing: .025em; }
.text-link::after { content: "→"; font-size: 16px; transition: transform .2s; }
.text-link:hover::after { transform: translateX(5px); }
.rule { border: 0; border-top: 1px solid var(--rule); }

.constellation { position: relative; width: min(100%, 1040px); height: clamp(700px, calc(100vh - 120px), 860px); margin: 20px auto 35px; }
.motion-control { display: block; margin: -20px auto 30px; padding: 6px 2px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font: 12px var(--ui); }
.motion-control:hover { color: var(--gold-bright); }
.motion-control[hidden], .emblem-part[hidden] { display: none !important; }
.constellation.motion-paused *, .constellation.motion-paused *::before, .constellation.motion-paused *::after { animation-play-state: paused !important; }
.constellation.motion-paused .constellation-art { animation: none !important; }
.constellation-orbit { position: absolute; inset: 14% 19%; border: 1px solid rgba(209,185,130,.17); border-radius: 50%; pointer-events: none; }
.constellation-orbit::before, .constellation-orbit::after { content: ""; position: absolute; width: 5px; height: 5px; background: rgba(224,201,151,.75); transform: rotate(45deg); animation: star-flicker 4.8s ease-in-out infinite alternate; }
.constellation-orbit::before { top: 19%; left: 10%; }
.constellation-orbit::after { right: 9%; bottom: 19%; animation-delay: -2.4s; }
.constellation.has-leylines .constellation-orbit { display: none; }
.leyline-field { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: visible; }
.leyline-layer { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; }
.leyline-glow { filter: blur(11px); }
.leyline-base, .leyline-filament, .leyline-whisper { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.leyline-halo { fill: rgba(40, 199, 224, .20); }
.leyline-ribbon { fill: url(#lore-mana-ribbon); filter: blur(2px); }
.leyline-base { stroke: rgba(100, 224, 239, .15); stroke-width: 2.5px; }
.leyline-filament { stroke: url(#lore-mana-thread); stroke-width: 1.1px; stroke-dasharray: 70 28 34 22; }
.leyline-whisper { stroke: rgba(117, 236, 247, .24); stroke-width: .9px; stroke-dasharray: 32 18 12 24; }
.leyline-stream { position: absolute; left: 0; top: 0; width: 130px; height: 32px; offset-anchor: 50% 50%; offset-rotate: auto; opacity: 0; animation: mana-flow 10s linear infinite; }
.leyline-stream::before, .leyline-stream::after { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.leyline-stream::before { background: radial-gradient(ellipse, rgba(123, 244, 255, .48), rgba(33, 198, 224, .23) 43%, transparent 75%); filter: blur(5px); }
.leyline-stream::after { inset: 13px 8px; background: linear-gradient(90deg, transparent, rgba(210, 255, 255, .8), rgba(80, 226, 242, .3), transparent); filter: blur(.8px); }
@keyframes mana-flow {
  0% { offset-distance: 0%; opacity: 0; transform: scaleY(.65); }
  9% { opacity: .7; }
  27% { transform: scaleY(1.65); }
  52% { transform: scaleY(.8); }
  76% { transform: scaleY(1.8); }
  90% { opacity: .7; }
  100% { offset-distance: 100%; opacity: 0; transform: scaleY(.65); }
}
.leyline-sparkle { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #c5efff; box-shadow: 0 0 5px 2px rgba(91, 193, 255, .45); transform: translate(-50%, -50%); opacity: .58; animation: mana-sparkle 4.2s ease-in-out infinite alternate; }
.leyline-sparkle::before, .leyline-sparkle::after { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: linear-gradient(90deg, transparent, #d9f7ff, transparent); }
.leyline-sparkle::before { width: 13px; height: 1px; }
.leyline-sparkle::after { width: 1px; height: 13px; background: linear-gradient(transparent, #d9f7ff, transparent); }
@keyframes mana-sparkle { from { opacity: .23; transform: translate(-50%, -50%) scale(.7); } to { opacity: .9; transform: translate(-50%, -50%) scale(1.05); } }
.constellation-center { position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%, -50%); width: clamp(220px, 26vw, 310px); text-align: center; }
.constellation-center img, .constellation-center .lore-book-art { display: block; width: min(100%, 285px); height: auto; margin: auto; filter: drop-shadow(0 18px 26px rgba(0,0,0,.45)); }
.lore-book-art { pointer-events: none; }
.lore-book-art .lore-pupil { transition: transform .14s ease-out; }
.constellation-book { position: absolute; z-index: 2; width: clamp(150px, 22vw, 205px); min-height: 195px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; transform: translate(-50%, -50%); }
.constellation-book-0 { left: 50%; top: 14.5%; --entry-delay: 0ms; --emblem-glow: rgba(244,235,199,.72); }
.constellation-book-1 { left: 81%; top: 31%; --entry-delay: 70ms; --emblem-glow: rgba(171,105,244,.7); }
.constellation-book-2 { left: 81%; top: 69%; --entry-delay: 140ms; --emblem-glow: rgba(187,112,255,.7); }
.constellation-book-3 { left: 50%; top: 85.5%; --entry-delay: 210ms; --emblem-glow: rgba(117,209,255,.75); }
.constellation-book-4 { left: 19%; top: 69%; --entry-delay: 280ms; --emblem-glow: rgba(100,124,255,.75); }
.constellation-book-5 { left: 19%; top: 31%; --entry-delay: 350ms; --emblem-glow: rgba(235,196,113,.7); }
.constellation-art { display: grid; place-items: center; width: clamp(138px, 15vw, 178px); aspect-ratio: 1; filter: drop-shadow(0 0 0 transparent); transition: transform .3s ease, filter .4s ease; animation: emblem-arrive .7s ease-out var(--entry-delay) backwards; }
.emblem-visual { display: block; position: relative; width: 100%; height: 100%; }
.emblem-part { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.emblem-cosmic::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 50%, rgba(255,255,247,.7), rgba(229,226,207,.18) 27%, transparent 61%); }
.cosmic-rings { transform: rotate(114deg) scale(1.02); transform-origin: 50% 50%; }
.cosmic-rings img { display: block; width: 100%; height: 100%; object-fit: contain; }
.cosmic-rings.motion-still { transform: rotate(114deg) scale(.82); }
.organic-motion { inset: -12.5%; width: 125%; height: 125%; overflow: visible; }
.organic-motion img { display: block; width: 100%; height: 100%; object-fit: contain; }
.organic-motion.motion-still { inset: 0; width: 100%; height: 100%; }
.emblem-chaos::before { content: ""; position: absolute; left: 42%; top: 38.5%; width: 17%; height: 15%; border-radius: 50%; pointer-events: none; background: linear-gradient(to bottom, transparent 45%, #180b1d 48% 52%, transparent 55%), radial-gradient(ellipse at 50% 35%, #69314d, #32152f 72%, #1b0b21); }
.chaos-center { -webkit-mask-image: radial-gradient(circle at 50% 46%, #000 0 12%, transparent 19%); mask-image: radial-gradient(circle at 50% 46%, #000 0 12%, transparent 19%); transform-origin: 50% 46%; animation: chaos-blink 13s ease-in-out infinite; }
.emblem-chaos::after { content: ""; position: absolute; left: 42%; top: 43%; width: 16%; height: 16%; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(198,255,107,.5), transparent 70%); opacity: .2; animation: chaos-glimmer 13s ease-in-out infinite; }
.portal-native img { display: block; width: 100%; height: 100%; object-fit: contain; }
.emblem-hourglass::after { content: ""; position: absolute; left: 50%; top: 44%; width: 3px; height: 5px; border-radius: 50%; background: #e4fbff; box-shadow: 0 0 7px #9be4ff; opacity: 0; pointer-events: none; animation: falling-sand 4s ease-in-out infinite; }
.emblem-eyes { transform: scale(1.28); }
.emblem-eyes::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 24% 24% at 50% 49%, rgba(0,1,6,.98) 0%, rgba(0,2,9,.94) 30%, rgba(1,4,14,.72) 58%, rgba(2,8,21,0) 100%); }
.sea-current { animation: sea-swirl 22s linear infinite; }
.sea-current-eddies { animation: sea-eddies 17s linear infinite; }
.sea-eye { animation: eye-blink 7s ease-in-out infinite; }
.sea-eye-upper { transform-origin: 49.5% 32.8%; }
.sea-eye-middle { transform-origin: 50.5% 48.8%; animation-delay: .2s; }
.sea-eye-lower { transform-origin: 50% 62.2%; animation-delay: .4s; }
.constellation-badge { position: relative; display: block; overflow: hidden; width: 84px; height: 84px; border-radius: 50%; }
.constellation-badge img { position: absolute; display: block; width: 188.5%; max-width: none; height: auto; left: -44.25%; top: -22%; }
.constellation-label { color: #f1eadc; font: 600 17px/1.25 var(--display); letter-spacing: .01em; text-shadow: 0 1px 3px #080a09, 0 0 9px #080a09; transition: color .2s ease; }
.constellation-book:hover .constellation-art, .constellation-book:focus-visible .constellation-art { transform: translateY(-4px); filter: drop-shadow(0 0 13px var(--emblem-glow)); }
.constellation-book:hover .constellation-label, .constellation-book:focus-visible .constellation-label { color: var(--gold-bright); }
@keyframes emblem-arrive { from { opacity: 0; transform: translateY(12px) scale(.9); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes star-flicker { from { opacity: .35; } to { opacity: .9; } }
@keyframes chaos-blink {
  0%, 35.4%, 38.2%, 85.4%, 88.2%, 100% { transform: scaleY(1); }
  36.4%, 36.8%, 86.4%, 86.8% { transform: scaleY(.06); }
}
@keyframes chaos-glimmer {
  0%, 35.4%, 38.2%, 85.4%, 88.2%, 100% { opacity: .2; }
  18%, 62% { opacity: .55; }
  36.4%, 36.8%, 86.4%, 86.8% { opacity: 0; }
}
@keyframes falling-sand { 0%, 27%, 100% { opacity: 0; transform: translateY(-8px); } 35% { opacity: .9; } 68% { opacity: 0; transform: translateY(24px); } }
@keyframes sea-swirl { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes sea-eddies { 0% { transform: rotate(0) scale(1); } 33% { transform: rotate(120deg) scale(1.04); } 67% { transform: rotate(240deg) scale(.98); } 100% { transform: rotate(360deg) scale(1); } }
@keyframes eye-blink { 0%, 43%, 49%, 100% { transform: scaleY(1); } 45%, 47% { transform: scaleY(.08); } }
.book-row, .result-row { display: flex; align-items: baseline; gap: 20px; padding: 15px 0; border-top: 1px solid var(--rule); }
.book-row:last-child, .result-row:last-child { border-bottom: 1px solid var(--rule); }
.book-row:hover .book-name, .result-row:hover .result-title { color: var(--gold-bright); }
.book-name { font: 18px/1.35 var(--display); transition: color .2s; }
.row-arrow { margin-left: auto; color: var(--faint); font: 15px var(--ui); }

.page-shell { width: min(100% - 96px, 1320px); margin: 0 auto; padding: 56px 0 110px; }
.page-heading { max-width: 800px; margin: 0 0 45px; }
.page-heading h1 { margin: 15px 0 14px; font: 400 clamp(43px, 5vw, 64px)/1.05 var(--display); letter-spacing: -.04em; }
.page-heading p { color: var(--muted); font: 16px/1.75 var(--body); margin: 0; max-width: 650px; }
.chapter-list { max-width: 950px; }
.book-group { border-top: 1px solid var(--rule); padding: 25px 0 27px; }
.book-group:last-child { border-bottom: 1px solid var(--rule); }
.book-group h2 { font: 400 27px/1.2 var(--display); margin: 0 0 10px; }
.book-group h2 a:hover { color: var(--gold-bright); }
.book-group details { margin-top: 10px; }
.book-group summary { color: var(--muted); font: 11px var(--ui); cursor: pointer; list-style: none; padding: 6px 0; }
.book-group summary::-webkit-details-marker { display: none; }
.book-group summary::before { content: "+"; color: var(--gold); font-size: 16px; margin-right: 10px; }
.book-group details[open] > summary::before { content: "−"; }
.chapter-links { list-style: none; padding: 9px 0 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 34px; }
.chapter-links li { border-top: 1px solid rgba(215,201,165,.09); }
.chapter-links a { display: block; padding: 11px 0; color: #c6c8bc; font: 13px/1.4 var(--ui); }
.chapter-links a:hover { color: var(--gold-bright); }

.letter-nav { display: flex; flex-wrap: wrap; gap: 4px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 15px 0; margin: 0 0 25px; }
.letter-nav a, .letter-nav span { display: grid; place-items: center; min-width: 29px; height: 30px; font: 11px var(--ui); color: var(--gold); }
.letter-nav a:hover { color: #111; background: var(--gold); }
.letter-nav span { color: #4e554e; }
.character-filter { display: flex; align-items: center; gap: 12px; max-width: 410px; border-bottom: 1px solid var(--rule); margin: 0 0 38px; padding: 8px 0; }
.character-filter input { background: transparent; color: var(--ink); border: 0; outline: 0; width: 100%; font: 14px var(--ui); }
.character-filter input::placeholder { color: var(--faint); }
.character-controls { display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: 1080px; margin-bottom: 20px; }
.character-controls .character-filter { flex: 1; margin: 0; min-width: 0; padding: 13px 0; }
.character-filter-toggle, .character-filter-clear { background: none; border: 0; color: var(--gold-bright); font: 13px/1.5 var(--ui); padding: 12px 0; }
.character-filter-toggle::before { content: "+"; margin-right: 9px; }
.character-filter-toggle[aria-expanded="true"]::before { content: "−"; }
.character-filter-toggle:hover, .character-filter-clear:hover { text-decoration: underline; text-underline-offset: 4px; }
.character-facets { max-width: 1080px; padding: 25px 0 6px; }
.character-facet-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; max-width: 760px; }
.character-facet-field label { display: block; color: var(--muted); font: 11px/1.5 var(--ui); letter-spacing: .06em; margin-bottom: 8px; }
.character-facet-field select { width: 100%; min-height: 45px; padding: 10px 32px 10px 12px; border: 1px solid var(--rule); border-radius: 0; background: #151914; color: var(--ink); font: 14px/1.5 var(--ui); }
.character-results-bar { max-width: 1080px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0; }
.character-filter-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.character-filter-chip { border: 1px solid var(--rule); background: rgba(203,183,123,.07); color: var(--gold-bright); padding: 9px 12px; font: 12px/1.5 var(--ui); text-align: left; }
.character-filter-chip:hover { border-color: var(--gold); }
.character-results-bar[hidden] { display: none; }
.character-controls button:focus-visible, .character-facets select:focus-visible, .character-results-bar button:focus-visible, .letter-nav a:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 4px; }
@media (max-width: 600px) {
  .character-controls { gap: 14px; }
  .character-filter-toggle { font-size: 12px; flex-shrink: 0; }
  .character-facet-fields { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .character-facets { padding-top: 20px; }
}
.character-directory { max-width: 1080px; }
.letter-group { display: grid; grid-template-columns: 80px 1fr; gap: 22px; padding: 12px 0 39px; scroll-margin-top: 96px; }
.letter-group h2 { color: var(--gold); font: 400 43px/1 var(--display); margin: 0; }
.character-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); column-gap: 40px; align-content: start; }
.character-row { display: flex; align-items: center; min-height: 51px; padding: 11px 0; border-top: 1px solid var(--rule); }
.character-row strong { font: 400 18px/1.2 var(--display); }
.character-row:hover strong { color: var(--gold-bright); }
.empty-state { color: var(--muted); line-height: 1.7; padding: 25px 0; }

.reader-layout { display: grid; grid-template-columns: 230px minmax(0, 710px); gap: clamp(55px, 7vw, 110px); align-items: start; }
.reader-sidebar { position: sticky; top: 105px; max-height: calc(100vh - 125px); overflow: auto; padding: 3px 20px 20px 0; scrollbar-width: thin; scrollbar-color: #4b5145 transparent; }
.sidebar-label { color: var(--faint); font: 11px var(--ui); letter-spacing: .14em; text-transform: uppercase; margin: 0 0 18px; }
.reader-sidebar details { border-top: 1px solid var(--rule); padding: 13px 0; }
.reader-sidebar summary { color: #ddd8ca; font: 13px/1.5 var(--ui); list-style: none; cursor: pointer; }
.reader-sidebar summary.current { position: relative; padding-right: 18px; color: var(--gold-bright); }
.reader-sidebar summary.current::after { content: ""; position: absolute; right: 2px; top: 2px; width: 9px; height: 13px; background: var(--gold); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%); opacity: .8; }
.reader-sidebar summary::-webkit-details-marker { display: none; }
.reader-sidebar summary::before { content: "+"; display: inline-block; width: 19px; color: var(--gold); }
.reader-sidebar details[open] summary::before { content: "−"; }
.reader-sidebar ul { list-style: none; padding: 7px 0 0 19px; margin: 0; }
.reader-sidebar a { display: block; color: #b5baaf; font: 13px/1.45 var(--ui); padding: 5px 0; }
.reader-sidebar a:hover, .reader-sidebar a.current { color: var(--gold-bright); }
.reader-sidebar .nested { padding-left: 14px; }
.mobile-contents { display: none; }
.breadcrumb { color: var(--faint); font: 11px/1.5 var(--ui); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 17px; }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb span { margin: 0 9px; color: #596258; }
.article-title { font: 400 clamp(39px, 4.5vw, 61px)/1.07 var(--display); letter-spacing: -.04em; margin: 0 0 20px; }
.article-subtitle { color: var(--gold); font: 13px/1.5 var(--ui); margin: -4px 0 28px; }
.article-rule { height: 1px; background: var(--rule); margin: 26px 0 35px; }
.chapter-article .article-rule { position: relative; }
.chapter-article .article-rule::after { content: ""; position: absolute; top: -3px; left: 0; width: 7px; height: 7px; border: 1px solid rgba(209,185,130,.7); background: var(--bg); transform: rotate(45deg); }
.overview-title { font-size: clamp(34px, 3.5vw, 48px); line-height: 1.1; }
.overview-heading { display: flex; align-items: center; gap: 20px; }
.overview-heading-text { min-width: 0; }
.overview-heading .article-title { margin-bottom: 0; }
.overview-book-label { margin: 0 0 8px; color: var(--gold); font: 12px/1.4 var(--ui); letter-spacing: .1em; text-transform: uppercase; }
.chapter-intro { margin: 14px 0 0; max-width: 680px; color: #c8c5b9; font: 16px/1.65 var(--body); }
.overview-intro { max-width: 620px; margin: 17px 0 0; color: #b5b9ac; font: 16px/1.7 var(--body); }
.book-emblem { display: block; width: 58px; height: 58px; flex: 0 0 auto; object-fit: contain; }
.book-emblem-focus { object-fit: cover; }
.book-emblem-badge { position: relative; overflow: hidden; border-radius: 50%; }
.book-emblem-badge img { position: absolute; display: block; width: 188.5%; max-width: none; height: auto; left: -44.25%; top: -22%; }
.overview-contents h2 { margin: 0 0 15px; color: #e7e3d7; font: 400 25px/1.2 var(--display); }
.overview-chapters { list-style: none; margin: 0; padding: 0; }
.overview-chapters > li { border-top: 1px solid var(--rule); }
.overview-chapters a { display: block; padding: 15px 0; color: #d2d2c8; font: 16px/1.45 var(--body); transition: color .2s; }
.overview-chapters a:hover { color: var(--gold-bright); }
.overview-chapters > .has-children { padding-bottom: 15px; }
.overview-chapters .overview-chapters { margin: 0 0 2px 18px; padding-left: 16px; border-left: 1px solid var(--rule); }
.overview-chapters .overview-chapters > li { border: 0; }
.overview-chapters .overview-chapters a { color: #c8c5b9; font-size: 16px; padding: 6px 0; }
.overview-chapters .overview-chapters a:hover { color: var(--gold-bright); }
.overview-notes { margin-top: 45px; font-size: 14px; color: var(--muted); }
.overview-references.prose { margin-top: 45px; padding-top: 20px; border-top: 1px solid var(--rule); color: var(--muted); font: 14px/1.6 var(--body); }
.overview-references.prose h2 { margin: 0 0 10px; color: var(--faint); font: 12px/1.4 var(--ui); letter-spacing: .08em; text-transform: uppercase; }
.overview-references.prose ul { list-style: none; margin: 0; padding: 0; }
.overview-references.prose li { margin: 5px 0; padding: 0; }
.prose { color: #ddd8cc; font: 18px/1.72 var(--body); overflow-wrap: break-word; }
.prose p { margin: 0 0 1.22em; }
.prose h2 { color: #eee9dc; font: 400 29px/1.2 var(--display); letter-spacing: -.02em; margin: 1.65em 0 .58em; scroll-margin-top: 100px; }
.prose h3 { color: #e2d7bb; font: 400 22px/1.3 var(--display); margin: 1.55em 0 .55em; scroll-margin-top: 100px; }
.prose a, .figure-caption a { color: var(--gold-bright); border-bottom: 1px solid rgba(209,185,130,.42); }
.prose a:hover, .figure-caption a:hover { border-bottom-color: var(--gold-bright); }
.prose strong { color: #ede9dd; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { padding-left: .25em; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font: 13px/1.55 var(--ui); }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: .65em .7em; text-align: left; vertical-align: top; }
.prose th { color: var(--gold); font-weight: 600; }
.table-scroll { overflow-x: auto; }
.prose .dropcap::first-letter { float: left; font: 400 3.7em/.82 "Uncial Antiqua", var(--display); color: #d1b982; padding: .045em .09em 0 0; text-shadow: none; }
.story-figure { margin: 1.7em 0; }
.story-figure img { display: block; width: 100%; max-height: 420px; object-fit: contain; object-position: left center; }
.figure-caption { color: var(--faint); font: 12px/1.6 var(--ui); margin-top: 9px; }
.figure-caption a { color: #c7b685; }
.chapter-pagination { display: flex; justify-content: space-between; gap: 25px; border-top: 1px solid var(--rule); margin-top: 50px; padding-top: 22px; }
.chapter-pagination a { max-width: 47%; color: var(--muted); font: 12px/1.6 var(--ui); }
.chapter-pagination a:hover { color: var(--gold-bright); }
.chapter-pagination small { display: block; color: var(--faint); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; margin-bottom: 5px; }
.chapter-pagination .page-next { text-align: right; }
.chapter-pagination .page-previous small::before { content: "◂"; color: var(--gold); font-size: 13px; margin-right: 8px; }
.chapter-pagination .page-next small::after { content: "▸"; color: var(--gold); font-size: 13px; margin-left: 8px; }

.profile-shell { width: min(100% - 96px, 1080px); margin: 0 auto; padding: 58px 0 110px; }
.profile-heading { max-width: 870px; }
.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(32px, 4vw, 56px); align-items: start; }
.profile-gallery { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 105px; }
.profile-gallery figure { margin: 0; }
.profile-gallery figure[hidden] { display: none; }
.profile-gallery img { display: block; width: 100%; height: auto; max-height: 300px; object-fit: contain; object-position: center; }
.profile-gallery img.transparent-art { filter: drop-shadow(0 4px 14px rgba(210, 176, 112, .16)); }
.profile-gallery img.transparent-art[alt*="silhouette" i] { filter: drop-shadow(0 0 2px rgba(225, 205, 157, .62)) drop-shadow(0 4px 14px rgba(210, 176, 112, .16)); }
.profile-gallery figcaption { text-align: center; }
.appearance-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.appearance-tab { width: 40px; height: 40px; padding: 0; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--muted); font: 12px var(--ui); }
.appearance-tab:hover, .appearance-tab[aria-selected="true"] { color: var(--gold-bright); }
.appearance-tab[aria-selected="true"] { border-bottom-color: var(--gold); }
.profile-copy .sources-heading { padding-top: 15px; border-top: 1px solid var(--rule); font: 10px var(--ui); letter-spacing: .15em; text-transform: uppercase; color: var(--gold); margin: 32px 0 8px; }
.profile-copy .source-list { font: 12px/1.8 var(--ui); color: var(--faint); margin: 0; }
.profile-copy .source-line { font: 12px/1.6 var(--ui); margin: 0 0 10px; }
.profile-copy .story-link { font: 12px/1.6 var(--ui); margin-top: 20px; }
.profile-copy .story-link a { border-bottom: 0; }
.profile-copy .story-link a::after { content: " ↗"; }

.search-section { margin: 35px 0 50px; max-width: 920px; }
.search-section h2 { font: 400 26px var(--display); margin: 0 0 14px; }
.search-jump { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 12px; color: var(--gold-bright); font: 12px/1.6 var(--ui); }
.search-jump a:hover { text-decoration: underline; text-underline-offset: .2em; }
.result-row mark { color: inherit; background: rgba(209,185,130,.23); border-radius: 2px; }
.result-row { align-items: flex-start; }
.result-title { display: block; font: 20px/1.25 var(--display); }
.result-detail { display: block; color: var(--muted); font: 13px/1.6 var(--body); margin-top: 5px; }
.section-contents { margin: -12px 0 30px; color: var(--muted); font: 12px/1.55 var(--ui); }
.section-contents summary { display: inline-block; color: var(--gold); cursor: pointer; padding: 6px 0; }
.section-contents summary::before { content: "+"; display: inline-block; width: 16px; }
.section-contents[open] summary::before { content: "−"; }
.section-contents ul { list-style: none; margin: 5px 0 0; padding: 0 0 0 15px; border-left: 1px solid var(--rule); }
.section-contents li { margin: 7px 0; }
.section-contents li.nested { margin-left: 15px; }
.section-contents a:hover { color: var(--gold-bright); }


@media (max-width: 950px) {
  .header-inner { gap: 28px; padding-inline: 28px; }
  .header-tools { gap: 15px; }
  .header-search { width: 150px; }
  .wrap, .page-shell, .profile-shell { width: min(100% - 56px, 1320px); }
  .reader-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 38px; }
}
@media (max-width: 800px) {
  .constellation { width: min(100%, 520px); height: auto; margin: 30px auto 60px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .leyline-field { overflow: clip; }
  .constellation-orbit { display: none; }
  .constellation-center { position: static; transform: none; grid-column: 1 / -1; width: auto; margin: 0 0 24px; }
  .constellation-center img, .constellation-center .lore-book-art { width: min(230px, 64%); }
  .constellation-book { position: static; transform: none; width: auto; min-width: 0; min-height: 178px; }
  .constellation-art { width: min(100%, 150px); }
}
@media (max-width: 700px) {
  .site-header { position: relative; }
  .header-inner { padding: 13px 20px 10px; min-height: 0; display: grid; grid-template-columns: 1fr auto; gap: 13px 14px; }
  .brand img { width: 38px; height: 33px; }
  .main-nav { grid-row: 2; grid-column: 1; gap: 25px; height: 28px; }
  .main-nav a.active::after { bottom: -10px; }
  .header-tools { grid-column: 2; grid-row: 1 / 3; align-items: center; }
  .header-search { width: 132px; }
  .wrap, .page-shell, .profile-shell { width: calc(100% - 40px); }
  .page-shell, .profile-shell { padding: 40px 0 80px; }
  .reader-layout { display: block; }
  .overview-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; align-items: center; }
  .overview-heading-text { display: contents; }
  .overview-book-label { grid-column: 1; grid-row: 1; margin: 0; }
  .overview-heading .book-emblem { grid-column: 2; grid-row: 1; width: 32px; height: 32px; }
  .overview-heading .article-title { grid-column: 1 / -1; grid-row: 2; margin-top: 6px; }
  .overview-intro { margin-top: 12px; }
  .overview-heading ~ .article-rule { margin: 20px 0 24px; }

  .reader-sidebar { display: none; }
  .mobile-contents { display: block; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 12px 0; margin: 0 0 28px; }
  .mobile-contents summary { color: var(--gold); font: 11px var(--ui); cursor: pointer; text-transform: uppercase; letter-spacing: .11em; }
  .mobile-contents ul { list-style: none; padding: 10px 0 0; margin: 0; max-height: 250px; overflow: auto; }
  .mobile-contents a { display: block; padding: 6px 0; color: #c8c5b9; font: 14px/1.5 var(--ui); }
  .mobile-contents a[aria-current="page"] { color: var(--gold-bright); }
  .prose { font-size: 17px; line-height: 1.78; }
  .prose h2 { font-size: 25px; }
  .chapter-links { grid-template-columns: 1fr; }
  .letter-group { grid-template-columns: 45px 1fr; gap: 12px; }
  .letter-group h2 { font-size: 34px; }
  .character-list { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .profile-layout { display: flex; flex-direction: column-reverse; gap: 25px; }
  .profile-gallery { position: static; width: 100%; display: flex; flex-direction: column; align-items: center; }
  .profile-gallery figure { width: 360px; max-width: 100%; }
  .appearance-tabs { width: 360px; max-width: 100%; }
}
@media (max-width: 600px) {
  .prose .dropcap::first-letter { float: none; font: inherit; color: inherit; padding: 0; text-shadow: none; }
}
@media (max-width: 430px) {
  .book-emblem { width: 44px; height: 44px; }
}
@media (max-width: 360px) {
  .header-inner { grid-template-columns: minmax(0, 1fr) 132px; }
  .brand { grid-column: 1 / -1; }
  .main-nav { grid-row: 2; grid-column: 1; }
  .header-tools { grid-row: 2; grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .constellation-center img, .constellation-art, .constellation-orbit::before, .constellation-orbit::after,
  .emblem-part, .emblem-visual::before, .emblem-visual::after { animation: none !important; }
  .leyline-sparkle { animation: none !important; opacity: .38; }
  .leyline-stream { display: none !important; animation: none !important; }
  .lore-book-art .lore-pupil { transition: none !important; }
  .cosmic-rings { transform: rotate(114deg) scale(.82); }
  .organic-motion { inset: 0; width: 100%; height: 100%; }
}
