/* Red Node colour tokens, light and dark. Shared by the landing, the legal pages and (later) /rednode/app.
   The theme comes from prefers-color-scheme unless the visitor picked one: <html data-theme="light|dark">,
   stored in localStorage "rs-theme" (one key for all of redstudio.site). */
:root{
  color-scheme:light;
  --paper:#FFFFFF;      /* page */
  --surface:#FFFFFF;    /* raised bits: inputs, chips, avatars */
  --wash:#F4F3F1;       /* message bubbles, code */
  --ink:#0E0E0E;        /* headings, main text */
  --ink2:#4B4843;       /* body text */
  --ink3:#6B675F;       /* secondary text, captions (AA on paper and wash) */
  --ink4:#A9A59D;       /* decoration only, never text that must be read */
  --line:#E7E4DF;       /* hairlines */
  --line2:#D6D2CB;      /* stronger outlines */
  --line-soft:#EFEDE9;  /* inner dividers */
  --red:#E0262F;        /* the accent: lines, marks, fills */
  --red-ink:#B8141D;    /* red text */
  --on-ink:#FFFFFF;     /* text on an ink-filled button */
  --on-red:#FFFFFF;     /* text on a red fill */
  --alarm:rgba(224,38,47,.055);
  --cv-red:#E0262F;     /* canvas pulse lines */
  --cv-dot:#C3BFB8;     /* canvas dotted track */
  --cv-glow:0;          /* canvas glow radius, px */
  --cv-alarm:rgba(224,38,47,.055);
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    color-scheme:dark;
    --paper:#0E0D0C;
    --surface:#191816;
    --wash:#1C1B19;
    --ink:#F3F1EE;
    --ink2:#C4BFB7;
    --ink3:#9F998F;
    --ink4:#5E5A54;
    --line:#2A2825;
    --line2:#3B3834;
    --line-soft:#232120;
    --red:#E0262F;
    --red-ink:#FF6B70;
    --on-ink:#0E0D0C;
    --on-red:#FFFFFF;
    --alarm:rgba(224,38,47,.13);
    --cv-red:#E8333C;
    --cv-dot:#4D4943;
    --cv-glow:7;
    --cv-alarm:rgba(224,38,47,.12);
  }
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --paper:#0E0D0C;
  --surface:#191816;
  --wash:#1C1B19;
  --ink:#F3F1EE;
  --ink2:#C4BFB7;
  --ink3:#9F998F;
  --ink4:#5E5A54;
  --line:#2A2825;
  --line2:#3B3834;
  --line-soft:#232120;
  --red:#E0262F;
  --red-ink:#FF6B70;
  --on-ink:#0E0D0C;
  --on-red:#FFFFFF;
  --alarm:rgba(224,38,47,.13);
  --cv-red:#E8333C;
  --cv-dot:#4D4943;
  --cv-glow:7;
  --cv-alarm:rgba(224,38,47,.12);
}

/* theme switch in the header: one button, moon in light, sun in dark */
.theme-btn{display:inline-grid;place-items:center;flex:none;width:44px;height:44px;border:0;border-radius:10px;background:transparent;color:var(--ink2);cursor:pointer;transition:color .2s,background-color .2s;-webkit-tap-highlight-color:transparent}
.theme-btn:hover{color:var(--ink);background:var(--wash)}
.theme-btn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.theme-btn .i-sun{display:none}
:root[data-theme-now="dark"] .theme-btn .i-sun{display:block}
:root[data-theme-now="dark"] .theme-btn .i-moon{display:none}
html.theme-anim,html.theme-anim *,html.theme-anim *::before,html.theme-anim *::after{transition:background-color .35s ease,color .35s ease,border-color .35s ease,fill .35s ease,stroke .35s ease!important}
html:not(.js) .theme-btn{display:none}
