/* ================================================================== */
/* Homebrew — editorial system                                         */
/* Brand-locked: Playfair display + system sans + tracked-caps utility. */
/* Devices: eyebrow + hairline rule, plum-night negative bands,         */
/* hairline-outlined equal-height cards with hover-pop, the open book.  */
/* ================================================================== */

.hb { max-width: 960px; margin: 0 auto; padding: var(--spacing-2xl) var(--spacing-lg); }

/* Brand links across the whole homebrew scope (kills UA default blue).
   Excludes .btn so button labels keep their own color (else purple-on-purple). */
.hb a:not(.btn) { color: var(--primary); text-decoration: none; }
.hb a:not(.btn):hover { text-decoration: underline; }

/* Headings → Playfair display (these pages never inherited it before). */
.hb h1 { font-family: 'Playfair Display', serif; font-weight: 800; font-size: var(--font-size-3xl); line-height: 1.12; letter-spacing: -0.01em; color: var(--heading-color); margin: 0 0 var(--spacing-md); }
.hb h2 { font-family: 'Playfair Display', serif; font-weight: 700; font-size: var(--font-size-2xl); line-height: 1.2; color: var(--heading-color); margin: 0; }
.hb h3 { font-family: 'Playfair Display', serif; font-weight: 700; font-size: var(--font-size-lg); color: var(--heading-color); margin: 0 0 var(--spacing-sm); }
.hb em { font-style: italic; } /* Playfair italic accent word */
.hb p { line-height: 1.75; }

.hb-head { text-align: center; max-width: 720px; margin: 0 auto var(--spacing-3xl); }
.hb-lede { font-size: var(--font-size-lg); color: var(--text-muted); line-height: 1.6; margin: var(--spacing-md) 0 0; }

/* ---- Utility label / eyebrow ------------------------------------- */
.hb-eyebrow { font-size: var(--font-size-xs); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--primary); }
.hb-eyebrow .num { color: var(--secondary-dark); }
/* CSS-drawn separator dot (no middot/em-dash glyphs allowed in copy). */
.hb-dot { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.5; vertical-align: middle; margin: 0 0.55em; }
.hb-head .hb-eyebrow { display: block; margin-bottom: var(--spacing-md); }

/* ---- Section header: rule + eyebrow + serif heading -------------- */
.hb-section { margin: var(--spacing-3xl) 0; }
.hb-sechead { border-top: 1px solid var(--border-medium); padding-top: var(--spacing-md); margin-bottom: var(--spacing-xl); display: flex; align-items: center; gap: var(--spacing-md); flex-wrap: wrap; }
.hb-sechead .hb-eyebrow { display: inline-flex; align-items: center; gap: var(--spacing-sm); }
.hb-sechead .hb-eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--secondary); border-radius: 1px; }
.hb-sechead h2 { flex-basis: 100%; }

/* ================================================================== */
/* Open book — the signature                                           */
/* ================================================================== */
.hb-book {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--container);
  border: 1.5px solid var(--border-medium);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: var(--spacing-3xl);
  box-shadow: 0 16px 48px -24px rgba(20, 16, 40, 0.45);
}
.hb-book-left { padding: var(--spacing-xl); box-shadow: inset -22px 0 26px -22px rgba(20, 16, 40, 0.32); }
.hb-book-right { background-size: cover; background-position: center; min-height: 440px; box-shadow: inset 22px 0 26px -22px rgba(20, 16, 40, 0.32); }
/* Center spine: hairline that fades toward top and bottom, so the
   pages read as curving away from the fold (the "book icon" curve). */
.hb-book::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 5%;
  bottom: 5%;
  width: 1.5px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, transparent, var(--border-medium) 10%, var(--border-medium) 90%, transparent);
}

.hb-statcard-head { font-family: 'Playfair Display', serif; font-weight: 700; font-size: var(--font-size-xl); color: var(--heading-color); margin: 0 0 var(--spacing-lg); }

/* Stat band */
.hb-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0 0 var(--spacing-lg); border-top: 1px solid var(--border-medium); border-bottom: 1px solid var(--border-medium); }
.hb-stats--abilities { grid-template-columns: repeat(6, 1fr); }
.hb-stats > div { text-align: center; padding: var(--spacing-md) var(--spacing-xs); }
.hb-stats > div + div { border-left: 1px solid var(--border-subtle); }
.hb-stats dt { font-size: var(--font-size-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.hb-stats dd { margin: 0; font-family: 'Playfair Display', serif; font-weight: 700; font-size: var(--font-size-lg); font-variant-numeric: tabular-nums; color: var(--heading-color); }

.hb-statcard p { margin: 0 0 var(--spacing-sm); }
.hb-statcard p strong { color: var(--heading-color); }
.hb-statline { font-size: var(--font-size-sm); letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }

@media (max-width: 768px) {
  .hb-book { grid-template-columns: 1fr; }
  .hb-book::after { display: none; }
  .hb-book-left, .hb-book-right { box-shadow: none; }
  .hb-book-right { order: -1; min-height: 240px; }
}

/* ---- Chips ------------------------------------------------------- */
.hb-chips { list-style: none; display: flex; flex-wrap: wrap; gap: var(--spacing-sm); justify-content: center; padding: 0; margin: var(--spacing-md) 0 var(--spacing-lg); }
.hb-chip { font-size: var(--font-size-xs); font-weight: 600; letter-spacing: 0.04em; padding: 4px var(--spacing-sm); border-radius: 9999px; background: var(--primary-light); color: var(--primary-dark); }
.hb-chip--role { background: var(--secondary-light); color: var(--secondary-dark); }
.hb-chip--env { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border-medium); }

.hb-appears { font-size: var(--font-size-sm); color: var(--text-muted); }

/* ================================================================== */
/* Cards — universal: hairline outline, equal height, hover-pop        */
/* ================================================================== */
.hb-cardgrid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--spacing-md); }
.hb-card { display: flex; }
.hb-card > a {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  text-align: center; gap: var(--spacing-sm);
  padding: var(--spacing-lg) var(--spacing-md);
  background: var(--container); border: 1px solid var(--border-medium); border-radius: var(--radii-lg);
  color: var(--text-primary);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.hb-card > a:hover { transform: translateY(-4px); border-color: var(--primary); background: var(--primary-light); box-shadow: 0 14px 30px -14px rgba(20, 16, 40, 0.38); z-index: 2; text-decoration: none; }
.hb-card-avatar { width: 76px; height: 76px; border-radius: 9999px; background-size: cover; background-position: center; box-shadow: 0 2px 10px -3px rgba(0, 0, 0, 0.3); }
.hb-card-name { font-weight: 700; color: var(--heading-color); line-height: 1.2; }
.hb-card-meta { font-size: var(--font-size-xs); letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted); margin-top: auto; }

@media (max-width: 900px) { .hb-cardgrid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .hb-cardgrid { grid-template-columns: repeat(2, 1fr); } }

/* ================================================================== */
/* Statblock page — how to run / story hooks / one-shot                */
/* ================================================================== */
/* Story hooks live in a plum-night negative band. */
.hb-hooks-band { background: var(--cta-background); color: #fff; border-radius: var(--radii-lg); padding: var(--spacing-2xl); }
.hb-hooks-band .hb-sechead { border-top-color: rgba(255, 255, 255, 0.18); }
.hb-hooks-band .hb-eyebrow { color: var(--secondary-light); }
.hb-hooks-band h2 { color: #fff; }
.hb-hooklist { list-style: none; padding: 0; margin: 0; }
.hb-hook { display: grid; grid-template-columns: auto 1fr; gap: var(--spacing-lg); align-items: baseline; padding: var(--spacing-lg) 0; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.hb-hook:first-child { border-top: none; padding-top: 0; }
.hb-hook-num { font-family: 'Playfair Display', serif; font-weight: 700; font-size: var(--font-size-2xl); color: var(--secondary); line-height: 1; }
.hb-hook p { margin: 0; color: rgba(255, 255, 255, 0.92); }

/* Read-aloud boxed text: serif italic with a gold rule. */
.hb-boxed { font-family: 'Playfair Display', serif; font-style: italic; font-size: var(--font-size-lg); line-height: 1.55; color: var(--heading-color); border-left: 3px solid var(--secondary); padding: 2px 0 2px var(--spacing-lg); margin: var(--spacing-md) 0; }
.hb-chapter { margin-top: var(--spacing-lg); }

.hb-paywall { background: var(--cta-background); color: #fff; border-radius: var(--radii-lg); padding: var(--spacing-2xl); text-align: center; margin-top: var(--spacing-lg); }
.hb-paywall p { color: rgba(255, 255, 255, 0.85); margin: 0 0 var(--spacing-md); }

.hb-related { color: var(--text-muted); font-size: var(--font-size-sm); }

/* ================================================================== */
/* Theme page — plot hooks / cast / one-shots                          */
/* ================================================================== */
/* Plot hooks: masonry of creature cards (art banner + that creature's
   hooks). Varied heights break the "infinite list" monotony and remove
   the repeated-thumbnail problem. */
.hb-hookmasonry { columns: 2; column-gap: var(--spacing-md); }
.hb-hookgroup { display: inline-block; width: 100%; break-inside: avoid; margin: 0 0 var(--spacing-md); border: 1px solid var(--border-medium); border-radius: var(--radii-lg); overflow: hidden; background: var(--container); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.hb-hookgroup:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: 0 16px 34px -16px rgba(20, 16, 40, 0.35); }
.hb-hookgroup-art { display: block; height: 160px; background-size: cover; background-position: center 22%; }
.hb-hookgroup-body { padding: var(--spacing-lg); }
.hb-hookgroup-name { margin: 0; }
.hb-hookgroup-body .hb-eyebrow { display: block; margin: 4px 0 var(--spacing-md); color: var(--text-muted); }
.hb-hookgroup-hooks { list-style: none; padding: 0; margin: 0 0 var(--spacing-md); display: grid; gap: var(--spacing-md); }
.hb-hookgroup-hooks li { padding-left: var(--spacing-md); border-left: 2px solid var(--secondary); color: var(--text-primary); font-size: var(--font-size-sm); line-height: 1.55; }
.hb-hookcard-run { font-weight: 700; font-size: var(--font-size-sm); }

/* Cast: shared card grid. One-shots: horizontal cards with art. */
.hb-oneshotgrid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-md); }
.hb-oneshotcard { display: grid; grid-template-columns: 96px 1fr; border: 1px solid var(--border-medium); border-radius: var(--radii-lg); overflow: hidden; background: var(--container); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.hb-oneshotcard:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: 0 16px 34px -16px rgba(20, 16, 40, 0.35); }
.hb-oneshotcard-art { background-size: cover; background-position: center; }
.hb-oneshotcard-body { padding: var(--spacing-lg); }
.hb-oneshot-meta { font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--secondary-dark); font-weight: 700; }
.hb-oneshotcard-body .hb-oneshot-meta { display: block; margin-bottom: 4px; }
.hb-oneshots-title { display: block; font-family: 'Playfair Display', serif; font-weight: 700; font-size: var(--font-size-lg); margin-bottom: var(--spacing-sm); }
.hb-oneshotcard-body p { margin: 0; font-size: var(--font-size-sm); color: var(--text-muted); line-height: 1.55; }

@media (max-width: 640px) {
  .hb-hookmasonry { columns: 1; }
  .hb-oneshotgrid { grid-template-columns: 1fr; }
}

/* ================================================================== */
/* Themes index — collection cards                                     */
/* ================================================================== */
.hb-themegrid { list-style: none; padding: 0; margin: var(--spacing-2xl) 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--spacing-md); }
.hb-themecard { display: flex; }
.hb-themecard > a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: var(--spacing-sm);
  text-decoration: none; color: var(--text-primary);
  padding: var(--spacing-xl) var(--spacing-lg);
  border-radius: var(--radii-lg); background: var(--container); border: 1px solid var(--border-medium);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.hb-themecard > a:hover { transform: translateY(-4px); border-color: var(--primary); background: var(--primary-light); box-shadow: 0 14px 30px -14px rgba(20, 16, 40, 0.38); text-decoration: none; }
.hb-themecard-cluster { display: flex; justify-content: center; }
.hb-themecard-avatar { width: 44px; height: 44px; border-radius: 9999px; background-size: cover; background-position: center; margin-left: -12px; border: 2px solid var(--container); flex-shrink: 0; }
.hb-themecard-cluster .hb-themecard-avatar:first-child { margin-left: 0; }
.hb-themecard-label { font-family: 'Playfair Display', serif; font-weight: 700; font-size: var(--font-size-lg); text-align: center; color: var(--heading-color); }
.hb-themecard-count { font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }

@media (max-width: 900px) { .hb-themegrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .hb-themegrid { grid-template-columns: 1fr; } }

/* ================================================================== */
/* Landing — cover spread (pillars are whole-panel links)              */
/* ================================================================== */
.hb-cover-spread { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--border-medium); border-radius: 18px; overflow: hidden; margin: 0 0 var(--spacing-3xl); box-shadow: 0 16px 48px -24px rgba(20, 16, 40, 0.4); }
a.hb-cover-hub { display: flex; flex-direction: column; gap: var(--spacing-sm); padding: var(--spacing-2xl) var(--spacing-xl); text-decoration: none; color: var(--text-primary); transition: background .18s ease; }
a.hb-cover-hub:hover { background: var(--primary-light); text-decoration: none; }
.hb-cover-hub--left { border-right: 1.5px solid var(--border-medium); }
.hb-cover-hub--right { background: var(--surface); }
.hb-cover-hub--right:hover { background: var(--primary-light); }

.hb-cover-avatar-cluster { display: flex; margin-bottom: var(--spacing-sm); }
.hb-cover-avatar { width: 52px; height: 52px; border-radius: 9999px; background-size: cover; background-position: center; border: 2px solid var(--container); margin-left: -14px; flex-shrink: 0; box-shadow: 0 2px 8px -3px rgba(0, 0, 0, 0.3); }
.hb-cover-avatar:first-child { margin-left: 0; }

.hb-cover-spread .hb-cover-hub-label { font-family: 'Playfair Display', serif; font-weight: 800; font-size: var(--font-size-2xl); color: var(--primary); margin: 0; }
.hb-cover-hub-pitch { color: var(--text-muted); margin: 0; font-size: var(--font-size-md); flex: 1; line-height: 1.5; }
.hb-cover-hub-count { font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin: 0; }

.hb-cover-theme-tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--spacing-xs); margin: 0 0 var(--spacing-sm); min-height: 56px; align-items: flex-start; align-content: flex-start; }

.hb-latest-more { text-align: center; margin-top: var(--spacing-xl); }
.hb-latest-more a { font-weight: 700; font-size: var(--font-size-sm); text-transform: uppercase; letter-spacing: 0.06em; }

@media (max-width: 768px) {
  .hb-cover-spread { grid-template-columns: 1fr; }
  .hb-cover-hub--left { border-right: none; border-bottom: 1.5px solid var(--border-medium); }
}

/* ================================================================== */
/* Bookmark anchor nav — reserved left gutter rail                     */
/* ================================================================== */
:root { --hb-rail: 200px; }

.hb-page-rail { display: grid; grid-template-columns: var(--hb-rail) minmax(0, 1fr); gap: var(--spacing-xl); max-width: 1200px; margin: 0 auto; padding: 0 var(--spacing-lg); align-items: start; }
.hb-bookmarks { position: sticky; top: var(--spacing-2xl); padding-top: var(--spacing-3xl); }
.hb-bookmarks ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--spacing-md); }
.hb-bookmarks a { display: flex; align-items: center; gap: var(--spacing-sm); text-decoration: none; color: var(--text-muted); font-size: var(--font-size-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 0; transition: color 0.2s; }
.hb-bookmarks a:hover, .hb-bookmarks a[aria-current="true"] { color: var(--text-primary); text-decoration: none; }
.hb-bookmark-bar { display: inline-block; height: 2px; width: 16px; background: var(--primary); border-radius: 1px; opacity: 0.3; transition: width 0.25s ease, opacity 0.25s ease; flex-shrink: 0; }
.hb-bookmarks a:hover .hb-bookmark-bar, .hb-bookmarks a[aria-current="true"] .hb-bookmark-bar { width: 32px; opacity: 1; }

@media (max-width: 768px) {
  .hb-page-rail { grid-template-columns: 1fr; padding: 0; }
  .hb-bookmarks { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hb-bookmark-bar { transition: none; }
  .hb-card > a, .hb-themecard > a, .hb-hookgroup, .hb-oneshotcard, a.hb-cover-hub { transition: none; }
}
