/* ============ theme — the light act ============
   Light is an exact inversion of dark: paper is the dark theme's ink, ink is the
   dark theme's paper. Because the colours swap one-for-one, the portals (which
   cut the dark world open through letterforms) hand over without a colour seam.
   Every component reads tokens, so scoping them here re-themes whole chapters. */

[data-theme="light"] {
  --bg: #ece8e1;
  --bg-deep: #e4dfd6;
  --surface-1: #f3f0ea;
  --surface-2: #e2ddd3;
  --surface-3: #d8d2c7;

  --ink: #0b0b0c;
  --ink-2: rgba(11, 11, 12, 0.76);
  --ink-3: rgba(11, 11, 12, 0.6);   /* ≈ 5:1 on paper — still readable as small mono */
  --ink-4: rgba(11, 11, 12, 0.32);  /* decorative only */
  --hairline: rgba(11, 11, 12, 0.12);
  --hairline-strong: rgba(11, 11, 12, 0.24);

  --signal: #e8481a;                /* a touch deeper so it holds on paper */
  --signal-soft: rgba(232, 72, 26, 0.14);
  --signal-text: #b8340c;           /* 4.6:1 on paper, for accent-coloured text */

  color-scheme: light;
  background: var(--bg);
  color: var(--ink);
}

.act {
  position: relative;
  z-index: 2;
  background: var(--bg);
}

/* paper has its own tooth: grain multiplies instead of glowing */
html.on-light .grain { mix-blend-mode: multiply; opacity: 0.05; filter: invert(1); }
.grain { transition: opacity 300ms var(--ease-ui); }

/* the nav reads its theme from what is underneath it: html.nav-light (js/core/theme.js) re-tints
   the glass to paper and flips its ink — the rules live with the material in css/navglass.css */

/* the cursor inverts against whatever it is over — paper or film */
.cursor { mix-blend-mode: difference; }
.cursor.has-label { mix-blend-mode: normal; }
html.on-light .cursor.has-label .cursor__ring::before { background: #0b0b0c; border-color: #0b0b0c; }
html.on-light .cursor.has-label .cursor__label { color: #ece8e1; }

/* focus ring stays visible on paper */
[data-theme="light"] :focus-visible { outline-color: var(--signal-text); }
[data-theme="light"] ::selection { background: #0b0b0c; color: #ece8e1; }

/* the act opens on the portal's paper: it rises over the last of the zoom (same paper, so the seam
   is invisible) instead of leaving a blank screen of it */
.portal--in + .act { margin-top: -58lvh; }

/* the act opens on the portal's paper — no need for a full dark-style lead-in */
.act > .about:first-child { padding-top: clamp(1.5rem, 4vh, 3rem); }
