/* Aplomb: a minimal physics piece. A warm white room, one sheet of paper in a hairline frame, a plumb line hung
   from its top edge and a scale of fine ticks. Everything is one SVG redrawn by the script; the colours and the
   type are here. */
:root {
  --room: #efece4;      /* the room around the sheet */
  --paper: #fbfaf6;     /* the sheet */
  --ink: #161513;       /* the frame, the plumb line and the figures */
  --accent: #ff4b1f;    /* the notch that reads the angle */
  --muted: #8f897d;     /* the fine ticks and the small print */
  --guide: #d3cdbf;     /* the true vertical outside the sheet */
  --light: 280;         /* the weight of the figures when the sheet is level (100 to 1000) */
  --heavy: 720;         /* the weight of the figures at the steepest tilt (100 to 1000) */
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--room);
  color: var(--ink);
  font-family: 'Roboto Flex Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

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

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

.guide {
  fill: none;
  stroke: var(--guide);
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.paper {
  fill: var(--paper);
}

.frame {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.25;
  stroke-linejoin: miter;
}

.tick {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-linecap: butt;
}

.tick--major {
  stroke: var(--ink);
}

.label {
  fill: var(--muted);
  font-weight: 450;
  font-variant-numeric: tabular-nums;
  text-anchor: middle;
}

.sweep {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: butt;
}

.notch {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: butt;
}

.thread {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1;
}

.bob {
  fill: var(--ink);
}

.pin {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.25;
}

.brand {
  fill: var(--ink);
  font-weight: 640;
  font-stretch: 112%;
  letter-spacing: -0.01em;
}

/* the figures: the script writes --k (how steep, 0 to 1) and --s (how fast the plumb swings, 0 to 1) */
.num {
  --k: 0;
  --s: 0;
  fill: var(--ink);
  font-weight: calc(var(--light) + (var(--heavy) - var(--light)) * var(--k));
  font-stretch: calc(100% - var(--s) * 26%);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
  text-anchor: middle;
}

.num__deg {
  font-size: 0.6em;
  letter-spacing: 0;
}

.say {
  fill: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-anchor: middle;
}

.hint {
  position: absolute;
  left: 24px;
  bottom: 22px;
  margin: 0;
  max-width: calc(100% - 48px);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 450;
  letter-spacing: 0.01em;
  color: var(--muted);
  pointer-events: none;
}

.stage:focus-visible .hint {
  color: var(--ink);
}

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