/* ==========================================================================
   Adom base layer

   Reset, the shared type scale, and the utilities every Adom page relies on.
   Consumes tokens.css. Holds no page composition.
   ========================================================================== */

* { box-sizing: border-box; }

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--body);
  background: var(--canvas);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

button,
input { font: inherit; }

h1,
h2,
h3,
p,
ol,
ul,
dl,
figure,
blockquote { margin: 0; }

/* Hierarchy comes from size, weight, air, and contrast. One family throughout. */

h1,
h2,
h3 {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(56px, 6vw, 84px);
  line-height: 0.98;
}

h2 {
  font-size: clamp(40px, 4.6vw, 64px);
  line-height: 1.03;
}

h3 {
  font-size: clamp(22px, 2vw, 29px);
  line-height: 1.22;
  letter-spacing: -0.03em;
}

.eyebrow {
  margin-bottom: 24px;
  color: var(--green-action);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

:focus-visible {
  outline: 3px solid var(--green-action);
  outline-offset: 4px;
}

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

.skip-link {
  position: fixed;
  inset: 12px auto auto 12px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  color: var(--cream);
  background: var(--ink);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Scroll reveal. Sections arrive once, and never move again. */

[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 700ms ease,
    transform 700ms var(--ease-out);
}

[data-reveal][data-visible="true"] {
  opacity: 1;
  transform: none;
}

/* Form status messaging */

[data-form-status][data-state="error"] { color: var(--risk); }
[data-form-status][data-state="success"] { color: var(--green-ink); }
[data-form-status][data-state="submitting"] { color: var(--muted); }

@media (max-width: 820px) {
  html {
    scroll-padding-top: 78px;
  }
}

@media (max-width: 430px) {
  html {
    scroll-padding-top: 72px;
  }

  body {
    font-size: 16px;
  }

  /* Sized so the first hero sentence still holds one line on a phone. */
  h1 {
    font-size: clamp(36px, 11.2vw, 52px);
  }

  h2 {
    font-size: clamp(34px, 9.6vw, 44px);
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
