/* Self-hosted, OFL. Same faces as the balance study (doc/balance-v1/estudo.html). */
@font-face { font-family: "IM Fell English SC"; src: url("../fonts/im-fell-english-sc-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url("../fonts/im-fell-english-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url("../fonts/im-fell-english-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/alegreya-sans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/alegreya-sans-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/alegreya-sans-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/alegreya-sans-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

/* Tokens: the dark ledger of the balance study, used site-wide.
   Gold is the only accent; blood red belongs to the primary button; ember marks erased names. */
:root {
  color-scheme: dark;

  --bg: #17150f;          /* soot */
  --bg-deep: #100e0a;
  --panel: #1f1c15;       /* worn leather */
  --panel-2: #262219;
  --line: #3a3528;        /* hairline */
  --line-2: #5a4f3c;
  --ink: #ece4d2;         /* parchment */
  --ink-2: #b9ae95;       /* faded ink */
  --ink-3: #8f846d;       /* margin notes, >= 4.9:1 on --bg */
  --gold: #d7b46a;
  --gold-2: #b8954f;
  --gold-soft: rgba(215, 180, 106, .12);
  --gold-line: rgba(215, 180, 106, .38);
  --blood: #8c2624;
  --blood-2: #a63129;
  --blood-edge: #c0533f;
  --ember: #d0602f;
  --ok: #5fb37a;
  --warn: #e0a33a;
  --tooltip: #0f0e0a;

  --f-display: "IM Fell English SC", "Cormorant SC", Georgia, serif;
  --f-fell: "IM Fell English", Georgia, serif;
  --f-body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --f-data: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --measure: 62ch;
  --wrap: 1200px;
  --wrap-wide: 1440px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(88px, 11vw, 152px);
  --radius: 4px;
  --header-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html:not(.reduce-motion) { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font: 400 18px/1.62 var(--f-body);
  font-synthesis: none;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--ink); text-decoration-color: var(--gold-line); text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { color: var(--gold); text-decoration-color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
::selection { background: rgba(215, 180, 106, .32); color: var(--ink); }
button { font: inherit; color: inherit; }
p { margin: 0 0 1em; }
strong { color: var(--ink); font-weight: 500; }
em { font-style: italic; }
code { font: 400 .86em var(--f-data); color: var(--ink); background: var(--panel); padding: .08em .35em; border-radius: 3px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }
abbr[title] { text-decoration: none; border-bottom: 1px dotted var(--ink-3); cursor: help; }

h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 400; color: var(--ink); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(46px, 7.4vw, 92px); line-height: .98; letter-spacing: -.005em; }
h2 { font-size: clamp(34px, 4.4vw, 54px); line-height: 1.03; }
h3 { font-size: clamp(24px, 2.4vw, 30px); line-height: 1.12; }
h4 { font-size: 21px; line-height: 1.2; }
.h-gold { color: var(--gold); }

.label {
  font: 500 12px/1.4 var(--f-data);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.num, .data { font-family: var(--f-data); font-variant-numeric: tabular-nums; }
.quote { font: italic 400 clamp(22px, 2.3vw, 28px)/1.35 var(--f-fell); color: var(--ink); margin: 0; }
.quote cite { display: block; margin-top: 12px; font: 500 12px/1.4 var(--f-data); letter-spacing: .12em; text-transform: uppercase; font-style: normal; color: var(--ink-3); }
.lead { font-size: clamp(19px, 1.6vw, 21px); line-height: 1.6; color: var(--ink-2); max-width: var(--measure); }
.prose { max-width: var(--measure); }
.prose p:last-child { margin-bottom: 0; }
.prose ul { margin: 0 0 1em; padding-left: 1.1em; }
.prose li { margin: .25em 0; }
.prose li::marker { color: var(--gold-2); }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -64px; z-index: 100; padding: 10px 16px; background: var(--gold); color: #17150f; font-weight: 500; border-radius: var(--radius); }
.skip-link:focus { top: 12px; color: #17150f; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.wrap-wide { width: min(100% - 2 * var(--gutter), var(--wrap-wide)); margin-inline: auto; }
.section { padding-block: var(--section); }
.section + .section { padding-top: 0; }
.band { background: var(--bg-deep); border-block: 1px solid var(--line); }
.band + .section, .section + .band { padding-top: var(--section); }

/* "§ 02 — O mapa do Ato I": a hairline with a ledger label instead of ornaments */
.rule { display: flex; align-items: center; gap: 14px; margin-bottom: clamp(28px, 4vw, 48px); }
.rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rule .label { white-space: nowrap; }
.rule .label b { color: var(--gold); font-weight: 500; }

.split { display: grid; gap: clamp(32px, 5vw, 72px); align-items: start; }
.split > *, .annotated > *, .chapter-grid > * { min-width: 0; }
@media (min-width: 960px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .split.reverse { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  .split.even { grid-template-columns: 1fr 1fr; }
  .split.center { align-items: center; }
}

/* Prose with notes in the margin (become inline notes on narrow screens) */
.annotated { display: grid; gap: 0 56px; }
.annotated > * { grid-column: 1; }
.annotated > .note { grid-column: 1; margin: -.2em 0 1.2em; }
@media (min-width: 1100px) {
  .annotated { grid-template-columns: minmax(0, var(--measure)) 230px; }
  .annotated > .note { grid-column: 2; margin: .35em 0 0; align-self: start; }
  .annotated > .wide { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center; gap: 28px;
  padding-inline: var(--gutter);
  background: rgba(16, 14, 10, .9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.brand { flex: none; display: block; }
.brand img { height: 26px; width: auto; }
.site-nav { display: flex; gap: 26px; margin-right: auto; }
.site-nav a { font-size: 16px; color: var(--ink-2); text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--gold); }
.header-tools { display: flex; align-items: center; gap: 18px; }
.version-chip { font: 500 12px/1 var(--f-data); letter-spacing: .08em; color: var(--gold); text-decoration: none; border: 1px solid var(--gold-line); border-radius: 999px; padding: 6px 10px; }
.version-chip:hover { background: var(--gold-soft); }
.lang-switch { font: 500 12px/1 var(--f-data); letter-spacing: .1em; display: flex; gap: 8px; align-items: center; color: var(--ink-3); }
.lang-switch a { color: var(--ink-3); text-decoration: none; padding: 6px 2px; }
.lang-switch a:hover { color: var(--ink); }
.lang-switch [aria-current="true"] { color: var(--ink); }
.menu-toggle { display: none; margin-left: auto; min-height: 44px; min-width: 64px; background: none; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 8px 14px; font: 500 12px/1 var(--f-data); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); cursor: pointer; }
@media (max-width: 899px) {
  .site-header { gap: 12px; }
  .menu-toggle { display: inline-flex; }
  .site-nav, .header-tools { display: none; }
  .site-header.open { height: auto; flex-wrap: wrap; padding-bottom: 16px; }
  .site-header.open .site-nav { display: flex; flex-direction: column; gap: 0; width: 100%; order: 3; }
  .site-header.open .site-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 18px; }
  .site-header.open .header-tools { display: flex; width: 100%; order: 4; justify-content: space-between; padding-top: 14px; }
}

/* ------------------------------------------------------------------ footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-deep); padding: 56px 0 40px; font-size: 15px; }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.footer-logo { width: 160px; margin-bottom: 18px; }
.site-footer h2 { font-size: 20px; color: var(--ink); margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 6px 0; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.footer-legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font: 400 12px/1.6 var(--f-data); color: var(--ink-3); }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: rgba(16, 14, 10, .55);
  color: var(--ink); font: 500 16px/1.2 var(--f-body); letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease), background-color .2s var(--ease);
}
.btn:hover { border-color: var(--gold); color: var(--gold); }
.btn-primary { background: var(--blood); border-color: var(--blood-edge); color: #f6ead4; }
.btn-primary:hover { background: var(--blood-2); border-color: #dc7a60; color: #fff4e2; }
.btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.btn[aria-disabled="true"]:hover { border-color: var(--line-2); color: var(--ink); background: rgba(16, 14, 10, .55); }
.btn-primary[aria-disabled="true"]:hover { background: var(--blood); border-color: var(--blood-edge); color: #f6ead4; }
.btn svg { width: 18px; height: 18px; flex: none; }
.text-link { font-weight: 500; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--gold-line); padding-bottom: 2px; }
.text-link::after { content: " \203A"; color: var(--gold); }
.text-link:hover { color: var(--gold); border-color: var(--gold); }

/* ------------------------------------------------------------------ plates (every image) */
.plate { margin: 0; }
.plate-frame { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); background: var(--bg-deep); cursor: zoom-in; overflow: hidden; }
.plate-frame img { width: 100%; transition: transform .6s var(--ease), filter .3s var(--ease); }
.plate-frame:hover img { transform: scale(1.012); }
.plate-frame:focus-visible { outline-offset: 4px; }
.plate figcaption { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin-top: 12px; align-items: baseline; }
.plate-no { font: 500 12px/1.4 var(--f-data); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); white-space: nowrap; }
.plate-title { font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.plate-src { grid-column: 2; font: 400 11.5px/1.4 var(--f-data); letter-spacing: .04em; color: var(--ink-3); }
.plate.bare figcaption { display: none; }

/* ------------------------------------------------------------------ notes in the margin */
.note { font: 400 13px/1.55 var(--f-data); color: var(--ink-3); padding-left: 14px; border-left: 1px solid var(--gold-line); }
.note b { color: var(--ink-2); font-weight: 500; }

/* ------------------------------------------------------------------ erased names */
.struck { position: relative; text-decoration: none; color: var(--ink-3); }
.struck::after {
  content: ""; position: absolute; left: -3%; right: -3%; top: 55%; height: 2px;
  background: var(--ember); transform: rotate(-2.5deg); transform-origin: left center;
  border-radius: 2px; box-shadow: 0 0 6px rgba(208, 96, 47, .35);
}
.redacted { display: inline-block; vertical-align: -.12em; height: .95em; width: var(--w, 6ch); position: relative;
  background: repeating-linear-gradient(115deg, rgba(185, 174, 149, .36) 0 2px, transparent 2px 5px);
  border-radius: 2px; }
.redacted::after { content: ""; position: absolute; left: -6%; right: -6%; top: 50%; height: 2px; background: var(--ember); transform: rotate(-3deg); border-radius: 2px; }

/* ------------------------------------------------------------------ ledger tables */
.ledger-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.ledger { width: 100%; border-collapse: collapse; font-size: 16px; }
.ledger caption { text-align: left; padding: 14px 16px 0; font: 500 12px/1.4 var(--f-data); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); caption-side: top; }
.ledger th { font: 500 12px/1.4 var(--f-data); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); text-align: left; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.ledger td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.ledger tr:last-child td { border-bottom: 0; }
.ledger td:first-child, .ledger th[scope="row"] { color: var(--ink); }
.ledger th[scope="row"] { font: inherit; text-transform: none; letter-spacing: 0; background: transparent; position: static; border-bottom: 1px solid var(--line); white-space: normal; }
.ledger .n { font-family: var(--f-data); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; color: var(--ink); }
.ledger th.n { text-align: right; }
.ledger tbody tr:hover td, .ledger tbody tr:hover th { background: rgba(215, 180, 106, .035); }
.ledger .muted { color: var(--ink-3); }
.tier { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 999px; font: 500 11.5px/1 var(--f-data); color: var(--ink-2); }
.tier.t4 { background: var(--gold); border-color: var(--gold); color: #1a160d; }
.tier.t3 { border-color: var(--gold-line); color: var(--gold); }

/* ------------------------------------------------------------------ chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 14px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--ink-2); font: 500 12.5px/1 var(--f-data); letter-spacing: .04em; text-decoration: none; cursor: pointer; }
.chip:hover { color: var(--ink); border-color: var(--gold-line); }
.chip[aria-pressed="true"], .chip[aria-current="true"], .chip.is-active { background: var(--gold); border-color: var(--gold); color: #1a160d; }

/* ------------------------------------------------------------------ stat tiles (from the study) */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 18px 18px 16px; }
.tile-label { font-size: 14.5px; color: var(--ink-2); }
.tile-value { font: 400 34px/1.1 var(--f-data); font-variant-numeric: tabular-nums; color: var(--ink); margin: 10px 0 6px; }
.tile-value small { font-size: 16px; color: var(--ink-3); }
.tile-foot { font-size: 13px; line-height: 1.45; color: var(--ink-3); }

/* ------------------------------------------------------------------ keycaps */
.key { display: inline-block; min-width: 1.9em; padding: 1px 7px 2px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; background: var(--panel); font: 500 13px/1.5 var(--f-data); color: var(--ink); text-align: center; white-space: nowrap; }

/* ------------------------------------------------------------------ registry card (the nameless one) */
.registry { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 26px 26px 22px; position: relative; }
.registry::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(58, 53, 40, .7); border-radius: 3px; pointer-events: none; }
.registry-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.registry dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0; }
.registry dt { font: 500 12px/1.4 var(--f-data); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 12px 18px 12px 0; border-top: 1px dashed var(--line); }
.registry dd { margin: 0; padding: 10px 0; border-top: 1px dashed var(--line); color: var(--ink); font-size: 17px; }
.registry dd.fell { font: 400 21px/1.3 var(--f-fell); }
.scribble { display: inline-block; width: 168px; height: 30px; vertical-align: middle; }
.scribble path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.scribble .ink { stroke: var(--ink-2); stroke-width: 1.6; }
.scribble .strike { stroke: var(--ember); stroke-width: 2.4; }
.registry-foot { margin: 16px 0 0; font: 400 12px/1.5 var(--f-data); color: var(--ink-3); }

/* ------------------------------------------------------------------ media dialog */
.media-dialog { width: min(1500px, 94vw); max-height: 94vh; padding: 0; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg-deep); color: var(--ink-2); }
.media-dialog::backdrop { background: rgba(8, 7, 5, .9); }
.media-dialog .media-body img, .media-dialog .media-body video { width: 100%; max-height: calc(94vh - 72px); object-fit: contain; background: #000; }
.media-dialog .media-caption { margin: 0; padding: 12px 18px 14px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 15px; }
.media-dialog .media-caption .plate-src { margin-left: auto; }
.dialog-close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: 50%; background: rgba(16, 14, 10, .85); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }
.dialog-close:hover { border-color: var(--gold); color: var(--gold); }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; min-height: min(100svh, 940px); display: grid; place-items: center; overflow: hidden; isolation: isolate; margin-top: calc(-1 * var(--header-h)); padding: calc(var(--header-h) + 40px) var(--gutter) 120px; }
.hero-art { position: absolute; inset: 0; z-index: -2; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 70% 60% at 50% 46%, rgba(16, 14, 10, .05), rgba(16, 14, 10, .55) 70%, rgba(16, 14, 10, .82)),
    linear-gradient(180deg, rgba(16, 14, 10, .55) 0, rgba(16, 14, 10, 0) 22%, rgba(16, 14, 10, 0) 58%, var(--bg) 100%); }
.hero-content { text-align: center; max-width: 900px; }
.hero h1 { margin: 0 auto; }
.hero-logo { width: min(640px, 88vw); margin: 0 auto; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .55)); }
.hero-line { font: 400 clamp(23px, 2.6vw, 33px)/1.3 var(--f-fell); color: var(--ink); margin: 10px auto 34px; text-shadow: 0 2px 18px rgba(0, 0, 0, .8); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.hero-facts { position: absolute; left: 0; right: 0; bottom: 34px; margin: 0; text-align: center; padding-inline: var(--gutter); font: 500 12px/1.7 var(--f-data); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.hero-facts span + span::before { content: "·"; margin: 0 .9em; color: var(--gold-2); }
.hero-credit { position: absolute; right: var(--gutter); bottom: 8px; margin: 0; font: 400 11px/1.4 var(--f-data); color: var(--ink-3); letter-spacing: .04em; }
@media (max-width: 640px) { .hero-facts span { display: block; } .hero-facts span + span::before { content: none; } .hero-credit { display: none; } }

/* ------------------------------------------------------------------ premise */
.premise h2 { margin-bottom: 26px; }
.premise .registry { margin-top: 8px; }
.premise-plate { margin-top: clamp(48px, 6vw, 80px); }

/* ------------------------------------------------------------------ atlas */
.atlas-section { padding-block: var(--section); }
.atlas-head { display: grid; gap: 18px 56px; align-items: end; margin-bottom: 32px; }
@media (min-width: 960px) { .atlas-head { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); } }
.atlas { position: relative; border: 1px solid var(--line); background: #0b0a07; }
.atlas-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-color: var(--line-2) transparent; }
.atlas-canvas { position: relative; min-width: 980px; aspect-ratio: 2520 / 1080; }
.atlas-canvas > img, .atlas-canvas > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.atlas-svg { overflow: visible; }
.atlas-svg .hit { cursor: pointer; }
.atlas-svg .hit path, .atlas-svg .hit ellipse { fill: rgba(215, 180, 106, 0); stroke: rgba(236, 228, 210, 0); stroke-width: 3; transition: fill .25s var(--ease), stroke .25s var(--ease); }
.atlas-svg .hit:hover path, .atlas-svg .hit:focus-visible path, .atlas-svg .hit.is-current path,
.atlas-svg .hit:hover ellipse, .atlas-svg .hit:focus-visible ellipse, .atlas-svg .hit.is-current ellipse { fill: rgba(215, 180, 106, .10); stroke: var(--gold); }
.atlas-svg .hit:focus { outline: none; }
.atlas-svg .hit:focus-visible path, .atlas-svg .hit:focus-visible ellipse { stroke-width: 5; }
.atlas-svg .veil path, .atlas-svg .veil ellipse { fill: url(#atlas-hatch); stroke: rgba(185, 174, 149, .55); stroke-dasharray: 10 8; }
.atlas-svg .veil:hover path, .atlas-svg .veil.is-current path, .atlas-svg .veil:focus-visible path { stroke: var(--ink-2); fill: url(#atlas-hatch); }
.atlas-svg .lbl { font-family: var(--f-display); font-size: 34px; fill: var(--ink); paint-order: stroke; stroke: rgba(10, 9, 6, .92); stroke-width: 7px; stroke-linejoin: round; pointer-events: none; }
.atlas-svg .lbl-sub { font-family: var(--f-data); font-size: 19px; letter-spacing: 2px; fill: var(--gold); }
.atlas-svg .veil .lbl { fill: var(--ink-2); }
.atlas-svg .pin { fill: var(--gold); stroke: #0b0a07; stroke-width: 3; }
.atlas-svg .pin-boss { fill: var(--blood-2); }
.atlas-svg .cave-layer { opacity: 0; transition: opacity .35s var(--ease); pointer-events: none; }
.atlas.show-cave .atlas-svg .cave-layer { opacity: 1; pointer-events: auto; }
.atlas.show-cave .atlas-svg .surface-dim { opacity: .62; }
.atlas-svg .surface-dim { opacity: 0; transition: opacity .35s var(--ease); pointer-events: none; }
.atlas-tools { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; z-index: 2; }
.atlas-tools .chip:not([aria-pressed="true"]) { background: rgba(10, 9, 6, .82); }
.atlas-legend { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 12px; font: 400 12px/1.5 var(--f-data); color: var(--ink-3); }
.atlas-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; }
.atlas-legend .l-boss { background: var(--blood-2); }
.atlas-legend .l-open { border: 1.5px solid var(--gold); }
.atlas-legend .l-veil { border: 1.5px dashed var(--ink-2); }

.region-list { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 4px; scrollbar-width: thin; }
@media (min-width: 900px) { .region-list { flex-wrap: wrap; overflow: visible; } }
.region-list .chip { flex: none; }

.region-cards { margin-top: 28px; }
.region-card { display: grid; gap: 26px 48px; padding: 30px 0; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 24px); }
@media (min-width: 960px) { .region-card { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; } }
.js .region-cards.single .region-card { display: none; }
.js .region-cards.single .region-card.is-current { display: grid; }
.region-card h3 { font-size: clamp(30px, 3.2vw, 42px); margin: 6px 0 14px; }
.region-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 18px; padding: 0; list-style: none; font: 500 13px/1.4 var(--f-data); color: var(--ink-2); }
.region-meta li b { color: var(--ink); font-weight: 500; }
.region-card .quote { font-size: 21px; margin: 18px 0 0; color: var(--ink); }
.region-card.veiled h3 { color: var(--ink-2); }
.region-nav { display: flex; gap: 10px; margin-top: 22px; }
.no-js .region-nav { display: none; }

/* ------------------------------------------------------------------ systems ledger */
.facts { display: grid; gap: 0; border-top: 1px solid var(--line); }
@media (min-width: 900px) { .facts { grid-template-columns: 1fr 1fr; column-gap: 56px; } }
.fact { display: grid; grid-template-columns: 64px 1fr; gap: 18px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.fact img { width: 64px; height: 64px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--bg-deep); }
.fact h3 { font-size: 23px; margin-bottom: 6px; }
.fact p { margin: 0; font-size: 16.5px; line-height: 1.55; }
.fact p.note { margin-top: 10px; border: 0; padding: 0; font: 400 13px/1.55 var(--f-data); letter-spacing: .02em; }

/* ------------------------------------------------------------------ classes as an open book */
.book { display: grid; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); overflow: hidden; }
@media (min-width: 960px) { .book { grid-template-columns: 1fr 1fr; } .book > .page + .page { border-left: 1px solid var(--line); } }
.book .page { padding: clamp(24px, 3.4vw, 44px); display: grid; gap: 22px; align-content: start; }
.book .page + .page { border-top: 1px solid var(--line); }
@media (min-width: 960px) { .book .page + .page { border-top: 0; } }
.class-head { display: grid; grid-template-columns: 128px 1fr; gap: 22px; align-items: center; }
.class-head img { width: 128px; height: 128px; object-fit: cover; border: 1px solid var(--line-2); border-radius: 4px; }
.class-head h3 { font-size: clamp(32px, 3.4vw, 44px); }
.class-tag { font: italic 400 19px/1.35 var(--f-fell); color: var(--gold); margin: 6px 0 0; }
.class-stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.class-stats div { padding: 10px 12px; border-left: 1px solid var(--line); }
.class-stats div:first-child { border-left: 0; }
.class-stats dt { font: 500 11px/1.3 var(--f-data); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.class-stats dd { margin: 4px 0 0; font: 400 22px/1.1 var(--f-data); color: var(--ink); }
.class-path { margin: 0; padding: 0; list-style: none; font-size: 16px; }
.class-path li { padding: 8px 0 8px 18px; border-top: 1px dashed var(--line); position: relative; }
.class-path li::before { content: ""; position: absolute; left: 2px; top: 1.05em; width: 7px; height: 7px; border: 1px solid var(--gold); transform: rotate(45deg); }
.class-path .soon { font: 400 12px/1 var(--f-data); color: var(--ink-3); margin-left: 8px; letter-spacing: .04em; }

/* ------------------------------------------------------------------ bosses */
.dossiers { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
@media (min-width: 960px) { .dossiers { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ledger-title { margin: 44px 0 14px; }
.bosses-ledger .r-unique-text { color: #ed9438; }
.bosses .ledger-wrap + .note { margin-top: 14px; }
.dossier { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.dossier img { width: 100%; aspect-ratio: 1; object-fit: cover; border-bottom: 1px solid var(--line); }
.dossier-body { padding: 18px 18px 20px; display: grid; gap: 8px; align-content: start; }
.dossier h3 { font-size: 25px; }
.dossier .subtitle { font: italic 400 16.5px/1.35 var(--f-fell); color: var(--ink-2); margin: 0; }
.dossier .where { font: 500 12px/1.4 var(--f-data); letter-spacing: .06em; color: var(--ink-3); margin: 2px 0 0; }
.dossier .quote { font-size: 18px; margin-top: 8px; color: var(--ink); }

/* ------------------------------------------------------------------ gallery: a contact sheet */
.sheet { display: grid; gap: 28px 22px; grid-template-columns: repeat(12, 1fr); }
.sheet > .plate { grid-column: span 12; }
@media (min-width: 760px) {
  .sheet > .plate.s4 { grid-column: span 4; }
  .sheet > .plate.s5 { grid-column: span 5; }
  .sheet > .plate.s6 { grid-column: span 6; }
  .sheet > .plate.s7 { grid-column: span 7; }
  .sheet > .plate.s8 { grid-column: span 8; }
}
.sheet .plate-frame img { aspect-ratio: var(--ar, 16 / 9); object-fit: cover; }
.video-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 34px; }
.video-row p { margin: 0; font: 400 13px/1.5 var(--f-data); color: var(--ink-3); }

/* ------------------------------------------------------------------ codex band */
.codex-band .tiles { margin: 0 0 30px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.notes-list { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.notes-list li { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 16.5px; }
.notes-list .kind { font: 500 11.5px/1.9 var(--f-data); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }

/* ------------------------------------------------------------------ who makes it (one person) */
.maker-grid { display: grid; gap: 40px 64px; align-items: start; }
.maker-grid > * { min-width: 0; }
@media (min-width: 960px) { .maker-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.maker-portrait { margin: 0; }
.maker-portrait .plate-frame img { aspect-ratio: 1; object-fit: cover; }
.maker-motto { margin: 18px 0 0; font: italic 400 21px/1.35 var(--f-fell); color: var(--ink-2); }
.maker-mark .icon { border: 0; background: transparent; }
.maker-text h2 { margin: 16px 0 22px; }
/* hairlines come from the 1px gap over the line colour; an odd last fact spans the rest of its row */
.maker-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 28px 0 26px; border: 1px solid var(--line); border-radius: 4px; background: var(--line); overflow: hidden; }
.maker-facts div { padding: 12px 16px; background: var(--panel); }
.maker-facts div:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 560px) {
  .maker-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .maker-facts div:last-child:nth-child(odd) { grid-column: auto; }
  .maker-facts div:last-child:nth-child(3n+2) { grid-column: span 2; }
}
.maker-facts dt { font: 500 11.5px/1.4 var(--f-data); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.maker-facts dd { margin: 4px 0 0; font-size: 17px; color: var(--ink); }

/* ------------------------------------------------------------------ wishlist */
.wishlist { position: relative; overflow: hidden; isolation: isolate; text-align: center; padding-block: clamp(110px, 14vw, 180px); }
.wishlist-art { position: absolute; inset: 0; z-index: -1; }
.wishlist-art img { width: 100%; height: 100%; object-fit: cover; opacity: .38; }
.wishlist::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--bg) 0, rgba(23, 21, 15, .45) 40%, rgba(23, 21, 15, .7) 100%); }
.wishlist h2 { margin-bottom: 14px; }
.wishlist .lead { margin: 0 auto 30px; }
.steam-status { margin: 14px 0 0; font: 400 13px/1.5 var(--f-data); color: var(--ink-3); }

/* ------------------------------------------------------------------ small shared bits */
.btn-small { min-height: 36px; padding: 7px 14px; font-size: 14.5px; }
.section-title { margin-bottom: 18px; }
.classes-head { display: grid; gap: 10px 56px; align-items: end; margin-bottom: clamp(26px, 3vw, 40px); }
@media (min-width: 960px) { .classes-head { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); } .classes-head .section-title { margin: 0; } }
.lead-prose p { font-size: clamp(18.5px, 1.5vw, 20px); color: var(--ink-2); }
.section-link { margin: 30px 0 0; }
.spaced { margin-top: 26px; }
.muted { color: var(--ink-3); }
.sub { font-size: 24px; margin-bottom: 16px; }
.icon { flex: none; border: 1px solid var(--line-2); border-radius: 4px; background: var(--bg-deep); }
.bullets { list-style: none; padding: 0; margin: 18px 0 0; }
.bullets li { position: relative; padding: 10px 0 10px 22px; border-top: 1px dashed var(--line); margin: 0; }
.bullets li::before { content: ""; position: absolute; left: 3px; top: 1.15em; width: 7px; height: 7px; border: 1px solid var(--gold); transform: rotate(45deg); }
.footer-ai { flex-basis: 100%; }
.notes-title { font-size: 22px; margin: 26px 0 10px; }
.atlas-legend .l-way { background: var(--gold); }
.region-plate .plate-frame img { aspect-ratio: 16 / 10; object-fit: cover; }
/* a dungeon without a capture yet: an empty plate, same size as the others */
.region-blank { aspect-ratio: 16 / 10; display: grid; place-content: center; gap: 10px; padding: 24px; text-align: center;
  border: 1px solid var(--line); border-radius: 4px;
  background: repeating-linear-gradient(135deg, rgba(185, 174, 149, .05) 0 2px, transparent 2px 9px), var(--bg-deep); }
.region-blank span { font: italic 400 clamp(26px, 3vw, 34px)/1.2 var(--f-fell); color: var(--ink-2); }
.region-blank small { font: 500 11.5px/1.4 var(--f-data); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.atlas-off { margin: 8px 0 0; font: 400 12.5px/1.6 var(--f-data); color: var(--ink-3); }
.atlas-off a { color: var(--ink-2); }
.dossier-blank { aspect-ratio: 1; display: grid; place-items: center; padding: 24px; border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(135deg, rgba(185, 174, 149, .05) 0 2px, transparent 2px 9px), var(--bg-deep); }
.dossier-blank span { font: italic 400 26px/1.25 var(--f-fell); color: var(--ink-2); text-align: center; }
.ledger .with-icon { display: flex; align-items: center; gap: 12px; }
.ledger .fell-cell { font: 400 19px/1.3 var(--f-fell); }
.redacted.w5 { --w: 5ch; } .redacted.w6 { --w: 6ch; } .redacted.w7 { --w: 7ch; } .redacted.w8 { --w: 8ch; } .redacted.w9 { --w: 9ch; }
.ledger.compact td, .ledger.compact th { padding: 8px 14px; }
.ledger-wrap.narrow { max-width: 420px; }
.ledger-wrap + .ledger-wrap { margin-top: 18px; }
.notfound { min-height: 60vh; }
.notfound h1 { margin: 10px 0 18px; }
.notfound .scribble { display: inline-block; margin-left: 8px; }

/* ------------------------------------------------------------------ chronicle */
.chronicle-head { padding-top: clamp(56px, 8vw, 110px); padding-bottom: clamp(24px, 4vw, 40px); }
.chronicle-head h1 { margin: 12px 0 30px; max-width: 14ch; }
.chronicle-front { display: grid; gap: 36px 64px; align-items: start; }
.chronicle-front > * { min-width: 0; }
@media (min-width: 1000px) { .chronicle-front { grid-template-columns: minmax(0, 1fr) 380px; } }
@media (max-width: 999px) { .frontispiece { max-width: 420px; } }
.epigraph { margin: 0 0 34px; padding-left: 22px; border-left: 2px solid var(--gold); max-width: 40ch; }
.epigraph p { font: italic 400 clamp(22px, 2.4vw, 30px)/1.35 var(--f-fell); color: var(--ink); margin: 0; }
.epigraph cite { display: block; margin-top: 10px; font: 500 12px/1.4 var(--f-data); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-style: normal; }
.chronicle-toc { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); }
.chronicle-toc a { text-decoration: none; color: var(--ink-2); font-size: 16px; }
.chronicle-toc a span { font: 500 12px/1 var(--f-data); color: var(--gold); margin-right: 8px; }
.chronicle-toc a:hover { color: var(--gold); }

.chapter { padding-block: clamp(56px, 7vw, 96px); border-top: 1px solid var(--line); }
.chapter-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 26px; }
.chapter-n { font: 400 clamp(40px, 5vw, 64px)/1 var(--f-display); color: var(--gold); min-width: 1.4em; }
.chapter-grid { display: grid; gap: 34px 64px; align-items: start; }
@media (min-width: 1100px) {
  .chapter-grid { grid-template-columns: minmax(0, 1fr) 420px; }
  .chapter-grid.flip > .chapter-plates { order: -1; }
  .chapter-grid.flip { grid-template-columns: 420px minmax(0, 1fr); }
}
.chapter .prose p { font-size: 18.5px; }
.chapter .prose em { font-family: var(--f-fell); font-size: 1.08em; color: var(--ink); }
.chapter-plates { display: grid; gap: 24px; }
.page-plate .plate-frame { background: #d9cdb0; border-color: #6d5f43; }
.page-plate .plate-frame img { mix-blend-mode: multiply; }
.people { margin-top: 44px; }
.people-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.people-list li { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.people-list img { width: 72px; height: 72px; object-fit: cover; border-radius: 4px; }
.people-list strong { display: block; font: 400 20px/1.2 var(--f-display); color: var(--ink); }
.people-list span { font-size: 15px; line-height: 1.45; }
.acts { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.act { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.act-name { font: 400 22px/1.25 var(--f-display); color: var(--ink); }
.act-state { font: 500 12px/1.9 var(--f-data); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.act.sealed .act-name { color: var(--ink-3); }
.act.sealed .act-state { color: var(--ink-3); }
.chronicle-end { padding-top: 40px; }

/* ------------------------------------------------------------------ how to play */
.manual-head { padding-top: clamp(56px, 8vw, 110px); padding-bottom: clamp(16px, 3vw, 30px); }
.manual-head h1 { margin: 12px 0 24px; }
.manual-toc { margin-top: 30px; }
.manual-section { padding-block: clamp(48px, 6vw, 80px); }
.manual-section h2 { margin-bottom: 18px; }
.manual-section > .prose, .manual-section .split .prose { margin-bottom: 22px; }
.manual-plate { margin-top: 34px; }
.ledger.controls td { line-height: 2; }
.tech-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.tech-list li { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 14px 0; border-top: 1px dashed var(--line); align-items: start; }
.tech-list strong { color: var(--ink); font-weight: 500; }
.tech-list p { margin: 4px 0 0; font-size: 15.5px; line-height: 1.5; }
.tech-list.compact li { padding: 10px 0; }
.weapons { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.weapon { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 18px 18px 8px; }
.weapon h3 { font-size: 27px; }
.weapon header .note { margin: 6px 0 8px; }
.rarities { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.rarity { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.rarity strong { font: 400 21px/1.2 var(--f-display); }
.r-normal strong { color: #e6e0d4; }
.r-magic strong { color: #8799ff; }
.r-rare strong { color: #ffe066; }
.r-unique strong { color: #ed9438; }
.r-set strong { color: #66eb70; }
.coins { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.coin { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; align-items: start; }
.coin strong { font: 400 20px/1.2 var(--f-display); color: var(--ink); }
.coin p { margin: 6px 0 0; font-size: 15px; line-height: 1.5; }
.coin .tier { margin-left: 6px; vertical-align: 2px; }
.coin-blank { width: 64px; height: 64px; border: 1px dashed var(--line-2); border-radius: 4px; }
.uniques { grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }
.uniques .r-unique-name { color: #ed9438; }
.coin p strong { font: inherit; font-weight: 600; color: var(--ink); }
.uniques p.muted { margin: 2px 0 0; font: 400 12.5px/1.5 var(--f-data); }
.arca-key { margin: 0; display: grid; justify-items: center; gap: 22px; text-align: center; }
.arca-key .icon { width: 192px; height: 192px; border: 0; background: transparent; }
.arca-key .quote { max-width: 30ch; }
@media (max-width: 560px) { .rarity { grid-template-columns: 1fr; gap: 4px; } }

/* The Codex keeps the balance study's ledger column, with a side index on wide screens. */
.codex-page { padding-block: clamp(56px, 8vw, 104px) var(--section); }
.codex-head { border-bottom: 1px solid var(--line); padding-bottom: 28px; margin-bottom: 40px; }
.codex-head h1 { margin: 12px 0 20px; }
.codex-version { font: 400 .5em/1 var(--f-data); color: var(--gold); vertical-align: .55em; letter-spacing: .02em; }
.codex-versions { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 12px; }
.codex-meta { font: 400 12.5px/1.5 var(--f-data); color: var(--ink-3); margin: 0; }
.codex-layout { display: grid; gap: 40px; }
.codex-layout > * { min-width: 0; }   /* wide tables scroll inside their box instead of widening the page */
@media (min-width: 1100px) { .codex-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 56px; } }
.codex-toc { align-self: start; }
@media (min-width: 1100px) { .codex-toc { position: sticky; top: calc(var(--header-h) + 24px); } }
.codex-toc ol { list-style: none; margin: 12px 0 0; padding: 0; counter-reset: toc; }
.codex-toc li { counter-increment: toc; }
.codex-toc a { display: flex; gap: 10px; padding: 6px 0; text-decoration: none; color: var(--ink-2); font-size: 15.5px; border-left: 1px solid var(--line); padding-left: 12px; }
.codex-toc a::before { content: counter(toc, decimal-leading-zero); font: 500 11.5px/1.9 var(--f-data); color: var(--ink-3); }
.codex-toc a:hover, .codex-toc a[aria-current="true"] { color: var(--ink); border-left-color: var(--gold); }
.codex-toc a[aria-current="true"]::before { color: var(--gold); }
@media (max-width: 1099px) { .codex-toc ol { display: flex; flex-wrap: wrap; gap: 4px 8px; } .codex-toc a { border-left: 0; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; } .codex-toc a::before { display: none; } }
.codex-section { padding-bottom: 56px; scroll-margin-top: calc(var(--header-h) + 20px); }
.codex-section h2 { font-size: clamp(28px, 3vw, 34px); color: var(--gold); margin-bottom: 14px; }
.codex-section > .prose { margin-bottom: 22px; }
.codex-section .prose ul { padding-left: 1.1em; }
.ledger-wrap.sets td { font-size: 15px; }
.ledger-wrap.currency td { font-size: 15.5px; }

/* One deliberate motion: the erased name is struck when the register comes into view. */
@media (prefers-reduced-motion: no-preference) {
  html.js:not(.reduce-motion) .registry .scribble .strike { stroke-dasharray: 170; stroke-dashoffset: 170; animation: strike 1.1s .5s var(--ease) forwards; }
  @keyframes strike { to { stroke-dashoffset: 0; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
}
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }

/* Closed-alpha account / signup page */
.account-page { padding-top: calc(var(--header-h) + 48px); padding-bottom: var(--section); }
.account-wrap { max-width: 560px; }
.account-head { margin-bottom: 28px; }
.account-head .label {
  font: 500 12px/1.4 var(--f-data); letter-spacing: .14em; text-transform: uppercase; color: var(--gold);
  margin: 0 0 12px;
}
.account-head h1 {
  font: 400 clamp(34px, 5vw, 48px)/1.1 var(--f-display); color: var(--ink); margin: 0 0 14px;
}
.account-head .lead { color: var(--ink-2); font-size: 18px; line-height: 1.55; margin: 0; }
.account-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 22px;
}
.account-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.account-form { display: grid; gap: 14px; }
.account-form label { display: grid; gap: 6px; color: var(--ink-2); font-size: 14.5px; }
.account-form input {
  min-height: 46px; padding: 10px 12px; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: var(--bg-deep); color: var(--ink);
  font: 400 16px/1.3 var(--f-body);
}
.account-form input:focus {
  outline: 2px solid var(--gold-line); outline-offset: 1px; border-color: var(--gold);
}
.account-form small { color: var(--ink-3); font: 400 12.5px/1.4 var(--f-data); }
.account-form .btn { width: 100%; margin-top: 4px; }
.account-status { margin: 16px 0 0; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.account-status.is-ok { color: var(--ok); }
.account-status.is-err { color: var(--blood-edge); }
.account-actions { display: grid; gap: 12px; margin-top: 8px; }
.account-actions .btn { width: 100%; }

/* Discord floating entry — circular icon, shine sweep, timed bubble */
.discord-fab {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 45;
  display: grid; place-items: center;
  width: 56px; height: 56px; padding: 0;
  border: 1px solid #6b7bd6; border-radius: 999px;
  background: #5865f2; color: #f4f5ff;
  text-decoration: none; overflow: visible;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .38);
  transition: filter .2s ease, box-shadow .2s ease, transform .2s ease;
}
.discord-fab svg { width: 26px; height: 26px; position: relative; z-index: 2; }
.discord-shine {
  position: absolute; inset: 0; border-radius: inherit; z-index: 1; pointer-events: none;
  overflow: hidden;
}
.discord-shine::before {
  content: ""; position: absolute; inset: -20% -50%;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%);
  transform: translateX(-130%) rotate(12deg);
  animation: discord-shine 3s ease-in-out infinite;
}
.discord-bubble {
  position: absolute; right: 0; bottom: calc(100% + 14px);
  padding: 8px 12px; border-radius: 10px 10px 4px 10px;
  background: #f3ead8; color: #1a160d;
  font: 600 12.5px/1.2 "Alegreya Sans", system-ui, sans-serif; letter-spacing: .02em;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .28);
  opacity: 0; transform: translateY(6px) scale(.92);
  pointer-events: none;
  animation: discord-bubble-cycle 3s ease-in-out infinite;
  transform-origin: 90% 100%;
}
.discord-bubble::after {
  content: ""; position: absolute; right: 18px; bottom: -6px;
  border: 6px solid transparent; border-top-color: #f3ead8; border-bottom: 0;
}
.discord-fab:hover { filter: brightness(1.08); color: #fff; transform: translateY(-2px); box-shadow: 0 14px 32px rgba(0, 0, 0, .45); }
.discord-fab:hover .discord-bubble { animation-play-state: paused; opacity: 1; transform: translateY(0) scale(1); }
.discord-fab:focus-visible { outline: 2px solid #dfc49e; outline-offset: 3px; }
@keyframes discord-shine {
  0%, 35% { transform: translateX(-130%) rotate(12deg); }
  55%, 100% { transform: translateX(130%) rotate(12deg); }
}
@keyframes discord-bubble-cycle {
  0%, 8% { opacity: 0; transform: translateY(8px) scale(.9); }
  18%, 52% { opacity: 1; transform: translateY(0) scale(1); }
  62%, 100% { opacity: 0; transform: translateY(-4px) scale(.94); }
}
@media (prefers-reduced-motion: reduce) {
  .discord-shine::before, .discord-bubble { animation: none; }
  .discord-bubble { opacity: 1; transform: none; }
}
@media (max-width: 520px) {
  .discord-fab { width: 52px; height: 52px; }
  .discord-fab svg { width: 24px; height: 24px; }
  .discord-bubble { right: -2px; font-size: 12px; padding: 7px 10px; }
}
