/* ==========================================================================
   Reset + element defaults
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Fine paper grain over the whole page. Purely decorative. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.28'/%3E%3C/svg%3E");
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4,
blockquote, p { overflow-wrap: break-word; }

h1, h2, h3, h4 {
  font-weight: 400;
  font-size: inherit;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 2px;
}

::selection {
  background: var(--gold);
  color: var(--veil);
}

/* ---- Utilities ----------------------------------------------------- */

.u-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.u-skip {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 999;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--veil);
  font-size: var(--text-sm);
  transform: translateY(-160%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.u-skip:focus-visible { transform: translateY(0); }

.u-lock { overflow: hidden; }
