/* Hubbo site. Light and dark follow the system. Colors match the web admin's teal. */
:root {
  --bg: oklch(0.985 0.002 247);
  --fg: oklch(0.21 0.02 260);
  --card: oklch(1 0 0);
  --muted: oklch(0.5 0.02 260);
  --band: oklch(0.96 0.006 220);
  --border: oklch(0.9 0.006 250);
  --primary: oklch(0.5 0.1 190);
  --primary-fg: oklch(0.99 0 0);
  --link: oklch(0.45 0.1 195);
  --chip: oklch(0.94 0.03 190);
  --chip-fg: oklch(0.3 0.06 195);
  --ring: oklch(0.6 0.12 190);
  --radius: 0.65rem;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.16 0.008 260);
    --fg: oklch(0.95 0.005 260);
    --card: oklch(0.2 0.009 260);
    --muted: oklch(0.72 0.015 260);
    --band: oklch(0.19 0.012 230);
    --border: oklch(0.3 0.01 260);
    --primary: oklch(0.72 0.12 190);
    --primary-fg: oklch(0.18 0.03 200);
    --link: oklch(0.8 0.1 190);
    --chip: oklch(0.27 0.03 200);
    --chip-fg: oklch(0.9 0.04 190);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1rem/1.6 var(--font);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; outline: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); letter-spacing: -0.02em; }
h2 { font-size: 1.4rem; margin-top: 2rem; }
h3 { font-size: 1.05rem; margin-top: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: 0.15em; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: 4px;
}
.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1rem; }
.page { padding-top: 1.5rem; padding-bottom: 3rem; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }
.muted { color: var(--muted); }
.count { color: var(--muted); font-size: 0.85em; font-weight: 400; font-variant-numeric: tabular-nums; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--card); padding: 0.5rem 1rem; z-index: 2; }
.skip:focus { left: 0.5rem; }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--border); background: var(--card); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.5rem; }
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.15rem; color: var(--fg); text-decoration: none; }
.site-header ul { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.site-header nav a { color: var(--fg); text-decoration: none; font-weight: 500; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--link); text-decoration: underline; }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.875rem; padding: 1.5rem 0 1rem; text-align: center; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: 0.5rem 1.1rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--fg);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0; }

/* Homepage */
.hero { padding: 3.5rem 0 3rem; }
.hero h1 { max-width: 44rem; }
.band { padding: 2.5rem 0; }
.band.alt { background: var(--band); }
.band h2 { margin-top: 0; }
.needs { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.needs li { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.needs h3 { margin-top: 0; }
.needs p { margin: 0; color: var(--muted); }
.needs { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.features { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.features h2 { font-size: 1.2rem; }
.get .lead { margin-bottom: 0; }

/* Search */
.search { display: flex; gap: 0.5rem; margin: 1.25rem 0 0.5rem; max-width: 40rem; }
.search input, .filter input {
  flex: 1; min-width: 0; min-height: 2.75rem; padding: 0.5rem 0.85rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--fg); font: inherit;
}
.filter { display: flex; flex-direction: column; gap: 0.25rem; max-width: 24rem; margin: 1rem 0; font-weight: 500; }
.results-h { font-size: 1.1rem; margin-top: 1.5rem; }

/* Lists */
.crumbs { font-size: 0.9rem; margin-bottom: 0.75rem; color: var(--muted); }
.chips, .tags { list-style: none; padding: 0; margin: 0.75rem 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips a {
  display: inline-flex; gap: 0.4rem; align-items: baseline; min-height: 2.25rem; padding: 0.35rem 0.85rem;
  border-radius: 999px; background: var(--chip); color: var(--chip-fg); text-decoration: none; font-weight: 500;
}
.chips a[aria-current] { background: var(--primary); color: var(--primary-fg); }
.chips a[aria-current] .count { color: inherit; }
.tags li { padding: 0.2rem 0.7rem; border: 1px solid var(--border); border-radius: 999px; font-size: 0.9rem; }
.tiles { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
.tiles a, .list a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.75rem 1rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--fg); text-decoration: none;
}
.tiles a:hover, .list a:hover { border-color: var(--primary); }
.name { font-weight: 600; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: 0.875rem; white-space: nowrap; }
.list { list-style: none; padding: 0; margin: 0.5rem 0; display: grid; gap: 0.5rem; }
@media (max-width: 30rem) {
  .list a { flex-direction: column; gap: 0.1rem; }
}
.columns { list-style: none; padding: 0; margin: 0.5rem 0; columns: 14rem; column-gap: 2rem; }
.columns li { break-inside: avoid; padding: 0.2rem 0; }
.letters { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin: 0.5rem 0 1rem; font-weight: 600; }
.letters a { padding: 0.25rem; }
.letter-group h2 { margin-top: 1.5rem; scroll-margin-top: 1rem; }

/* Device page */
h1 .maker { display: block; font-size: 0.5em; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.5rem; margin: 0; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; }
@media (max-width: 30rem) {
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 0.6rem; }
}
.keys { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.keys li { padding: 0.25rem 0.65rem; background: var(--card); border: 1px solid var(--border); border-radius: 0.4rem; font-size: 0.9rem; }
.note { margin-top: 0.75rem; color: var(--muted); }
.eyebrow { font-weight: 600; color: var(--link); margin-bottom: 0.5rem; }

/* Spec pages */
.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tabs a { padding: 0.5rem 0; color: var(--fg); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; }
.tabs a[aria-current] { color: var(--link); border-bottom-color: var(--link); }
.doc-page { display: grid; gap: 0 2.5rem; }
.doc-page > .tabs, .doc-page > .doc-title { grid-column: 1 / -1; }
.doc-title { font-size: clamp(1.7rem, 4vw, 2.3rem); }
@media (min-width: 60rem) {
  .doc-page:has(.toc) { grid-template-columns: 14rem minmax(0, 1fr); }
  .toc { position: sticky; top: 1rem; align-self: start; max-height: calc(100vh - 2rem); overflow: auto; }
}
.toc-h { font-size: 0.9rem; font-weight: 600; margin: 0 0 0.5rem; color: var(--muted); }
.toc ul { list-style: none; margin: 0 0 1.5rem; padding: 0; font-size: 0.9rem; }
.toc li { margin: 0.2rem 0; }
.prose { min-width: 0; max-width: 48rem; }
.prose h2 { scroll-margin-top: 1rem; }
.prose li { margin: 0.25rem 0; }
.prose code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.prose :not(pre) > code { background: var(--chip); color: var(--chip-fg); padding: 0.05em 0.35em; border-radius: 0.3rem; }
.prose pre {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.9rem 1rem; overflow: auto; max-height: 32rem; line-height: 1.45;
}
.prose pre code { overflow-wrap: normal; }
.table-wrap { overflow-x: auto; margin: 1rem 0; }
.prose table { border-collapse: collapse; font-size: 0.9rem; min-width: 100%; }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; }
.prose th { background: var(--band); }
.source { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }
