/* The wine glass rating: a question, five wine glasses and a word, on a white page. The glass is clear with a cool
   grey edge, the wine a deep Nebbiolo red, darker at the bottom of the bowl and lighter on its surface; the sparks of
   the toast are gold. */
:root {
  --page: #ffffff;          /* the page */
  --ink: #241419;           /* the question, the word */
  --muted: #8e8287;         /* the thanks, the hint before a pick */
  --glass: #a9b4be;         /* the glass's edge */
  --glass-tint: #e6edf2;    /* the glass's body, at its sides */
  --shine: #ffffff;         /* the light on the glass, over the wine */
  --wine: #8e1b3a;          /* the wine near its surface */
  --wine-deep: #4c0b1f;     /* the wine at the bottom of the bowl */
  --wine-top: #b0405c;      /* the wine's surface, seen from a little above */
  --spark: #c99a3e;         /* the sparks of the clink */
  --shadow: #ebe7e9;        /* the glasses' shadows on the table */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

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

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

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

.taste__ask {
  margin: 0 0 22px;
  font-size: clamp(24px, 6.6vw, 28px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* ---------------------------------------------------------------- the glasses */
.taste__row {
  position: relative;
  width: min(360px, 100%);
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
  touch-action: pan-y;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

.taste__stop-wine {
  stop-color: var(--wine);
}

.taste__stop-deep {
  stop-color: var(--wine-deep);
}

.taste__stop-tint {
  stop-color: var(--glass-tint);
}

.taste__stop-clear {
  stop-color: var(--page);
  stop-opacity: 0.4;
}

.taste__shadow {
  fill: var(--shadow);
}

.taste__body {
  fill: url(#taste-tint);
  opacity: 0.85;
}

.taste__edge,
.taste__rim,
.taste__rim-back {
  fill: none;
  stroke: var(--glass);
  stroke-linejoin: round;
  stroke-linecap: round;
}

.taste__rim-back {
  opacity: 0.55;
}

.taste__stem {
  fill: var(--glass-tint);
  stroke: var(--glass);
  stroke-linejoin: round;
}

.taste__liquid {
  fill: url(#taste-wine);
}

.taste__surface {
  fill: var(--wine-top);
}

.taste__meniscus {
  fill: none;
  stroke: var(--wine-top);
  stroke-linecap: round;
  opacity: 0.8;
}

.taste__shine {
  fill: none;
  stroke: var(--shine);
  stroke-linecap: round;
}

.taste__drop {
  fill: var(--wine);
}

.taste__spark {
  stroke: var(--spark);
  stroke-linecap: round;
  fill: none;
}

/* the real choices: five radio buttons lying over the glasses, see-through. The hand works on the glasses, the
   keyboard and screen readers on the radio buttons */
.taste__choices {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--n, 5), 1fr);
  pointer-events: none;
}

.taste__choices label {
  position: relative;
}

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

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

/* ---------------------------------------------------------------- the word and the thanks */
.taste__word {
  height: 34px;
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 34px;
  font-style: italic;
}

.taste__word span {
  display: inline-block;
  font-weight: 500;
}

.taste__word .is-idle {
  color: var(--muted);
  font-size: 22px;
  font-weight: 500;
}

.taste__thanks {
  min-height: 22px;
  margin: 4px 0 0;
  font-size: 18px;
  line-height: 22px;
  font-weight: 500;
  color: var(--muted);
}
