/* The rearranging tangram: seven hairline pieces on a warm white page, standing on a thin floor, and the name of
   the figure under them in a wide grotesque that narrows as it leaves. */
:root {
  --page: #f2efe8;          /* the page */
  --ink: #171614;           /* the outlines, the filled pieces and the name */
  --accent: #e5532b;        /* the one square piece */
  --floor: #c9c3b8;         /* the hairline the figures stand on */
}

* {
  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', 'Archivo', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(18px, 4.4svh, 44px);
  padding: 32px 16px;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ---------------------------------------------------------------- the board */
.board {
  display: block;
  width: min(88vw, 640px, calc(60svh * 8 / 7.95));
  height: auto;
  aspect-ratio: 8 / 7.95;
  overflow: visible;
}

.floor {
  stroke: var(--floor);
  stroke-width: 1;
  fill: none;
  vector-effect: non-scaling-stroke;
}

.piece__line {
  fill: none;
  stroke: var(--ink);
  stroke-width: var(--sw, 0.021);
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* the ink keeps a hairline of page around it: the seams between the pieces stay visible */
.piece__fill {
  fill: var(--ink);
  stroke: var(--page);
  stroke-width: var(--seam, 0.019);
  stroke-linejoin: round;
}

.piece--accent .piece__fill {
  fill: var(--accent);
}

/* ---------------------------------------------------------------- the name */
.name {
  margin: 0;
  min-height: 1.2em;
  font-size: clamp(34px, 7.4vw, 82px);
  font-weight: 560;
  line-height: 1;
  letter-spacing: -0.025em;
  text-align: center;
  white-space: nowrap;
}

/* the letters rise into a window and drop out of it */
.name__clip {
  display: inline-block;
  overflow: hidden;
  padding: 0.08em 0.1em 0.16em;
  margin: -0.08em -0.1em -0.16em;
  vertical-align: top;
}

.ch {
  display: inline-block;
  font-variation-settings: 'wdth' var(--w, 100);
  will-change: transform;
}
