/* /names — the register: the two proofs, the ruler, the story as clauses, every seat in public.
   sits on proof.css for the atoms and on styles.css for the tokens. the state marks copy the home page's .mk-state. */

.names-main {
  max-width: 72rem;
}

.names-hero {
  max-width: 56rem;
}

/* the three states, the same marks the home register uses */
.mk-state {
  display: inline-block;
  padding: 0.35rem 0.55rem;
  border: 1.5px solid var(--ink);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
}

.mk-state.is-official {
  border: 2px double var(--accent);
  color: var(--accent);
  transform: rotate(-3deg);
}

.mk-state.is-disowned {
  border-style: dashed;
  color: var(--muted);
}

.names-states {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.proof-kicker.is-yes {
  color: var(--accent);
}

/* your names: a real object, so a box */
.names-me {
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  padding: 1rem 1.2rem 1.1rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--panel);
}

.names-me[hidden] {
  display: none;
}

.names-me-line {
  margin: 0.5rem 0 0;
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.4;
  color: var(--ink);
}

.names-me-list {
  margin: 0.6rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

.names-me-list a,
.names-list a,
.names-story a,
.names-proof-col p a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.names-story-wrap,
.names-rules,
.names-live,
.names-numbers {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: clamp(1.5rem, 3vw, 2.25rem);
  border-top: 1.5px solid var(--ink);
}

.names-numbers {
  padding-top: 0;
  border-top: 0;
}

/* ---- the three proofs: one ruled table ---- */
.names-proofs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1.8rem;
  border: 1.5px solid var(--ink);
}

.names-proof-col {
  padding: 1.8rem 2rem;
  min-width: 0;
}

.names-proof-col + .names-proof-col {
  border-left: 1.5px solid var(--ink);
}

.names-proof-col h3 {
  margin: 0.6rem 0 0.5rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.2vw, 1.9rem);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.names-proof-col p {
  margin: 0 0 1.2rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}

.names-proof-col code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--ink);
}

.names-ex {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--ink);
}

.names-ex > div {
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.names-ex .proof-kicker {
  display: block;
  margin-bottom: 0.6rem;
}

.names-ex span:not(.proof-kicker) {
  display: block;
  margin: 0.3rem 0;
}

.names-ex s {
  color: var(--muted);
}

.names-proof-notes {
  margin-top: 1.6rem;
}

/* the rule lists: a ruled document, the term on the left. these rules lived in proof.css
   until the proof redesign dropped its own list, which left the names page unstyled */
.proof-rule-list {
  margin: 1.6rem 0 0;
  border-top: 1px solid var(--line);
}

.proof-rule-list > div {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 0.4rem 2rem;
  padding: 1.1rem 0 1.2rem;
  border-bottom: 1px solid var(--line);
}

.proof-rule-list dt {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.proof-rule-list dd {
  margin: 0;
  max-width: 68ch;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
}

.proof-rule-list em {
  font-style: normal;
  color: var(--ink);
}

@media (max-width: 640px) {
  .proof-rule-list > div {
    grid-template-columns: minmax(0, 1fr);
    padding: 1rem 0 1.1rem;
  }

  .proof-rule-list dt {
    font-size: 1.15rem;
  }
}

/* ---- the numbers as a ruler ---- */
.names-ruler {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
}

.names-ruler li {
  padding: 1.5rem 1.2rem 1.6rem 0;
  border-right: 1px solid var(--line);
  min-width: 0;
}

.names-ruler li + li {
  padding-left: 1.2rem;
}

.names-ruler li:last-child {
  border-right: 0;
}

.names-ruler b {
  display: block;
  margin-bottom: 0.6rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.1vw, 2.1rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink);
}

.names-ruler span {
  display: block;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--muted);
}

.names-ruler span em {
  font-style: italic;
  color: var(--ink);
}

/* ---- the story as clauses ---- */
.names-story {
  counter-reset: beat;
  list-style: none;
  margin: 1.8rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.names-story > li {
  counter-increment: beat;
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 0.3rem 2rem;
  padding: 1.5rem 0 1.6rem;
  border-bottom: 1px solid var(--line);
}

.names-story > li::before {
  content: "§ " counter(beat);
  grid-row: 1 / span 2;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-top: 0.5rem;
}

.names-story h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}

.names-story p {
  margin: 0.5rem 0 0;
  max-width: 64ch;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
}

.names-story p strong,
.names-never strong {
  color: var(--ink);
  font-weight: 500;
}

.names-story p em {
  font-style: italic;
  color: var(--ink);
}

.names-story .mk-state {
  margin: 0 0.15rem;
  vertical-align: middle;
}

/* ---- the register: every seat ---- */
.names-live-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1.5px solid var(--ink);
}

.names-live-head .proof-h2 {
  margin-top: 0;
}

.names-live-meta {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.names-list-wrap {
  overflow-x: auto;
}

.names-list {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.names-list th,
.names-list td {
  padding: 1.1rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.names-list th:first-child,
.names-list td:first-child {
  padding-left: 0;
}

.names-list th:last-child,
.names-list td:last-child {
  padding-right: 0;
}

.names-list th {
  padding-top: 0.85rem;
  padding-bottom: 0.6rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.names-list td:first-child {
  width: 20%;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.names-list td:first-child a {
  color: var(--ink);
  text-decoration: none;
}

.names-list td:first-child a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.names-list td:nth-child(2) {
  color: var(--muted);
  font-size: 0.9rem;
}

.names-list .is-num {
  text-align: right;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.names-list .is-empty td {
  padding: 1.6rem 0;
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--muted);
}

.names-never {
  margin: 1.5rem 0 0;
  max-width: 68ch;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

@media (max-width: 960px) {
  .names-ruler {
    grid-template-columns: repeat(3, 1fr);
  }

  .names-ruler li:nth-child(3n) {
    border-right: 0;
  }

  .names-ruler li:nth-child(3n + 1) {
    padding-left: 0;
  }

  .names-ruler li:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }

  .names-proofs {
    grid-template-columns: 1fr;
  }

  .names-proof-col + .names-proof-col {
    border-left: 0;
    border-top: 1.5px solid var(--ink);
  }

  .names-story > li {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .names-story > li::before {
    grid-row: auto;
    padding-top: 0;
  }

  .names-live-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
}

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

  .names-ruler li {
    border-right: 0 !important;
    padding-left: 0 !important;
    border-top: 1px solid var(--line);
  }

  .names-ruler li:nth-child(-n + 2) {
    border-top: 0;
  }

  .names-ex {
    grid-template-columns: 1fr;
  }

  /* the seat ledger reads as one card per coin on a phone instead of a table to scroll */
  .names-list-wrap {
    overflow: visible;
  }

  .names-list {
    min-width: 0;
  }

  .names-list thead {
    display: none;
  }

  .names-list,
  .names-list tbody {
    display: block;
  }

  .names-list tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
  }

  .names-list tbody td {
    display: block;
    width: auto !important;
    padding: 0 !important;
    border: 0;
  }

  .names-list tbody tr > td:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 0.9rem;
    color: var(--muted);
  }

  .names-list tbody tr > td:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }

  .names-list tbody tr > td:nth-child(4),
  .names-list tbody tr > td:nth-child(5) {
    grid-row: 3;
    text-align: left;
    font-family: var(--mono);
    font-size: 0.9rem;
  }

  .names-list tbody tr > td:nth-child(4)::before,
  .names-list tbody tr > td:nth-child(5)::before {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    color: var(--muted);
  }

  .names-list tbody tr > td:nth-child(4)::before {
    content: "saved";
  }

  .names-list tbody tr > td:nth-child(5)::before {
    content: "paid out";
  }

  .names-list tbody tr.is-empty {
    display: block;
  }

  .names-list tbody tr.is-empty td {
    font-size: 1rem;
    line-height: 1.5;
  }
}

/* the hero reads as one column: the proof page's two-column hero grid does not apply here */
.names-hero {
  display: block;
  max-width: none;
}
.names-hero > * {
  max-width: 52rem;
}

/* the full rules sit one click away */
.names-full {
  margin-top: clamp(1.6rem, 3vw, 2.4rem);
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.names-full > summary {
  font-size: 0.72rem;
}

.names-full > section {
  margin-top: clamp(1.6rem, 3vw, 2.4rem);
}

.names-more {
  margin-top: 1rem;
}
