/* Every color, type size, radius and space in the app lives here, so the whole look can be restyled from this
   one file. The values are Sol's Mnemir direction (design/brand/mnemir/tokens.css): petrol and verdigris on
   mineral paper, Source Sans 3 for the interface, Newsreader for reading. Light is the default; dark follows the
   system unless Settings pins a theme. */
:root {
  /* color */
  --bg: #f1f1e8;
  --surface: #fcfdf7;
  --surface-2: #e0e8df;
  --ink: #203739;
  --ink-2: #485e5c;
  --ink-3: #526862;
  --line: #cad4cb;
  --line-strong: #768c82;
  --accent: #245d5a;
  --accent-ink: #ffffff;
  --accent-soft: #dbe7da;
  --warn: #984310;
  --warn-soft: #f5e4d2;
  --good: #286444;
  --mark: #e7dda1;
  --mark-ink: #303419;
  --star: #765719;
  --shade: rgba(30, 28, 25, 0.4);
  --shadow: 0 8px 30px rgba(30, 28, 25, 0.1);
  --lift: 0 1px 3px var(--line);          /* the chosen segment of a switch */

  /* type */
  --font-ui: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-read: "Newsreader", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-md: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.875rem;
  --text-base: 1rem;                      /* buttons and text boxes; 16px in a box keeps iOS from zooming the page */
  --display: calc(var(--text-2xl) * 1.6); /* a page's name: 48px on a laptop */
  --display-phone: calc(var(--text-2xl) * 1.2);
  --headline: calc(var(--text-2xl) * 1.55);       /* an article's headline: 46.5px */
  --headline-phone: calc(var(--text-2xl) * 1.3);  /* 39px */
  --figure: calc(var(--text-2xl) * 1.65); /* the big numbers on Insights */
  --weight-read: 450;                     /* headlines in the reading face */
  --weight-strong: 650;
  --track-label: 0.1em;                   /* small capital labels */
  --track-tight: -0.025em;                /* big serif headlines */
  --read-size: 1.25rem;                   /* article body; Settings switches it */
  --read-leading: 1.65;
  --read-measure: 40rem;                  /* line length; Settings switches it */

  /* space, shape */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --rule: 1px;                            /* separators */
  --rule-strong: 3px;                     /* the chosen row, notes, the top of a figure */
  --focus: 3px;                           /* focus ring width and offset */
  --dot: 6px;                             /* the unread dot */
  --icon: 1.2rem;
  --icon-sm: 1rem;
  --icon-lg: 1.375rem;
  --chevron: 0.75rem;                     /* the small turn-mark beside a folder */
  --tap: 2.75rem;                         /* smallest comfortable touch target */
  --tap-sm: 2.25rem;                      /* secondary controls on a laptop */
  --sidebar-w: 15rem;
  --drawer-w: 20rem;                      /* the sidebar as a drawer on a phone */
  --queue-w: 20rem;                       /* the list beside an open article */
  --page-w: 90rem;
  --prose-w: 44rem;                       /* hints and explanations */
  --dialog-w: 32rem;
  --dialog-wide: 38rem;
  --signin-w: 23rem;
  --bar-h: 3.25rem;
  --bar-h-phone: 3.75rem;                 /* the reader's toolbar on a phone: room for 44px controls */
  --nav-h: 3.5rem;
  --lockup-w: 10rem;
  --lockup-w-phone: 8rem;
  --lockup-h: 3.5rem;
  --state-mark: 4rem;
  --thumb-w: 9rem;
  --thumb-phone: 6rem;
  --card-min: 16.5rem;
  --chart-h: 12rem;
  --chart-h-phone: 11rem;
  --state-h: 17rem;

  /* motion */
  --ease: 180ms ease;
  --brand-drift-duration: 48s;            /* one slow turn of the planet's surface in a large empty state */
  --brand-loading-duration: 10s;          /* the same, repeating, only while feeds are really being checked */
}

:root[data-theme="dark"] {
  --bg: #122d31;
  --surface: #1b383b;
  --surface-2: #294649;
  --ink: #edf4e8;
  --ink-2: #c0d4c8;
  --ink-3: #aec4b8;
  --line: #3d5a59;
  --line-strong: #7e9e8e;
  --accent: #a2d7c4;
  --accent-ink: #122d31;
  --accent-soft: #304b44;
  --warn: #f1b889;
  --warn-soft: #483b29;
  --good: #a2cfa5;
  --mark: #626031;
  --mark-ink: #fff6cd;
  --star: #e1c482;
  --shade: rgba(0, 0, 0, 0.58);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #122d31;
    --surface: #1b383b;
    --surface-2: #294649;
    --ink: #edf4e8;
    --ink-2: #c0d4c8;
    --ink-3: #aec4b8;
    --line: #3d5a59;
    --line-strong: #7e9e8e;
    --accent: #a2d7c4;
    --accent-ink: #122d31;
    --accent-soft: #304b44;
    --warn: #f1b889;
    --warn-soft: #483b29;
    --good: #a2cfa5;
    --mark: #626031;
    --mark-ink: #fff6cd;
    --star: #e1c482;
    --shade: rgba(0, 0, 0, 0.58);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  }
}

/* reading preferences (Settings) */
:root[data-read-size="s"] { --read-size: 1.0625rem; }
:root[data-read-size="l"] { --read-size: 1.3125rem; }
:root[data-read-size="xl"] { --read-size: 1.5rem; }
:root[data-read-measure="narrow"] { --read-measure: 33rem; }
:root[data-read-measure="wide"] { --read-measure: 48rem; }

@media (prefers-reduced-motion: reduce) { :root { --ease: 0ms; } }
