/* The star rating: a question, five stars and a word, on a white page. The stars are a warm gold; empty, a pale
   outline. */
:root {
  --page: #ffffff;          /* the page */
  --ink: #1d1a16;           /* the question, the word */
  --muted: #8d877e;
  --empty: #e6e1d8;         /* an empty star */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

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

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

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

.rate__ask {
  margin: 0 0 22px;
  font-size: clamp(26px, 7.5vw, 34px);
  font-weight: 560;
  font-variation-settings: 'opsz' 72, 'SOFT' 60;
  letter-spacing: -0.02em;
}

/* ---------------------------------------------------------------- the stars */
.rate__stars {
  position: relative;
  width: min(308px, 100%);
  margin: 0;
  padding: 0;
  border: 0;
  touch-action: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.rate__art {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.rate__empty path {
  fill: var(--page);
  stroke: var(--empty);
  stroke-width: 2.4;
  stroke-linejoin: round;
}

.rate__full path {
  fill: url(#gold);
}

.rate__glint {
  fill: rgba(255, 255, 255, 0.6);
}

/* the real choices: five radio buttons lying over the stars, see-through */
.rate__choices {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.rate__choices label {
  position: relative;
  cursor: pointer;
}

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

/* the keyboard's ring: round the star */
.rate__choices input:focus-visible + span {
  position: absolute;
  inset: -6px 2px;
  border-radius: 14px;
  box-shadow: 0 0 0 2px var(--ink);
}

/* ---------------------------------------------------------------- the word and the thanks */
.rate__word {
  height: 30px;
  margin: 18px 0 0;
  overflow: hidden;
  font-size: 22px;
  font-weight: 600;
  font-variation-settings: 'opsz' 40;
  line-height: 30px;
}

.rate__word span {
  display: block;
}

.rate__word .is-idle {
  font-weight: 450;
  color: var(--muted);
  font-style: italic;
}

.rate__thanks {
  min-height: 22px;
  margin: 8px 0 0;
  font-size: 16px;
  color: var(--muted);
}
