/* BORROWED SIGNALS — base reset + shared overlays · SYSTEM EDITION (light)
   Every piece is full-bleed, full-screen, no scroll (unless the piece itself
   scrolls). Background/foreground come from the (now light) tokens, so the
   flip is automatic; the overlays below are re-tuned for paper. */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  width: 100%;
  background: var(--grey-dark);   /* now paper */
  color: var(--paper);            /* now ink   */
  font-family: var(--font-mono);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#scene {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* paper-grain overlay — dark grain multiplied onto paper (was light-on-dark) */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%20200%20200%27%3E%3Cfilter%20id%3D%27n%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%270.9%27%20numOctaves%3D%272%27%20stitchTiles%3D%27stitch%27/%3E%3C/filter%3E%3Crect%20width%3D%27100%25%27%20height%3D%27100%25%27%20filter%3D%27url%28%2523n%29%27/%3E%3C/svg%3E");
  z-index: 90;
}

/* ruled-paper overlay — faint instrument hairlines instead of CRT scanlines */
.scanline-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(22, 24, 29, 0.035) 0px,
    rgba(22, 24, 29, 0.035) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 1;
  z-index: 91;
}

/* glitch jitter for headline text (kept — the human breaking through) */
@keyframes glitch {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-2px, 1px); }
  40% { transform: translate(2px, -1px); }
  60% { transform: translate(-1px, 2px); }
  80% { transform: translate(1px, -2px); }
}
.glitch-text {
  animation: glitch 0.25s infinite steps(2, end);
}
.glitch-text:hover {
  animation-duration: 0.08s;
}

a { color: inherit; }

/* ── SYSTEM-EDITION chrome overrides ───────────────────────────────────
   Per-piece style.css files style .back-link as a dark indigo pill (built
   for the dark wall). These higher-specificity rules (html .x beats .x)
   re-skin the shared chrome to paper without editing each piece — and make
   the "back to the wall" control noticeably BIGGER and more tappable
   everywhere (one global change covers all pieces). */
html .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: rgba(250, 249, 246, 0.82);
  color: var(--grey-light);
  border: 1px solid var(--rule);
  border-radius: 3px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  text-shadow: none;
  text-decoration: none;
  /* bigger hit area + type than the per-piece 0.8rem default */
  font-family: var(--font-mono);
  font-size: clamp(0.82rem, 1.6vw, 0.95rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.62em 1.05em;
  opacity: 1;                 /* override the dim 0.4–0.5 some pieces set */
  box-shadow: 0 1px 0 rgba(22,24,29,0.04);
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .12s ease;
}
html .back-link:hover {
  color: var(--signal);
  border-color: var(--signal);
  background: rgba(255,255,255,0.95);
  transform: translateY(-1px);
  opacity: 1;
}
html .back-link:active { transform: translateY(0); }
/* keep the leading arrow optically aligned at the larger size */
html .back-link { line-height: 1; }
