/* Cadans base styles. Mobile first, no framework, WCAG AA contrast. */

/*
 * Space Grotesk is self-hosted on purpose. Loading it from Google's CDN would
 * send every visitor's IP address to Google, which /info.html says does not
 * happen. SIL Open Font License; see assets/fonts/LICENSE.txt.
 */
@font-face {
  font-family: 'Space Grotesk';
  src: url('/assets/fonts/space-grotesk-var-latin.woff2') format('woff2-variations');
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --c-bg: #ffffff;
  --c-surface: #f4f6f4;
  --c-border: #d7ded9;
  --c-ink: #10221c;
  --c-ink-soft: #4a5a54;
  --c-accent: #b1440e;
  --c-accent-ink: #ffffff;
  --c-link: #0b5d4e;
  --c-focus: #0b5d4e;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;

  --radius: 10px;
  --measure: 34rem;

  /*
   * A characterful display face and an invisible body face. The display face
   * carries the brand and every number the runner reads at a glance; the body
   * face is the system stack, which costs nothing and disappears.
   */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: 'Space Grotesk', var(--font);
}

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

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

/* Layout rules below set display on these elements, so hidden must win. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--c-ink);
  background: var(--c-bg);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0 0 var(--space-3);
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1.2vw, 1.75rem); }
h3 { font-size: 1.125rem; }

p { margin: 0 0 var(--space-3); }

a {
  color: var(--c-link);
  text-underline-offset: 0.15em;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: var(--space-3);
  top: var(--space-3);
  z-index: 10;
  padding: var(--space-2) var(--space-3);
  background: var(--c-bg);
  border: 2px solid var(--c-ink);
  border-radius: var(--radius);
}

.wrap {
  width: 100%;
  max-width: 44rem;
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.prose { max-width: var(--measure); }

/* Header ------------------------------------------------------------------ */

.site-header {
  border-bottom: 1px solid var(--c-border);
  padding-block: var(--space-3);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  align-items: baseline;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3125rem;
  color: var(--c-ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand img {
  flex: none;
}

.brand-text span {
  display: block;
  font-family: var(--font);
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--c-ink-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Sections ---------------------------------------------------------------- */

.hero {
  padding-block: var(--space-5) var(--space-4);
}

.hero .lead {
  font-size: 1.1875rem;
  color: var(--c-ink-soft);
  max-width: var(--measure);
}

.section {
  padding-block: var(--space-4);
  border-top: 1px solid var(--c-border);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.steps li {
  background: var(--c-surface);
  border-radius: var(--radius);
  padding: var(--space-3);
}

.steps h3 { margin-bottom: var(--space-1); }
.steps p { margin: 0; color: var(--c-ink-soft); }

@media (min-width: 40rem) {
  .steps { grid-template-columns: repeat(2, 1fr); }
}

/* Forms ------------------------------------------------------------------- */

.field {
  display: block;
  margin-bottom: var(--space-3);
  max-width: var(--measure);
}

.field > span {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-1);
}

input[type="email"],
input[type="url"],
input[type="text"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  font: inherit;
  padding: 0.7rem 0.75rem;
  color: var(--c-ink);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}

.consent {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  max-width: var(--measure);
  margin-bottom: var(--space-3);
  font-size: 0.9375rem;
  color: var(--c-ink-soft);
}

.consent input {
  margin-top: 0.3rem;
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
}

.button {
  display: inline-block;
  font: inherit;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 0.75rem 1.25rem;
  color: var(--c-accent-ink);
  background: var(--c-accent);
  border: 2px solid var(--c-accent);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
}

.button:hover { filter: brightness(1.08); }
.button:active { transform: translateY(1px); }

.button[disabled],
.button[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

.button-secondary {
  color: var(--c-link);
  background: transparent;
  border-color: var(--c-border);
}

/* Legal ------------------------------------------------------------------- */

.site-footer {
  margin-top: var(--space-5);
  padding-block: var(--space-4) var(--space-5);
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
  font-size: 0.9375rem;
  color: var(--c-ink-soft);
}

.legal h2 {
  font-size: 1rem;
  margin-bottom: var(--space-1);
  color: var(--c-ink);
}

.legal > * + * { margin-top: var(--space-3); }
.legal p { margin: 0; max-width: var(--measure); }
