/* The swipe deck: bold coloured cards on a white page, green to keep and red to skip. */
:root {
  --page: #ffffff;          /* the page */
  --ink: #1b1a17;
  --muted: #86837b;
  --line: #ebe8e2;
  --keep: #189a52;          /* keep */
  --skip: #e0453b;          /* skip */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Archivo Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  overflow: hidden;
}

.plans {
  width: min(340px, 100%);
}

.plans__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.plans__title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.01em;
}

.plans__count {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- the deck */
.deck {
  position: relative;
  height: min(440px, 62svh);
}

.card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  background: var(--bg);
  color: var(--ink-card);
  box-shadow: 0 1px 2px rgba(20, 18, 14, 0.06), 0 14px 34px -14px rgba(20, 18, 14, 0.28);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  will-change: transform;
}

.card.is-held {
  cursor: grabbing;
}

.card:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

html[data-using='pointer'] .card:focus-visible {
  outline: none;
}

.card__art {
  display: block;
  width: 100%;
  height: 54%;
  flex: none;
}

.card__body {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex: 1;
  padding: 0 24px 24px;
}

.card__tag {
  align-self: flex-start;
  padding: 4px 10px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card__title {
  margin: 12px 0 0;
  font-size: clamp(32px, 10vw, 40px);
  font-weight: 800;
  font-stretch: 116%;
  line-height: 0.95;
  letter-spacing: -0.015em;
}

.card__meta {
  margin: 10px 0 0;
  font-size: 15px;
  font-weight: 550;
  opacity: 0.78;
}

/* the stamps that show while a card is dragged */
.card__stamp {
  position: absolute;
  top: 24px;
  padding: 3px 12px 4px;
  border: 3px solid currentColor;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 26px;
  font-weight: 850;
  font-stretch: 100%;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
}

.card__stamp--keep {
  left: 20px;
  color: var(--keep);
}

.card__stamp--skip {
  right: 20px;
  color: var(--skip);
}

/* ---------------------------------------------------------------- the buttons */
.actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 26px;
}

.act {
  --p: 0;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 8px 20px -10px rgba(20, 18, 14, 0.3);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1), border-color 0.25s;
  -webkit-tap-highlight-color: transparent;
}

.act svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* the buttons fill up with their colour as a card is dragged their way */
.act--keep {
  color: color-mix(in srgb, #ffffff calc(var(--p) * 100%), var(--keep));
  background: color-mix(in srgb, var(--keep) calc(var(--p) * 100%), #ffffff);
}

.act--skip {
  color: color-mix(in srgb, #ffffff calc(var(--p) * 100%), var(--skip));
  background: color-mix(in srgb, var(--skip) calc(var(--p) * 100%), #ffffff);
}

.act--undo {
  width: 46px;
  height: 46px;
  color: #6f6b62;
}

.act--undo svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

.act:disabled {
  opacity: 0.4;
  cursor: default;
}

@media (hover: hover) {
  .act:not(:disabled):hover {
    transform: scale(1.07);
  }
}

.act:not(:disabled):active {
  transform: scale(0.9);
}

.act:focus-visible,
.done__again:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

html[data-using='pointer'] .act:focus-visible,
html[data-using='pointer'] .done__again:focus-visible {
  outline: none;
}

.plans__hint {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ---------------------------------------------------------------- the end */
.done {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 1.5px dashed var(--line);
  border-radius: 28px;
  text-align: center;
}

.done[hidden] {
  display: none;
}

.done__over {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.done__count {
  margin: 2px 0 14px;
  font-size: 88px;
  font-weight: 850;
  font-stretch: 120%;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.done__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.done__list li {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-card);
  font-size: 13px;
  font-weight: 700;
}

.done__again {
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  font: 700 15px 'Archivo Variable', system-ui, sans-serif;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.done__again:active {
  transform: scale(0.94);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
