/* The light, for Docs (in dark, every glow far fainter: light on a dark
   surface reads much brighter than on a light one, Paul 2026-11-10): the values rastrillo's depth styles read (its
   day theme's names, ui/themes/day.css), which estilo's Calma does not
   declare yet, and the same light on Docs' own controls. Positions come
   from rastrillo's light.js (its buttons and cards) and from
   pointer.js (everything here); with neither, every rule below falls
   back to the still design. Hover-only, and under (hover: hover), so a
   touch screen never holds a light where a finger lifted. */
:root {
  --rst-sheen-fill: light-dark(rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.035));
  --rst-sheen-plain: light-dark(color-mix(in srgb, var(--rst-accent) 10%, transparent), rgba(255, 255, 255, 0.025));
  --rst-light-rim: light-dark(color-mix(in srgb, var(--rst-accent) 38%, var(--rst-line)), color-mix(in srgb, var(--rst-accent) 18%, #4a4a4a));
  --rst-light-wash: light-dark(color-mix(in srgb, var(--rst-accent) 4%, transparent), rgba(255, 255, 255, 0.01));
  /* The bloom's light, as an rgb triplet so its alpha can follow the
     press: rgb(var() / calc()) works in every engine, where a
     color-mix() whose percentage carried calc(var()) blanked Safari
     (rastrillo's tokens.css, on its own press). Docs' accent, light and
     dark. */
  --docs-bloom: 46 91 180;
  /* How strong every press bloom is: 1 in light, much less in dark,
     where light on a dark surface reads far brighter (Paul). */
  --docs-bloom-k: 1;
  /* The pool of light a pointer casts on the control it is over. */
  --docs-light-tint: light-dark(color-mix(in srgb, var(--rst-accent) 10%, transparent), color-mix(in srgb, var(--rst-accent) 6%, transparent));
}
/* Dark, a triplet, so a selector and a media query rather than
   light-dark(), which takes only colours. */
:root[data-theme="dark"] { --docs-bloom: 135 177 253; --docs-bloom-k: 0.4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --docs-bloom: 135 177 253; --docs-bloom-k: 0.4; } }

/* A press is press in and bloom (Paul, from the press lab): the
   control gives a little under the press and springs back on release,
   overshooting slightly; and the light flares where the press landed
   (pointer.js writes --rst-px/--rst-py), swelling while it is held and
   fading after release. --docs-press is 1 while held, at once, and
   falls to 0 over 0.7s, which a registered number can transition; the
   flare's size and alpha both ride it. --docs-flare is that light, drawn
   as a background layer by each control's own rule. Inherited, so a
   shelf page's paper can read its tile's press. */
@property --docs-press {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
:root {
  --docs-flare: radial-gradient(calc(24px + var(--docs-press, 0) * 76px) circle at var(--rst-px, 50%) var(--rst-py, 50%), rgb(var(--docs-bloom) / calc(var(--docs-press, 0) * 0.16 * var(--docs-bloom-k))), transparent 72%);
  --docs-release: --docs-press 0.7s cubic-bezier(0.2, 0.6, 0.3, 1), scale 0.42s cubic-bezier(0.3, 1.6, 0.5, 1);
}
[docs-tool],
[docs-tile],
[docs-list] [rst-row],
[estilo-menu-item] {
  transition: var(--docs-release);
}
[docs-tool]:active:not(:disabled),
[docs-tile]:active,
[docs-list] [rst-row]:active,
[estilo-menu-item]:active:not(:disabled) {
  --docs-press: 1;
  transition: scale 90ms ease-out;
}
/* The give itself only where motion is welcome; the bloom still comes. */
@media (prefers-reduced-motion: no-preference) {
  [docs-tool]:active:not(:disabled) { scale: 0.92; }
  [docs-list] [rst-row]:active { scale: 0.992; }
}
[estilo-menu-item]:not(:disabled) {
  background-image: var(--docs-flare);
}
/* rastrillo's buttons carry their own press value, --rst-press (1 while
   held, fading over 0.7s), and a face layer under everything else: the
   bloom goes in the face, white on a filled button, and they give under
   the press the same way, keeping their own transitions. */
[rst-btn] {
  --rst-btn-face: radial-gradient(calc(24px + var(--rst-press, 0) * 96px) circle at var(--rst-px, 50%) var(--rst-py, 50%), rgb(var(--docs-bloom) / calc(var(--rst-press, 0) * 0.14 * var(--docs-bloom-k))), transparent 72%);
}
[rst-btn~="primary"],
[rst-btn~="danger"] {
  --rst-btn-face:
    radial-gradient(calc(24px + var(--rst-press, 0) * 96px) circle at var(--rst-px, 50%) var(--rst-py, 50%), rgb(255 255 255 / calc(var(--rst-press, 0) * 0.22 * var(--docs-bloom-k))), transparent 72%),
    linear-gradient(rgb(255 255 255 / var(--rst-depth-face, 0)), rgb(0 0 0 / var(--rst-depth-face, 0)));
}
[rst-btn] {
  transition: --rst-press 0.7s cubic-bezier(0.2, 0.6, 0.3, 1), translate 0.3s ease-out, scale 0.42s cubic-bezier(0.3, 1.6, 0.5, 1);
}
[rst-btn]:active:not(:disabled):not([aria-busy="true"]) {
  transition: scale 90ms ease-out;
}
@media (prefers-reduced-motion: no-preference) {
  [rst-btn]:active:not(:disabled):not([aria-busy="true"]) { scale: 0.965; }
}

@media (hover: hover) {
  /* A menu's rows: the hover fill estilo draws, with the light on it. */
  [estilo-menu-item]:hover:not(:disabled) {
    background-image: var(--docs-flare), radial-gradient(120px circle at var(--rst-mx, 50%) var(--rst-my, 50%), var(--docs-light-tint), transparent 70%);
  }
}

/* The menu bar's titles take the pointer, as every other control on the
   page does (Paul, 2026-11-07). estilo's menu.css gives them the arrow
   on purpose, after desktop menu bars; this is Docs leading, and the
   rule belongs in estilo if the suite follows. */
[estilo-menubar-title] {
  cursor: pointer;
}
