/* Cards laid on the table: five white cards with a hairline edge on a warm white page, one word in the corner of
   each, set in Archivo on its width and weight axes. One accent, the red of a playing card. */
:root {
  --page: #f3f0e8;     /* the table */
  --card: #fdfcf8;     /* the cards */
  --ink: #141414;      /* the words, the ruler and the note */
  --accent: #e2382a;   /* the card under the pointer */
  --edge: rgba(20, 20, 20, 0.2); /* the hairline round every card */
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: 'Archivo Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.stage {
  position: fixed;
  inset: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

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

/* ------------------------------------------------------------------ the table: a point near the middle of the page */
.table {
  position: absolute;
  left: 50%;
  top: 47%;
  width: 0;
  height: 0;
  opacity: 0;
}

.deck {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
}

/* one card: the script moves it; the face inside carries the paper, the edge and the word */
.card {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}

.card__face {
  position: absolute;
  inset: 0;
  border-radius: var(--round, 6px);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--edge), 0 1px 2px rgba(20, 20, 20, 0.04);
}

/* the word, in the top right corner: the strip of the card that the one on top of it leaves uncovered */
.card__word {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
  line-height: 1;
  white-space: pre;
  color: var(--ink);
  font-variation-settings: 'wdth' 100, 'wght' 380;
  letter-spacing: -0.01em;
}

/* a hairline under the word, across the strip */
.card__rule {
  position: absolute;
  right: 0;
  height: 1px;
  background: var(--ink);
  opacity: 0.16;
  transform-origin: 100% 50%;
}

/* ------------------------------------------------------------------ the ruler under the cards */
.ruler {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
}

.ruler__line {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  background: var(--ink);
  opacity: 0.32;
  transform-origin: 0 50%;
}

.ruler__tick {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  background: var(--ink);
  opacity: 0.45;
  transform-origin: 50% 0;
}

/* ------------------------------------------------------------------ the keyboard handle */
.handle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 1px;
  outline: none;
}

.handle:focus-visible ~ .note .note__rule {
  background: var(--accent);
  opacity: 1;
}

/* ------------------------------------------------------------------ the note at the foot of the page */
.note {
  position: absolute;
  left: 50%;
  bottom: max(28px, 6vh);
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  font-variation-settings: 'wdth' 100, 'wght' 480;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
  opacity: 0;
  transform: translateX(-50%);
}

.note__hint {
  opacity: 0.55;
}

.note__rule {
  width: 28px;
  height: 1px;
  background: var(--ink);
  opacity: 0.3;
}

.probe {
  position: absolute;
  left: 0;
  top: 0;
  line-height: 1;
  white-space: pre;
  letter-spacing: -0.01em;
  visibility: hidden;
  pointer-events: none;
}
