/*
 * Element defaults and reset.
 *
 * Deliberately thin: the goal is sane defaults for unclassed elements so that
 * partials can render plain HTML and still look right, not a full normalize.
 */

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

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

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);

  /* Tabular figures keep hour and money columns from jittering as they update. */
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h1 {
  font-size: var(--text-2xl);
}

h2 {
  font-size: var(--text-xl);
}

h3 {
  font-size: var(--text-lg);
}

h4 {
  font-size: var(--text-md);
}

h5,
h6 {
  font-size: var(--text-base);
}

p,
ul,
ol,
dl,
figure,
blockquote,
pre {
  margin: 0;
}

a {
  color: var(--color-text-link);
  text-decoration-color: var(--color-border-strong);
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration-color: currentcolor;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

svg {
  fill: none;
  stroke: currentcolor;
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  padding: 0.1em 0.3em;
  border-radius: var(--radius-sm);
  background-color: var(--color-surface-sunken);
}

pre {
  overflow-x: auto;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background-color: var(--color-surface-sunken);
}

pre code {
  padding: 0;
  background-color: transparent;
}

hr {
  height: 1px;
  margin: var(--space-4) 0;
  border: 0;
  background-color: var(--color-border);
}

/* Inherit the type stack rather than falling back to the browser's. */
button,
input,
select,
textarea {
  margin: 0;
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

textarea {
  resize: vertical;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-weight: var(--weight-semibold);
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
}

/*
 * Visible focus for keyboard users only. This app is heavily keyboard-driven
 * (triage queue, kanban), so the ring is prominent on purpose.
 */
:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

::selection {
  background-color: var(--color-primary-subtle);
  color: var(--color-primary-text);
}

::placeholder {
  color: var(--color-text-subtle);
  opacity: 1;
}

/* Turbo shows this on slow navigations; keep it subtle rather than a spinner. */
.turbo_progress_bar {
  height: 2px;
  background-color: var(--color-primary);
}

/*
 * An accessibility override has to beat every component rule that sets a
 * transition, which is the one case !important is the correct tool.
 */
/* stylelint-disable declaration-no-important */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
/* stylelint-enable declaration-no-important */
