/* BrainWeave — design tokens. Every colour, size, space and speed in the interface comes from here.
   Two themes: "paper" (light, the default) and "midnight" (dark). Nothing else may hard-code a colour. */

@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-ext.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans-ext.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans-italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* The faces the three colour looks use (all free, SIL Open Font Licence; fetched by tools/getfonts.py). */
@font-face { font-family: "Syne"; src: url("../fonts/syne.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Syne"; src: url("../fonts/syne-ext.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Schibsted Grotesk"; src: url("../fonts/schibsted-grotesk.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Schibsted Grotesk"; src: url("../fonts/schibsted-grotesk-ext.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Bricolage Grotesque"; src: url("../fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage Grotesque"; src: url("../fonts/bricolage-grotesque-ext.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-ext.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* the place you are in has a colour of its own in the colour looks (set per look with [data-place]); here it is just the accent */
  --place: var(--accent);
  --font-display: var(--font-read);   /* big titles; the colour looks swap in their own face */
  /* type */
  --font-read: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;   /* headings and anything you read */
  --font-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; /* controls and labels */
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 0.8125rem;   /* 13 — captions, counts */
  --fs-sm: 0.875rem;    /* 14 — secondary text, table cells */
  --fs-md: 0.9375rem;   /* 15 — controls and body */
  --fs-lg: 1.0625rem;   /* 17 — lead text, list titles */
  --fs-xl: 1.3125rem;   /* 21 — section headings */
  --fs-2xl: 1.75rem;    /* 28 — page titles on phones */
  --fs-3xl: 2.375rem;   /* 38 — page titles */
  --fs-4xl: 3.25rem;    /* 52 — welcome headline */
  --fs-read: 1.1875rem; /* 19 — the author's text */
  --lh-tight: 1.15; --lh-snug: 1.35; --lh-body: 1.5; --lh-read: 1.68;

  /* space — a 4px grid */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px; --s20: 80px;

  /* shape */
  --r-sm: 6px; --r: 10px; --r-lg: 16px; --r-full: 999px;

  /* layout */
  --sidebar-w: 256px; --rail-w: 68px; --topbar-h: 56px; --tabbar-h: 62px;
  --content-max: 1120px; --read-max: 44rem; --form-max: 30rem;
  --hit: 40px;        /* smallest pointer target; 44px on touch screens (set in base.css) */

  /* motion */
  --ease: cubic-bezier(.2, .7, .2, 1); --fast: 120ms; --slow: 220ms;

  /* layers */
  --z-nav: 20; --z-pop: 40; --z-dialog: 60; --z-toast: 80;
}

/* ───────── paper: the default, light ───────── */
:root, :root[data-theme="paper"] {
  color-scheme: light;
  --paper: #F6F3EC;        /* the page */
  --paper-sunk: #EEE9DD;   /* wells, the side bar, skeleton blocks */
  --surface: #FFFDF8;      /* cards, panels, inputs */
  --surface-raised: #FFFFFF;
  --ink: #1C1A16;          /* text */
  --ink-2: #48443C;        /* secondary text */
  --ink-3: #68635A;        /* captions and hints — 5.1:1 on paper */
  --line: #E0D9CA;         /* hairlines between things */
  --line-strong: #8A8374;  /* input and control edges — 3.3:1 on paper */
  --accent: #2A3B8F;       /* indigo thread: primary actions, links, focus */
  --accent-strong: #1F2C70;
  --accent-soft: #E4E8F8;  /* selected rows, chips */
  --on-accent: #FFFFFF;
  --madder: #B23A22;       /* madder thread: the brand's second colour, marks and counts */
  --madder-soft: #F8E4DC;
  --ok: #37652F; --ok-soft: #E2EEDC;
  --warn: #855600; --warn-soft: #F7EACB;
  --danger: #A12A1E; --danger-soft: #F9E1DC;
  --mark: #F6DF8E;         /* highlighter for search hits */
  --scrim: rgba(28, 26, 22, .42);
  --shadow-1: 0 1px 2px rgba(28, 26, 22, .06);
  --shadow-2: 0 12px 32px rgba(28, 26, 22, .14), 0 2px 6px rgba(28, 26, 22, .06);
  /* cloth colours for book covers and project spines */
  --cloth-1: #2A3B8F; --cloth-2: #8E2F1C; --cloth-3: #35593A; --cloth-4: #7A5510; --cloth-5: #5B2E5E; --cloth-6: #2F4A57;
}

/* ───────── midnight: dark ───────── */
:root[data-theme="midnight"] {
  color-scheme: dark;
  --paper: #15140F;
  --paper-sunk: #100F0B;
  --surface: #1E1C17;
  --surface-raised: #26241D;
  --ink: #EEE9DD;
  --ink-2: #CAC4B5;
  --ink-3: #A49E8F;
  --line: #302D26;
  --line-strong: #7D7768;
  --accent: #AEB9FF;
  --accent-strong: #C8D0FF;
  --accent-soft: #252A47;
  --on-accent: #14162B;
  --madder: #F2957E;
  --madder-soft: #3A211B;
  --ok: #A3D197; --ok-soft: #1F2E1C;
  --warn: #E8C272; --warn-soft: #33290F;
  --danger: #FFA294; --danger-soft: #3B1C18;
  --mark: #6A5613;
  --scrim: rgba(0, 0, 0, .6);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 12px 32px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .35);
  --cloth-1: #3C4DA6; --cloth-2: #9C3C28; --cloth-3: #3F6A45; --cloth-4: #8A641C; --cloth-5: #6C3B70; --cloth-6: #3A5C6B;
}

@media (max-width: 719px) {
  :root { --fs-3xl: 1.875rem; --fs-4xl: 2.375rem; --fs-read: 1.125rem; }
}
