/* The "In plain language" switch and the two-version sections of the legal pages.
   Canonical copy: Asyml8-labs/brahma site/plain-language.css; mybrahma.com carries a copy.
   Colours come from the page's own variables (--paper, --paper-2, --ink, --ink-2, --rule, --accent,
   --accent-ink, --focus), so each site's light and dark themes apply. */

.lp-bar {
  position: sticky; top: var(--lp-top, 0px); z-index: 12;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .lp-bar { background: color-mix(in srgb, var(--paper) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
}
.lp-bar[hidden] { display: none; }
.lp-bar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-block: 10px; }

.lp-switch {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0; padding: 6px 14px 6px 6px;
  border: 1px solid var(--rule); border-radius: 999px;
  background: var(--paper-2); color: var(--ink);
  font: inherit; font-size: 0.95rem; font-weight: 600; line-height: 1.2;
  cursor: pointer;
}
.lp-switch:hover { border-color: var(--ink-2); }
.lp-switch:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.lp-track {
  position: relative; flex: none; width: 40px; height: 24px; border-radius: 999px;
  background: var(--rule); transition: background-color .2s;
}
.lp-thumb {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink-2); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s, background-color .2s;
}
.lp-switch[aria-checked="true"] .lp-track { background: var(--accent); }
.lp-switch[aria-checked="true"] .lp-thumb { transform: translateX(16px); background: var(--accent-ink); }

.lp-fx-picker { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--ink-2); }
.lp-fx-picker button {
  font: inherit; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--rule);
  background: transparent; color: var(--ink); cursor: pointer;
}
.lp-fx-picker button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.lp-fx-picker button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* The document clips words that fly or fall out of it. clip (not hidden) keeps the bar sticky. */
.lp-doc { overflow: hidden; }
@supports (overflow: clip) { .lp-doc { overflow: clip; } }

.lp-sec { padding-block: 8px 20px; border-top: 1px solid var(--rule); }
.lp-sec:first-child { border-top: 0; }
.lp-sec h2 { max-width: none; margin: 22px 0 10px; font-size: var(--lp-h2, 1.35rem); letter-spacing: -0.01em; }
.lp-legal p, .lp-legal li, .lp-plain p, .lp-plain li { max-width: 70ch; }
.lp-legal { color: var(--ink); }
.lp-legal p, .lp-legal li { line-height: 1.6; }
.lp-plain p, .lp-plain li { font-size: 1.06em; line-height: 1.55; color: var(--ink); }

/* Without JS: both versions, the plain one in a labelled box under the legal text. */
.lp-plain {
  margin: 14px 0 6px; padding: 12px 16px;
  border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: 8px;
  background: var(--paper-2);
}
.lp-tag {
  margin: 0 0 6px; font-size: 0.75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2);
}
.lp-plain > :last-child, .lp-legal > :last-child { margin-bottom: 0; }

/* With JS: one version at a time, the other kept in the DOM but out of sight. */
.lp-js .lp-pair { position: relative; }
.lp-js .lp-plain { margin: 0; padding: 0 0 0 16px; border: 0; border-left: 3px solid var(--accent); border-radius: 0; background: none; }
.lp-js .lp-tag { display: none; }
.lp-js.lp-on .lp-pair:not([data-show]) .lp-legal,
.lp-js:not(.lp-on) .lp-pair:not([data-show]) .lp-plain,
.lp-js .lp-pair[data-show="plain"] .lp-legal,
.lp-js .lp-pair[data-show="legal"] .lp-plain {
  position: absolute; top: 0; left: 0; right: 0; visibility: hidden;
}
/* During an effect both versions are on screen; the animations decide what is seen. */
.lp-js .lp-pair.lp-fx .lp-legal,
.lp-js .lp-pair.lp-fx .lp-plain { visibility: visible; }
.lp-js .lp-pair.lp-fx-decode .lp-legal,
.lp-js .lp-pair.lp-fx-decode .lp-plain { position: absolute; top: 0; left: 0; right: 0; }
.lp-ghost { opacity: 0 !important; }
.lp-words { position: absolute; top: 0; left: 0; right: 0; margin: 0; pointer-events: none; }
.lp-w { display: inline-block; will-change: transform, opacity; }
.lp-decode {
  white-space: pre-line; padding-left: 16px; border-left: 3px solid var(--accent);
  font-size: 1.06em; line-height: 1.55; color: var(--ink); max-width: 70ch; margin: 1em 0;
}
.lp-running .lp-legal a, .lp-running .lp-plain a { pointer-events: none; }

.lp-toc { margin: 8px 0 4px; padding: 0; list-style: none; columns: 2 16rem; column-gap: 32px; font-size: 0.92rem; }
.lp-toc li { margin: 0 0 4px; break-inside: avoid; }
.lp-toc a { color: var(--ink-2); }
.lp-placeholder { font-family: var(--mono, ui-monospace, monospace); font-size: .92em; background: var(--paper-2); padding: 0 4px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  .lp-track, .lp-thumb { transition: none; }
}
