/* Table of Chapters (v08): landing page. */

/* Light catching the laminate; follows the pointer on a desktop. */
.home .poster::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(112deg,
    rgba(255, 255, 255, 0) 38%,
    rgba(255, 255, 255, .30) 48%,
    rgba(255, 255, 255, .08) 53%,
    rgba(255, 255, 255, 0) 60%);
  background-size: 280% 100%;
  background-position: var(--sheen, 74%) 0;
  transition: background-position .6s ease-out;
}

.stage { position: relative; }

/* The table. JS places every item on the grid; --cols is 8 or 4. */
.table {
  --cols: 8;
  --gap: 6px;
  --pcol: 30px;
  position: relative;
  container-type: inline-size;
  display: grid;
  grid-template-columns: var(--pcol) repeat(var(--cols), minmax(0, 1fr));
  gap: var(--gap);
}
.table.is-narrow { --cols: 4; --gap: 3px; --pcol: 14px; }
.table.is-narrow .el { padding: 0 4px; }

.table .el,
.table .slot {
  min-height: calc((100cqi - var(--pcol) - var(--cols) * var(--gap)) / var(--cols) * 1.18);
}

.table .el {
  transition: transform .24s cubic-bezier(.2, .8, .2, 1), box-shadow .24s, opacity .3s, filter .3s;
  animation: set .45s cubic-bezier(.2, .7, .2, 1) backwards;
  animation-delay: var(--d, 0ms);
  -webkit-tap-highlight-color: transparent;
}
@keyframes set {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
}
.table .el.is-lifted {
  z-index: 6;
  transform: translateY(-7px) scale(1.05);
  box-shadow: 0 18px 26px -12px rgba(20, 18, 12, .55), 0 3px 6px rgba(20, 18, 12, .14);
}
.table .el.is-dim { opacity: .24; filter: grayscale(.85); }
.table .el:focus-visible { outline-offset: 4px; z-index: 7; }

.per {
  grid-column: 1;
  align-self: start;
  padding-top: 7px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.slot {
  position: relative;
  border: 1.5px solid rgba(29, 27, 23, .17);
}
.slot-no {
  position: absolute;
  top: 6px; left: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-3);
}

/* Masthead: inside the gap of the first period on a wide screen, above the table otherwise. */
.mast {
  align-self: center;
  justify-self: center;
  text-align: center;
  padding: 2px 10px;
}
.mast-h { margin: 0; font-weight: 400; }
.mast-name {
  display: block;
  margin-right: -.34em;
  font-size: 15px;
  font-weight: 800;
  font-stretch: 122%;
  letter-spacing: .34em;
  text-transform: uppercase;
}
.mast-title {
  display: block;
  margin: 10px 0 12px;
  font-size: clamp(36px, 6.8cqi, 96px);
  font-weight: 900;
  font-stretch: 64%;
  line-height: .9;
  letter-spacing: .005em;
  text-transform: uppercase;
  text-wrap: balance;
}
.mast-line {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  font-style: italic;
  color: var(--ink-2);
}
.table.is-narrow .mast { padding: 4px 0 18px; }
.table.is-narrow .mast-name { font-size: 12.5px; letter-spacing: .3em; margin-right: -.3em; }
.table.is-narrow .mast-title { font-size: clamp(40px, 14cqi, 92px); margin: 10px 0; }
.table.is-narrow .mast-line { font-size: 16px; }

/* Groups legend. */
.legend-h,
.notes h2 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.legend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.legend-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 6px 8px;
  border: 1.5px solid transparent;
  background: none;
  color: var(--ink);
  font: 600 16px/1.2 var(--sans);
  text-align: left;
  cursor: pointer;
}
.legend-btn:hover { border-color: rgba(29, 27, 23, .3); }
.legend-btn[aria-pressed="true"] { border-color: var(--ink); background: rgba(29, 27, 23, .06); }
.legend-sw {
  flex: none;
  width: 30px; height: 22px;
  border: 1.5px solid var(--ink);
  background: linear-gradient(90deg, var(--f1) 0 33.3%, var(--f0) 33.3% 66.6%, var(--f2) 66.6%);
}
.legend-n { margin-left: auto; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.table .legend {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 2px 6px;
}
.table .legend-h {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: -1px;
}
.table .legend-list { gap: 1px; }
.table .legend-btn { gap: 7px; padding: 3px 4px; min-height: 24px; font-size: 12px; }
.table .legend-sw { width: 17px; height: 14px; }
@media (min-width: 641px) {
  .table .legend-list { gap: 3px; }
  .table .legend-btn { gap: 10px; min-height: 30px; font-size: 14.5px; }
  .table .legend-sw { width: 24px; height: 18px; }
}

/* The card a tile lifts out into. */
.card {
  position: absolute;
  left: 0; top: 0;
  z-index: 20;
  width: min(360px, 100%);
  transform-origin: 0 0;
  background: var(--fill);
  border: 1.5px solid var(--ink);
  color: var(--ink);
  box-shadow: 0 34px 54px -26px rgba(20, 18, 12, .6), 0 6px 14px rgba(20, 18, 12, .14);
  pointer-events: none;
  transition: transform .32s cubic-bezier(.2, .8, .2, 1);
}
.card[hidden] { display: none; }
.card-in { padding: 14px 18px 18px; opacity: 0; transition: opacity .14s; }
.card.is-open .card-in { opacity: 1; transition: opacity .2s .11s; }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-no { font-size: 26px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.card-kind {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-k);
}
.card-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-top: 4px; }
.card-sym { font-size: 108px; font-weight: 800; line-height: .88; letter-spacing: -.03em; }
.card-fig {
  display: block;
  flex: none;
  width: 112px; height: 112px;
  border: 1.5px solid var(--ink);
  background: rgba(255, 255, 255, .35);
  overflow: hidden;
}
.card-fig[hidden] { display: none; }
.card-fig img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-title { margin: 14px 0 3px; font-size: 23px; font-weight: 750; line-height: 1.12; }
.card-meta {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.card-prop { margin: 10px 0 0; font-size: 15px; font-style: italic; line-height: 1.38; }
.card-lede {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1.5px solid rgba(29, 27, 23, .3);
  font-family: var(--serif);
  font-size: 18.5px;
  line-height: 1.42;
}
.card-prop:empty, .card-lede:empty { display: none; }
.card-shells {
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  margin: 14px 0 0;
  font-size: 12.5px; font-weight: 600;
  color: var(--ink-2);
}
.card-acts { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.card-go {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 40px;
  padding: 0 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px; font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
}
.card-x {
  display: none;
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: 700 13px var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}

/* On a phone (and after a tap) the card rises as a sheet. */
.card.is-sheet {
  position: fixed;
  top: auto;
  left: max(10px, calc(50% - 280px));
  right: max(10px, calc(50% - 280px));
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  width: auto;
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
}
.card.is-sheet.is-top { top: 10px; bottom: auto; }
.card.is-sheet .card-x { display: inline-block; }
.card.is-sheet .card-go { min-height: 44px; }
.card.is-sheet .card-acts { justify-content: space-between; }

/* Legend, key and notes: the poster's footnotes. */
.notes {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 44px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 2px solid var(--ink);
}
.notes-col[hidden] { display: none; }

.key-wrap { display: flex; align-items: flex-start; gap: 30px; }
.key-tile { position: relative; flex: none; width: 186px; margin: 0 28px; }
.key-tile .el { min-height: 222px; }
.badge {
  display: inline-block;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px; font-weight: 700;
  line-height: 19px;
  text-align: center;
  font-style: normal;
}
.key-tile .badge { position: absolute; z-index: 2; }
.key-tile .b1 { left: -27px; top: 4px; }
.key-tile .b2 { left: -27px; top: 66px; }
.key-tile .b3 { left: -27px; top: 108px; }
.key-tile .b5 { left: -27px; top: 180px; }
.key-tile .b4 { right: -27px; top: 4px; }
.key-tile .b6 { right: -27px; top: 80px; }
.key-list, .foot-list { margin: 0; padding: 0; list-style: none; }
.key-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 0;
  font-size: 15px; font-weight: 550;
}
.key-list .badge { flex: none; }
.foot-list { counter-reset: foot; }
.foot-list li {
  counter-increment: foot;
  position: relative;
  padding: 0 0 10px 20px;
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.4;
  color: var(--ink-2);
}
.foot-list li::before {
  content: counter(foot);
  position: absolute; left: 0; top: 1px;
  font: 700 11px/1.4 var(--sans);
  color: var(--ink);
}
@media not all and (hover: hover) and (pointer: fine) {
  .foot-type { display: none; }
}

.imprint {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px;
  margin-top: 26px;
  padding-top: 12px;
  border-top: 1px solid rgba(29, 27, 23, .35);
  font-size: 12px; font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.imprint-name { font-weight: 800; color: var(--ink); }

/* Tablet and phone. */
@media (max-width: 1100px) {
  .notes { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .notes-foot { grid-column: 1 / -1; }
}
@media (max-width: 979px) {
  .notes { grid-template-columns: minmax(0, 1fr); gap: 30px; }
}
@media (max-width: 640px) {
  .poster {
    width: calc(100% - 16px);
    margin: 8px auto 28px;
    padding: 20px 14px 18px;
  }
  .poster::before { inset: 5px; border-width: 3px; }
  .tape { width: 56px; height: 18px; }
  .tape--tl { top: -5px; left: -6px; }
  .tape--tr { top: -5px; right: -6px; }
  .tape--bl { bottom: -5px; left: -6px; }
  .tape--br { bottom: -5px; right: -6px; }
  .per { font-size: 10px; padding-top: 5px; }
  .slot-no { font-size: 10.5px; top: 4px; left: 5px; }
  .notes { margin-top: 24px; padding: 18px 6px 0; }
  .key-wrap { flex-direction: column; align-items: center; gap: 14px; }
  .key-list { align-self: stretch; display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
  .key-list li { font-size: 14px; align-items: flex-start; }
  .key-list li:last-child { grid-column: 1 / -1; }
  .foot-list li { font-size: 16px; }
  .imprint { margin: 18px 6px 0; font-size: 11px; }
  .card-sym { font-size: 84px; }
  .card-fig { width: 92px; height: 92px; }
  .card-title { font-size: 21px; }
  .card-prop { font-size: 16px; }
  .card-lede { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .home .poster::after { transition: none; }
  .table .el { animation: none; transition: opacity .2s, filter .2s; }
  .table .el.is-lifted { transform: none; outline: 3px solid var(--ink); outline-offset: 2px; }
  .card { transition: none; }
  .card-in, .card.is-open .card-in { transition: none; }
}
