/* The front door's pilot (R101, R8): three of the hundred, four moments as the show told them and
 * three screenshots of what watching looks like — one season QA ran that will never air, written into
 * the page by `mise run site-pilot`. Every line in them is one the show aired, set in the voice it
 * aired in: the System's in its box and mono, the feed's in the serif (R18); the System's own band, its
 * obituary and the rule of the win, comes after the three of the cast. A phone reads each as a
 * column; from 1024 they stand in columns across the frame, never longer lines. Every image has its
 * size in the markup, so nothing moves when it lands (R64). */

/* --- the System's band: its obituary in its box, and the rule of the win ---------------------------- */

.door-system {
  --kind: var(--acid);
  position: relative;
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-4);
  border: 1px solid var(--kind);
  background: color-mix(in srgb, var(--kind) 6%, var(--ink-2));
  box-shadow: 0 0 4px color-mix(in srgb, var(--kind) 16%, transparent);
}

.door-system::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid color-mix(in srgb, var(--kind) 22%, transparent);
  pointer-events: none;
}

.system-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--space-3);
  font-size: var(--text-12);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

.system-label {
  font-family: var(--font-system);
  font-weight: 500;
  color: var(--kind);
}

.said-turn {
  color: var(--parchment-faint);
  font-family: var(--font-prose);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  font-size: var(--text-12);
}

.system-line {
  margin: 0;
  font-family: var(--font-system);
  font-variant-ligatures: none;
  font-size: var(--text-14);
  line-height: var(--leading-chrome);
  color: color-mix(in srgb, var(--parchment) 86%, var(--kind));
}

/* The band after the cast: the head, the obituary's box and the rule in the System's voice, one
 * column on a phone, box and rule side by side from 1024. */
.door-system-band {
  display: grid;
  gap: var(--space-4);
  align-content: start;
}

.door-system-band .door-head {
  margin: 0;
}

/* The win in the System's voice, in its mono (R7). */
.door-rule {
  margin: 0;
  font-family: var(--font-system);
  font-variant-ligatures: none;
  font-size: var(--text-14);
  line-height: var(--leading-chrome);
  color: var(--parchment-dim);
}

.door-rule .system-label {
  display: block;
  margin-block-end: var(--space-1);
}

@media (min-width: 40em) {
  .door-system {
    padding: var(--space-5);
  }

  .system-line {
    font-size: var(--text-16);
    line-height: 1.5;
  }
}

@media (min-width: 64em) {
  .door-system-band {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    column-gap: var(--page-gap);
    row-gap: var(--space-5);
    align-items: start;
  }

  .door-system-band .door-head {
    grid-column: 1 / -1;
  }

  .door-system {
    padding: var(--space-6);
    gap: var(--space-3);
  }

  .system-line {
    font-size: clamp(1.125rem, 1.45vw, 1.375rem);
    line-height: 1.5;
  }

  .system-head,
  .said-turn {
    font-size: var(--text-14);
  }

  .door-rule {
    align-self: center;
    font-size: var(--text-16);
  }
}

@media (max-width: 39.99em) {
  .door-system {
    gap: var(--space-1);
    padding: var(--space-3);
  }
}

/* --- three of the hundred ---------------------------------------------------------------------- */

.people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

/* A person from turn 0 to the end: a face, a name, what they are like and what they want; one line
 * the show aired about them; and what became of them. */
.person {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3) var(--space-4);
  align-content: start;
  padding: var(--space-4);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--rule-strong);
  background: var(--ink-2);
}

.person-face {
  grid-row: 1;
  display: block;
  inline-size: 4.5rem;
  block-size: 4.5rem;
  border: 1px solid var(--rule-strong);
  border-radius: 20%;
  background: var(--ink);
}

.person-who {
  align-self: center;
  min-width: 0;
}

.person-name {
  font-size: var(--text-lead);
  line-height: 1.12;
  color: var(--parchment);
}

.person-line {
  display: grid;
  gap: 2px;
  margin-top: var(--space-1);
  font-size: var(--text-16);
  line-height: 1.35;
  color: var(--parchment-dim);
}

.person-nature {
  font-size: var(--text-12);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--parchment-faint);
}

.person-want {
  font-style: italic;
  color: var(--parchment);
}

.person-said,
.moment-line {
  grid-column: 1 / -1;
  display: grid;
  gap: var(--space-1);
  margin: 0;
}

.person-said {
  align-content: start;
}

.said-text {
  min-width: 0;
}

/* The feed's prose: the serif at the lede's size, a rule in the page's ink at its left. */
.person-said[data-voice="feed"],
.moment-line[data-voice="feed"] {
  padding-left: var(--space-3);
  border-left: 2px solid var(--rule-strong);
}

.person-said[data-voice="feed"] .said-text,
.moment-line[data-voice="feed"] .said-text {
  font-size: var(--text-prose);
  line-height: 1.4;
  color: var(--parchment);
}

/* The System's own card: its box, mono and acid, as the show draws it. */
.person-said[data-voice="system"],
.moment-line[data-voice="system"] {
  --kind: var(--acid);
  padding: var(--space-3);
  border: 1px solid var(--kind);
  background: color-mix(in srgb, var(--kind) 6%, var(--ink));
  box-shadow: 0 0 4px color-mix(in srgb, var(--kind) 16%, transparent);
}

.person-said[data-voice="system"] .said-text,
.moment-line[data-voice="system"] .said-text {
  font-family: var(--font-system);
  font-variant-ligatures: none;
  font-size: var(--text-14);
  line-height: var(--leading-chrome);
  color: color-mix(in srgb, var(--parchment) 86%, var(--kind));
}

/* What became of them: the last word, in the accent for the one who won. */
.person-end {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--space-3);
  margin: 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--rule);
}

.person-end-label {
  font-size: var(--text-12);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--parchment-faint);
}

.person-fate {
  font-size: var(--text-lead);
  font-weight: 600;
  line-height: 1.2;
  color: var(--parchment);
}

.person-fate[data-fate="won"] {
  color: var(--acid);
}

/* --- moments ----------------------------------------------------------------------------------- */

.moments {
  display: grid;
  gap: var(--space-4);
}

/* A moment is a card with its kind's colour at its left: red for a knife and a death (R98), ochre for
 * a boss, acid for the System's own crown. */
.moment {
  --kind: var(--blood);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--kind);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--kind) 7%, transparent), transparent 60%),
    var(--ink-2);
}

.moment[data-kind="boss_kill"] {
  --kind: var(--fray);
}

.moment[data-kind="crowning"] {
  --kind: var(--acid);
}

.moment-label {
  margin: 0;
  font-size: var(--text-12);
  font-weight: 600;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--kind);
}

.moment-faces {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
}

/* A face and the full name under it. */
.moment-who {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: var(--space-2);
  margin: 0;
  inline-size: 6rem;
}

.moment-face {
  display: block;
  inline-size: 5rem;
  block-size: 5rem;
  border: 1px solid var(--rule-strong);
  border-radius: 20%;
  background: var(--ink);
}

.moment-name {
  text-align: center;
  font-size: var(--text-14);
  line-height: 1.2;
  color: var(--parchment-dim);
  text-wrap: balance;
}

.moment-body {
  display: grid;
  gap: var(--space-3);
  align-content: start;
  min-width: 0;
}

/* What a boss paid, in plain numbers: one row a share that was paid. */
.purse {
  display: grid;
  gap: var(--space-1);
  padding-top: var(--space-3);
  border-top: 1px solid var(--rule);
  font-variant-numeric: tabular-nums lining-nums;
}

.purse-head {
  margin: 0;
  font-size: var(--text-12);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--parchment-faint);
}

.purse-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.purse-row {
  font-size: var(--text-16);
  line-height: 1.4;
  color: var(--parchment);
}

/* --- what watching looks like ---------------------------------------------------------------------- */

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

.shot {
  display: grid;
  gap: var(--space-2);
  align-content: start;
  margin: 0;
  min-width: 0;
}

.shot-link {
  display: block;
  border: 1px solid var(--rule-strong);
  background: var(--ink-2);
  line-height: 0;
}

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

/* Under 640 px `<picture>` serves the phone's own 375 capture (H34), so its text is read at its own size. */
.shot-link picture {
  display: block;
}

/* The size is in the markup; the image fills its column and keeps its shape. */
.shot-img {
  display: block;
  inline-size: 100%;
  block-size: auto;
}

.shot-caption {
  max-inline-size: 36rem;
  font-size: var(--text-16);
  line-height: var(--leading-chrome);
  color: var(--parchment-dim);
}

/* --- from 640: two columns of moments ---------------------------------------------------------- */

@media (min-width: 40em) {
  .person,
  .moment {
    padding: var(--space-5);
  }

  .person-face {
    inline-size: 6rem;
    block-size: 6rem;
  }

  .moment-face {
    inline-size: 6rem;
    block-size: 6rem;
  }

  .moment-who {
    inline-size: 7rem;
  }
}

/* --- from 1024: the people, the moments and the screenshots in columns ------------------------------- */

@media (min-width: 64em) {
  .people {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--page-gap);
  }

  .moments {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--page-gap);
  }

  .moment {
    padding: var(--space-6);
  }

  .moment-line[data-voice="feed"] .said-text {
    font-size: var(--text-lead);
  }

  .moment-line[data-voice="system"] .said-text,
  .person-said[data-voice="system"] .said-text {
    font-size: var(--text-16);
    line-height: 1.5;
  }

  /* The three shots stand in one row at one height: each column's share of the row is its picture's
   * shape (`test_site_pilot` holds these to the pictures' own), so the row is as tall as the widest
   * is wide and nothing is cropped. */
  .shots {
    display: flex;
    align-items: flex-start;
    gap: var(--page-gap);
  }

  .shot {
    flex: 1 1 0;
  }

  .shot-live {
    flex-grow: 1.524;
  }

  .shot-cam {
    flex-grow: 1.524;
  }

  .shot-fight {
    flex-grow: 1.686;
  }
}
