:root {
  --paper: #f4f1eb;        /* the warm white page */
  --card: #fffdfa;         /* the settings panel */
  --ink: #1a1917;          /* titles and the preview sentence */
  --muted: #8b857a;        /* small print */
  --line: #e6e0d5;         /* hairlines, the empty rail and the ticks */
  --accent: #5b46f2;       /* the single accent: the fill, the thumb ring, the changed words */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage {
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 2vh 14px;
}

.panel {
  width: min(500px, 92vw);
  background: var(--card);
  border: 1px solid #ebe5da;
  border-radius: min(24px, 4.6vh);
  padding: min(20px, 3.6vh) min(22px, 5.4vw) min(18px, 3.2vh);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 1px 2px rgba(40, 30, 10, .05), 0 26px 54px -26px rgba(40, 30, 10, .3);
  display: flex;
  flex-direction: column;
  gap: min(16px, 2.8vh);
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand__mark {
  width: min(34px, 6.4vh);
  height: min(34px, 6.4vh);
  padding: 7px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--card);
  flex: none;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--muted);
}

h1 {
  font-size: min(17px, 3.4vh);
  font-weight: 620;
  letter-spacing: -.01em;
  line-height: 1.2;
}

/* the value, two rolling columns of digits inside a pill */
.value {
  display: flex;
  align-items: center;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 30px;
  overflow: hidden;
  flex: none;
}

.value__col {
  display: inline-flex;
  flex-direction: column;
  height: 30px;
  width: 1ch;
  text-align: center;
}

.value__col > span { display: block; height: 30px; }

.value__dot { width: .5ch; text-align: center; }

/* the preview sentence */
.preview {
  border-radius: min(16px, 3vh);
  background: #faf7f1;
  border: 1px solid #efe9de;
  padding: min(14px, 2.6vh) min(16px, 4vw) min(16px, 3vh);
  min-height: min(132px, 25vh);
}

.preview__label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: min(8px, 1.4vh);
  display: flex;
  gap: 6px;
}

.preview__label span { color: var(--accent); font-weight: 600; }

.preview__text {
  font-family: "Fraunces Variable", Georgia, serif;
  font-size: min(24px, 4.6vh, 5.6vw);
  line-height: 1.34;
  letter-spacing: -.01em;
  font-variation-settings: "opsz" 36;
}

/* one word slot: the old and the new word share the slot while they swap */
.slot {
  position: relative;
  display: inline-block;
  vertical-align: top;
  white-space: nowrap;
  overflow: hidden;
  padding: .1em 0 .16em;
  margin: -.1em 0 -.16em;
}

.slot__word { display: inline-block; }

.slot__word--out {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}

.slot__mark {
  position: absolute;
  left: 0;
  right: 0;
  bottom: .06em;
  height: 1.5px;
  border-radius: 2px;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
  opacity: 0;
}

/* the slider */
.slider {
  outline: none;
  touch-action: none;
  cursor: pointer;
  padding-top: 26px;
}

.slider__track {
  position: relative;
  height: 28px;
  margin: 0 14px;
}

.slider__rail,
.slider__fill {
  position: absolute;
  left: 0;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  border-radius: 4px;
}

.slider__rail { right: 0; background: var(--line); }

.slider__fill {
  width: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.slider__ticks {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  margin-top: 9px;
  height: 6px;
}

.slider__ticks i {
  position: absolute;
  top: 0;
  width: 1px;
  height: 6px;
  margin-left: -.5px;
  background: var(--line);
  transform-origin: 50% 0;
}

.slider__thumb {
  position: absolute;
  left: 0;
  top: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(26, 25, 23, .08), 0 2px 4px rgba(26, 25, 23, .1), 0 10px 18px -8px rgba(26, 25, 23, .35);
  display: grid;
  place-items: center;
}

.slider__core {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.slider__chip {
  position: absolute;
  left: 50%;
  bottom: 100%;
  margin-bottom: 4px;
  transform: translateX(-50%);
  pointer-events: none;
}

.slider__chip-in {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, #fff);
  border-radius: 999px;
  padding: 3px 8px;
  opacity: 0;
  white-space: nowrap;
}

.slider__ends {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--muted);
}

.slider:focus-visible .slider__thumb { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent), 0 2px 4px rgba(26, 25, 23, .1); }

@media (hover: hover) {
  .slider:hover .slider__thumb { box-shadow: 0 0 0 1px rgba(26, 25, 23, .1), 0 3px 6px rgba(26, 25, 23, .12), 0 14px 22px -8px rgba(26, 25, 23, .38); }
}
