/* ===================================================================
   Public display face.
   Linked from partials/nav.php ONLY, so the staff app never loads it and
   never pays for it. Nothing in here restates a colour, a size or a layout
   rule - it declares one typeface and the token that names it.
   =================================================================== */

/*
 * WHY A WEBFONT AT ALL, WHEN THE SYSTEM STACK WAS WORKING
 *
 * The stack in welcome.css was measured and it is honest, but it has a property
 * nobody chose: the marketing site draws its headline in a DIFFERENT TYPEFACE ON
 * EVERY OPERATING SYSTEM. Iowan Old Style on a Mac, Palatino Linotype on Windows,
 * Noto Serif on Android - and Android plus Windows is nearly everybody who opens
 * this site. That is not a brand, it is whatever the visitor happens to have
 * installed, which is a strange thing to leave the front door of a lodge to.
 *
 * One self-hosted face fixes that: every visitor gets the same headline.
 *
 * WHY THIS ONE
 *
 * Viaoda Libre is a high-contrast display serif - the family of letterform a
 * lodge is actually selling, closer to a printed invitation than to a document.
 * It is SIL OFL 1.1, which permits redistribution; the copyright and licence
 * lines below were read out of the font file's own name table rather than
 * recalled from a website, because a licence statement written from memory is
 * how an unverified claim ends up in a comment.
 *
 *   Copyright 2020 The Viaodalibre Project Authors
 *   https://github.com/bettergui/ViaodaLibre
 *   "This Font Software is licensed under the SIL Open Font License,
 *    Version 1.1." - http://scripts.sil.org/OFL
 *
 * The font is shipped UNMODIFIED. OFL's one condition that bites here is that a
 * modified version may not be sold under the reserved name, so nothing is
 * subset or converted locally: what ships is the file the designers released,
 * byte for byte, hash-verified when it was copied in.
 *
 * WHY IT IS NOT PRECACHED-OUT, AND WHY THAT IS THE POINT
 *
 * The service worker keeps this site working with no connection. A face on a
 * third-party CDN is a render-blocking request that fails precisely when the
 * connection does - so the file is local, is listed in sw.js PRECACHE, and is
 * therefore offline in the same breath as the CSS that names it.
 *
 * font-display: swap, because 187 KB over a Lusaka mobile connection is not
 * instant and nobody should stare at a blank heading while it arrives: the
 * Palatino/Georgia fallback paints first and the real face replaces it. The
 * fallback is deliberately close in proportion, so the swap moves the words
 * rather than the layout.
 *
 * A FILE NAME THAT CANNOT BE BUSTED IS A FILE THAT CANNOT BE FIXED.
 * @font-face src cannot go through asset_v(), so this URL carries no ?v= stamp,
 * and sw.js's cacheKey() strips query strings from precached paths anyway. If
 * Viaoda Libre is ever updated or swapped, DO NOT overwrite this file - add it
 * under a new name and change this rule. Same reason the release archive is
 * named for its version: an identical name is an identical cache entry.
 */
@font-face {
  font-family: 'Viaoda Libre';
  src: url('../fonts/viaoda-libre-regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /*
   * --font-brand, not --font-display, and that split is the whole decision.
   *
   * A high-contrast display face is drawn for two or three sizes above the
   * body. At the sizes --font-display is currently used at - a 1.18rem wordmark,
   * a 1.5rem room price, a 0.9rem table heading - its hairlines go thin enough
   * to disappear, and its serif detail turns to mush. So the brand face is used
   * for the headline-scale writing and NOTHING else:
   *
   *   --font-brand  hero headline, section titles, pull quotes
   *   --font-display  wordmark, prices, sub-headings, the staff app
   *
   * Both stay serif, so they sit together rather than fighting.
   *
   * ONE WEIGHT, ON PURPOSE. This file is Regular 400; there is no 600 cut. Where
   * --font-brand is applied, the weight must therefore be set to 400 as well -
   * main.css asks for 600 on every heading, and a browser asked for 600 from a
   * 400-only face does not find a bolder one, it smears the one it has with
   * synthetic bold. Elegant at 3rem, ruined. The rules that use this token in
   * welcome.css carry their own font-weight for exactly that reason, and are not
   * cosmetic.
   *
   * Defined at :root rather than on body.welcome-page because the face is a
   * property of the whole document, not of one component - but note that pages
   * which do not link this file will not have this token defined at all, and a
   * var() naming an undefined custom property resolves to nothing. Any use of
   * --font-brand outside the pages that link fonts.css inherits whatever font
   * was already in force. tests/public_typography_test.php is what keeps that
   * from becoming a silent bug.
   */
  --font-brand: 'Viaoda Libre', 'Palatino Linotype', Palatino, 'Book Antiqua',
                Georgia, 'Noto Serif', serif;
}
