/* www.sloppyvoice.com. Colours are tokens on :root; dark mode follows the
   system setting. No external resources. */

:root {
  color-scheme: light;
  --brand: #b6a2ff;
  --brand-ink: #171e2a;
  --bg: #fbfaff;
  --bg-subtle: #f2effc;
  --bg-raised: #ffffff;
  --bg-code: #f1eff8;
  --border: #e0dcef;
  --border-strong: #c3bcdc;
  --text: #171e2a;
  --text-muted: #525a6b;
  --link: #5b3fd0;
  --link-hover: #3b2499;
  --button-bg: #ffffff;
  --button-primary-bg: #171e2a;
  --button-primary-text: #ffffff;
  --note-border: #6d5ae0;
  --note-bg: #f1edff;
  --warn-border: #c2410c;
  --warn-bg: #fff4ea;
  --warn-title: #9a3412;
  --shadow: 0 1px 2px rgb(23 30 42 / 6%), 0 6px 20px rgb(23 30 42 / 7%);
  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #11151d;
    --bg-subtle: #171c26;
    --bg-raised: #1a202b;
    --bg-code: #151a23;
    --border: #2a3140;
    --border-strong: #3c4557;
    --text: #e6e8ef;
    --text-muted: #a3aabb;
    --link: #c4b5ff;
    --link-hover: #e0d8ff;
    --button-bg: #1a202b;
    --button-primary-bg: #b6a2ff;
    --button-primary-text: #171e2a;
    --note-border: #a594ff;
    --note-bg: #1c1a2e;
    --warn-border: #fb923c;
    --warn-bg: #2a1a0e;
    --warn-title: #fdba74;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 20px rgb(0 0 0 / 25%);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font-sans);
  overflow-wrap: break-word;
}

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}
a:hover {
  color: var(--link-hover);
}
:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
:not(pre) > code {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05em 0.3em;
}
pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  line-height: 1.5;
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: var(--gutter);
  top: 0.5rem;
  background: var(--bg-raised);
  padding: 0.5rem 0.75rem;
  z-index: 10;
}

/* header and footer */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
}
.header-inner,
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
}
.site-header ul {
  display: flex;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.site-header nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}
.site-header nav a:hover,
.site-header nav a[aria-current] {
  color: var(--text);
}
.site-header nav a[aria-current] {
  text-decoration: underline;
  text-decoration-color: var(--brand);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.5em;
}
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.site-footer p {
  margin: 0.3rem 0;
}

/* buttons */
.button {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  margin: 0 0.4rem 0.5rem 0;
}
.button:hover {
  border-color: var(--text-muted);
  color: var(--text);
}
.button.primary {
  background: var(--button-primary-bg);
  border-color: var(--button-primary-bg);
  color: var(--button-primary-text);
}
.button.primary:hover {
  color: var(--button-primary-text);
  filter: brightness(1.12);
}
.button .size {
  font-weight: 400;
  font-size: 0.85em;
  opacity: 0.75;
}

/* home */
.hero {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
.hero-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 4rem var(--gutter) 3.5rem;
  text-align: center;
}
.hero-icon svg {
  width: 84px;
  height: 84px;
}
.hero h1 {
  font-size: clamp(2.2rem, 7vw, 3.4rem);
  line-height: 1.1;
  margin: 1rem 0;
  letter-spacing: -0.02em;
}
.lede {
  font-size: 1.15rem;
  color: var(--text-muted);
}
.small {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.features,
.more {
  max-width: 1120px;
  margin: 0 auto;
  padding: 3rem var(--gutter) 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}
.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}
.card h2,
.more h2 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}
.card p {
  margin: 0;
  color: var(--text-muted);
}

/* document pages */
.doc {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 0;
}
.doc.narrow {
  max-width: 800px;
}
.page-header h1 {
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  line-height: 1.15;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}
.page-header .lede {
  margin-top: 0;
}
.platform {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 2rem;
}
.platform h2 {
  margin: 0 0 0.25rem;
}
.platform ul {
  padding-left: 1.2rem;
}
.checksums {
  list-style: none;
  padding: 0 !important;
}
.checksums li {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.6rem;
}
code.sum {
  font-size: 0.78rem;
  word-break: break-all;
  color: var(--text-muted);
}
code.file {
  align-self: flex-start;
}

.with-toc {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}
.toc {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  font-size: 0.9rem;
  padding-top: 0.5rem;
}
.toc h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc li {
  margin: 0.2rem 0;
}
.toc a {
  color: var(--text-muted);
  text-decoration: none;
}
.toc a:hover {
  color: var(--text);
}
@media (max-width: 900px) {
  .with-toc {
    display: block;
  }
  .toc {
    position: static;
    max-height: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 2rem;
  }
}

.prose {
  max-width: 760px;
  min-width: 0;
}
.prose h2 {
  margin-top: 2.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 1.5rem;
}
.prose h3 {
  margin-top: 2rem;
  font-size: 1.15rem;
}
.prose h2,
.prose h3 {
  position: relative;
}
.anchor {
  position: absolute;
  left: -1.1em;
  color: var(--border-strong);
  text-decoration: none;
  opacity: 0;
}
h2:hover .anchor,
h3:hover .anchor {
  opacity: 1;
}
.prose li {
  margin: 0.25rem 0;
}
.prose li > pre {
  margin: 0.75rem 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.93rem;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--bg-subtle);
  font-weight: 600;
}

.callout {
  border-left: 4px solid var(--note-border);
  background: var(--note-bg);
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 1rem;
  margin: 1.25rem 0;
}
.callout.warning {
  border-left-color: var(--warn-border);
  background: var(--warn-bg);
}
.callout p {
  margin: 0.25rem 0;
}
.callout-title {
  font-weight: 600;
}
.callout.warning .callout-title {
  color: var(--warn-title);
}
