/* Quicksloth site: one stylesheet, system fonts, light and dark themes. */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-soft: #f3f6fa;
  --text: #17212f;
  --muted: #4a5668;
  --border: #d5dde8;
  --brand: #1f3a5f;
  --accent: #34d399;
  --link: #1d4f91;
  --link-hover: #12345f;
  --code-bg: #eef2f7;
  --note-bg: #fff8e1;
  --note-border: #c99a06;
  --focus: #1d4f91;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1a2a;
    --bg-soft: #16243a;
    --text: #e7edf5;
    --muted: #aab6c7;
    --border: #2c3d57;
    --brand: #e7edf5;
    --link: #7ee2b8;
    --link-hover: #b4f0d5;
    --code-bg: #1c2c45;
    --note-bg: #2a2412;
    --note-border: #d9b23a;
    --focus: #7ee2b8;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--link-hover);
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 1rem;
  background: var(--bg);
  border: 2px solid var(--focus);
  z-index: 10;
}

.skip-link:focus {
  top: 1rem;
}

.wrap {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header and navigation */
.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--brand);
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  text-decoration: none;
  font-weight: 500;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
}

/* Main content */
main {
  padding: 2rem 0 3rem;
}

main .wrap > * {
  max-width: 46rem;
}

main .wrap > .cards,
main .wrap > .wide {
  max-width: none;
}

h1,
h2,
h3 {
  line-height: 1.25;
  color: var(--text);
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.45rem;
  margin: 2.5rem 0 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 1.15rem;
  margin: 1.75rem 0 0.5rem;
}

.lead {
  font-size: 1.2rem;
  color: var(--muted);
}

.updated {
  color: var(--muted);
  font-size: 0.95rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.ui {
  font-weight: 600;
}

.note {
  background: var(--note-bg);
  border-left: 4px solid var(--note-border);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin: 1.25rem 0;
}

.note > :first-child {
  margin-top: 0;
}

.note > :last-child {
  margin-bottom: 0;
}

/* Hero on the home page */
.hero {
  padding: 1rem 0 0.5rem;
}

.hero p {
  max-width: 40rem;
}

.accent-bar {
  display: block;
  width: 3.5rem;
  height: 0.35rem;
  margin-bottom: 1rem;
  background: var(--accent);
  border-radius: 2px;
}

/* Product cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

.card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  background: var(--bg-soft);
}

.card h3,
.card .card-title {
  margin: 0 0 0.5rem;
  padding: 0;
  border: 0;
  font-size: 1.15rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.status {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

/* Tables */
.table-scroll {
  overflow-x: auto;
}

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

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

th {
  background: var(--bg-soft);
}

/* On-this-page navigation */
.toc {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  background: var(--bg-soft);
  margin: 1.5rem 0;
}

.toc h2 {
  font-size: 1rem;
  margin: 0 0 0.25rem;
  padding: 0;
  border: 0;
}

.toc ol {
  margin: 0;
  padding-left: 1.25rem;
}

.sub-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  font-size: 0.97rem;
}

dt {
  font-weight: 600;
  margin-top: 1rem;
}

dd {
  margin-left: 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.93rem;
  padding: 1.5rem 0 2rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

.site-footer p {
  margin: 0.25rem 0;
}

@media print {
  .site-nav,
  .skip-link {
    display: none;
  }
}
