/* Reset, typography and form primitives. */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 var(--t-md) / 1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.015em; line-height: 1.2; }
h1 { font-size: var(--t-2xl); letter-spacing: -0.025em; }
h2 { font-size: var(--t-lg); }
p { margin: 0; }

a { color: inherit; }
.link { color: var(--cobalt); text-decoration: none; font-weight: 550; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.code, code {
  font-family: var(--font-code);
  font-size: 0.86em;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.i {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.i .fill { fill: currentColor; stroke: none; }

.sr, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  border-radius: var(--r-control);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}

:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
main:focus { outline: none; }

input, select, textarea, button { font: inherit; color: inherit; }

input:where(:not([type=checkbox]):not([type=radio])), select, textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  background: var(--surface);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
input::placeholder { color: var(--faint); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cobalt) 22%, transparent);
}
input[aria-invalid=true] { border-color: var(--danger); }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }

select {
  appearance: none;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

input[type=checkbox] {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--cobalt);
  flex: none;
}

input[disabled], select[disabled], button[disabled] { opacity: 0.55; cursor: not-allowed; }
