:root {
  color-scheme: dark light;
  --bg: #0b0b0b;
  --surface: #151515;
  --fg: #f4f4f4;
  --muted: #bdbdbd;
  --line: #3a3a3a;
  --focus: #ffffff;
  --button-bg: #f4f4f4;
  --button-fg: #0b0b0b;
  --max: 46rem;
  --gutter: 1rem;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #fafafa;
    --surface: #ffffff;
    --fg: #111111;
    --muted: #4a4a4a;
    --line: #c8c8c8;
    --focus: #000000;
    --button-bg: #111111;
    --button-fg: #fafafa;
  }
}

:root[data-theme="light"] {
  --bg: #fafafa;
  --surface: #ffffff;
  --fg: #111111;
  --muted: #4a4a4a;
  --line: #c8c8c8;
  --focus: #000000;
  --button-bg: #111111;
  --button-fg: #fafafa;
}

* { box-sizing: border-box; }

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

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

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

a { color: var(--fg); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background: var(--button-bg);
  color: var(--button-fg);
  padding: 0.75rem 1rem;
  min-height: 48px;
  z-index: 10;
}
.skip-link:focus { top: var(--gutter); }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header and navigation */
.site-header {
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  min-height: 64px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.brand {
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 0.75rem;
  text-decoration: none;
}
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* Type */
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 6vw, 3.25rem); margin: 0 0 1rem; }
h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); margin: 0 0 0.75rem; }
h3 { font-size: 1.15rem; margin: 0 0 0.5rem; }
p { margin: 0 0 1rem; }
.lead { font-size: clamp(1.1rem, 2.6vw, 1.3rem); color: var(--muted); }
.eyebrow {
  text-transform: none;
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

main section { padding: 2.5rem 0; border-top: 1px solid var(--line); }
main section:first-child { border-top: 0; }
.hero { padding-top: 3rem; padding-bottom: 2.5rem; }

/* Buttons and links styled as buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 48px;
  padding: 0.65rem 1.25rem;
  border: 2px solid var(--fg);
  border-radius: 6px;
  background: var(--button-bg);
  color: var(--button-fg);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button.secondary {
  background: transparent;
  color: var(--fg);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Steps and lists */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.steps li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 1rem 1.1rem;
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--fg);
  border-radius: 50%;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.checklist {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}
.checklist li { margin-bottom: 0.5rem; }

.notice {
  border: 1px solid var(--line);
  border-left: 4px solid var(--fg);
  background: var(--surface);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  margin: 1.25rem 0;
}
.notice strong { display: block; margin-bottom: 0.25rem; }

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}
code {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.3em;
  word-break: break-word;
}
pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  max-width: 100%;
}
pre code { border: 0; padding: 0; }

/* Atlas filters */
.filters {
  display: grid;
  gap: 0.75rem;
  margin: 1.5rem 0 0.5rem;
}
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--fg);
  font: inherit;
}
.field input:focus-visible,
.field select:focus-visible { border-color: var(--fg); }
.count {
  color: var(--muted);
  margin: 0.75rem 0 1rem;
}

.printer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.printer-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 1rem 1.1rem;
}
.printer-card header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem 1rem;
  margin-bottom: 0.5rem;
}
.printer-card h3 { margin: 0; }
.badge {
  display: inline-block;
  border: 1px solid var(--fg);
  border-radius: 999px;
  padding: 0.05rem 0.65rem;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge::before { content: attr(data-icon) " "; }
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 0.9rem;
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
}
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
details { margin-top: 0.75rem; }
summary {
  cursor: pointer;
  min-height: 48px;
  display: flex;
  align-items: center;
  font-weight: 600;
}
.command-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin-top: 0.5rem;
}
.command-table th,
.command-table td {
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--line);
  padding: 0.45rem 0.35rem;
}
.command-table code { white-space: normal; }
.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 1.25rem;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  padding: 2rem 0 3rem;
}

[hidden] { display: none !important; }

@media (min-width: 40rem) {
  .filters { grid-template-columns: 2fr 1fr 1fr; align-items: end; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .printer-list { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  .button { transition: background-color 120ms ease; }
}
