/* Tally: a minimal archive of eighteen small abstract prints on warm paper. One shape each, four inks, one of
   them vermilion. A click on an order and the prints slide into columns, each on its own spring; thin labels and a
   hairline sit over the columns. */
:root {
  --paper: #f3f0e8;     /* the room */
  --card: #fbfaf6;      /* the paper of the prints */
  --ink: #141414;       /* the type, the hairlines, the ink prints */
  --muted: #8a857b;     /* the small print */
  --vermilion: #e5401f; /* the only accent: three prints */
  --stone: #9c968b;     /* the grey prints */
  --sand: #d8c9ab;      /* the pale prints */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Roboto Flex Variable', 'Roboto Flex', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.room {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

/* ---- the top: the name and the orders ---- */
.top {
  position: absolute;
  top: 26px;
  left: 44px;
  right: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.top p {
  margin: 0;
}

.mark {
  font-size: 20px;
  font-weight: 600;
  font-stretch: 80%;
  letter-spacing: -0.01em;
  overflow: hidden;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}

.mark span {
  display: inline-block;
}

.sort {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}

.sort__by {
  color: var(--muted);
  font-stretch: 90%;
}

.sort__keys {
  position: relative;
  display: flex;
  gap: 2px;
}

/* the hairline box that springs to the order in use */
.sort__frame {
  position: absolute;
  left: 0;
  top: 0;
  width: 10px;
  height: 100%;
  border: 1px solid var(--ink);
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
}

.key {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  margin: 0;
  padding: 6px 11px 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 420;
  font-stretch: 92%;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.3s ease;
}

.key__t {
  display: inline-block;
  transition: font-stretch 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), font-weight 0.3s ease;
}

.key[aria-pressed='true'] {
  color: var(--ink);
}

.key[aria-pressed='true'] .key__t {
  font-weight: 620;
}

.key:focus-visible {
  outline: 1px dashed var(--ink);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .key:hover {
    color: var(--ink);
  }

  .key:hover .key__t {
    font-stretch: 112%;
  }
}

/* ---- the board: column heads and prints, placed by the script ---- */
.board {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.heads,
.prints {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.head {
  position: absolute;
  left: 0;
  top: 0;
  height: 30px;
}

.head__label,
.head__count {
  position: absolute;
  bottom: 9px;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  line-height: 1.25;
  padding-bottom: 0.1em;
  font-size: var(--label, 12px);
}

.head__label {
  left: 0;
  right: 1.9em;
  height: 1.4em;
  font-weight: 520;
  font-stretch: 86%;
}

.head__count {
  right: 0;
  color: var(--muted);
  font-weight: 400;
  font-stretch: 80%;
  font-variant-numeric: tabular-nums;
}

.head__label .roll {
  position: absolute;
  left: 0;
  top: 0;
}

.head__label span,
.head__count span {
  display: inline-block;
}

.head__line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.print {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
}

/* the element GSAP moves is .print; the one that lifts, squashes and feels the neighbours is .print__in */
.print__in {
  position: relative;
  width: 100%;
  height: 100%;
}

.print__shade {
  position: absolute;
  inset: 6% 4% -3%;
  border-radius: 2px;
  background: var(--ink);
  filter: blur(9px);
  opacity: 0;
}

.print svg {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  background: var(--card);
  box-shadow: 0 0 0 1px rgba(20, 20, 20, 0.06);
}

.print svg .art {
  transform-box: view-box;
  transform-origin: 50% 50%;
}

.f-vermilion { fill: var(--vermilion); }
.f-ink { fill: var(--ink); }
.f-stone { fill: var(--stone); }
.f-sand { fill: var(--sand); }
.f-card { fill: var(--card); }

.horizon {
  stroke: var(--ink);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  opacity: 0.55;
}

/* ---- the foot: what is shown, and the total ---- */
.foot {
  position: absolute;
  left: 44px;
  right: 44px;
  bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-size: 13px;
  pointer-events: none;
}

.foot p {
  margin: 0;
}

.foot__status {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 1.4em;
  overflow: hidden;
  white-space: nowrap;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
  font-stretch: 92%;
}

.roll {
  display: inline-block;
}

.roll span {
  display: inline-block;
}

.foot__total {
  color: var(--muted);
  font-stretch: 90%;
  white-space: nowrap;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 639px) {
  .top {
    top: 18px;
    left: 16px;
    right: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .sort {
    gap: 8px;
    margin-left: -11px;
  }

  .sort__by {
    display: none;
  }

  .foot {
    left: 16px;
    right: 16px;
    bottom: 18px;
    font-size: 12px;
  }
}
