:root {
  --heroes-shell: min(92vw, 1240px);
  --heroes-copy: 760px;
}

body.heroes-page {
  background:
    radial-gradient(circle at 78% 12%, rgba(134, 75, 34, 0.13), transparent 32rem),
    radial-gradient(circle at 14% 34%, rgba(53, 89, 101, 0.1), transparent 30rem),
    linear-gradient(rgba(7, 10, 11, 0.91), rgba(7, 10, 11, 0.97)),
    url("/assets/images/tirisfalen-stone-desktop.webp") center top / cover fixed no-repeat,
    #070a0b;
}

.heroes-page .primary-nav a[aria-current="page"] {
  color: var(--gold-bright);
}

.hero-page-main,
.heroes-hub-main {
  min-height: 70vh;
  padding: clamp(1.3rem, 3vw, 2.6rem) 0 clamp(4rem, 8vw, 7rem);
}

.hero-article,
.heroes-hub {
  width: var(--heroes-shell);
  margin-inline: auto;
}

.heroes-page .breadcrumbs {
  margin-bottom: clamp(1.2rem, 2.5vw, 2rem);
}

.hero-intro {
  position: relative;
  display: grid;
  width: 100%;
  max-width: none;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  min-height: min(72vh, 720px);
  margin-bottom: 0;
  overflow: hidden;
  border: 1px solid rgba(205, 174, 113, 0.28);
  border-radius: 2px;
  color: inherit;
  background: rgba(8, 12, 13, 0.92);
  box-shadow: 0 38px 90px rgba(0, 0, 0, 0.5);
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.hero-intro::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 34%;
  pointer-events: none;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(6, 9, 10, 0.82));
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 5.5vw, 5.7rem);
  background:
    radial-gradient(circle at 14% 18%, rgba(197, 167, 109, 0.12), transparent 19rem),
    linear-gradient(90deg, rgba(8, 12, 13, 0.98), rgba(8, 12, 13, 0.88));
}

.hero-kicker,
.hub-kicker {
  margin-bottom: 1rem;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.hero-copy h1,
.heroes-hub-header h1 {
  max-width: 14ch;
  margin-bottom: clamp(1.2rem, 2.3vw, 2rem);
  color: #f0e7d4;
  font-family: var(--serif);
  font-size: clamp(3rem, 5.5vw, 5.8rem);
  font-weight: 600;
  line-height: 0.94;
  letter-spacing: -0.028em;
}

.hero-copy .lead {
  max-width: 66ch;
  margin: 0;
  color: #c9c4b7;
  font-size: clamp(1rem, 1.25vw, 1.16rem);
  line-height: 1.72;
}

.hero-copy .lead strong {
  color: #ebe0c9;
}

.hero-intro .infobox {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 0 0 1.15rem;
  border: 0;
  border-left: 1px solid rgba(205, 174, 113, 0.24);
  border-radius: 0;
  background: #0b1011;
  font-size: 0.84rem;
  line-height: 1.45;
}

.hero-intro .infobox figure {
  position: relative;
  height: clamp(270px, 37vw, 500px);
  margin: 0;
  overflow: hidden;
}

.hero-intro .infobox figure::after {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  content: "";
  background: linear-gradient(transparent, #0b1011);
}

.hero-intro .infobox img {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  object-fit: cover;
  object-position: center;
}

.hero-intro .ib-title {
  position: relative;
  z-index: 2;
  margin: -1.3rem 1.25rem 0.75rem !important;
  padding: 0 0 0.65rem;
  border: 0 !important;
  border-bottom: 1px solid rgba(205, 174, 113, 0.22) !important;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 1.65rem !important;
  text-align: left;
}

.hero-intro .infobox table {
  width: calc(100% - 2.5rem);
  margin: 0 1.25rem;
  border-collapse: collapse;
}

.hero-intro .infobox td {
  padding: 0.48rem 0.25rem;
  border-top: 1px solid rgba(205, 174, 113, 0.12);
  color: #b8b5aa;
  vertical-align: top;
}

.hero-intro .infobox td:first-child {
  width: 36%;
  color: var(--gold);
}

.hero-body {
  width: min(100%, 940px);
  margin: clamp(3.2rem, 7vw, 6.5rem) auto 0;
  color: #cbc6b9;
  font-size: clamp(1rem, 1.2vw, 1.11rem);
  line-height: 1.78;
}

.hero-body > h2,
.hero-body > h3 {
  scroll-margin-top: 92px;
  font-family: var(--serif);
}

.hero-body > h2 {
  margin: clamp(3.6rem, 7vw, 6.2rem) 0 1.25rem;
  padding-bottom: 0.72rem;
  border-bottom: 1px solid rgba(205, 174, 113, 0.25);
  color: #e4c987;
  font-size: clamp(2.15rem, 4vw, 3.45rem);
  font-weight: 600;
  line-height: 1.02;
}

.hero-body > h3 {
  margin: 2.6rem 0 0.7rem;
  color: #ead8b0;
  font-size: clamp(1.55rem, 2.4vw, 2.1rem);
  font-weight: 600;
  line-height: 1.15;
}

.hero-body a {
  color: var(--gold-bright);
  text-decoration: underline;
  text-decoration-color: rgba(225, 199, 141, 0.35);
  text-underline-offset: 0.18em;
}

.hero-body blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--gold);
  color: #dfd4be;
  background: rgba(19, 25, 25, 0.8);
  font-family: var(--serif);
  font-size: 1.22rem;
  font-style: italic;
}

.hero-body figure {
  margin: clamp(2.5rem, 5vw, 4.6rem) 0;
}

.hero-body figure img {
  width: 100%;
  height: auto;
  border: 1px solid rgba(205, 174, 113, 0.26);
  border-radius: 2px;
  box-shadow: 0 26px 65px rgba(0, 0, 0, 0.42);
}

.hero-body figcaption {
  max-width: 78ch;
  margin-top: 0.75rem;
  color: #8f9189;
  font-size: 0.84rem;
  line-height: 1.5;
}

.toc {
  margin: 0 0 clamp(3rem, 7vw, 5rem);
  padding: 1.4rem clamp(1.2rem, 3vw, 2.1rem);
  border: 1px solid rgba(205, 174, 113, 0.2);
  background: rgba(14, 20, 21, 0.82);
  font-size: 0.93rem;
}

.toc strong {
  color: var(--gold);
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.toc ol {
  columns: 2;
  gap: 2.5rem;
  margin: 1rem 0 0;
  padding-left: 1.25rem;
}

.toc li {
  break-inside: avoid;
  margin: 0.28rem 0;
}

.video {
  position: relative;
  width: min(100%, 420px);
  margin: 1.6rem auto 3rem;
  aspect-ratio: 9 / 16;
}

.video.wide {
  width: min(100%, 860px);
  max-width: none;
  aspect-ratio: 16 / 9;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(205, 174, 113, 0.28);
  border-radius: 2px;
}

.tree {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(205, 174, 113, 0.22);
  background: rgba(14, 20, 21, 0.78);
  scrollbar-color: var(--gold) #111819;
}

.tree svg {
  width: 100%;
  min-width: 720px;
  height: auto;
}

details.mermaid-src {
  margin-top: 0.8rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(205, 174, 113, 0.15);
  background: #0d1314;
  color: #9d9b90;
  font-size: 0.8rem;
}

details.mermaid-src pre {
  overflow-x: auto;
  white-space: pre;
}

.related {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.8rem;
  padding: 0;
  list-style: none;
}

.related li {
  min-height: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(205, 174, 113, 0.2);
  background: rgba(15, 22, 23, 0.85);
}

.archive-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-top: 1.4rem;
}

.archive-link {
  display: flex;
  min-height: 135px;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem;
  border: 1px solid rgba(205, 174, 113, 0.23);
  background: linear-gradient(145deg, rgba(22, 29, 29, 0.92), rgba(9, 13, 14, 0.95));
  text-decoration: none !important;
}

.archive-link small {
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.archive-link strong {
  color: #e9dfcb;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.08;
}

.heroes-hub-header {
  max-width: 920px;
  margin: clamp(2rem, 6vw, 5.5rem) 0 clamp(3rem, 6vw, 5rem);
}

.heroes-hub-header h1 {
  max-width: none;
  margin-bottom: 1.2rem;
  font-size: clamp(3.8rem, 8vw, 7.8rem);
}

.heroes-hub-header p:last-child {
  max-width: 66ch;
  color: #b9b6ab;
  font-size: clamp(1.05rem, 1.5vw, 1.24rem);
  line-height: 1.7;
}

.heroes-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(0.9rem, 2vw, 1.5rem);
}

.hero-card {
  grid-column: span 4;
  min-width: 0;
}

.hero-card:first-child,
.hero-card:nth-child(6) {
  grid-column: span 6;
}

.hero-card a {
  position: relative;
  display: grid;
  min-height: 480px;
  overflow: hidden;
  border: 1px solid rgba(205, 174, 113, 0.22);
  background: #0c1112;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.35);
}

.hero-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease, filter 500ms ease;
}

.hero-card a::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(4, 7, 8, 0.04) 18%, rgba(4, 7, 8, 0.92) 82%);
}

.hero-card-copy {
  position: relative;
  z-index: 2;
  align-self: end;
  padding: clamp(1.3rem, 3vw, 2.1rem);
}

.hero-card-copy small {
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-card-copy h2 {
  margin: 0.45rem 0 0.5rem;
  color: #f0e7d4;
  font-family: var(--serif);
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 600;
  line-height: 0.98;
}

.hero-card-copy p {
  max-width: 52ch;
  margin: 0;
  color: #bdb9ad;
  font-size: 0.91rem;
  line-height: 1.55;
}

@media (hover: hover) {
  .hero-card a:hover img {
    filter: saturate(1.08) brightness(1.04);
    transform: scale(1.035);
  }

  .archive-link:hover,
  .related li:hover {
    border-color: rgba(225, 199, 141, 0.52);
  }
}

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

  .hero-copy {
    order: 2;
    margin-top: -5rem;
    padding-top: 7.5rem;
  }

  .hero-intro .infobox {
    order: 1;
    border-left: 0;
  }

  .hero-intro .infobox figure {
    height: min(72vh, 620px);
  }

  .hero-intro .infobox .ib-title,
  .hero-intro .infobox table {
    display: none;
  }

  .hero-card,
  .hero-card:first-child,
  .hero-card:nth-child(6) {
    grid-column: span 6;
  }
}

@media (max-width: 640px) {
  body.heroes-page {
    background:
      linear-gradient(rgba(7, 10, 11, 0.93), rgba(7, 10, 11, 0.98)),
      url("/assets/images/tirisfalen-stone-mobile.webp") center top / cover fixed no-repeat,
      #070a0b;
  }

  .hero-page-main,
  .heroes-hub-main {
    padding-top: 0.85rem;
  }

  .hero-intro .infobox figure {
    height: 55vh;
    min-height: 360px;
  }

  .hero-copy {
    margin-top: -4.25rem;
    padding: 6.4rem 1.35rem 2rem;
  }

  .hero-copy h1 {
    max-width: 12ch;
    font-size: clamp(2.65rem, 12vw, 4rem);
    line-height: 0.96;
  }

  .hero-copy .lead {
    font-size: 1rem;
    line-height: 1.65;
  }

  .hero-body {
    margin-top: 3.2rem;
  }

  .hero-body > h2 {
    margin-top: 3.8rem;
    font-size: clamp(2rem, 10vw, 2.75rem);
  }

  .toc ol {
    columns: 1;
  }

  .tree {
    margin-inline: calc((100vw - var(--heroes-shell)) / -2);
    padding-inline: calc((100vw - var(--heroes-shell)) / 2);
    border-right: 0;
    border-left: 0;
  }

  .heroes-hub-header h1 {
    font-size: clamp(3.5rem, 18vw, 5.2rem);
  }

  .hero-card,
  .hero-card:first-child,
  .hero-card:nth-child(6) {
    grid-column: 1 / -1;
  }

  .hero-card a {
    min-height: 430px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-card img {
    transition: none;
  }
}
