/* ==========================================================================
   Base: reset, typography utilities, reveal-on-scroll and accessibility.
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: auto;   /* scroll is driven by the user; animations are scroll-linked */
  overflow-x: clip;        /* wide decorative elements (ticker, ghosts) must never cause sideways scroll */
}

body {
  margin: 0;
  background: var(--color-pasture);
  color: var(--color-straw);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* same as html: stops phones from widening the layout viewport */
}

img, video, canvas { max-width: 100%; display: block; }
/* width/height attributes only reserve space; CSS sizes win, so keep the ratio. */
img { height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--color-red); outline-offset: 3px; }

/* Visible to screen readers and search engines, hidden on screen. */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Typography utilities
   -------------------------------------------------------------------------- */

/* Small uppercase monospace label ("etiqueta"). */
.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* Big condensed feed-sack headline. */
.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  line-height: .84;
  letter-spacing: -.005em;
  text-wrap: balance;
}

/* Italic serif aside, used for the humorous second lines. */
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; }

/* Handwritten note. */
.hand { font-family: var(--font-hand); font-size: 1.6em; line-height: 1; }

/* Red "tape" behind a word, slightly rotated. */
.highlight {
  display: inline-block;
  margin-top: .06em;
  padding: .06em .12em 0;
  background: var(--color-red);
  color: var(--color-paper);
  transform: rotate(-2deg);
}

/* --------------------------------------------------------------------------
   Reveal on scroll
   Elements start hidden ONLY when JavaScript is running (html.js), so the
   content is always readable without JS and for crawlers.
   -------------------------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .9s var(--ease-out-soft), transform .9s var(--ease-out-soft);
}
.js .reveal.is-in { opacity: 1; transform: none; }
.reveal.delay-1 { transition-delay: .12s; }
.reveal.delay-2 { transition-delay: .24s; }
.reveal.delay-3 { transition-delay: .36s; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
