/*
 * Section components for the factions, legends and token pages.
 */

/* ── factions ──────────────────────────────────────────────────────── */

.fac {
  display: flex;
  flex-direction: column;
  background: var(--ink);
  border: 3px solid var(--f);
  box-shadow: 7px 7px 0 var(--f2);
}
.fac-art {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-bottom: 3px solid var(--f);
}
.fac-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fac-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px 22px 22px;
}
.fac-stance {
  align-self: flex-start;
  margin: 0 0 10px;
  padding: 1px 12px;
  background: var(--f);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}
.fac h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 900;
  font-size: var(--t-card-lg);
  line-height: 0.92;
  text-transform: uppercase;
  color: var(--paper);
}
.fac-creed {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 23px;
  line-height: 1.1;
  color: var(--f);
}
.fac-creed::before {
  content: "\201C";
}
.fac-creed::after {
  content: "\201D";
}
.fac-body p {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.5;
}
.fac-look b {
  color: var(--paper);
}
.fac-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: auto 0 0 !important;
  padding-top: 14px;
  border-top: 2px solid var(--night-2);
  font-size: 14px !important;
  font-weight: 700;
  color: var(--paper);
}
.fac-meta .more {
  margin-left: auto;
  font-size: 16px;
}
.fac-meta .more + .more {
  margin-left: 0;
}
.swatch {
  width: 40px;
  height: 18px;
  background: linear-gradient(90deg, var(--f) 50%, var(--f2) 50%);
  border: 2px solid var(--paper);
}

/* A hostile with no art yet gets a plate where the art would be, so every card
   in a row has the same build and the row ends level: registry-red halftone
   with the record's stamp. The stamp is drawn, not read: the card's own text says who it is. */
.hos:not(.has-art)::before {
  content: "No visual on file";
  content: "No visual on file" / "";
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  border-bottom: 3px solid var(--paper);
  background:
    linear-gradient(var(--ink), var(--ink)) center / 62% 2.6em no-repeat,
    radial-gradient(rgba(227, 18, 59, 0.5) 1.4px, transparent 1.8px) 0 0 / 8px 8px,
    var(--night);
  font-family: var(--display);
  font-weight: 900;
  font-size: 17px;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--registry-text);
}
.hos {
  display: flex;
  flex-direction: column;
  background: var(--night);
  border-left: 8px solid var(--registry);
}
.hos-body {
  padding: 20px 22px 22px;
}
.hos-art img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 3px solid var(--paper);
}
.hos-kind {
  margin: 0 0 4px;
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--t-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--sodium);
}
.hos h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 900;
  font-size: var(--t-card);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--paper);
}
.hos p:not(.hos-kind) {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.5;
}
.hos p.hos-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
  margin: 0;
}

.margins {
  max-width: 46rem;
}
.margins > p {
  font-size: 18px;
}

/* ── legends ───────────────────────────────────────────────────────── */

.src {
  padding: 22px;
  background: var(--ink);
  border: 3px solid var(--paper);
}
.src-clean {
  border-color: var(--sodium);
}
.src-tag {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--t-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--sodium);
}
.src h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 900;
  font-size: var(--t-card-lg);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--paper);
}
.src-quote {
  margin: 0 0 12px;
  font-size: 19px;
  font-style: italic;
  color: var(--lattice);
}
.src p:last-child {
  margin: 0;
  font-size: 16px;
}

.arch {
  display: flex;
  flex-direction: column;
  padding: 16px 18px 18px;
  background: var(--night-2);
  border: 3px solid var(--paper);
}
.arch-role {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sodium);
}
.arch-rt {
  color: var(--registry);
  letter-spacing: 0.08em;
}
.arch h3 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 900;
  font-size: var(--t-card);
  overflow-wrap: anywhere;
  line-height: 0.92;
  text-transform: uppercase;
  color: var(--paper);
}
.arch-quote {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
  color: var(--paper);
}
.arch-rite {
  background: var(--ink);
  border-color: var(--registry);
  box-shadow: 6px 6px 0 var(--registry);
}
.arch-rite .arch-rt {
  color: #ff5470;
}


.tl {
  display: flex;
  flex-direction: column;
  padding: 18px 20px 22px;
  background: var(--night);
  border: 2px solid var(--line);
  border-top: 8px solid var(--c);
}
.tl-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--t-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.tl-tag.is-wip {
  color: var(--sodium);
}
.tl h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 900;
  font-size: var(--t-card);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--c);
}
.tl-fantasy {
  margin: 0 0 12px;
  font-style: italic;
  color: var(--paper);
}
.tl-cost {
  margin: auto 0 0;
  font-size: 15px;
  line-height: 1.45;
}
.tl-cost b {
  color: var(--paper);
}

.set-cards {
  display: grid;
  gap: 16px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}
.set-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 20px;
  background: var(--ink);
  border: 3px solid var(--paper);
  border-top: 8px solid var(--sodium);
}
.set-card b {
  font-family: var(--display);
  font-weight: 900;
  font-size: var(--t-card);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--paper);
}
.set-card span {
  font-size: 17px;
  line-height: 1.4;
  font-style: italic;
  color: var(--lattice);
}
/* Card titles lead to their field-guide pages. The link covers the whole card, so the card is the target. */
.arch,
.tl,
.set-card {
  position: relative;
}
.arch h3 a,
.tl h3 a,
.set-card b a {
  color: inherit;
  text-decoration: none;
}
.arch h3 a::before,
.tl h3 a::before,
.set-card b a::before {
  content: "";
  position: absolute;
  inset: 0;
}
.arch h3 a::after,
.tl h3 a::after,
.set-card b a::after {
  content: "\00a0\2192";
}
.arch h3 a:hover,
.tl h3 a:hover,
.set-card b a:hover {
  text-decoration: underline;
  text-decoration-thickness: 3px;
}
.arch-body {
  max-width: 46rem;
  margin: 32px 0 0;
  padding-top: 20px;
  border-top: 2px solid var(--night-2);
  font-size: 17px;
}
.arch-body b {
  color: var(--paper);
}

.clean {
  display: grid;
  gap: 40px;
  align-items: start;
}
.band-paper .clean p {
  max-width: 36rem;
}
.clean-hook {
  margin: 0 0 18px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(26px, 3.6vw, 34px);
  line-height: 1.05;
  color: var(--ink);
}
.band-paper .btn-alt {
  color: var(--ink);
  background: transparent;
  border-color: var(--ink);
}
.fork {
  display: grid;
  gap: 0;
  max-width: 28rem;
}
.fork-head {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.fork-a,
.fork-b {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
  border: 3px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}
.fork-a {
  margin-bottom: 14px;
  background: var(--paper);
  color: var(--ink);
}
.fork-b {
  box-shadow: 6px 6px 0 var(--registry);
}
.fork b {
  font-family: var(--display);
  font-weight: 900;
  font-size: 30px;
  line-height: 1;
  text-transform: uppercase;
}
.fork span {
  font-size: 16px;
}

/* ── token ─────────────────────────────────────────────────────────── */

.tk {
  display: grid;
  gap: 48px;
  align-items: center;
}
.note {
  max-width: 520px;
  margin: 0 auto;
  transform: rotate(-3deg);
}
/* on a narrow phone the tilted note and its offset shadow would touch the screen edge */
@media (max-width: 479px) {
  .note {
    max-width: calc(100% - 24px);
    transform: rotate(-2deg);
  }
}
.note-face {
  position: relative;
  aspect-ratio: 2.15 / 1;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: 1fr auto;
  padding: 14px 18px;
  color: var(--paper);
  border: 3px solid var(--paper);
  outline: 2px solid var(--sodium);
  outline-offset: -11px;
  box-shadow: 9px 9px 0 var(--registry);
  background:
    repeating-radial-gradient(circle at 78% 50%, transparent 0 6px, rgba(255, 143, 28, 0.35) 6px 7px),
    repeating-linear-gradient(90deg, transparent 0 3px, rgba(56, 232, 255, 0.07) 3px 4px),
    var(--night);
  overflow: hidden;
}
.note-denom {
  align-self: center;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(44px, 12vw, 78px);
  line-height: 0.8;
  color: var(--sodium);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--ink);
}
.note-issuer {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 700;
}
.note-corner {
  grid-row: 1;
  grid-column: 2;
  justify-self: end;
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
}
.note-serial {
  position: absolute;
  right: 18px;
  bottom: 30px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.note-void {
  top: 38%;
  right: 14px;
  bottom: auto;
  padding: 2px 10px;
  font-size: 22px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--registry);
  border: 3px solid var(--registry);
  background: var(--ink);
  transform: rotate(-8deg);
}
.tk-copy .sec-head {
  margin-bottom: 20px;
}
.tk-copy > p {
  max-width: 38em;
}
.ledger {
  display: grid;
  gap: 10px;
  max-width: 38em;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}
.ledger li {
  position: relative;
  padding-left: 22px;
}
.ledger li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 10px;
  height: 10px;
  background: var(--sodium);
}
.ledger code {
  color: var(--sodium);
  overflow-wrap: anywhere;
}
.ca {
  max-width: 38em;
  padding: 16px 18px;
  background: var(--ink);
  border: 3px solid var(--registry);
}
.ca-label {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--registry-text);
}
.ca-val {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 32px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--paper);
  overflow-wrap: anywhere;
}
code.ca-val {
  display: block;
  font-family: ui-monospace, monospace;
  font-size: 15px;
  text-transform: none;
}
.ca-note {
  margin: 0;
  font-size: 15px;
  color: var(--dim);
}

.why dl {
  display: grid;
  gap: 0;
  margin: 0;
  max-width: 52rem;
}
.why dl > div {
  padding: 16px 0;
  border-top: 2px solid var(--night-2);
}
.why dt {
  margin: 0 0 4px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  color: var(--paper);
}
.why dd {
  margin: 0;
}

.bstep {
  position: relative;
  background: var(--ink);
  border: 3px solid var(--paper);
  padding-bottom: 18px;
}
.bstep-media {
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-bottom: 3px solid var(--paper);
}
.bstep-media img,
.bstep-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bstep-n {
  position: absolute;
  top: 10px;
  left: 10px;
  margin: 0;
  padding: 0 12px;
  background: var(--sodium);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 900;
  font-size: 30px;
  line-height: 1.25;
}
.bstep h3 {
  margin: 14px 18px 6px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 32px;
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--paper);
}
.bstep p:last-child {
  margin: 0 18px;
  font-size: 16px;
  line-height: 1.5;
}

.rules {
  display: grid;
  gap: 40px;
  align-items: center;
}
.rulelist {
  max-width: 40rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rule;
}
.rulelist li {
  position: relative;
  margin: 0 0 14px;
  padding: 0 0 14px 52px;
  border-bottom: 2px solid var(--night-2);
  counter-increment: rule;
}
.rulelist li::before {
  content: counter(rule);
  position: absolute;
  left: 0;
  top: -2px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--sodium);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 900;
  font-size: 22px;
}

/* the lead sentence reads at the size of the list it introduces, not as fine print above it */
.disclaimer p {
  max-width: 38em;
  margin: 0 0 12px;
}
.disclaimer h2 {
  font-size: 28px;
}

/* below 960px the faction cards are one per row, so the art is a band rather than a 16:9 block taller than the card's text */
@media (max-width: 959px) {
  .fac-art {
    aspect-ratio: 21 / 9;
  }
}

@media (min-width: 640px) {
  .srcs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .set-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .archs,
  .tls,
  .bsteps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .facs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }
  .hoss {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .clean {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 72px;
  }
  .tk {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
    gap: 72px;
  }
  .rules {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 64px;
  }
  .set-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  /* "Why Solana" is four short answers: two by two, rather than one column with the right half empty */
  .why dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 48px;
    max-width: none;
  }
}

@media (min-width: 1100px) {
  .archs,
  .tls,
  .bsteps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
