/* Interference: split, turn, recombine (/tools/interference/). Page-scoped; builds on the shared .demo card in site.css.
   The card is always dark (both themes), so colours are fixed here rather than taken from the light/dark tokens:
   0 = violet #A78BFA (5.4:1 on the card), 1 = cyan #22D3EE (8.2:1), sums = band text #F5F3FF at 55% opacity (5.1:1),
   the size-1 guide ring white at 40% (3.6:1). */
.ifx { --ifx-zero: #A78BFA; --ifx-one: #22D3EE; --ifx-sum: #F5F3FF; --ifx-guide: rgba(255,255,255,0.4); }
.article .ifx figure { margin: 0; background: none; border-radius: 0; padding: 0; }   /* the card is not an article figure */
.ifx .ifx-setup { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ifx .ifx-strip { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 4px; align-items: center; font-family: var(--f-display); font-size: 0.88rem; color: var(--band-fg); }
.ifx .ifx-strip li { display: flex; align-items: center; gap: 4px; }
.ifx .ifx-strip li + li::before { content: "\2192"; color: var(--band-muted); padding: 0 4px; }
.ifx .ifx-step { border: 1px solid rgba(255,255,255,0.28); border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
.ifx .ifx-caption { margin: 0; }
.ifx .ifx-guide, .ifx .ifx-controls, .ifx .ifx-contrib, .ifx .ifx-pred, .ifx .ifx-obs { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.12); }
.ifx .ifx-stepn { margin: 0; }
.ifx .ifx-stepn:focus { outline: none; }
.ifx .ifx-stepn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ifx .ifx-answers { border: 1px solid rgba(255,255,255,0.18); border-radius: 12px; padding: 10px 14px 12px; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ifx .ifx-answers legend { font-family: var(--f-display); font-size: 0.9rem; color: var(--band-fg); padding: 0 6px; }
.ifx .ifx-answers label, .ifx .ifx-check { display: flex; gap: 10px; align-items: flex-start; font-family: var(--f-display); font-size: 0.92rem; color: var(--band-fg); margin: 0; padding: 8px 0; min-height: 44px; cursor: pointer; }
.ifx .ifx-answers b { font-weight: 500; color: var(--band-muted); margin-right: 4px; }
.ifx input[type=radio], .ifx input[type=checkbox] { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--ifx-one); }
.ifx input:disabled + span { opacity: 0.7; }
.ifx .ifx-fb p { margin: 0; }
.ifx .ifx-fb:focus { outline: none; }
.ifx .ifx-fb:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 6px; }
.ifx .ifx-fb:not(:empty) + .btn-row { margin-top: 2px; }
.ifx .ifx-feedback { font-family: var(--f-body); font-size: 1rem; line-height: 1.5; color: var(--band-fg); }
.ifx .ifx-feedback.is-right, .ifx .ifx-feedback.is-wrong { border-left: 3px solid var(--ifx-one); padding-left: 12px; margin-top: 4px; }
.ifx .ifx-feedback.is-wrong { border-left-style: dashed; border-left-color: var(--ifx-zero); }
.ifx .ifx-controls .demo-set { position: relative; }
.ifx input[type=range] { min-height: 44px; }
.ifx input[type=range]:disabled { opacity: 0.6; }
.ifx .ifx-ticks { position: relative; height: 1.4em; margin: -6px 10px 4px; font-family: var(--f-mono); font-size: 0.72rem; color: var(--band-muted); }
.ifx .ifx-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ifx .ifx-ticks span:first-child { transform: none; }
.ifx .ifx-ticks span:last-child { transform: translateX(-100%); }
.ifx .ifx-explain { font-family: var(--f-body); font-size: 1rem; line-height: 1.55; color: var(--band-fg); margin: 0; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.12); }
.ifx .ifx-hidden { margin: 0; padding: 14px; border: 1px dashed rgba(255,255,255,0.28); border-radius: 12px; }
.ifx .ifx-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px 22px; }
.ifx .ifx-panel, .ifx .ifx-branch { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ifx .ifx-ph { margin: 0; }
.ifx .ifx-branch { border: 1px solid rgba(255,255,255,0.14); border-radius: 12px; padding: 10px 12px; }
.ifx .ifx-ph { font-family: var(--f-display); font-size: 0.9rem; color: var(--band-fg); display: flex; gap: 8px; align-items: center; }
.ifx .ifx-ph .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.ifx .ifx-ph .sw.zero { background: var(--ifx-zero); }
.ifx .ifx-ph .sw.one { background: var(--ifx-one); }
.ifx .ifx-svg { width: 100%; max-width: 240px; height: auto; display: block; margin: 0 auto; }
.ifx .ifx-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ifx .ifx-mini .ifx-svg { max-width: 170px; }
.ifx .ifx-len { margin: 0; text-align: center; font-family: var(--f-display); font-size: 0.88rem; color: var(--band-fg); overflow-wrap: anywhere; }
.ifx .ifx-minicap { margin: 2px 0 0; display: flex; gap: 6px; align-items: center; justify-content: center; font-family: var(--f-display); font-size: 0.85rem; color: var(--band-fg); }
.ifx .ifx-minicap .sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.ifx .ifx-minicap .sw.zero { background: var(--ifx-zero); }
.ifx .ifx-minicap .sw.one { background: var(--ifx-one); }
.ifx .ifx-overall { margin: 0; font-family: var(--f-display); font-size: 0.95rem; color: var(--band-fg); }
.ifx .ifx-branches { display: flex; flex-direction: column; gap: 10px; }
.ifx .ifx-branches > p { margin: 0; }
/* the drawing: amplitudes, not anything in space; no animation in any mode */
.ifx svg .ifx-ring { fill: none; stroke: var(--ifx-guide); stroke-width: 1; stroke-dasharray: 3 4; }
.ifx svg .ifx-axis { stroke: rgba(255,255,255,0.14); stroke-width: 1; }
.ifx svg .ifx-arrow { stroke-width: 2; fill: none; stroke-linecap: round; }
.ifx svg .ifx-arrow.ifx-zero { stroke: var(--ifx-zero); }
.ifx svg .ifx-arrow.ifx-one { stroke: var(--ifx-one); }
.ifx svg .ifx-arrow.ifx-minus { stroke-dasharray: 6 4; stroke-linecap: butt; }
.ifx svg .ifx-sum { stroke: var(--ifx-sum); stroke-width: 5; stroke-linecap: round; stroke-opacity: 0.55; }
.ifx svg .ifx-head-sum { fill-opacity: 0.55; }
.ifx svg .ifx-head-zero { fill: var(--ifx-zero); }
.ifx svg .ifx-head-one { fill: var(--ifx-one); }
.ifx svg .ifx-head-sum { fill: var(--ifx-sum); }
.ifx svg circle.ifx-zero { fill: var(--ifx-sum); }
.ifx svg text, .ifx svg text.t-note { fill: var(--band-muted); font-size: 12px; }
.ifx svg text.ifx-zerolabel { fill: var(--band-fg); font-size: 13px; }
.ifx .ifx-pred .tally, .ifx .ifx-obs .tally { color: var(--band-fg); }
.ifx .bar.zero i em { background: var(--ifx-zero); }
.ifx .bar.one i em { background: var(--ifx-one); }
.ifx .ifx-steps { margin: 4px 0 8px; padding-left: 1.3em; display: flex; flex-direction: column; gap: 8px; }
.ifx .ifx-steps strong { font-weight: 500; color: var(--band-fg); }
.ifx .ifx-tech { margin-top: 6px; }
.ifx .ifx-tech .demo-small + .demo-small, .ifx .ifx-tech .ket + .demo-small { margin-top: 8px; }
.ifx .ifx-ans { margin-top: 6px; }
.ifx .ifx-ans summary { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; color: var(--band-fg); width: fit-content; }
.ifx .ifx-locknote { margin: 0; }
@media (max-width: 480px) {
  .ifx .ifx-mini .ifx-svg { max-width: 130px; }
  .ifx .ifx-ticks { font-size: 0.68rem; }
}
.ifx .btn-ghost:disabled, .ifx .btn-link:disabled { opacity: 0.55; cursor: not-allowed; }
