/* Intro overlay (lab home). html.intro-on is set by the inline gate in the page head before first paint: until the
   overlay mounts, a plain cover in the intro's background hides the page (true black in the dark theme, paper in
   the light theme; the same colours as intro/config.js). The gate removes the class after 4 s if the intro script
   never starts, so a failure can never leave the page covered. Scrolling is held by the intro's own input handlers
   rather than overflow: hidden, so no scrollbar appears or disappears and the hero never shifts. */
:root { --intro-bg: #f2efe8; --intro-ink: #15192b; --intro-skip: .64; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --intro-bg: #000; --intro-ink: #fff; --intro-skip: .5; } }
:root[data-theme="dark"] { --intro-bg: #000; --intro-ink: #fff; --intro-skip: .5; }

html.intro-on body::after { content: ""; position: fixed; inset: 0; z-index: 99; background: var(--intro-bg); }
html.intro-live body::after { display: none; }
html.intro-on #h-name, html.intro-on #h-tagline { opacity: 0; }
html.intro-on .replay-tools, html.intro-on .toc-toggle { visibility: hidden; }

.intro { position: fixed; inset: 0; z-index: 100; touch-action: none; user-select: none; -webkit-user-select: none; }
.intro-bg { position: absolute; inset: 0; }
.intro canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* The only thing on screen besides the piece: a small "Skip". Low-key, but still AA contrast (5:1 or more). */
.intro-skip {
  position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right));
  font-family: var(--mono, ui-monospace, monospace); font-size: .64rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--intro-ink); opacity: calc(var(--intro-skip) * var(--k, 1)); background: none; border: 0; border-radius: 4px;
  min-height: 32px; min-width: 44px; padding: 0 .7rem; cursor: pointer; transition: opacity .3s ease;
}
.intro-skip:hover, .intro-skip:focus-visible { opacity: calc(.95 * var(--k, 1)); }
.intro-skip:focus-visible { outline: 1px solid currentColor; outline-offset: 2px; }
.intro.is-leaving { opacity: 0; transition: opacity .6s cubic-bezier(.4, 0, .2, 1); }
@media print {
  .intro, html.intro-on body::after { display: none !important; }
  html.intro-on #h-name, html.intro-on #h-tagline { opacity: 1 !important; filter: none !important; }
}
