/* `/how` on the static site — the rules in full (HOW1, #24; PAGES2, #16, R12; R17, R18). It was the
 * show's `pages/how.css`; the frame, the bar, the footer and the buttons are `door.css`'s. The prose at
 * the measure, in the explainer's own face and size. One column on a phone; from 1024 the parts are a
 * grid of whole cells, two across and from 1280 four, each part's prose still at its measure, never a
 * longer line (WIDTH, #39). The floor's key is the map's, its marks drawn beside their names. Every box
 * has its place before any script runs: the page is static and shifts by nothing (R64). */

.how-head {
  margin: 0 0 var(--space-4);
  color: var(--parchment);
}

.how-parts {
  display: grid;
  gap: var(--space-5);
}

/* From 1024 the parts stand in a grid of whole cells (H53, R101: a column flow broke a paragraph
 * across two columns, "Crawlers on the same" at the foot of one and "fame share a place" at the head of
 * the next, and set the floor in half its row), two across and from 1280 four, each at the top of its
 * cell. Nothing flows, so nothing breaks: a part is a cell. The floor, the tallest, spans the frame
 * under them with its key in three cells of its own. */
@media (min-width: 64em) {
  .how-parts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5) var(--page-gap);
    align-items: start;
  }

  .how-part--floor {
    grid-column: 1 / -1;
  }

  .how-part--floor .how-key {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4) var(--page-gap);
  }
}

@media (min-width: 80em) {
  .how-parts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* What a viewer can do: three plain lines before the rules, one column on a phone and a column each
 * from 1024, so the first screen of `/how` answers "what can I do here" (R48). */
.how-can {
  display: grid;
  gap: var(--space-3);
  margin: 0 0 var(--space-5);
  padding: 0;
  list-style: none;
  font-family: var(--font-prose);
  font-size: var(--text-16);
  color: var(--parchment-dim);
}

.how-can-verb {
  color: var(--parchment);
}

@media (min-width: 64em) {
  .how-can {
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: var(--page-gap);
  }
}

.how-part-head {
  margin: 0 0 var(--space-2);
  color: var(--parchment);
}

.how-part-words {
  max-width: var(--measure);
  margin: 0;
  font-family: var(--font-prose);
  font-size: var(--text-prose);
  line-height: var(--leading-prose);
  color: var(--parchment);
}

.how-link {
  color: var(--parchment);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
}

.how-link:hover,
.how-link:focus-visible {
  border-bottom-color: var(--parchment);
}

/* With no show in config.js (pre-launch) "the board" and "the map" have nowhere to go: they read as
 * the sentence's own words, not as links that lead nowhere. */
html:not(.has-show) .how-link {
  color: inherit;
  border-bottom: 0;
}

/* The floor's key: what the 2D map draws, then what it means. A row is a cell, the term over its words:
 * one column on a phone, two from 640 and, under the floor's heading, three from 1024. */
.how-key {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  margin: var(--space-3) 0 0;
  font-family: var(--font-prose);
  font-size: var(--text-prose);
  line-height: var(--leading-prose);
  color: var(--parchment);
}

@media (min-width: 40em) {
  .how-key {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4) var(--page-gap);
  }
}

.how-key-row {
  display: grid;
  align-content: start;
  gap: var(--space-1);
}

.how-key dt,
.how-key dd {
  margin: 0;
}

.how-key dt {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
}

/* The map's own marks (M36), drawn with the map's own coordinates and colours (`map_mark_art.js`): a disc
 * of ink with a rim in the mark's colour. Blood is a fight between crawlers, ochre one with monsters
 * (R98), acid the System's pulse, parchment a crowd. */
.how-glyph {
  flex: none;
  inline-size: 1.5rem;
  block-size: 1.5rem;
}

.how-glyph--fight {
  color: var(--blood);
}

.how-glyph--bubble {
  color: var(--parchment-dim);
}

.how-glyph--pulse {
  color: var(--acid);
}

.how-glyph-disc {
  fill: var(--ink);
  stroke: currentColor;
  stroke-width: 2;
}

.how-glyph-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.how-glyph-count {
  fill: var(--parchment);
  font-family: var(--font-prose);
  font-size: var(--text-12);
  font-weight: 700;
}

.how-glyph-ring {
  fill: none;
  stroke: currentColor;
  stroke-opacity: 0.45;
  stroke-width: 2;
}

.how-glyph-room {
  fill: currentColor;
  fill-opacity: 0.12;
  stroke: currentColor;
  stroke-width: 2;
}

/* A fight's two colours, in the words that name them: the badge's rim. */
.how-swatch {
  display: inline-block;
  inline-size: 0.7em;
  block-size: 0.7em;
  margin-inline-end: 0.3em;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.how-swatch--blood {
  color: var(--blood);
}

.how-swatch--fray {
  color: var(--fray);
}

/* The two ways on: the page's closing strip, across the frame under the grid, a rule over it and
 * a part's gap clear of the last paragraph (I16-WEB: the columns end at three heights, and a strip
 * across all three is where the page ends rather than ground). On a phone each is a `.door-btn` row. */
.how-on {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-5) 0 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--rule);
}

/* A button in a row on a phone has no room for a promise: it is the card's (below). */
.how-go-line {
  display: none;
}

/* From 768 the two ways on are two cards across the frame, each a big serif line with its arrow at the
 * far edge: two small links at the left of a full-width rule left 280 px of bare ground under the
 * columns at 1920 (I16-WEB, the designer of I16-s7, R17). The cards are the strip's edge, so the rule
 * over it goes. Each is the size of its words, the title and its arrow at the top (I23-WEB, R17: grown to the
 * screen's height at 1920 they were 250 px of ground holding one title). A card is the button's
 * element wearing the card's colours, so the buttons stay one component (M7). */
@media (min-width: 48em) {
  .how-on {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    display: grid;
    gap: var(--space-5);
    padding-top: 0;
    border-top: 0;
  }

  .how-go {
    --btn-fill: var(--surface-raised);
    --btn-fill-hover: var(--surface-raised);
    --btn-ink: var(--parchment);
    --btn-edge: var(--rule-strong);
    --btn-edge-hover: var(--parchment);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    justify-content: stretch;
    align-items: start;
    gap: var(--space-2) var(--space-4);
    min-block-size: 6rem;
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--btn-edge);
    font-family: var(--font-prose);
    font-size: var(--text-h2);
    font-weight: 400;
    letter-spacing: normal;
    text-align: start;
    text-transform: none;
  }

  .how-go:hover,
  .how-go:focus-visible {
    transform: none;
  }

  /* The promise under the title, across the card: the page it leads to in one line, the page's own size. */
  .how-go-line {
    display: block;
    grid-column: 1 / -1;
    font-size: var(--text-prose);
    letter-spacing: normal;
    line-height: var(--leading-chrome);
    color: var(--parchment-dim);
  }
}
