/*
 * Roasit Blog tokens: the roasit.com landing page's own (Roasit-Web src/styles.css,
 * the .ap rule and the landing rules after it). Wiro's neutrals, Roasit's blue for
 * links, the indigo dot of the wordmark. Keep the values in step with Roasit-Web
 * when it changes them.
 *
 * The blog has the dashboard's light and dark themes, and its choice: the blog is
 * on the dashboard's origin, so localStorage ro_theme ("light" | "dark", absent =
 * the system's) holds on both. header.php marks <html data-theme> from it before
 * anything is painted, and the dark set below is the dashboard's dark tokens
 * (Roasit-Web src/styles.css, the block after :root) by the same roles. The
 * landing (roasit.com/) stays light by design. Paper is light whatever the
 * screen's theme: the dark set is for screens only.
 *
 * The fonts are the landing's files (Roasit-Web src/fonts), served from the theme:
 * Geist, variable weight, in its Latin and Latin Extended subsets, then Poppins for
 * any character Geist does not carry. Both under the SIL Open Font License 1.1
 * (assets/fonts/OFL-Geist.txt, OFL-Poppins.txt).
 */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/geist-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: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/geist-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: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/poppins-400.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/poppins-500.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/poppins-600.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/poppins-700.woff2") format("woff2");
}

:root {
  color-scheme: light;

  /* .ap: the page, the card, the ink, the second ink (Wiro ink3, 4.93:1 on the page)
     and the hairline. */
  --rb-bg: #f9f8f5;
  --rb-card: #fff;
  --rb-ink: #16140f;
  --rb-ink-2: #706c62;
  --rb-line: #e5e5e5;

  /* Wiro ink2: the body text of a long read (11.4:1 on the page), as the dashboard
     sets its body text. The landing's short paragraphs take --rb-ink-2. */
  --rb-ink-body: #3d3a33;

  /* .ap-btn:hover, and the text on an ink fill (the button, the topic chip and the
     page number that are current, the skip link). */
  --rb-ink-hover: #2a2820;
  --rb-on-ink: #fff;

  /* Wiro's raised fills: a table's header strip, a code chip. */
  --rb-warm: #f2efe8;
  --rb-stone: #edeae2;
  --rb-zebra: #fbfaf7;
  --rb-line-strong: #d0d0cf;

  /* A field's edge, the dashboard's --input-line: all that marks the search field
     on the page, so it is held to 3:1 (3.58 on the field, 3.37 on the page). The
     hairline was 1.2:1. */
  --rb-input-line: #8b877d;

  /* Roasit blue (the dashboard's --accent): links and focus. 6.0:1 on the page. */
  --rb-accent: #2b58c8;
  --rb-accent-line: rgb(43 88 200 / 38%);
  --rb-selection: rgb(43 88 200 / 18%);

  /* The dot of the wordmark's i, the light ground's (.ap --brand-dot). */
  --rb-brand-dot: #5a6cf0;

  /* The pinned header (.ap-nav): the page, a little see-through. */
  --rb-nav-bg: rgb(249 248 245 / 85%);
  --rb-nav-bg-scrolled: rgb(249 248 245 / 92%);

  /* The dark showcase and the SDK sample (.ap-showcase, .ap-code, .ap-code-bar). On
     the light page the window is its own edge; --rb-code-ring draws one in dark. */
  --rb-dark: #16140f;
  --rb-code-bg: #131210;
  --rb-code-bar: #1e1c16;
  --rb-code-ink: #e8e5df;
  --rb-code-dot: rgb(255 255 255 / 25%);
  --rb-code-ring: none;

  /* The mark on a post with no cover. */
  --rb-cover-mark: rgb(22 20 15 / 16%);

  --rb-font: "Geist", "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rb-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* .ap .wrap: 1120 px with 24 px sides. */
  --rb-wrap: 1120px;
  --rb-gutter: 24px;
  --rb-nav-h: 60px;

  /* The article's text column. Geist at 18 px sets about 8 px a character, so 640 px
     is some 80 characters on a full line and 70 on an average one; the landing's
     own paragraphs run 620-640 px (.ap-lead, .cl-hero p). Its 68ch would be 810 px:
     Geist's zero is wide. "On this page" sits 56 px beside the column. */
  --rb-measure: 640px;
  --rb-toc-gap: 56px;
  --rb-toc-w: 220px;

  /* .ap-card 18, .ap-block and .ap-code 16, .ap-btn 12, .ap-menu-btn 10. */
  --rb-radius-card: 18px;
  --rb-radius-block: 16px;
  --rb-radius-btn: 12px;
  --rb-radius-ctl: 10px;

  /* .ap-card:hover, the header once the page scrolls (.ap-nav.scrolled), the open
     menu. */
  --rb-shadow-hover: 0 14px 40px rgb(0 0 0 / 6%);
  --rb-shadow-nav: 0 8px 24px rgb(0 0 0 / 5%);
  --rb-shadow-menu: 0 12px 24px rgb(0 0 0 / 6%);
}

/* Dark: the dashboard's dark tokens (Wiro's), by the same roles. Its page, surface
   and ink; its --muted as the second ink (7.5:1 on the page) and its --ink-2 as the
   long read's body text (12.5:1); its 14% hairline (--border) and --axis; its
   raised fills, field edge (5.1:1 on the page), blue (6.3:1) and the wordmark's
   dot. The code window is the dashboard's code box (--warm) in a --grid frame, so it
   still stands off a page as dark as itself. A shadow on this page is all but
   black on black: a trace. Written twice, as the dashboard does: once for a dark
   system with no choice made, once for the choice. */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --rb-bg: #12100d;
    --rb-card: #171510;
    --rb-ink: #f7f3ea;
    --rb-ink-2: #aaa297;
    --rb-line: rgb(247 243 234 / 14%);
    --rb-ink-body: #d8d1c5;
    --rb-ink-hover: #e4dfd5;
    --rb-on-ink: #12100d;
    --rb-warm: #1e1c17;
    --rb-stone: #211f19;
    --rb-zebra: #1b1914;
    --rb-line-strong: #4d4a44;
    --rb-input-line: #89837a;
    --rb-accent: #5096ec;
    --rb-accent-line: rgb(80 150 236 / 45%);
    --rb-selection: rgb(80 150 236 / 28%);
    --rb-brand-dot: #9aa5ff;
    --rb-nav-bg: rgb(18 16 13 / 85%);
    --rb-nav-bg-scrolled: rgb(18 16 13 / 92%);
    --rb-code-bg: #1e1c17;
    --rb-code-bar: #2b2924;
    --rb-code-ring: inset 0 0 0 1px #2b2924;
    --rb-cover-mark: rgb(247 243 234 / 14%);
    --rb-shadow-hover: 0 14px 40px rgb(0 0 0 / 35%);
    --rb-shadow-nav: 0 8px 24px rgb(0 0 0 / 30%);
    --rb-shadow-menu: 0 12px 24px rgb(0 0 0 / 35%);
  }
}

@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --rb-bg: #12100d;
    --rb-card: #171510;
    --rb-ink: #f7f3ea;
    --rb-ink-2: #aaa297;
    --rb-line: rgb(247 243 234 / 14%);
    --rb-ink-body: #d8d1c5;
    --rb-ink-hover: #e4dfd5;
    --rb-on-ink: #12100d;
    --rb-warm: #1e1c17;
    --rb-stone: #211f19;
    --rb-zebra: #1b1914;
    --rb-line-strong: #4d4a44;
    --rb-input-line: #89837a;
    --rb-accent: #5096ec;
    --rb-accent-line: rgb(80 150 236 / 45%);
    --rb-selection: rgb(80 150 236 / 28%);
    --rb-brand-dot: #9aa5ff;
    --rb-nav-bg: rgb(18 16 13 / 85%);
    --rb-nav-bg-scrolled: rgb(18 16 13 / 92%);
    --rb-code-bg: #1e1c17;
    --rb-code-bar: #2b2924;
    --rb-code-ring: inset 0 0 0 1px #2b2924;
    --rb-cover-mark: rgb(247 243 234 / 14%);
    --rb-shadow-hover: 0 14px 40px rgb(0 0 0 / 35%);
    --rb-shadow-nav: 0 8px 24px rgb(0 0 0 / 30%);
    --rb-shadow-menu: 0 12px 24px rgb(0 0 0 / 35%);
  }
}
