/* Tokens mirror src/assets/tailwind.css. Touch'N'Stars is a dark-only app,
   so this page commits to the same single palette instead of offering a
   light variant the app itself does not have. */
:root {
  color-scheme: dark;

  --ground: #0a0f1c;
  --surface-1: #111827;
  --surface-2: #1a2336;
  --surface-3: #243049;

  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.32);

  --content: #e2e8f0;
  --content-muted: #8fa3bf;
  --content-faint: #64748b;

  --accent: #22d3ee;
  --accent-action: #036682;

  --status-ok: #34d399;
  --status-warn: #fbbf24;
  --status-danger: #f87171;

  --radius-card: 14px;
  --radius-control: 12px;
  --radius-chip: 10px;

  --mono:
    ui-monospace, 'Cascadia Mono', 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}
html {
  background: var(--ground);
}
body {
  margin: 0;
  background: var(--ground);
  color: var(--content);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
.wrap {
  max-width: 58rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem) 4rem;
}

/* ---- Masthead ---- */
.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.brand img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-chip);
  flex-shrink: 0;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
h1 {
  margin: 0.15rem 0 0;
  font-size: clamp(1.6rem, 1.1rem + 2vw, 2.3rem);
  line-height: 1.12;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.standfirst {
  margin: 1rem 0 0;
  max-width: 46rem;
  color: var(--content-muted);
}
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line-strong);
}
.stat {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-chip);
  background: var(--surface-1);
  color: var(--content-muted);
  font-variant-numeric: tabular-nums;
}

/* ---- Controls ---- */
.controls {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 1.5rem 0;
}
#search {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  font: inherit;
  color: var(--content);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  transition: border-color 0.15s;
}
#search::placeholder {
  color: var(--content-faint);
}
#search:focus {
  outline: none;
  border-color: var(--accent-action);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.5);
}
.select {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  font: inherit;
  color: var(--content);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  transition: border-color 0.15s;
}
.select:focus {
  outline: none;
  border-color: var(--accent-action);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.5);
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.filter {
  font: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--content);
  cursor: pointer;
  transition: all 0.15s ease-out;
}
.filter:hover {
  background: var(--surface-2);
}
.filter:active {
  transform: scale(0.97);
}
.filter[aria-pressed='true'] {
  background: var(--accent-action);
  border-color: var(--accent-action);
  color: #fff;
}
.filter:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.5);
}

/* ---- Manufacturer groups ---- */
/* Level 1: groups the whole page by vendor, above the device cards below. */
.vendor-group + .vendor-group {
  margin-top: 1.6rem;
}
.vendor-group-heading {
  margin: 0 0 0.6rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--content-muted);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
}

/* ---- Device cards ---- */
.devices {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.device {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 1rem 1.1rem;
}
.device-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.device-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.008em;
}
.device-cat {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--content-faint);
}
.drivers {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
/* Level 2 of three: device card (surface-1) > driver (surface-2) >
   user note (ground). Each step changes the surface, so it is obvious at a
   glance which text is a driver name and which is somebody's remark. */
.driver {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-control);
  background: var(--surface-2);
  border-left: 3px solid var(--line-strong);
}
.driver.works {
  border-left-color: var(--status-ok);
}
.driver.caveat {
  border-left-color: var(--status-warn);
}
.driver.broken {
  border-left-color: var(--status-danger);
}

.label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--content-faint);
}
.driver-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.75rem;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
}
.status.works {
  color: var(--status-ok);
}
.status.caveat {
  color: var(--status-warn);
}
.status.broken {
  color: var(--status-danger);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
  background: currentColor;
}
.driver-name {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--content);
  word-break: break-word;
}
.stack {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-left: 0.5rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--content-muted);
  white-space: nowrap;
}
.driver-meta {
  font-size: 0.75rem;
  color: var(--content-faint);
  font-variant-numeric: tabular-nums;
}

/* Level 3: what a user wrote, sunk into the page ground and set in the
   body face - deliberately unlike the monospaced driver name above it. */
.note {
  margin-top: 0.2rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-chip);
  background: var(--ground);
  border: 1px solid var(--line);
}
.note .label {
  display: block;
  margin-bottom: 0.15rem;
}
.note p,
.note ul {
  margin: 0;
  font-size: 0.9rem;
  color: var(--content-muted);
}
.note ul {
  padding-left: 1.1rem;
}
.note li + li {
  margin-top: 0.3rem;
}

/* ---- States & footer ---- */
.msg {
  padding: 1.75rem 1.25rem;
  text-align: center;
  color: var(--content-muted);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.contribute {
  margin-top: 2.5rem;
  padding: 1.1rem 1.3rem;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-card);
}
.contribute h2 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}
.contribute p {
  margin: 0;
  color: var(--content-muted);
  font-size: 0.95rem;
}
footer {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--content-faint);
}
a {
  color: var(--accent);
  text-underline-offset: 0.16em;
}
