/* ==========================================================================
   Base — reset, document defaults and shared primitives.
   ========================================================================== */

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

body,
h1,
h2,
h3,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul[class],
ol[class] {
  margin: 0;
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
}

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

body {
  min-height: 100vh;
  background-color: var(--color-page);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  color: var(--color-secondary);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Illustration primitive.
   The exported SVGs carry no fill information (their <defs> were empty and
   every path pointed at a `uuid-…` class no stylesheet defined), so each one
   is painted as a flat brand colour: js/illustrations.js injects the file
   inline, and the `fill="currentColor"` on its root picks up `--art-color`.
   Swap `--art-color` for a full-colour re-export and this all still works.
   -------------------------------------------------------------------------- */
.art {
  display: block;
  width: 100%;
  height: 100%;
  color: var(--art-color, currentColor);
}

/* Sizing only — deliberately no `fill` here. A CSS fill would beat the
   presentation attributes inside a full-colour re-export and flatten it, so
   the tint is left to the `fill="currentColor"` on the flat files' own root.
   viewBox + no explicit size means the default preserveAspectRatio scales the
   artwork to fit, the way `mask-size: contain` used to. */
.art > svg {
  width: 100%;
  height: 100%;
}

/* Wrapper that reserves the illustration's footprint before it loads. */
.art-frame {
  width: var(--art-width, 100%);
  aspect-ratio: var(--art-ratio);
}

/* An illustration that could not be loaded, after retries. Collapsing it is
   kinder than leaving a reserved gap where artwork should be; the container
   keeps its role and aria-label, so the meaning is still announced. */
.art--failed {
  display: none;
}

.art-frame:has(> .art--failed) {
  aspect-ratio: auto;
  min-height: 0;
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */
@keyframes pulse {
  0%,
  100% {
    opacity: 0.45;
  }

  50% {
    opacity: 1;
  }
}

/* Sections start hidden and are revealed by the IntersectionObserver in
   js/reveal.js, which adds `.is-revealed`. */
.reveal {
  opacity: 0;
  transform: translateY(var(--reveal-offset));
  transition:
    opacity var(--duration-reveal) ease-out,
    transform var(--duration-reveal) var(--ease-rise);
}

.reveal.is-revealed {
  opacity: 1;
  transform: none;
}

/* No JS? Never leave content invisible, and never trap the reader behind an
   envelope that nothing can open. */
.no-js .reveal {
  opacity: 1;
  transform: none;
}

.no-js .envelope {
  display: none;
}

/* Set while the envelope overlay is covering the page. */
.is-scroll-locked {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
