/* Active questions: a dark field, flat where it meets the introduction and cut
   on a falling slant at its foot (a clipped layer, with the next section's
   paper showing through under the slant). */
.questions {
  --q-pad: clamp(96px, 14svh, 160px);
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
  padding: var(--q-pad) var(--gutter) calc(var(--q-pad) + var(--slant));
  background: var(--paper);
  color: var(--on-dark);
}

.questions::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 70% at 70% 48%, rgba(7, 92, 89, 0.34) 0%, transparent 70%),
    linear-gradient(180deg, var(--deep) 0%, var(--night) 100%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - var(--slant)));
}

.questions__copy {
  position: relative;
  z-index: 2;
  grid-column: 1 / span 4;
  align-self: center;
}

.questions__copy .title {
  color: var(--on-dark);
}

.questions__copy .prose {
  margin-top: clamp(34px, 5.4svh, 56px);
  max-width: 27em;
  color: var(--on-dark-soft);
}

/* -- The scene. js/questions.js draws the helix and reports the focal point
   as --fx/--fy, where the focal dot sits. -- */
.questions__scene {
  --fx: 40px;
  --fy: 50%;
  position: relative;
  grid-column: 5 / span 8;
  height: clamp(600px, 78svh, 780px);
}

.questions__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* The focal dot; it flares as a question arrives. */
.questions__dot {
  position: absolute;
  left: calc(var(--fx) - 6px);
  top: calc(var(--fy) - 6px);
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 7px rgba(232, 164, 60, 0.14), 0 0 24px rgba(232, 164, 60, 0.4);
}

.questions__scene.is-arriving .questions__dot {
  animation: questions-land 900ms var(--ease);
}

@keyframes questions-land {
  0% { box-shadow: 0 0 0 0 rgba(232, 164, 60, 0.55), 0 0 40px rgba(232, 164, 60, 0.8); }
  100% { box-shadow: 0 0 0 7px rgba(232, 164, 60, 0.14), 0 0 24px rgba(232, 164, 60, 0.4); }
}

/* Without the script (or before the list loads), the questions read as a list. */
.questions:not(.has-scene) .questions__scene {
  height: auto;
}

.questions:not(.has-scene) :is(.questions__canvas, .questions__dot) {
  display: none;
}

.questions__list {
  position: relative;
  z-index: 2;
  padding: 0;
  list-style: none;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--on-dark-soft);
  columns: 2;
  column-gap: 40px;
}

.questions__list:empty {
  display: none;
}

.questions__list li {
  break-inside: avoid;
  padding: 8px 0;
  border-top: 1px solid var(--rule-dark);
}

.questions.has-scene .questions__list {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Portrait tablets and phones: the copy at full measure, then the helix
   across the width under it (js/questions.js sets narrower question lines
   below 600px of scene). */
@media (max-width: 900px) {
  .questions {
    display: block;
    padding: clamp(64px, 10svh, 96px) var(--gutter) calc(40px + var(--slant));
  }

  .questions__copy .prose {
    max-width: 34em;
  }

  .questions__scene {
    height: clamp(480px, 128vw, 660px);
    margin-top: 24px;
  }

  .questions__list {
    columns: 1;
  }
}
