.legend {
  display: flex;
  justify-content: center;
  padding: var(--space-6) var(--space-4) var(--space-8);
}
.legend__panel {
  width: 1040px;
  max-width: 100%;
  background: var(--surface-raised);
  border: var(--border-w-bold) solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.legend__backbar {
  padding: 13px 26px;
  background: var(--surface-sunken);
  border-bottom: var(--border-w-bold) solid var(--border);
}
.legend__back {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--label-spacing);
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}

.legend__hero {
  padding: 26px 28px 0;
}
.legend__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--legend);
  margin: 0 0 10px;
}
.legend__gem {
  width: 10px;
  height: 10px;
  flex: none;
  background: var(--legend);
  transform: rotate(45deg);
}
.legend__title {
  font-family: var(--font-display);
  font-size: var(--fs-display-l);
  line-height: 1.04;
  color: var(--text);
  margin: 0;
}
.legend__who {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text-muted);
  margin: 10px 0 0;
}
.legend__who b {
  color: var(--text);
  font-weight: var(--fw-semibold);
}

.legend__quote {
  margin: 16px 28px 4px;
  padding-left: 16px;
  border-left: 3px solid var(--legend);
  font-family: var(--font-body);
  font-style: italic;
  font-size: 18px;
  line-height: 1.4;
  color: var(--text);
}

.legend__body {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  margin-top: 24px;
  border-top: var(--border-w-bold) solid var(--border);
}
.legend__side {
  padding: 26px 24px 28px;
  background: var(--surface);
  border-bottom: var(--border-w-bold) solid var(--border);
}
.legend__main {
  padding: 10px 28px 26px;
}
.legend__label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.legend__timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 6px;
}
.legend__timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 5px;
  bottom: 7px;
  width: 2px;
  background: rgba(74, 47, 26, 0.22);
}
.legend__event {
  position: relative;
  padding: 0 0 16px 24px;
}
.legend__event:last-child {
  padding-bottom: 0;
}
.legend__event::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 3px;
  width: 12px;
  height: 12px;
  background: var(--legend);
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
}
.legend__age {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--legend);
  margin: 0 0 2px;
}
.legend__event-text {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
  margin: 0;
}

.legend__chapter {
  padding: 22px 0;
  border-top: 2px dashed rgba(74, 47, 26, 0.16);
}
.legend__chapter:first-child {
  padding-top: 4px;
  border-top: none;
}
.legend__chapter-kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 6px;
}
.legend__chapter-title {
  font-family: var(--font-display);
  font-size: var(--fs-title);
  line-height: 1.15;
  color: var(--text);
  margin: 0 0 11px;
}
.legend__chapter-text {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 12px;
}
.legend__chapter-text:last-child {
  margin-bottom: 0;
}

.legend__figure {
  position: relative;
  overflow: hidden;
  margin: 0 0 14px;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(74, 47, 26, 0.07) 0,
    rgba(74, 47, 26, 0.07) 1px,
    transparent 1px,
    transparent 10px
  );
}
.legend__figure-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.legend__figure-placeholder {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.legend__figure-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  color: var(--text-muted);
}
.legend__figure-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(74, 47, 26, 0.18);
  border-top-color: var(--legend);
  border-radius: var(--radius-pill);
  animation: loading-spin 1s linear infinite;
}
.legend__figure-loading-text {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
@media (prefers-reduced-motion: reduce) {
  .legend__figure-spinner {
    animation: none;
  }
}

.legend__pull {
  margin: 0;
  padding: 18px 22px;
  border-left: 4px solid var(--legend);
  border-radius: 3px var(--radius-md) var(--radius-md) 3px;
  background: var(--legend-soft);
}
.legend__pull-text {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: var(--fw-semibold);
  font-size: 19px;
  line-height: 1.3;
  color: var(--text);
  margin: 0;
}

.legend__hooks {
  padding: 22px 0 4px;
  border-top: 2px dashed rgba(74, 47, 26, 0.16);
}
.legend__hooks-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.legend__hook {
  position: relative;
  padding-left: 22px;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.45;
  color: var(--text);
}
.legend__hook::before {
  content: "◆";
  position: absolute;
  left: 0;
  top: 1px;
  font-size: 12px;
  color: var(--legend);
}

.legend__relationships {
  padding: 22px 0 4px;
  border-top: 2px dashed rgba(74, 47, 26, 0.16);
}
.legend__rel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.legend__rel-key {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--legend);
  margin: 0 0 4px;
}
.legend__rel-value {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  margin: 0;
}

.legend__gatewrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 4px 28px 30px;
}
.legend__teaser {
  padding: 8px 0 0;
}
.legend__gate {
  position: relative;
  margin-top: -10px;
}
.legend__gate--standalone {
  margin-top: 18px;
}
.legend__fade {
  height: 110px;
  background: linear-gradient(
    to bottom,
    rgba(250, 240, 216, 0) 0%,
    var(--surface-raised) 86%
  );
}
.legend__ghost span {
  display: block;
  height: 12px;
  margin-bottom: 11px;
  border-radius: 6px;
  background: rgba(74, 47, 26, 0.12);
}
.legend__ghost span:nth-child(2) {
  width: 94%;
}
.legend__ghost span:nth-child(3) {
  width: 82%;
}
.legend__gatecard {
  max-width: 460px;
  margin: 8px auto 0;
  padding: 26px 26px 22px;
  text-align: center;
  border: var(--border-w-bold) solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
}
.legend__lock {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--legend);
  border: var(--border-w-bold) solid var(--legend);
  border-radius: var(--radius-pill);
}
.legend__lock svg {
  width: 22px;
  height: 22px;
}
.legend__gate-tag {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--legend);
  margin: 0 0 7px;
}
.legend__gate-title {
  font-family: var(--font-display);
  font-size: var(--fs-display-s);
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 11px;
}
.legend__gate-text {
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 34ch;
  margin: 0 auto 18px;
}
.legend__gate-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.legend__upgrade {
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  font-size: var(--fs-body);
  padding: 13px 28px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  color: var(--legend-ink);
  background: var(--legend);
  border: var(--border-w-bold) solid var(--border);
  border-radius: var(--radius-md);
}
.legend__plans {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: var(--label-spacing);
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text-muted);
}
.legend__gate-note {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-muted);
  margin: 16px 0 0;
}

/* CTA on the character page that links here */
.legend-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  text-decoration: none;
  color: var(--legend-ink);
  background: var(--legend);
  border-top: 2px solid var(--border);
}
.legend-cta__gem {
  width: 13px;
  height: 13px;
  flex: none;
  background: var(--legend-ink);
  transform: rotate(45deg);
}
.legend-cta__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.legend-cta__title {
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  font-size: 17px;
  line-height: 1;
}
.legend-cta__subtitle {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: var(--label-spacing);
  text-transform: uppercase;
  opacity: 0.85;
}
.legend-cta__arrow {
  margin-left: auto;
  font-size: 22px;
  line-height: 1;
}

@media (min-width: 721px) {
  /* --bp-md */
  .legend__title {
    font-size: 42px;
  }
  .legend__body {
    grid-template-columns: 300px 1fr;
  }
  .legend__side {
    border-right: var(--border-w-bold) solid var(--border);
    border-bottom: none;
  }
  .legend__figure {
    aspect-ratio: 5 / 2;
  }
  .legend__rel-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
