﻿/* Home and Rules: the two views a new reader meets first. */

.home,
.rules { max-width: 78rem; margin: 0 auto; }

.home > *,
.rules > * { margin-top: 0; margin-bottom: 0; }

.home h2,
.rules h2 {
  margin: 3rem 0 1rem;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.home .page-title,
.rules .page-title { margin-bottom: 1.5rem; }

/* Home: the two doors in. */

.home-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
}
.home-actions .primary,
.home-actions .link-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.home-actions .primary { margin-top: 0; text-decoration: none; }

/* The title and buttons beside the top of a real GAME.md. */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}
@media (min-width: 62rem) {
  .home-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 32rem); gap: 4rem; }
}

@media (max-width: 61.99rem) {
  /* Links that stand on their own get a full tap target; links inside a sentence do not need one. */
  .home-begin a,
  .home-actions a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

/* Five steps: one row of columns on a wide screen, stacked on a phone. */
.home-steps { list-style: none; margin: 0; padding: 0; }
.home-step {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--hair);
}
.home-step:first-child { border-top: 0; padding-top: 0; }
.home-step-number { font: 0.85rem var(--mono); color: var(--quiet); }
.home-step-title { margin: 0; font-size: 1.05rem; font-weight: 650; }
.home-step-text { margin: 0; max-width: 38rem; font-size: 0.95rem; }

/* One line of the person's prompt, on ruled paper. */
.home-said {
  margin: 0;
  padding: 0.3rem 0.6rem 0.25rem;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  font: 0.8rem/1.45 var(--mono);
  overflow-wrap: anywhere;
}

/* The folder as one ruled-paper listing. */
.home-files {
  list-style: none;
  margin: 0;
  padding: 0 1rem;
  max-width: 58rem;
  border: 1px solid var(--hair);
  background: var(--paper);
}
.home-file { padding: 0.8rem 0; border-bottom: 1px solid var(--rule); }
.home-file:last-child { border-bottom: 0; }
.home-file-head { display: flex; align-items: baseline; gap: 0.9rem; }
.home-file-name { font: 0.9rem var(--mono); }
.home-file-limit { font: 0.8rem var(--mono); color: var(--quiet); }
.home-file-what { display: block; margin-top: 0.2rem; font-size: 0.95rem; }

@media (min-width: 62rem) {
  .home-file {
    display: grid;
    grid-template-columns: minmax(7rem, 9rem) minmax(5rem, 7rem) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: baseline;
  }
  .home-file-head { display: contents; }
  .home-file-what { margin-top: 0; grid-column: 3; }
}

/* Three ways in, separated by hair rules, no boxes. */
.home-begin-col { padding-top: 1.5rem; border-top: 1px solid var(--hair); }
.home-begin-col:first-child { padding-top: 0; border-top: 0; }
.home-begin h3 { margin: 0 0 0.5rem; font-size: 1.05rem; font-weight: 650; }
.home-begin-text { margin: 0 0 0.75rem; max-width: 38rem; }
.home-begin-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  margin: 0;
}
.home-begin-links .link-button { display: inline-flex; align-items: center; min-height: 44px; }

@media (min-width: 62rem) {
  .home-begin { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-begin-col { padding: 0 0 0 1.5rem; border-top: 0; border-left: 1px solid var(--hair); }
  .home-begin-col:first-child { padding-left: 0; border-left: 0; }
}

.home-works { max-width: 38rem; }
.home-source { max-width: 38rem; margin-top: 1.5rem; }
.home-source a { color: inherit; }

/* Rules: the whole rubric, then the words and the files. */

.rules-intro { max-width: 38rem; }

.rules-table {
  width: 100%;
  margin: 1.5rem 0 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.92rem;
}
.rules-table th,
.rules-table td {
  padding: 0.7rem 0.75rem 0.7rem 0;
  border-bottom: 1px solid var(--hair);
  text-align: left;
  vertical-align: top;
}
.rules-table th {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--ink);
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--quiet);
}
.rules-table th:nth-child(1) { width: 2.5rem; }
.rules-table th:nth-child(2) { width: 18%; }
.rules-table th:nth-child(3),
.rules-table th:nth-child(4),
.rules-table th:nth-child(5) { width: 14%; }
.rules-table th:nth-child(6) { width: 6rem; }
.rules-table th:nth-child(7) { width: 16%; }
.rules-id { font-family: var(--mono); color: var(--quiet); }
.rules-check { font-weight: 600; }
.rules-score { font: 700 0.9rem var(--mono); }
.rules-score-bad { color: var(--bad); }
.rules-score-mid { color: var(--mid); }
.rules-score-ok { color: var(--ok); }
.rules-anchor-n { display: none; font: 0.85rem var(--mono); }
.rules-by { width: 6rem; }
.rules-evidence { width: 16%; }

/* On a phone each check is its own block, with the score in front of its anchor. */
@media (max-width: 61.99rem) {
  .rules-table { display: block; table-layout: auto; font-size: 0.95rem; }
  .rules-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .rules-table tbody { display: block; }
  .rules-table tr {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--hair);
  }
  .rules-table td { display: block; width: auto; padding: 0; border: 0; }
  .rules-table td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    font-family: var(--mono);
    color: var(--quiet);
  }
  .rules-table td:nth-child(2) { grid-column: 2; grid-row: 1; font-weight: 600; }
  .rules-table td:nth-child(3),
  .rules-table td:nth-child(4),
  .rules-table td:nth-child(5) {
    grid-column: 2;
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr);
    gap: 0.5rem;
    margin-top: 0.4rem;
  }
  .rules-table .rules-anchor-n { display: block; }
  .rules-table td:nth-child(6),
  .rules-table td:nth-child(7) {
    grid-column: 2;
    margin-top: 0.4rem;
    color: var(--quiet);
    font-size: 0.9rem;
  }
  .rules-table td:nth-child(6) { margin-top: 0.7rem; }
}

.rules h3 { margin: 1.5rem 0 0.35rem; font-size: 1.05rem; font-weight: 650; }
.rules-leave-text { margin: 0; max-width: 38rem; }

/* What you type: key on the left, meaning on the right. */
.rules-say {
  display: grid;
  grid-template-columns: minmax(7rem, 12rem) minmax(0, 1fr);
  max-width: 52rem;
  margin: 0;
}
.rules-say dt,
.rules-say dd { margin: 0; padding: 0.55rem 0; border-bottom: 1px solid var(--hair); }
.rules-say dt { padding-right: 1.25rem; }

@media (max-width: 61.99rem) {
  .rules-say { grid-template-columns: minmax(0, 1fr); }
  .rules-say dt { padding: 0.55rem 0 0.1rem; border-bottom: 0; }
  .rules-say dd { padding: 0.1rem 0 0.65rem; }
}

.rules-files-text { max-width: 38rem; }
.rules .primary { margin-top: 1.5rem; }
.rules-command { margin: 1rem 0 0; }
.rules-command code { font-size: 0.9rem; }
