/* particles-theme.css
   Dual-theme layer for the particle artwork section.
   Loads AFTER the existing particle layout CSS. All rules are scoped to
   .particle-section. Geometry, layout, spacing, sizes, position and gestures
   are not touched. Dark is the default; light comes from prefers-color-scheme.
*/

/* ------------------------------------------------------------------ */
/* Dark (default): keeps the current look and adds the shader contract  */
/* ------------------------------------------------------------------ */
.particle-section {
  color-scheme: dark;

  /* Shader contract. JS reads these and uses additive blending on dark. */
  --p-dot-ember: #fa4513;
  --p-dot-gold: #ffa857;
  --p-dot-ivory: #ffedc9;
}

/* ------------------------------------------------------------------ */
/* Light: fully light section with burnt-orange particles on ivory      */
/* ------------------------------------------------------------------ */
@media (prefers-color-scheme: light) {
  /* :root raises specificity to (0,2,0), so this beats the base rule and
     the <=700px layout background override at every width. */
  :root .particle-section {
    color-scheme: light;

    /* Section tokens. Contrast is measured on #f4f2ed. */
    --p-bg: #f4f2ed;
    --p-text: #1b1c1f;          /* about 15.4:1 */
    --p-muted: #62635d;         /* about 5.4:1 */
    --p-accent: #b4471f;        /* about 4.9:1 */
    --p-accent-soft: #8f3714;   /* about 6.9:1, used for hover and focus */
    --p-line: rgba(27, 28, 31, 0.16);  /* decorative divider */
    --p-control-line: #7d7e77;  /* about 3.7:1, control boundary */
    --p-track: rgba(27, 28, 31, 0.14);

    /* Shader contract. JS uses normal alpha blending on light.
       No white particles. Every hue clears 4.5:1 on ivory. */
    --p-dot-ember: #b8400f;     /* deep burnt orange, about 4.7:1 */
    --p-dot-gold: #9a5a1c;      /* copper, about 4.9:1 */
    --p-dot-ivory: #3b2b24;     /* warm charcoal in the ivory slot */

    /* Ivory field with a faint burnt-orange halo. No dark bottom wash. */
    background:
      radial-gradient(ellipse 70% 55% at 50% 42%, rgba(180, 71, 31, 0.09) 0%, rgba(180, 71, 31, 0.03) 45%, rgba(244, 242, 237, 0) 72%),
      #f4f2ed;
    background-color: #f4f2ed;
    color: var(--p-text);
  }

  /* Crisp dark copy: remove the dark-theme glow shadows */
  :root .particle-section .particle-copy h2,
  :root .particle-section .particle-copy p {
    text-shadow: none;
  }

  :root .particle-section .particle-copy h2 {
    color: var(--p-text);
  }

  :root .particle-section .particle-copy p {
    color: var(--p-muted);
  }

  /* Static fallback artwork (not the canvas) */
  :root .particle-section .particle-fallback {
    color: var(--p-accent);
    filter: drop-shadow(0 0 14px rgba(180, 71, 31, 0.18));
  }

  /* Footer and hint */
  :root .particle-section .particle-footer {
    border-top-color: var(--p-line);
  }

  :root .particle-section .particle-hint,
  :root .particle-section.is-paused .particle-hint,
  :root .particle-section .is-paused .particle-hint {
    color: var(--p-muted);
  }

  /* Control states */
  :root .particle-section .particle-footer button {
    color: var(--p-text);
    background-color: transparent;
    border-color: var(--p-control-line);
  }

  :root .particle-section .particle-footer button:hover {
    color: var(--p-accent-soft);
    border-color: var(--p-accent-soft);
    background-color: rgba(180, 71, 31, 0.06);
  }

  :root .particle-section .particle-footer button:focus-visible {
    outline-color: var(--p-accent-soft);
  }

  /* Pressed (paused) state: about 4.9:1 */
  :root .particle-section .particle-footer button[aria-pressed="true"] {
    background-color: var(--p-accent);
    border-color: var(--p-accent);
    color: var(--p-bg);
  }

  /* Pressed + hover: about 6.9:1 */
  :root .particle-section .particle-footer button[aria-pressed="true"]:hover {
    background-color: var(--p-accent-soft);
    border-color: var(--p-accent-soft);
    color: var(--p-bg);
  }
}
