/* Rikyu Riso tokens and helpers. rikyu-labs/riso/riso.css, v1.2.0, 2026-11-01 (Osaa, Oracle AI).
   Load the Rikyu tokens first (rikyu-labs/tokens.css, or slide-kit/tokens/tokens.css: the same file), then this
   file, then riso.js. riso.js reads the --riso-* properties below, so the print and the HTML share one token
   source: change an ink here (or in tokens.css) and both the words and the dots follow. */
:root {
  --riso-paper: var(--rikyu-shiro);   /* the sheet */
  --riso-ink-1: var(--rikyu-kuro);    /* ink 1: blocks of work, shadows, the facts */
  --riso-ink-2: var(--rikyu-sabi);    /* ink 2: the human (the one block that is "you") */
  --riso-ink-3: var(--rikyu-moss);    /* ink 3: agents, helpers, the background crowd */
  --riso-flood: var(--rikyu-sabi);    /* a whole-sheet solid for the one closing page */
  --riso-knockout-pad: 40px;          /* clear paper kept around every word (stage px) */
}

/* the print canvas. riso.js sets its position and CSS size (fixed under a slide stage, or absolute in a
   container, always on whole device pixels) and sizes its backing store to device pixels. pixelated is a
   safety net only: when the rules hold there is nothing to resample. */
.riso-canvas { position: absolute; left: 0; top: 0; display: block; image-rendering: pixelated; pointer-events: none; z-index: 0; }
/* a landing-page box that holds a print: words go in a child above the canvas (z-index 1).
   ⛔ never give .riso-box or any ancestor a transform, scale, translate, rotate or zoom (the moire rule). */
.riso-box { position: relative; overflow: hidden; background: var(--riso-paper); }
.riso-layer { position: relative; z-index: 1; height: 100%; }   /* the words, above the print */

/* the sabi highlighter: sabi is never text on shiro (1.78:1), so a highlight is a marker band behind kuro text */
.riso-hl {
  color: var(--rikyu-kuro);
  background: linear-gradient(transparent 58%, var(--rikyu-sabi) 58%, var(--rikyu-sabi) 90%, transparent 90%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
/* on the flooded (sabi) page the band would vanish, so it turns into a kuro underline */
.riso-flooded .riso-hl { background: linear-gradient(transparent 86%, var(--rikyu-kuro) 86%, var(--rikyu-kuro) 92%, transparent 92%); }

/* still mode (key S): the page stops; riso.js prints one frame and stays */
.riso-still * { animation: none !important; transition: none !important; }

/* ── solid or dot screen for flat (2D) elements (v1.2, 2026-11-01; rule and reasons: README "Solid or dot screen") ──
   Yim: "ส่วนใหญ่ใน slide มันควรเป็นสีทึบนะ ยกเว้นอันที่เราทำเป็น motion ทำเป็น graphic".
   .riso-solid = one flat ink (the default for every box, label, chip, row, panel, bar).
   .riso-screen = dots of one ink, ONLY for a graphic or an illustrative figure, never behind words.
   Both read --riso-fill, so a modifier sets the ink once for either. */
:root {
  --riso-screen-cell: 4px;   /* dot pitch = riso.js default cell, so a CSS screen and the 3D print look like one press */
  --riso-screen-dot: 1.1px;  /* dot radius: 1.1 px on a 4 px pitch ≈ 24% ink coverage */
}
.riso-solid, .riso-screen { --riso-fill: var(--rikyu-stone); --riso-on: var(--rikyu-kuro); }
.riso-solid { background: var(--riso-fill); color: var(--riso-on); }
.riso-screen {
  background: radial-gradient(circle, var(--riso-fill) var(--riso-screen-dot), transparent calc(var(--riso-screen-dot) + .35px))
              0 0 / var(--riso-screen-cell) var(--riso-screen-cell);
  color: transparent;        /* a screen holds no words: anything typed in it disappears, which a check will notice */
}
/* stone is not a drum: on a screen it prints as a light kuro tint, as a real riso would */
.riso-screen:not(.riso-fill-sabi):not(.riso-fill-kuro):not(.riso-fill-moss) { --riso-fill: rgba(26,26,26,.45); }
.riso-fill-stone { --riso-fill: var(--rikyu-stone); --riso-on: var(--rikyu-kuro); }   /* kuro on stone 11.99 */
.riso-fill-sabi  { --riso-fill: var(--rikyu-sabi);  --riso-on: var(--rikyu-kuro); }   /* kuro on sabi 8.98 */
.riso-fill-kuro  { --riso-fill: var(--rikyu-kuro);  --riso-on: var(--rikyu-shiro); }  /* shiro on kuro 15.99 */
.riso-fill-moss  { --riso-fill: var(--rikyu-moss);  --riso-on: var(--rikyu-shiro); }  /* shiro on moss 4.18: text ≥ 24 px only */
.riso-fill-error { --riso-fill: var(--rikyu-status-error); --riso-on: var(--rikyu-shiro); } /* shiro on beni 6.19; errors only, solid only */
/* sabi is a light ink (1.78 on shiro): at 24% its screen vanishes, so it prints denser (1.6 px ≈ 50%), as light drums do */
.riso-screen.riso-fill-sabi { --riso-screen-dot: 1.6px; }
