/* THE LAMP : two registers, one switch (KA, 2026-10-05, Mikha'el's ruling).
   The house keepeth two registers of light, and the reader chooseth:
     - the DARK register: the deep-navy house signature (the default), and
     - the BRIGHT register: the scripture-white reading light.
   On a house-dark room the pill readeth "Raise the lamp" and showeth the
   bright register; on a doctrine-white room * the pill readeth "Dim the
   lamp" and bringeth the house dark. The reader's choice is remembered in
   their own browser, in one key, never sent, never counted.

   THE LAWS:
     1. Never flash the wrong register. The register is applied by an
        ordinary same-origin script in each page's head (js/lamp-early.js),
        BEFORE the first paint: a stored choice, or the system's dark wish,
        setteth the class pre-paint.
     2. Honour prefers-color-scheme: a reader whose system asketh for dark,
        and who hath made no choice of their own, getteth the dark register
        unasked. Their own choice, once made, alway winneth (legacy stored
        'day' -> bright; legacy 'dim' -> dark).
     3. Honour prefers-reduced-motion: the change is a settling of colour,
        never a fade. No motion is added anywhere by this mode.

   The mode is carried by the house's own tokens, so every room that ever
   used --paper or --ink followeth the register, and a room added tomorrow
   is reached as well without a line of work. Nothing is hidden and no word
   is changed: the light, only.

   THE BOUNDED OVERRIDES (the keeper's word: "bounded bright-register
   overrides for literal-colored rooms"): the rooms whose sheets painted
   literal colours rather than the house's tokens are carried to the bright
   register by name below — the breach family, the not-found room — and the
   two canvases that are their own doctrine (the Cell; the Question's hate
   prelude) are kept dark in both registers. Every override is scoped to
   the register and to the named room; nothing else is touched.

   * The doctrine-white rooms (the sixteen ministries, the Magnificat, and
   the House of the Name) keep their white paper by the keeper's ruling of
   2026-10-04; the lamp bringeth them the house dark at the reader's word.

   TEMPLE MARK L1: ␗ : reading-mode.css */

/* --- THE BRIGHT REGISTER: the scripture-white reading light ---------------- */
@media screen {
  html.lamp-bright body.site-page {
    --paper: var(--white);
    --ink: var(--blue-ink);
    --bureau: var(--blue-mid);
    --candle: var(--blue-ink);
    --line-paper: rgba(10, 42, 67, 0.16);
    --line-dark: rgba(10, 42, 67, 0.2);
    --shadow-paper: 0 1px 2px rgba(10, 42, 67, 0.06), 0 12px 32px rgba(10, 42, 67, 0.08);
    --surface: var(--white);
    --muted: var(--blue-mid);
    --brass: var(--gold-deep);
    /* The night tokens invert with the register, as they already do on
       paper (the print block): a room that painted with --hate-bg/--hate-ink
       followeth the light without a room-by-room rule. */
    --hate-bg: var(--white);
    --hate-ink: var(--blue-ink);
    background: var(--register-ground, var(--white));
    color: var(--register-ink, var(--blue-ink));
  }
  html.lamp-bright body.site-page a,
  html.lamp-bright body.site-page a:visited {
    color: var(--blue-ink);
  }
  /* The frost of the band followeth the register's own ground. */
  html.lamp-bright body.site-page .room-header {
    background: color-mix(in srgb, var(--register-ground, var(--paper)) 88%, transparent);
  }
}

/* --- THE BRIGHT REGISTER : the literal-coloured rooms' devices ------------
   MF-043 (2026-10-09). The rooms whose sheets painted literal grounds and
   literal inks carry their light-register values as tokens in their OWN
   sheets (--register-ground, --register-ink, --register-rule,
   --register-chip, --register-wash, set on html.lamp-bright body.<room>);
   the rules below consume them by the name of the device — the rewritten
   lie, the redaction chip, the exhibit wash — and this sheet nameth no
   room. The defaults are the house's own light values, which stand for
   every room that never declared a token, and the grounds and inks of the
   body itself are carried by the generic block above. */
@media screen {
  html.lamp-bright body.site-page .rewritten {
    color: var(--register-ink, var(--blue-ink));
    border-left-color: var(--register-rule, rgba(10, 42, 67, 0.35));
  }
  html.lamp-bright body.site-page .redacted {
    background: var(--register-chip, var(--blue-ink));
  }
  html.lamp-bright body.site-page .rewrite-exhibit {
    background: var(--register-wash, rgba(10, 42, 67, 0.04));
  }
}

/* --- THE KEPT CANVASES : their own doctrine, in either register -------------
   The Cell saith "the room is dark" and carrieth no control; the Question's
   nine-second hate prelude is the Party's own palette until the drain. Both
   stand dark in both registers; the register reacheth the rest of their
   chrome by the tokens they inherit — and their links keep the pale ink of
   the dark they stand on, so no dark-blue link falleth onto a dark ground. */
@media screen {
  html.lamp-bright body.cell {
    --paper: var(--blue-night);
    --ink: var(--white);
    --bureau: var(--blue-soft);
    --candle: var(--white);
    --line-paper: var(--line-dark);
    --surface: var(--blue-night);
    --muted: var(--blue-soft);
    --brass: var(--gold);
    --hate-bg: var(--blue-night);
    --hate-ink: var(--white);
    background: var(--blue-night);
    color: var(--white);
  }
  html.lamp-bright body.cell a,
  html.lamp-bright body.cell a:visited {
    color: var(--white);
  }
  html.lamp-bright body.question.hate {
    --paper: var(--blue-night);
    --ink: var(--white);
    --bureau: var(--blue-soft);
    --candle: var(--white);
    --line-paper: var(--line-dark);
    --surface: var(--blue-night);
    --muted: var(--blue-soft);
    --brass: var(--gold);
    --hate-bg: var(--blue-night);
    --hate-ink: var(--white);
    background: var(--blue-night);
    color: var(--white);
  }
  html.lamp-bright body.question.hate a,
  html.lamp-bright body.question.hate a:visited {
    color: var(--white);
  }
  html.lamp-bright body.question.hate .room-header {
    background: color-mix(in srgb, var(--blue-night) 88%, transparent);
  }
}

/* THE CONTROL. It sitteth with the other reader tools, and it is a word,
   not a switch. */
.lamp-control {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.8rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: inherit;
  font: 500 0.8rem/1.4 var(--font-ui);
  cursor: pointer;
}

.lamp-control:hover,
.lamp-control:focus-visible {
  background: rgba(212, 175, 55, 0.12);
}

/* The lamp's own little sign: a wick at low ebb in the dark register, lit
   when the reader raiseth the lamp. */
.lamp-control::before {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.45em;
  border-radius: 50%;
  background: var(--brass);
  opacity: 0.45;
}

html.lamp-bright .lamp-control::before {
  opacity: 1;
  box-shadow: 0 0 0.5em rgba(216, 178, 74, 0.6);
}

@media (prefers-reduced-motion: reduce) {
  .lamp-control { transition: none; }
}

/* Paper is never dimmed: the sheet printeth as the room it is. */
@media print {
  html.lamp-bright,
  html.lamp-dark {
    color-scheme: light;
  }
  html.lamp-bright body.site-page,
  html.lamp-dark body.site-page {
    --paper: var(--white);
    --ink: var(--blue-ink);
    --bureau: var(--blue-mid);
    --candle: var(--blue-ink);
    --line-paper: rgba(10, 42, 67, 0.16);
    --line-dark: rgba(10, 42, 67, 0.16);
    --shadow-paper: none;
    background: none;
    color: var(--ink);
  }
}
