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

html {
  font-size: 100%; /* respects the user's browser text size */
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--c-ink);
  background-color: var(--c-bone);
  background-image: var(--tex-stone);
  padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

@media (min-width: 900px) {
  body { padding-bottom: 0; }
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--c-forest);
  margin: 0 0 .5em;
  letter-spacing: .01em;
}
h1 { font-size: clamp(1.9rem, 5vw + .5rem, 3.2rem); }
h2 { font-size: clamp(1.4rem, 2.5vw + .6rem, 2rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }
a { color: var(--c-forest); text-underline-offset: 3px; }
a:hover { color: var(--c-amber-text); }

img, svg, canvas { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--c-amber);
  outline-offset: 2px;
  border-radius: 4px;
}

.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;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  background: var(--c-forest);
  color: var(--c-bone);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 12px; color: var(--c-bone); }

main { display: block; outline: none; min-height: calc(100vh - var(--header-h)); }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* 'backwards', not 'both': a transform left on .page would trap fixed children (the mini avatar dock). */
.page { padding-top: 24px; padding-bottom: 48px; animation: page-in var(--t-slow) var(--ease) backwards; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.eyebrow {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-amber-text);
  margin-bottom: .4em;
}

.lead { font-size: 1.1rem; color: var(--c-muted); max-width: 60ch; }

.page-loader {
  display: grid; place-items: center;
  min-height: 50vh;
}

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