@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #0b101b;
  --bg-deep: #090d17;
  --panel: #141927;
  --panel-glass: rgba(15, 19, 32, .92);
  --text: #f3eade;
  --body-text: #d2c9c1;
  --soft-text: #a69d9d;
  --muted: #777989;
  --line: rgba(203, 171, 137, .17);
  --line-strong: rgba(216, 177, 139, .35);
  --gold: #d7b18d;
  --red: #d5796b;
  --outline: #f2ba91;
  --reading-scale: 1;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3ece1;
  --bg-deep: #ece3d7;
  --panel: #fff9f0;
  --panel-glass: rgba(249, 242, 232, .95);
  --text: #24212a;
  --body-text: #3f3840;
  --soft-text: #716470;
  --muted: #837b7b;
  --line: rgba(80, 59, 51, .16);
  --line-strong: rgba(94, 64, 53, .32);
  --gold: #9a6141;
  --red: #a44942;
  --outline: #9a6141;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body { margin: 0; min-width: 320px; color: var(--text); background: var(--bg); font-family: var(--sans); -webkit-font-smoothing: antialiased; transition: color .2s, background-color .2s; }
body::before { content: ''; position: absolute; top: 64px; left: 0; width: 100%; height: 860px; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 76% 24%, rgba(128, 62, 62, .10), transparent 44%), radial-gradient(ellipse at 28% 10%, rgba(151, 120, 89, .05), transparent 38%); }
html[data-theme="light"] body::before { background: radial-gradient(ellipse at 76% 24%, rgba(160, 87, 59, .11), transparent 44%); }
::selection { background: #ab6759; color: #fff; }
a { color: inherit; }
a:focus-visible, button:focus-visible, select:focus-visible { outline: 3px solid var(--outline); outline-offset: 4px; }
button, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: -120px; left: 15px; z-index: 200; background: var(--panel); color: var(--text); padding: 14px 18px; }
.skip-link:focus { top: 10px; }
.reading-progress { position: fixed; z-index: 110; top: 0; left: 0; right: 0; height: 3px; background: transparent; }
.reading-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8f453d, #e4b68c); transition: width .08s linear; }

.site-header { height: 83px; padding: 0 max(5vw, calc((100vw - 1500px) / 2)); position: relative; z-index: 20; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: var(--bg); }
.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; color: var(--gold); border: 1px solid var(--line-strong); border-radius: 50%; width: 39px; height: 39px; font-family: var(--serif); font-size: 26px; }
.brand-copy { display: flex; flex-direction: column; gap: 4px; }
.brand-copy strong { font-size: 15px; letter-spacing: .22em; font-weight: 700; }
.brand-copy small { font-size: 8px; color: var(--soft-text); letter-spacing: .19em; }
.header-actions { display: flex; align-items: center; gap: 7px; }
.header-volume { color: var(--soft-text); font-size: 10px; letter-spacing: .17em; margin-right: 24px; }
.header-volume span { color: var(--gold); padding: 0 7px; }
.icon-button { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--body-text); font-size: 13px; transition: background .2s, border-color .2s; }
.icon-button:hover { background: var(--panel); border-color: var(--line-strong); }
.theme-button { font-size: 24px; margin-left: 6px; color: var(--gold); }

.hero { max-width: 1500px; margin: 0 auto; min-height: 702px; padding: 83px 5% 80px; display: grid; grid-template-columns: 1.02fr .93fr; gap: clamp(40px, 7vw, 115px); align-items: center; position: relative; }
.hero-copy { align-self: center; max-width: 590px; }
.eyebrow { display: flex; align-items: center; gap: 13px; color: var(--gold); font-size: 10px; font-weight: 600; letter-spacing: .24em; margin: 0 0 45px; }
.eyebrow-line { width: 29px; height: 1px; background: var(--gold); }
.hero-prelude { color: var(--soft-text); font-size: 11px; letter-spacing: .19em; margin: 0 0 9px; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: var(--serif); }
.hero h1 { font-size: clamp(74px, 8.5vw, 132px); letter-spacing: -.06em; line-height: .83; font-weight: 500; margin: 0 0 35px -7px; }
.hero h1 em { display: block; margin-top: 9px; color: var(--red); font-weight: 500; }
.hero-subtitle { max-width: 475px; color: var(--soft-text); font-size: 15px; line-height: 1.95; margin: 0 0 32px; }
.hero-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--soft-text); font-size: 11px; letter-spacing: .025em; }
.hero-meta b { font-weight: 700; color: var(--gold); margin-right: 4px; }
.meta-divider { display: block; height: 14px; width: 1px; background: var(--line-strong); }
.hero-links { margin-top: 43px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.primary-button { display: inline-flex; justify-content: space-between; align-items: center; gap: 32px; min-height: 55px; padding: 0 22px; color: #1a1821; font-size: 12px; font-weight: 700; text-decoration: none; letter-spacing: .035em; background: #deb58f; transition: transform .2s, background .2s; }
.primary-button:hover { background: #f0c9a5; transform: translateY(-2px); }
.primary-button span { font-size: 19px; font-weight: 400; }
.secondary-button { color: var(--body-text); font-size: 12px; text-decoration: none; padding: 13px 0; border-bottom: 1px solid var(--line-strong); }
.secondary-button span { margin-left: 12px; color: var(--gold); }
.secondary-button:hover { color: var(--gold); }
.resume-link { display: inline-block; color: var(--gold); font-size: 12px; margin-top: 18px; text-underline-offset: 4px; }
.hero-art { position: relative; height: 590px; isolation: isolate; border: 1px solid var(--line-strong); padding: 10px; background: rgba(154, 120, 94, .035); box-shadow: 0 24px 90px rgba(0, 0, 0, .16); }
.hero-art::before, .hero-art::after { content: ''; position: absolute; width: 22px; height: 22px; border-color: var(--gold); opacity: .8; pointer-events: none; }
.hero-art::before { top: -5px; left: -5px; border-top: 1px solid; border-left: 1px solid; }
.hero-art::after { bottom: -5px; right: -5px; border-bottom: 1px solid; border-right: 1px solid; }
.canyon-illustration { display: block; width: 100%; height: 100%; object-fit: cover; }
.art-label { position: absolute; bottom: 29px; left: 30px; right: 30px; padding: 15px 17px; display: flex; align-items: center; gap: 12px; background: rgba(13, 18, 30, .83); border: 1px solid rgba(245, 218, 184, .19); backdrop-filter: blur(9px); color: #f9e9da; }
.art-label-symbol { color: #e3b48d; font-size: 25px; }
.art-label span:last-child { display: flex; flex-direction: column; gap: 5px; }
.art-label small { font-size: 9px; color: #d0ad8a; letter-spacing: .16em; }
.art-label strong { font-family: var(--serif); font-size: 21px; font-weight: 500; }
.hero-index { position: absolute; right: 5%; bottom: 35px; color: var(--muted); letter-spacing: .18em; font-size: 10px; }
.section-divider { height: 68px; display: flex; align-items: center; justify-content: center; gap: 22px; color: var(--gold); opacity: .7; }
.section-divider::before, .section-divider::after { content: ''; height: 1px; background: var(--line); width: min(43%, 520px); }
.section-divider span { font-size: 15px; }

.reading-layout { max-width: 1500px; margin: 0 auto; padding: 68px 5% 0; display: grid; grid-template-columns: 255px minmax(0, 1fr); gap: clamp(60px, 8vw, 140px); align-items: start; }
.sidebar { align-self: stretch; border-right: 1px solid var(--line); }
.sidebar-inner { position: sticky; top: 32px; padding: 14px 22px 35px 0; }
.sidebar-kicker { font-size: 10px; letter-spacing: .23em; color: var(--gold); margin: 0 0 11px; }
.sidebar h2 { font-size: 39px; letter-spacing: -.025em; font-weight: 500; line-height: 1; margin: 0 0 39px; }
.toc { display: flex; flex-direction: column; gap: 8px; }
.toc-link { position: relative; display: flex; gap: 15px; align-items: flex-start; border: 1px solid transparent; border-left: 2px solid transparent; text-decoration: none; padding: 13px 12px 13px 10px; color: var(--soft-text); transition: all .2s; }
.toc-link:hover { background: var(--panel); color: var(--text); }
.toc-link.is-active { border-left-color: var(--red); background: var(--panel); color: var(--text); }
.toc-number { color: var(--gold); font-size: 10px; line-height: 1.8; font-weight: 700; letter-spacing: .08em; }
.toc-text { display: flex; flex-direction: column; gap: 7px; }
.toc-text strong { font-size: 12px; font-weight: 600; line-height: 1.55; }
.toc-text small { font-size: 10px; color: var(--muted); }
.sidebar-bottom { margin-top: 65px; padding: 0 8px 0 4px; }
.sidebar-rule { display: block; width: 29px; height: 1px; background: var(--gold); margin-bottom: 26px; }
.sidebar-bottom p { font-family: var(--serif); font-size: 22px; line-height: 1.3; font-style: italic; color: var(--soft-text); margin: 0 0 18px; }
.sidebar-bottom small { display: block; font-size: 9px; color: var(--muted); letter-spacing: .13em; }
.chapters-wrapper { min-width: 0; max-width: 810px; padding-bottom: 80px; }
.mobile-chapter-nav { display: none; }
.chapter { scroll-margin-top: 70px; }
.chapter-header { margin: 0 0 39px; }
.chapter-overline { display: flex; align-items: center; gap: 15px; color: var(--gold); letter-spacing: .17em; font-size: 10px; font-weight: 600; margin: 0 0 19px; }
.overline-rule { display: block; width: 24px; height: 1px; background: var(--line-strong); }
.chapter h2 { font-family: var(--serif); font-size: clamp(58px, 6.4vw, 92px); line-height: .98; letter-spacing: -.045em; font-weight: 500; max-width: 770px; margin: 0 0 23px; }
.chapter h2 em { color: var(--red); font-weight: 500; }
.chapter-deck { max-width: 610px; font-family: var(--serif); font-style: italic; font-size: 25px; line-height: 1.45; color: var(--soft-text); margin: 0; }
.chapter-ornament { color: var(--gold); font-size: 19px; margin-top: 26px; }
.chapter-body { max-width: 710px; font-family: var(--serif); font-size: calc(24px * var(--reading-scale)); line-height: 1.62; color: var(--body-text); }
.chapter-body p { margin: 0 0 25px; hyphens: auto; text-wrap: pretty; }
.chapter-body .dropcap::first-letter { float: left; font-size: calc(77px * var(--reading-scale)); line-height: .77; padding: 13px 9px 0 0; color: var(--gold); font-weight: 600; }
.chapter-body .dialogue { border-left: 2px solid var(--line-strong); padding-left: 22px; margin-left: 14px; color: var(--text); font-style: italic; }
.chapter-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px; border-top: 1px solid var(--line); margin-top: 53px; padding-top: 28px; font-family: var(--sans); }
.chapter-footer > span { font-size: 10px; color: var(--muted); letter-spacing: .17em; }
.chapter-footer a { text-decoration: none; color: var(--gold); font-size: 12px; font-weight: 600; }
.chapter-footer a:hover, .endmatter a:hover { text-decoration: underline; text-underline-offset: 5px; }
.chapter-footer a span { margin: 0 5px; }
.chapter-separator { display: flex; align-items: center; justify-content: center; gap: 26px; margin: 109px 0 125px; color: var(--gold); opacity: .65; }
.chapter-separator::before, .chapter-separator::after { content: ''; display: block; width: 100%; max-width: 150px; height: 1px; background: var(--line-strong); }
.chapter-separator span:nth-child(2) { font-size: 23px; }
.endmatter { padding: 122px 0 36px; text-align: center; }
.endmatter > span { display: block; font-size: 32px; color: var(--gold); }
.endmatter p { color: var(--gold); font-size: 11px; letter-spacing: .25em; margin: 20px 0; }
.endmatter h2 { font-size: clamp(42px, 5vw, 75px); line-height: 1; letter-spacing: -.04em; font-weight: 500; margin: 0 0 30px; }
.endmatter a { font-size: 12px; color: var(--soft-text); text-decoration: none; }
.site-footer { max-width: 1500px; padding: 25px 5% 37px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; letter-spacing: .16em; }

@media (min-width: 1550px) { .site-header { padding-left: calc((100vw - 1350px) / 2); padding-right: calc((100vw - 1350px) / 2); } }
@media (max-width: 1050px) {
  .hero { min-height: 620px; gap: 36px; }
  .hero h1 { font-size: clamp(66px, 8vw, 90px); }
  .hero-art { height: 500px; }
  .reading-layout { gap: 42px; grid-template-columns: 215px minmax(0, 1fr); }
}
@media (max-width: 780px) {
  html { scroll-padding-top: 30px; }
  .site-header { padding: 0 5%; height: 70px; }
  .brand-copy strong { font-size: 12px; }
  .brand-copy small { font-size: 7px; }
  .header-volume { display: none; }
  .icon-button { width: 34px; height: 34px; }
  .hero { padding: 60px 6% 60px; display: flex; flex-direction: column; gap: 46px; align-items: stretch; }
  .hero-copy { align-self: stretch; max-width: none; }
  .hero h1 { font-size: clamp(70px, 12.4vw, 110px); }
  .eyebrow { margin-bottom: 30px; }
  .hero-art { width: min(100%, 600px); height: 430px; align-self: center; }
  .hero-index { bottom: 16px; }
  .section-divider { height: 45px; }
  .reading-layout { display: block; padding: 46px 6% 0; }
  .sidebar { display: none; }
  .chapters-wrapper { margin: 0 auto; }
  .mobile-chapter-nav { display: flex; flex-direction: column; gap: 11px; margin-bottom: 62px; }
  .mobile-chapter-nav label { font-size: 10px; letter-spacing: .17em; color: var(--gold); text-transform: uppercase; }
  .mobile-chapter-nav select { width: 100%; background: var(--panel); border: 1px solid var(--line-strong); color: var(--text); border-radius: 2px; padding: 13px; }
  .chapter h2 { font-size: clamp(57px, 10vw, 83px); }
  .chapter-body { font-size: calc(22px * var(--reading-scale)); }
  .chapter-deck { font-size: 23px; }
  .chapter-separator { margin: 84px 0 94px; }
}
@media (max-width: 480px) {
  .site-header { padding: 0 4%; }
  .brand-mark { height: 32px; width: 32px; font-size: 20px; }
  .brand { gap: 8px; }
  .brand-copy strong { font-size: 11px; letter-spacing: .13em; }
  .brand-copy small { font-size: 6px; letter-spacing: .07em; }
  .header-actions { gap: 4px; }
  .font-control { width: 30px; }
  .theme-button { width: 30px; margin-left: 1px; }
  .hero { padding-top: 48px; }
  .hero h1 { font-size: clamp(65px, 14vw, 85px); }
  .hero-prelude { font-size: 9px; }
  .hero-subtitle { font-size: 14px; }
  .hero-meta { gap: 10px; font-size: 10px; }
  .hero-links { gap: 16px; }
  .hero-art { height: 360px; }
  .art-label { bottom: 21px; left: 20px; right: 20px; }
  .chapter-overline { font-size: 8px; letter-spacing: .1em; }
  .chapter h2 { font-size: clamp(53px, 12vw, 72px); }
  .chapter-deck { font-size: 22px; }
  .chapter-body { font-size: calc(21px * var(--reading-scale)); line-height: 1.57; }
  .chapter-body p { margin-bottom: 22px; }
  .chapter-body .dropcap::first-letter { font-size: calc(66px * var(--reading-scale)); }
  .chapter-footer { gap: 12px; }
  .chapter-footer > span { width: 100%; order: -1; }
  .site-footer { padding-left: 6%; padding-right: 6%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media print {
  :root { --bg: #fff; --text: #222; --body-text: #222; --soft-text: #555; --line: #aaa; --gold: #734f35; --red: #873d35; }
  body { background: white; }
  .site-header, .reading-progress, .hero, .section-divider, .sidebar, .mobile-chapter-nav, .chapter-footer, .chapter-separator, .endmatter, .site-footer { display: none !important; }
  .reading-layout { display: block; padding: 0; }
  .chapters-wrapper { max-width: unset; padding: 0; }
  .chapter { break-before: page; }
  .chapter:first-of-type { break-before: auto; }
  .chapter-header { break-after: avoid; }
  .chapter-body { max-width: none; font-size: 13pt; line-height: 1.45; }
  .chapter-body p { orphans: 3; widows: 3; }
  .chapter h2 { font-size: 42pt; }
}

/* ------------------------------------------------------------
   Navigation commune et Codex des personnages
   ------------------------------------------------------------ */
.site-nav { display: flex; align-items: center; gap: clamp(12px, 2vw, 30px); margin-left: auto; margin-right: clamp(12px, 3vw, 38px); }
.site-nav a { color: var(--soft-text); font-size: 11px; letter-spacing: .045em; text-decoration: none; padding: 12px 0; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; white-space: nowrap; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--gold); border-color: var(--gold); }
.endmatter a.endmatter-codex { display: block; width: max-content; margin: 17px auto 0; color: var(--gold); }

.glossary-page .codex-hero { overflow: hidden; position: relative; isolation: isolate; border-bottom: 1px solid var(--line); background: radial-gradient(ellipse at 78% 48%, rgba(146,76,68,.10), transparent 40%); }
.glossary-page .codex-hero-inner { position: relative; z-index: 2; width: min(1450px, 90%); margin: 0 auto; padding: 93px 0 95px; }
.glossary-page .codex-hero .eyebrow { margin-bottom: 31px; }
.codex-surtitle { color: var(--muted); font-size: 11px; letter-spacing: .22em; font-weight: 600; margin: 0 0 15px; }
.codex-surtitle span { color: var(--red); padding: 0 9px; }
.codex-hero h1 { max-width: 720px; font-size: clamp(66px, 7.3vw, 116px); font-weight: 500; line-height: .90; letter-spacing: -.057em; margin: 0 0 31px; }
.codex-hero h1 em { display: block; color: var(--red); font-weight: 500; }
.codex-lead { max-width: 585px; font-size: 15px; line-height: 1.94; color: var(--soft-text); margin: 0 0 35px; }
.codex-metrics { display: flex; flex-wrap: wrap; gap: 27px; color: var(--soft-text); font-size: 11px; }
.codex-metrics b { color: var(--gold); font-size: 19px; font-family: var(--serif); font-weight: 600; margin-right: 5px; }
.codex-hero-art { position: absolute; right: max(-120px,calc((100vw - 1600px) / 2)); top: -6px; width: min(60vw, 765px); aspect-ratio: 1; z-index: 0; opacity: .82; pointer-events: none; }
.codex-hero-art::before { content: ''; position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(circle at center, rgba(215,125,92,.22) 0%,rgba(164,69,66,.06) 32%,transparent 69%); }
.orbit { position: absolute; inset: 16%; border: 1px solid rgba(215,177,141,.20); border-radius: 50%; transform: rotate(-24deg) scaleX(.80); }
.orbit-two { inset: 4%; transform: rotate(37deg) scaleX(.85); border-color: rgba(215,177,141,.11); }
.orbit-one::before, .orbit-two::before { content: ''; position: absolute; top: 17%; left: 13%; width: 9px; height: 9px; background: var(--red); box-shadow: 0 0 24px 6px rgba(213,121,107,.27); border-radius: 50%; }
.orbit-two::before { top: 75%; left: 85%; width: 6px; height: 6px; background: var(--gold); }
.codex-core { position: absolute; top: 50%; left: 50%; translate: -50% -50%; display: grid; place-items: center; width: 170px; aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(215,177,141,.4); box-shadow: 0 0 0 27px rgba(215,177,141,.035), 0 0 0 75px rgba(215,177,141,.018), 0 0 65px rgba(213,121,107,.12); color: var(--gold); background: radial-gradient(circle at 28% 25%,#40313d, #141a2b 70%); font-size: 75px; font-family: var(--serif); }
.orbit-star { position: absolute; color: var(--gold); font-style: normal; font-size: 25px; }
.orbit-star.one { top: 14%; left: 28%; }.orbit-star.two { top: 26%; right: 9%;font-size: 16px; }.orbit-star.three { bottom: 15%; left: 14%;font-size: 17px; }.orbit-star.four { bottom: 12%; right: 22%;font-size: 30px; }

.codex-tools { max-width: 1450px; margin: 0 auto; padding: 44px 5% 0; }
.codex-search-wrap { max-width: 700px; }
.codex-search-wrap > label { display: block; margin-bottom: 12px; font-size: 10px; color: var(--gold); letter-spacing: .20em; font-weight: 700; }
.codex-input-wrap { position: relative; display: flex; align-items: center; width: 100%; color: var(--muted); }
.codex-input-wrap svg { position: absolute; left: 19px; pointer-events: none; }
.codex-input-wrap input { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--panel); padding: 18px 54px; color: var(--text); font-size: calc(14px * var(--reading-scale)); outline: none; transition: border-color .2s, box-shadow .2s; }
.codex-input-wrap input::placeholder { color: var(--muted); }
.codex-input-wrap input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(215,177,141,.09); }
.codex-input-wrap kbd { position: absolute; right: 16px; border: 1px solid var(--line-strong); border-radius: 3px; padding: 3px 9px; font-size: 12px; font-family: var(--sans); color: var(--soft-text); pointer-events: none; }
.codex-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 26px; }
.filter-button { display: inline-flex; gap: 10px; align-items: center; background: transparent; color: var(--soft-text); border: 1px solid var(--line); border-radius: 4px; padding: 12px 15px; font-size: 11px; transition: all .18s; }
.filter-button span { color: var(--muted); font-size: 10px; }
.filter-button:hover { border-color: var(--line-strong); color: var(--text); }
.filter-button.is-selected { background: var(--panel); border-color: var(--gold); color: var(--gold); }
.filter-button.is-selected span { color: var(--gold); }
.codex-feedback { margin-top: 18px; padding: 13px 0 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.codex-feedback p { margin: 0; color: var(--soft-text); font-size: 11px; }
.codex-bulk-actions { display: flex; align-items: center; gap: 11px; color: var(--muted); }
.codex-bulk-actions button { padding: 6px 0; border: 0; background: transparent; color: var(--gold); font-size: 11px; }
.codex-bulk-actions button:hover { text-decoration: underline; }

.codex-content { max-width: 1450px; padding: 0 5%; margin: 0 auto; }
.faction-section { scroll-margin-top: 35px; padding: 72px 0 77px; border-bottom: 1px solid var(--line); }
.faction-heading { display: flex; justify-content: space-between; gap: 35px; align-items: flex-end; margin-bottom: 32px; }
.faction-eyebrow { color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: .22em; margin: 0 0 17px; }
.faction-eyebrow span { padding: 0 5px; }
.faction-heading h2 { font-size: clamp(48px, 5vw, 70px); line-height: 1.01; font-weight: 500; letter-spacing: -.043em; margin: 0 0 18px; }
.faction-heading h2 em { font-weight: 500; color: var(--red); }
.faction-description { max-width: 780px; color: var(--soft-text); font-size: calc(14px * var(--reading-scale)); line-height: 1.8; margin: 0; }
.faction-total { font-family: var(--serif); font-size: 60px; line-height: .9; letter-spacing: -.04em; color: var(--gold); display: grid; justify-items: center; flex-shrink: 0; padding-bottom: 8px; }
.faction-total small { font-size: 10px; font-family: var(--sans); font-weight: 500; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
.character-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; align-items: stretch; }
.character-card { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); overflow: hidden; transition: border-color .2s, transform .2s, box-shadow .2s; scroll-margin-top: 22px; }
.character-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.character-card::before { content: ''; display: block; width: 100%; height: 2px; background: linear-gradient(90deg, var(--accent), transparent 85%); }
.character-card[data-faction="equipage"] { --accent: #d7b18d; }
.character-card[data-faction="eclipse"] { --accent: #ce716d; }
.character-card[data-faction="fourniz"] { --accent: #8ead98; }
.character-card[data-faction="community"] { --accent: #9faed4; }
.character-card-top { display: flex; justify-content: space-between; align-items: center; padding: 21px 23px 0; }
.character-sigil { display: grid; place-items: center; height: 52px; width: 52px; font-size: 27px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent); }
.character-state { color: var(--muted); font-size: 9px; letter-spacing: .13em; text-align: right; }
.character-card-main { padding: 21px 23px 22px; flex: 1; }
.character-kicker { color: var(--accent); font-size: 10px; letter-spacing: .065em; line-height: 1.6; margin: 0 0 10px; }
.character-card h3 { font-family: var(--serif); font-size: clamp(33px, 3vw, 42px); line-height: 1; letter-spacing: -.035em; font-weight: 600; margin: 0 0 8px; }
.character-epithet { font-family: var(--serif); font-size: 20px; font-style: italic; color: var(--soft-text); line-height: 1.15; margin: 0 0 17px; }
.character-summary { font-size: calc(12.5px * var(--reading-scale)); line-height: 1.75; color: var(--body-text); margin: 0; }
.character-details { border-top: 1px solid var(--line); }
.character-details summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 16px 23px; color: var(--gold); cursor: pointer; font-size: 11px; font-weight: 600; }
.character-details summary::-webkit-details-marker { display: none; }
.character-details summary:hover { background: color-mix(in srgb, var(--gold) 5%, transparent); }
.character-details summary:focus-visible { outline: 2px solid var(--outline); outline-offset: -3px; }
.details-arrow { display: inline-block; font-size: 17px; transition: transform .2s; }
.character-details[open] .details-arrow { transform: rotate(180deg); }
.character-details-body { border-top: 1px solid var(--line); padding: 20px 23px 23px; }
.character-details-body p { font-size: calc(12px * var(--reading-scale)); line-height: 1.7; color: var(--body-text); margin: 0 0 14px; }
.character-details-body p strong { display: block; text-transform: uppercase; font-size: 9px; letter-spacing: .13em; color: var(--accent); margin-bottom: 2px; }
.character-chapter { display: inline-block; margin-top: 4px; font-size: 11px; line-height: 1.6; text-underline-offset: 3px; color: var(--gold); }
.community-note { border-left: 2px solid var(--gold); padding: 14px 19px; background: var(--panel); color: var(--soft-text); font-size: calc(13px * var(--reading-scale)); line-height: 1.7; margin: 0 0 35px; }
.community-note a { color: var(--gold); text-underline-offset: 3px; }
.subsection-heading { font-family: var(--serif); font-size: 31px; font-weight: 500; margin: 0 0 20px; }
.allies-heading { margin-top: 50px; }
.subsection-note { color: var(--soft-text); font-size: calc(13px * var(--reading-scale)); line-height: 1.75; margin: -10px 0 22px; }
.no-results { text-align: center; margin: 80px auto; padding: 75px 20px; max-width: 610px; border: 1px dashed var(--line-strong); }
.no-results span { font-size: 42px; color: var(--gold); }
.no-results h2 { font-size: 38px; font-weight: 500; margin: 18px 0 10px; }
.no-results p { color: var(--soft-text); font-size: 13px; line-height: 1.65; }
.no-results button { background: none; border: 1px solid var(--line-strong); color: var(--gold); padding: 12px 18px; border-radius: 4px; }
.canon-note { max-width: 1300px; margin: 40px auto 0; padding: 26px 5%; display: flex; gap: 25px; align-items: flex-start; color: var(--soft-text); }
.canon-note > span { font-size: 24px; color: var(--gold); }
.canon-note h2 { color: var(--text); font-size: 29px; font-weight: 500; margin: 0 0 9px; }
.canon-note p { font-size: 12px; line-height: 1.9; margin: 0; }
.canon-note strong { color: var(--text); font-weight: 600; }
.codex-end { text-align: center; max-width: 1000px; margin: 0 auto; padding: 105px 5% 120px; }
.codex-end > span { color: var(--gold); font-size: 34px; }
.codex-end > p { color: var(--gold); font-size: 10px; letter-spacing: .23em; margin: 20px 0 15px; }
.codex-end h2 { font-weight: 500; font-size: clamp(44px, 5vw, 72px); line-height: 1; margin-bottom: 35px; }
.codex-end h2 em { color: var(--red); }
.codex-end .secondary-button { display: inline-flex; text-decoration: none; }

@media (max-width: 1070px) {
  .character-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .codex-hero-art { right: -160px; opacity: .48; }
  .site-nav { margin-right: 16px; }
}
@media (max-width: 780px) {
  .site-nav { margin-left: auto; margin-right: 12px; gap: 13px; }
  .site-nav a { font-size: 10px; }
  .codex-hero h1 { font-size: clamp(65px, 10vw, 95px); }
  .glossary-page .codex-hero-inner { padding-top: 73px; padding-bottom: 73px; }
  .codex-hero-art { opacity: .16; width: 650px; right: -350px; }
  .codex-tools { padding: 31px 6% 0; }
  .codex-content { padding: 0 6%; }
  .faction-section { padding: 58px 0 65px; }
  .faction-heading h2 { font-size: clamp(43px, 8vw, 63px); }
  .faction-total { font-size: 49px; }
}
@media (max-width: 570px) {
  .site-header { gap: 5px; }
  .brand-copy small { display: none; }
  .site-nav { gap: 10px; margin-right: 4px; }
  .site-nav a { font-size: 9px; letter-spacing: 0; }
  .site-nav a:first-child { display: none; }
  .codex-hero h1 { font-size: clamp(57px, 12.6vw, 79px); }
  .codex-lead { font-size: 14px; }
  .codex-metrics { gap: 14px; font-size: 10px; }
  .character-grid { grid-template-columns: 1fr; }
  .faction-heading { align-items: start; gap: 8px; }
  .faction-heading h2 { font-size: 47px; }
  .faction-total { font-size: 38px; margin-top: 23px; }
  .faction-total small { font-size: 8px; }
  .character-card h3 { font-size: 42px; }
  .codex-filters { gap: 6px; }
  .filter-button { padding: 10px 12px; }
  .codex-input-wrap kbd { display: none; }
  .codex-input-wrap input { padding-right: 17px; }
  .canon-note { padding-left: 6%; padding-right: 6%; }
}
@media (max-width: 390px) {
  .site-nav { margin-left: auto; }
  .brand-mark { display: none; }
  .brand-copy strong { font-size: 10px; }
  .site-nav a { font-size: 9px; }
  .faction-heading h2 { font-size: 40px; }
  .codex-hero h1 { font-size: 53px; }
}
@media print {
  .glossary-page .site-header, .glossary-page .codex-tools, .glossary-page .codex-hero-art, .glossary-page .codex-end, .glossary-page .site-footer { display: none !important; }
  .glossary-page .codex-hero { display: block !important; }
  .glossary-page .codex-hero-inner { padding: 15px 0 20px; }
  .glossary-page .codex-hero h1 { font-size: 37pt; }
  .glossary-page .codex-lead { font-size: 11pt; }
  .glossary-page .codex-content { max-width: none; padding: 0; }
  .glossary-page .faction-section { break-before: page; padding: 20px 0; }
  .glossary-page .character-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .glossary-page .character-card { break-inside: avoid; background: white; }
  .glossary-page .character-details:not([open]) .character-details-body { display: block; }
  .glossary-page .canon-note { padding: 12px 0; }
}
