/* Base elements and components shared by the public site and the app. */

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p, figure { margin: 0; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Buttons */
.button {
  display: inline-grid;
  place-items: center;
  min-height: var(--tap);
  padding: 0 var(--space-5);
  border: 0;
  border-radius: var(--radius-pill);
  font: 500 var(--text-xs) / 1 var(--font-sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration-quick) var(--ease-out),
              color var(--duration-quick) var(--ease-out);
}

.button-primary {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}

.button-primary[aria-pressed="true"] {
  background: var(--color-accent-soft);
  color: var(--color-ink);
}

.button-quiet {
  background: transparent;
  color: var(--color-ink);
  box-shadow: inset 0 0 0 1px var(--color-line);
}

/* Form fields. 16px text stops iOS from zooming in on focus. */
.field-label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 500;
}

.field {
  min-height: var(--tap);
  width: 100%;
  padding: 0 var(--space-4);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-ink);
  font: 400 1rem / 1 var(--font-sans);
}

.field[aria-invalid="true"] { border-color: var(--color-danger); }

.field-error {
  margin-top: var(--space-2);
  color: var(--color-danger);
  font-size: var(--text-sm);
}

/* Off-screen for people, still visible to bots that fill in every field. */
.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.button-block { width: 100%; }

.button-danger { color: var(--color-danger); }

.button-danger-solid {
  background: var(--color-danger);
  color: var(--color-accent-ink);
}

/* A button that reads as a link (for POST actions inside text) */
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.field-hint {
  margin-top: var(--space-1);
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}

select.field { appearance: auto; }

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

[hidden] { display: none !important; }

textarea.field {
  min-height: 6rem;
  padding-block: var(--space-3);
  border-radius: var(--radius-md);
  resize: vertical;
}

/* The wordmark: Etheli in widely spaced Bodoni capitals. The spacing after the last
   letter is taken back, so it sits centred. */
.wordmark-text {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  /* Bodoni's hairlines vanish when small: a heavier weight and a small optical size
     (which thickens the thin strokes) keep every letter, the H's bar too, visible. */
  font-weight: 650;
  font-variation-settings: "opsz" 8;
  letter-spacing: 0.32em;
  margin-right: -0.32em;
  line-height: 1.2;
  text-transform: uppercase;
}

