/* "Notice the pattern?" (Dec 3, her note: "do a cool animation that 17/20 richest self made people did competitions,
   take that from the deck"). Slide 3 of her deck: the 20 richest self-made people under 35, each with the competition
   they did, or "No competitions found" for the 3 without one. Names, companies and competitions only (no photos).
   On a computer the count sits on the left and the 20 tiles sit in a 5 x 4 grid on the right. Phones stack them, two
   tiles across. Motion (features/pantheon-20.js): the tiles start faded, then light up one at a time in a scattered
   order while the number counts up to 17. The 3 without competitions never light. Reduced motion: the end state. */

#pantheon .p20 { display: grid; grid-template-columns: minmax(0, 3.2fr) minmax(0, 8.8fr); gap: clamp(22px, 3vw, 48px); align-items: center;
  margin: clamp(48px, 5vw, 80px) 0 clamp(48px, 5vw, 80px); }
#pantheon .p20-k { margin: 0 0 10px; font: 600 12.5px/1.2 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
#pantheon .p20-num { display: flex; align-items: baseline; gap: 10px; margin: 0; font-family: var(--sans); font-variant-numeric: tabular-nums; }
#pantheon .p20-n { font-weight: 600; font-size: clamp(76px, 8.4vw, 132px); line-height: 0.9; letter-spacing: -0.04em; color: var(--acc, #8C2F39); min-width: 1.15em; }
#pantheon .p20-of { font-weight: 500; font-size: clamp(22px, 2vw, 30px); color: var(--muted); }
#pantheon .p20-h { margin: 14px 0 0; max-width: 17em; font: 400 clamp(24px, 2.2vw, 32px)/1.12 var(--serif); color: var(--ink); text-wrap: balance; }

#pantheon .p20-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
#pantheon .p20-grid li { position: relative; display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 11px 12px 12px;
  border-radius: 8px; background: #FCFAF6; box-shadow: 0 1px 0 rgba(26, 24, 22, 0.04), 0 10px 22px -18px rgba(26, 24, 22, 0.35); }
#pantheon .p20-grid b { font: 650 14.5px/1.2 var(--sans); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pantheon .p20-grid span { font: 400 13px/1.25 var(--sans); color: var(--muted); }
#pantheon .p20-grid i { margin-top: 7px; font: italic 400 13.5px/1.25 var(--sans); font-style: normal; font-weight: 600; color: #34416A; }
/* the three without a competition */
#pantheon .p20-grid li.n { background: transparent; box-shadow: inset 0 0 0 1px rgba(26, 24, 22, 0.08); }
#pantheon .p20-grid li.n b, #pantheon .p20-grid li.n span, #pantheon .p20-grid li.n i { color: rgba(26, 24, 22, 0.32); font-weight: 500; }
#pantheon .p20-grid li.n b { font-weight: 600; }

/* motion: faded until lit */
.motion #pantheon .p20.pre li { transition: background-color 0.5s ease, box-shadow 0.5s ease, opacity 0.5s ease, translate 0.6s var(--e-out, ease), scale 0.6s var(--e-out, ease); }
.motion #pantheon .p20.pre li.y:not(.lit) { background: transparent; box-shadow: inset 0 0 0 1px rgba(26, 24, 22, 0.08); opacity: 0.4; scale: 0.97; }
.motion #pantheon .p20.pre li.y:not(.lit) i { color: var(--muted); }
.motion #pantheon .p20.pre li.n { opacity: 0.4; }
.motion #pantheon .p20.pre li.y.lit { animation: p20pop 0.6s var(--e-out, ease) both; }
@keyframes p20pop { 0% { translate: 0 6px; } 45% { translate: 0 -3px; } 100% { translate: 0 0; } }
.motion #pantheon .p20.pre.done li.n { opacity: 1; transition-delay: 0.2s; }
#pantheon .p20.done .p20-n { animation: p20beat 0.7s var(--e-out, ease); }
@keyframes p20beat { 0% { scale: 1; } 35% { scale: 1.08; } 100% { scale: 1; } }
#pantheon .p20-n { display: inline-block; transform-origin: left 80%; }

@media (max-width: 1100px) {
  #pantheon .p20 { grid-template-columns: minmax(0, 1fr); }
  #pantheon .p20-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  #pantheon .p20-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  #pantheon .p20-grid li { padding: 9px 10px 10px; }
  #pantheon .p20-grid b { font-size: 13.5px; white-space: normal; }
  #pantheon .p20-grid i { margin-top: 5px; font-size: 12.5px; }
}

/* dark mode */
[data-theme="dark"] #pantheon .p20-grid li { background: #1B1A18; box-shadow: none; }
[data-theme="dark"] #pantheon .p20-grid i { color: #A7B3D8; }
[data-theme="dark"] #pantheon .p20-grid li.n, [data-theme="dark"] .motion #pantheon .p20.pre li.y:not(.lit) { background: transparent; box-shadow: inset 0 0 0 1px rgba(255, 246, 228, 0.1); }
[data-theme="dark"] #pantheon .p20-grid li.n b, [data-theme="dark"] #pantheon .p20-grid li.n span, [data-theme="dark"] #pantheon .p20-grid li.n i { color: rgba(244, 239, 230, 0.3); }
/* the count and "of 20" sit together (no reserved width), and the left column has room for the line */
#pantheon .p20-n { min-width: 0; }
@media (min-width: 1101px) { #pantheon .p20 { grid-template-columns: minmax(0, 3.7fr) minmax(0, 8.3fr); } }
#pantheon .p20-h { hyphens: manual; }
