/* styles/scenarios.css
   ----------------------------------------------------------------------
   Per-scenario environmental differentiation (P2-C + P2-D).

   The aesthetic backbone of each biome stays in styles/biomes/*.css —
   their established palettes (Foundry brass, Customs hall-green,
   Court gold, Waiting clinical-blue, Tide pool-teal) carry the BIOME
   identity. This file adds a SCENARIO layer ON TOP — a soft tonal
   wash + a couple of variable overrides — so the same Foundry reads
   differently when you visit it under cross_border vs marketplace.

   Driver: body[data-scenario="..."] (set in episode.js at boot and
   refreshed when the scenario picker resolves).

   The wash sits at z-index 8 (above biome SVG/elements at 1–5, below
   the voices at 20+) so prose stays crisp while the environment tints.

   first_payment is the baseline — no overrides. Returning players
   should see the canonical Kreuzberg-warm palette so they have a
   stable anchor to compare other scenarios against.
*/

/* =====================================================================
   CROSS-BORDER — São Paulo dusk. Warmer, dustier, faintly amber.
   The "long crossing this time" tonal cue.
   ===================================================================== */

body[data-scenario="cross_border"] {
  /* Ambient particle tempo — slower drift = the longer journey */
  --scenario-ambient-speed: 1.35;
  /* Scenario accent (consumed by ambient elements via var() reference) */
  --scenario-accent:        #e8a868;
  --scenario-accent-soft:   rgba(232, 168, 104, 0.14);
}

body[data-scenario="cross_border"] .scene.active::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  background:
    radial-gradient(
      ellipse 80% 60% at 80% 15%,
      var(--scenario-accent-soft) 0%,
      transparent 65%
    ),
    radial-gradient(
      ellipse 60% 50% at 10% 90%,
      rgba(168, 96, 48, 0.07) 0%,
      transparent 70%
    );
  /* No blend-mode — additive transparency is enough, and avoids the
     "mix-blend-mode dulls voice prose" hazard. */
}

/* Distant packets in the surface drift gain a warmer tint */
body[data-scenario="cross_border"] .surface-packet {
  filter: hue-rotate(-12deg) saturate(1.15);
}

/* Foundry brass accent picks up amber */
body[data-scenario="cross_border"] #foundry-belt,
body[data-scenario="cross_border"] .data-tile.placed {
  filter: hue-rotate(-6deg) saturate(1.08);
}

/* =====================================================================
   MARKETPLACE — Amsterdam morning. Cooler, more institutional,
   slightly desaturated. The "platform-perspective" tonal cue.
   ===================================================================== */

body[data-scenario="marketplace"] {
  --scenario-ambient-speed: 0.85;   /* faster bustle */
  --scenario-accent:        #98c0d8;
  --scenario-accent-soft:   rgba(152, 192, 216, 0.12);
}

body[data-scenario="marketplace"] .scene.active::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  background:
    radial-gradient(
      ellipse 80% 60% at 50% 0%,
      var(--scenario-accent-soft) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 90% 30% at 50% 100%,
      rgba(80, 110, 140, 0.08) 0%,
      transparent 75%
    );
}

/* Distant packets in the surface drift gain a cooler tint */
body[data-scenario="marketplace"] .surface-packet {
  filter: hue-rotate(15deg) saturate(0.85) brightness(1.05);
}

/* Boardroom (marketplace's Foundry replacement) gets the cooler accent
   on its commission-split panel borders */
body[data-scenario="marketplace"] .foundry-extra-panel.boardroom {
  border-color: var(--scenario-accent) !important;
}

/* =====================================================================
   AMBIENT TEMPO — drives per-scenario animation duration on shared
   ambient classes. Each ambient element multiplies its base duration
   by --scenario-ambient-speed (default 1 if not set). Biomes can opt
   in by using the variable in their animation declarations; for now
   the surface-packet override above demonstrates the pattern.
   ===================================================================== */

:root { --scenario-ambient-speed: 1; }

/* =====================================================================
   REDUCED MOTION — the filter-based ambient-particle tints don't
   move, so they stay. But we explicitly disable the radial-gradient
   layering pulse on the .scene::after pseudo-element if any future
   variant adds one (currently static, but the guard is cheap to add
   now and impossible to retrofit later).
   ===================================================================== */

@media (prefers-reduced-motion: reduce) {
  body[data-scenario="cross_border"] .scene.active::after,
  body[data-scenario="marketplace"] .scene.active::after {
    animation: none;
  }
}
