/* Counting pi: a minimal physics piece on a black page. A wall, a floor, two blocks drawn with one thin line each,
   and a large serif number that counts every knock. */
:root {
  --page: #0e0e0e;      /* the page */
  --ink: #ece8df;       /* the number, the blocks, the wall and the floor */
  --muted: #6f6b64;     /* the small print and the digits of pi still to come */
  --accent: #ff5a1f;    /* the small block's knocks, and the digits the blocks have counted */
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--page);
  color: var(--ink);
  font-family: 'Fraunces Variable', Georgia, serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  outline: none;
}

.room {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.wall,
.floor {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1;
}

.hatch {
  stroke: var(--muted);
  stroke-width: 1;
}

.block {
  fill: var(--page);
  stroke: var(--ink);
  stroke-width: 1;
}

.mass {
  fill: var(--muted);
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: 12px;
  font-style: italic;
  font-variation-settings: 'opsz' 12;
  text-anchor: middle;
}

/* ---------------------------------------------------------------- the count */
.count {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  text-align: center;
  pointer-events: none;
}

.count__value {
  margin: 0;
  font-size: 160px;
  line-height: 0.9;
  font-weight: 300;
  font-variant-numeric: lining-nums tabular-nums;
  font-variation-settings: 'opsz' 144, 'SOFT' 0;
  letter-spacing: -0.02em;
}

.count__label {
  margin: 0.6em 0 0;
  font-size: 13px;
  font-style: italic;
  font-variation-settings: 'opsz' 14;
  color: var(--muted);
}

.pi {
  margin: 1.6em 0 0;
  font-size: 15px;
  letter-spacing: 0.06em;
  font-variant-numeric: lining-nums tabular-nums;
  font-variation-settings: 'opsz' 14;
  color: var(--muted);
}

.pi__name {
  font-style: italic;
}

.pi__d {
  display: inline-block;
}

.top {
  position: absolute;
  top: 22px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  line-height: 1.3;
  pointer-events: none;
}

.top__brand {
  font-weight: 600;
  font-variation-settings: 'opsz' 12;
  letter-spacing: 0.04em;
}

.top__note {
  color: var(--muted);
  font-style: italic;
  font-variation-settings: 'opsz' 12;
  text-align: right;
}

.hint,
.read {
  position: absolute;
  bottom: 22px;
  margin: 0;
  font-size: 12px;
  line-height: 1.3;
  font-variation-settings: 'opsz' 12;
  color: var(--muted);
  pointer-events: none;
}

.hint {
  left: 24px;
  max-width: calc(100% - 190px);
}

.read {
  right: 24px;
  display: flex;
  gap: 10px;
  font-variant-numeric: lining-nums tabular-nums;
}

.read__value {
  font-weight: 600;
  color: var(--ink);
}

@media (max-width: 560px) {
  .top {
    top: 18px;
    left: 16px;
    right: 16px;
  }

  .hint {
    left: 16px;
    bottom: 18px;
  }

  .read {
    right: 16px;
    bottom: 18px;
  }
}
