/* Licensed to account 52c7da1aea3f, 2026-10-19. Moving parts. */
/* Ink reveal, the mechanics: the ink of a word, the fresh ink at its head, the bare text ahead.
   Moving parts. How a word is painted while its block is live, on three stops the engine writes; the look of the preview follows.
   Readable source: components/ink-reveal/ink-reveal.css */

/* ---------- the colours of the ink ---------- */

/* One colour and one strength, zero specificity.
   Set them on the block marked data-ink-reveal, or on anything above it:
   --ink-reveal-fresh is the colour of the ink that has just been laid, and
   --ink-reveal-rest the strength of the text not inked yet, from 0 to 1.
   The ink itself is the colour of the text, word by word. */
:where([data-ink-reveal]) {
  --ink-reveal-css: 1;
  --ink-reveal-fresh: #ff4a00;
  --ink-reveal-rest: 0.2;
  --ink-reveal-toward: right;
}

:where([dir="rtl"] [data-ink-reveal], [data-ink-reveal][dir="rtl"]) {
  --ink-reveal-toward: left;
}

/* ---------- a word ---------- */

/* One gradient, clipped to the letters: the dry ink, the fresh ink, the
   bare text. The engine moves the three stops; a word it has not reached
   has none and is all bare, a word it has passed is all ink. The padding
   keeps the overhang of an italic and the tail of a letter inside the
   paint, and the margin takes it back so no word moves. */
[data-ink-reveal-state]:not([data-ink-reveal-state="reduced"]) .ink-reveal-unit {
  --ink-reveal-bare: color-mix(in srgb, currentColor calc(var(--ink-reveal-rest) * 100%), transparent);
  --ink-reveal-head: color-mix(in srgb, var(--ink-reveal-fresh) calc(var(--ink-reveal-heat, 0) * 100%), currentColor);
  padding: 0.16em 0.12em;
  margin: 0 -0.12em;
  background-image: linear-gradient(
    to var(--ink-reveal-toward),
    currentColor var(--ink-reveal-a, 0%),
    var(--ink-reveal-head) var(--ink-reveal-b, 0%),
    var(--ink-reveal-bare) var(--ink-reveal-c, 0%)
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* A selection shows its words whole, inked or not. */
[data-ink-reveal-state]:not([data-ink-reveal-state="reduced"]) .ink-reveal-unit::selection {
  -webkit-text-fill-color: currentColor;
}

/* On paper, and where the system paints its own colours, plain text. */
@media print, (forced-colors: active) {
  [data-ink-reveal-state]:not([data-ink-reveal-state="reduced"]) .ink-reveal-unit {
    background-image: none;
    -webkit-text-fill-color: currentColor;
  }
}

/* ---------- look, left out of the Webflow Embed ---------- */

/* Clinix Studio: the look of the preview (the ink-reveal-* classes of the
   note on a warm black page, set in Instrument Sans and Geist Mono) is left
   out of this copy on purpose. The intro of the homepage keeps its own
   type and layout in src/components/Intro.astro, and sets the fresh ink to
   the site's accent through --ink-reveal-fresh there. The mechanics above
   are the file as shipped. */
