/* =========================================================
   The Guild of Adventuring Heroes
   One stylesheet, five pages. Ink and brass, aged paper,
   oxblood and verdigris.

   1  tokens / reset          6  article pages (prose, figures, callouts)
   2  furniture (bar, nav)    7  reference page (skills, pyramid, knacks)
   3  home page               8  tooltips
   4  page heads / toolbar    9  wide screens
   5  dossiers                10 motion / print
   ========================================================= */

/* ---------- 1. tokens ---------------------------------- */

:root {
  --ink:        #14140f;
  --ink-2:      #1d1d16;
  --ink-3:      #2a291f;
  --paper:      #e9e1cd;
  --paper-2:    #ded4bc;
  --paper-edge: #c9bd9e;
  --type:       #241f18;
  --type-soft:  #57503f;
  --brass:      #c8a13c;
  --brass-lo:   #8c6d21;
  --brass-hi:   #e8cd83;
  --oxblood:    #7d2a25;
  --verdigris:  #38706a;

  --dim:        #8d825f;
  --dim-2:      #7d7355;

  --shell: 62rem;
  --radius: 2px;

  --f-display: 'Limelight', 'Cinzel', Georgia, serif;
  --f-head:    'Cinzel', Georgia, 'Times New Roman', serif;
  --f-label:   'Oswald', 'Helvetica Neue', Arial, sans-serif;
  --f-body:    'EB Garamond', Georgia, 'Times New Roman', serif;
}

*, *::before, *::after { box-sizing: border-box; }

/* class selectors below out-specify the UA rule, so restate it */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  background-image:
    radial-gradient(120% 60% at 50% 0%, #23231a 0%, transparent 70%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.014) 0 1px, transparent 1px 4px);
  color: var(--paper);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

img { max-width: 100%; display: block; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: 1.1rem;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--brass); color: var(--ink);
  padding: .6rem 1rem; font-family: var(--f-label); z-index: 90;
}
.skip:focus { left: .5rem; top: .5rem; }

:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 3px; }

/* deco rule */
.rule { display: flex; align-items: center; gap: .55rem; margin: 1rem auto; max-width: 22rem; }
.rule span { flex: 1; height: 1px; background: var(--brass-lo); }
.rule i { width: 9px; height: 9px; transform: rotate(45deg); border: 1px solid var(--brass-lo); }
.rule--light span { background: linear-gradient(90deg, transparent, var(--brass), transparent); }
.rule--light i { border-color: var(--brass); background: var(--brass); }

/* shared buttons */
.btn {
  display: inline-block;
  cursor: pointer;
  font-family: var(--f-label); font-weight: 300; font-size: .7rem;
  letter-spacing: .16em; text-transform: uppercase;
  padding: .55rem .9rem;
  color: var(--brass-hi);
  background: #1c1c15;
  border: 1px solid var(--brass-lo);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background .18s, color .18s;
}
.btn:hover { background: var(--brass-lo); color: #14140f; }
.btn[aria-pressed="true"] { background: var(--brass); border-color: var(--brass); color: #14140f; }
.btn--big { padding: .8rem 1.5rem; font-size: .78rem; letter-spacing: .2em; }
.btn--ghost { background: transparent; border-color: var(--ink-3); color: var(--dim); }
.btn--ghost:hover { border-color: var(--brass-lo); background: transparent; color: var(--brass-hi); }

/* ---------- 2. furniture ------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(16,16,12,.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--brass-lo);
}
.topbar__inner {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: .5rem 1rem;
  padding-block: .55rem;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand__mark {
  width: 22px; height: 22px; flex: 0 0 auto;
  border: 1px solid var(--brass); transform: rotate(45deg);
  position: relative;
}
.brand__mark::after {
  content: ""; position: absolute; inset: 4px; background: var(--brass);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__text b {
  font-family: var(--f-head); font-weight: 700; font-size: .92rem;
  letter-spacing: .06em; color: var(--paper);
}
.brand__text i {
  font-family: var(--f-label); font-weight: 300; font-style: normal;
  font-size: .54rem; letter-spacing: .22em; text-transform: uppercase; color: var(--dim);
}
.topnav { display: flex; flex-wrap: wrap; gap: .15rem; }
.topnav a {
  padding: .4rem .7rem;
  font-family: var(--f-label); font-weight: 300; font-size: .72rem;
  letter-spacing: .16em; text-transform: uppercase;
  color: #b3a884; text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .18s, border-color .18s;
}
.topnav a:hover { color: var(--brass-hi); }
.topnav a.is-here { color: var(--brass); border-bottom-color: var(--brass); }

.colophon {
  margin-top: 3rem;
  padding: 2rem 0 3rem; text-align: center;
  border-top: 1px solid var(--ink-3);
  color: var(--dim-2);
  font-family: var(--f-label); font-weight: 300; font-size: .72rem; letter-spacing: .14em;
}
.colophon p { margin: .3rem 0; }
.colophon b { color: var(--brass); font-weight: 400; }
.colophon__fine { font-size: .62rem; color: #5d5642; }
.colophon code { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0; }

/* next-page links, bottom of every page */
.pagenav {
  display: grid; gap: .8rem; margin: 2.6rem 0 1rem;
}
.pagenav a {
  display: block; padding: 1rem 1.1rem;
  border: 1px solid var(--ink-3); border-left: 3px solid var(--brass-lo);
  background: #1a1a13; text-decoration: none;
  transition: border-color .18s, background .18s;
}
.pagenav a:hover { background: #202017; border-left-color: var(--brass); }
.pagenav b {
  display: block;
  font-family: var(--f-head); font-weight: 700; font-size: 1rem;
  letter-spacing: .04em; color: var(--brass-hi);
}
.pagenav span { display: block; margin-top: .15rem; font-size: .95rem; color: var(--dim); }

/* ---------- 3. home page ------------------------------- */

.hero {
  position: relative; overflow: hidden;
  padding: 3.4rem 0 2.8rem; text-align: center;
  border-bottom: 1px solid var(--brass-lo);
  background: linear-gradient(180deg, #191912 0%, #12120d 100%);
}
.hero__rays {
  position: absolute; inset: -40% -10% auto -10%; height: 200%;
  background: repeating-conic-gradient(from 90deg at 50% 0%,
      rgba(200,161,60,.075) 0deg 3deg, transparent 3deg 11deg);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 62%);
          mask-image: linear-gradient(180deg, #000 0%, transparent 62%);
}
.hero__inner { position: relative; }
.hero__eyebrow {
  margin: 0 0 .9rem;
  font-family: var(--f-label); font-weight: 300; font-size: .68rem;
  letter-spacing: .38em; text-transform: uppercase; color: var(--brass);
}
.hero__eyebrow b { color: var(--brass-hi); font-weight: 400; }
.hero__title {
  margin: 0;
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(1.9rem, 7.5vw, 3.6rem);
  line-height: 1.12; letter-spacing: .04em;
  text-shadow: 0 2px 0 rgba(0,0,0,.5);
}
.hero__blurb { max-width: 44rem; margin: 1.2rem auto 0; }
.hero__blurb p {
  margin: 0 0 .85rem;
  font-size: 1.16rem; line-height: 1.72; color: #d3c9ae;
}
.hero__beat {
  margin-bottom: 0 !important;
  padding-top: .85rem;
  border-top: 1px solid rgba(140,109,33,.45);
  font-family: var(--f-head); font-weight: 500;
  font-size: 1.2rem !important; color: var(--brass-hi) !important;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; margin-top: 1.8rem; }

.navcards {
  display: grid; gap: 1rem; margin: 0 0 2.6rem; padding: 0; list-style: none;
}
.navcard a {
  display: block; height: 100%; position: relative;
  padding: 1.3rem 1.3rem 1.1rem;
  background: #1a1a13;
  border: 1px solid var(--ink-3);
  text-decoration: none;
  transition: border-color .2s, background .2s, transform .2s;
}
.navcard a::before {
  content: ""; position: absolute; inset: .35rem;
  border: 1px solid rgba(140,109,33,.28); pointer-events: none;
  transition: border-color .2s;
}
.navcard a:hover { border-color: var(--brass-lo); background: #202017; }
.navcard a:hover::before { border-color: rgba(200,161,60,.55); }
.navcard__no {
  display: block; margin-bottom: .5rem;
  font-family: var(--f-head); font-weight: 700; font-size: .82rem;
  letter-spacing: .2em; color: var(--brass-lo);
}
.navcard h3 {
  margin: 0 0 .45rem;
  font-family: var(--f-head); font-weight: 700; font-size: 1.32rem;
  letter-spacing: .02em; color: var(--paper);
}
.navcard p { margin: 0 0 .9rem; color: #a89e80; font-size: 1rem; }
.navcard__go {
  font-family: var(--f-label); font-weight: 300; font-size: .62rem;
  letter-spacing: .24em; text-transform: uppercase; color: var(--brass);
}
.navcard__go::after { content: " \203A"; }

.strip {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem;
  margin: 0; padding: 0; list-style: none;
}
.strip a { display: block; text-decoration: none; }
.strip .plate { aspect-ratio: 1 / 1; margin: 0 0 .5rem; max-width: none; }
.strip a:hover .plate { border-color: var(--brass); }
.strip__name {
  display: block;
  font-family: var(--f-head); font-weight: 700; font-size: .92rem;
  color: var(--paper); line-height: 1.2;
}
.strip__title {
  display: block; margin-top: .1rem;
  font-family: var(--f-label); font-weight: 300; font-size: .58rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--brass-lo);
}
.strip a:hover .strip__title { color: var(--brass); }
.strip__note {
  margin: 1rem 0 0; text-align: center;
  font-family: var(--f-label); font-weight: 300; font-size: .62rem;
  letter-spacing: .2em; text-transform: uppercase; color: var(--dim-2);
}

/* ---------- 4. page heads / toolbar --------------------- */

.pagehead {
  padding: 2.6rem 0 1.8rem; text-align: center;
  border-bottom: 1px solid var(--ink-3);
  background: linear-gradient(180deg, #191912 0%, #14140f 100%);
}
.pagehead__eyebrow {
  margin: 0 0 .7rem;
  font-family: var(--f-label); font-weight: 300; font-size: .64rem;
  letter-spacing: .34em; text-transform: uppercase; color: var(--brass);
}
.pagehead__title {
  margin: 0;
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(1.7rem, 6.5vw, 2.9rem);
  line-height: 1.14; letter-spacing: .03em;
}
.pagehead__lede {
  max-width: 36rem; margin: .4rem auto 0;
  font-size: 1.06rem; font-style: italic; color: var(--dim);
}

.quicknav { padding: 1.2rem 0 .2rem; }
.quicknav__label {
  margin: 0 0 .7rem;
  font-family: var(--f-label); font-weight: 300; font-size: .62rem;
  letter-spacing: .3em; text-transform: uppercase; color: var(--dim-2);
}
.quicknav__list {
  display: flex; gap: .5rem; margin: 0; padding: 0 0 .6rem;
  list-style: none; overflow-x: auto; scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.quicknav__list a {
  display: flex; align-items: center; gap: .5rem;
  padding: .35rem .7rem .35rem .35rem;
  border: 1px solid var(--ink-3); border-radius: 999px;
  background: var(--ink-2); color: #c4b894;
  text-decoration: none; white-space: nowrap;
  font-family: var(--f-label); font-weight: 300; font-size: .78rem;
  transition: border-color .18s, color .18s, background .18s;
}
.quicknav__list a:hover { border-color: var(--brass-lo); color: var(--brass-hi); background: #23231a; }
.quicknav__chip {
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(160deg, var(--brass-hi), var(--brass-lo));
  color: #1a1710; font-family: var(--f-head); font-weight: 700; font-size: .62rem;
}

.toolbar {
  position: sticky; top: 0; z-index: 20;
  padding: .7rem 0;
  background: rgba(18,18,13,.94);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--ink-3);
  border-bottom: 1px solid var(--brass-lo);
}
.toolbar__inner { display: flex; flex-wrap: wrap; gap: .7rem; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; flex: 0 1 12rem; }
.field__label {
  font-family: var(--f-label); font-weight: 300; font-size: .56rem;
  letter-spacing: .26em; text-transform: uppercase; color: #877c5c;
}
.field select {
  width: 100%;
  font-family: var(--f-label); font-weight: 300; font-size: .92rem;
  padding: .5rem 1.6rem .5rem .65rem;
  color: var(--paper); background-color: #1c1c15;
  border: 1px solid var(--ink-3); border-radius: var(--radius);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--brass) 50%),
                    linear-gradient(135deg, var(--brass) 50%, transparent 50%);
  background-position: right .78rem center, right .55rem center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.field select:focus { border-color: var(--brass); outline: none; }
.toolbar__count {
  margin: 0 0 .4rem auto;
  font-family: var(--f-label); font-weight: 300; font-size: .62rem;
  letter-spacing: .2em; text-transform: uppercase; color: var(--dim-2);
}

/* ---------- 5. dossiers -------------------------------- */

.roster { display: flex; flex-direction: column; gap: 1.6rem; padding: 1.6rem 0 1rem; }

.dossier {
  position: relative;
  display: grid; grid-template-columns: 1fr; gap: 0 1.4rem;
  background: var(--paper);
  background-image:
    radial-gradient(90% 70% at 12% 0%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(60% 50% at 90% 100%, rgba(140,109,33,.09), transparent 70%);
  color: var(--type);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgba(200,161,60,.28), 0 14px 34px rgba(0,0,0,.5);
  padding: 1.1rem;
  scroll-margin-top: 8rem;
}
.dossier::before {
  content: ""; position: absolute; inset: .38rem;
  border: 1px solid rgba(140,109,33,.34); pointer-events: none;
}
.dossier.is-open { box-shadow: 0 0 0 1px var(--brass), 0 18px 44px rgba(0,0,0,.6); }

/* portrait plate, shared with the home strip and article figures */
.plate {
  position: relative;
  width: 100%; max-width: 24rem; margin-inline: auto;
  aspect-ratio: 1 / 1;
  background: linear-gradient(165deg, #2c2b21, #17170f);
  border: 1px solid var(--brass-lo);
  overflow: hidden;
  margin-bottom: 1rem;
  transition: border-color .2s;
}
.plate img { width: 100%; height: 100%; object-fit: cover; }
.plate__mono {
  position: absolute; inset: 0;
  display: grid; place-content: center; gap: .5rem; justify-items: center;
  color: #6f6444; text-align: center;
}
.plate__mono b {
  font-family: var(--f-head); font-weight: 700; font-size: 2.4rem;
  letter-spacing: .08em; color: var(--brass-lo);
}
.plate__mono span {
  font-family: var(--f-label); font-weight: 300; font-size: .55rem;
  letter-spacing: .26em; text-transform: uppercase;
}
.plate:not(.is-empty) .plate__mono { display: none; }
.plate::after {
  content: ""; position: absolute; inset: 6px;
  border: 1px solid rgba(232,205,131,.3); pointer-events: none;
}
.plate__no {
  position: absolute; top: 0; left: 0; z-index: 2;
  padding: .22rem .5rem;
  background: var(--brass); color: #16150e;
  font-family: var(--f-label); font-weight: 500; font-size: .58rem; letter-spacing: .2em;
}

.ident { margin-bottom: .9rem; }
.ident__name {
  margin: 0;
  font-family: var(--f-head); font-weight: 700;
  font-size: clamp(1.3rem, 5vw, 1.75rem);
  line-height: 1.15; color: #1b1710;
}
.ident__title {
  margin: .3rem 0 0;
  font-family: var(--f-label); font-weight: 400; font-size: .8rem;
  letter-spacing: .2em; text-transform: uppercase; color: var(--oxblood);
}
.ident__hr {
  height: 3px; margin: .7rem 0 0; max-width: 7rem;
  border-top: 1px solid var(--brass-lo); border-bottom: 1px solid var(--brass-lo);
}

/* Derived stats, never authored. Presented the way the rest of the file
   is: a line typed on the form, with the rating stamped in afterwards. */
.vitals {
  display: flex; flex-wrap: wrap; gap: .1rem 2.2rem;
  margin: 0 0 .9rem; padding: .5rem 0 .35rem; list-style: none;
  border-top: 1px solid rgba(140,109,33,.4);
  border-bottom: 1px solid rgba(140,109,33,.4);
}
.vitals li { flex: 1 1 11rem; }
.vital {
  --ink: var(--oxblood);
  width: 100%;
  display: flex; align-items: baseline; gap: .45rem;
  padding: .1rem 0; background: none; border: 0;
  cursor: help; text-align: left;
}
.vital[data-stat="resolve"] { --ink: var(--verdigris); }

.vital__label {
  flex: 0 0 auto;
  font-family: var(--f-label); font-weight: 400; font-size: .66rem;
  letter-spacing: .3em; text-transform: uppercase; color: var(--type-soft);
}
/* dot leaders, the way a form runs the eye to the value */
.vital__leader {
  flex: 1 1 auto; min-width: 1rem;
  border-bottom: 1px dotted rgba(36,31,24,.42);
  transform: translateY(-.18em);
}

/* the stamp: hand-applied, so it sits a degree off true and sinks
   into the paper rather than printing on top of it */
.vital__stamp {
  position: relative;          /* anchors the inner ring */
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 2.2rem; height: 2.2rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  opacity: .82;
  transform: rotate(-4deg);
  mix-blend-mode: multiply;
  transition: transform .18s, opacity .18s;
}
.vital__stamp::before {
  content: ""; position: absolute;
  width: 1.74rem; height: 1.74rem;
  border: 1px solid var(--ink); border-radius: 50%;
  opacity: .55;
}
.vital__stamp b {
  font-family: var(--f-head); font-weight: 700; font-size: 1.12rem;
  line-height: 1; letter-spacing: 0;
}
.vital[data-stat="resolve"] .vital__stamp { transform: rotate(3deg); }
.vital:hover .vital__stamp,
.vital[aria-describedby] .vital__stamp { opacity: 1; transform: rotate(0deg); }

.ladder { margin: 0 0 1rem; padding: 0; list-style: none; display: grid; gap: .4rem; }
.ladder__row { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.ladder__rank {
  flex: 0 0 auto; min-width: 5.4rem; padding: .2rem .45rem;
  font-family: var(--f-label); font-weight: 500; font-size: .58rem;
  letter-spacing: .14em; text-transform: uppercase; text-align: center;
  border: 1px solid currentColor; color: var(--type-soft);
}
.ladder__row[data-rank="4"] .ladder__rank { background: var(--brass); border-color: var(--brass-lo); color: #16150e; }
.ladder__row[data-rank="3"] .ladder__rank { background: rgba(200,161,60,.32); color: #4b3c12; border-color: rgba(140,109,33,.6); }
.ladder__row[data-rank="2"] .ladder__rank { color: #6b5a2c; border-color: rgba(140,109,33,.5); }
.ladder__row[data-rank="1"] .ladder__rank { color: #857c66; border-color: rgba(0,0,0,.2); }

/* skill chips are buttons: they carry the tooltip */
.skill {
  padding: .18rem .5rem;
  font-family: var(--f-label); font-weight: 300; font-size: .76rem;
  letter-spacing: .04em;
  background: rgba(0,0,0,.045);
  border: 1px solid rgba(0,0,0,.13);
  border-bottom-style: dashed;
  border-radius: 999px;
  color: #33301f;
  cursor: help;
  transition: background .15s, border-color .15s, color .15s;
}
.skill:hover, .skill[aria-describedby] {
  background: var(--brass); border-color: var(--brass-lo); color: #16150e;
}
.ladder__row[data-rank="4"] .skill { font-weight: 400; background: rgba(200,161,60,.2); border-color: var(--brass-lo); }
.ladder__row .skill.is-hit { background: var(--verdigris); border-color: var(--verdigris); color: #f2efe4; }

.reveal {
  position: relative; overflow: hidden;
  max-height: 8.5rem;
  transition: max-height .42s cubic-bezier(.3,.7,.3,1);
}
.reveal::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 6rem;
  background: linear-gradient(180deg, rgba(233,225,205,0) 0%, rgba(233,225,205,.86) 55%, var(--paper) 100%);
  pointer-events: none; transition: opacity .3s;
}
.dossier.is-open .reveal { max-height: none; }
.dossier.is-open .reveal::after { opacity: 0; }

.toggle {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  width: 100%; margin-top: .8rem; padding: .6rem;
  cursor: pointer; background: transparent;
  border: 1px solid var(--brass-lo); border-radius: var(--radius);
  color: #5c4a16;
  font-family: var(--f-label); font-weight: 400; font-size: .7rem;
  letter-spacing: .22em; text-transform: uppercase;
  transition: background .2s, color .2s;
}
.toggle:hover { background: var(--brass-lo); color: var(--paper); }
.toggle__chev {
  width: 8px; height: 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .3s;
}
.dossier.is-open .toggle__chev { transform: translateY(1px) rotate(225deg); }

.bio p { margin: 0 0 .85rem; }
.bio p:last-child { margin-bottom: 0; }
.bio p:first-of-type::first-letter {
  float: left; line-height: .82; padding: .08em .12em 0 0;
  font-family: var(--f-head); font-weight: 700; font-size: 3.1em; color: var(--oxblood);
}

.kit { margin: 0; padding: 0; list-style: none; display: grid; gap: .55rem; }
.kit li { position: relative; padding-left: 1rem; font-size: .98rem; color: #35301f; }
.kit li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 6px; height: 6px; transform: rotate(45deg); border: 1px solid var(--brass-lo);
}
.kit b { font-family: var(--f-head); font-weight: 700; font-size: .92em; color: #241f14; }
.kit b::after { content: ": "; font-family: var(--f-body); font-weight: 400; color: var(--type-soft); }

/* knack panels: on the paper of a dossier, and on the dark reference page */
.knacks { display: grid; gap: .7rem; margin: 0; padding: 0; list-style: none; }
.knack {
  padding: .7rem .85rem;
  background: rgba(255,255,255,.42);
  border: 1px solid rgba(0,0,0,.06);
  border-left: 3px solid var(--brass-lo);
}
.knack__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; margin-bottom: .25rem; }
.knack__name {
  font-family: var(--f-head); font-weight: 700; font-size: .96rem;
  letter-spacing: .04em; text-transform: uppercase; color: #241f14;
}
.knack__cost {
  padding: .1rem .45rem;
  font-family: var(--f-label); font-weight: 400; font-size: .56rem;
  letter-spacing: .16em; text-transform: uppercase;
  border-radius: 999px; white-space: nowrap;
}
.knack__cost[data-cost="always"]           { background: rgba(56,112,106,.16); color: #24534e; border: 1px solid rgba(56,112,106,.5); }
.knack__cost[data-cost="spend 1"]          { background: rgba(200,161,60,.24); color: #5b4712; border: 1px solid var(--brass-lo); }
.knack__cost[data-cost="once per session"] { background: rgba(125,42,37,.14); color: var(--oxblood); border: 1px solid rgba(125,42,37,.5); }
.knack__text { margin: 0; font-size: .98rem; color: #35301f; }

.empty { padding: 3rem 1rem; text-align: center; color: var(--dim); font-style: italic; }

/* ---------- 6. article pages --------------------------- */

.article { padding-top: 1.8rem; }

.section-head {
  display: flex; align-items: center; gap: .7rem;
  margin: 2.2rem 0 .9rem;
  font-family: var(--f-label); font-weight: 400; font-size: .68rem;
  letter-spacing: .3em; text-transform: uppercase;
  color: var(--type-soft);
}
.section-head::after { content: ""; flex: 1; height: 1px; background: rgba(140,109,33,.45); }
.section-head span { flex: 0 0 auto; }
.reveal .section-head:first-child { margin-top: 0; }

/* on the dark pages the heads flip to brass */
.article .section-head,
.section-head--dark { color: var(--brass); }
.article .section-head::after,
.section-head--dark::after { background: var(--brass-lo); }

.prose p { margin: 0 0 1.05rem; color: #ccc2a6; font-size: 1.09rem; line-height: 1.74; }
.prose p b { color: var(--brass-hi); font-weight: 500; }
.prose > p:first-of-type::first-letter,
.prose .section-head + p::first-letter {
  float: left; line-height: .82; padding: .08em .14em 0 0;
  font-family: var(--f-head); font-weight: 700; font-size: 3.2em; color: var(--brass);
}
.lede { margin: 0 0 1rem; color: var(--dim); font-style: italic; font-size: 1.06rem; }

/* figures */
.figure { margin: 1.8rem 0; }
.frame {
  position: relative;
  /* letterbox rather than max-height: with aspect-ratio a height cap
     shrinks the width instead, pulling the plate off the measure */
  aspect-ratio: 21 / 9;
  background: linear-gradient(165deg, #23221a, #15150f);
  border: 1px solid var(--brass-lo);
  overflow: hidden;
}
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame::after {
  content: ""; position: absolute; inset: 6px;
  border: 1px solid rgba(232,205,131,.26); pointer-events: none;
}
.frame__ph {
  position: absolute; inset: 0;
  display: grid; place-content: center; gap: .5rem; justify-items: center;
  text-align: center;
  background-image: repeating-linear-gradient(45deg,
      rgba(200,161,60,.05) 0 10px, transparent 10px 20px);
}
.frame__ph b { font-family: var(--f-head); font-size: 1.6rem; color: var(--brass-lo); }
.frame__ph span {
  font-family: var(--f-label); font-weight: 300; font-size: .58rem;
  letter-spacing: .26em; text-transform: uppercase; color: #6f6444;
}
.frame:not(.is-empty) .frame__ph { display: none; }
.frame--portrait { aspect-ratio: 3 / 4; }
.frame--square { aspect-ratio: 1 / 1; }

/* Once real art loads, the figure takes that image's ratio and is capped
   by height rather than width, so a square plate becomes a centred square
   instead of a page-tall slab. The authored ratios above only ever
   describe the placeholder. */
.figure.is-filled { max-width: min(100%, calc(30rem * var(--ar))); margin-inline: auto; }
.figure.is-filled .frame { aspect-ratio: var(--ar); }
.figure figcaption {
  margin-top: .55rem;
  font-family: var(--f-label); font-weight: 300; font-size: .68rem;
  letter-spacing: .1em; color: var(--dim-2); line-height: 1.5;
}
.figure--wide { margin: 2rem 0 2.4rem; }

.figrow { display: grid; gap: 1.2rem; margin: 1.4rem 0; }
.figrow .figure { margin: 0; }
.figrow__body p:last-child { margin-bottom: 0; }

/* callouts */
.callout {
  margin: 1.8rem 0; padding: 1.1rem 1.2rem;
  background: #1a1a13;
  border: 1px solid var(--ink-3); border-left: 3px solid var(--brass);
}
.callout h3 {
  margin: 0 0 .7rem;
  font-family: var(--f-label); font-weight: 400; font-size: .64rem;
  letter-spacing: .28em; text-transform: uppercase; color: var(--brass);
}
.callout ul, .callout ol { margin: 0; padding-left: 1.1rem; color: #bdb395; }
.callout li { margin-bottom: .45rem; }
.callout li:last-child { margin-bottom: 0; }
.callout b { color: var(--brass-hi); font-weight: 500; }
.callout--clip { border-left-color: var(--dim-2); }
.callout--clip ul { list-style: none; padding-left: 0; }
.callout--clip li { position: relative; padding-left: 1.2rem; }
.callout--clip li::before {
  content: "\203A"; position: absolute; left: .2rem; color: var(--brass-lo);
}
.callout--kit ul { list-style: none; padding-left: 0; }
.callout--kit li { position: relative; padding-left: 1.2rem; }
.callout--kit li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 6px; height: 6px; transform: rotate(45deg); border: 1px solid var(--brass);
}

.pullquote {
  margin: 2rem 0; padding: 1.2rem 0;
  border-top: 1px solid var(--brass-lo); border-bottom: 1px solid var(--brass-lo);
  text-align: center;
}
.pullquote p {
  margin: 0;
  font-family: var(--f-head); font-weight: 500;
  font-size: clamp(1.15rem, 3.6vw, 1.5rem);
  line-height: 1.4; color: var(--brass-hi);
}

/* ---------- 7. reference page -------------------------- */

.skillgrid { display: grid; gap: .8rem; margin-bottom: 1.6rem; }
.skillcard {
  padding: .9rem 1rem;
  background: #1a1a13;
  border: 1px solid var(--ink-3);
  border-top: 2px solid var(--brass-lo);
}
.skillcard__name {
  margin: 0 0 .3rem;
  font-family: var(--f-head); font-weight: 700; font-size: 1.05rem;
  letter-spacing: .04em; color: var(--paper);
}
.skillcard__text { margin: 0; font-size: 1rem; color: #a89e80; }
.skillcard__best {
  margin: .6rem 0 0; padding-top: .5rem;
  border-top: 1px dotted rgba(140,109,33,.4);
  font-family: var(--f-label); font-weight: 300; font-size: .62rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--dim-2);
}
.skillcard__best a { color: var(--brass); text-decoration: none; border-bottom: 1px solid rgba(200,161,60,.4); }
.skillcard__best a:hover { color: var(--brass-hi); }
.pip {
  display: inline-block; margin-left: .2rem; padding: .05rem .35rem;
  border-radius: 999px; font-size: .58rem;
  background: rgba(200,161,60,.2); border: 1px solid var(--brass-lo); color: var(--brass-hi);
}
.pip[data-rank="4"] { background: var(--brass); color: #16150e; }

.notes { display: grid; gap: .7rem; margin-bottom: 1rem; }
.note {
  margin: 0; padding: .8rem 1rem;
  background: #1a1a13; border-left: 3px solid var(--verdigris);
  color: #bdb395; font-size: 1rem;
}
.note b { color: var(--brass-hi); font-weight: 500; }
.note--rule { font-family: var(--f-head); font-size: 1.05rem; color: var(--paper); }

.pyramid { margin: 0 0 1rem; padding: 0; list-style: none; display: grid; gap: .4rem; justify-items: center; }
.tier {
  width: var(--w, 100%); min-width: 12rem;
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: .55rem .9rem;
  border: 1px solid var(--brass-lo);
}
.tier b {
  font-family: var(--f-label); font-weight: 500; font-size: .7rem;
  letter-spacing: .18em; text-transform: uppercase;
}
.tier span { font-family: var(--f-body); font-size: .95rem; color: #a89e80; }
.tier[data-rank="4"] { background: var(--brass); color: #16150e; }
.tier[data-rank="4"] span { color: #43350d; }
.tier[data-rank="3"] { background: rgba(200,161,60,.34); color: var(--paper); }
.tier[data-rank="2"] { background: rgba(200,161,60,.18); color: var(--paper); }
.tier[data-rank="1"] { background: rgba(200,161,60,.08); color: #cdc3a6; }
.pyramid__outro { margin: 0 0 1rem; color: #a89e80; font-size: 1.02rem; }
.pyramid__outro em { color: var(--brass-hi); font-style: italic; }

.tier[data-rank="-1"] {
  background: transparent;
  border-style: dashed; border-color: rgba(125,42,37,.7);
  color: #b0987c;
}
.tier[data-rank="-1"] b { color: #c07a6f; }
.tier[data-rank="-1"] span { color: #8d825f; }

.knacknote {
  margin: -.4rem 0 1.2rem; padding-left: .9rem;
  border-left: 2px solid var(--brass-lo);
  color: var(--dim); font-size: 1rem;
}

.vitalcards { margin: 0 0 1rem; padding: 0; list-style: none; display: grid; gap: .8rem; }
.vitalcard {
  padding: .9rem 1rem;
  background: #1a1a13; border: 1px solid var(--ink-3); border-top: 2px solid var(--brass-lo);
}
.vitalcard h3 {
  margin: 0 0 .25rem;
  font-family: var(--f-head); font-weight: 700; font-size: 1.05rem;
  letter-spacing: .06em; color: var(--paper);
}
.vitalcard__formula {
  margin: 0 0 .4rem;
  font-family: var(--f-label); font-weight: 300; font-size: .7rem;
  letter-spacing: .08em; color: var(--brass-hi);
}
.vitalcard__text { margin: 0; color: #a89e80; font-size: 1rem; }

.spread { display: grid; grid-template-columns: 1fr auto auto; gap: .3rem .9rem; align-items: baseline; }
.spread__head {
  font-family: var(--f-label); font-weight: 300; font-size: .56rem;
  letter-spacing: .2em; text-transform: uppercase; color: var(--dim-2);
  padding-bottom: .2rem; border-bottom: 1px solid var(--ink-3);
}
.spread a { color: #c4b894; text-decoration: none; font-size: .98rem; }
.spread a:hover { color: var(--brass-hi); }
.spread b {
  font-family: var(--f-head); font-weight: 700; font-size: .95rem; text-align: center;
}
.spread [data-stat="grit"]    { color: #c07a6f; }
.spread [data-stat="resolve"] { color: #6fb3aa; }
.spread__head[data-stat] { text-align: center; }

.chips { margin: 0; padding: 0; list-style: none; display: grid; gap: .7rem; align-content: start; }
.chipnote {
  padding: .8rem 1rem;
  background: #1a1a13; border: 1px solid var(--ink-3); border-left: 3px solid var(--brass);
}
.chipnote b {
  display: block; margin-bottom: .2rem;
  font-family: var(--f-head); font-weight: 700; font-size: 1rem; color: var(--brass-hi);
}
.chipnote span { color: #a89e80; font-size: 1rem; }

.filterbar { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.4rem; }
.chipbtn {
  cursor: pointer; padding: .4rem .8rem;
  background: #1c1c15; border: 1px solid var(--ink-3); border-radius: 999px;
  color: #b3a884;
  font-family: var(--f-label); font-weight: 300; font-size: .66rem;
  letter-spacing: .16em; text-transform: uppercase;
  transition: background .18s, color .18s, border-color .18s;
}
.chipbtn__n {
  display: inline-block; margin-left: .5rem; padding: 0 .35rem;
  border-radius: 999px; font-size: .58rem;
  background: rgba(200,161,60,.18); color: var(--brass-hi);
}
.chipbtn[aria-pressed="true"] .chipbtn__n { background: rgba(0,0,0,.22); color: #16150e; }
.chipbtn:hover { border-color: var(--brass-lo); color: var(--brass-hi); }
.chipbtn[aria-pressed="true"] { background: var(--brass); border-color: var(--brass); color: #16150e; }

.knackgroup { margin-bottom: 2rem; }
.knackgroup__head { margin-bottom: .9rem; }
.knackgroup__head h3 {
  margin: 0;
  font-family: var(--f-head); font-weight: 700; font-size: 1.2rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--brass);
}
.knackgroup__head p { margin: .15rem 0 0; color: var(--dim); font-style: italic; }

/* knacks on the dark reference page invert the paper styling */
.knackgroup .knack { background: #1a1a13; border-color: var(--ink-3); border-left-color: var(--brass-lo); }
.knackgroup .knack__name { color: var(--paper); }
.knackgroup .knack__text { color: #a89e80; }
.knack__holder {
  padding: .1rem .5rem; border-radius: 999px;
  font-family: var(--f-label); font-weight: 300; font-size: .56rem;
  letter-spacing: .16em; text-transform: uppercase; white-space: nowrap;
  background: rgba(200,161,60,.16); border: 1px solid var(--brass-lo);
  color: var(--brass-hi); text-decoration: none;
}
a.knack__holder:hover { background: var(--brass); color: #16150e; }
.knack__holder--open { background: transparent; border-color: var(--ink-3); color: var(--dim-2); }

/* ---------- 8. tooltips -------------------------------- */

.tip {
  position: fixed; z-index: 80;
  max-width: min(20rem, calc(100vw - 2rem));
  padding: .6rem .75rem;
  background: #16160f;
  border: 1px solid var(--brass);
  box-shadow: 0 10px 30px rgba(0,0,0,.65);
  pointer-events: none;
}
.tip__title {
  display: block; margin-bottom: .2rem;
  font-family: var(--f-label); font-weight: 500; font-size: .6rem;
  letter-spacing: .22em; text-transform: uppercase; color: var(--brass);
}
.tip__body { display: block; font-size: .95rem; line-height: 1.5; color: #d3c9ae; }
.tip__arrow {
  position: absolute; bottom: -5px; width: 8px; height: 8px;
  margin-left: -4px; transform: rotate(45deg);
  background: #16160f;
  border-right: 1px solid var(--brass); border-bottom: 1px solid var(--brass);
}
.tip.is-below .tip__arrow {
  bottom: auto; top: -5px;
  border: 0;
  border-left: 1px solid var(--brass); border-top: 1px solid var(--brass);
}

/* ---------- 9. wide screens ---------------------------- */

@media (min-width: 34rem) {
  .strip { grid-template-columns: repeat(4, 1fr); }
  .navcards { grid-template-columns: 1fr 1fr; }
  .pagenav { grid-template-columns: 1fr 1fr; }
  .skillgrid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 40rem) {
  .dossier {
    grid-template-columns: 15rem 1fr;
    grid-template-rows: auto auto 1fr auto auto;
    padding: 1.4rem;
  }
  .plate { grid-column: 1; grid-row: 1 / span 3; align-self: start; margin-bottom: 0; }
  .ident  { grid-column: 2; align-self: start; }
  .vitals { grid-column: 2; align-self: start; margin-bottom: 0; }
  .ladder { grid-column: 2; align-self: start; margin: .9rem 0 0; }
  .reveal, .toggle { grid-column: 1 / -1; }
  .reveal { margin-top: 1.2rem; }
  .kit { grid-template-columns: 1fr 1fr; gap: .55rem 1.4rem; }

  .figrow { grid-template-columns: 15rem 1fr; align-items: start; }
  .figrow .figure--inline { position: sticky; top: 5rem; }
}

@media (min-width: 52rem) {
  .dossier { grid-template-columns: 18rem 1fr; padding: 1.6rem; }
  .skillgrid { grid-template-columns: repeat(3, 1fr); }
  .vitalcards { grid-template-columns: 1fr 1fr; }
  .vitalcard--wide { grid-column: 1 / -1; }
  .navcards { grid-template-columns: repeat(4, 1fr); }
  .knacks { grid-template-columns: 1fr 1fr; }
  .knackgroup .knacks { grid-template-columns: 1fr 1fr; }
}

/* ---------- 10. motion / print ------------------------- */

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

@media print {
  body { background: #fff; color: #000; }
  .topbar, .toolbar, .quicknav, .hero__rays, .toggle, .skip, .tip, .filterbar, .pagenav { display: none !important; }
  .dossier { break-inside: avoid; box-shadow: none; border: 1px solid #999; }
  .reveal { max-height: none !important; }
  .reveal::after { display: none; }
  .prose p, .skillcard__text, .knack__text { color: #000; }
}
