/*
 * Minimal reset and base elements.
 *
 * Not a normalize: only the handful of browser defaults that get in the way of
 * a paper-and-ink layout. Everything else stays as the browser intended.
 */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  /* A blanket stop for anything that slipped past the motion tokens. */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  min-height: 100svh;
  background-color: var(--paper);

  /* The paper grain. Self-hosted tile, repeated — present, almost
     imperceptible, exactly as the brief asks. */
  background-image: url("/assets/paper-grain-0f181269.svg");
  background-repeat: repeat;
  background-size: 180px 180px;
  background-attachment: fixed;

  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Images behave like objects on a page, not like inline text. */
img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* Inherit the type system into form controls, which opt out by default. */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

/* Long guest names and event titles must not blow out a print or a card. */
p,
h1,
h2,
h3,
h4,
figcaption,
li {
  overflow-wrap: break-word;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

hr {
  border: none;
  border-top: 1px solid var(--rule);
}

/* Focus is always visible. The guest may well be navigating with a keyboard,
   a switch, or a screen reader on a phone at a party. */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--gold-wash);
  color: var(--ink);
}

/* The header sticks, so anything jumped to needs room to clear it. */
:target {
  scroll-margin-block-start: 6rem;
}

[hidden] {
  display: none !important;
}
