/*
 * pique-base.css — the immutable base layer.
 *
 * Deliberately quiet, and deliberately incomplete (JAVASCRIPT-RUNTIME-PLAN.md §9.1). Anything
 * with a visual opinion — type scale, palette, spacing rhythm, motion — belongs in theme.css
 * or interactive.css, because a base layer with taste becomes the visible fingerprint of every
 * interactive the app has ever produced, which is the one failure mode the creative-ceiling
 * audit exists to catch.
 *
 * What it does own: box sizing, a full-viewport stage that does not fight the scroll, the
 * reduced-motion hook, and a visually-hidden utility.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.pique-interactive {
  margin: 0;
  /* No font stack, no color, no background. Those are theme decisions. */
}

/*
 * The default structural contract: one sticky, full-viewport stage the prose scrolls over
 * (§2.2). `position: sticky` rather than `fixed` so the stage stays inside the flow and a
 * flattened single-document preview keeps working.
 */
.pique-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.pique-stage > svg,
.pique-stage > canvas {
  display: block;
  width: 100%;
  height: 100%;
}

[data-pique-flow] {
  position: relative;
}

/* Focus stays visible. Removing an outline is a decision the theme has to make deliberately. */
:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.pique-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/*
 * Two spellings of the same preference, because a capture sets it as an attribute: the media
 * query is the reader's real setting, and `data-pique-reduced-motion` is what the host applies
 * when it renders a reduced-motion screenshot of a machine that has motion enabled.
 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

:root[data-pique-reduced-motion="reduce"] *,
:root[data-pique-reduced-motion="reduce"] *::before,
:root[data-pique-reduced-motion="reduce"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}
