/* ==========================================================================
   Soul Sounds Academy (SSA) — design tokens  ·  "Nocturne"
   A concert hall after dark: near-black stage, warm gold light, a violet
   haze in the rafters and a cool teal for money that arrived online.

   Three palettes share one set of names. The keys stay the same as before
   (app.js and localStorage use them), only the look changed:
     brass  →  Nocturne  (default, warm dark)
     paper  →  Daylight  (light)
     ink    →  Onyx      (true black, high contrast)

   Every colour a component uses comes from here. Colours that need alpha
   are also exposed as space-separated RGB (--x-rgb) for rgb(var(--x-rgb) / a).
   ========================================================================== */

/* ---------- Fonts (self-hosted; served from /css/fonts) ----------
   The app: Newsreader (display, variable weight and optical size) with
   IBM Plex Sans (interface, variable weight). Sign-in and the overture keep
   Instrument Serif + Geist (pinned in shell.css); Geist Mono is shared. */
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin-standard-normal.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin-standard-italic.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/ibm-plex-sans-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  /* ---------- Type ---------- */
  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-ui: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* The sign-in pair, kept as it was */
  --font-display-login: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-ui-login: "Geist", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  /* A modular scale (1.2) around a 14px UI base */
  --fs-2xs: 0.6875rem;  /* 11 */
  --fs-xs: 0.75rem;     /* 12 */
  --fs-sm: 0.8125rem;   /* 13 */
  --fs-base: 0.875rem;  /* 14 */
  --fs-md: 1rem;        /* 16 */
  --fs-lg: 1.25rem;     /* 20 */
  --fs-xl: 1.625rem;    /* 26 */
  --fs-2xl: 2.25rem;    /* 36 */
  --fs-3xl: clamp(2.5rem, 1.6rem + 2.6vw, 3.75rem);   /* screen titles */
  --fs-hero: clamp(3rem, 1.6rem + 4.6vw, 5.75rem);   /* the one big figure (Newsreader sets wider than the old face) */

  --lh-tight: 1.05;
  --lh-snug: 1.3;
  --lh-body: 1.55;
  --tracking-tight: -0.02em;
  --tracking-wide: 0.14em;

  /* ---------- Space (4px grid) ---------- */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px;
  --s-9: 56px; --s-10: 72px;

  /* ---------- Radii ---------- */
  --r-xs: 6px;
  --r-ctl: 10px;       /* inputs, buttons */
  --r-card: 18px;      /* panels, cards */
  --r-xl: 28px;        /* hero, login */
  --r-pill: 999px;

  /* ---------- Layout ---------- */
  --sidebar-w: 256px;
  --appbar-h: 64px;
  --content-max: 1360px;
  --gutter: clamp(16px, 2.6vw, 40px);

  /* ---------- Opacity steps ---------- */
  --o-1: 0.9; --o-2: 0.66; --o-3: 0.42;

  color-scheme: dark;
}

/* =====================================================================
   Nocturne (key: brass) — the default
   ===================================================================== */
:root,
:root[data-theme="brass"] {
  --bg-rgb: 8 8 12;
  --bg: rgb(var(--bg-rgb));
  --bg-2: #0E0D14;
  --bg-sunk: #050508;

  /* Glass surfaces sit over the aurora; the solid versions sit over anything */
  --surface: rgb(255 255 255 / 0.028);
  --surface-2: rgb(255 255 255 / 0.05);
  --surface-3: rgb(255 255 255 / 0.08);
  --surface-solid: #111018;
  --surface-solid-2: #17161F;
  --surface-raised: #1B1A24;

  --paper-rgb: 246 240 229;         /* the warm white of text */
  --paper: rgb(var(--paper-rgb));
  --text-1: #F6F0E5;
  --text-2: rgb(246 240 229 / 0.64);
  --text-3: rgb(246 240 229 / 0.58);
  --text-inv: #120F09;

  --line: rgb(255 255 255 / 0.07);
  --line-strong: rgb(255 255 255 / 0.13);
  --line-hot: rgb(255 255 255 / 0.22);

  /* Gold: the one accent. Everything that matters glows in it. */
  --brass-rgb: 242 196 109;
  --brass: rgb(var(--brass-rgb));
  --brass-hover: #FFD68A;
  --brass-deep: #D98E3B;
  --brass-ink: #1A1206;
  --gold-grad: linear-gradient(135deg, #FFE7B0 0%, #F2C46D 38%, #E3A04A 72%, #C9772E 100%);
  --gold-text: linear-gradient(180deg, #FFF1CF 0%, #F6CD7B 45%, #D9913F 100%);

  /* Signals */
  --online-rgb: 94 225 198;          /* paid online (teal) */
  --online: rgb(var(--online-rgb));
  --ember-rgb: 255 118 102;          /* unpaid, loss, danger (coral) */
  --ember: rgb(var(--ember-rgb));
  --violet-rgb: 139 108 255;         /* atmosphere only, never data */
  --violet: rgb(var(--violet-rgb));
  --positive: #7FE3A6;

  /* Inputs */
  --input-bg: rgb(255 255 255 / 0.035);
  --input-bg-hot: rgb(255 255 255 / 0.06);
  --focus-border: rgb(var(--brass-rgb) / 0.8);
  --focus-ring: 0 0 0 4px rgb(var(--brass-rgb) / 0.16);

  /* Depth */
  --shadow-1: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-2: 0 1px 0 rgb(255 255 255 / 0.05) inset, 0 12px 32px -12px rgb(0 0 0 / 0.7);
  --shadow-3: 0 1px 0 rgb(255 255 255 / 0.06) inset, 0 30px 80px -20px rgb(0 0 0 / 0.85), 0 0 0 1px rgb(255 255 255 / 0.06);
  --shadow-btn-rest: 0 1px 0 rgb(255 255 255 / 0.35) inset, 0 -1px 0 rgb(0 0 0 / 0.2) inset, 0 6px 18px -8px rgb(var(--brass-rgb) / 0.55);
  --shadow-btn-hover: 0 1px 0 rgb(255 255 255 / 0.45) inset, 0 -1px 0 rgb(0 0 0 / 0.2) inset, 0 10px 28px -8px rgb(var(--brass-rgb) / 0.7);
  --highlight-btn: 0 0 0 1px rgb(var(--brass-rgb) / 0.4);
  --glow-brass-soft: 0 0 40px -6px rgb(var(--brass-rgb) / 0.45);

  /* Atmosphere */
  --aurora-1: rgb(var(--violet-rgb) / 0.20);
  --aurora-2: rgb(var(--brass-rgb) / 0.13);
  --aurora-3: rgb(var(--online-rgb) / 0.07);
  --glass-blur: 10px;       /* the one blur level for glass (cards, app bar) */
  --scrim: rgb(4 4 8 / 0.62);

  /* Payment cells */
  --cell-paid-bg: var(--brass);
  --cell-paid-ink: var(--brass-ink);
  --cell-online-bg: var(--online);
  --cell-online-ink: #04261F;
  --cell-unpaid: var(--ember);
  --cell-upcoming: rgb(255 255 255 / 0.14);

  color-scheme: dark;
}

/* =====================================================================
   Daylight (key: paper)
   ===================================================================== */
:root[data-theme="paper"] {
  --bg-rgb: 246 243 237;
  --bg: rgb(var(--bg-rgb));
  --bg-2: #EFEBE3;
  --bg-sunk: #E9E4DA;

  --surface: rgb(255 255 255 / 0.66);
  --surface-2: rgb(255 255 255 / 0.85);
  --surface-3: #FFFFFF;
  --surface-solid: #FFFFFF;
  --surface-solid-2: #FBF9F5;
  --surface-raised: #FFFFFF;

  --paper-rgb: 24 20 30;
  --paper: rgb(var(--paper-rgb));
  --text-1: #17141E;
  --text-2: rgb(23 20 30 / 0.72);
  --text-3: rgb(23 20 30 / 0.64);
  --text-inv: #FFFFFF;

  --line: rgb(23 20 30 / 0.08);
  --line-strong: rgb(23 20 30 / 0.15);
  --line-hot: rgb(23 20 30 / 0.28);

  --brass-rgb: 176 112 26;
  --brass: rgb(var(--brass-rgb));
  --brass-hover: #C27D1F;
  --brass-deep: #8E5510;
  --brass-ink: #FFFFFF;
  --gold-grad: linear-gradient(135deg, #D9A04A 0%, #B7771F 50%, #93590F 100%);
  --gold-text: linear-gradient(180deg, #C7862B 0%, #A6661A 55%, #7E4A0C 100%);

  --online-rgb: 13 148 124;
  --online: rgb(var(--online-rgb));
  --ember-rgb: 214 66 52;
  --ember: rgb(var(--ember-rgb));
  --violet-rgb: 112 86 230;
  --violet: rgb(var(--violet-rgb));
  --positive: #178A4B;

  --input-bg: #FFFFFF;
  --input-bg-hot: #FFFFFF;
  --focus-border: rgb(var(--brass-rgb) / 0.8);
  --focus-ring: 0 0 0 4px rgb(var(--brass-rgb) / 0.14);

  --shadow-1: 0 1px 2px rgb(40 30 10 / 0.06);
  --shadow-2: 0 1px 2px rgb(40 30 10 / 0.05), 0 12px 32px -14px rgb(40 30 10 / 0.18);
  --shadow-3: 0 30px 80px -24px rgb(40 30 10 / 0.3), 0 0 0 1px rgb(23 20 30 / 0.06);
  --shadow-btn-rest: 0 1px 0 rgb(255 255 255 / 0.3) inset, 0 6px 16px -8px rgb(var(--brass-rgb) / 0.6);
  --shadow-btn-hover: 0 1px 0 rgb(255 255 255 / 0.35) inset, 0 10px 24px -8px rgb(var(--brass-rgb) / 0.7);
  --highlight-btn: 0 0 0 1px rgb(var(--brass-rgb) / 0.35);
  --glow-brass-soft: 0 0 32px -8px rgb(var(--brass-rgb) / 0.4);

  --aurora-1: rgb(var(--violet-rgb) / 0.10);
  --aurora-2: rgb(var(--brass-rgb) / 0.12);
  --aurora-3: rgb(var(--online-rgb) / 0.06);
  --scrim: rgb(30 24 14 / 0.32);

  --cell-paid-bg: var(--brass);
  --cell-paid-ink: #FFFFFF;
  --cell-online-bg: var(--online);
  --cell-online-ink: #FFFFFF;
  --cell-unpaid: var(--ember);
  --cell-upcoming: rgb(23 20 30 / 0.16);

  color-scheme: light;
}

/* =====================================================================
   Onyx (key: ink) — true black, stronger lines, brighter signals
   ===================================================================== */
:root[data-theme="ink"] {
  --bg-rgb: 0 0 0;
  --bg: #000;
  --bg-2: #060606;
  --bg-sunk: #000;

  --surface: rgb(255 255 255 / 0.04);
  --surface-2: rgb(255 255 255 / 0.07);
  --surface-3: rgb(255 255 255 / 0.11);
  --surface-solid: #0B0B0C;
  --surface-solid-2: #121214;
  --surface-raised: #17171A;

  --paper-rgb: 255 255 255;
  --paper: #fff;
  --text-1: #FFFFFF;
  --text-2: rgb(255 255 255 / 0.74);
  --text-3: rgb(255 255 255 / 0.64);
  --text-inv: #000;

  --line: rgb(255 255 255 / 0.12);
  --line-strong: rgb(255 255 255 / 0.22);
  --line-hot: rgb(255 255 255 / 0.4);

  --brass-rgb: 255 210 122;
  --brass: rgb(var(--brass-rgb));
  --brass-hover: #FFE2A6;
  --brass-deep: #F0A845;
  --brass-ink: #000;
  --gold-grad: linear-gradient(135deg, #FFF0C8 0%, #FFD27A 45%, #F0A845 100%);
  --gold-text: linear-gradient(180deg, #FFFFFF 0%, #FFE3A6 40%, #FFC35C 100%);

  --online-rgb: 90 245 212;
  --online: rgb(var(--online-rgb));
  --ember-rgb: 255 110 96;
  --ember: rgb(var(--ember-rgb));
  --violet-rgb: 150 125 255;
  --positive: #8BF5B5;

  --input-bg: rgb(255 255 255 / 0.05);
  --input-bg-hot: rgb(255 255 255 / 0.08);

  --aurora-1: rgb(var(--violet-rgb) / 0.12);
  --aurora-2: rgb(var(--brass-rgb) / 0.08);
  --aurora-3: rgb(var(--online-rgb) / 0.04);
  --scrim: rgb(0 0 0 / 0.72);

  --cell-upcoming: rgb(255 255 255 / 0.24);

  color-scheme: dark;
}

/* A palette change repaints almost everything at once; transitions are
   suppressed for that one frame so the swap is clean (app.js toggles this) */
.is-theming, .is-theming *, .is-theming *::before, .is-theming *::after {
  transition: none !important;
}
