/* Reset, typography and global element styles */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

h1, h2, h3, p, ol, ul, figure, blockquote { margin: 0; }
ol, ul { padding: 0; list-style: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h3 { font-weight: 600; line-height: 1.2; letter-spacing: 0; }

/* Crimson Pro Light Italic highlights one or two words inside a heading */
h1 em, h2 em, blockquote em {
  font-family: var(--font-highlight);
  font-style: italic;
  font-weight: 300;
  font-size: 1.08em;
  letter-spacing: -0.02em;
}

p { text-wrap: pretty; }

:focus-visible {
  outline: 2px solid var(--heathered-gray-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--heathered-gray); color: var(--heavy-metal); }

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--heavy-metal);
  color: var(--concrete);
  border-radius: 8px;
  text-decoration: none;
  transition: top 160ms ease;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Scroll reveal — only hides content once JS has confirmed it can reveal it */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}
