/* ==========================================================================
   Nightjar — reader-facing pages (home, browse, genres, story, library)
   ========================================================================== */

.page-head {
  padding: var(--s7) 0 var(--s5);
  max-width: 720px;
}
.page-head h1 {
  margin-top: 10px;
  font-size: var(--fs-3xl);
}
.page-head p {
  margin-top: 12px;
  font-size: var(--fs-lg);
  color: var(--ink-2);
}

/* segmented control */
.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--paper-2);
}
.seg__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  min-width: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-2);
}
.seg__btn[aria-pressed="true"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

/* ---------- HOME: hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--night);
  color: var(--night-fg);
  padding: clamp(40px, 6vw, 80px) 0 28px;
  isolation: isolate;
}
.hero__glow {
  position: absolute;
  inset: -20% -10% auto auto;
  width: 70%;
  height: 140%;
  background: radial-gradient(closest-side, var(--hero-accent, #f08a4b) 0%, transparent 70%);
  opacity: 0.28;
  filter: blur(20px);
  z-index: -1;
  transition: background 0.6s;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(241, 234, 220, 0.5) 1px, transparent 1.2px);
  background-size: 120px 120px;
  background-position: 13px 37px;
  opacity: 0.18;
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}
.hero__in {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  min-height: 420px;
}
.hero__copy {
  animation: rise 0.6s var(--ease);
}
.hero .eyebrow {
  color: var(--ember-bright);
}
.hero__title {
  margin-top: 16px;
  font-size: clamp(2.4rem, 1.2rem + 4.4vw, 4.6rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.hero__title a {
  text-decoration: none;
}
.hero__tagline {
  margin-top: 18px;
  max-width: 46ch;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-xl);
  line-height: 1.35;
  color: #e3dacb;
}
.hero__by {
  margin-top: 14px;
  color: var(--night-muted);
}
.hero__by strong {
  color: var(--night-fg);
  font-weight: 600;
}
.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 22px;
  font-size: var(--fs-sm);
  color: var(--night-muted);
}
.hero__stats span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hero__stats .ico {
  width: 16px;
  height: 16px;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.hero__art {
  position: relative;
  justify-self: center;
  width: min(300px, 70vw);
  aspect-ratio: 2 / 3;
  animation: rise 0.7s var(--ease);
}
.hero__art .cover {
  position: absolute;
  inset: 0;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7), 0 2px 4px rgba(0, 0, 0, 0.3);
}
.hero__art .cover--back {
  transform: translate(26%, 6%) rotate(8deg) scale(0.9);
  opacity: 0.55;
  filter: saturate(0.7) brightness(0.8);
}
.hero__art .cover--front {
  transform: rotate(-3deg);
}
.hero__art a:hover .cover--front {
  transform: rotate(-1.5deg) translateY(-4px);
}
.hero__art .cover--front {
  transition: transform 0.4s var(--ease);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}
.hero__picks {
  display: flex;
  gap: 10px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--night-3);
  overflow-x: auto;
  scrollbar-width: none;
}
.pick {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  padding: 8px 14px 8px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--night-muted);
  text-align: left;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.pick:hover {
  background: var(--night-2);
  color: var(--night-fg);
}
.pick[aria-selected="true"] {
  background: var(--night-2);
  border-color: var(--night-3);
  color: var(--night-fg);
}
.pick__cover {
  width: 34px;
  flex: none;
  border-radius: 2px;
  overflow: hidden;
}
.pick strong {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.25;
}
.pick small {
  font-size: 0.72rem;
}

/* ---------- HOME: continue ---------- */
.continue {
  background: var(--paper-2);
}
.continue__row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.ccard {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--card);
  text-decoration: none;
  box-shadow: var(--shadow-1);
  transition: box-shadow 0.25s, transform 0.25s var(--ease);
}
.ccard:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}
.ccard .cover {
  width: 58px;
  flex: none;
}
.ccard__body {
  min-width: 0;
  flex: 1;
}
.ccard__body strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.2;
}
.ccard__body small {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: var(--fs-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meter {
  height: 4px;
  margin-top: 10px;
  border-radius: 4px;
  background: var(--paper-2);
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  width: var(--p);
  background: var(--ember);
  border-radius: inherit;
}
.ccard__go {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  flex: none;
}

/* ---------- HOME: pulse (feed + ranking) ---------- */
.pulse {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
.feed {
  list-style: none;
  border-top: 1px solid var(--line);
}
.feed li {
  border-bottom: 1px solid var(--line);
}
.feed a {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 4px;
  text-decoration: none;
  transition: background 0.2s;
}
.feed a:hover {
  background: rgba(255, 255, 255, 0.5);
}
.feed .cover {
  width: 44px;
}
.feed__story {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.feed__ch {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 1.12rem;
  line-height: 1.25;
}
.feed__ch b {
  color: var(--ember);
  font-weight: 600;
}
.feed__time {
  display: grid;
  justify-items: end;
  gap: 4px;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  white-space: nowrap;
}

.rank-card {
  position: sticky;
  top: calc(var(--head-h) + 20px);
  padding: 22px 22px 10px;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-1);
  border: 1px solid var(--line);
}
.rank-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.rank-card h2 {
  font-size: var(--fs-xl);
}
.rank {
  list-style: none;
  counter-reset: rank;
}
.rank li {
  counter-increment: rank;
  border-bottom: 1px solid var(--line);
}
.rank li:last-child {
  border: 0;
}
.rank a {
  display: grid;
  grid-template-columns: 38px 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  text-decoration: none;
}
.rank a::before {
  content: counter(rank);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  font-style: italic;
  line-height: 1;
  color: var(--line-strong);
  text-align: center;
}
.rank li:first-child a::before {
  color: var(--ember);
}
.rank .cover {
  width: 40px;
}
.rank strong {
  display: block;
  font-weight: 600;
  line-height: 1.25;
}
.rank a:hover strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rank small {
  color: var(--ink-3);
  font-size: var(--fs-xs);
}

/* ---------- HOME: genre tiles ---------- */
.genre-band {
  background: var(--paper-2);
}
.genre-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.gtile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 168px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--c);
  color: #fff;
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.gtile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.28));
}
.gtile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
}
.gtile h3 {
  font-size: 1.4rem;
}
.gtile p {
  font-size: var(--fs-xs);
  opacity: 0.88;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.gtile__covers {
  position: absolute;
  right: -6px;
  bottom: -18px;
  display: flex;
  z-index: -1;
}
.gtile__covers .cover {
  width: 62px;
  margin-left: -26px;
  transform: rotate(var(--r));
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.5);
}
.gtile:hover .gtile__covers .cover {
  transform: rotate(var(--r)) translateY(-6px);
}
.gtile__covers .cover {
  transition: transform 0.35s var(--ease);
}

/* ---------- HOME: excerpt ---------- */
.excerpt {
  background: var(--night);
  color: var(--night-fg);
}
.excerpt__in {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.excerpt .cover {
  box-shadow: 0 24px 50px -18px rgba(0, 0, 0, 0.8);
}
.excerpt .eyebrow {
  color: var(--ember-bright);
}
.excerpt blockquote {
  margin: 18px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1rem + 1.5vw, 2.1rem);
  font-weight: 400;
  line-height: 1.38;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
.excerpt blockquote::first-letter {
  float: left;
  margin: 0.06em 0.08em 0 0;
  font-size: 3.2em;
  line-height: 0.82;
  color: var(--ember-bright);
}
.excerpt__src {
  margin-top: 22px;
  color: var(--night-muted);
}
.excerpt__src strong {
  color: var(--night-fg);
}
.excerpt__cta {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- HOME: roadmap ---------- */
.roadmap__in {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.roadmap h2 {
  margin-top: 10px;
  font-size: var(--fs-2xl);
}
.roadmap__in > div > p {
  margin-top: 12px;
  color: var(--ink-2);
}
.roadmap__list {
  list-style: none;
  display: grid;
  gap: 4px;
}
.roadmap__list li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.roadmap__list li:last-child {
  border: 0;
}
.roadmap__list .ico {
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ember);
}
.roadmap__list strong {
  display: block;
}
.roadmap__list span {
  font-size: var(--fs-sm);
  color: var(--ink-2);
}

/* ---------- BROWSE ---------- */
.browse__layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(24px, 3vw, 48px);
  padding-bottom: var(--s8);
}
.filters__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.filters__head h2 {
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.filters__close,
.filters__apply {
  display: none;
}
.filters {
  position: sticky;
  top: calc(var(--head-h) + 16px);
  align-self: start;
  max-height: calc(100vh - var(--head-h) - 32px);
  overflow-y: auto;
  padding-right: 4px;
}
.fgroup {
  margin: 0;
  padding: 16px 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.fgroup legend {
  float: left;
  width: 100%;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: var(--fs-sm);
}
.fgroup__list {
  clear: both;
}
.check {
  clear: both;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--ember);
  flex: none;
}
.check .n {
  margin-left: auto;
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.toolbar__search {
  position: relative;
  flex: 1 1 260px;
}
.toolbar__search .ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  width: 18px;
}
.toolbar__search .input {
  padding-left: 42px;
  border-radius: 999px;
}
.toolbar__sort .select {
  border-radius: 999px;
  min-width: 180px;
}
.toolbar__filters {
  display: none;
}
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.active-filters:empty {
  display: none;
}
.active-filters .chip {
  min-height: 30px;
  font-size: var(--fs-xs);
}
.results__count {
  margin: 18px 0 20px;
  font-size: var(--fs-sm);
  color: var(--ink-3);
}
.results__count strong {
  color: var(--ink);
}
.rlist {
  list-style: none;
  display: grid;
  gap: 2px;
}
.rrow {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 22px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.rrow .cover {
  width: 92px;
}
.rrow h3 {
  font-size: var(--fs-xl);
}
.rrow h3 a {
  text-decoration: none;
}
.rrow h3 a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rrow__by {
  margin-top: 2px;
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
.rrow__tag {
  margin-top: 8px;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-2);
}
.rrow__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin-top: 10px;
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
mark {
  background: rgba(242, 138, 82, 0.3);
  color: inherit;
  border-radius: 2px;
}

@media (max-width: 900px) {
  .browse__layout {
    grid-template-columns: 1fr;
  }
  .toolbar__filters {
    display: inline-flex;
  }
  .filters {
    position: fixed;
    inset: 0 0 0 auto;
    top: 0;
    z-index: 60;
    width: min(360px, 88vw);
    max-height: none;
    padding: 18px 20px 90px;
    background: var(--paper);
    box-shadow: var(--shadow-2);
    transform: translateX(105%);
    transition: transform 0.3s var(--ease), visibility 0.3s;
    visibility: hidden;
  }
  .filters.is-open {
    transform: none;
    visibility: visible;
  }
  .filters__close {
    display: inline-grid;
  }
  .filters__apply {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px 20px;
    background: var(--paper);
    border-top: 1px solid var(--line);
  }
  .filters__apply .btn {
    width: 100%;
  }
  .scrim {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(16, 14, 22, 0.45);
  }
}

/* ---------- GENRES ---------- */
.genre-index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: var(--s6);
}
.genre-list {
  display: grid;
  gap: 20px;
  padding-bottom: var(--s8);
}
.grow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  padding: clamp(22px, 3.5vw, 40px);
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.grow::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--c);
}
.grow__n {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c);
}
.grow h2 {
  margin-top: 8px;
  font-size: var(--fs-2xl);
}
.grow p {
  margin-top: 10px;
  color: var(--ink-2);
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-lg);
}
.grow .btn {
  margin-top: 20px;
}
.grow__books {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.grow__books .scard__title {
  font-size: 0.92rem;
}

/* ---------- STORY ---------- */
.shero {
  position: relative;
  overflow: hidden;
  background: var(--sbg, var(--night));
  color: var(--sfg, var(--night-fg));
  isolation: isolate;
}
.shero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(60% 90% at 85% 10%, color-mix(in srgb, var(--sac) 45%, transparent), transparent 70%),
    linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, 0.18));
}
.shero__in {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  padding-block: clamp(32px, 5vw, 64px);
  align-items: end;
}
.shero .cover {
  box-shadow: 0 30px 60px -22px rgba(0, 0, 0, 0.7), 0 2px 4px rgba(0, 0, 0, 0.25);
  transform: rotate(-1.5deg);
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--fs-sm);
  opacity: 0.8;
}
.crumbs a {
  text-decoration: none;
}
.crumbs a:hover {
  text-decoration: underline;
}
.shero h1 {
  margin-top: 14px;
  font-size: clamp(2.1rem, 1.3rem + 3.2vw, 3.8rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.shero__by {
  margin-top: 10px;
  font-size: var(--fs-lg);
  opacity: 0.85;
}
.shero__tag {
  margin-top: 14px;
  max-width: 52ch;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-xl);
  line-height: 1.35;
}
.shero__genres {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.shero__genres a {
  padding: 4px 12px;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-decoration: none;
}
.shero__genres a:hover {
  background: color-mix(in srgb, currentColor 12%, transparent);
}
.shero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}
.shero .btn--ghost {
  border-color: color-mix(in srgb, currentColor 40%, transparent);
}
.shero .btn--ghost:hover {
  background: color-mix(in srgb, currentColor 10%, transparent);
}
.shero__cta .btn--primary {
  background: var(--sfg);
  color: var(--sbg);
}
.shero__cta .btn--primary:hover {
  filter: brightness(0.95);
}
.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.stats div {
  padding: 18px clamp(12px, 2vw, 24px);
  border-right: 1px solid var(--line);
}
.stats div:last-child {
  border: 0;
}
.stats dt {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stats dd {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}
.stats dd small {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--ink-3);
}
.sbody {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(28px, 4vw, 64px);
  padding: var(--s7) 0 var(--s8);
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  overflow-x: auto;
}
.tabs [role="tab"] {
  position: relative;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  background: none;
  font-weight: 600;
  color: var(--ink-3);
  white-space: nowrap;
}
.tabs [role="tab"][aria-selected="true"] {
  color: var(--ink);
}
.tabs [role="tab"][aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--ember);
}
.tabs__n {
  margin-left: 4px;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  font-weight: 500;
}
.synopsis {
  font-family: var(--font-display);
  font-size: 1.22rem;
  line-height: 1.65;
  max-width: 64ch;
}
.synopsis::first-letter {
  font-size: 3.3em;
  float: left;
  line-height: 0.85;
  margin: 0.05em 0.1em 0 0;
  color: var(--ember);
}
.taglist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.taglist a {
  font-size: var(--fs-xs);
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--paper-2);
  text-decoration: none;
  font-weight: 600;
  color: var(--ink-2);
}
.taglist a:hover {
  background: var(--line);
}
.opening {
  margin-top: 32px;
  padding: 24px 28px;
  border-left: 3px solid var(--ember);
  background: var(--card);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.opening h3 {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.opening p {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1.6;
}
.opening a {
  display: inline-flex;
  margin-top: 14px;
}

.chtools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.chtools .toolbar__search {
  flex: 1 1 220px;
}
.ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.ranges .chip {
  min-height: 30px;
  font-size: var(--fs-xs);
}
.chapters {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
}
.chapters li {
  border-bottom: 1px solid var(--line);
}
.chapters a {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 4px;
  text-decoration: none;
  transition: background 0.15s;
}
.chapters a:hover {
  background: var(--card);
}
.chapters .n {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-3);
  text-align: right;
}
.chapters .t {
  font-weight: 500;
  line-height: 1.3;
}
.chapters .d {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--ink-3);
}
.chapters .is-read .t {
  color: var(--ink-3);
}
.chapters .r {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.chapters .read-mark {
  color: var(--moss);
}
.chapters .is-current a {
  background: color-mix(in srgb, var(--ember) 8%, transparent);
}

.sside {
  display: grid;
  gap: 20px;
  align-content: start;
}
.sbox {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.sbox h2 {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: var(--fs-sm);
}
.details dt {
  color: var(--ink-3);
}
.details dd {
  margin: 0;
  font-weight: 500;
  text-align: right;
}
.rating-bars {
  display: grid;
  gap: 6px;
  font-size: var(--fs-xs);
}
.rating-bars div {
  display: grid;
  grid-template-columns: 14px 1fr 34px;
  gap: 8px;
  align-items: center;
  color: var(--ink-3);
}
.rating-bars .bar {
  height: 6px;
  border-radius: 6px;
  background: var(--paper-2);
  overflow: hidden;
}
.rating-bars .bar span {
  display: block;
  height: 100%;
  width: var(--w);
  background: var(--gold);
}
.rating-big {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}
.rating-big strong {
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1;
}
.rating-big span {
  color: var(--ink-3);
  font-size: var(--fs-sm);
}
.audio-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.audio-note .ico {
  color: var(--ember);
  margin-top: 2px;
}
.audio-note strong {
  display: block;
  color: var(--ink);
}

.notfound__in {
  display: grid;
  justify-items: center;
  text-align: center;
  padding-block: clamp(48px, 10vw, 120px);
}
.notfound__code {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(6rem, 20vw, 12rem);
  line-height: 1;
  color: var(--line-strong);
}
.notfound h1 {
  font-size: var(--fs-2xl);
}
.notfound p {
  margin-top: 12px;
  max-width: 48ch;
  color: var(--ink-2);
}
.notfound__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

/* ---------- LIBRARY ---------- */
.tabpanel {
  padding-bottom: var(--s8);
}
.lib-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.lib-row .cover {
  width: 72px;
}
.lib-row h3 {
  font-size: 1.2rem;
}
.lib-row h3 a {
  text-decoration: none;
}
.lib-row h3 a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lib-row p {
  margin-top: 2px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.lib-row .meter {
  max-width: 320px;
}
.lib-row__actions {
  display: flex;
  gap: 8px;
}
.hist-day {
  margin: 28px 0 6px;
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.hist {
  list-style: none;
}
.hist li a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.hist .cover {
  width: 34px;
}
.hist small {
  display: block;
  color: var(--ink-3);
}
.hist time {
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
.lib-actions {
  display: flex;
  justify-content: flex-end;
  margin: 16px 0 0;
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .genre-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sbody {
    grid-template-columns: 1fr;
  }
  .sside {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}
@media (max-width: 860px) {
  .hero__in {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .hero__art {
    order: -1;
    width: 170px;
    justify-self: start;
  }
  .hero__art .cover--back {
    transform: translate(40%, 6%) rotate(8deg) scale(0.9);
  }
  .pulse,
  .roadmap__in,
  .grow {
    grid-template-columns: 1fr;
  }
  .rank-card {
    position: static;
  }
  .excerpt__in {
    grid-template-columns: 1fr;
  }
  .excerpt .cover {
    width: 120px;
  }
  .shero__in {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .shero .cover {
    width: 150px;
  }
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stats div:nth-child(3) {
    border-right: 0;
  }
  .stats div:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }
  .chapters {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .genre-tiles {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .gtile {
    min-height: 130px;
    padding: 14px;
  }
  .gtile h3 {
    font-size: 1.1rem;
  }
  .gtile__covers .cover {
    width: 46px;
  }
  .grow__books {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grow__books > :nth-child(4) {
    display: none;
  }
  .rrow {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 14px;
  }
  .rrow .cover {
    width: 70px;
  }
  .lib-row {
    grid-template-columns: 56px minmax(0, 1fr);
  }
  .lib-row .cover {
    width: 56px;
  }
  .lib-row__actions {
    grid-column: 2;
  }
  .grid-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .feed a {
    grid-template-columns: 40px minmax(0, 1fr);
  }
  .feed__time {
    grid-column: 2;
    justify-items: start;
    grid-auto-flow: column;
    justify-content: start;
    gap: 10px;
  }
  .toolbar__sort {
    flex: 1;
  }
  .toolbar__sort .select {
    min-width: 0;
  }
}
