/* ═══════════════════════════════════════════════
   PLASTIC QUIZ — one question, between the
   comparison table and the waitlist CTA.

   Built entirely by js/plastic-quiz.js, so every
   selector here styles markup the HTML does not
   contain.

   ── THE COLOUR IS THE ARGUMENT ──
   The track is the one place on this site that leaves
   the palette on purpose. It runs clear green → amber →
   alarm red, because it is not decoration: it is a
   warning gauge, and the reader has to feel the top of
   it. An earlier version stayed inside the brand
   (--sage to --wine) and the result was that 90% looked
   like every other heading on the page.

   The card around it stays in the palette. Only the
   gauge shouts.
   ═══════════════════════════════════════════════ */

.pquiz{
  position:relative; z-index:2;
  max-width:620px; margin:0 auto;
  padding:clamp(56px,9vw,104px) 24px clamp(48px,8vw,88px);
  text-align:center;
}

/* ── the frame ──
   Without this the quiz is just centred text on the same cream ground as the
   waitlist band right after it, and the two run together as one continuous
   block. Framed and lifted off the page — the same card language as the
   popup and the waitlist modal — it reads as its own thing: something to
   play with, not more copy to skim past. */
.pquiz__card{
  padding:clamp(40px,6vw,56px) clamp(24px,5vw,48px) clamp(36px,5vw,44px);
  background:linear-gradient(165deg, rgba(255,255,255,.85), rgba(226,178,170,.24)), var(--cream);
  border:1px solid rgba(136,1,42,.12);
  border-radius:24px;
  box-shadow:0 22px 50px rgba(43,28,30,.10);
}

.pquiz__eyebrow{
  margin:0 0 10px; font:600 11px/1 var(--sans);
  letter-spacing:.26em; text-transform:uppercase; color:var(--wine);
}
.pquiz__title{
  margin:0 0 12px; font-family:var(--serif); font-style:italic; font-weight:400;
  font-size:clamp(26px,4.6vw,38px); color:var(--wine); line-height:1.18;
}
.pquiz__sub{
  margin:0 auto 34px; max-width:46ch;
  color:var(--ink-soft); font:400 14px/1.7 var(--sans);
}

/* ── the readout ──
   Tabular figures so the number does not jitter sideways while dragging:
   without them 11% and 88% are different widths and the whole line twitches. */
.pquiz__value{
  font-family:var(--serif); font-weight:400;
  font-size:clamp(46px,9vw,72px); line-height:1;
  font-variant-numeric:tabular-nums;
  color:var(--pq-c, #1f9d55);
  transition:color .12s linear;
  margin-bottom:18px;
}

.pquiz__control{margin:0 auto; max-width:440px}

/* The filled part carries the same colour as the readout, so the bar itself
   gets redder as the guess climbs — the point of the whole thing.

   The unfilled part is faded with an alpha-blended gradient, NOT with
   `opacity` on the track: the fill is a child, so a parent opacity would drag
   the filled half down with it and the colour — the entire point of this
   control — would never reach full strength. */
.pquiz__track{
  position:relative; height:10px; border-radius:99px; overflow:hidden;
  background:linear-gradient(90deg,
    rgba(31,157,85,.22), rgba(216,162,28,.22) 34%,
    rgba(232,84,31,.22) 68%, rgba(208,15,39,.22));
}
.pquiz__fill{
  position:absolute; inset:0 auto 0 0; border-radius:99px;
  /* sized to the whole track, then clipped by width, so the gradient keeps its
     full 0–100 scale instead of being squeezed into the filled portion */
  background:linear-gradient(90deg,
    #1f9d55, #d8a21c 34%, #e8541f 68%, #d00f27);
  background-size:var(--pq-track, 440px) 100%;
  background-repeat:no-repeat;
  width:var(--pq-p, 50%);
}
.pquiz__rail{position:relative; padding:14px 0}

/* The native input sits on top, invisible, and does the actual work: keyboard,
   touch, screen readers and every browser's own drag behaviour come free. */
.pquiz__slider{
  position:absolute; inset:0; width:100%; height:100%;
  margin:0; padding:0; appearance:none; -webkit-appearance:none;
  background:none; cursor:grab; z-index:2;
}
.pquiz__slider:active{cursor:grabbing}
.pquiz__slider::-webkit-slider-thumb{
  -webkit-appearance:none; width:30px; height:30px; border-radius:50%;
  background:var(--cream); border:2.5px solid var(--pq-c, #1f9d55);
  box-shadow:0 3px 12px rgba(43,28,30,.22);
  cursor:grab; transition:border-color .12s linear, transform .18s var(--ease);
}
.pquiz__slider::-moz-range-thumb{
  width:30px; height:30px; border-radius:50%; box-sizing:border-box;
  background:var(--cream); border:2.5px solid var(--pq-c, #1f9d55);
  box-shadow:0 3px 12px rgba(43,28,30,.22);
  cursor:grab; transition:border-color .12s linear, transform .18s var(--ease);
}
.pquiz__slider:hover::-webkit-slider-thumb{transform:scale(1.08)}
.pquiz__slider:hover::-moz-range-thumb{transform:scale(1.08)}
.pquiz__slider:focus-visible::-webkit-slider-thumb{
  outline:2px solid var(--wine); outline-offset:3px;
}
.pquiz__slider:focus-visible::-moz-range-thumb{
  outline:2px solid var(--wine); outline-offset:3px;
}
.pquiz__slider:disabled{cursor:default}
.pquiz__slider:disabled::-webkit-slider-thumb{cursor:default; transform:none}
.pquiz__slider:disabled::-moz-range-thumb{cursor:default; transform:none}

.pquiz__scale{
  display:flex; justify-content:space-between; margin-top:6px;
  font:500 11px/1 var(--sans); color:var(--ink-soft); opacity:.75;
}

.pquiz__go{
  appearance:none; cursor:pointer;
  margin-top:26px; min-height:44px; padding:0 30px;
  background:var(--wine); color:var(--cream);
  border:1.5px solid var(--wine); border-radius:99px;
  font:600 11px/1 var(--sans); letter-spacing:.14em; text-transform:uppercase;
  transition:background .25s var(--ease), border-color .25s var(--ease),
             transform .18s var(--ease);
}
.pquiz__go:hover{background:var(--wine-soft); border-color:var(--wine-soft)}
.pquiz__go:active{transform:translateY(1px)}
.pquiz__go:focus-visible{outline:2px solid var(--wine); outline-offset:3px}

/* answered — the guess stays on screen, quieter, and the button only reopens */
.pquiz.is-done .pquiz__go{
  background:transparent; color:var(--wine); border-color:rgba(136,1,42,.4);
}
.pquiz.is-done .pquiz__go:hover{background:rgba(136,1,42,.06); border-color:var(--wine)}

/* ══ the answer ══ */
.pq__scrim{
  position:fixed; inset:0; z-index:9060;
  background:rgba(43,28,30,.42);
  backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px);
  opacity:0; pointer-events:none;
  transition:opacity .35s var(--ease);
}
.pq__scrim.is-on{opacity:1; pointer-events:auto}

/* Deliberately wider than the scratch card (400px): this one carries a number
   that is meant to land, and a cramped box undercuts it. */
.pq{
  position:fixed; z-index:9210;
  top:50%; left:50%;
  width:min(540px, calc(100vw - 32px));
  max-height:calc(100vh - 32px); overflow-y:auto;
  box-sizing:border-box;
  padding:44px 40px 38px;
  background:linear-gradient(165deg, rgba(255,255,255,.94), rgba(226,178,170,.34)), var(--cream);
  border:1px solid rgba(136,1,42,.10); border-radius:22px;
  box-shadow:0 34px 80px rgba(43,28,30,.32);
  text-align:center;
  opacity:0; pointer-events:none;
  transform:translate(-50%,-50%) translateY(20px) scale(.96);
  visibility:hidden;
  /* closed = invisible AND out of the tab order / screen reader; visibility
     switches at the end of the fade out and the start of the fade in */
  transition:opacity .3s var(--ease), transform .5s var(--ease), visibility .3s;
}
.pq.is-on{opacity:1; pointer-events:auto; visibility:visible; transform:translate(-50%,-50%)}

.pq__x{
  position:absolute; top:16px; right:16px;
  width:32px; height:32px; display:grid; place-items:center;
  appearance:none; border:0; background:none; cursor:pointer;
  color:var(--ink-soft); font-size:19px; line-height:1;
  border-radius:50%; transition:background .25s, color .25s;
}
.pq__x:hover{background:rgba(136,1,42,.08); color:var(--wine)}
.pq__x:focus-visible{outline:2px solid var(--wine); outline-offset:2px}

.pq__eyebrow{
  margin:0 0 10px; font:600 11px/1 var(--sans);
  letter-spacing:.26em; text-transform:uppercase; color:var(--wine);
}
.pq__title{
  margin:0 0 20px; font-family:var(--serif); font-style:italic; font-weight:400;
  font-size:clamp(28px,5.4vw,40px); color:var(--wine); line-height:1.15;
}

/* ── the number ──
   The whole section exists to put this in front of someone, so it is the
   largest type on the page. */
.pq__big{
  display:block; margin:0 0 4px;
  font-family:var(--serif); font-weight:400; font-style:normal;
  font-size:clamp(76px,17vw,124px); line-height:.92;
  /* the alarm end of the gauge, not --wine: 90% is where the slider screams,
     and the number that reveals it should be the same colour it landed on */
  color:#d00f27; font-variant-numeric:tabular-nums;
}
.pq__biglabel{
  display:block; margin:0 0 24px;
  font:600 11px/1 var(--sans); letter-spacing:.26em; text-transform:uppercase;
  color:#d00f27; opacity:.7;
}

.pq__body{
  margin:0 auto 14px; max-width:40ch;
  color:var(--ink); font:400 15px/1.65 var(--sans);
}
.pq__body strong{color:var(--wine); font-weight:700}

.pq__note{
  margin:0 auto 26px; max-width:38ch;
  color:var(--ink-soft); font:400 13.5px/1.6 var(--sans); font-style:italic;
}

.pq__turn{
  margin:0 auto 22px; max-width:40ch; padding-top:22px;
  border-top:1px solid rgba(136,1,42,.14);
  color:var(--ink); font:500 14px/1.6 var(--sans);
}

.pq__cta{
  appearance:none; cursor:pointer;
  min-height:44px; padding:0 28px;
  background:var(--wine); color:var(--cream);
  border:1.5px solid var(--wine); border-radius:99px;
  font:600 11px/1 var(--sans); letter-spacing:.14em; text-transform:uppercase;
  transition:background .25s var(--ease), border-color .25s var(--ease);
}
.pq__cta:hover{background:var(--wine-soft); border-color:var(--wine-soft)}
.pq__cta:focus-visible{outline:2px solid var(--wine); outline-offset:3px}

@media (max-width:480px){
  .pq{padding:38px 24px 30px}
  .pquiz{padding-top:48px}
}

@media (prefers-reduced-motion:reduce){
  .pq, .pq__scrim, .pquiz__value, .pquiz__slider::-webkit-slider-thumb{transition:none}
}
