/* ═══ site-bg.css — the board's full ambient background, on every reading page ═══
   So an article feels like it's still floating inside the main page: the drifting
   particle field (canvas.scene, drawn by story-scene.js), the faint Krishna +
   life imagery (bg-collage), the portrait veil glow, and the mantra/markets/code
   text columns (veil-streams, drawn by site-bg.js). Self-contained: works whether
   the page loads lab.css or reader.css.
   The article itself sits on a subtle backlit board — see the bottom block. */

/* ---- particle field canvas (story-scene.js draws + reveals it) ---- */
.scene {
  position: fixed; inset: 0; z-index: -1; display: block;
  width: 100%; height: 100%; pointer-events: none;
  opacity: 0; transform: translateZ(0); will-change: opacity;
  transition: opacity 1600ms ease;
}
.scene.is-live { opacity: 1; }

/* ---- fine overlay grain ---- */
.noise {
  position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: 0.2;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.24) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 50%, rgba(255, 255, 255, 0.2) 0 1px, transparent 1px);
  background-size: 17px 19px, 23px 29px;
  mix-blend-mode: overlay;
}

/* ---- the portrait veil, breathing behind everything ---- */
.veil {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: url("assets/rajat-hoodie.jpg") 72% 30% / cover no-repeat;
  opacity: 0.08;
  filter: saturate(0.9) brightness(1.35) contrast(1.05);
  -webkit-mask-image: radial-gradient(75% 85% at 62% 42%, #000 30%, transparent 76%);
  mask-image: radial-gradient(75% 85% at 62% 42%, #000 30%, transparent 76%);
  animation: veilBreathe 26s ease-in-out infinite;
}
@keyframes veilBreathe {
  0%, 100% { opacity: 0.06; transform: scale(1); }
  50%      { opacity: 0.11; transform: scale(1.03); }
}

/* ---- the ambient life collage: Krishna + music/trading/coding/fitness, faint ---- */
.bg-collage { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
.bgc {
  position: absolute;
  background-position: center; background-size: cover; background-repeat: no-repeat;
  filter: grayscale(0.4) sepia(0.22) brightness(1.12) contrast(1.04);
  mix-blend-mode: screen;
  opacity: var(--o, 0.1);
  -webkit-mask-image: radial-gradient(ellipse 72% 72% at 50% 50%, #000 30%, transparent 80%);
  mask-image: radial-gradient(ellipse 72% 72% at 50% 50%, #000 30%, transparent 80%);
}
.bgc-me {
  left: 50%; top: 8vh; width: 46vw; height: 82vh; transform: translateX(-50%);
  background-image: url("assets/vishwaroop-2.jpg");   /* the vishvarupa — Krishna's cosmic form */
  background-position: center 42%; --o: 0.12;
}
.bgc-music   { left: 16vw; bottom: -6vh; width: 32vw; height: 46vh; background-image: url("assets/bg-music.jpg");   --o: 0.12; }
.bgc-trading { right: -4vw; top: 12vh;   width: 34vw; height: 42vh; background-image: url("assets/bg-trading.jpg"); --o: 0.20; }
.bgc-coding  { right: 4vw;  bottom: -4vh; width: 32vw; height: 42vh; background-image: url("assets/bg-coding.jpg");  --o: 0.10; }

/* ---- background text field — mantra · markets · code · music (site-bg.js) ---- */
.veil-streams {
  position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 6%, #000 94%, transparent);
}
.vcol {
  position: absolute; top: 0; white-space: pre;
  font-family: var(--mono, monospace);
  font-size: 13px; line-height: 1.7; letter-spacing: 0.14em;
  opacity: 0.15; will-change: transform;
}
.vcol.up { animation: vcolUp linear infinite; }
.vcol.dn { animation: vcolDn linear infinite; }
@keyframes vcolUp { from { transform: translateY(0); }   to { transform: translateY(-50%); } }
@keyframes vcolDn { from { transform: translateY(-50%); } to { transform: translateY(0); } }

.t-binary  { color: rgba(151, 200, 163, 0.9);  text-shadow: 0 0 8px rgba(151, 200, 163, 0.4); }
.t-mantra  { color: rgba(201, 164, 93, 0.92);  text-shadow: 0 0 8px rgba(201, 164, 93, 0.45); opacity: 0.2; }
.t-trading { color: rgba(145, 205, 165, 0.92); text-shadow: 0 0 8px rgba(145, 205, 165, 0.4); }
.t-trading .dn-neg { color: rgba(226, 120, 120, 0.95); }
.t-code    { color: rgba(150, 195, 215, 0.92); text-shadow: 0 0 8px rgba(150, 195, 215, 0.4); }
.t-code .cur { opacity: 0.9; animation: curBlink 1s steps(1) infinite; }
.t-music   { color: rgba(180, 160, 228, 0.92); text-shadow: 0 0 8px rgba(180, 160, 228, 0.4); }
@keyframes curBlink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) { .vcol { animation: none !important; } .veil { animation: none; } }
@media (max-width: 760px) {
  .vcol { opacity: 0.1; font-size: 11px; }
  .bgc { --o: 0.14; }
  .bgc-me { left: 50%; transform: translateX(-50%); width: 92vw; height: 46vh; top: 14vh; }
}

/* ═══ the article sits on a subtle, backlit board ═══
   frosted dark glass + a soft gold backlight, so the reading column floats
   over the field instead of being painted flat on it. */
.read, .reader, .index-wrap {
  position: relative;
  background: linear-gradient(180deg, rgba(13, 11, 7, 0.66), rgba(9, 8, 5, 0.6));
  -webkit-backdrop-filter: blur(4px) saturate(1.05);
  backdrop-filter: blur(4px) saturate(1.05);
  border: 1px solid rgba(201, 164, 93, 0.16);
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 242, 214, 0.05),
    0 30px 90px rgba(0, 0, 0, 0.5),
    0 0 160px -40px rgba(201, 164, 93, 0.4);   /* the backlight */
  padding: clamp(1.6rem, 4vw, 3.4rem);
}
@media (max-width: 640px) {
  .reader, .index-wrap { border-radius: 14px; padding: 1.3rem 1.15rem; }
}

/* ═══ the reading plate — the article board becomes a component on the motherboard ═══
   decorations injected by reader-plate.js: corner screws, silkscreen part labels,
   a live gold trace down the margin that fills with your reading progress, and a
   glowing drop-cap. */
.plate { padding-left: clamp(2.4rem, 5vw, 4.2rem) !important; }

/* corner screws — same ceramic-and-gold language as the board's die screws */
.plate-screw {
  position: absolute; width: 13px; height: 13px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 34% 30%, #7a6738, #221a0d 72%);
  box-shadow: inset 0 1px 1px rgba(255, 240, 200, 0.25), 0 1px 2px rgba(0, 0, 0, 0.6);
}
.plate-screw::after {
  content: ""; position: absolute; inset: 3px;
  border-top: 1.4px solid rgba(201, 164, 93, 0.55); transform: rotate(34deg);
}
.plate-screw.tl { left: 12px; top: 12px; } .plate-screw.tr { right: 12px; top: 12px; }
.plate-screw.bl { left: 12px; bottom: 12px; } .plate-screw.br { right: 12px; bottom: 12px; }

/* silkscreen part labels — printed on the board */
.plate-silk {
  position: absolute; pointer-events: none;
  font-family: var(--mono, monospace); font-size: 0.6rem; letter-spacing: 0.26em;
  text-transform: uppercase; color: rgba(201, 164, 93, 0.5);
}
.plate-silk.tl { left: 36px; top: 14px; }
.plate-silk.tr { right: 36px; top: 14px; }
.plate-silk.foot { left: 0; right: 0; bottom: 13px; text-align: center; font-size: 0.56rem; color: rgba(201, 164, 93, 0.3); }

/* the margin trace — a gold circuit line that lights up as you read (current flow) */
.plate-rail {
  position: absolute; left: 21px; top: 52px; bottom: 52px; width: 2px;
  border-radius: 2px; overflow: hidden; pointer-events: none;
  background: rgba(201, 164, 93, 0.14);
}
.plate-rail-fill {
  position: absolute; left: 0; top: 0; width: 100%; height: 0%;
  background: linear-gradient(180deg, rgba(232, 186, 116, 0.95), rgba(201, 164, 93, 0.55));
  box-shadow: 0 0 10px rgba(201, 164, 93, 0.85);
  transition: height 120ms linear;
}
.plate-rail::after {   /* a bright current pulse always travelling down the trace */
  content: ""; position: absolute; left: -1px; width: 4px; height: 46px; top: -46px;
  background: linear-gradient(180deg, transparent, rgba(255, 242, 208, 0.95), transparent);
  animation: railPulse 5s linear infinite;
}
@keyframes railPulse { to { top: 108%; } }
@media (prefers-reduced-motion: reduce) { .plate-rail::after { display: none; } }

/* illuminated drop-cap to open the piece */
.dropcap::first-letter {
  float: left; font-family: var(--sans, sans-serif); font-weight: 900;
  font-size: 3.5em; line-height: 0.8; padding: 0.02em 0.14em 0 0;
  color: var(--gold, #c9a45d); text-shadow: 0 0 24px rgba(201, 164, 93, 0.45);
}
@media (max-width: 640px) {
  .plate { padding-left: 1.15rem !important; }
  .plate-rail, .plate-silk.tl, .plate-silk.tr { display: none; }
}
