/* The Book of Glen — design tokens. Palette: "midnight library".
   Ink roles are strict:
   --gold          CTA fills, foil, active nav, focus ring
   --navy / --terracotta  chapter ink (illustration, labels, numbers)
   --night / --wood  the desk the book lies on, never inside the pages */

/* Self-hosted from Google Fonts (SIL Open Font License). */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/assets/fonts/fraunces-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: "Fraunces";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/assets/fonts/fraunces-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url("/assets/fonts/fraunces-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: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/literata-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("/assets/fonts/literata-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #f4ecd9;
  --paper-shade: #e8dcc1;
  --paper-edge: #d9caa6;
  --ink: #1b2032;
  --ink-2: rgb(27 32 50 / 0.78);
  --ink-3: rgb(27 32 50 / 0.68);
  --line: rgb(27 32 50 / 0.14);
  --line-strong: rgb(27 32 50 / 0.32);

  --night: #0e1424;
  --night-2: #162038;
  --leather: #1d2a4a;
  --leather-dark: #111a31;
  --wood: #2b1e17;
  --wood-light: #4a3324;
  --on-night: #f4ecd9;
  --on-night-2: rgb(244 236 217 / 0.72);

  --gold: #c9a14a;
  --gold-light: #ecd391;
  --gold-deep: #7a5c20;
  --foil: linear-gradient(100deg, #8e6d2a 0%, #e9cf86 22%, #b38a35 40%, #f3e1a4 58%, #a07c31 78%, #e1c27a 100%);
  --navy: #2f4f86;
  --terracotta: #b5532f;
  --navy-text: #2f4f86;
  --terracotta-text: #9a4422;
  --highlight: rgb(201 161 74 / 0.42);
  --ok: #3c7a52;

  /* Sticky-note papers from readers' notes. */
  --note-yellow: #f3df7e;
  --note-pink: #f2bdb3;
  --note-green: #cfe0a8;
  --note-blue: #bcd5ea;

  --accent: var(--gold);
  --accent-press: #b48c38;
  --accent-line: var(--gold-deep);

  --chapter-ink: var(--navy);
  --chapter-text: var(--navy-text);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-text: "Literata", "Iowan Old Style", Georgia, serif;
  --font-code: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.625rem;
  --text-2xl: clamp(2rem, 1.4rem + 2vw, 2.75rem);
  --text-title: clamp(3.25rem, 2rem + 5vw, 6.5rem);
  --text-cover: clamp(3rem, 2rem + 4.2vw, 5.75rem);

  --leading-tight: 1.02;
  --leading-snug: 1.3;
  --leading-text: 1.65;
  --tracking-caps: 0.12em;

  --s1: 0.5rem;
  --s2: 1rem;
  --s3: 1.5rem;
  --s4: 2rem;
  --s5: 3rem;
  --s6: 4.5rem;
  --s7: 6rem;

  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-pill: 999px;

  --masthead-h: 52px;
  --cover-edge: 10px;

  --duration-fast: 120ms;
  --duration-default: 200ms;
  --duration-slow: 320ms;
  --duration-turn: 820ms;
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-page: cubic-bezier(0.45, 0.05, 0.25, 1);
}

/* --chapter-text is the hue tuned to pass 4.5:1 on paper, for small text. */
[data-ink="blue"] { --chapter-ink: var(--navy); --chapter-text: var(--navy-text); }
[data-ink="green"] { --chapter-ink: var(--terracotta); --chapter-text: var(--terracotta-text); }

@media (max-width: 899px) {
  :root {
    --cover-edge: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-default: 0ms;
    --duration-slow: 0ms;
    --duration-turn: 0ms;
  }
}
