/* Paranor Library: night-sky fantasy theme. */
:root {
  --bg: #0d0b1a;
  --bg2: #151127;
  --surface: #1b1631;
  --surface2: #241d40;
  --ink: #f1ecff;
  --muted: #b3a9cf;
  --line: #342a58;
  --gold: #ffd77a;
  --gold-deep: #e0a93b;
  --stone: #7fd8ff;
  --c-guardians: #c9a8ff;
  --c-ohmsford: #7fd8ff;
  --c-leah: #ff9d7a;
  --c-elessedil: #8ef0b4;
  --era: #ffd77a;
  --display: "Cinzel", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--sans); overflow-x: hidden; }
img { max-width: 100%; }
a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.15; letter-spacing: .01em; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: .15em 0 .3em; }
h2 { font-size: clamp(1.45rem, 3.4vw, 2rem); margin: 1.6em 0 .5em; }
h3 { font-size: 1.2rem; margin: 1em 0 .3em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px; z-index: 20; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 860px; }
.meta { color: var(--muted); font-size: .88rem; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(13, 11, 26, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: .04em; }
.wordmark span { color: var(--gold); }
.wordmark .mark { width: 24px; height: 24px; fill: rgba(127, 216, 255, .25); stroke: var(--stone); stroke-width: 1.6; filter: drop-shadow(0 0 6px rgba(127, 216, 255, .7)); }
.wordmark.small { font-size: 1.05rem; }
nav#site-nav { display: flex; gap: 4px 22px; flex-wrap: wrap; }
nav#site-nav a { color: var(--muted); text-decoration: none; font-size: .95rem; padding: 6px 0; border-bottom: 2px solid transparent; }
nav#site-nav a:hover, nav#site-nav a[aria-current] { color: var(--ink); border-bottom-color: var(--gold); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 8px; padding: 6px 12px; font: inherit; }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  nav#site-nav { display: none; width: 100%; flex-direction: column; padding: 4px 0 12px; }
  nav#site-nav.open { display: flex; }
}

/* Buttons */
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 6px; }
.btn { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: #22160a; padding: 11px 20px; border-radius: 999px; text-decoration: none; font-weight: 700; border: 0; font-size: 1rem; cursor: pointer; box-shadow: 0 6px 24px -8px rgba(255, 215, 122, .7); transition: transform .15s, box-shadow .15s; }
.btn:hover { color: #22160a; transform: translateY(-2px); box-shadow: 0 10px 30px -8px rgba(255, 215, 122, .9); }
.btn-ghost { background: rgba(255, 255, 255, .04); color: var(--ink); border: 1px solid rgba(255, 255, 255, .25); box-shadow: none; }
.btn-ghost:hover { color: #fff; border-color: var(--gold); box-shadow: none; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .76rem; font-weight: 700; color: var(--era, var(--gold)); margin: 0; }
.eyebrow a { color: inherit; text-decoration: none; }
.lede { font-size: 1.15rem; color: #d9d1f2; max-width: 44em; }
.section-lede { color: var(--muted); margin-top: -.2em; }
.badge { display: inline-block; vertical-align: middle; font-family: var(--sans); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #22160a; background: var(--gold); border-radius: 999px; padding: 2px 9px; }

/* Home hero */
.hero { position: relative; min-height: min(86vh, 640px); display: flex; align-items: flex-start; overflow: hidden; }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-copy { position: relative; padding-top: clamp(48px, 10vh, 110px); padding-bottom: 180px; }
.hero h1 { text-shadow: 0 4px 30px rgba(0, 0, 0, .6); max-width: 15em; }
.hero .stars circle { animation: twinkle 4s ease-in-out infinite; }
.hero .stars circle:nth-child(3n) { animation-delay: 1.3s; }
.hero .stars circle:nth-child(4n) { animation-delay: 2.6s; }
.stone-glow { animation: pulse 3.5s ease-in-out infinite; transform-origin: 721px 288px; }
.hero .far { animation: drift 30s ease-in-out infinite alternate; }
@keyframes twinkle { 50% { opacity: .15; } }
@keyframes pulse { 50% { opacity: .35; transform: scale(1.3); } }
@keyframes drift { to { transform: translateX(-30px); } }

/* Page heroes */
.page-hero { position: relative; padding: 56px 0 40px; background:
  radial-gradient(900px 340px at 15% 0%, color-mix(in srgb, var(--era) 35%, transparent), transparent 70%),
  radial-gradient(600px 300px at 90% 20%, rgba(127, 216, 255, .12), transparent 70%), var(--bg2);
  border-bottom: 1px solid var(--line); }
.page-hero .eyebrow { color: var(--era); }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }

/* Picker */
.picker { padding-top: 24px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 18px; }
.pick { text-align: left; font: inherit; color: var(--ink); cursor: pointer; background: linear-gradient(160deg, color-mix(in srgb, var(--era) 22%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--era) 45%, var(--line)); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px; transition: transform .15s, border-color .15s, box-shadow .15s; }
.pick:hover, .pick[aria-pressed="true"] { transform: translateY(-3px); border-color: var(--era); box-shadow: 0 12px 34px -14px var(--era); }
.pick-label { font-family: var(--display); font-weight: 800; font-size: 1.08rem; }
.pick-desc { color: var(--muted); font-size: .92rem; line-height: 1.45; }
.pick-result { display: grid; grid-template-columns: 180px 1fr; gap: 28px; align-items: start; margin-top: 22px; padding: 24px; border-radius: var(--radius); border: 1px solid var(--era); background: radial-gradient(600px 260px at 0% 0%, color-mix(in srgb, var(--era) 28%, transparent), transparent), var(--surface); }
.pick-result h3 { font-size: 1.7rem; margin: .1em 0; }
.pick-result h3 a { color: var(--ink); text-decoration: none; }
.pick-result[hidden] { display: none; }
.pick-result.appear { animation: appear .45s ease-out; }
@keyframes appear { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (max-width: 600px) { .pick-result { grid-template-columns: 110px 1fr; gap: 16px; padding: 16px; } .pick-result h3 { font-size: 1.3rem; } }

/* Covers */
.cover { display: block; border-radius: 6px; overflow: hidden; background: linear-gradient(160deg, var(--surface2), var(--surface)); box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .06); transition: transform .2s ease, box-shadow .2s; aspect-ratio: 32 / 50; }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover:hover { box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .9), 0 0 0 2px var(--era), 0 0 30px -6px var(--era); }
.cover.small { width: 72px; }
.cover.big { width: 100%; }

/* Shelves */
.ages { padding: 8px 0 24px; }
.shelf { margin: 26px 0 10px; }
.shelf-head { display: flex; align-items: center; gap: 14px; }
.shelf-head h3 { margin: 0; font-size: 1.3rem; }
.shelf-head h3 a { color: var(--ink); text-decoration: none; }
.shelf-head h3 a:hover { color: var(--era); }
.shelf-head .meta { margin: 0; }
.age-num { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; color: #160f22; background: var(--era); box-shadow: 0 0 18px -2px var(--era); }
.shelf-row { display: flex; gap: 18px; overflow-x: auto; padding-top: 14px; padding-bottom: 18px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.shelf-row.wrap-row { flex-wrap: wrap; overflow: visible; }
.tile { position: relative; flex: 0 0 148px; width: 148px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; }
.big-tiles .tile { flex-basis: 180px; width: 180px; }
.tile-title { color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.3; font-size: .95rem; margin-top: 4px; }
.tile-title:hover { color: var(--era); }
.tile-meta { color: var(--muted); font-size: .78rem; line-height: 1.3; }
.tile-num { position: absolute; z-index: 2; top: -10px; left: -8px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: .85rem; background: var(--era); color: #160f22; box-shadow: 0 4px 10px rgba(0, 0, 0, .5); }
.tile .read-toggle { align-self: flex-start; }
.tile.is-read .cover { box-shadow: 0 0 0 2px var(--gold), 0 14px 30px -12px rgba(0, 0, 0, .9); }
@media (max-width: 600px) { .tile { flex-basis: 118px; width: 118px; } .big-tiles .tile { flex-basis: 140px; width: 140px; } }

/* Read toggle */
.read-toggle { font: inherit; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px 3px 9px; }
.read-toggle::before { content: "\25CB"; margin-right: 5px; }
.read-toggle[aria-pressed="true"] { color: #22160a; background: var(--gold); border-color: var(--gold); }
.read-toggle[aria-pressed="true"]::before { content: "\2713"; }
.read-toggle.big { font-size: .95rem; padding: 10px 18px; }
.read-toggle.pop { animation: pop .4s ease-out; }
@keyframes pop { 40% { transform: scale(1.18); box-shadow: 0 0 24px var(--gold); } }

/* Teaser + about */
.teaser { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center; margin-top: 40px; padding: 28px; border-radius: var(--radius); background: radial-gradient(500px 240px at 100% 50%, rgba(127, 216, 255, .14), transparent), var(--surface); border: 1px solid var(--line); }
.teaser h2 { margin-top: 0; }
.teaser-art { width: 100%; max-width: 340px; justify-self: center; }
@media (max-width: 700px) { .teaser { grid-template-columns: 1fr; } }
.about { margin: 40px auto 56px; padding: 6px 28px 18px; border-left: 4px solid var(--gold); border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface); max-width: 860px; }
.about h2 { margin-top: .8em; }

/* Reading order */
.callout { margin: 28px 0; padding: 4px 24px 10px; border-radius: var(--radius); background: linear-gradient(150deg, rgba(255, 215, 122, .12), transparent 60%), var(--surface); border: 1px solid rgba(255, 215, 122, .35); }
.callout h2 { font-size: 1.3rem; margin-top: .9em; }
.progress-box { position: sticky; top: 68px; z-index: 5; margin: 20px 0; padding: 14px 18px; border-radius: var(--radius); background: rgba(27, 22, 49, .94); border: 1px solid var(--line); backdrop-filter: blur(8px); }
.progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rank { font-family: var(--display); font-weight: 800; color: var(--gold); font-size: 1.1rem; }
.count { color: var(--muted); font-size: .9rem; }
.bar { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--stone), var(--gold)); border-radius: 999px; transition: width .4s ease; box-shadow: 0 0 12px var(--gold); }
.progress-box .meta { margin: 0; }
.toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.toggle a { padding: 8px 18px; text-decoration: none; color: var(--muted); }
.toggle a[aria-current] { background: var(--gold); color: #22160a; font-weight: 700; }
.order-list { list-style: none; padding: 0; margin: 18px 0; }
.order-era { margin: 28px 0 6px; font-family: var(--display); font-weight: 800; font-size: 1.15rem; padding-left: 14px; border-left: 4px solid var(--era); }
.order-era a { color: var(--era); text-decoration: none; }
.order-era span { font-family: var(--sans); font-weight: 400; font-size: .82rem; color: var(--muted); margin-left: 6px; }
.order-item { display: grid; grid-template-columns: 34px 72px 1fr auto; gap: 14px; align-items: start; padding: 14px; margin: 8px 0; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: border-color .2s; }
.order-item:hover { border-color: var(--era); }
.order-item.is-read { background: linear-gradient(90deg, rgba(255, 215, 122, .09), var(--surface) 40%); }
.order-num { font-family: var(--display); font-weight: 800; font-size: 1.3rem; color: var(--era); text-align: center; padding-top: 4px; }
.order-body h3 { margin: 0 0 2px; font-size: 1.1rem; }
.order-body h3 a { color: var(--ink); text-decoration: none; }
.order-body h3 a:hover { color: var(--era); }
.order-body .meta { margin: 0 0 6px; }
.order-body .blurb { margin: 0; font-size: .94rem; color: #d3cbea; }
.ad-row { list-style: none; }
@media (max-width: 600px) {
  .order-item { grid-template-columns: 60px 1fr; gap: 12px; }
  .order-num { display: none; }
  .order-item .cover.small { width: 60px; }
  .order-item .read-toggle { grid-column: 2; justify-self: start; }
  .order-body .blurb { font-size: .9rem; }
}

/* Book page */
.book-hero { position: relative; padding: 36px 0 44px; background:
  radial-gradient(800px 420px at 20% 40%, color-mix(in srgb, var(--era) 40%, transparent), transparent 70%), var(--bg2);
  border-bottom: 1px solid var(--line); overflow: hidden; }
.book-hero-grid { display: grid; grid-template-columns: 280px 1fr; gap: 44px; align-items: center; }
.hero-cover { width: 100%; transform: perspective(900px) rotateY(-8deg); box-shadow: 30px 30px 60px -20px rgba(0, 0, 0, .9), 0 0 60px -10px var(--era); }
.byline { color: var(--muted); margin: 0 0 10px; }
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.stat { background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 12px; padding: 8px 16px; display: flex; flex-direction: column; }
.stat-num { font-family: var(--display); font-weight: 800; font-size: 1.4rem; color: var(--era); line-height: 1.2; }
.stat .meta { font-size: .78rem; }
@media (max-width: 760px) {
  .book-hero-grid { grid-template-columns: 1fr; gap: 20px; }
  .book-cover-wrap { width: 170px; }
}
.nav-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 18px 0; }
.nav-card { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-left: 3px solid var(--era); border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.nav-card:hover { border-color: var(--gold); transform: translateY(-2px); color: var(--ink); }
.nav-card img { width: 46px; height: 72px; object-fit: cover; border-radius: 4px; flex: 0 0 auto; }
.nav-card > span { display: flex; flex-direction: column; }
.nav-card.empty { flex-direction: column; align-items: flex-start; color: var(--muted); font-size: .9rem; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.person-chip { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid currentColor; text-decoration: none; transition: transform .15s; }
.person-chip:hover { transform: translateY(-2px); }
.person-chip strong { color: var(--ink); font-family: var(--display); }
.person-chip span { color: var(--muted); font-size: .88rem; line-height: 1.4; }

/* Era page */
.era-nav { display: flex; justify-content: space-between; gap: 12px; margin: 36px 0 56px; flex-wrap: wrap; }
.era-nav-link { flex: 1 1 240px; display: flex; flex-direction: column; padding: 16px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--era); text-decoration: none; color: var(--ink); }
.era-nav-link.next { text-align: right; border-left: 1px solid var(--line); border-right: 4px solid var(--era); }
.era-nav-link strong { font-family: var(--display); font-size: 1.15rem; }
.era-nav-link:hover { color: var(--ink); background: var(--surface2); }

/* Books index */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 8px; }
.chip { font: inherit; font-size: .86rem; cursor: pointer; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; }
.chip[aria-pressed="true"] { background: var(--era, var(--gold)); border-color: var(--era, var(--gold)); color: #160f22; font-weight: 700; }
.library { gap: 26px 20px; margin-bottom: 48px; }
.lib-item[hidden] { display: none; }

/* Timeline road */
.road-list { list-style: none; padding: 30px 0 20px; margin: 0; position: relative; }
.road-list::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 4px; margin-left: -2px; border-radius: 2px; background: linear-gradient(180deg, #7a5cff, #d0563b, #3f9e7b, #c9963b, #3b8fd0, #8f5bd0, #2fb3c2, #5b7bd0, #c23b6a, #9aa83b, #e0763b); opacity: .55; }
.road-stop { position: relative; display: flex; margin: 26px 0; }
.road-stop.left { justify-content: flex-start; }
.road-stop.right { justify-content: flex-end; }
.road-card { width: calc(50% - 46px); padding: 20px 22px; border-radius: var(--radius); background: radial-gradient(400px 200px at 0 0, color-mix(in srgb, var(--era) 22%, transparent), transparent), var(--surface); border: 1px solid color-mix(in srgb, var(--era) 50%, var(--line)); }
.road-card h2 { margin: .2em 0 .3em; font-size: 1.45rem; }
.road-card h2 a { color: var(--ink); text-decoration: none; }
.road-card h2 a:hover { color: var(--era); }
.road-card p { margin: 0 0 12px; }
.road-dot { position: absolute; left: 50%; top: 26px; width: 44px; height: 44px; margin-left: -22px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; background: var(--era); color: #160f22; box-shadow: 0 0 0 6px var(--bg), 0 0 26px var(--era); z-index: 1; }
.road-gap { position: relative; text-align: center; margin: 8px 0; }
.road-gap span { position: relative; display: inline-block; background: var(--bg); color: var(--gold); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 12px; border: 1px dashed rgba(255, 215, 122, .5); border-radius: 999px; }
.road-ad { list-style: none; }
.fan { display: flex; height: 150px; margin: 8px 0 10px; padding-left: 10px; }
.fan-book { width: 96px; flex: 0 0 auto; margin-left: -26px; transform: rotate(calc((var(--n) - (var(--count) - 1) / 2) * 6deg)); transform-origin: bottom center; transition: transform .25s, margin .25s; }
.fan-book:first-child { margin-left: 0; }
.fan-book img { width: 96px; height: 150px; object-fit: cover; border-radius: 5px; box-shadow: 0 10px 20px -6px rgba(0, 0, 0, .9); background: var(--surface2); }
.fan:hover .fan-book { margin-left: 6px; transform: none; }
.fan:hover .fan-book:first-child { margin-left: 0; }
.fan-book:hover { transform: translateY(-8px) !important; }
.more { font-weight: 700; text-decoration: none; }
.fan-titles { margin: 0 0 10px !important; }
.fan-titles a { color: var(--muted); }
.fan-titles a:hover { color: var(--ink); }
@media (max-width: 760px) {
  .road-list::before { left: 22px; }
  .road-stop, .road-stop.right { justify-content: flex-end; }
  .road-dot { left: 22px; }
  .road-card { width: calc(100% - 58px); }
  .road-gap { text-align: left; padding-left: 58px; }
  .fan-book, .fan-book img { width: 78px; }
  .fan-book img { height: 122px; }
  .fan { height: 124px; }
}

/* Bloodlines */
.bloodlines { padding: 20px 0 56px; margin-top: 30px; border-top: 1px solid var(--line); background: radial-gradient(900px 400px at 50% 0%, rgba(127, 216, 255, .08), transparent); }
.legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--muted); font-size: .86rem; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend .link { opacity: 1; }
.tree-scroll { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg2); }
.tree { position: relative; display: grid; grid-template-columns: 150px repeat(var(--cols), minmax(160px, 1fr)); min-width: 800px; }
.tree-links { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 1; }
.tree-head { position: sticky; top: 0; font-family: var(--display); font-weight: 800; padding: 14px 8px; text-align: center; border-bottom: 2px solid var(--line); background: var(--bg2); z-index: 3; }
.tree-era { font-size: .8rem; padding: 10px; border-bottom: 1px solid var(--line); display: flex; align-items: center; border-left: 3px solid var(--era); }
.tree-era a { color: var(--muted); text-decoration: none; }
.tree-era a:hover { color: var(--ink); }
.tree-cell { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; align-content: center; padding: 14px 8px; border-bottom: 1px solid var(--line); min-height: 60px; position: relative; }
.tree-cell::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: currentColor; opacity: .14; }
.line-guardians { color: var(--c-guardians); }
.line-ohmsford { color: var(--c-ohmsford); }
.line-leah { color: var(--c-leah); }
.line-elessedil { color: var(--c-elessedil); }
.person { position: relative; z-index: 2; font: inherit; font-size: .84rem; line-height: 1.2; color: var(--ink); background: var(--surface); border: 1.5px solid currentColor; border-radius: 999px; padding: 6px 11px; cursor: pointer; transition: background .15s, box-shadow .15s, transform .15s; }
.tree-cell .person { border-color: currentColor; color: var(--ink); }
.tree-cell.line-guardians .person { border-color: var(--c-guardians); }
.tree-cell.line-ohmsford .person { border-color: var(--c-ohmsford); }
.tree-cell.line-leah .person { border-color: var(--c-leah); }
.tree-cell.line-elessedil .person { border-color: var(--c-elessedil); }
.person:hover { transform: translateY(-1px); background: var(--surface2); }
.person.is-related { box-shadow: 0 0 0 2px var(--gold), 0 0 16px -2px var(--gold); }
.person.is-selected { background: var(--gold); color: #22160a; box-shadow: 0 0 0 3px var(--gold), 0 0 24px var(--gold); }
.link { fill: none; stroke: #8f86b3; stroke-width: 1.8; opacity: .6; }
.link-skip, .link-same { stroke-dasharray: 7 6; }
.link-successor { stroke-dasharray: 1.5 6; stroke-linecap: round; stroke-width: 2.6; stroke: var(--c-guardians); }
.link-sibling { stroke-dasharray: 2 4; opacity: .45; }
.link.is-active { stroke: var(--gold); opacity: 1; stroke-width: 3; filter: drop-shadow(0 0 4px rgba(255, 215, 122, .8)); }
.person-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 0 var(--radius) var(--radius) 0; padding: 6px 22px 14px; min-height: 86px; }
.person-card h3 { margin-top: .7em; font-size: 1.4rem; }
.person-card h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 1em 0 .3em; }
.person-card ul { padding-left: 18px; margin: 0; }
.person-link { all: unset; cursor: pointer; color: var(--gold); text-decoration: underline; }
.hint { color: var(--muted); }

/* Prose pages */
.prose { padding: 10px 16px 56px; }
.prose h2 { font-size: 1.3rem; }

/* Ads: empty until switched on, so they take no room. */
.ad-slot:empty { display: none; }

/* Scroll reveal (only when JS adds .js-reveal) */
.js-reveal .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js-reveal .reveal.in { opacity: 1; transform: none; }

/* Footer */
.site-footer { margin-top: 20px; border-top: 1px solid var(--line); background: #0a0814; color: var(--muted); font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 1.3fr .8fr 1.4fr; gap: 28px; padding-top: 34px; padding-bottom: 10px; }
.footer-grid h2 { font-family: var(--sans); font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; color: var(--ink); margin: .4em 0 .6em; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 4px 0; }
.footer-grid a { color: var(--muted); text-decoration: none; }
.footer-grid a:hover { color: var(--gold); }
.footer-grid ul.cols { columns: 2; column-gap: 20px; }
.legal { border-top: 1px solid var(--line); padding-top: 14px; padding-bottom: 28px; font-size: .82rem; }
.legal p { max-width: 70em; margin: .4em 0; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 10px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Wide screens: move the keep out from behind the headline. */
@media (min-width: 900px) {
  .hero .keep, .hero .stone-glow-wrap { transform: translateX(360px); }
}
