/* ==========================================================================
   stage.css — the page goes dark around a product.

   When a prototype scrolls into view the page's ground fades to ink, so the
   product window reads as a lit screen in a dark room. In light theme the
   navigation rail keeps its paper — the room darkens, the door does not.

   Only the light theme needs this: in dark theme the page is already dark, so
   the stage is invisible by design rather than by accident.
   ========================================================================== */

/* the section that holds a product screen */
.stage {
  --stage-ground: var(--paper-low);
  position: relative;
  padding-block: clamp(28px, 4vw, 56px);
}

/* ---------- the room sinks a shade ----------------------------------- */

/* There is no light theme to fade from any more, so the stage does what a dark
   room does: it takes the ground down another step, so the lit window is the
   only bright thing on the page. The rail is gone; nothing needs preserving. */
[data-stage="on"] {
  --paper: var(--paper-low);
  --paper-deep: color-mix(in oklab, var(--light) 4%, var(--paper-low));
  --rule: color-mix(in oklab, var(--light) 16%, transparent);
  --rule-strong: color-mix(in oklab, var(--light) 42%, transparent);
}

/* the fade itself, on the things that actually paint */
body,
.site-head,
.colophon,
.coda {
  transition: background-color 620ms cubic-bezier(0.2, 0, 0, 1),
    color 620ms cubic-bezier(0.2, 0, 0, 1),
    border-color 620ms cubic-bezier(0.2, 0, 0, 1);
}

/* text that sits around the product follows the room */
[data-stage="on"] .section-head__title,
[data-stage="on"] .section-head__aside,
[data-stage="on"] .section-label,
[data-stage="on"] .stage__caption,
[data-stage="on"] .pagenote,
[data-stage="on"] .pagenote * {
  transition: color 620ms cubic-bezier(0.2, 0, 0, 1),
    border-color 620ms cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-reduced-motion: reduce) {
  body,
  .site-head,
  .colophon,
  .coda,
  [data-stage="on"] .section-head__title,
  [data-stage="on"] .section-head__aside,
  [data-stage="on"] .pagenote,
  [data-stage="on"] .pagenote * {
    transition-duration: 1ms;
  }
}

/* the plates and the campaign panels keep their ink — they are printed matter */
html[data-stage="on"] .plate,
html[data-stage="on"] .st-brand,
html[data-stage="on"] .st-plan {
  color: var(--ink);
}
