/* 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 author 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; }

/* Mukoba: the design of Timothy Mukoba Books (the bookshelf shop), so the author moves between his
   shop and his studio in one visual world. Navy and gold; dark editorial navy by default, paper and
   navy ink when the device is light. Sorts Mill Goudy for headings, Plus Jakarta Sans for the UI. */
[data-theme="mukoba"]{
  color-scheme:dark;
  --bg-primary:#0B1020;   --bg-secondary:#0E1526;
  --surface:#121A2B;      --surface-elevated:#182238;  --surface-alpha:rgba(227,184,102,.05);
  --border:#253049;       --border-strong:#34405C;
  --text-primary:#F3EEE4; --text-secondary:#D2CABB;    --text-muted:#A8A293;
  --accent-primary:#E3B866; --accent-ink:#1A1407;      --accent-soft:rgba(227,184,102,.14);
  --accent-secondary:#9CC8F0; --accent-secondary-soft:rgba(156,200,240,.14);
  --success:#7FD3A1; --warning:#F0C56E; --danger:#F4A08C; --info:#9CC8F0;
  --focus-ring:#E3B866;
  --shadow:0 1px 2px rgba(0,0,0,.45),0 12px 32px rgba(0,0,0,.4);
  --glow:none;
  --cover-shadow:0 2px 6px rgba(0,0,0,.5),0 18px 40px rgba(0,0,0,.45);
  --scrim:rgba(5,8,18,.62);
  --grid:none;
  --cover-paper:#FFFFFF; --cover-ink:#14213D;
}
@media (prefers-color-scheme: light){
  [data-theme="mukoba"]{
    color-scheme:light;
    --bg-primary:#F6F7F9;   --bg-secondary:#EEF0F3;
    --surface:#FFFFFF;      --surface-elevated:#FFFFFF;  --surface-alpha:rgba(20,33,61,.035);
    --border:#E2E6EB;       --border-strong:#D2D7DE;
    --text-primary:#151A26; --text-secondary:#3A4150;    --text-muted:#5D6472;
    --accent-primary:#14213D; --accent-ink:#FFFFFF;      --accent-soft:rgba(20,33,61,.08);
    --accent-secondary:#8A5F17; --accent-secondary-soft:rgba(138,95,23,.12);
    --success:#1D6B43; --warning:#8A5A0A; --danger:#A8321F; --info:#1D5591;
    --focus-ring:#14213D;
    --shadow:0 1px 2px rgba(21,26,38,.05),0 10px 30px rgba(21,26,38,.09);
    --cover-shadow:0 2px 6px rgba(21,26,38,.08),0 14px 34px rgba(21,26,38,.16);
    --scrim:rgba(21,26,38,.45);
  }
}

/* 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);
}

/* the Mukoba theme's own type and shape (after the shared :root values, so they win) */
:root[data-theme="mukoba"]{
  --serif:"Sorts Mill Goudy","Iowan Old Style",Georgia,serif;
  --sans:"Plus Jakarta Sans",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --radius:16px;
}
