/* What the announcement (index.html) and the 404 page share: the typefaces, the tokens, the base, the
   spaced labels, the glass button and the full-bleed layout on phones and tablets. Each page's own rules
   follow in its <style>. Single-theme by choice (see color-scheme in each page's <head>) */

/* ---------- Fonts ---------- */
/* Cormorant and Jost, SIL Open Font License 1.1 (see /fonts/LICENSE-*.txt). Cormorant's italic is one
   variable file holding every weight: the light name (300), the firmer signature (500) */
@font-face { font-family: "Cormorant"; font-style: italic; font-weight: 300 700; font-display: swap; src: url("/fonts/cormorant-italic.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/jost-400.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
/* js/sky-clock.js sets --sky-*, --edge, --shadow, --shadow-close, --scrim and --glass-tint for the
   time of day (on <html>, before the first paint); the values here are for when it doesn't run */
:root {
  /* What the browser paints around the page: the theme-color blue */
  --edge: #3a64ae;
  /* The plain sky */
  --sky-top: #2f5fa8;
  --sky-mid: #7fa3d6;
  --sky-low: #f1c2c0;
  /* White lettering (js/name.js writes the name in --ink too). Every line of it has the same shade, as her
     name has: a faint close one, and a soft glow falling just below (wider for the name, which is larger).
     Both deepen a little by day */
  --ink: #fffaf8;
  --shadow: rgba(45, 50, 95, 0.42);
  --shadow-close: rgba(35, 45, 95, 0.25);
  --lettering-shade: 0 1px 2px var(--shadow-close), 0 2px 10px var(--shadow);
  --scrim: transparent;   /* how much the sky dims just behind the words by day (none at night) */
  /* Glass: a light frost, a fine edge and, by day, a blue-grey tint that keeps the white label readable */
  --glass: rgba(255, 255, 255, 0.16);
  --glass-edge: rgba(255, 255, 255, 0.38);
  --glass-tint: transparent;
  --font-label: "Jost", "Futura", "Avenir Next", "Segoe UI", sans-serif;
  --font-name: "Cormorant", "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --gutter: 16px;   /* the least space between the text (or a button) and the screen's edges */
  --bleed: 140px;   /* extra sky above and below the screen on touch screens, in px (js/fullbleed.js reads it) */
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* What the browser paints around the page (Safari's bars, overscroll). The sky clock sets --edge before the
   first paint, and after that only while the page is out of sight: Safari on the Mac flickers if the colour
   moves in view */
html {
  height: 100%;
  background-color: var(--edge);
  -webkit-text-size-adjust: 100%;   /* the text stays the size it is set, turned sideways too */
  text-size-adjust: 100%;
}
/* Taps are taps (for sound, and on her name): no double-tap zoom, which on an iPhone zooms the page in
   around a quick second tap and leaves it adrift in the extra sky. Safari looks at the element tapped, so
   every element says so. Pinching to zoom still works */
html, body, body * { touch-action: manipulation; }
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Labels ---------- */
/* Small spaced capitals, spaced no wider than reads as one line (the spaces between words drawn in a
   little to match) */
.eyebrow {
  margin: 0;
  padding-left: 0.32em;   /* balances the trailing letter-spacing */
  font-family: var(--font-label);
  letter-spacing: 0.32em;
  word-spacing: -0.12em;
  text-transform: uppercase;
  text-shadow: var(--lettering-shade);
}

/* ---------- Glass button ---------- */
/* A soft sheen from top to bottom over the tint and the frost, a fine edge and a gentle shadow. The shadow
   stays on the button itself: cast from a wrapper, Safari draws it as a rectangle */
.glass {
  --sheen: rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background:
    linear-gradient(180deg, var(--sheen)),
    linear-gradient(var(--glass-tint), var(--glass-tint)),
    var(--glass);
  box-shadow: 0 6px 22px rgba(20, 30, 70, 0.16);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  color: var(--ink);
  text-shadow: var(--lettering-shade);
  transition: background 0.3s ease;
}
.glass:hover { --sheen: rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.1); }
/* A white ring with a soft dark edge, so it shows against pale daytime clouds too */
.glass:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 7px rgba(30, 40, 85, 0.45);
}

/* ---------- The screen ---------- */
/* What holds the text: the whole window on a computer, clear of the rounded corners and notch at the sides */
.screen {
  position: relative;
  height: 100%;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* ---------- Full-bleed on phones and tablets, either way up ---------- */
/* Safari only draws page content under its bars while the page is scrolled, so the page gets --bleed of
   extra sky above and below the screen and starts in the middle (scroll-initial-target where supported;
   elsewhere js/fullbleed.js scrolls there once). Scrolling stays free, as on any page, and the sky eases into
   the background colour across that extra sky.
   The text (.screen) sits in the part of the screen Safari leaves clear: 100svh is the screen with Safari's
   bars shown. Upright, its toolbar is at the bottom, so that's simply the top of the screen down. In
   landscape its toolbar runs across the top, so the text starts lower by the toolbar's height
   (100lvh - 100svh) */
@media (pointer: coarse) {
  html, body { height: auto; }
  body {
    position: relative;
    overflow: visible;
    min-height: calc(100lvh + 2 * var(--bleed));
  }
  .screen {
    position: absolute;
    top: var(--bleed);
    left: 0;
    right: 0;
    height: 100svh;
    scroll-initial-target: nearest;
  }
}
@media (pointer: coarse) and (orientation: landscape) {
  .screen { top: calc(var(--bleed) + 100lvh - 100svh); }
}
