.page-archive {
  background: linear-gradient(180deg, var(--stone-start), var(--stone-end));
  min-height: 100dvh;
  color: var(--parchment);
}

.page-landing {
  background: linear-gradient(180deg, var(--stone-end), var(--stone-start), var(--stone-end));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 32px;
}

.landing__line-v {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--gold-dim));
  margin-bottom: 24px;
}

.landing__subtitle {
  font-size: var(--label-size);
  letter-spacing: 4px;
  color: var(--parchment-ghost);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.landing__title {
  font-family: var(--font-prose);
  font-size: 28px;
  color: var(--parchment);
  line-height: 1.2;
  margin-bottom: 8px;
}

.landing__chinese {
  font-family: var(--font-prose);
  font-size: 14px;
  color: rgba(196, 168, 122, 0.65);
  letter-spacing: 2px;
  margin-bottom: 32px;
}

.landing__epigraph {
  font-family: var(--font-prose);
  font-size: 13px;
  color: rgba(244, 239, 230, 0.35);
  line-height: 1.8;
  max-width: 240px;
  margin-bottom: 40px;
  font-style: italic;
}

.landing__enter {
  padding: 12px 32px;
  border: 1px solid rgba(196, 168, 122, 0.2);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.3s;
}

.landing__enter:hover {
  border-color: rgba(196, 168, 122, 0.4);
}

.landing__enter-label {
  font-size: var(--label-size);
  letter-spacing: 3px;
  color: rgba(196, 168, 122, 0.5);
  text-transform: uppercase;
}

.landing__continue {
  margin-top: 16px;
  font-size: 11px;
  color: rgba(244, 239, 230, 0.2);
  cursor: pointer;
  transition: color 0.3s;
}

.landing__continue:hover {
  color: rgba(244, 239, 230, 0.4);
}

.landing__continue-title {
  font-family: var(--font-prose);
  font-style: italic;
}

.landing__line-v-bottom {
  width: 1px;
  height: 40px;
  background: linear-gradient(to top, transparent, rgba(196, 168, 122, 0.15));
  margin-top: 32px;
}

.archive-header {
  padding: 20px var(--page-padding-mobile) 16px;
  border-bottom: 1px solid rgba(244, 239, 230, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.archive-header__back {
  font-size: 13px;
  color: var(--parchment-ghost);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
}

.archive-header__nav {
  display: flex;
  gap: 16px;
}

.archive-header__nav-link {
  font-size: var(--label-size);
  letter-spacing: 1px;
  color: rgba(244, 239, 230, 0.2);
  cursor: pointer;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(244, 239, 230, 0.06);
  transition: color 0.3s;
}

.archive-header__nav-link:hover,
.archive-header__nav-link--active {
  color: rgba(244, 239, 230, 0.4);
}

.archive-section-title {
  padding: 24px var(--page-padding-mobile) 16px;
  text-align: center;
}

.archive-section-title h2 {
  font-family: var(--font-prose);
  font-size: 18px;
  color: var(--parchment);
}

.archive-section-title p {
  font-size: 11px;
  color: var(--parchment-ghost);
  margin-top: 4px;
}

/* Character list */
.character-list {
  padding: 0 var(--page-padding-mobile);
}

.character-entry {
  border-bottom: 1px solid rgba(244, 239, 230, 0.04);
  padding: 14px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: background 0.2s;
}

.character-entry:hover {
  background: rgba(244, 239, 230, 0.02);
  margin: 0 calc(-1 * var(--page-padding-mobile));
  padding-left: var(--page-padding-mobile);
  padding-right: var(--page-padding-mobile);
}

.character-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(244, 239, 230, 0.04);
  border: 1px solid var(--gold-ghost);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.character-avatar__chinese {
  font-size: 14px;
  color: var(--gold-thread);
}

.character-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.character-entry__name {
  font-family: var(--font-prose);
  font-size: 14px;
  color: var(--parchment-dim);
}

.character-entry__subtitle {
  font-size: 10px;
  color: var(--parchment-ghost);
  margin-top: 2px;
}

/* Dossier */
.dossier {
  padding: 24px var(--page-padding-mobile);
}

.dossier__profile {
  text-align: center;
  margin-bottom: 24px;
}

.dossier__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(244, 239, 230, 0.05);
  border: 1px solid var(--gold-ghost);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dossier__avatar-chinese {
  font-family: var(--font-prose);
  font-size: 24px;
  color: var(--gold-thread);
}

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

.dossier__name {
  font-family: var(--font-prose);
  font-size: 20px;
  color: var(--parchment);
}

.dossier__chinese {
  font-size: 12px;
  color: var(--gold-thread);
  margin-top: 4px;
}

.dossier__epithet {
  font-family: var(--font-prose);
  font-size: 13px;
  font-style: italic;
  color: rgba(196, 168, 122, 0.5);
  margin-top: 4px;
}

.dossier__pronouns {
  font-size: 11px;
  color: var(--parchment-ghost);
  font-style: italic;
  margin-top: 4px;
}

.dossier__role {
  text-align: center;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--parchment-ghost);
  margin-bottom: 20px;
}

.dossier__notes {
  font-family: var(--font-prose);
  font-size: 13px;
  color: var(--parchment-dim);
  line-height: 1.7;
  margin-bottom: 20px;
  padding-left: 14px;
  border-left: 1px solid rgba(196, 168, 122, 0.12);
  font-style: italic;
}

.dossier__field {
  margin-bottom: 20px;
}

.dossier__field-label {
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(244, 239, 230, 0.2);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.dossier__field-value {
  font-family: var(--font-prose);
  font-size: 13px;
  color: var(--parchment-dim);
  line-height: 1.6;
}

.dossier__bonds {
  margin-top: 24px;
}

.bond-entry {
  display: block;
  padding: 10px 12px;
  background: rgba(244, 239, 230, 0.02);
  border-radius: 4px;
  border-left: 2px solid var(--gold-ghost);
  cursor: pointer;
  margin-bottom: 8px;
  transition: background 0.2s;
}

.bond-entry:hover {
  background: rgba(244, 239, 230, 0.04);
}

.bond-entry__header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bond-entry__name {
  font-family: var(--font-prose);
  font-size: 12px;
  color: rgba(244, 239, 230, 0.5);
}

.bond-entry__dot {
  font-size: 10px;
  color: rgba(196, 168, 122, 0.3);
}

.bond-entry__dynamic {
  font-size: 10px;
  color: var(--parchment-ghost);
}

.bond-entry__heart {
  font-family: var(--font-prose);
  font-size: 11px;
  color: var(--parchment-dim);
  line-height: 1.6;
  margin-top: 6px;
}

.bond-entry__standing {
  font-size: 10px;
  color: rgba(196, 168, 122, 0.35);
  margin-top: 4px;
}

/* Lexicon */
.lexicon-category {
  padding: 0 var(--page-padding-mobile);
  margin-bottom: 24px;
}

.lexicon-category__header {
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(196, 168, 122, 0.35);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lexicon-category__line {
  flex: 1;
  height: 1px;
  background: var(--gold-whisper);
}

.lexicon-term {
  padding: 10px 0;
  border-bottom: 1px solid rgba(244, 239, 230, 0.04);
  cursor: pointer;
}

.lexicon-term__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.lexicon-term__name {
  font-family: var(--font-prose);
  font-size: 13px;
  color: var(--parchment-dim);
}

.lexicon-term__chinese {
  font-size: 10px;
  color: var(--gold-dim);
}

.lexicon-term__description {
  font-family: var(--font-prose);
  font-size: 12px;
  color: rgba(244, 239, 230, 0.35);
  line-height: 1.6;
  margin-top: 8px;
  padding-left: 12px;
  border-left: 1px solid rgba(196, 168, 122, 0.1);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, margin-top 0.4s ease, opacity 0.4s ease;
  opacity: 0;
}

.lexicon-term--expanded .lexicon-term__description {
  max-height: 200px;
  opacity: 1;
}

/* Bonds constellation */
.constellation {
  width: 100%;
  height: calc(100dvh - 120px);
  position: relative;
  overflow: hidden;
  touch-action: none;
}

.constellation__loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-family: var(--font-prose);
  font-size: 13px;
  font-style: italic;
  color: var(--parchment-dim);
  z-index: 1;
}

.constellation svg {
  width: 100%;
  height: 100%;
}

.constellation__node {
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.constellation__node circle {
  transition: stroke 0.3s, r 0.3s;
}

.constellation__node--active circle {
  stroke: var(--gold-thread);
}

.constellation__node-char {
  font-family: var(--font-prose);
  fill: var(--gold-thread);
  font-size: 16px;
  pointer-events: none;
}

.constellation__node text:not(.constellation__node-char) {
  font-family: var(--font-prose);
  fill: var(--parchment-dim);
  font-size: 9px;
  pointer-events: none;
}

.constellation__link-group {
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.constellation__link-group:focus,
.constellation__link-group:active {
  outline: none;
}

.constellation svg {
  -webkit-tap-highlight-color: transparent;
  outline: none;
  user-select: none;
}

.constellation__link {
  pointer-events: none;
  transition: stroke-opacity 0.3s;
}

.constellation__link-label {
  font-family: var(--font-ui);
  font-size: 7px;
  letter-spacing: 0.5px;
  fill: rgba(196, 168, 122, 0.3);
  pointer-events: none;
  text-transform: uppercase;
  transition: opacity 0.3s;
}

.constellation__link--friendship { stroke: rgba(196, 168, 122, 0.25); }
.constellation__link--romance { stroke: rgba(196, 168, 122, 0.4); stroke-width: 1.5; }
.constellation__link--professional { stroke: rgba(244, 239, 230, 0.12); stroke-dasharray: 4 4; }
.constellation__link--rivalry { stroke: var(--rivalry-cool); }
.constellation__link--shadow-work { stroke: rgba(244, 239, 230, 0.06); }

.constellation__detail {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: rgba(30, 26, 22, 0.95);
  border: 1px solid rgba(196, 168, 122, 0.15);
  border-radius: 8px;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.constellation__detail--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.constellation__detail-dynamic {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--gold-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.constellation__detail-heart {
  font-family: var(--font-prose);
  font-size: 13px;
  color: var(--parchment-dim);
  line-height: 1.6;
  margin-bottom: 8px;
}

.constellation__detail-standing {
  font-size: 11px;
  color: var(--parchment-ghost);
}

.constellation__tooltip-bond {
  padding: 4px 0;
  transition: opacity 0.2s;
}

.constellation__tooltip-bond:hover {
  opacity: 0.7;
}

.constellation__tooltip {
  position: absolute;
  top: 60px;
  left: 20px;
  right: 20px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 10;
}

.constellation__tooltip--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (min-width: 768px) {
  .landing__title {
    font-size: 36px;
  }

  .landing__epigraph {
    font-size: 14px;
    max-width: 360px;
  }

  .archive-header {
    padding: 20px var(--page-padding-desktop) 16px;
  }

  .dossier {
    padding: 32px var(--page-padding-desktop);
    max-width: 600px;
    margin: 0 auto;
  }

  .character-list {
    max-width: 600px;
    margin: 0 auto;
  }

  .lexicon-category {
    max-width: 600px;
    margin: 0 auto 24px;
  }
}
