/* Page-specific layouts. One block per page, in site order. */

.section__more {
  color: var(--bone-2);
  font-size: 0.875rem;
}

/* ---- home: directory ------------------------------------------------------ */

.directory {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.directory__col h3 {
  padding-bottom: 10px;
  border-bottom: 2px solid var(--tone);
  color: var(--dust);
  font-size: 0.875rem;
  font-weight: 500;
}

.directory__link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}

.directory__name {
  font-size: var(--step-1);
  font-weight: 500;
}

.directory__count {
  align-self: center;
  color: var(--dust);
}

.directory__desc {
  grid-column: 1 / -1;
  color: var(--dust);
  font-size: var(--step--1);
}

.directory__link:hover .directory__name {
  color: var(--tone);
}

.directory__subs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.directory__subs .pill {
  height: 28px;
  padding: 0 10px;
  font-size: 0.8125rem;
}

@media (max-width: 959px) {
  .directory {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 24px;
  }
}

@media (max-width: 520px) {
  .directory {
    grid-template-columns: 1fr;
  }
}

/* ---- map conditions: home hero panel, full schedule on the maps page ---------- */

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

.conditions__region .select {
  height: 32px;
  font-size: 0.875rem;
}

/* The schedule sits above the map cards, which are not in a .section of their own. */
#conditions + .maps-body {
  margin-top: 64px;
}

.conditions {
  display: grid;
  gap: 28px;
}

.conditions__group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--dust);
  font-size: 0.875rem;
  font-weight: 500;
}

.conditions__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.condition {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--night-2);
}

.condition--live {
  border-color: color-mix(in srgb, var(--tone) 40%, transparent);
  background: color-mix(in srgb, var(--tone) 6%, var(--night-2));
}

.condition__icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.condition__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.condition__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-weight: 500;
  line-height: 1.35;
}

.condition__name .tag {
  padding: 0 6px;
  font-size: 0.75rem;
  font-weight: 400;
}

.condition__maps {
  color: var(--bone-2);
  font-size: var(--step--1);
}

.condition__maps a {
  text-decoration: none;
}

.condition__maps a:hover {
  color: var(--tone);
}

.condition__when {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  white-space: nowrap;
}

.condition__count {
  font-size: 0.9375rem;
  font-weight: 500;
}

.condition--live .condition__count {
  color: var(--tone);
}

.condition__time {
  color: var(--dust);
  font-size: var(--step--1);
}

.conditions__note {
  margin-top: 16px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--tone) 60%, transparent);
  animation: live-pulse 2s var(--ease) infinite;
}

@keyframes live-pulse {
  70% {
    box-shadow: 0 0 0 6px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* The live panel in the hero, so conditions show without scrolling. */
.now {
  margin-top: 24px;
  max-width: 480px;
  padding: 12px 14px;
  border: 1px solid rgba(235, 230, 215, 0.3);
  border-radius: var(--radius);
  background: rgba(19, 9, 24, 0.8);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.now[hidden] {
  display: none;
}

.now__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.now__title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--bone-2);
  font-size: 0.875rem;
  font-weight: 500;
}

.now__count {
  flex: 1;
  color: var(--tone);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.now__region.select {
  height: 28px;
  padding-left: 10px;
  padding-right: 28px;
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  font-size: 0.8125rem;
}

.now__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

.now__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.now__icon {
  flex: none;
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.now__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.now__name,
.now__meta {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.now__name {
  font-weight: 500;
}

.now__meta {
  color: var(--dust);
  font-size: var(--step--1);
}

.now__meta .num {
  color: var(--tone);
}

.now__next {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  color: var(--bone-2);
  font-size: var(--step--1);
  text-decoration: none;
}

.now__next-names {
  flex: 1;
  min-width: 0;
}

.now__next-all {
  color: var(--tone);
  white-space: nowrap;
}

.now__next:hover .now__next-all {
  text-decoration: underline;
}

/* Phones: straight under the title, so it is on screen before any scrolling. */
@media (max-width: 859px) {
  .hero__content {
    display: flex;
    flex-direction: column;
  }

  .hero__content > * {
    order: 2;
  }

  .hero__content > .hero__title {
    order: 0;
  }

  .now {
    order: 1;
    width: 100%;
  }
}

@media (max-width: 359px) {
  .now__list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .section__head:has(.conditions__region) {
    flex-wrap: wrap;
  }
}

/* ---- news ------------------------------------------------------------------ */

.news-list {
  border-top: 1px solid var(--rule);
}

.section__head + .news-list,
.section__head + #news-list {
  border-top: 0;
}

.news {
  position: relative;
  border-bottom: 1px solid var(--rule);
}

/* Opening a post sweeps the logo's four stripes across its top edge. */
.news::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan) 0 25%, var(--green) 25% 50%, var(--yellow) 50% 75%, var(--red) 75%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.7s var(--ease);
}

.news.is-open::before {
  transform: scaleX(1);
}

.news__head {
  width: 100%;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 24px;
  padding: 16px 0;
  border: 0;
  background: none;
  text-align: left;
  transition: grid-template-columns 0.55s var(--ease), padding 0.55s var(--ease);
}

/* The thumbnail widens as the post opens. */
.news.is-open .news__head {
  grid-template-columns: 360px minmax(0, 1fr) 34px;
  padding: 28px 0 24px;
}

.news__thumb {
  aspect-ratio: 3;
  overflow: hidden;
  border-radius: 2px;
  background: var(--night-2);
}

.news__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.news__head:hover .news__thumb img {
  transform: scale(1.05);
}

.news.is-open .news__thumb img {
  transform: none;
}

.news__text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.news__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--dust);
  font-size: var(--step--1);
}

.news__title {
  font-size: var(--step-1);
  font-weight: 500;
  line-height: 1.35;
}

.news__head:hover .news__title {
  text-decoration: underline;
  text-decoration-color: var(--rule-2);
  text-underline-offset: 0.2em;
}

.news__alt {
  color: var(--dust);
  font-size: var(--step--1);
}

/* Plus that turns into a minus. */
.news__toggle {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid var(--rule-2);
  border-radius: 50%;
  transition: transform 0.5s var(--ease), background 0.25s, border-color 0.25s;
}

.news__toggle i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 1.5px;
  background: var(--bone);
  transform: translate(-50%, -50%);
  transition: transform 0.45s var(--ease), background 0.25s;
}

.news__toggle i + i {
  transform: translate(-50%, -50%) rotate(90deg);
}

.news__head:hover .news__toggle {
  border-color: var(--bone-2);
}

.news.is-open .news__toggle {
  transform: rotate(180deg);
  background: var(--bone);
  border-color: var(--bone);
}

.news.is-open .news__toggle i {
  background: var(--night);
}

.news.is-open .news__toggle i + i {
  transform: translate(-50%, -50%) rotate(0deg);
}

/* Height animates through a 0fr → 1fr grid row. */
.news__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s var(--ease);
}

.news.is-open .news__panel {
  grid-template-rows: 1fr;
}

.news__panel-inner {
  min-height: 0;
  overflow: hidden;
}

.news__body {
  max-width: 46em;
  padding: 4px 0 48px;
}

/* Blocks rise in one after another. */
.news.is-open .news__body > * {
  animation: news-in 0.5s var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 10) * 45ms + 120ms);
}

@keyframes news-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.news__block + .news__block,
.news__block + .news__video,
.news__video + .news__block {
  margin-top: 0.9em;
}

.news__body h2 {
  margin-top: 1.4em;
  color: var(--bone);
  font-size: var(--step-2);
}

.news__body h3,
.news__body h4 {
  margin-top: 1.2em;
  color: var(--bone);
  font-size: var(--step-1);
  font-weight: 500;
}

.news__body p + p {
  margin-top: 0.8em;
}

.news__body strong {
  color: var(--bone);
  font-weight: 600;
}

.news__body a {
  color: var(--bone);
  text-decoration-color: var(--yellow);
}

.news__body ul,
.news__body ol {
  padding-left: 1.4em;
}

.news__body ul {
  list-style: disc;
}

.news__body ol {
  list-style: decimal;
}

.news__body ul ul {
  list-style: circle;
  margin-top: 0.3em;
}

.news__body li + li {
  margin-top: 0.35em;
}

.news__body li::marker {
  color: var(--dust);
}

.news__body img {
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 2px;
}

.news__block--image {
  margin: 1.4em 0;
}

.news__body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.news__body th,
.news__body td {
  padding: 6px 12px 6px 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.news__body blockquote {
  margin: 0;
  padding-left: 16px;
  border-left: 2px solid var(--rule-2);
}

.news__video {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 1.4em 0;
  background: var(--night-2);
}

.news__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.news__lang {
  margin-bottom: 1em;
}

.news__source {
  margin-top: 2em;
}

@media (max-width: 720px) {
  .news__head {
    grid-template-columns: 96px minmax(0, 1fr) 30px;
    gap: 14px;
  }

  .news.is-open .news__head {
    grid-template-columns: 140px minmax(0, 1fr) 30px;
    padding: 20px 0 16px;
  }

  .news__title {
    font-size: var(--step-0);
  }

  .news__toggle {
    width: 30px;
    height: 30px;
  }
}

/* ---- items ------------------------------------------------------------------ */

.items-filter {
  width: min(280px, 100%);
}

.items-cats {
  margin-bottom: 16px;
}

.items-count {
  margin-bottom: 12px;
}

.recipe-benches {
  margin-bottom: 10px;
}

/* ---- quests ------------------------------------------------------------------ */

.quests-maps {
  margin-bottom: 16px;
}

.list-count {
  margin-bottom: 12px;
}

.quest-quote {
  margin: 0;
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--tone);
}

.quest-quote footer {
  margin-top: 8px;
  color: var(--dust);
  font-size: var(--step--1);
}

.quest-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.quest-xp {
  margin-top: 8px;
}

/* ---- skill tree ---------------------------------------------------------------- */

.branches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.branch__title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--tone);
  font-size: var(--step-1);
  font-weight: 500;
}

.branch__tree {
  position: relative;
  height: 644px;
}

.branch__links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.branch__links line {
  stroke: var(--rule-2);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.branch__links line.is-lit {
  stroke: var(--tone);
  stroke-width: 3;
}

.skill-node {
  --d: 40px;
  position: absolute;
  left: calc((var(--col) * 2 + 1) / 6 * 100%);
  top: calc((var(--row) + 0.5) / 7 * 100%);
  width: 33.34%;
  transform: translate(-50%, calc(var(--d) / -2));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  text-decoration: none;
}

.skill-node.is-major {
  --d: 50px;
}

.skill-node__dot {
  width: var(--d, 40px);
  height: var(--d, 40px);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 2px solid var(--tone);
  border-radius: 50%;
  background: var(--night);
  color: var(--bone-2);
  font-size: 0.8125rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}

.skill-node.is-major .skill-node__dot,
.skill-head__dot.is-major {
  box-shadow: 0 0 0 3px var(--night), 0 0 0 4px color-mix(in srgb, var(--tone) 55%, transparent);
}

.skill-node:hover .skill-node__dot {
  background: var(--night-3);
  color: var(--bone);
}

.skill-node.is-lit .skill-node__dot {
  background: var(--tone);
  color: var(--night);
}

/* Labels sit on the page color so the connector lines pass behind them. */
.skill-node__name {
  max-width: 100%;
  padding: 0 4px;
  border-radius: 2px;
  background: var(--night);
  color: var(--bone-2);
  font-size: 0.8125rem;
  line-height: 1.3;
}

.skill-node:hover .skill-node__name,
.skill-node[aria-current='true'] .skill-node__name {
  color: var(--bone);
}

.skill-head {
  grid-template-columns: 64px 1fr;
}

.skill-head__dot {
  --d: 56px;
  background: var(--tone);
  color: var(--night);
  font-size: 1.125rem;
}

@media (max-width: 859px) {
  .branches {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

/* ---- hideout, traders, projects: stacked sections ------------------------------------- */

.station-index {
  margin-bottom: 8px;
}

.station,
.trader {
  padding: 36px 0;
  border-top: 1px solid var(--rule);
}

.station-index + .station,
.station-index + .trader {
  margin-top: 28px;
}

.station__head,
.trader__head {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
}

.station__head h2,
.trader__head h2 {
  font-size: var(--step-2);
}

.station__img {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--night-2);
}

.station__img:empty {
  background: repeating-linear-gradient(135deg, var(--rule) 0 1px, transparent 1px 9px), var(--night-2);
}

.station__img img {
  width: 90%;
  height: 90%;
  object-fit: contain;
}

.levels {
  margin-left: 116px;
  border-top: 1px solid var(--rule);
}

.levels--flat {
  border: 0;
}

.level {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}

.level__n {
  padding-top: 6px;
  color: var(--dust);
  font-size: 0.875rem;
}

.level__body {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.crafts summary {
  width: max-content;
  color: var(--bone-2);
  font-size: 0.875rem;
  cursor: pointer;
}

.crafts summary .num {
  color: var(--dust);
}

.crafts[open] summary {
  margin-bottom: 10px;
}

.crafts__label {
  margin-bottom: 6px;
  color: var(--dust);
  font-size: var(--step--1);
}

.trader__head {
  grid-template-columns: 120px 1fr;
}

.trader__img {
  width: 120px;
  aspect-ratio: 1.1;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--night-2);
}

.trader__links {
  margin-top: 6px;
}

.shop {
  width: 100%;
  border-collapse: collapse;
}

.shop th {
  padding: 8px 16px 8px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--dust);
  font-size: var(--step--1);
  font-weight: 500;
  text-align: left;
}

.shop td {
  padding: 8px 16px 8px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}

.shop__terms .note + .note {
  margin-left: 12px;
}

@media (max-width: 640px) {
  .levels {
    margin-left: 0;
  }

  .station__head,
  .trader__head {
    grid-template-columns: 72px 1fr;
  }

  .trader__img {
    width: 72px;
  }

  .shop thead {
    display: none;
  }

  .shop tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--rule);
  }

  .shop td {
    padding: 0;
    border: 0;
  }

  .shop__terms {
    grid-column: 1 / -1;
  }
}

/* ---- ARC ------------------------------------------------------------------------ */

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

.arc-card,
.map-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--night-2);
  overflow: hidden;
}

.arc-card.is-target {
  border-color: var(--cyan);
}

.arc-card__img {
  aspect-ratio: 2;
  overflow: hidden;
  background: var(--night-3);
}

.arc-card__img img,
.map-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.arc-card__body,
.map-card__body {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.arc-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.arc-card__head h2 {
  font-size: var(--step-2);
}

.arc-card__desc {
  color: var(--bone-2);
}

.en-note {
  margin-bottom: -8px;
}

.arc-card__block h3 {
  margin-bottom: 8px;
  color: var(--dust);
  font-size: 0.875rem;
  font-weight: 500;
}

.arc-card__facts {
  display: flex;
  gap: 32px;
  margin: 0;
}

.arc-card__facts dt {
  color: var(--dust);
  font-size: var(--step--1);
}

.arc-card__facts dd {
  margin: 0;
  font-size: var(--step-1);
  font-weight: 500;
}

/* Threat as five slanted bars, filled in the red of the logo's last stripe. */
.threat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  color: var(--bone-2);
  font-size: var(--step--1);
  white-space: nowrap;
}

.threat__bars {
  display: flex;
  gap: 3px;
}

.threat__bars i {
  width: 12px;
  height: 8px;
  background: var(--rule-2);
  transform: skewX(17deg);
}

.threat__bars i.on {
  background: var(--red);
}

@media (max-width: 859px) {
  .arc-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- maps --------------------------------------------------------------------- */

.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.map-card__img {
  aspect-ratio: 1;
  background: var(--night-3);
  overflow: hidden;
}

.map-card__img--tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.map-card__img--tiles img {
  aspect-ratio: 1;
}

.map-card__img--levels {
  display: grid;
  grid-template-rows: 1fr 1fr;
}

.map-card__img--levels figure {
  position: relative;
  min-height: 0;
  margin: 0;
}

.map-card__img--levels figure + figure {
  border-top: 1px solid var(--rule-2);
}

.map-card__img--levels figcaption {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--night) 80%, transparent);
  color: var(--bone);
  font-size: var(--step--1);
  line-height: 1.5;
}

.map-card__body h2 {
  font-size: var(--step-1);
}

.map-card__quests .note {
  margin-left: 8px;
}

.events-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.events h3 {
  margin-bottom: 8px;
  color: var(--dust);
  font-size: 0.875rem;
  font-weight: 500;
}

.event {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}

.event img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.event > span {
  display: flex;
  flex-direction: column;
}

@media (max-width: 640px) {
  .events-wrap {
    grid-template-columns: 1fr;
  }
}

.map-card__open {
  justify-self: start;
}

/* ---- interactive map ------------------------------------------------------------ */

.page-head--compact {
  padding-top: clamp(24px, 4vw, 40px);
  padding-bottom: 20px;
}

.mapper {
  padding-top: 20px;
  padding-bottom: 64px;
}

.mapper__maps {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.mapper__maps::-webkit-scrollbar {
  display: none;
}

/* Map and filters fill the screen below the header once the title scrolls away. */
.mapper__main {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  height: calc(100svh - var(--header-h) - 80px);
  min-height: 520px;
}

.mapper__stage {
  position: relative;
  min-width: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

.mapper__map {
  position: absolute;
  inset: 0;
  background: #0b0610;
  font: inherit;
}

.mapper__map.is-under .leaflet-tile-pane {
  filter: brightness(0.45) saturate(0.6);
}

.mapper__count {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 500;
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--night) 85%, transparent);
  color: var(--bone-2);
  font-size: var(--step--1);
  pointer-events: none;
}

.mapper__count:empty {
  display: none;
}

.mapper__panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  padding: 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--night-2);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mapper__opts {
  display: grid;
  gap: 12px;
}

.mapper__layers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mapper__cond {
  display: grid;
  gap: 4px;
}

.mapper__cond .select {
  width: 100%;
}

.mapper__quest {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: var(--step--1);
}

.mapper__groups {
  display: grid;
  gap: 16px;
}

.pin-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

.pin-group__head h3 {
  color: var(--dust);
  font-size: 0.875rem;
  font-weight: 500;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--bone-2);
  font-size: var(--step--1);
  text-decoration: underline;
  text-decoration-color: var(--rule-2);
  text-underline-offset: 0.2em;
}

.link-button:hover {
  color: var(--bone);
  text-decoration-color: currentColor;
}

.pin-row {
  display: grid;
  grid-template-columns: 16px 22px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 5px 6px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  text-align: left;
  font-size: 0.9375rem;
  line-height: 1.3;
}

.pin-row:hover {
  background: var(--night-3);
}

.pin-row[aria-pressed='false'] {
  color: var(--dust);
}

.pin-row[aria-pressed='false'] .pin-ico {
  opacity: 0.3;
  filter: grayscale(1);
}

/* A checkbox, so whether a type is on the map reads at a glance. */
.pin-row__check {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--rule-2);
  border-radius: 3px;
  transition: background 0.12s, border-color 0.12s;
}

.pin-row:hover .pin-row__check {
  border-color: var(--bone-2);
}

.pin-row[aria-pressed='true'] .pin-row__check {
  border-color: var(--cyan);
  background: var(--cyan)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.2l3 3 6-6.4' fill='none' stroke='%23130918' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 14px no-repeat;
}

.pin-row.is-empty {
  opacity: 0.45;
}

.pin-row__count {
  color: var(--dust);
  font-size: var(--step--1);
}

.pin-ico {
  display: block;
  width: 22px;
  height: 22px;
  flex: none;
}

.pin-ico--img {
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--pin);
  overflow: hidden;
}

.pin-ico--img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.25);
}

.mapper__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mapper__actions .button {
  height: 32px;
  padding: 0 10px;
  font-size: 0.875rem;
}

.mapper__credit a {
  color: var(--bone-2);
}

/* Leaflet controls, tooltips and popups in the site's colors. */
.mapper__map .leaflet-bar {
  border: 1px solid var(--rule-2);
  box-shadow: none;
}

.mapper__map .leaflet-bar a {
  width: 34px;
  height: 34px;
  border-bottom-color: var(--rule-2);
  background: var(--night-2);
  color: var(--bone);
  line-height: 34px;
}

.mapper__map .leaflet-bar a:hover {
  background: var(--night-3);
}

.mapper__map .leaflet-bar a.leaflet-disabled {
  background: var(--night-2);
  color: var(--night-4);
}

.pin-tip {
  padding: 2px 8px;
  border: 1px solid var(--rule-2);
  border-radius: 2px;
  background: var(--night);
  color: var(--bone);
  font: 500 0.8125rem / 1.5 var(--font);
  box-shadow: none;
}

.pin-tip::before {
  display: none;
}

.pin-pop .leaflet-popup-content-wrapper {
  border: 1px solid var(--rule-2);
  border-radius: var(--radius);
  background: var(--night-2);
  color: var(--bone);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

.pin-pop .leaflet-popup-tip {
  background: var(--night-2);
  box-shadow: none;
}

.pin-pop .leaflet-popup-content {
  display: grid;
  gap: 8px;
  margin: 12px 30px 12px 12px;
  font: 400 0.875rem / 1.5 var(--font);
}

.pin-pop .leaflet-popup-content p {
  margin: 0;
}

.pin-pop a.leaflet-popup-close-button {
  color: var(--dust);
}

.pin-pop a.leaflet-popup-close-button:hover {
  color: var(--bone);
}

.pin-pop__head {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: center;
}

.pin-pop__head .pin-ico {
  width: 26px;
  height: 26px;
}

.pin-pop__head strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
}

.pin-pop__sub {
  display: block;
  color: var(--dust);
  font-size: var(--step--1);
}

.pin-pop__note {
  color: var(--bone-2);
}

.pin-pop__cond {
  color: var(--cyan);
}

.pin-pop__fact {
  color: var(--bone-2);
  font-size: var(--step--1);
}

.pin-pop__link {
  color: var(--bone);
  font-weight: 500;
}

@media (max-width: 959px) {
  .mapper__main {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .mapper__stage {
    height: calc(100svh - var(--header-h) - 150px);
    min-height: 360px;
  }

  .mapper__panel {
    overflow: visible;
  }

  .mapper__groups {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

/* ---- projects ------------------------------------------------------------------ */

/* Contents sidebar beside the list; on phones it becomes a bar under the header. */
.projects {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.toc__toggle {
  display: none;
}

.toc__body {
  position: relative;
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.toc__tools {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  font-size: var(--step--1);
}

.toc__tools button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--bone-2);
}

.toc__tools button:hover {
  color: var(--bone);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.toc__group {
  margin: 20px 0 6px;
  color: var(--dust);
  font-size: var(--step--1);
  font-weight: 500;
}

.toc__tools + .toc__group {
  margin-top: 0;
}

.toc__list {
  border-left: 1px solid var(--rule);
}

.toc__link {
  display: flex;
  flex-direction: column;
  margin-left: -1px;
  padding: 6px 0 6px 14px;
  border-left: 2px solid transparent;
  color: var(--bone-2);
  line-height: 1.35;
  text-decoration: none;
}

.toc__link:hover {
  color: var(--bone);
}

.toc__link[aria-current='true'] {
  border-left-color: var(--yellow);
  color: var(--bone);
}

.toc__name {
  font-size: 0.9375rem;
}

.toc__meta {
  color: var(--dust);
  font-size: 0.75rem;
}

.projects__group + .projects__group {
  margin-top: 48px;
}

.projects__group-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  color: var(--dust);
  font-size: 0.875rem;
  font-weight: 500;
}

.project {
  border-bottom: 1px solid var(--rule);
}

/* html's scroll-padding already clears the header; the shared scroll-margin below would double it. */
.projects .project {
  scroll-margin-top: 0;
}

.project > summary {
  position: relative;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 16px;
  padding: 22px 36px 22px 0;
  cursor: pointer;
}

.project > summary::-webkit-details-marker {
  display: none;
}

.project > summary::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 1.5px solid var(--dust);
  border-bottom: 1.5px solid var(--dust);
  transform: rotate(45deg);
  transition: transform 0.2s var(--ease);
}

.project[open] > summary::after {
  margin-top: -2px;
  transform: rotate(225deg);
}

.project > summary:hover h3 {
  color: var(--tone, var(--bone));
}

.project__head h3 {
  font-size: var(--step-2);
  transition: color 0.12s;
}

.project__head .tags {
  align-items: center;
}

.project__body {
  padding-bottom: 32px;
}

.phases {
  margin-top: 20px;
}

.phase {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
}

.phase__n {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--tone, var(--rule-2));
  border-radius: 50%;
  color: var(--bone-2);
  font-size: var(--step--1);
}

.phase__body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.phase__body h4 {
  font-size: var(--step-0);
  font-weight: 500;
}

.reqs {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.req,
.req__reward {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.req__reward {
  gap: 6px;
}

@media (max-width: 959px) {
  .projects {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .toc {
    top: var(--header-h);
    z-index: 5;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    background: var(--night);
    border-bottom: 1px solid var(--rule);
  }

  .toc__toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 24px 12px 0;
    position: relative;
    border: 0;
    background: none;
    text-align: left;
  }

  .toc__toggle::after {
    content: '';
    position: absolute;
    right: 6px;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -5px;
    border-right: 1.5px solid var(--dust);
    border-bottom: 1.5px solid var(--dust);
    transform: rotate(45deg);
  }

  .toc.is-open .toc__toggle::after {
    margin-top: -1px;
    transform: rotate(225deg);
  }

  .toc__label {
    font-weight: 500;
  }

  .toc__current {
    min-width: 0;
    overflow: hidden;
    color: var(--dust);
    font-size: 0.875rem;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .toc__body {
    display: none;
    max-height: 60vh;
    padding-bottom: 16px;
  }

  .toc.is-open .toc__body {
    display: block;
  }

  /* Clear the contents bar too. */
  .projects .project {
    scroll-margin-top: 48px;
  }
}

/* Anchored sections clear the sticky header. */
.station,
.trader,
.project,
.arc-card,
.map-card,
.row {
  scroll-margin-top: calc(var(--header-h) + 16px);
}
