/* Lingways type: the one place where fonts, sizes and weights are set, for every page of the site.
   Two fonts: DM Sans to read, Manrope for headlines. Three weights: 400 to read, 600 for controls and labels,
   700 for headlines, the boldest on any page. No text is smaller than 14px. Emphasis inside a sentence is a
   brighter colour, not a heavier weight.
   The home pages get this file built into them (build.py); every other page links it. */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,600;9..40,700&family=Manrope:wght@700&display=swap");

:root {
  --font: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --display: "Manrope", "DM Sans", "Helvetica Neue", Arial, sans-serif;

  --w-read: 400; --w-label: 600; --w-head: 700;

  /* sizes to read */
  --t-small: 14px;  /* captions, fine print, menus, labels: the smallest text there is */
  --t-ui: 16px;     /* buttons, pills, text inside cards, footer links */
  --t-body: 18px;
  --t-point: 19px;  /* the points beside a picture */
  --t-lede: 21px;   /* the opening paragraph under a page's headline */

  /* headline sizes */
  --t-h1: clamp(40px, 5.2vw, 62px);    /* a page's headline */
  --t-h2: clamp(30px, 4vw, 46px);      /* a chapter's headline */
  --t-h3: clamp(26px, 3.2vw, 36px);    /* a section inside a page */
  --t-h4: 21px;                        /* a card, or a heading inside running text */
  --t-close: clamp(34px, 4.6vw, 56px); /* the closing line of a page */

  --track-head: -0.02em;
  --track-label: 0.14em;

  /* whole text styles, for the `font` property; headlines also take letter-spacing: var(--track-head),
     labels take letter-spacing: var(--track-label) and upper case */
  --head-1: var(--w-head) var(--t-h1)/1.06 var(--display);
  --head-2: var(--w-head) var(--t-h2)/1.1 var(--display);
  --head-3: var(--w-head) var(--t-h3)/1.14 var(--display);
  --head-4: var(--w-head) var(--t-h4)/1.25 var(--display);
  --head-close: var(--w-head) var(--t-close)/1.06 var(--display);
  --label: var(--w-label) var(--t-small)/1.4 var(--font);
}
@media (max-width: 700px) {
  :root { --t-point: 17px; --t-lede: 18px; --t-h1: 36px; --t-h2: 28px; }
}

body { font: var(--w-read) var(--t-body)/1.6 var(--font); }
b, strong { font-weight: var(--w-head); } /* never the browser's "bolder", which reaches 900 inside bold text */

/* ---- older pages ----
   The pages copied from lingways.com (body.site-page) keep their own stylesheets for layout and colour. Those set a
   size for each component, many under 14px. The rules below put each kind of text on the scale above; this file is
   the last stylesheet on those pages, and ":root .site-page" lets these rules win over the ones they replace. */
:root body.site-page { font: var(--w-read) var(--t-body)/1.6 var(--font); }

/* headlines */
:root .site-page :is(h1, h2, h3) { font-family: var(--display); font-weight: var(--w-head); letter-spacing: var(--track-head); text-wrap: balance; }
:root .site-page h1 { font-size: var(--t-h1); line-height: 1.06; }
:root .site-page h2 { font-size: var(--t-h3); line-height: 1.14; }
:root .site-page h3,
:root .site-page .lw-copy h2,
:root .site-page.page-privacy .body h2 { font-size: var(--t-h4); line-height: 1.25; }
:root .site-page .final-cta h2 { font-size: var(--t-close); line-height: 1.06; }

/* text to read */
:root .site-page .lw-copy :is(p, label, summary, li) { font-size: var(--t-body); }
:root .site-page :is(.lead, .intro) { font-size: var(--t-lede); line-height: 1.55; }
:root .site-page :is(.guide, .practice-card, .steps, .steps-grid, .demo-copy, .dialect-band, .status-grid) :is(p, li, blockquote),
:root .site-page .links a { font-size: var(--t-ui); }
:root .site-page :is(.fine, figcaption, small, .small, .site-small, .byline, .check, .feedback, time, .site-context p) { font-size: var(--t-small); }
:root .site-page time { font-family: var(--font); }
:root .site-page summary { font-weight: var(--w-label); }

/* labels and links; the header and the buttons are the shared ones in shell.css */
:root .site-page :is(.eyebrow, .pill) { font: var(--label); letter-spacing: var(--track-label); text-transform: uppercase; }
:root .site-page .text-link { font: var(--w-label) var(--t-ui)/1.5 var(--font); }
