:root {
  --bg: #090909;
  --bg-soft: #111111;
  --panel: rgba(12, 12, 12, 0.88);
  --panel-strong: rgba(18, 18, 18, 0.94);
  --line: rgba(255, 255, 255, 0.18);
  --line-strong: rgba(255, 255, 255, 0.42);
  --text: #f5f3ef;
  --muted: #bfb9ae;
  --warm: #f5f3ef;
  --warm-2: #d8d2c8;
  --cold: #f5f3ef;
  --shadow: rgba(0, 0, 0, 0.42);
  --radius: 28px;
  --radius-lg: 40px;
  --shell: min(1440px, calc(100vw - 36px));
  --body-font: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "URW Palladio L", serif;
  --display-font: "Avenir Next Condensed", "Gill Sans Nova Condensed", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.07), transparent 20%),
    radial-gradient(circle at 78% 18%, rgba(255,255,255,0.05), transparent 22%),
    linear-gradient(180deg, #050505 0%, #0a0a0a 46%, #0e0e0e 100%);
  color: var(--text);
  font-family: var(--body-font);
  line-height: 1.68;
}

.site-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px),
    url("./assets/paper-noise.svg");
  background-size: 48px 48px, 48px 48px, 300px 300px;
  mix-blend-mode: screen;
  opacity: 0.23;
}

.site-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, transparent 0%, rgba(0, 0, 0, 0.16) 58%, rgba(0, 0, 0, 0.58) 100%);
}

.shell {
  width: var(--shell);
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 20px;
  padding: 18px 0 14px;
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
}

.brand-crest {
  width: 52px;
  height: 52px;
  filter: grayscale(1) brightness(1.9) drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.02;
}

.brand-copy strong {
  font-family: var(--display-font);
  font-size: 1.4rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-copy small {
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
  justify-content: flex-end;
}

.locale-switcher {
  position: relative;
  flex: 0 0 auto;
  margin-left: 4px;
}

.locale-trigger,
.locale-option {
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(8, 8, 8, 0.74);
  color: var(--muted);
  font-family: var(--display-font);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.locale-trigger {
  min-width: 88px;
  padding: 0 14px 0 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.locale-trigger:hover,
.locale-switcher.is-open .locale-trigger {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(18, 18, 18, 0.96);
  color: var(--text);
}

.locale-trigger.is-active {
  animation: localePulse 2.4s ease-in-out infinite;
}

.locale-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 6px;
  min-width: 108px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(10, 10, 10, 0.96);
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 160ms ease, transform 160ms ease;
}

.locale-switcher.is-open .locale-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.locale-option {
  width: 100%;
  padding: 0 12px;
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
}

.locale-option:hover,
.locale-option.is-active {
  border-color: var(--line);
  background: rgba(18, 18, 18, 0.96);
  color: var(--text);
}

.locale-flag {
  width: 18px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.locale-flag svg {
  width: 18px;
  height: 12px;
  display: block;
  filter: drop-shadow(0 3px 8px rgba(255,255,255,0.08));
}

.locale-code {
  position: relative;
  top: 0.02em;
}

.locale-caret {
  width: 8px;
  height: 8px;
  margin-left: 2px;
  border-right: 1px solid rgba(245, 243, 239, 0.68);
  border-bottom: 1px solid rgba(245, 243, 239, 0.68);
  transform: rotate(45deg) translateY(-1px);
  transition: transform 160ms ease;
}

.locale-switcher.is-open .locale-caret {
  transform: rotate(225deg) translateY(-1px);
}

.topnav a {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  background: rgba(8, 8, 8, 0.68);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
  font-family: var(--display-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.topnav a:hover,
.topnav a[aria-current="page"] {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(18, 18, 18, 0.95);
}

.home-shell,
.reading-shell,
.roster-shell {
  padding-top: 10px;
  padding-bottom: 80px;
}

.hero-panel,
.ink-panel,
.feature-card,
.story-section,
.chapter-preview,
.character-preview-card,
.character-card,
.character-detail {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 28px 60px var(--shadow);
}

.hero-panel::before,
.ink-panel::before,
.feature-card::before,
.story-section::before,
.chapter-preview::before,
.character-preview-card::before,
.character-card::before,
.character-detail::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.014) 1px, transparent 1px),
    url("./assets/paper-noise.svg");
  background-size: 28px 28px, 28px 28px, 260px 260px;
  mix-blend-mode: screen;
  opacity: 0.08;
  pointer-events: none;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.cover-panel {
  min-height: 84vh;
}

.slim-panel {
  min-height: 44vh;
  margin-bottom: 30px;
}

.cover-backdrop {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  transform: scale(1.04);
  filter: grayscale(1) contrast(1.06) brightness(0.7);
}

.cover-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(112deg, rgba(5,5,5,0.95) 10%, rgba(5,5,5,0.62) 48%, rgba(6,6,6,0.94) 100%),
    radial-gradient(circle at 72% 32%, rgba(255,255,255,0.12), transparent 23%);
}

.cover-grid,
.reader-hero-copy {
  position: relative;
  z-index: 1;
}

.cover-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.7fr);
  gap: 28px;
  align-items: end;
  min-height: inherit;
  padding: 50px;
}

.cover-copy h1,
.reader-hero-copy h1 {
  margin: 10px 0 18px;
  font-family: var(--display-font);
  font-size: clamp(2.8rem, 5.2vw, 5.9rem);
  line-height: 0.92;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lead,
.reader-hero-copy .richtext,
.cover-plaque p {
  max-width: 58ch;
  color: #e2ddd5;
  font-size: 1.06rem;
}

.eyebrow,
.plaque-label,
.rail-label {
  margin: 0;
  color: rgba(255,255,255,0.68);
  font-family: var(--display-font);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--display-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.82rem;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: #f5f3ef;
  color: #090909;
  box-shadow: 0 16px 30px rgba(255,255,255,0.12);
}

.btn-secondary,
.btn-ghost {
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: rgba(15, 15, 15, 0.62);
}

.cover-side {
  display: flex;
  justify-content: flex-end;
}

.cover-plaque {
  max-width: 360px;
  padding: 24px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(18, 18, 18, 0.9), rgba(11, 11, 11, 0.92));
}

.cover-plaque h2 {
  margin: 10px 0 12px;
  font-family: var(--display-font);
  font-size: 1.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.9fr);
  gap: 24px;
  margin: 34px 0;
}

.section-copy h2,
.feature-copy h3,
.group-rail h2,
.chapter-rail h2,
.character-detail h2 {
  margin: 10px 0 12px;
  font-family: var(--display-font);
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.reading-path {
  padding: 22px;
  border-radius: 24px;
  display: grid;
  gap: 16px;
}

.reading-step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: start;
}

.reading-step span {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--display-font);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
}

.split-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin: 34px 0 40px;
  align-items: stretch;
}

.feature-card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  min-height: 360px;
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.feature-card:hover,
.feature-card:focus-visible,
.chapter-preview:hover,
.chapter-preview:focus-visible,
.character-preview-card:hover,
.character-preview-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 32px 68px rgba(0, 0, 0, 0.5);
}

.feature-art {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  filter: grayscale(1) contrast(1.08) brightness(0.72);
}

.feature-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 8, 8, 0.18), rgba(8, 8, 8, 0.92) 72%);
}

.feature-copy {
  position: relative;
  z-index: 1;
  padding: 28px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: end;
}

.mini-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 20px;
}

.mini-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(14, 14, 14, 0.5);
  color: var(--muted);
  font-size: 0.86rem;
}

.library-preview {
  margin: 46px 0;
}

.section-copy.compact {
  margin-bottom: 18px;
}

.chapter-preview-grid,
.character-preview-grid,
.group-section-list,
.character-card-grid {
  display: grid;
  gap: 18px;
  align-items: stretch;
}

.chapter-preview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
}

.character-preview-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
}

.chapter-preview,
.character-preview-card,
.character-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
}

.chapter-preview,
.character-preview-card {
  display: block;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.chapter-preview {
  min-height: 260px;
}

.character-preview-card {
  min-height: 320px;
}

.chapter-preview::before,
.character-preview-card::before,
.character-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 8, 8, 0.15), rgba(8, 8, 8, 0.92) 78%);
  z-index: 1;
}

.chapter-preview .art,
.character-preview-card .art,
.character-card .card-art {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  filter: grayscale(1) contrast(1.06) brightness(0.78);
}

.chapter-preview .copy,
.character-preview-card .copy,
.character-card .card-copy {
  position: relative;
  z-index: 2;
  padding: 22px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: end;
}

.chapter-preview h3,
.character-preview-card h3,
.character-card h3 {
  margin: 8px 0 8px;
  font-family: var(--display-font);
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chapter-preview p,
.character-preview-card p,
.character-card p {
  margin: 0;
  color: #ddd7cd;
}

.chapter-preview .copy p:last-child,
.character-preview-card .copy p:last-child {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.footer-bar {
  padding: 0 0 44px;
  text-align: center;
  color: var(--muted);
}

.footer-divider {
  display: block;
  width: min(100%, 420px);
  margin: 0 auto 16px;
  opacity: 0.9;
}

.reading-shell {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 24px;
}

.chapter-rail {
  position: sticky;
  top: 96px;
  align-self: start;
  border-radius: 28px;
  padding: 22px;
  background: var(--panel-strong);
}

.chapter-nav {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.group-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.chapter-nav a,
.group-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid transparent;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.chapter-nav a:hover,
.chapter-nav a.is-active,
.group-nav a:hover,
.group-nav a.is-active {
  color: var(--text);
  background: rgba(255,255,255,0.06);
  border-color: var(--line);
}

.rail-copy {
  color: #ddd7cd;
  font-size: 0.98rem;
}

.story-sections {
  display: grid;
  gap: 20px;
}

.story-section {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.78fr);
  min-width: 0;
}

.story-section.reverse {
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.2fr);
}

.story-copy,
.story-art {
  position: relative;
  min-width: 0;
}

.story-copy {
  padding: 34px 34px 36px;
  z-index: 2;
}

.story-art {
  min-height: 100%;
}

.story-art .image {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  filter: saturate(0.95) brightness(0.76);
}

.story-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 8, 8, 0.12), rgba(8, 8, 8, 0.84));
}

.chapter-meta {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
  min-width: 0;
}

.chapter-meta .roman {
  color: rgba(255,255,255,0.78);
  font-family: var(--display-font);
  font-size: 2rem;
  line-height: 1;
}

.story-copy h2 {
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(1.5rem, 2.3vw, 2.4rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 0;
  overflow-wrap: anywhere;
}

.richtext p {
  margin: 0 0 14px;
  color: #e0dcd3;
}

.richtext ul {
  margin: 0 0 14px 1.3rem;
  padding: 0;
  color: #e0dcd3;
}

.richtext li {
  margin-bottom: 8px;
}

.richtext strong {
  color: #f5f3ef;
  font-weight: 700;
}

.reader-hero-copy {
  position: relative;
  z-index: 1;
  padding: 36px;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  justify-content: end;
}

.atlas-shell {
  display: grid;
  gap: 26px;
  min-width: 0;
}

.champion-strip-panel,
.character-detail {
  border-radius: 28px;
  padding: 26px;
  background: var(--panel-strong);
  min-width: 0;
  max-width: 100%;
}

.roster-stage {
  min-width: 0;
}

.group-section-list {
  gap: 34px;
}

.group-section {
  display: grid;
  gap: 20px;
  align-content: start;
  scroll-margin-top: 118px;
}

.group-intro {
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.92), rgba(11, 11, 11, 0.92));
  max-width: 980px;
}

.group-intro h2 {
  margin: 10px 0 0;
}

.group-intro .richtext {
  margin-top: 14px;
}

.character-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  grid-auto-rows: 1fr;
}

.character-card {
  min-height: 395px;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.character-card:hover,
.character-card.is-active {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 32px 60px rgba(0, 0, 0, 0.52);
}

.character-card::before {
  background:
    linear-gradient(180deg, rgba(8, 8, 8, 0.04) 4%, rgba(8, 8, 8, 0.42) 44%, rgba(8, 8, 8, 0.96) 82%);
}

.character-card .portrait-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 18px 18px 84px;
  z-index: 1;
}

.character-card .portrait-wrap img {
  max-width: 88%;
  max-height: 88%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.42));
}

.character-card .card-copy {
  background: linear-gradient(180deg, rgba(8, 8, 8, 0) 6%, rgba(8, 8, 8, 0.62) 42%, rgba(8, 8, 8, 0.96) 78%);
  min-width: 0;
}

.character-card .card-copy > p:last-of-type {
  min-height: 2.9em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.character-card h3 {
  font-size: clamp(1.26rem, 1.8vw, 1.7rem);
}

.champion-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(190px, 220px);
  gap: 16px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.champion-strip::-webkit-scrollbar {
  height: 10px;
}

.champion-strip::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 999px;
}

.character-cell {
  min-height: 248px;
  scroll-snap-align: start;
}

.character-cell .card-art {
  filter: grayscale(1) contrast(1.05) brightness(0.52);
  background-position: center 22%;
  background-size: cover;
}

.character-cell::before {
  background:
    linear-gradient(180deg, rgba(8, 8, 8, 0.04) 0%, rgba(8, 8, 8, 0.46) 42%, rgba(8, 8, 8, 0.96) 100%);
}

.character-cell .card-copy {
  padding: 18px;
}

.character-cell .card-copy > p:last-of-type {
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.character-cell .character-chip-row,
.character-cell .portrait-wrap {
  display: none;
}

.character-chip-row,
.detail-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.5);
  color: var(--muted);
  font-size: 0.78rem;
}

.chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.character-focus-panel {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.character-detail {
  width: min(1120px, 100%);
  margin: 0 auto;
  min-height: auto;
  min-width: 0;
  scroll-margin-top: 110px;
}

#characters-hero {
  min-height: 30vh;
  margin-bottom: 18px;
}

#characters-hero .reader-hero-copy {
  padding: 26px 30px;
}

#characters-hero h1 {
  font-size: clamp(2rem, 4vw, 3.8rem);
  margin-bottom: 12px;
}

.detail-empty {
  color: var(--muted);
}

.detail-header {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  min-height: 560px;
  margin-bottom: 22px;
  display: grid;
  align-items: end;
}

.detail-header .art {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  filter: grayscale(1) contrast(1.05) brightness(0.72);
}

.detail-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 34%, rgba(255,255,255,0.1), transparent 22%),
    linear-gradient(180deg, rgba(8, 8, 8, 0.14), rgba(8, 8, 8, 0.94));
}

.detail-header .portrait {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 24px 24px 0;
}

.detail-header .portrait img {
  max-width: min(62%, 540px);
  max-height: 94%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 20px 32px rgba(0,0,0,0.52));
}

.detail-header .detail-copy {
  position: relative;
  z-index: 2;
  width: min(720px, calc(100% - 34px));
  margin: 0 auto 22px;
  padding: 22px 24px;
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: center;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(11, 11, 11, 0.78), rgba(12, 12, 12, 0.94));
  backdrop-filter: blur(12px);
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.34);
}

.detail-header h2 {
  margin: 8px 0 6px;
  font-family: var(--display-font);
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.detail-sub {
  color: #ddd7cd;
  margin: 0;
  font-size: 1.04rem;
}

.detail-section-title {
  margin: 20px 0 14px;
  font-family: var(--display-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.68);
  text-align: center;
}

.character-skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.character-skill-card {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(16, 16, 16, 0.88);
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.28);
}

.character-skill-card .art {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  filter: grayscale(1) contrast(1.08) brightness(0.68);
}

.character-skill-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 8, 8, 0.16), rgba(8, 8, 8, 0.94) 78%);
}

.character-skill-copy {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 18px;
}

.character-skill-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.skill-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(14, 14, 14, 0.58);
  color: var(--muted);
  font-size: 0.76rem;
  font-family: var(--display-font);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.character-skill-copy h3 {
  margin: 0 0 8px;
  font-family: var(--display-font);
  font-size: 1.24rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.character-skill-copy p {
  margin: 0;
  color: #ddd7cd;
}

.skill-empty {
  padding: 18px 0 8px;
  color: var(--muted);
  text-align: center;
}

.character-detail > .richtext {
  max-width: 88ch;
  margin: 0 auto;
}

.scroll-progress {
  position: fixed;
  inset: 0 auto auto 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.9), rgba(255,255,255,0.3));
  z-index: 40;
  box-shadow: 0 0 18px rgba(255,255,255,0.2);
}

.hidden {
  display: none !important;
}

@media (max-width: 1260px) {
  .detail-header {
    min-height: 520px;
  }

  .detail-header .portrait img {
    max-width: min(68%, 500px);
  }
}

@media (max-width: 1120px) {
  .reading-shell {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .chapter-rail {
    order: 2;
    position: relative;
    top: auto;
  }

  .reading-stage {
    order: 1;
  }

  .section-grid,
  .split-panels {
    grid-template-columns: 1fr;
  }

  .chapter-preview-grid,
  .character-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .champion-strip {
    grid-auto-columns: minmax(180px, 210px);
  }
}

@media (max-width: 980px) {
  .cover-grid,
  .story-section,
  .story-section.reverse {
    grid-template-columns: 1fr;
  }

  .cover-panel {
    min-height: 70vh;
  }

  .cover-grid,
  .reader-hero-copy {
    padding: 28px;
  }

  .story-copy {
    padding: 26px 24px 28px;
  }

  .story-art {
    min-height: 240px;
  }

  .detail-header {
    min-height: 500px;
  }

  .detail-header .portrait img {
    max-width: min(76%, 470px);
  }

  .detail-header .detail-copy {
    width: min(92%, 680px);
  }
}

@media (max-width: 820px) {
  .chapter-rail {
    display: none;
  }

  .chapter-preview-grid,
  .character-preview-grid,
  .character-card-grid,
  .character-skill-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .topnav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    margin-left: 0;
    justify-content: flex-start;
  }

  .locale-switcher {
    width: 100%;
    margin-left: 0;
  }

  .locale-menu {
    right: auto;
    left: 0;
  }

  .group-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .chapter-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
  }

  .chapter-nav a {
    min-width: 180px;
    flex: 0 0 auto;
    scroll-snap-align: start;
    border: 1px solid var(--line);
    background: rgba(14, 14, 14, 0.45);
  }

  .champion-strip-panel,
  .character-detail {
    padding: 18px;
  }

  .detail-header {
    min-height: 440px;
  }

  .detail-header .detail-copy {
    width: calc(100% - 24px);
    padding: 18px 18px 20px;
  }

  .detail-header .portrait img {
    max-width: min(82%, 430px);
  }
}

@keyframes localePulse {
  0%,
  100% {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 0 0 1px rgba(255,255,255,0.02);
  }
  50% {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 0 1px rgba(255,255,255,0.12), 0 0 18px rgba(255,255,255,0.08);
  }
}

@media (max-width: 640px) {
  :root {
    --shell: min(100vw - 24px, 1480px);
  }

  .topbar {
    padding: 16px 0 14px;
  }

  .topnav {
    gap: 8px;
  }

  .topnav a {
    padding: 9px 12px;
    font-size: 0.74rem;
  }

  .cover-grid,
  .reader-hero-copy,
  .story-copy {
    padding: 22px;
  }

  .chapter-meta {
    display: grid;
    gap: 8px;
    align-items: start;
  }

  .chapter-rail {
    padding: 18px;
  }

  .rail-copy {
    font-size: 0.92rem;
  }

  .character-card {
    min-height: 360px;
  }

  .character-cell {
    min-height: 220px;
  }

  .character-card .portrait-wrap {
    padding-bottom: 86px;
  }

  .detail-header {
    min-height: 380px;
  }

  .detail-header .portrait {
    justify-content: center;
    opacity: 0.72;
  }

  .detail-header .portrait img {
    max-width: 86%;
  }

  .detail-header .detail-copy {
    width: calc(100% - 16px);
    margin-bottom: 12px;
    padding: 16px;
  }

  .detail-header h2 {
    font-size: clamp(1.6rem, 8vw, 2.4rem);
  }

  #characters-hero {
    min-height: 24vh;
  }

  #characters-hero .reader-hero-copy {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
