:root {
  --bg: #000000;
  --ink: #1a1712;
  --pill-hi: #fffaf0;
  --pill-lo: #ece3d0;
  --accent: #e5532a;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
}

/* ---- the pill ---- */
.size {
  position: relative;
  width: min(272px, calc(100vw - 32px));
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 9px;
  border: 0;
  border-radius: 99px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
}
.size:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.size__glow {
  position: absolute;
  inset: -2px 14px -16px;
  border-radius: 99px;
  background: #fff3d6;
  filter: blur(22px);
  opacity: 0.16;
  z-index: -3;
  transition: opacity 0.6s ease, background-color 0.6s ease;
}
.size.is-found .size__glow { background: var(--accent); opacity: 0.5; }
.size__body {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background: linear-gradient(180deg, var(--pill-hi), var(--pill-lo));
  box-shadow: inset 0 1px 0 #ffffff, inset 0 -1px 0 rgba(26, 23, 18, 0.14), inset 0 0 0 1px rgba(26, 23, 18, 0.05);
  z-index: -1;
}
.size__light {
  position: absolute;
  inset: 0;
  background: radial-gradient(130px 80px at var(--px, 50%) var(--py, 0%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.size.is-hot .size__light { opacity: 1; }

/* ---- the seat with the ruler ---- */
.seat {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 0%, #3a352c, #1a1712 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 2px 5px rgba(26, 23, 18, 0.3);
  display: grid;
  place-items: center;
}
.seat svg { width: 24px; height: 24px; overflow: visible; }
.seat rect, .seat path { fill: none; stroke: #fffaf0; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---- the middle: the words, or the tape running under the needle ---- */
.mid { position: relative; flex: 1; min-width: 0; height: 42px; }
.label { position: absolute; left: 0; right: 0; top: 10px; height: 22px; overflow: hidden; font-size: 15.5px; line-height: 22px; font-weight: 620; font-stretch: 104%; letter-spacing: -0.008em; }
.label__word { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tape {
  position: absolute;
  inset: 4px 0;
  border-radius: 10px;
  overflow: hidden;
  background: #f6c84a;
  box-shadow: inset 0 0 0 1px rgba(26, 23, 18, 0.14), inset 0 2px 3px rgba(26, 23, 18, 0.12);
  -webkit-mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  opacity: 0;
  visibility: hidden;
}
.tape__strip { position: absolute; left: 50%; top: 0; bottom: 0; display: flex; align-items: stretch; }
.tape__cm { position: relative; flex: none; width: 34px; }
/* every centimetre: a long tick with its number, and a short tick halfway */
.tape__cm::before { content: ""; position: absolute; left: 0; top: 0; width: 1.5px; height: 12px; background: #1a1712; }
.tape__cm::after { content: ""; position: absolute; left: 17px; top: 0; width: 1.5px; height: 7px; background: rgba(26, 23, 18, 0.6); }
.tape__cm b { position: absolute; left: 0; bottom: 3px; transform: translateX(-50%); font-size: 11.5px; line-height: 13px; font-weight: 680; }
.tape__needle { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); box-shadow: 0 0 0 1px rgba(255, 250, 240, 0.7); }

/* ---- the letter of the size ---- */
.chip {
  flex: none;
  width: 0;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 4px 10px -3px color-mix(in srgb, var(--accent) 70%, transparent);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #ffffff;
  font-size: 18px;
  font-weight: 740;
  font-stretch: 110%;
  opacity: 0;
  visibility: hidden;
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #ffffff;
  stroke: #101116;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}
