/* vestkeep.com, in the device UI's e-ink language: four colors, no motion, pressed is
   an instant inversion, keyboard focus is a 4px ring inside the element. */

@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2');
}

:root {
  /* Colors: these four and nothing else. */
  --black: #000000;
  --white: #ffffff;
  --gray-text: #4d4d4d; /* secondary text */
  --gray-divider: #bfbfbf; /* dividers */

  --font: 'Atkinson Hyperlegible', sans-serif;

  /* Sizes in rem so a larger browser text size makes everything larger.
     At the default 16px: body 22px, secondary 20px. */
  --body-size: 1.375rem;
  --secondary-size: 1.25rem;
  --body-line-height: 1.45;

  --column: 640px;
  --gutter: clamp(16px, 5vw, 32px);
  /* Touch targets: 10mm is about 38 CSS px. */
  --control-height: 3.5rem;

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  animation: none !important;
  transition: none !important;
}

html {
  background: var(--white);
  color: var(--black);
  font-family: var(--font);
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--white);
  font-size: var(--body-size);
  line-height: var(--body-line-height);
  overflow-wrap: break-word;
}

h1,
p {
  margin: 0;
}

a,
button,
input {
  -webkit-tap-highlight-color: transparent;
}

/* Focus: no browser ring. Keyboard focus is a 4px ring drawn inside the element,
   just inside its 2px border, so nothing moves when focus changes. */
:focus {
  outline: none;
}

:focus-visible {
  outline: 4px solid var(--black);
  outline-offset: -6px;
}

/* Column ------------------------------------------------------------------- */

.site-header,
.site-main,
.site-footer {
  width: 100%;
  max-width: calc(var(--column) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-header {
  padding-block: 24px 20px;
  border-bottom: 2px solid var(--black);
}

.wordmark {
  font-size: var(--body-size);
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.2;
}

.site-main {
  flex: 1;
  padding-block: 48px 56px;
}

.site-footer {
  padding-block: 12px 20px;
  border-top: 2px solid var(--black);
}

/* Home page ---------------------------------------------------------------- */

.headline {
  font-size: clamp(2.125rem, 8vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
}

.lead {
  margin-top: 28px;
}

.signup {
  margin-top: 44px;
  padding-top: 32px;
  border-top: 2px solid var(--gray-divider);
}

.signup__status {
  font-weight: 700;
}

.signup__form {
  margin-top: 24px;
}

.signup__label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  line-height: 1.2;
}

/* Field and button side by side when they fit, stacked (button full width) when not. */
.signup__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.signup__row .field {
  flex: 999 1 15rem;
  min-width: 0;
}

.signup__row .btn {
  flex: 1 0 auto;
}

/* Inline success or error text. Always rendered, so screen readers track the
   live region; it takes no space while empty. */
.signup__message:not(:empty) {
  margin-top: 16px;
  padding: 12px 16px;
  border: 2px solid var(--black);
  font-weight: 700;
}

.signup__note {
  margin-top: 20px;
  color: var(--gray-text);
  font-size: var(--secondary-size);
}

/* Result pages (thanks, signup error, 404) ---------------------------------- */

.page-title {
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
}

.page-action {
  margin-top: 32px;
}

/* Controls ------------------------------------------------------------------ */

.field {
  display: block;
  width: 100%;
  min-height: var(--control-height);
  margin: 0;
  padding: 8px 14px;
  border: 2px solid var(--black);
  border-radius: 0;
  background: var(--white);
  color: var(--black);
  font: inherit;
  line-height: 1.2;
  -webkit-appearance: none;
  appearance: none;
}

/* Browsers tint autofilled fields; keep them white. The inset shadow only paints the
   field's own background, nothing outside it. */
.field:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--white) inset;
  -webkit-text-fill-color: var(--black);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height);
  margin: 0;
  padding: 0 20px;
  border: 2px solid var(--black);
  border-radius: 0;
  background: var(--black);
  color: var(--white);
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-appearance: none;
  appearance: none;
}

/* On the black button the focus ring is white, inside the black edge. */
.btn:focus-visible {
  outline-color: var(--white);
}

/* Pressed: instant inversion. */
.btn:active {
  background: var(--white);
  color: var(--black);
}

.btn:active:focus-visible {
  outline-color: var(--black);
}

/* While sending: gray, no pressed state, still focusable. */
.btn[aria-disabled='true'],
.btn[aria-disabled='true']:active {
  border-color: var(--gray-divider);
  background: var(--white);
  color: var(--gray-text);
  cursor: default;
}

.btn[aria-disabled='true']:focus-visible {
  outline-color: var(--black);
}

/* White button: "Back to the home page". */
.btn--secondary {
  background: var(--white);
  color: var(--black);
  white-space: normal;
  text-align: center;
}

.btn--secondary:focus-visible {
  outline-color: var(--black);
}

.btn--secondary:active {
  background: var(--black);
  color: var(--white);
}

.btn--secondary:active:focus-visible {
  outline-color: var(--white);
}

/* The footer's email link. The padding leaves room for the focus ring inside the
   link, clear of the text; the negative margin keeps the text on the column edge. */
.footer-link {
  display: inline-block;
  margin-left: -10px;
  padding: 10px;
  color: var(--black);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.footer-link:focus-visible {
  outline-offset: -4px;
}

.footer-link:active {
  background: var(--black);
  color: var(--white);
}

.footer-link:active:focus-visible {
  outline-color: var(--white);
}

/* Hidden from people, still in the page (the honeypot). Not display: none. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
