/* ============================================================================
   Notamine site tokens — the same "Stationery Arcade" tokens as the app.
   The page is a desk; the sheets lying on it are paper. Reward colours (ember, sun, pink, violet…)
   stay hidden until you earn them by typing.
   ========================================================================== */

@font-face { font-family: 'Bricolage'; src: url('../fonts/bricolage.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Instrument'; src: url('../fonts/instrument-sans.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url('../fonts/newsreader.woff2') format('woff2'); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url('../fonts/newsreader-italic.woff2') format('woff2'); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: 'JetBrains'; src: url('../fonts/jetbrains-mono.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('../fonts/caveat.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --font-display: 'Bricolage', 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --font-ui: 'Instrument', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --font-hand: 'Caveat', 'Segoe Print', cursive;

  /* reward palette (constant across themes) */
  --ember: #ff5a36;
  --sun: #ffc83d;
  --mint: #38e5a5;
  --blue: #5b6bff;
  --pink: #ff5da2;
  --sky: #5bb8ff;
  --violet: #9b6bff;

  /* flow tiers: idle · warm · focused · flow · overdrive */
  --t0: #b9ae9b;
  --t1: #ffc83d;
  --t2: #ff7a2f;
  --t3: #ff3d81;
  --t4: #8e7bff;

  /* beacon inks — semantic, identical in every theme */
  --b-exam: #ffc83d;
  --b-question: #5bb8ff;
  --b-define: #38e5a5;
  --b-example: #ff8a5b;
  --b-todo: #ff5da2;

  --marker-a: 38%;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 28px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --wrap: 1180px;
  --gutter: clamp(20px, 5vw, 56px);
  --nav-h: 68px;
}

/* ---------------------------------------------------------------- Daylight Paper (site default) */
:root,
[data-theme='paper'] {
  color-scheme: light;
  --marker-a: 62%;
  --bg: #ece3d1;
  --bg-2: #e4d9c3;
  --surface: #f5eee0;
  --surface-2: #fbf6ea;
  --surface-3: #ffffff;
  --border: rgba(43, 33, 24, 0.12);
  --border-strong: rgba(43, 33, 24, 0.26);
  --text: #2b2118;
  --text-dim: #5e5040;
  --text-faint: #6f6150;
  --accent: #e8431f;
  --accent-ink: #fff7ef;
  --accent-soft: color-mix(in srgb, #e8431f 14%, transparent);
  --link: #3441e0;
  --shadow: 0 30px 60px -28px rgba(70, 48, 20, 0.45), 0 2px 6px rgba(70, 48, 20, 0.08);
  --paper-bg: #fffbf2;
  --paper-text: #2a2017;
  --paper-dim: #61533f;
  --paper-faint: #7e705b;
  --paper-rule: rgba(60, 100, 170, 0.14);
  --paper-edge: rgba(43, 33, 24, 0.1);
  --paper-margin: rgba(232, 67, 31, 0.38);
  --code-bg: rgba(43, 33, 24, 0.07);
  --grain-opacity: 0.09;
  --t0: #9a8c76;
}

/* ---------------------------------------------------------------- Night Desk */
[data-theme='night'] {
  color-scheme: dark;
  --marker-a: 38%;
  --bg: #14110d;
  --bg-2: #1a1611;
  --surface: #211b15;
  --surface-2: #2a231b;
  --surface-3: #342b21;
  --border: rgba(244, 235, 221, 0.09);
  --border-strong: rgba(244, 235, 221, 0.2);
  --text: #f4ebdd;
  --text-dim: #bfb3a0;
  --text-faint: #8a7f6f;
  --accent: #ff5a36;
  --accent-ink: #1b0d08;
  --accent-soft: color-mix(in srgb, #ff5a36 18%, transparent);
  --link: #8e9bff;
  --shadow: 0 30px 70px -26px rgba(0, 0, 0, 0.8), 0 2px 6px rgba(0, 0, 0, 0.3);
  --paper-bg: #1f1a14;
  --paper-text: #f1e8d8;
  --paper-dim: #b3a792;
  --paper-faint: #6f6657;
  --paper-rule: rgba(241, 232, 216, 0.075);
  --paper-edge: rgba(241, 232, 216, 0.09);
  --paper-margin: rgba(255, 90, 54, 0.3);
  --code-bg: rgba(241, 232, 216, 0.08);
  --grain-opacity: 0.05;
  --t0: #b9ae9b;
}

/* ---------------------------------------------------------------- Deep Space */
[data-theme='oled'] {
  color-scheme: dark;
  --marker-a: 38%;
  --bg: #000000;
  --bg-2: #07070a;
  --surface: #0e0e14;
  --surface-2: #15151e;
  --surface-3: #1d1d29;
  --border: rgba(180, 190, 255, 0.11);
  --border-strong: rgba(180, 190, 255, 0.24);
  --text: #eef0ff;
  --text-dim: #aab0d6;
  --text-faint: #6d7399;
  --accent: #5b6bff;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, #5b6bff 22%, transparent);
  --link: #8e9bff;
  --shadow: 0 0 0 1px rgba(120, 130, 255, 0.12), 0 24px 60px -22px rgba(70, 80, 255, 0.4);
  --paper-bg: #05050a;
  --paper-text: #e9ebff;
  --paper-dim: #9aa1cc;
  --paper-faint: #555a80;
  --paper-rule: rgba(160, 170, 255, 0.07);
  --paper-edge: rgba(130, 140, 255, 0.2);
  --paper-margin: rgba(91, 107, 255, 0.45);
  --code-bg: rgba(160, 170, 255, 0.1);
  --grain-opacity: 0;
  --t0: #b9ae9b;
}

/* ---------------------------------------------------------------- Terminal */
[data-theme='terminal'] {
  color-scheme: dark;
  --marker-a: 36%;
  --bg: #04100a;
  --bg-2: #061a10;
  --surface: #08200f;
  --surface-2: #0b2c15;
  --surface-3: #0f3a1c;
  --border: rgba(80, 255, 140, 0.14);
  --border-strong: rgba(80, 255, 140, 0.3);
  --text: #b8ffcf;
  --text-dim: #6fd993;
  --text-faint: #3f9a5f;
  --accent: #39ff7a;
  --accent-ink: #02150a;
  --accent-soft: color-mix(in srgb, #39ff7a 16%, transparent);
  --link: #7dffb0;
  --shadow: 0 0 0 1px rgba(57, 255, 122, 0.18), 0 24px 60px -22px rgba(57, 255, 122, 0.28);
  --paper-bg: #031009;
  --paper-text: #b8ffcf;
  --paper-dim: #6fd993;
  --paper-faint: #2f7a49;
  --paper-rule: rgba(57, 255, 122, 0.08);
  --paper-edge: rgba(57, 255, 122, 0.25);
  --paper-margin: rgba(57, 255, 122, 0.38);
  --code-bg: rgba(57, 255, 122, 0.1);
  --grain-opacity: 0.06;
  --t0: #3f9a5f;
}

/* ---------------------------------------------------------------- Sakura */
[data-theme='sakura'] {
  color-scheme: dark;
  --marker-a: 38%;
  --bg: #1c1220;
  --bg-2: #231728;
  --surface: #2b1c31;
  --surface-2: #35233c;
  --surface-3: #422c4a;
  --border: rgba(255, 190, 220, 0.12);
  --border-strong: rgba(255, 190, 220, 0.25);
  --text: #ffe8f2;
  --text-dim: #d9aec6;
  --text-faint: #9a7189;
  --accent: #ff7eb6;
  --accent-ink: #2a0a1a;
  --accent-soft: color-mix(in srgb, #ff7eb6 18%, transparent);
  --link: #ffa6cf;
  --shadow: 0 30px 70px -26px rgba(20, 0, 20, 0.8);
  --paper-bg: #28182e;
  --paper-text: #ffeaf4;
  --paper-dim: #d3a9c0;
  --paper-faint: #86607a;
  --paper-rule: rgba(255, 190, 220, 0.08);
  --paper-edge: rgba(255, 190, 220, 0.14);
  --paper-margin: rgba(255, 126, 182, 0.42);
  --code-bg: rgba(255, 190, 220, 0.1);
  --grain-opacity: 0.05;
  --t0: #b9a0b0;
}

/* ---------------------------------------------------------------- Deep Ocean */
[data-theme='ocean'] {
  color-scheme: dark;
  --marker-a: 38%;
  --bg: #08141a;
  --bg-2: #0b1c24;
  --surface: #0f2630;
  --surface-2: #143240;
  --surface-3: #1a4153;
  --border: rgba(120, 230, 255, 0.12);
  --border-strong: rgba(120, 230, 255, 0.26);
  --text: #e4fbff;
  --text-dim: #9cd0dc;
  --text-faint: #5d909e;
  --accent: #19d3c5;
  --accent-ink: #00201d;
  --accent-soft: color-mix(in srgb, #19d3c5 18%, transparent);
  --link: #7fe3f5;
  --shadow: 0 30px 70px -26px rgba(0, 20, 30, 0.85);
  --paper-bg: #0c2029;
  --paper-text: #e1f9ff;
  --paper-dim: #94c7d4;
  --paper-faint: #4f8190;
  --paper-rule: rgba(120, 230, 255, 0.07);
  --paper-edge: rgba(120, 230, 255, 0.14);
  --paper-margin: rgba(25, 211, 197, 0.42);
  --code-bg: rgba(120, 230, 255, 0.09);
  --grain-opacity: 0.04;
  --t0: #6aa0ae;
}

/* ---------------------------------------------------------------- Graphite */
[data-theme='mono'] {
  color-scheme: dark;
  --marker-a: 38%;
  --bg: #111111; --bg-2: #161616; --surface: #1e1e1e; --surface-2: #272727; --surface-3: #323232;
  --border: rgba(255, 255, 255, 0.09); --border-strong: rgba(255, 255, 255, 0.2);
  --text: #ededed; --text-dim: #b4b4b4; --text-faint: #7d7d7d;
  --accent: #ececec; --accent-ink: #111111; --accent-soft: rgba(255, 255, 255, 0.12); --link: #d4d4d4;
  --shadow: 0 30px 70px -26px rgba(0, 0, 0, 0.85);
  --paper-bg: #1a1a1a; --paper-text: #eaeaea; --paper-dim: #a8a8a8; --paper-faint: #666;
  --paper-rule: rgba(255, 255, 255, 0.06); --paper-edge: rgba(255, 255, 255, 0.1); --paper-margin: rgba(255, 255, 255, 0.22);
  --code-bg: rgba(255, 255, 255, 0.08); --grain-opacity: 0.03; --t0: #8a8a8a;
}

/* ---------------------------------------------------------------- Espresso */
[data-theme='coffee'] {
  color-scheme: dark;
  --marker-a: 38%;
  --bg: #1a120d; --bg-2: #20160f; --surface: #2a1d14; --surface-2: #34251a; --surface-3: #402e20;
  --border: rgba(255, 225, 190, 0.1); --border-strong: rgba(255, 225, 190, 0.22);
  --text: #f5e6d3; --text-dim: #c7ab8e; --text-faint: #8e7459;
  --accent: #e0a458; --accent-ink: #1f1309; --accent-soft: color-mix(in srgb, #e0a458 18%, transparent); --link: #eab97e;
  --shadow: 0 30px 70px -26px rgba(0, 0, 0, 0.8);
  --paper-bg: #2b1e15; --paper-text: #f3e3cf; --paper-dim: #b89c80; --paper-faint: #75604c;
  --paper-rule: rgba(243, 227, 207, 0.07); --paper-edge: rgba(243, 227, 207, 0.09); --paper-margin: rgba(224, 164, 88, 0.4);
  --code-bg: rgba(243, 227, 207, 0.09); --grain-opacity: 0.06; --t0: #a58b72;
}

/* ---------------------------------------------------------------- Matcha */
[data-theme='matcha'] {
  color-scheme: light;
  --marker-a: 60%;
  --t0: #7a8a6e;
  --bg: #dfe7d3; --bg-2: #d6e0c8; --surface: #e9efde; --surface-2: #f2f6ea; --surface-3: #fbfdf6;
  --border: rgba(40, 60, 30, 0.14); --border-strong: rgba(40, 60, 30, 0.28);
  --text: #1f2b18; --text-dim: #46583b; --text-faint: #6f7f63;
  --accent: #3d8a4f; --accent-ink: #f4fff0; --accent-soft: color-mix(in srgb, #3d8a4f 15%, transparent); --link: #2f6f3f;
  --shadow: 0 30px 60px -28px rgba(40, 70, 30, 0.45), 0 2px 6px rgba(40, 70, 30, 0.08);
  --paper-bg: #fbfdf4; --paper-text: #1d2a16; --paper-dim: #4d6040; --paper-faint: #9aa88e;
  --paper-rule: rgba(61, 138, 79, 0.15); --paper-edge: rgba(40, 60, 30, 0.12); --paper-margin: rgba(61, 138, 79, 0.45);
  --code-bg: rgba(40, 60, 30, 0.07); --grain-opacity: 0.08;
}

/* ---------------------------------------------------------------- Blueprint */
[data-theme='blueprint'] {
  color-scheme: dark;
  --marker-a: 40%;
  --bg: #0b2043; --bg-2: #0d264e; --surface: #123062; --surface-2: #173a75; --surface-3: #1e4688;
  --border: rgba(190, 225, 255, 0.17); --border-strong: rgba(190, 225, 255, 0.32);
  --text: #e8f4ff; --text-dim: #aacbee; --text-faint: #6f94c2;
  --accent: #ffd24d; --accent-ink: #0a1a33; --accent-soft: color-mix(in srgb, #ffd24d 16%, transparent); --link: #8fd0ff;
  --shadow: 0 30px 70px -26px rgba(0, 10, 40, 0.85);
  --paper-bg: #0f2c58; --paper-text: #eaf5ff; --paper-dim: #a2c4ea; --paper-faint: #5f86b8;
  --paper-rule: rgba(190, 225, 255, 0.13); --paper-edge: rgba(190, 225, 255, 0.28); --paper-margin: rgba(255, 210, 77, 0.5);
  --code-bg: rgba(190, 225, 255, 0.1); --grain-opacity: 0; --t0: #8aaed8;
}
[data-theme='blueprint'] body {
  background-image:
    linear-gradient(rgba(190, 225, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(190, 225, 255, 0.05) 1px, transparent 1px);
  background-size: 36px 36px;
}

/* ---------------------------------------------------------------- Neon City */
[data-theme='cyber'] {
  color-scheme: dark;
  --marker-a: 38%;
  --bg: #0a0512; --bg-2: #0f0719; --surface: #160b27; --surface-2: #1e1035; --surface-3: #2a1747;
  --border: rgba(255, 60, 200, 0.22); --border-strong: rgba(255, 60, 200, 0.42);
  --text: #f6ebff; --text-dim: #c9aaea; --text-faint: #8768b0;
  --accent: #ff2fb8; --accent-ink: #1b0314; --accent-soft: color-mix(in srgb, #ff2fb8 18%, transparent); --link: #38e1ff;
  --shadow: 0 0 0 1px rgba(255, 47, 184, 0.28), 0 24px 60px -16px rgba(255, 47, 184, 0.4);
  --paper-bg: #0e0720; --paper-text: #f4e9ff; --paper-dim: #b99ae0; --paper-faint: #6d4f98;
  --paper-rule: rgba(56, 225, 255, 0.1); --paper-edge: rgba(255, 47, 184, 0.38); --paper-margin: rgba(255, 47, 184, 0.55);
  --code-bg: rgba(56, 225, 255, 0.1); --grain-opacity: 0.02; --t0: #8f72b8;
}
[data-theme='cyber'] body {
  background-image:
    radial-gradient(900px 500px at 90% -10%, rgba(255, 47, 184, 0.16), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(56, 225, 255, 0.12), transparent 60%);
  background-attachment: fixed;
}

/* ---------------------------------------------------------------- Terminal swaps the UI fonts, like the app */
[data-theme='terminal'] {
  --font-ui: 'JetBrains', ui-monospace, monospace;
  --font-serif: 'JetBrains', ui-monospace, monospace;
}

/* ============================================================================
   Paper stocks — override just the sheets, whatever desk is active
   ========================================================================== */
[data-paper='cream'] { --paper-bg: #f8f0de; --paper-text: #2a2017; --paper-dim: #61533f; --paper-faint: #7e705b; --paper-rule: rgba(80, 110, 170, 0.15); --paper-edge: rgba(43, 33, 24, 0.12); --paper-margin: rgba(214, 60, 40, 0.38); --code-bg: rgba(43, 33, 24, 0.07); --marker-a: 62%; }
[data-paper='kraft'] { --paper-bg: #cdab80; --paper-text: #2b1d10; --paper-dim: #5a4025; --paper-faint: #8f7048; --paper-rule: rgba(70, 40, 12, 0.14); --paper-edge: rgba(60, 35, 10, 0.2); --paper-margin: rgba(120, 30, 10, 0.4); --code-bg: rgba(60, 35, 10, 0.1); --marker-a: 60%; }
[data-paper='legal'] { --paper-bg: #fbf1a4; --paper-text: #1d2b52; --paper-dim: #3d4f80; --paper-faint: #8c93a8; --paper-rule: rgba(60, 110, 210, 0.35); --paper-edge: rgba(90, 80, 20, 0.2); --paper-margin: rgba(222, 40, 40, 0.65); --code-bg: rgba(29, 43, 82, 0.08); --marker-a: 58%; }
[data-paper='slate'] { --paper-bg: #dde5ee; --paper-text: #1b2533; --paper-dim: #475569; --paper-faint: #8793a5; --paper-rule: rgba(60, 90, 130, 0.17); --paper-edge: rgba(30, 50, 80, 0.15); --paper-margin: rgba(70, 100, 160, 0.4); --code-bg: rgba(30, 50, 80, 0.08); --marker-a: 60%; }
[data-paper='chalk'] { --paper-bg: #1f3a2f; --paper-text: #f1f5ee; --paper-dim: #bcd0c2; --paper-faint: #6f8f7c; --paper-rule: rgba(255, 255, 255, 0.07); --paper-edge: rgba(120, 90, 50, 0.7); --paper-margin: rgba(255, 255, 255, 0.28); --code-bg: rgba(255, 255, 255, 0.1); --marker-a: 36%; }
