/* ==========================================================================
   LEAK HUNTER · SITE A · css/fig-questions.css — figure "questions" (#questions)
   The back third's full-bleed media moment: a perspective slot floor (canvas,
   js/fig-questions.js) streams toward the viewer; the open questions float
   over it. Every rule is scoped under #questions.
   Layout contract with the JS: the title's foot sits at ~33% of the stage and
   the canvas puts its horizon just under it (measured, so it holds at any width).
   ========================================================================== */

#questions {
  --q-h: clamp(640px, 92vh, 980px);      /* stage height on ≥768 px */
  --q-sky: .33;                           /* share of the stage above the title's foot */
  --q-chip: var(--s1);
  --q-chip-q: var(--s2);
  --q-chip-hov: color-mix(in srgb, var(--lime) 7%, var(--s1));  /* chip hover: a breath of the accent in the surface */
  --q-mid: var(--ink);                    /* the stage's slightly lifted middle */
  --q-hi-rgb: var(--text-rgb);            /* bright type: title, questions, hover */
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column;
  min-height: var(--q-h);
  padding: 0; text-align: center;
  /* no-canvas fallback: the same horizon light, flat */
  background:
    radial-gradient(64% 20% at 50% 36%, rgb(var(--lime-rgb) / .05), transparent 72%),
    linear-gradient(180deg, var(--bg) 0%, var(--q-mid) 40%, var(--bg) 100%);
}

/* canvas from LH.util.canvas(root): behind the content, fading into the neighbours */
#questions > .q-floor {
  z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 13%, #000 84%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 13%, #000 84%, transparent 100%);
}

#questions > .q__in {
  position: relative; z-index: 1; flex: 1 0 auto;
  display: flex; flex-direction: column; align-items: center;
  padding-bottom: clamp(96px, 15vh, 170px);  /* the near floor stays in view */
}

/* ---------- head: kicker + title, sitting on the horizon -------------------- */
#questions .q__head {
  width: 100%; min-height: calc(var(--q-h) * var(--q-sky));
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding-top: clamp(88px, 11vh, 140px);
}
#questions .q__kicker {
  font: 600 13px/1.3 var(--f-ui); letter-spacing: 0; color: var(--lime);
  font-variant-numeric: tabular-nums;
}
#questions .q__kw { display: inline-block; white-space: nowrap; }
#questions .q__kc { display: inline-block; }
#questions .q__title {
  margin: 14px 0 0; max-width: none;     /* one line on ≥768 px: a title on the horizon */
  font: 700 clamp(40px, 4.6vw, 88px)/.94 var(--f-display); letter-spacing: -0.04em;
  text-transform: uppercase; color: rgb(var(--q-hi-rgb)); text-wrap: balance;
  text-shadow: 0 0 60px rgb(var(--lime-rgb) / .07);
}
/* SplitText line masks (inline overflow: clip): pad them so the Q's tail isn't cut */
#questions .q__title > [class*="-mask"] { padding-bottom: .12em; margin-bottom: -.12em; }

/* ---------- the cloud ------------------------------------------------------- */
#questions .cloud-wrap {
  position: relative; width: 100%; max-width: 1060px;
  margin-top: clamp(40px, 6.4vh, 80px);
}
#questions .cloud-wrap::before {         /* radial scrim between the floor and the chips */
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: -14%; right: -14%; top: -30%; bottom: -34%;
  background: radial-gradient(closest-side, rgb(var(--bg-rgb) / .55) 0%, rgb(var(--bg-rgb) / .55) 52%, rgb(var(--bg-rgb) / 0) 100%);
}
#questions .cloud {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 10px;
}
#questions .cloud > li { display: flex; }

#questions .chip {
  --flash: 0;
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 11px 18px; border-radius: 12px;
  background: var(--q-chip);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09), 0 18px 34px -18px rgba(0, 0, 0, .9);
  font: 500 15px/1.3 var(--f-ui); color: rgb(var(--text-rgb) / .78);
  text-decoration: none; text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: color .3s ease, background-color .3s ease;
}
#questions .chip--q {
  min-height: 54px; padding: 12px 22px 12px 12px; gap: 12px;
  background: var(--q-chip-q);
  font-size: 17px; font-weight: 600; color: rgb(var(--q-hi-rgb)); letter-spacing: -0.006em;
}
#questions .chip__no {
  flex: none; display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 7px; border-radius: 7px;
  background: rgb(var(--lime-rgb) / .12); box-shadow: inset 0 0 0 1px rgb(var(--lime-rgb) / .2);
  font: 700 12px/1 var(--f-ui); letter-spacing: .01em; color: var(--lime); font-variant-numeric: tabular-nums;
  transition: background-color .3s ease, color .3s ease;
}
#questions .chip__t { min-width: 0; text-wrap: balance; }
#questions .chip::before {               /* accent ring: the scan flash, then hover/focus */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--lime), 0 0 0 4px rgb(var(--lime-rgb) / .08), 0 0 32px rgb(var(--lime-rgb) / .26);
  opacity: var(--flash); transition: opacity .35s ease;
}
/* "Open" status: hangs off the top-right corner, never takes layout space */
#questions .chip__status {
  position: absolute; top: -8px; right: -8px; z-index: 2;
  display: none; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px;
  background: var(--lime); color: var(--ink);
  font: 700 11px/1 var(--f-display); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
  box-shadow: 0 6px 16px -4px rgb(var(--lime-rgb) / .5);
  pointer-events: none;
}
#questions .chip:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; border-radius: 12px; }
#questions .chip:focus-visible::before { opacity: 1; }
#questions .chip:focus-visible .chip__no { background: var(--lime); color: var(--ink); }

@media (hover: hover) and (pointer: fine) {
  #questions .chip__status {
    display: inline-flex; opacity: 0; transform: scale(.55) translateY(3px); transform-origin: 100% 100%;
    transition: opacity .22s ease, transform .5s var(--ease-back);
  }
  #questions .chip:hover { color: rgb(var(--q-hi-rgb)); background-color: var(--q-chip-hov); }
  #questions .chip:hover::before { opacity: 1; }
  #questions .chip:hover .chip__no { background: var(--lime); color: var(--ink); }
  #questions .chip:hover .chip__status,
  #questions .chip:focus-visible .chip__status { opacity: 1; transform: none; }
}

/* accent scan that lights the chips on entry (≥768 px only) */
#questions .cloud__scan {
  position: absolute; top: -22px; bottom: -22px; left: 0; width: 2px; margin-left: -1px; z-index: 3;
  pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, transparent, var(--lime) 18%, var(--lime) 82%, transparent);
  box-shadow: 0 0 18px 2px rgb(var(--lime-rgb) / .5);
}
#questions .cloud__scan::after {         /* soft wash trailing the line */
  content: ""; position: absolute; top: 10%; bottom: 10%; right: 2px; width: 140px;
  background: linear-gradient(90deg, rgb(var(--lime-rgb) / 0), rgb(var(--lime-rgb) / .07));
}

#questions .q__foot {
  position: relative; isolation: isolate;
  margin-top: clamp(24px, 3.4vh, 38px);
  display: inline-flex; align-items: center; gap: 10px;
  font: 400 14px/1.45 var(--f-ui); color: rgb(var(--q-hi-rgb) / .7);
}
#questions .q__foot::after {             /* local scrim: floor lines pass behind the line, never through it */
  content: ""; position: absolute; z-index: -1; inset: -16px -56px; pointer-events: none;
  background: radial-gradient(closest-side, rgb(var(--bg-rgb) / .92), rgb(var(--bg-rgb) / .7) 55%, rgb(var(--bg-rgb) / 0));
}
#questions .q__foot::before {            /* an open ring: nothing has flown yet */
  content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--lime), 0 0 10px rgb(var(--lime-rgb) / .35);
}

/* ---------- tablet: a touch tighter so the questions pair up instead of stranding one ---- */
@media (min-width: 768px) and (max-width: 899px) {
  #questions .cloud-wrap { max-width: 744px; }
  #questions .cloud { gap: 10px 8px; }
  #questions .chip { min-height: 44px; padding: 10px 12px; font-size: 13px; }
  #questions .chip--q { min-height: 50px; padding: 11px 16px 11px 11px; gap: 10px; font-size: 15px; }
}

/* ---------- phones: auto height, a stack of questions, then a 2×2 of extras ---- */
@media (max-width: 767px) {
  #questions { min-height: 0; }
  #questions .q__head { min-height: 0; padding-top: 92px; }
  #questions .q__title { max-width: 12ch; }
  #questions .cloud-wrap { margin-top: 40px; }
  #questions .cloud-wrap::before { left: -10%; right: -10%; top: -10%; bottom: -12%; }
  #questions .cloud { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  #questions .cloud > li { min-width: 0; }
  #questions .cloud > li:nth-child(-n + 5) { grid-column: 1 / -1; }
  #questions .chip { flex: 1 1 auto; min-height: 48px; padding: 10px 14px; font-size: 14px; }
  #questions .chip--q { min-height: 52px; padding: 10px 14px 10px 10px; gap: 10px; font-size: 15px; }
  #questions .chip__no { min-width: 28px; height: 24px; }
  #questions .cloud__scan { display: none; }
  #questions > .q__in { padding-bottom: 112px; }
  #questions .q__foot { margin-top: 26px; }
}
