:root {
  --ink: #142033;
  --ink-soft: #3a465c;
  --paper: #e8edf2;
  --paper-2: #f4f7fa;
  --line: #c5ceda;
  --accent: #c41e3a;
  --accent-deep: #9a1530;
  --chip: #1f6f8b;
  --ok: #1f7a4d;
  --reader-bg: #1a2230;
  --reader-ink: #f2f5f8;
  --shadow: 0 18px 40px rgba(20, 32, 51, 0.12);
  --radius: 14px;
  --font-display: 'Syne', Georgia, serif;
  --font-body: 'Figtree', 'Segoe UI', sans-serif;
  --max: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(196, 30, 58, 0.12), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(31, 111, 139, 0.14), transparent 55%),
    linear-gradient(180deg, var(--paper-2), var(--paper));
  line-height: 1.55;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.shell {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(244, 247, 250, 0.88);
  border-bottom: 1px solid rgba(197, 206, 218, 0.8);
}

.site-header__inner {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}

.brand__mark {
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border-radius: 0.55rem;
  background: var(--accent);
  color: white;
  font-family: var(--font-display);
  font-weight: 800;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.site-nav {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
}

.site-nav a.is-active,
.site-nav a:hover {
  color: var(--accent);
}

.site-search {
  display: flex;
  gap: 0.4rem;
}

.site-search input,
.search-panel input,
.chapter-jump {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font: inherit;
  min-width: 0;
  color: var(--ink);
}

.site-search button,
.btn {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 700;
  padding: 0.55rem 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover,
.site-search button:hover {
  background: var(--accent-deep);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(196, 30, 58, 0.06);
}

.btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.hero-home {
  margin-bottom: 1.75rem;
  padding: 1.5rem 0 0.5rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}

h1,
h2 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero-home h1,
.page-intro h1 {
  margin: 0 0 0.55rem;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.lede {
  margin: 0;
  max-width: 38rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.catalog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.title-tile {
  display: grid;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
  transition: transform 180ms ease;
}

.title-tile:hover {
  transform: translateY(-3px);
}

.title-tile img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #d7dee8;
}

.title-tile__meta {
  display: grid;
  gap: 0.25rem;
}

.title-tile__name {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.25;
}

.chip {
  display: inline-flex;
  width: fit-content;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(31, 111, 139, 0.12);
  color: var(--chip);
  font-size: 0.75rem;
  font-weight: 700;
}

.pager {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin-top: 1.75rem;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.breadcrumbs {
  margin: 0 0 1.1rem;
}

.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.breadcrumbs__item:not(:last-child)::after {
  content: '/';
  margin-left: 0.55rem;
  color: var(--line);
}

.breadcrumbs__item a {
  color: var(--ink-soft);
  text-decoration: none;
}

.breadcrumbs__item a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.breadcrumbs__item [aria-current='page'] {
  color: var(--ink);
  font-weight: 600;
}

.section-heading {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.seo-intro {
  margin: 0.75rem 0 0;
  color: var(--ink-soft);
  max-width: 46rem;
  font-size: 0.98rem;
}

.seo-intro--compact {
  margin: 0 0 1rem;
  font-size: 0.92rem;
}

.seo-intro--reader {
  margin: 0.5rem 0 1rem;
  color: rgba(242, 245, 248, 0.78);
  max-width: 40rem;
}

.seo-block {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.seo-block h2 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.hero-home__links {
  margin: 1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  font-size: 0.95rem;
}

.faq {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.faq-list {
  margin-top: 0.75rem;
}

.faq details,
.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
}

.faq-item p {
  margin: 0.65rem 0 0;
  color: var(--ink-soft);
}

.reader-related {
  margin: 1.25rem 0 0;
  text-align: center;
  color: rgba(242, 245, 248, 0.7);
  font-size: 0.92rem;
}

.reader-related a {
  color: #9ed0e0;
}

.page-intro {
  margin-bottom: 1.5rem;
}

.site-footer__seo {
  margin: 0.35rem 0 0;
  max-width: 36rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.search-panel {
  margin-top: 1rem;
  display: flex;
  gap: 0.6rem;
  max-width: 36rem;
}

.search-panel input {
  flex: 1;
}

.series-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 1.5rem;
  align-items: start;
}

.series-sidebar {
  position: sticky;
  top: 5rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.series-cover img {
  width: 100%;
  border-radius: 12px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.series-title {
  margin: 0.9rem 0 0.35rem;
  font-size: 1.7rem;
}

.series-alts,
.series-authors {
  margin: 0.25rem 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.series-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 1rem 0;
}

.series-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.series-stats > div {
  background: var(--paper);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.series-stats .label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.series-stats .value {
  font-weight: 800;
}

.status-ongoing {
  color: var(--ok);
}

.genre-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.genre-pills a {
  text-decoration: none;
  background: rgba(196, 30, 58, 0.1);
  color: var(--accent-deep);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.series-synopsis h2 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.series-synopsis p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.chapter-rail {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  min-height: 60vh;
}

.chapter-rail__heading {
  margin: 0;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.15rem;
}

.chapter-rail__list {
  max-height: 75vh;
  overflow: auto;
}

.chapter-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(197, 206, 218, 0.7);
  align-items: center;
}

.chapter-row:hover {
  background: rgba(31, 111, 139, 0.06);
}

.chapter-row.is-unreleased {
  opacity: 0.55;
  pointer-events: none;
}

.chapter-row__thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  background: #d7dee8;
}

.chapter-row__thumb--empty {
  display: block;
}

.chapter-row__title {
  display: block;
  font-weight: 700;
}

.chapter-row__date {
  display: block;
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

.page-chapter {
  background: var(--reader-bg);
  color: var(--reader-ink);
}

.page-chapter .site-header {
  background: rgba(26, 34, 48, 0.92);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.page-chapter .brand,
.page-chapter .site-nav a,
.page-chapter .site-footer,
.page-chapter .site-footer a {
  color: var(--reader-ink);
}

.page-chapter .site-search input {
  background: #243044;
  border-color: #334560;
  color: var(--reader-ink);
}

.page-chapter .shell {
  width: min(920px, calc(100% - 1rem));
}

.reader-head {
  text-align: center;
  margin-bottom: 1.25rem;
}

.reader-head__thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
  margin: 0 auto 0.75rem;
}

.reader-head__series {
  margin: 0;
  opacity: 0.75;
}

.reader-head__series a {
  color: #9fd0e2;
}

.reader-head h1 {
  margin: 0.35rem 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.reader-head__date {
  margin: 0;
  opacity: 0.65;
}

.reader-nav {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.page-chapter .btn-ghost {
  color: var(--reader-ink);
  border-color: rgba(255, 255, 255, 0.2);
}

.chapter-jump {
  width: min(100%, 420px);
  margin: 0 auto;
  display: block;
  background: #243044;
  border-color: #334560;
  color: var(--reader-ink);
}

.reader-pages {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
}

.reader-pages img {
  width: min(100%, 840px);
  height: auto;
  background: #0f1520;
}

.reader-foot {
  margin-top: 1.5rem;
  padding-bottom: 2rem;
}

.genre-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.genre-list a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
}

.muted {
  color: var(--ink-soft);
  font-weight: 500;
}

.prose {
  max-width: 42rem;
}

.prose h1 {
  margin-top: 0;
}

.empty,
.hint,
.result-count {
  color: var(--ink-soft);
}

.error-panel {
  max-width: 34rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem;
  margin-top: auto;
}

.site-footer__inner {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
}

.site-footer__brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
}

.site-footer__tag,
.site-footer__copy {
  color: var(--ink-soft);
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 0.85rem 0;
}

@media (max-width: 860px) {
  .site-header__inner {
    grid-template-columns: 1fr;
    padding: 0.75rem 0;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .series-layout {
    grid-template-columns: 1fr;
  }

  .series-sidebar {
    position: static;
  }

  .series-actions {
    grid-template-columns: 1fr;
  }
}
