/* ------------------------------------------------------------------
   Self-hosted writing faces (SIL Open Font License 1.1 — see fonts/OFL.txt).
   These replace the three Mac-only fonts so every typeface in the menu
   renders identically on macOS, Windows and Linux. Variable weight
   400-700 covers regular and bold; true italics included.
   Browsers fetch these only when the face is actually used.
------------------------------------------------------------------- */

@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/literata-normal-latin.woff2') format('woff2');
  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: 'Literata';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/literata-normal-latin-ext.woff2') format('woff2');
  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: 'Literata';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/literata-italic-latin.woff2') format('woff2');
  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: 'Literata';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/literata-italic-latin-ext.woff2') format('woff2');
  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: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-normal-latin.woff2') format('woff2');
  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: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-normal-latin-ext.woff2') format('woff2');
  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: 'Inter';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-italic-latin.woff2') format('woff2');
  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: 'Inter';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-italic-latin-ext.woff2') format('woff2');
  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: 'Work Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/worksans-normal-latin.woff2') format('woff2');
  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: 'Work Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/worksans-normal-latin-ext.woff2') format('woff2');
  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: 'Work Sans';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/worksans-italic-latin.woff2') format('woff2');
  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: 'Work Sans';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/worksans-italic-latin-ext.woff2') format('woff2');
  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;
}

/* ------------------------------------------------------------------
   Writer's Notepad — prototype stylesheet
   Palette: warm ivory paper, warm ink, one accent (wet-ink blue).
------------------------------------------------------------------- */

:root {
  color-scheme: light;
  --paper:     #F9F8F6;
  --chrome:    #F4F3F1;
  --chrome-2:  #E9E8E5;   /* pressed / hovered chrome */
  --ink:       #2A2520;
  --muted:     #8C8B88;
  --line:      #E4E3E0;
  --accent:    #43628C;   /* wet ink */
  --find-hl:   #F3E5A8;
  --find-cur:  #E9C96B;
  --selection: #D9E2EF;

  /* Library surfaces, built from the editor's own daylight palette so the
     two pages read as one app: the page takes the paper, the sticky
     header takes the chrome, dividers take the hairline. */
  --lib-bg:        #F9F8F6;   /* = --paper */
  --header-bg:     rgba(244, 243, 241, 0.78);   /* = --chrome, softened */
  --dim:           #6E6D6A;
  --dim-thin:      #5A5956;   /* --dim, for type with very thin strokes */
  --divider:       #E4E3E0;   /* = --line */
  --row-hover:     #F1F0EE;
  --menu-bg:       #FFFFFF;
  --menu-border:   #E0DFDC;
  --menu-hover:    #F1F0EE;
  --field-bg:      #EFEEEB;
  --field-focus:   #E9E8E5;   /* = --chrome-2 */
  --field-border:  #D8D7D3;
  --danger:        #C4362F;
  --ok:            #2F8F55;
  --icon:          #85847F;
  --toggle-off:    #D8D7D3;
  --knob:          #FFFFFF;   /* stays light on both track colours */

  /* Inter is self-hosted above, so menus, tabs and headings look the same
     on macOS and Windows instead of borrowing each system's own face. */
  --ui-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --editor-size: 17px;    /* scaled by zoom via JS */
  /* Height of the editor's floating menu bar + tab strip. Fixed, because
     the chrome does not scale with the editor's zoom. */
  --chrome-h: 67px;
}

/* Entry titles and excerpts in the library. Each typeface needs its own size
   and tracking to sit at the same visual weight. Not limited to :root, so
   the menu in Settings can preview each face on its own item. */
:root,
[data-entry-font='serif'] {
  --read-font: Georgia, "Times New Roman", serif;
  --read-title-size: 19px;
  --read-excerpt-size: 14.5px;
  --read-tracking: -0.015em;
  --read-excerpt-ink: var(--dim);
}

[data-entry-font='sans'] {
  --read-font: var(--ui-font);
  --read-title-size: 18px;
  --read-excerpt-size: 14px;
  --read-tracking: -0.015em;
}

[data-entry-font='mono'] {
  --read-font: "Courier New", Courier, monospace;
  --read-title-size: 18px;
  --read-excerpt-size: 14px;
  --read-tracking: -0.01em;
  --read-excerpt-ink: var(--dim-thin);
}

/* Dark: same lightness values, zero saturation — plain grays.
   Theme is set by JS (File > Theme); defaults to the system scheme. */
/* Dark: plain grays, no saturation. The values come from the Library
   design, and the editor now shares them — the writing surface is the
   same #171717 as the Library page, with the chrome a shade beneath it. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper:     #171717;   /* = --lib-bg; the page you write on */
  --chrome:    #141414;   /* menu bar, tab strip, status bar */
  --chrome-2:  #232323;
  --ink:       #DBDBDB;
  --muted:     #7B7B7B;
  --line:      #2E2E2E;
  --accent:    #A1A1A1;
  --find-hl:   #3A3A3A;
  --find-cur:  #555555;
  --selection: #454545;

  --lib-bg:        #171717;
  --header-bg:     #14141498;
  --dim:           #6F6F6F;
  --dim-thin:      #929292;
  --divider:       #303030;
  --row-hover:     #0C0C0C;
  --menu-bg:       #232323;
  --menu-border:   #333333;
  --menu-hover:    #2E2E2E;
  --field-bg:      #232323;
  --field-focus:   #2A2A2A;
  --field-border:  #3D3D3D;
  --danger:        #E5484D;
  --ok:            #2F9E5F;
  --icon:          #8F8F8F;
  --toggle-off:    #232323;
  --knob:          #DBDBDB;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
