/* ── FAQ frames ────────────────────────────────────────────
   each question its own frame, all with the same corner; while one
   is open the others step back */
.fqf {
  display: flex;
  flex-direction: column;
  /* Bencho tokens mapped directly to VLYNH's existing dark-section tokens:
     --font-ui → --jp; --fill-on → --paper; --fill-slab → --deep;
     --ink remains the project's --ink fallback; --signal → --orange.
     No new global aliases or RGB tokens are introduced. */
  font-family: var(--jp);
  color: var(--paper, var(--ink));
  --fqf-frame: var(--deep);
  --fqf-soft: color-mix(in srgb, var(--paper) 72%, var(--deep));
  --fqf-mute: color-mix(in srgb, var(--paper) 52%, var(--deep));
  --fqf-disc: color-mix(in srgb, var(--paper) 6%, var(--deep));
  --fqf-ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* a touch past the mark and back */
  --fqf-give: cubic-bezier(0.34, 1.18, 0.64, 1);
}

.fqf-item {
  background: var(--fqf-frame);
  border-radius: 14px;
  transition: background-color 320ms var(--fqf-ease), color 320ms var(--fqf-ease);
}

/* while one is open the others step back: their frames thin out
   toward the ground and their questions go quiet, so the open one
   is the only solid frame in the stack */
.fqf[data-dim]:has(.fqf-item[data-open]) .fqf-item:not([data-open]) {
  background: color-mix(in srgb, var(--fqf-frame) 50%, transparent);
  color: var(--fqf-soft);
}

/* pointing at one brings its question back to full ink */
.fqf[data-dim]:has(.fqf-item[data-open]) .fqf-item:not([data-open]):hover { color: var(--paper, var(--ink)); }

.fqf-item + .fqf-item { margin-top: 4px; }

.fqf-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  height: 56px;
  padding: 0 14px 0 20px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-align: left;
  cursor: pointer;
}

.fqf-q > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fqf-q:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--orange); border-radius: inherit; }

/* the chevron sits bare, with no disc behind it; under the pointer it
   goes to full ink. Open, it flips */
.fqf-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: transparent;
  color: var(--fqf-mute);
  transition: background-color 220ms var(--fqf-ease), color 220ms var(--fqf-ease), scale 220ms var(--fqf-ease);
}

.fqf-mark svg { transition: rotate 480ms var(--fqf-give); }
.fqf-mark:hover { color: var(--paper, var(--ink)); }
.fqf-q:active .fqf-mark { scale: 0.9; }
.fqf-item[data-open] .fqf-mark { color: var(--paper, var(--ink)); }
.fqf-item[data-open] .fqf-mark svg { rotate: 180deg; }

.fqf-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 480ms var(--fqf-give);
}
.fqf-item[data-open] .fqf-a { grid-template-rows: 1fr; }

/* the frame's HEIGHT bounces as it opens: it runs a few pixels past
   the answer and settles back. The row's own overshoot cannot show —
   1fr is a ceiling — so the extra is a little padding under the
   answer that comes and goes while the row opens. Nothing scales */
.fqf-item[data-open] .fqf-a > div { animation: fqf-give 620ms ease-in-out; }
.fqf-a > div { min-height: 0; overflow: hidden; }

.fqf-a p {
  margin: 0;
  padding: 0 40px 18px 20px;
  font-size: 13px;
  line-height: 20px;
  color: var(--fqf-soft);
  opacity: 0;
  translate: 0 -4px;
  transition: opacity 160ms ease, translate 160ms ease;
}

.fqf-item[data-open] .fqf-a p {
  opacity: 1;
  translate: 0 0;
  transition: opacity 300ms var(--fqf-ease) 120ms, translate 420ms var(--fqf-ease) 120ms;
}

@media (prefers-reduced-motion: reduce) {
  .fqf-item, .fqf-a, .fqf-a > div, .fqf-mark, .fqf-mark svg, .fqf-a p { transition: none; translate: none; animation: none; }
}

@keyframes fqf-give {
  0% { padding-bottom: 0; }
  55% { padding-bottom: var(--fqf-bounce, 7px); }
  100% { padding-bottom: 0; }
}

/* Project adaptation: retain the wall's longest-answer reserve without fixed
   pixel heights or JS measurement, including wrapped Japanese questions. The
   reserve also leaves room for the tiny padding bounce described above. */
.fqf { display: grid; min-width: 0; }
.fqf-stack, .fqf-reserve { grid-area: 1 / 1; min-width: 0; }
.fqf-stack { align-self: start; }
.fqf-reserve { visibility: hidden; pointer-events: none; padding-bottom: var(--fqf-bounce, 3px); }
.fqf-reserve-questions > .fqf-q + .fqf-q { margin-top: 4px; }
.fqf-reserve-answers { display: grid; }
.fqf-reserve-answers p { grid-area: 1 / 1; margin: 0; padding: 0 40px 18px 20px; font-size: 13px; line-height: 20px; }
.fqf-q { height: auto; min-height: 56px; padding-top: 14px; padding-bottom: 14px; line-height: 1.7; }
.fqf-q > span { white-space: normal; overflow: visible; text-overflow: clip; }
.fqf-item { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--paper) 10%, transparent); }
#business-faq-root { margin-bottom: 30px; }
#business-faq-root > .accordions { margin-bottom: 0; }
html.motion-reduced .fqf-item,
html.motion-reduced .fqf-a,
html.motion-reduced .fqf-a > div,
html.motion-reduced .fqf-mark,
html.motion-reduced .fqf-mark svg,
html.motion-reduced .fqf-a p { transition: none; translate: none; animation: none; }
