/*
  StoaReads design tokens, Gallery (Juno, DESIGN-C.md §1; Seph's yes, WS-19).
  The dark set is WS-7a's dark (the one the app and this site already share) with a navy band added.
  test/tokens.test.mjs holds every value to the spec table, so a change here is a change to the spec.
  One type system for stoareads.com (SPEC-TYPE-SYSTEM, Juno, Nov 14): Newsreader 500 for display, Public Sans 400 and
  600 for the interface, both self-hosted under the SIL OFL (fonts/OFL-*.txt).
*/
@font-face {
  font-family: 'Newsreader';
  src: url('/fonts/newsreader-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Public Sans';
  src: url('/fonts/public-sans-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Public Sans';
  src: url('/fonts/public-sans-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* Newsreader's measured stand-in while it loads, the same faces My Shelf uses (#544): Times New Roman or Liberation
   Serif, its metric twin; Noto Serif on Android. */
@font-face {
  font-family: 'Newsreader Fallback';
  src: local('Times New Roman'), local('TimesNewRomanPSMT'), local('Liberation Serif'), local('LiberationSerif');
  size-adjust: 106.8%;
  ascent-override: 68.8%;
  descent-override: 24.8%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Newsreader Fallback Noto';
  src: local('Noto Serif'), local('NotoSerif-Regular');
  size-adjust: 95%;
  ascent-override: 77.4%;
  descent-override: 27.9%;
  line-gap-override: 0%;
}

/* Public Sans' measured stand-in, regular and bold: Arial or Liberation Sans (its metric twin), width scaled to Public
   Sans' average advance over a pangram plus the page's own labels and genre names (103.9% at 400, 98.5% at 600 against
   Bold), ascent and descent from Public Sans' own tables (1900 and 450 per 2000) over that scale. */
@font-face {
  font-family: 'Public Sans Fallback';
  src: local('Arial'), local('ArialMT'), local('Liberation Sans'), local('LiberationSans');
  font-weight: 400;
  size-adjust: 103.9%;
  ascent-override: 91.4%;
  descent-override: 21.6%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Public Sans Fallback';
  src: local('Arial Bold'), local('Arial-BoldMT'), local('Liberation Sans Bold'), local('LiberationSans-Bold');
  font-weight: 600;
  size-adjust: 98.5%;
  ascent-override: 96.5%;
  descent-override: 22.8%;
  line-gap-override: 0%;
}

:root {
  color-scheme: light dark;

  /* Grounds */
  --page: #f5f6f9;
  --sunk: #e9ecf3;
  --band: #0f1b3d;
  --field: #ffffff;
  --foot: #eef0f5;

  /* Text and lines */
  --ink: #11152a;
  --soft: #454a5e;
  --faint: #62677a;
  --line: #dde0e9;
  --line-strong: #c2c7d4;

  /* Accent */
  --accent: #2f44b5;
  --on-accent: #ffffff;
  /* The one filled primary, the same on every .com page and the app (Juno, design pass Nov 14) */
  --fill: #2f44b5;
  --on-fill: #ffffff;

  /* On the navy band */
  --band-ink: #f3f5fb;
  --band-soft: #c3c9de;
  --band-accent: #aab8ff;
  --on-band-accent: #0b1020;
  --band-line: rgba(255, 255, 255, 0.18);
  --band-field: rgba(255, 255, 255, 0.08);
  /* "Read" (WS-36): a filled check on the band, light and dark alike. */
  --band-saved: #8fd3bd;

  /* The proof dot only: never text, never a fill, never without its line of text. */
  --proof: #b8912a;

  /* Covers are the only things with shadows. */
  --cover-shadow: 0 2px 4px rgba(15, 27, 61, 0.12), 0 14px 30px -14px rgba(15, 27, 61, 0.45);
  --cover-shadow-hi: 0 4px 8px rgba(15, 27, 61, 0.16), 0 24px 40px -16px rgba(15, 27, 61, 0.55);

  /* Type */
  --display: 'Newsreader', 'Newsreader Fallback', 'Newsreader Fallback Noto', Georgia, serif;
  --sans: 'Public Sans', 'Public Sans Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs-hero: 42px;
  --fs-h1: 38px;
  /* One page title size (Juno R3-24): 32px under 1000, 44px from 1000. */
  --h-page: 32px;
  /* Two heading ranks (Juno, polish PL1): a page section, and a section inside a column. No h2 under 20 px. */
  --h-section: 24px;
  --h-sub: 20px;
  --fs-h2: var(--h-section);
  --fs-h3: 19px;
  --fs-lead: 19px;
  --fs-body: 16px;
  --fs-tile: 15px;
  --fs-small: 15px;
  --fs-meta: 15px;

  /* Space: 6, 10, 16, 24, 36, 56 */
  --s1: 6px;
  --s2: 10px;
  --s3: 16px;
  --s4: 24px;
  --s5: 36px;
  --s6: 56px;
  --sec: 56px;
  --foot-gap: 88px;

  /* Grid */
  --maxw: 1280px;
  --gut: 20px;

  /* Shape */
  /* Two radii only (R3-26): controls (buttons, fields, selects, segmented) and cards (cards, tiles, sheets, menus). */
  --r-control: 8px;
  --r-card: 12px;
  /* Covers keep their own. */
  --rc: 3px;
  --tap: 44px;
}

@media (min-width: 900px) {
  :root {
    --gut: 40px;
    --fs-hero: 72px;
    --fs-h1: 60px;
    --fs-lead: 24px;
    --sec: 88px;
    --foot-gap: 120px;
  }
}

/* The heading ranks switch at 1000, with the page title (R3-8, R3-21). */
@media (min-width: 1000px) {
  :root {
    --h-section: 30px;
    --h-sub: 22px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #121314;
    --sunk: #1a1c1e;
    --band: #161b2c;
    --field: #1a1c1e;
    --foot: #141517;
    --ink: #ecedee;
    --soft: #b9bbc0;
    --faint: #94979d;
    --line: #2a2c30;
    --line-strong: #3c3f44;
    --accent: #a8bbf0;
    --on-accent: #0f1a3a;
    --fill: #a8bbf0;
    --on-fill: #0f1a3a;
    --band-ink: #ecedee;
    --band-soft: #b9bbc0;
    --band-accent: #a8bbf0;
    --on-band-accent: #0f1a3a;
    --proof: #d9b85c;
    --cover-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 14px 30px -12px rgba(0, 0, 0, 0.9);
    --cover-shadow-hi: 0 4px 8px rgba(0, 0, 0, 0.55), 0 24px 40px -16px rgba(0, 0, 0, 0.95);
  }
}

@media (min-width: 1000px) {
  :root {
    --h-page: 44px;
  }
}
