:root {
  --bg: #0f172a;
  --surface: #111827;
  --surface-strong: #1f2937;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-strong: #22d3ee;
  --border: rgba(148, 163, 184, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background: linear-gradient(180deg, #020617 0%, #0c1727 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--accent-strong);
}

/* Top nav */

.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: rgba(9, 19, 38, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.topnav-brand {
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
}

.topnav-brand:hover {
  color: var(--accent-strong);
}

.topnav-home {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: color 0.15s, border-color 0.15s;
}

.topnav-home:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Main content */

.page-main {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.2;
}

.page-subtitle {
  margin: 12px 0 0;
  color: var(--text-muted);
}

.page-content {
  line-height: 1.75;
}

.page-content h2,
.page-content h3 {
  color: #f8fafc;
  margin-top: 2rem;
}

.page-content a {
  color: var(--accent);
}

.page-content ol,
.page-content ul {
  padding-left: 1.4rem;
}

.page-content li {
  margin-bottom: 8px;
}

.page-content code {
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
  background: rgba(148, 163, 184, 0.08);
  padding: 0.2em 0.36em;
  border-radius: 0.28rem;
}

.page-content pre {
  overflow-x: auto;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 12px;
}

.page-content img {
  max-width: 100%;
  border-radius: 12px;
  margin: 24px 0;
  border: 1px solid var(--border);
  display: block;
}

strong {
  color: #f8fafc;
}

.page-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Device search + cards */

#device-search {
  display: block;
  width: 100%;
  max-width: 480px;
  padding: 12px 16px;
  margin: 24px 0 28px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

#device-search:focus {
  border-color: var(--accent);
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.device-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.device-card:hover {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.06);
  color: var(--accent-strong);
}

/* Details/summary dropdowns */

details {
  margin: 20px 0;
  padding: 14px 18px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 10px;
}

details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
  user-select: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: '+ ';
}

details[open] summary::before {
  content: '− ';
}

details p {
  margin: 12px 0 0;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Mobile */

@media (max-width: 600px) {
  .topnav {
    padding: 0 16px;
  }

  .topnav-brand {
    font-size: 0.9rem;
  }

  .topnav-home {
    font-size: 0.8rem;
    padding: 5px 10px;
  }

  .page-main {
    padding: 32px 16px 48px;
  }

  .device-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .device-card {
    padding: 20px 12px;
    font-size: 0.9rem;
  }
}

