/* Three spot inks on cream stock: fluorescent pink (flood), medium blue, sunflower.
   Page coordinates (CSS px): margins 30. Head 30..82, field 96..168, list from 180, rows 32. */
.rs {
  --pink: #ff48b0;
  --blue: #2f4fb5;
  --sun: #ffc61a;
  --paper: #fbf4de;
  --blue-on-pink: #2f1670;
  --sun-on-pink: #ff3d12;
  position: relative;
  width: 540px;
  height: 540px;
  box-sizing: border-box;
  padding: 30px;
  background: var(--pink);
  color: var(--blue);
  font-family: "Space Grotesk Variable", sans-serif;
}

.rs *,
.rs-pop * { box-sizing: border-box; }

/* paper tooth and ink mottle over the whole sheet */
.rs::after,
.rs-list::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .2  0 0 0 0 .1  0 0 0 0 .3  0 0 0 -1.5 1.05'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  opacity: 0.3;
}

.rs-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 52px;
  margin-bottom: 14px;
}

.rs-label {
  color: var(--blue-on-pink);
  font-size: 56px;
  font-weight: 700;
  line-height: 48px;
  letter-spacing: -3px;
  /* the sunflower plate, printed a hair off register */
  text-shadow: 3px 3px 0 var(--sun-on-pink);
}

.rs-count {
  margin-bottom: 2px;
  color: var(--blue-on-pink);
  font-family: "Space Mono", monospace;
  font-size: 20px;
  font-weight: 700;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
}

/* Field: pink knocked out to paper, blue keyline off register, halftone drop. */
.rs-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 72px;
  padding: 0 14px;
  background: var(--paper);
}

.rs-field::before,
.rs-pop::before {
  content: "";
  position: absolute;
  inset: 10px -10px -10px 10px;
  z-index: -1;
  background: radial-gradient(circle at 3px 3px, var(--blue-on-pink) 1.7px, transparent 2.1px) 0 0 / 6px 6px;
}

.rs-field::after {
  content: "";
  position: absolute;
  inset: -2px 2px 2px -2px;
  border: 3px solid var(--blue);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.rs-chip {
  position: relative;
  z-index: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 44px;
  padding: 0 9px 0 13px;
  background: var(--blue);
  color: var(--paper);
  font-size: 23px;
  font-weight: 600;
  line-height: 44px;
  letter-spacing: -0.8px;
  white-space: nowrap;
  outline: none;
  clip-path: polygon(0 3%, 99% 0, 100% 96%, 1.5% 100%);
  animation: rs-stamp 170ms cubic-bezier(0.2, 0.9, 0.3, 1.2) backwards;
}

.rs-chip:nth-of-type(even) { clip-path: polygon(1% 0, 100% 4%, 98.5% 100%, 0 97%); }

/* sunflower plate under the blue, slipped left */
.rs-chip::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  z-index: -1;
  background: var(--sun);
}

.rs-chip { padding-left: 19px; }

@keyframes rs-stamp {
  from { scale: 1.2; opacity: 0.3; }
}

.rs-x {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--pink);
  color: var(--blue-on-pink);
  outline: none;
}

.rs-x svg { width: 16px; height: 16px; stroke-width: 3.2; }

.rs-input {
  flex: 1;
  min-width: 24px;
  height: 44px;
  margin: 0;
  padding: 0 0 0 4px;
  border: 0;
  background: transparent;
  color: var(--blue);
  caret-color: var(--pink);
  font: inherit;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.8px;
  outline: none;
}

.rs-pop {
  width: var(--anchor-width);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2f4fb5;
  font-family: "Space Grotesk Variable", sans-serif;
  outline: none;
  overflow: visible;
  transition: opacity 160ms ease, translate 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.rs-pop[data-starting-style],
.rs-pop[data-ending-style] {
  opacity: 0;
  translate: 0 -10px;
}

.rs-list {
  position: relative;
  height: calc(var(--rows) * 32px + 12px);
  padding: 6px 8px;
  overflow: hidden;
  transition: height 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  background: #fbf4de;
  outline: none;
}

.rs-item {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 11px 0 10px;
  font-size: 23px;
  font-weight: 500;
  line-height: 32px;
  letter-spacing: -0.8px;
  outline: none;
  animation: rs-row 120ms cubic-bezier(0.2, 0.7, 0.2, 1) calc(var(--i) * 8ms) backwards;
}

@keyframes rs-row {
  from { opacity: 0.3; translate: -10px 0; }
}

.rs-no {
  position: relative;
  top: 2px;
  width: 42px;
  color: #ff48b0;
  font-family: "Space Mono", monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.rs-text { flex: 1; }

.rs-text mark {
  background: none;
  color: inherit;
  font-weight: 700;
  background: linear-gradient(#ffc61a, #ffc61a) 0 100% / 100% 11px no-repeat;
  animation: rs-ink 200ms cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

@keyframes rs-ink {
  from { background-size: 40% 11px; }
}

/* highlight: a sunflower block wiped in from the left, blue type overprinting it */
.rs-item::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #ffc61a;
  clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
  transition: clip-path 150ms cubic-bezier(0.3, 0.7, 0.2, 1);
}

.rs-item[data-highlighted]::before { clip-path: polygon(0 4%, 100% 0, 99.4% 100%, 0.6% 97%); }
.rs-item[data-highlighted] { font-weight: 700; }
.rs-item[data-highlighted] .rs-text mark { background-image: linear-gradient(#ff48b0, #ff48b0); }

.rs-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff48b0;
}
