/* AuthorOS design tokens. Four themes share one layout; only these values change.
   Every colour in the interface comes from here (bin/css_lint.php refuses any other).
   Quiet Library is the default and the only definition on :root. */
:root, [data-theme="quiet-library"]{
  color-scheme:dark;
  --bg-primary:#141210;   --bg-secondary:#1B1815;
  --surface:#1F1B17;      --surface-elevated:#272219;  --surface-alpha:rgba(255,248,235,.04);
  --border:#332C24;       --border-strong:#4A4033;
  --text-primary:#F1E9DA; --text-secondary:#C1B7A5;    --text-muted:#8E8474;
  --accent-primary:#D9A85E; --accent-ink:#1A1408;      --accent-soft:rgba(217,168,94,.14);
  --accent-secondary:#6FD3C7; --accent-secondary-soft:rgba(111,211,199,.14);
  --success:#5FB57A; --warning:#E0B354; --danger:#E06B5F; --info:#6FD3C7;
  --focus-ring:#D9A85E;
  --shadow:0 10px 30px rgba(0,0,0,.35);
  --glow:none;
  --cover-shadow:0 8px 20px rgba(0,0,0,.4);
  --scrim:rgba(0,0,0,.55);
  --grid:none;
  --cover-paper:#FFFFFF; --cover-ink:#1E1A16;
}
[data-theme="future-blue"]{
  color-scheme:dark;
  --bg-primary:#070B1A;   --bg-secondary:#0B1226;
  --surface:#0F1630;      --surface-elevated:#151F42;  --surface-alpha:rgba(160,180,255,.06);
  --border:#1F2A52;       --border-strong:#33427A;
  --text-primary:#E8ECFF; --text-secondary:#AEB8E6;    --text-muted:#76809F;
  --accent-primary:#5B8CFF; --accent-ink:#04091C;      --accent-soft:rgba(91,140,255,.16);
  --accent-secondary:#9B7BFF; --accent-secondary-soft:rgba(155,123,255,.16);
  --success:#62C98C; --warning:#E3B85A; --danger:#EF7A70; --info:#7FB3FF;
  --focus-ring:#8FB0FF;
  --shadow:0 12px 34px rgba(0,0,0,.5);
  --glow:0 0 0 1px rgba(91,140,255,.25), 0 0 24px rgba(91,140,255,.18);
  --cover-shadow:0 8px 22px rgba(0,0,0,.55);
  --scrim:rgba(3,6,20,.6);
  --grid:none;
}
[data-theme="neural-console"]{
  color-scheme:dark;
  --bg-primary:#0A0D0C;   --bg-secondary:#0D1210;
  --surface:#101514;      --surface-elevated:#151C1A;  --surface-alpha:rgba(53,224,161,.05);
  --border:#1E2A26;       --border-strong:#2C3C36;
  --text-primary:#E6F2EC; --text-secondary:#A9BFB5;    --text-muted:#6F857C;
  --accent-primary:#35E0A1; --accent-ink:#05140D;      --accent-soft:rgba(53,224,161,.14);
  --accent-secondary:#3FD6E0; --accent-secondary-soft:rgba(63,214,224,.14);
  --success:#35E0A1; --warning:#E6C15A; --danger:#F07A6B; --info:#3FD6E0;
  --focus-ring:#35E0A1;
  --shadow:0 10px 30px rgba(0,0,0,.5);
  --glow:0 0 0 1px rgba(53,224,161,.18);
  --cover-shadow:0 8px 22px rgba(0,0,0,.55);
  --scrim:rgba(4,8,7,.62);
  --grid:linear-gradient(rgba(53,224,161,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(53,224,161,.035) 1px, transparent 1px);
}

/* Reading Room: the one light theme. Paper rather than white, so a long session on a bright
   screen does not glare, and a gold dark enough to be read as text on it rather than decoration.
   Every pairing here clears 4.5:1 against the ground it sits on. */
[data-theme="reading-room"]{
  color-scheme:light;
  --bg-primary:#FAF7F0;   --bg-secondary:#F2EDE2;
  --surface:#FFFFFF;      --surface-elevated:#FFFDF8;  --surface-alpha:rgba(60,48,30,.05);
  --border:#E3DCCC;       --border-strong:#9A8B70;
  --text-primary:#231F18; --text-secondary:#544C40;    --text-muted:#736A5B;
  --accent-primary:#8A6417; --accent-ink:#FFFFFF;      --accent-soft:rgba(138,100,23,.12);
  --accent-secondary:#1F6F66; --accent-secondary-soft:rgba(31,111,102,.12);
  --success:#2C6E45; --warning:#8A6417; --danger:#A93826; --info:#1F6F66;
  --focus-ring:#8A6417;
  --shadow:0 10px 28px rgba(60,48,30,.12);
  --glow:none;
  --cover-shadow:0 8px 20px rgba(60,48,30,.20);
  --scrim:rgba(35,31,24,.45);
  --grid:none;
  --cover-paper:#FFFFFF; --cover-ink:#1E1A16;
}

/* The reader's own page colour, independent of the app theme (the Apostle reads long
   text; paper-like grounds are a reading choice, not a theme). */
/* The dark page is the default and must be declared FIRST: the three selectors carry the same
   specificity, so a later rule wins, and light and sepia have to come after to take effect. */
:root, [data-reader="dark"]{ --read-bg:var(--bg-primary); --read-ink:var(--text-primary); --read-ink-2:var(--text-secondary); --read-rule:var(--border); --read-accent:var(--accent-primary); }
[data-reader="light"]{ --read-bg:#F7F3EA; --read-ink:#1E1A16; --read-ink-2:#6B655C; --read-rule:#E1DBCF; --read-accent:#8C6A22; color-scheme:light; }
[data-reader="sepia"]{ --read-bg:#EFE3CB; --read-ink:#3B2F1E; --read-ink-2:#7A6A50; --read-rule:#DCCDAF; --read-accent:#8C6A22; color-scheme:light; }

/* type, shape, motion */
:root{
  --serif:"EB Garamond",Georgia,"Times New Roman",serif;
  --sans:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --radius:12px; --radius-sm:10px; --radius-pill:999px;
  --read-size:1.125rem; --read-lh:1.7;
  --shell-max:74rem; --content-max:64rem; --sidebar:15.5rem;
  --ease:180ms ease;
}

/* Names the earlier views use, kept as aliases so every screen inherits the theme. */
:root{
  --paper:var(--bg-primary); --paper-2:var(--surface); --ink:var(--text-primary); --ink-2:var(--text-secondary);
  --rule:var(--border); --royal:var(--accent-primary); --royal-ink:var(--accent-ink); --royal-soft:var(--accent-soft);
  --gold:var(--accent-primary); --ok:var(--success); --warn:var(--warning); --bad:var(--danger);
}
