:root {
  --paper: #eee7d8;
  --paper-deep: #e3dac8;
  --paper-light: #f7f2e7;
  --ink: #1d2423;
  --ink-soft: #58605c;
  --ink-faint: #778078;
  --night: #111a19;
  --night-soft: #1d2926;
  --gold: #b18a4c;
  --gold-light: #d3b57e;
  --rust: #8c4b38;
  --forest: #415b50;
  --line: rgba(29, 36, 35, 0.18);
  --line-light: rgba(247, 242, 231, 0.22);
  --shadow: 0 22px 65px rgba(23, 30, 28, 0.13);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  --reading: "新宋体", "NSimSun", "Noto Serif SC", "Source Han Serif SC", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 12%, rgba(255, 255, 255, 0.7), transparent 28rem),
    radial-gradient(circle at 92% 70%, rgba(135, 114, 77, 0.08), transparent 30rem),
    var(--paper);
  font-family: var(--sans);
  line-height: 1.8;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}

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

a {
  color: inherit;
  text-decoration-color: rgba(140, 75, 56, 0.42);
  text-underline-offset: 0.22em;
}

a:hover {
  text-decoration-color: currentColor;
}

h1,
h2,
h3,
h4,
blockquote,
.lead {
  font-family: var(--serif);
}

.page-subtitle {
  margin: 0.45rem 0 0;
  color: var(--gold-light);
  font: italic clamp(1rem, 1.7vw, 1.2rem)/1.5 "Palatino Linotype", "Noto Serif SC", serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

::selection {
  color: var(--paper-light);
  background: var(--rust);
}

.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  color: var(--paper-light);
  background: var(--night);
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  color: #ede6d7;
  background: rgba(17, 26, 25, 0.96);
  border-bottom: 1px solid rgba(211, 181, 126, 0.22);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(1180px, calc(100% - 2.5rem));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--gold-light);
  border: 1px solid var(--gold);
  border-radius: 50%;
  font-size: 1rem;
}

.brand-text {
  display: grid;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.brand-text small {
  margin-top: 0.2rem;
  color: rgba(237, 230, 215, 0.58);
  font: 0.66rem/1.2 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

.main-nav a {
  position: relative;
  font: 0.86rem/1 var(--sans);
  color: rgba(237, 230, 215, 0.72);
  text-decoration: none;
  letter-spacing: 0.08em;
}

.main-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -0.7rem;
  left: 0;
  height: 1px;
  background: var(--gold-light);
  transform: scaleX(0);
  transition: transform 180ms ease;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: #fffaf0;
}

.main-nav a:hover::after,
.main-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.hero {
  position: relative;
  min-height: min(760px, 86vh);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #f8f1e4;
  background:
    linear-gradient(90deg, rgba(10, 16, 15, 0.92) 0%, rgba(10, 16, 15, 0.63) 42%, rgba(10, 16, 15, 0.16) 75%),
    linear-gradient(0deg, rgba(10, 16, 15, 0.75), transparent 45%),
    url("../assets/covers/hero-main.jpg") center 28% / cover no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(105deg, transparent 0 48%, rgba(255, 255, 255, 0.03) 48% 48.15%, transparent 48.15%),
    radial-gradient(circle at 88% 16%, rgba(211, 181, 126, 0.2), transparent 26rem);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 10rem 0 clamp(4rem, 8vw, 7rem);
}

.hero-kicker,
.eyebrow {
  margin: 0 0 1rem;
  color: var(--gold-light);
  font: 600 0.72rem/1.4 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(3rem, 8vw, 7.4rem);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.32);
}

.hero h1 span {
  display: block;
  margin-top: 0.7rem;
  color: var(--gold-light);
  font: 0.24em/1.2 var(--sans);
  letter-spacing: 0.48em;
  text-transform: uppercase;
}

.hero-summary {
  max-width: 620px;
  margin: 1.8rem 0 0;
  color: rgba(248, 241, 228, 0.8);
  font-size: clamp(1rem, 1.8vw, 1.23rem);
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.button[hidden] {
  display: none;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.15rem;
  color: var(--night);
  background: var(--gold-light);
  border: 1px solid var(--gold-light);
  border-radius: 2px;
  font: 600 0.82rem/1 var(--sans);
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.button:hover {
  color: var(--paper-light);
  background: transparent;
  transform: translateY(-1px);
}

.button.secondary {
  color: var(--paper-light);
  background: rgba(17, 26, 25, 0.18);
  border-color: rgba(248, 241, 228, 0.42);
}

.button.secondary:hover {
  color: var(--night);
  background: var(--paper-light);
}

.page-shell {
  width: min(1180px, calc(100% - 2.5rem));
  margin: 0 auto;
}

.section {
  padding: clamp(4rem, 8vw, 7.2rem) 0;
}

.section.tight {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}

.section.ink {
  color: var(--paper-light);
  background:
    radial-gradient(circle at 85% 20%, rgba(177, 138, 76, 0.12), transparent 26rem),
    var(--night);
}

.section.divided {
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.62fr);
  gap: 4rem;
  align-items: end;
  margin-bottom: clamp(2rem, 5vw, 3.8rem);
}

.section-head h2,
.page-intro h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4.5vw, 4.25rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0.02em;
}

.section-head p,
.page-intro .lede {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.9;
}

.section.ink .section-head p {
  color: rgba(247, 242, 231, 0.64);
}

.domain-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.domain-grid-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.domain-card {
  position: relative;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.5rem, 3vw, 2.3rem);
  background: var(--paper-light);
  text-decoration: none;
  transition: color 180ms ease, background 180ms ease;
}

.domain-card:hover {
  color: var(--paper-light);
  background: var(--forest);
}

.domain-index {
  color: var(--rust);
  font: 600 0.75rem/1 var(--sans);
  letter-spacing: 0.12em;
}

.domain-card:hover .domain-index {
  color: var(--gold-light);
}

.domain-card h3 {
  margin: 3rem 0 0.8rem;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.2;
}

.domain-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.8;
}

.domain-card:hover p {
  color: rgba(247, 242, 231, 0.76);
}

.domain-link {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
  color: var(--rust);
  border-top: 1px solid currentColor;
  font: 600 0.74rem/1 var(--sans);
  letter-spacing: 0.08em;
}

.domain-card:hover .domain-link {
  color: var(--gold-light);
}

.novel-preview-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(0.8rem, 1.6vw, 1.3rem);
}

.cover-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.cover-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: var(--night-soft);
  border: 1px solid rgba(17, 26, 25, 0.26);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}

.cover-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 248, 232, 0.13);
}

.cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease, filter 500ms ease;
}

.cover-link:hover .cover-frame img {
  transform: scale(1.025);
  filter: saturate(1.08) brightness(1.04);
}

.volume-pill {
  position: absolute;
  z-index: 1;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.38rem 0.52rem;
  color: var(--paper-light);
  background: rgba(17, 26, 25, 0.86);
  font: 600 0.66rem/1 var(--sans);
  letter-spacing: 0.12em;
}

.cover-caption {
  padding-top: 0.9rem;
}

.cover-caption h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.cover-caption p {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  font: 0.76rem/1.55 var(--sans);
}

.section.ink .cover-caption p {
  color: rgba(247, 242, 231, 0.58);
}

.section-end-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2.4rem;
  color: var(--rust);
  font: 600 0.78rem/1 var(--sans);
  letter-spacing: 0.08em;
  text-underline-offset: 0.3em;
}

.section.ink .section-end-link {
  color: var(--gold-light);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.feature-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.6rem;
  color: inherit;
  background: rgba(247, 242, 231, 0.58);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: background 180ms ease, transform 180ms ease;
}

.feature-card:hover {
  background: var(--paper-light);
  transform: translateY(-2px);
}

.feature-card .meta {
  color: var(--rust);
  font: 600 0.7rem/1.4 var(--sans);
  letter-spacing: 0.1em;
}

.feature-card h3 {
  margin: 1.1rem 0 0.55rem;
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.3;
}

.feature-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.page-header {
  position: relative;
  overflow: hidden;
  color: var(--paper-light);
  background:
    radial-gradient(circle at 86% 0%, rgba(177, 138, 76, 0.2), transparent 28rem),
    var(--night);
}

.page-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.page-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: end;
  padding: clamp(4.5rem, 9vw, 7.5rem) 0 clamp(3.2rem, 6vw, 5.8rem);
}

.page-intro .lede {
  color: rgba(247, 242, 231, 0.68);
  font-size: 1.05rem;
}

.breadcrumbs {
  margin-bottom: 2.2rem;
  color: rgba(247, 242, 231, 0.54);
  font: 0.72rem/1.5 var(--sans);
  letter-spacing: 0.06em;
}

.page-back-button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin: 0 0 1.1rem;
  padding: 0.45rem 0.8rem;
  color: rgba(247, 242, 231, 0.82);
  background: rgba(247, 242, 231, 0.07);
  border: 1px solid rgba(247, 242, 231, 0.2);
  border-radius: 999px;
  font: 600 0.72rem/1.2 var(--sans);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.page-back-button:hover,
.page-back-button:focus-visible {
  color: var(--night);
  background: var(--gold-light);
  border-color: var(--gold-light);
}

.update-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.update-card h2 {
  transition: color 160ms ease;
}

.update-card:hover h2,
.update-card:focus-visible h2 {
  color: var(--rust);
}

.update-detail {
  display: grid;
  gap: 1.6rem;
  max-width: 860px;
}

.update-detail article {
  padding: 0;
  background: transparent;
  border: 0;
}

.update-detail h2 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  font-weight: 500;
}

.update-detail p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.85;
}

.update-list {
  display: grid;
  gap: 0.45rem;
  margin: 0.9rem 0 0;
  padding-left: 1.2rem;
  color: var(--ink-soft);
}

.update-list li {
  line-height: 1.75;
}

.update-summary {
  color: var(--ink) !important;
  font-size: 1.05rem;
  line-height: 1.9 !important;
}

.breadcrumbs a {
  color: rgba(247, 242, 231, 0.78);
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.4rem;
}

.status-badge {
  padding: 0.36rem 0.55rem;
  color: var(--gold-light);
  border: 1px solid rgba(211, 181, 126, 0.42);
  font: 600 0.66rem/1 var(--sans);
  letter-spacing: 0.08em;
}

.detail-layout {
  display: grid;
  width: min(1360px, calc(100% - 4rem));
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: clamp(2.5rem, 4vw, 3.75rem);
  align-items: start;
  padding: clamp(3rem, 7vw, 6rem) 0;
}

.detail-page .page-header .page-shell {
  width: min(1360px, calc(100% - 4rem));
}

.detail-main {
  min-width: 0;
}

.detail-aside {
  position: sticky;
  top: 104px;
  align-self: start;
}

.prose h2 {
  margin: 2.8rem 0 1rem;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 500;
  line-height: 1.3;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin: 2.2rem 0 0.7rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.prose p {
  margin: 0 0 1.2rem;
  color: #303735;
  font-size: clamp(1rem, 1.4vw, 1.08rem);
  line-height: 2;
}

.prose p.lead {
  color: var(--ink);
  font-size: clamp(1.15rem, 2.1vw, 1.42rem);
  line-height: 1.85;
}

.prose blockquote {
  margin: 2rem 0;
  padding: 1.1rem 0 1.1rem 1.4rem;
  color: var(--ink-soft);
  border-left: 2px solid var(--gold);
  font-size: 1.1rem;
}

.aside-box {
  margin-bottom: 1rem;
  padding: 1.3rem;
  background: rgba(247, 242, 231, 0.62);
  border: 1px solid var(--line);
}

.aside-box h2,
.aside-box h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.fact-list {
  margin: 0;
}

.fact-list div {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}

.fact-list div:last-child {
  border-bottom: 0;
}

.fact-list dt {
  color: var(--ink-faint);
  font: 0.74rem/1.6 var(--sans);
}

.fact-list dd {
  margin: 0;
  font-size: 0.88rem;
}

.timeline {
  position: relative;
  margin: 2.4rem 0;
  padding: 0;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 5.2rem;
  width: 1px;
  background: var(--line);
}

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr);
  gap: 2rem;
  padding: 0 0 1.55rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  top: 0.47rem;
  left: 4.93rem;
  width: 0.56rem;
  height: 0.56rem;
  background: var(--paper);
  border: 1px solid var(--rust);
  border-radius: 50%;
}

.timeline time {
  color: var(--rust);
  font: 600 0.74rem/1.6 var(--sans);
}

.timeline p {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.75;
}

.image-panel {
  display: grid;
  grid-template-columns: minmax(190px, 0.55fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  margin: 2.5rem 0;
}

.image-panel img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.image-panel.crest img {
  aspect-ratio: 1;
  object-fit: contain;
  padding: 2rem;
  background: var(--night);
}

.image-panel figcaption {
  color: var(--ink-soft);
  font: 0.82rem/1.75 var(--sans);
}

.portrait-hero {
  display: flex;
  justify-content: center;
  margin: 0 0 2.5rem;
}

.portrait-hero img {
  display: block;
  width: min(260px, 68vw);
  height: auto;
  box-shadow: none;
}

.detail-table-wrap {
  margin: 1rem 0 2rem;
  overflow: hidden;
  border: 1px solid var(--line);
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(247, 242, 231, 0.58);
  font-family: var(--sans);
}

.detail-table th,
.detail-table td {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.detail-table tr:last-child th,
.detail-table tr:last-child td {
  border-bottom: 0;
}

.detail-table th {
  width: 30%;
  color: var(--rust);
  font: 600 1.05rem/1.5 var(--serif);
  letter-spacing: 0.02em;
}

.detail-table td {
  color: var(--ink-soft);
}

.point-list {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0 2rem;
  padding-left: 1.25rem;
}

.point-list li {
  padding-left: 0.2rem;
  color: var(--ink-soft);
  line-height: 1.75;
}

.prose,
.prose .lead {
  font-family: var(--reading);
}

.intro-panel {
  margin: 1.4rem 0 2.4rem;
  padding: clamp(1.2rem, 3vw, 1.8rem);
  background: rgba(247, 242, 231, 0.76);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
}

.intro-panel .lead {
  margin: 0;
  color: var(--ink);
}

.entity-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  gap: clamp(1.4rem, 4vw, 3rem);
  align-items: center;
  margin: 0 0 2rem;
  padding: clamp(1.2rem, 3vw, 1.8rem);
  background: rgba(247, 242, 231, 0.76);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
}

.entity-overview-card h2 {
  margin: 0.3rem 0 1rem;
}

.entity-overview-card .fact-list {
  margin: 0;
}

.entity-crest {
  margin: 0;
}

.entity-crest img {
  width: 100%;
  height: auto;
  padding: 0;
  background: transparent;
  border: 0;
  object-fit: contain;
  box-shadow: none;
}

@media (max-width: 720px) {
  .entity-hero {
    grid-template-columns: 1fr;
  }

  .entity-crest {
    width: min(64vw, 240px);
    justify-self: center;
  }
}

.relation-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.relation-list a {
  padding: 0.38rem 0.58rem;
  color: var(--forest);
  background: rgba(65, 91, 80, 0.08);
  border: 1px solid rgba(65, 91, 80, 0.2);
  font: 0.76rem/1.3 var(--sans);
  text-decoration: none;
}

.relation-list a:hover {
  color: var(--paper-light);
  background: var(--forest);
}

.notice {
  margin: 2rem 0;
  padding: 1.2rem 1.35rem;
  color: #4e3a2d;
  background: rgba(177, 138, 76, 0.12);
  border-left: 2px solid var(--gold);
  font-size: 0.9rem;
  line-height: 1.8;
}

.catalog-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.catalog-tools label {
  display: grid;
  gap: 0.45rem;
  color: var(--ink-faint);
  font: 600 0.7rem/1 var(--sans);
  letter-spacing: 0.08em;
}

.catalog-search {
  width: min(420px, 100%);
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  color: var(--ink);
  background: rgba(247, 242, 231, 0.72);
  border: 1px solid var(--line);
  border-radius: 0;
}

.catalog-search:focus {
  outline: 2px solid rgba(140, 75, 56, 0.42);
  outline-offset: 1px;
}

.result-count {
  color: var(--ink-faint);
  font: 0.78rem/1.5 var(--sans);
}

.novel-catalog {
  display: grid;
  gap: 1rem;
}

.volume-card {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  min-height: 255px;
  background: rgba(247, 242, 231, 0.65);
  border: 1px solid var(--line);
}

.volume-card[hidden] {
  display: none;
}

.volume-card .cover-frame {
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  box-shadow: none;
}

.volume-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.3rem, 3vw, 2rem);
}

.volume-copy .volume-label {
  color: var(--rust);
  font: 600 0.7rem/1 var(--sans);
  letter-spacing: 0.12em;
}

.volume-copy h2 {
  margin: 0.65rem 0 0.25rem;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 500;
  line-height: 1.2;
}

.volume-copy .english-title {
  margin: 0;
  color: var(--ink-faint);
  font: 0.72rem/1.5 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.volume-copy .summary {
  margin: 1rem 0 1.25rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.volume-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
}

.text-button {
  min-height: 42px;
  padding: 0.55rem 0;
  color: var(--rust);
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
  font: 600 0.76rem/1 var(--sans);
  letter-spacing: 0.06em;
}

.text-button:hover {
  color: var(--ink);
}

.volume-state {
  color: var(--ink-faint);
  font: 0.72rem/1.4 var(--sans);
}

dialog {
  width: min(760px, calc(100% - 2rem));
  max-height: min(82vh, 760px);
  padding: 0;
  color: var(--ink);
  background: var(--paper-light);
  border: 1px solid var(--gold);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.36);
}

dialog::backdrop {
  background: rgba(9, 14, 13, 0.74);
  backdrop-filter: blur(3px);
}

.dialog-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  color: var(--paper-light);
  background: var(--night);
}

.dialog-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 500;
}

.dialog-close {
  width: 42px;
  height: 42px;
  color: var(--paper-light);
  background: transparent;
  border: 1px solid rgba(247, 242, 231, 0.36);
  cursor: pointer;
  font-size: 1.1rem;
}

.dialog-body {
  padding: clamp(1.3rem, 4vw, 2.4rem);
}

.dialog-body .volume-subtitle {
  margin: 0 0 1.2rem;
  color: var(--rust);
  font: 600 0.78rem/1.6 var(--sans);
  letter-spacing: 0.05em;
}

.dialog-body p {
  margin: 0 0 1rem;
}

.dialog-body ul {
  padding-left: 1.2rem;
}

.entry-list {
  display: grid;
  gap: 0.8rem;
  margin: 1.5rem 0;
}

.entry-list article {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.entry-list article > span {
  color: var(--gold);
  font: 600 0.72rem/1.7 var(--sans);
}

.entry-list h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.entry-list p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.75;
}

.source-note {
  margin-top: 2rem;
  padding-top: 1rem;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  font: 0.76rem/1.7 var(--sans);
}

.site-footer {
  padding: 3rem 0;
  color: rgba(247, 242, 231, 0.58);
  background: var(--night);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: end;
}

.footer-inner strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--paper-light);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.footer-inner p {
  margin: 0;
  font: 0.76rem/1.7 var(--sans);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  font: 0.76rem/1.5 var(--sans);
}

@media (max-width: 980px) {
  .novel-preview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 2rem;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-aside {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-aside {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .header-inner {
    width: min(100% - 1.4rem, 1180px);
    min-height: 64px;
    align-items: flex-start;
    padding: 0.8rem 0;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .brand-text small {
    display: none;
  }

  .main-nav {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
  }

  .main-nav a {
    font-size: 0.78rem;
  }

  .main-nav a::after {
    bottom: -0.25rem;
  }

  .hero {
    min-height: 700px;
    background-position: 64% center;
  }

  .hero-content {
    width: min(100% - 1.6rem, 1180px);
    padding-bottom: 3.5rem;
  }

  .hero h1 {
    font-size: clamp(3.2rem, 16vw, 5rem);
  }

  .page-shell {
    width: min(100% - 1.6rem, 1180px);
  }

  .section-head,
  .page-intro {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
  }

  .domain-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .domain-card {
    min-height: 235px;
  }

  .section-head {
    margin-bottom: 2rem;
  }

  .detail-aside {
    grid-template-columns: 1fr;
  }

  .image-panel {
    grid-template-columns: 1fr;
  }

  .image-panel img {
    max-width: 300px;
  }

  .volume-card {
    grid-template-columns: 115px minmax(0, 1fr);
  }

  .volume-copy {
    padding: 1.1rem;
  }

  .volume-copy .summary {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}

/* Horizontal cover backgrounds: keep the whole composition in the artwork. */
.landing-content {
  display: flex;
  min-height: max(680px, 100svh);
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: clamp(7rem, 13vh, 9rem) 0 clamp(2.4rem, 5vh, 4rem);
}

.landing-copy {
  width: min(760px, 72vw);
}

.landing-controls {
  margin-top: 1.7rem;
}

.landing-hint {
  margin-top: 0.7rem;
}

.landing-image {
  background-position: center;
}

@media (max-width: 760px) {
  .landing-content {
    min-height: max(720px, 100svh);
    justify-content: flex-end;
    padding-top: 7rem;
    padding-bottom: 2rem;
  }

  .landing-copy {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .header-inner {
    display: block;
  }

  .main-nav {
    margin-top: 0.9rem;
    justify-content: flex-start;
  }

  .hero {
    min-height: 630px;
  }

  .hero-summary {
    line-height: 1.75;
  }

  .hero-actions .button {
    width: 100%;
  }

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

  .volume-card {
    grid-template-columns: 110px minmax(0, 1fr);
    min-height: 220px;
  }

  .volume-copy h2 {
    font-size: 1.35rem;
  }

  .volume-copy .summary {
    -webkit-line-clamp: 2;
  }

  .volume-state {
    display: none;
  }

  .timeline::before {
    left: 4.15rem;
  }

  .timeline li {
    grid-template-columns: 3.2rem minmax(0, 1fr);
    gap: 1.7rem;
  }

  .timeline li::before {
    left: 3.85rem;
  }

  .fact-list div {
    grid-template-columns: 4.2rem minmax(0, 1fr);
  }
}

/* Interactive landing rail and category explorer */
.landing-stage {
  cursor: grab;
  touch-action: pan-y;
}

.landing-stage:active {
  cursor: grabbing;
}

.landing-image-stack {
  transform: translate(var(--pointer-x, 0), var(--pointer-y, 0)) scale(1.015);
  transition: transform 420ms cubic-bezier(0.2, 0.65, 0.2, 1);
}

.landing-hint {
  grid-column: 1 / -1;
  margin: -0.6rem 0 0;
  color: rgba(247, 242, 231, 0.46);
  font: 0.68rem/1.5 var(--sans);
  letter-spacing: 0.06em;
}

.landing-rail {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: max(1.2rem, calc((100vw - 1320px) / 2));
  width: 190px;
  display: grid;
  transform: translateY(-50%);
}

.rail-item {
  display: grid;
  grid-template-columns: 1.8rem minmax(0, 1fr);
  gap: 0 0.5rem;
  padding: 0.55rem 0.65rem;
  color: rgba(247, 242, 231, 0.52);
  background: rgba(10, 16, 15, 0.2);
  border: 0;
  border-left: 1px solid rgba(247, 242, 231, 0.2);
  cursor: pointer;
  text-align: left;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.rail-item:hover,
.rail-item:focus-visible,
.rail-item[aria-pressed="true"] {
  color: var(--paper-light);
  background: rgba(17, 26, 25, 0.76);
  border-left-color: var(--gold-light);
}

.rail-item > span {
  grid-row: 1 / span 2;
  color: var(--gold-light);
  font: 0.64rem/1.35 var(--sans);
}

.rail-item strong {
  font-size: 0.78rem;
  font-weight: 500;
}

.rail-item small {
  overflow: hidden;
  color: currentColor;
  font: 0.56rem/1.35 var(--sans);
  letter-spacing: 0.05em;
  opacity: 0.66;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.archive-section {
  padding-top: clamp(3rem, 6vw, 5rem);
}

.archive-section-head {
  margin-bottom: 2.2rem;
}

.archive-explorer {
  --tone-a: #244b46;
  --tone-b: #101c1a;
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(250px, 0.58fr) minmax(0, 1.42fr);
  overflow: hidden;
  color: var(--paper-light);
  background: var(--night);
  border: 1px solid rgba(17, 26, 25, 0.5);
  box-shadow: var(--shadow);
}

.archive-browser {
  display: flex;
  flex-direction: column;
  background: var(--night);
  border-right: 1px solid rgba(247, 242, 231, 0.16);
}

.archive-browser-head {
  display: grid;
  gap: 0.3rem;
  padding: 1.4rem 1.3rem;
  border-bottom: 1px solid rgba(247, 242, 231, 0.16);
}

.archive-browser-head span {
  color: var(--gold-light);
  font: 0.6rem/1.3 var(--sans);
  letter-spacing: 0.18em;
}

.archive-browser-head strong {
  font-size: 1.05rem;
  font-weight: 500;
}

.archive-list {
  display: grid;
  align-content: start;
}

.archive-list-item {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 0.7rem;
  min-height: 70px;
  align-items: center;
  padding: 0.8rem 1.2rem;
  color: rgba(247, 242, 231, 0.65);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(247, 242, 231, 0.12);
  cursor: pointer;
  text-align: left;
  transition: color 160ms ease, background 160ms ease;
}

.archive-list-item:hover,
.archive-list-item:focus-visible,
.archive-list-item[aria-pressed="true"] {
  color: var(--paper-light);
  background: rgba(177, 138, 76, 0.12);
}

.archive-list-item > span {
  grid-row: 1 / span 2;
  color: var(--gold-light);
  font: 0.67rem/1.4 var(--sans);
}

.archive-list-item strong {
  grid-row: 1;
  grid-column: 2;
  font-size: 1rem;
  font-weight: 500;
}

.archive-list-item small {
  grid-row: 2;
  grid-column: 2;
  color: currentColor;
  font: 0.58rem/1.4 var(--sans);
  letter-spacing: 0.12em;
  opacity: 0.48;
  text-transform: uppercase;
}

.archive-list-item i {
  grid-column: 3;
  grid-row: 1 / span 2;
  color: var(--gold-light);
  font-style: normal;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.archive-list-item:hover i,
.archive-list-item:focus-visible i,
.archive-list-item[aria-pressed="true"] i {
  opacity: 1;
  transform: translateX(0);
}

.archive-preview {
  position: relative;
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: clamp(2rem, 5vw, 4.5rem);
  background:
    radial-gradient(circle at 80% 18%, color-mix(in srgb, var(--tone-a) 72%, transparent), transparent 34rem),
    linear-gradient(135deg, var(--tone-b), #111916 62%, #19211e);
  transition: opacity 180ms ease;
}

.archive-preview.is-changing {
  animation: archive-change 220ms ease;
}

@keyframes archive-change {
  0% { opacity: 1; }
  45% { opacity: 0.55; }
  100% { opacity: 1; }
}

.archive-preview.tone-2 {
  --tone-a: #6c4c32;
  --tone-b: #181b18;
}

.archive-preview.tone-3 {
  --tone-a: #3d4c62;
  --tone-b: #111820;
}

.archive-preview.tone-4 {
  --tone-a: #5a4631;
  --tone-b: #181611;
}

.archive-visual {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translate(var(--preview-x, 0), var(--preview-y, 0));
  transition: transform 500ms cubic-bezier(0.2, 0.65, 0.2, 1);
}

.archive-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background:
    linear-gradient(rgba(247, 242, 231, 0.055) 1px, transparent 1px) 0 0 / 100% 54px,
    linear-gradient(90deg, rgba(247, 242, 231, 0.045) 1px, transparent 1px) 0 0 / 54px 100%;
  mask-image: linear-gradient(90deg, transparent, #000 40%, #000);
}

.archive-visual-number {
  position: absolute;
  top: 0.05em;
  right: 0.08em;
  color: rgba(247, 242, 231, 0.055);
  font-size: clamp(11rem, 26vw, 23rem);
  font-weight: 500;
  line-height: 0.8;
  letter-spacing: -0.08em;
}

.archive-rings {
  position: absolute;
  top: 47%;
  right: 10%;
  width: min(50vw, 430px);
  aspect-ratio: 1;
  border: 1px solid rgba(211, 181, 126, 0.25);
  border-radius: 50%;
  transform: translateY(-50%);
}

.archive-rings::before,
.archive-rings::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(211, 181, 126, 0.18);
  border-radius: 50%;
}

.archive-rings::before {
  inset: 16%;
}

.archive-rings::after {
  inset: 34%;
  background: rgba(211, 181, 126, 0.08);
}

.archive-contours {
  position: absolute;
  right: -8%;
  bottom: -38%;
  width: 72%;
  aspect-ratio: 1.25;
  border-radius: 50% 42% 55% 46%;
  border: 1px solid rgba(247, 242, 231, 0.12);
  box-shadow:
    0 0 0 22px rgba(247, 242, 231, 0.018),
    0 0 0 44px rgba(247, 242, 231, 0.018),
    0 0 0 66px rgba(247, 242, 231, 0.018),
    0 0 0 88px rgba(247, 242, 231, 0.018);
  transform: rotate(-14deg);
}

.archive-visual-caption {
  position: absolute;
  top: 1.4rem;
  left: 1.5rem;
  color: rgba(247, 242, 231, 0.34);
  font: 0.58rem/1.4 var(--sans);
  letter-spacing: 0.18em;
}

.archive-preview-copy {
  position: relative;
  z-index: 1;
  width: min(620px, 90%);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background: linear-gradient(90deg, rgba(9, 14, 13, 0.84), rgba(9, 14, 13, 0.2));
  backdrop-filter: blur(2px);
}

.archive-preview-copy h2 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 500;
  line-height: 1.08;
}

.archive-preview-copy > p:not(.eyebrow) {
  max-width: 500px;
  margin: 1rem 0 0;
  color: rgba(247, 242, 231, 0.72);
  font-size: 0.96rem;
  line-height: 1.8;
}

.archive-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

.archive-keywords span {
  padding: 0.35rem 0.55rem;
  color: rgba(247, 242, 231, 0.72);
  border: 1px solid rgba(247, 242, 231, 0.2);
  font: 0.68rem/1.35 var(--sans);
}

.archive-samples {
  margin: 1.6rem 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(247, 242, 231, 0.2);
}

.archive-samples h3 {
  margin: 0 0 0.6rem;
  color: var(--gold-light);
  font: 600 0.66rem/1.4 var(--sans);
  letter-spacing: 0.12em;
}

.archive-samples ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.archive-samples li {
  color: rgba(247, 242, 231, 0.7);
  font-size: 0.8rem;
  line-height: 1.5;
}

.archive-samples a {
  color: inherit;
  text-decoration-color: rgba(211, 181, 126, 0.55);
  text-underline-offset: 0.2em;
}

.archive-samples a:hover,
.archive-samples a:focus-visible {
  color: var(--gold-light);
}

.archive-preview .button {
  margin-top: 0.3rem;
}

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

@media (max-width: 820px) {
  .archive-explorer {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .archive-browser {
    border-right: 0;
    border-bottom: 1px solid rgba(247, 242, 231, 0.16);
  }

  .archive-browser-head {
    padding: 1rem 1.1rem;
  }

  .archive-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-list-item:nth-child(odd) {
    border-right: 1px solid rgba(247, 242, 231, 0.12);
  }

  .archive-preview {
    min-height: 580px;
  }

  .archive-rings {
    top: 35%;
    right: -10%;
    width: 78vw;
  }

  .archive-preview-copy {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .landing-hint {
    margin-top: -0.2rem;
  }

  .archive-list {
    grid-template-columns: 1fr;
  }

  .archive-list-item:nth-child(odd) {
    border-right: 0;
  }

  .archive-preview {
    min-height: 530px;
    padding: 1.2rem;
  }

  .archive-preview-copy {
    padding: 1.1rem;
  }

  .archive-samples ul {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .archive-visual-caption {
    left: 1rem;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Editorial landing */
.landing-stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: var(--paper-light);
  background: var(--night);
}

.landing-header {
  position: absolute;
  inset: 0 0 auto;
  background: linear-gradient(180deg, rgba(10, 15, 14, 0.84), transparent);
  border-bottom: 1px solid rgba(247, 242, 231, 0.12);
  backdrop-filter: none;
}

.landing-image-stack,
.landing-vignette {
  position: absolute;
  inset: 0;
}

.landing-image {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-position: center;
  background-size: cover;
  transform: scale(1.035);
  transition: opacity 950ms ease, transform 6.5s ease;
}

.landing-image.is-active {
  opacity: 1;
  transform: scale(1);
}

.landing-vignette {
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8, 13, 12, 0.94) 0%, rgba(8, 13, 12, 0.72) 36%, rgba(8, 13, 12, 0.14) 72%),
    linear-gradient(0deg, rgba(8, 13, 12, 0.86) 0%, transparent 44%),
    radial-gradient(circle at 88% 15%, rgba(211, 181, 126, 0.18), transparent 25rem);
}

.landing-content {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 2.5rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 720px) 1fr;
  gap: 2rem;
  align-items: end;
  padding: 10rem 0 6.3rem;
}

.landing-copy {
  max-width: 720px;
}

.landing-label {
  margin: 0 0 0.8rem;
  color: var(--gold-light);
  font: 600 0.72rem/1.4 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.landing-copy h1 {
  margin: 0;
  font-size: clamp(4rem, 9vw, 8.4rem);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: 0.015em;
  text-shadow: 0 3px 34px rgba(0, 0, 0, 0.38);
}

.landing-english {
  margin: 0.8rem 0 0;
  color: var(--gold-light);
  font: 0.82rem/1.5 var(--sans);
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.landing-summary {
  max-width: 620px;
  margin: 1.5rem 0 0;
  color: rgba(247, 242, 231, 0.78);
  font-size: clamp(1rem, 1.65vw, 1.18rem);
  line-height: 1.9;
}

.landing-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
  padding-bottom: 0.4rem;
}

.slide-arrow {
  width: 44px;
  height: 44px;
  color: var(--paper-light);
  background: rgba(10, 16, 15, 0.36);
  border: 1px solid rgba(247, 242, 231, 0.32);
  cursor: pointer;
}

.slide-arrow:hover {
  color: var(--night);
  background: var(--gold-light);
}

.slide-dots {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.slide-dot {
  width: 22px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.slide-dot::before {
  content: "";
  display: block;
  width: 100%;
  height: 2px;
  background: rgba(247, 242, 231, 0.32);
  transition: background 160ms ease, transform 160ms ease;
}

.slide-dot[aria-pressed="true"]::before {
  background: var(--gold-light);
  transform: scaleY(2);
}

.slide-counter {
  min-width: 4.8rem;
  color: rgba(247, 242, 231, 0.62);
  font: 0.72rem/1 var(--sans);
  letter-spacing: 0.1em;
  text-align: right;
}

.landing-index {
  position: absolute;
  z-index: 3;
  right: max(1.25rem, calc((100vw - 1180px) / 2));
  bottom: 1.4rem;
  display: flex;
  gap: 1px;
  background: rgba(247, 242, 231, 0.18);
}

.landing-index a {
  min-width: 96px;
  display: grid;
  gap: 0.25rem;
  padding: 0.65rem 0.8rem;
  background: rgba(10, 16, 15, 0.74);
  text-decoration: none;
}

.landing-index a:hover {
  background: rgba(65, 91, 80, 0.88);
}

.landing-index span {
  color: var(--gold-light);
  font: 0.62rem/1.2 var(--sans);
  letter-spacing: 0.12em;
}

.landing-index strong {
  font-size: 0.82rem;
  font-weight: 500;
}

/* Archive portal */
.archive-header {
  background:
    radial-gradient(circle at 10% 30%, rgba(177, 138, 76, 0.2), transparent 24rem),
    linear-gradient(115deg, #131e1b, #1d2926 60%, #111a19);
}

.archive-search {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.archive-search label {
  color: rgba(247, 242, 231, 0.62);
  font: 600 0.68rem/1.4 var(--sans);
  letter-spacing: 0.1em;
}

.archive-search > div {
  display: flex;
  align-items: stretch;
}

.archive-search input {
  min-width: 0;
  flex: 1;
  min-height: 46px;
  padding: 0.65rem 0.8rem;
  color: var(--paper-light);
  background: rgba(247, 242, 231, 0.07);
  border: 1px solid rgba(247, 242, 231, 0.27);
  border-right: 0;
  border-radius: 0;
}

.archive-search input::placeholder {
  color: rgba(247, 242, 231, 0.42);
}

.archive-search button {
  min-width: 76px;
  color: var(--night);
  background: var(--gold-light);
  border: 1px solid var(--gold-light);
  cursor: pointer;
  font: 600 0.78rem/1 var(--sans);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 250px;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.category-card {
  position: relative;
  overflow: hidden;
  display: block;
  color: var(--paper-light);
  background:
    linear-gradient(0deg, rgba(9, 14, 13, 0.91), rgba(9, 14, 13, 0.08) 78%),
    var(--category-image) center / cover no-repeat;
  text-decoration: none;
}

.category-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(17, 26, 25, 0.54), transparent 65%);
  transition: opacity 180ms ease;
}

.category-card:hover::before {
  opacity: 0.35;
}

.category-map {
  grid-column: span 2;
  grid-row: span 2;
}

.category-number {
  position: absolute;
  z-index: 1;
  top: 1rem;
  left: 1rem;
  color: var(--gold-light);
  font: 600 0.7rem/1 var(--sans);
  letter-spacing: 0.12em;
}

.category-copy {
  position: absolute;
  z-index: 1;
  inset: auto 0 0;
  display: grid;
  padding: 1.2rem;
}

.category-copy small {
  color: var(--gold-light);
  font: 0.62rem/1.4 var(--sans);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.category-copy strong {
  margin-top: 0.25rem;
  font-size: clamp(1.35rem, 2.1vw, 2rem);
  font-weight: 500;
  line-height: 1.25;
}

.category-copy > span {
  margin-top: 0.5rem;
  color: rgba(247, 242, 231, 0.7);
  font-size: 0.86rem;
  line-height: 1.65;
}

.category-copy em {
  margin-top: 0.8rem;
  color: var(--gold-light);
  font: normal 600 0.7rem/1.4 var(--sans);
  letter-spacing: 0.06em;
}

.category-error {
  grid-column: 1 / -1;
  margin: 0;
}

/* Dynamic card browsing */
.browse-header {
  background:
    radial-gradient(circle at 88% 12%, rgba(177, 138, 76, 0.18), transparent 24rem),
    var(--night);
}

.browse-description {
  max-width: 650px;
  margin: 1rem 0 0;
  color: rgba(247, 242, 231, 0.68);
  font-size: 0.98rem;
  line-height: 1.8;
}

.browse-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.browse-sidebar {
  position: sticky;
  top: 100px;
}

.category-list {
  display: grid;
  margin: 0.7rem 0 1.5rem;
  border-top: 1px solid var(--line);
}

.category-list a {
  padding: 0.7rem 0;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  font: 0.86rem/1.4 var(--sans);
  text-decoration: none;
}

.category-list a:hover,
.category-list a[aria-current="page"] {
  color: var(--rust);
  font-weight: 600;
}

.facet-block {
  margin-bottom: 1.5rem;
}

.group-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.group-list a {
  padding: 0.35rem 0.5rem;
  color: var(--ink-soft);
  background: rgba(247, 242, 231, 0.52);
  border: 1px solid var(--line);
  font: 0.7rem/1.35 var(--sans);
  text-decoration: none;
}

.group-list a:hover,
.group-list a[aria-current="page"] {
  color: var(--paper-light);
  background: var(--forest);
  border-color: var(--forest);
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.library-card {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  background: rgba(247, 242, 231, 0.65);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: background 180ms ease, transform 180ms ease;
}

a.library-card:hover {
  background: var(--paper-light);
  transform: translateY(-2px);
}

.library-card.has-image {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
}

.library-image {
  min-height: 100%;
  overflow: hidden;
  background: var(--night);
}

.library-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.library-copy {
  display: flex;
  flex-direction: column;
  padding: 1.15rem;
}

.library-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  color: var(--rust);
  font: 600 0.65rem/1.4 var(--sans);
  letter-spacing: 0.08em;
}

.library-meta span:last-child {
  color: var(--ink-faint);
  font-weight: 400;
  text-align: right;
}

.library-card h3 {
  margin: 0.75rem 0 0.2rem;
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.35;
}

.library-subtitle {
  margin: 0 !important;
  color: var(--ink-faint) !important;
  font: 0.76rem/1.6 var(--sans) !important;
}

.library-card p {
  margin: 0.7rem 0 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.75;
}

.library-open,
.library-pending {
  margin-top: auto;
  padding-top: 0.9rem;
  color: var(--rust);
  font: 600 0.7rem/1.5 var(--sans);
  letter-spacing: 0.05em;
}

.library-pending {
  color: var(--ink-faint);
  font-weight: 400;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 3rem 1rem;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  text-align: center;
}

/* Interactive map */
.map-section {
  padding-top: clamp(2rem, 4vw, 3rem);
}

.map-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.55fr);
  gap: 1.2rem;
  align-items: start;
}

.map-panel {
  min-width: 0;
}

.map-toolbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.map-toolbar button {
  min-height: 38px;
  min-width: 42px;
  padding: 0.4rem 0.7rem;
  color: var(--ink);
  background: var(--paper-light);
  border: 1px solid var(--line);
  cursor: pointer;
}

.map-toolbar button:hover {
  color: var(--paper-light);
  background: var(--forest);
}

.map-toolbar span {
  margin-left: auto;
  color: var(--ink-faint);
  font: 0.72rem/1 var(--sans);
}

.map-viewport {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #102b2e;
  border: 1px solid rgba(17, 26, 25, 0.34);
  box-shadow: var(--shadow);
  cursor: grab;
  touch-action: none;
}

.map-viewport.is-dragging {
  cursor: grabbing;
}

.map-canvas {
  position: relative;
  width: 100%;
  transform-origin: 0 0;
  will-change: transform;
}

.map-canvas img {
  width: 100%;
  height: auto;
  user-select: none;
}

.map-marker {
  position: absolute;
  top: var(--my);
  left: var(--mx);
  width: 22px;
  height: 22px;
  padding: 0;
  color: var(--paper-light);
  background: rgba(140, 75, 56, 0.94);
  border: 2px solid rgba(255, 246, 223, 0.92);
  border-radius: 50%;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.map-marker::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px solid rgba(255, 246, 223, 0.34);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
}

.map-marker:hover::after,
.map-marker:focus-visible::after,
.map-marker.is-active::after {
  opacity: 1;
  transform: scale(1.08);
}

.map-marker.is-active {
  background: var(--gold);
  color: var(--night);
}

.map-marker span {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  width: max-content;
  max-width: 130px;
  padding: 0.35rem 0.5rem;
  color: var(--paper-light);
  background: rgba(17, 26, 25, 0.92);
  border: 1px solid rgba(247, 242, 231, 0.24);
  font: 0.68rem/1.3 var(--sans);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 150ms ease;
}

.map-marker:hover span,
.map-marker:focus-visible span,
.map-marker.is-active span {
  opacity: 1;
}

.map-help {
  margin: 0.7rem 0 0;
  color: var(--ink-faint);
  font: 0.72rem/1.6 var(--sans);
}

.map-info {
  position: sticky;
  top: 100px;
  padding: 1.3rem;
  background: rgba(247, 242, 231, 0.7);
  border: 1px solid var(--line);
}

.map-info h2 {
  margin: 0.3rem 0 0.7rem;
  font-size: 1.7rem;
  font-weight: 500;
}

.map-info > p {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.map-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font: 0.7rem/1.5 var(--sans);
}

.map-legend span {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.legend-capital {
  background: #d5aa45;
}

.legend-family {
  background: #6cab68;
}

.legend-fort {
  background: #a96442;
}

.legend-port {
  background: #a5a297;
}

@media (max-width: 980px) {
  .landing-content {
    grid-template-columns: 1fr;
  }

  .landing-controls {
    justify-content: flex-start;
  }

  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .browse-layout,
  .map-page-grid {
    grid-template-columns: 1fr;
  }

  .browse-sidebar,
  .map-info {
    position: static;
  }

  .category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    border: 0;
  }

  .category-list a {
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .landing-content {
    width: min(100% - 1.6rem, 1180px);
    padding-top: 8rem;
    padding-bottom: 5.4rem;
  }

  .landing-copy h1 {
    font-size: clamp(3.3rem, 16vw, 5.2rem);
  }

  .landing-summary {
    line-height: 1.75;
  }

  .landing-controls {
    flex-wrap: wrap;
  }

  .landing-index {
    right: 1rem;
    bottom: 0.8rem;
    left: 1rem;
  }

  .landing-index a {
    min-width: 0;
    flex: 1;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 220px;
  }

  .category-map {
    grid-column: span 2;
    grid-row: span 1;
  }

  .library-grid {
    grid-template-columns: 1fr;
  }

  .map-viewport {
    aspect-ratio: 1 / 1;
  }
}

@media (max-width: 480px) {
  .landing-stage {
    min-height: max(760px, 100svh);
  }

  .landing-copy h1 {
    font-size: clamp(3.1rem, 18vw, 4.6rem);
  }

  .landing-english {
    letter-spacing: 0.2em;
  }

  .slide-dot {
    width: 16px;
  }

  .landing-index span {
    display: none;
  }

  .landing-index strong {
    font-size: 0.72rem;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .category-map {
    grid-column: auto;
  }

  .category-copy > span {
    display: none;
  }

  .library-card.has-image {
    grid-template-columns: 105px minmax(0, 1fr);
  }

  .map-info {
    padding: 1rem;
  }
}

.library-section {
  grid-column: 1 / -1;
}

.library-section + .library-section {
  margin-top: 1.4rem;
}

.library-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}

.library-section-head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.library-section-head span {
  color: var(--ink-faint);
  font: 0.7rem/1.4 var(--sans);
}

.library-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

/* Ballad catalogue */
.ballad-header {
  background:
    radial-gradient(circle at 82% 18%, rgba(177, 138, 76, 0.2), transparent 25rem),
    linear-gradient(120deg, #1b2420, #111a19);
}

.ballad-section {
  padding-top: clamp(3rem, 6vw, 5rem);
}

.ballad-intro {
  max-width: 780px;
  margin-bottom: 2.2rem;
}

.ballad-intro p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.08rem;
  line-height: 1.9;
}

.ballad-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ballad-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ballad-filters button {
  min-height: 40px;
  padding: 0.45rem 0.7rem;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  font: 0.74rem/1.3 var(--sans);
}

.ballad-filters button:hover,
.ballad-filters button[aria-pressed="true"] {
  color: var(--paper-light);
  background: var(--forest);
  border-color: var(--forest);
}

.ballad-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.ballad-card {
  min-width: 0;
  padding: clamp(1.3rem, 3vw, 2rem);
  background:
    linear-gradient(135deg, rgba(177, 138, 76, 0.08), transparent 42%),
    rgba(247, 242, 231, 0.68);
  border: 1px solid var(--line);
}

.ballad-card:first-child {
  grid-column: 1 / -1;
}

.ballad-card-head > span {
  color: var(--rust);
  font: 600 0.66rem/1.4 var(--sans);
  letter-spacing: 0.1em;
}

.ballad-card h2 {
  margin: 0.5rem 0 0.2rem;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 500;
  line-height: 1.2;
}

.ballad-card-head p {
  margin: 0;
  color: var(--ink-faint);
  font: 0.76rem/1.55 var(--sans);
}

.ballad-summary {
  margin: 1rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.85;
}

.ballad-card blockquote {
  display: grid;
  gap: 0.35rem;
  margin: 1.4rem 0;
  padding: 1.2rem 0 1.2rem 1.4rem;
  color: var(--ink);
  border-left: 2px solid var(--gold);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.85;
}

.ballad-context {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.82rem;
  line-height: 1.75;
}

.ballad-note {
  margin-top: 2rem;
  padding: 1.2rem 1.4rem;
  background: rgba(177, 138, 76, 0.09);
  border-left: 2px solid var(--gold);
}

.ballad-note strong {
  font-size: 0.9rem;
}

.ballad-note p {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.75;
}

@media (max-width: 720px) {
  .library-group-grid,
  .ballad-grid {
    grid-template-columns: 1fr;
  }

  .ballad-card:first-child {
    grid-column: auto;
  }
}

/* Landscape-first landing layout */
.landing-stage {
  min-height: max(680px, 100svh);
  overflow-x: hidden;
  overflow-x: clip;
}

.landing-content {
  min-width: 0;
  min-height: max(680px, 100svh);
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr auto auto;
  grid-template-areas:
    "copy"
    "controls"
    "hint";
  align-items: center;
  padding: clamp(7rem, 13vh, 9rem) 0 clamp(2.4rem, 5vh, 4rem);
}

.landing-copy {
  grid-area: copy;
  align-self: end;
  width: min(760px, 72vw);
}

.landing-controls {
  grid-area: controls;
  align-self: end;
  justify-content: flex-start;
  padding-bottom: 0;
}

.landing-hint {
  grid-area: hint;
  align-self: start;
  margin: 0;
}

.landing-rail {
  display: none;
}

@media (min-width: 1100px) {
  .landing-copy h1 {
    font-size: clamp(5rem, 7.4vw, 8rem);
  }
}

@media (max-width: 980px) {
  .landing-content {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr auto auto;
    grid-template-areas:
      "copy"
      "controls"
      "hint";
  }

  .landing-copy {
    width: min(760px, 82vw);
  }

  .landing-copy h1 {
    font-size: clamp(3.6rem, 8.5vw, 5.3rem);
  }
}

@media (max-width: 760px) {
  .landing-stage {
    min-height: max(760px, 100svh);
  }

  .landing-content {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "copy"
      "controls"
      "hint";
    row-gap: 1.4rem;
    align-items: start;
    padding-top: 7rem;
    padding-bottom: 2rem;
  }

  .landing-copy {
    width: 100%;
  }

  .landing-copy h1 {
    font-size: clamp(3.2rem, 15vw, 5rem);
  }
}

@media (max-width: 560px) {
  .landing-index a {
    min-width: 0;
    padding: 0.6rem 0.45rem;
  }
}
