/* Forma DJR Micro, licensed web fonts (FormaDJR_Web). Browsers fetch a face only
   when a page uses it; Regular and Medium are preloaded in app.html. */
@font-face {
  font-family: 'Forma DJR Micro';
  src: url('/fonts/FormaDJRMicro-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Forma DJR Micro';
  src: url('/fonts/FormaDJRMicro-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Forma DJR Micro';
  src: url('/fonts/FormaDJRMicro-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Forma DJR Micro';
  src: url('/fonts/FormaDJRMicro-MediumItalic.woff2') format('woff2');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Forma DJR Micro';
  src: url('/fonts/FormaDJRMicro-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Forma DJR Micro';
  src: url('/fonts/FormaDJRMicro-BoldItalic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 20px;
  --space-5: 32px;
  --space-6: 52px;
  --space-7: 84px;
  --space-8: 136px;
  --space-9: 220px;

  --font-family-display: 'Forma DJR Micro', 'Inter', system-ui, sans-serif;
  --font-family-body: 'Forma DJR Micro', 'Inter', system-ui, sans-serif;

  --font-size-0: 12px;
  --font-size-1: 14px;
  --font-size-2: 16px;
  --font-size-3: 18px;
  --font-size-4: 20px;
  --font-size-5: 22px;
  --font-size-6: 24px;
  --font-size-7: 35px;
  --font-size-8: 45px;
  --font-size-9: 60px;
  --font-size-10: 80px;

  --white: #fff;
  --black: #101112;
  --near-black: #1c1c1c;
  --red: #fd4317;
  --gray-200: #ced2d9;
  --gray-600: #6e7683;

  --max-width-0: 320px;
  --max-width-1: 768px;
  --max-width-2: 1440px;
}

html {
  background-color: var(--near-black);
  font-family: var(--font-family-body);
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/*
 * Entrance animations set their start state from script, after the page has
 * already painted. Elements marked [data-reveal] stay hidden until that script
 * reveals them, so they don't flash in their final state first. If a script
 * never runs, the fallback animation shows them after 3s.
 */
.js [data-reveal] {
  visibility: hidden;
  animation: reveal-fallback 0s 3s forwards;
}

@keyframes reveal-fallback {
  to {
    visibility: visible;
  }
}

/*
 * Leading trim: the box hugs the text from cap height to baseline, so it
 * centres optically and spacing is measured from the letters, not the line box.
 * Forma DJR Micro: cap height 0.7em, ascent 0.9em, descent 0.3em, so
 *   top    = half-leading + (ascent - cap) = 0.5lh - 0.6em + 0.2em -> trim 0.4em
 *   bottom = half-leading + descent        = 0.5lh - 0.3em         -> trim 0.3em
 * Nudge --trim-top / --trim-bottom to adjust by eye.
 */
.trim {
  --trim-top: 0.4em;
  --trim-bottom: 0.3em;
  display: flow-root;
}

.trim::before {
  content: '';
  display: table;
  margin-bottom: calc(-0.5lh + var(--trim-top));
}

.trim::after {
  content: '';
  display: table;
  margin-top: calc(-0.5lh + var(--trim-bottom));
}

body {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-display);
  font-weight: 500;
  margin: 0;
}

p {
  margin: 0;
}

/* Page transitions via the View Transitions API, driven by onNavigate in +layout.svelte */
::view-transition-old(root) {
  animation: 600ms cubic-bezier(0.65, 0, 0.35, 1) both page-out;
}

::view-transition-new(root) {
  animation: 600ms cubic-bezier(0.65, 0, 0.35, 1) both page-in;
}

@keyframes page-out {
  to {
    transform: translateY(-2%) scale(0.98);
    opacity: 0;
  }
}

@keyframes page-in {
  from {
    transform: translateY(2%) scale(0.98);
    opacity: 0;
  }
}
