/*
 * veil. type system, served from the same origin.
 *
 * The selected Google Fonts files are distributed under the SIL Open Font
 * License; the corresponding upstream licence texts live beside the binaries
 * in /fonts/licenses. Keeping the files local removes a render-blocking third-
 * party request and avoids disclosing a visitor's address to a font CDN.
 */

/* ─── THE FAMILIES, NAMED ONCE ────────────────────────────────────────────
 *
 * Every served document links this sheet (all forty-two of them), and the
 * page router inlines it into their <head>. So this is the one place the
 * platform's font STACKS can be stated without forty-two copies to keep in
 * step — and they had already come apart. /support and /begin/design-partner
 * asked for "Veil Sans" and "Veil Mono": families that have never existed in
 * this repository, have no @font-face below, and ship no binary. Both pages
 * rendered in Inter or the system UI face while every other page rendered in
 * DM Sans and Space Mono, and nothing failed — a missing family is silent by
 * design. The support page a customer is sent to when something is wrong was
 * the one that did not look like veil.
 *
 * A page may still override these; several declare their own --ff-* with the
 * same values, and a later :root wins at equal specificity. What it may not
 * do is invent a family name, and verify-design-foundation now asserts that
 * every family any served document or theme names is one this sheet actually
 * declares AND whose binary is on disk.
 */
:root {
  --veil-ff-sans:   'DM Sans', system-ui, sans-serif;
  --veil-ff-mono:   'Space Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --veil-ff-ticker: 'Cousine', ui-monospace, monospace;

  /* Defaults for the two names the authored documents already use, so a page
   * that declares neither still gets the platform's faces rather than the
   * browser's. */
  --ff-sans: var(--veil-ff-sans);
  --ff-mono: var(--veil-ff-mono);
  --ff-ticker: var(--veil-ff-ticker);

  /* THE TYPED-TEXT FLOOR. See below. */
  --veil-field-size: 1rem;

  /* ─── THE FOCUS RING, ONE COLOUR ───────────────────────────────────────
   * The platform draws exactly one keyboard-focus ring, and the served
   * estate had been drawing it in three violets: #9B6DFF in the app and the
   * refinement sheet, #9b7cff on /support, #9b8cff in the page router's
   * interim document and its injected bypass-link presentation. Nothing
   * failed — a focus ring in the wrong violet is still a focus ring — but a
   * person tabbing from the desk into /support sees the affordance change
   * colour, which is the sort of thing that reads as "different site".
   * Stated here, in the one sheet every served document links, so the
   * documents that are NOT wired for veil-refinement.css (/, /about,
   * /support, /legal, the 404) draw the same ring as the ones that are.
   * The value is T.violet from ui/customer/lib/theme.js. */
  --veil-focus-ring: #9B6DFF;
}

/* ─── THE TYPED-TEXT FLOOR, ON A COARSE POINTER ───────────────────────────
 *
 * Mobile Safari zooms the entire page when a field it is focusing carries
 * text under 16px — it does not ask, and it does not zoom back out. The
 * person tapping into a field is thrown into a magnified, sideways-scrolled
 * view of a form they were reading a moment ago, and every subsequent field
 * is off-screen. It is the single most common way a well-drawn form becomes
 * unusable on a phone, and this product walked into it four times: the auth
 * fields at 0.85rem (13.6px), the onboarding environment inputs at 0.85rem,
 * and the design-partner fields at 14px.
 *
 * The floor is stated ONCE, here, rather than at every field: fields are
 * authored in HTML/CSS on the served documents and in inline React styles in
 * the app, so no single callsite convention could have covered both. It is
 * `!important` because inline styles would otherwise outrank it — this is a
 * floor, not a suggestion.
 *
 * A field that genuinely wants to be BIGGER (the six-digit MFA code, set at
 * 1.15rem so the digits read as a code) raises --veil-field-size on itself
 * and keeps its size; `max()` means the variable can only ever push the
 * value UP. Nothing can opt out downward, which is the whole point.
 *
 * Scoped to (pointer: coarse) so the desk's deliberately small, dense field
 * typography is untouched on a mouse — the zoom behaviour it defends against
 * only exists on touch. Checkboxes, radios, ranges and colour swatches are
 * excluded: they render no text, and forcing a font-size on them changes
 * their box on some engines.
 */
@media (pointer: coarse) {
  input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='color']):not([type='hidden']),
  textarea,
  select {
    font-size: max(1rem, var(--veil-field-size, 1rem)) !important;
  }
}

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/fonts/dm-sans-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: 'DM Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/fonts/dm-sans-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: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/space-mono-400-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: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/space-mono-400-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: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/space-mono-700-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: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/space-mono-700-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: 'Cousine';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/cousine-400-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: 'Cousine';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/cousine-400-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: 'Cousine';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/cousine-700-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: 'Cousine';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/cousine-700-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;
}
