/* The colour picker: a ceramic mug on a white page, six colour swatches under it and the colour's name. */
:root {
  --page: #ffffff;          /* the page */
  --ink: #1c1c20;           /* text, the ring */
  --muted: #85858d;
  --steam: #d6d6dc;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Outfit Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.pick {
  display: grid;
  justify-items: center;
  width: min(380px, 100%);
  margin: 0;
  text-align: center;
}

/* ---------------------------------------------------------------- the mug */
.pick__mug {
  width: min(280px, 78vw);
  height: auto;
  overflow: visible;
}

.pick__shadow {
  fill: rgba(28, 28, 32, 0.16);
}

.pick__steam path {
  fill: none;
  stroke: var(--steam);
  stroke-width: 3.2;
  stroke-linecap: round;
}

.pick__coffee {
  fill: #4a2f22;
}

.pick__lip {
  fill: none;
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 1.6;
}

/* ---------------------------------------------------------------- the swatches */
.pick__swatches {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.pick__legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.swatch {
  position: relative;
  display: block;
  width: 42px;
  height: 42px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.swatch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.swatch span {
  position: absolute;
  inset: 4px;
  border-radius: 11px;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  pointer-events: none;
}

/* the ring round the colour chosen: one, sliding from swatch to swatch */
.pick__ring {
  position: absolute;
  left: 0;
  top: 0;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  box-shadow: inset 0 0 0 2px var(--ink);
  pointer-events: none;
}

.swatch input:focus-visible ~ span {
  outline: 2px solid var(--ink);
  outline-offset: 6px;
}

/* ---------------------------------------------------------------- the name */
.pick__name {
  height: 30px;
  margin: 18px 0 0;
  overflow: hidden;
  font-size: 22px;
  font-weight: 620;
  line-height: 30px;
  letter-spacing: -0.01em;
}

.pick__name span {
  display: block;
}

.pick__note {
  min-height: 22px;
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--muted);
}
