/* Atelier's own palette and type, so the documentation reads like the theme
   it documents: ink on paper, Klein blue, square corners, hairlines. */

:root {
  --ink: #101010;
  --paper: #ffffff;
  --bone: #f4f2ee;
  --accent: #002fa7;
  --muted: #6b6b6b;
  --line: #e3e0da;

  --shell: 68rem;
  --measure: 40rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: 'Oswald', 'Archivo', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.05;
  margin: 0;
}

h1 {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h3 {
  font-size: 1.125rem;
  letter-spacing: 0.04em;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.9em;
  background: var(--bone);
  padding: 0.1em 0.35em;
}

pre {
  background: var(--bone);
  padding: 1rem 1.25rem;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.shell {
  width: min(100% - 3rem, var(--shell));
  margin-inline: auto;
}

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

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1rem;
}

/* ------------------------------------------------------------- chrome -- */

.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 5;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.wordmark {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  padding-block: 0.5rem;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  border-bottom-color: var(--accent);
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 5rem;
  padding-block: 2rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
}

.site-footer p {
  margin: 0;
}

/* --------------------------------------------------------------- docs -- */

.docs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  padding-top: 3rem;
}

@media (min-width: 60rem) {
  .docs {
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 4rem;
  }

  .docs__toc {
    position: sticky;
    top: 5.5rem;
    align-self: start;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
  }
}

.docs__toc-title {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.docs__toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}

.docs__toc li a {
  display: block;
  padding: 0.3rem 0 0.3rem 1rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.875rem;
}

.docs__toc li a:hover {
  border-left-color: var(--accent);
  color: var(--accent);
}

.docs__body {
  max-width: 44rem;
}

.docs__body > h1 {
  margin-bottom: 1.5rem;
}

/* Every section in the manual is already preceded by a rule in the Markdown,
   so the heading adds space, not a second line. */
.docs__body h2 {
  margin-top: 2rem;
}

.docs__body h3 {
  margin-top: 2.25rem;
}

.docs__body p,
.docs__body ul,
.docs__body ol {
  margin-block: 1rem;
}

.docs__body li {
  margin-block: 0.35rem;
}

.docs__body blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 2px solid var(--accent);
  background: var(--bone);
  color: var(--ink);
}

.docs__body blockquote p {
  margin: 0;
}

.docs__body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 3.25rem 0 0;
}

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

.page {
  padding-top: 3.5rem;
  max-width: var(--measure);
}

.page--narrow {
  max-width: 34rem;
}

.page h1 {
  margin-bottom: 1.25rem;
}

.lede {
  font-size: 1.0625rem;
}

.notice {
  padding: 0.85rem 1rem;
  margin-block: 1.5rem;
  border-left: 2px solid var(--accent);
  background: var(--bone);
}

.notice--error {
  border-left-color: #b3261e;
}

/* --------------------------------------------------------------- form -- */

.form {
  margin-top: 2.5rem;
  display: grid;
  gap: 1.5rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

.field__optional {
  color: var(--muted);
  letter-spacing: 0.06em;
}

.field input[type='text'],
.field input[type='email'],
.field select,
.field textarea {
  font: inherit;
  color: inherit;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
}

.field textarea {
  resize: vertical;
  min-height: 9rem;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  border-color: var(--accent);
}

.field input[aria-invalid='true'],
.field textarea[aria-invalid='true'],
.field select[aria-invalid='true'] {
  border-color: #b3261e;
}

.field input[type='file'] {
  font-size: 0.875rem;
  padding: 0.5rem 0;
}

.field__hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}

.field__error {
  margin: 0;
  font-size: 0.8125rem;
  color: #b3261e;
}

/* Off-screen and out of the tab order: only a bot fills this in. */
.field--trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.button {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.875rem;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 0;
  padding: 0.95rem 2rem;
  cursor: pointer;
  justify-self: start;
  min-height: 2.75rem;
}

.button:hover {
  background: var(--accent);
}

.form__promise {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
