/* =====================================================================
   site-tokens.css — Interstellar Run site tokens (--ir-*), part of the
   SITE CSS layer (loaded after theme-base.css + brand-interstellar.css,
   before the fun themes). Kit files are never edited; everything the kit
   doesn't know about (neon glows, the scrolling grid, scanlines, header
   panel, tag colours, angled clip shapes) is defined here, derived from
   kit tokens by default and tuned per theme below.
   ===================================================================== */
:root {
  /* Colours are derived from kit tokens, so any theme (incl. kit fun themes) stays consistent. */
  --ir-blue: var(--color-accent);
  --ir-heading: var(--color-accent);        /* card titles, post title     */
  --ir-heading-2: var(--color-accent-2);    /* post body h2                */
  --ir-heading-3: var(--color-text);        /* post body h3                */
  --ir-tag-bg: var(--color-accent);         /* category tag                */
  --ir-tag-fg: var(--color-accent-contrast);
  --ir-header-bg: var(--brand-gradient);    /* header backdrop             */
  --ir-header-panel: var(--color-surface);  /* title panel on the backdrop */
  --ir-header-title: var(--color-text);
  --ir-shadow-color: #000000;               /* neutral drop shadows        */
  --ir-backdrop: #000000;                   /* modal scrims                */
  --ir-qr-bg: #ffffff;                      /* 2FA QR code: always white   */
  --ir-btn-gradient: linear-gradient(135deg, var(--color-accent), var(--color-accent-2)); /* admin primary buttons */
  --ir-btn-gradient-fg: var(--color-accent-contrast);

  /* Effects: off unless a theme turns them on. Glow colours of
     "transparent" make every neon glow disappear without touching layout. */
  --ir-glow-1: transparent;
  --ir-glow-2: transparent;
  --ir-glow-3: transparent;
  --ir-glow-4: transparent;
  --ir-grid-color: transparent;
  --ir-grid-opacity: 1;
  --ir-grid-animation: none;
  --ir-scanlines: none;
  --ir-scanline-opacity: 1;
  --ir-h1-animation: none;
  --ir-card-shadow: var(--shadow-sm);

  /* Angled "new wave" shapes are part of the brand, in every theme. */
  --ir-clip-header: polygon(0 0, 100% 0, 98% 100%, 2% 100%);
  --ir-clip-card: polygon(0 0, 98% 0, 100% 10px, 100% 100%, 2% 100%, 0 calc(100% - 10px));
  --ir-clip-tag: polygon(5% 0, 100% 0, 95% 100%, 0 100%);
  --ir-clip-button: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
}

/* Dark (and OS-dark with no stored choice): softened neon glows. */
:root[data-theme="dark"] {
  --ir-glow-1: #b98cff;  --ir-glow-2: #ff7ac0;  --ir-glow-3: #8fe3ff;  --ir-glow-4: #6a4fc0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --ir-glow-1: #b98cff;  --ir-glow-2: #ff7ac0;  --ir-glow-3: #8fe3ff;  --ir-glow-4: #6a4fc0;
  }
}

/* retro80s: the original Interstellar Run effects. */
:root[data-theme="retro80s"] {

  --ir-blue: #0080ff;
  --ir-heading: #00ffff;
  --ir-heading-2: #ff00ff;
  --ir-heading-3: #b54dff;
  --ir-tag-bg: #b54dff;
  --ir-tag-fg: #050510;
  --ir-header-bg: linear-gradient(135deg, #9d00ff 0%, #ff0080 50%, #00ffff 100%);
  --ir-header-panel: rgb(10 10 26 / .9);
  --ir-header-title: #e0e0ff;
  --ir-glow-1: #00ffff;
  --ir-glow-2: #ff00ff;
  --ir-glow-3: #ff0080;
  --ir-glow-4: #9d00ff;
  --ir-grid-color: rgb(0 255 255 / .2);
  --ir-grid-opacity: .3;
  --ir-grid-animation: ir-grid-scroll 20s linear infinite;
  --ir-scanlines: repeating-linear-gradient(0deg, rgb(0 0 0 / .15), rgb(0 0 0 / .15) 1px, transparent 1px, transparent 2px);
  --ir-scanline-opacity: .5;
  --ir-h1-animation: ir-flicker 5s infinite alternate;
  --ir-card-shadow: 0 0 #0000;
  --ir-btn-gradient: linear-gradient(135deg, #9d00ff, #d6006b); /* original was #9d00ff→#ff0080; end darkened so white text passes 4.5:1 */
  --ir-btn-gradient-fg: #ffffff;
}

/* eink: flat, no glow, no motion. */
:root[data-theme="eink"] {

  --ir-blue: #0066cc;
  --ir-heading: #0066cc;
  --ir-heading-2: #000000;
  --ir-heading-3: #555555;
  --ir-tag-bg: #555555;
  --ir-tag-fg: #f5f5f5;
  --ir-header-bg: #f5f5f5;
  --ir-header-panel: #ffffff;
  --ir-header-title: #1a1a1a;
  --ir-glow-1: transparent;
  --ir-glow-2: transparent;
  --ir-glow-3: transparent;
  --ir-glow-4: transparent;
  --ir-grid-color: transparent;
  --ir-grid-animation: none;
  --ir-scanlines: none;
  --ir-h1-animation: none;
  --ir-card-shadow: var(--shadow-sm);
}
