:root {
  color-scheme: light;
  --canvas: #eef3f7;
  --surface: rgb(255 255 255 / 78%);
  --surface-solid: #ffffff;
  --surface-hover: #f5f9fc;
  --text: #0c1b26;
  --muted: #5d6f7d;
  --stroke: #c9d7e2;
  --stroke-strong: #9fb4c4;
  --accent: #0078d4;
  --accent-soft: #dceeff;
  --shadow: 0 18px 50px rgb(40 73 96 / 10%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0c151d;
  --surface: rgb(24 37 47 / 84%);
  --surface-solid: #18252f;
  --surface-hover: #20323e;
  --text: #f2f7fa;
  --muted: #a8bac7;
  --stroke: #344a59;
  --stroke-strong: #557184;
  --accent: #60cdff;
  --accent-soft: #143c50;
  --shadow: 0 20px 60px rgb(0 0 0 / 28%);
}

* { box-sizing: border-box; }
html { background: var(--canvas); scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 9% 2%, rgb(0 120 212 / 12%), transparent 30rem),
    radial-gradient(circle at 92% 18%, rgb(96 205 255 / 10%), transparent 34rem),
    var(--canvas);
  font: 15px/1.55 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

a { color: inherit; }
button, input { font: inherit; }
button { color: inherit; }
.skip-link { position: fixed; left: 12px; top: -48px; z-index: 20; padding: 8px 12px; background: var(--surface-solid); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: blur(22px) saturate(130%);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 680; text-decoration: none; }
.brand img { border-radius: 8px; }
.topbar nav { display: flex; align-items: center; gap: 6px; }
.topbar nav a, .topbar nav button {
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  text-decoration: none;
  cursor: pointer;
}
.topbar nav a:hover, .topbar nav button:hover { background: var(--surface-hover); }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 72px 0 88px; }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 48px; align-items: end; margin-bottom: 38px; }
.eyebrow { grid-column: 1 / -1; margin: 0 0 12px; color: var(--accent); font-size: 12px; font-weight: 760; letter-spacing: .16em; }
h1 { margin: 0; font-size: clamp(42px, 7vw, 74px); line-height: .98; letter-spacing: -.045em; }
.intro > p:not(.eyebrow) { grid-column: 1; margin: 20px 0 0; color: var(--muted); font-size: 18px; }
.summary { grid-column: 2; grid-row: 2 / 4; display: flex; gap: 32px; margin: 0; }
.summary div { min-width: 88px; }
.summary dt { font-size: 25px; font-weight: 720; }
.summary dd { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.explorer { padding: 22px; border: 1px solid var(--stroke); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.toolbar { display: flex; gap: 14px; }
.search-field { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border: 1px solid var(--stroke-strong); border-radius: 12px; background: var(--surface-solid); }
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.search-field svg { width: 20px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; }
.search-field kbd { color: var(--muted); font-size: 11px; border: 1px solid var(--stroke); border-radius: 5px; padding: 1px 6px; }
.view-switch { display: flex; padding: 4px; border: 1px solid var(--stroke); border-radius: 12px; background: var(--surface-solid); }
.view-switch button, .filter-row button { border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.view-switch button { padding: 7px 13px; white-space: nowrap; }
.view-switch button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; padding-bottom: 2px; }
.filter-row button { padding: 6px 10px; color: var(--muted); white-space: nowrap; }
.filter-row button[aria-pressed="true"] { color: var(--text); background: var(--surface-hover); box-shadow: inset 0 0 0 1px var(--stroke); }
.result-meta { min-height: 24px; margin: 18px 2px 8px; color: var(--muted); font-size: 13px; }
.results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.api-card { min-width: 0; padding: 18px; border: 1px solid var(--stroke); border-radius: 14px; background: var(--surface-solid); transition: border-color 140ms ease, transform 140ms ease; }
.api-card:hover { border-color: var(--stroke-strong); transform: translateY(-1px); }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.card-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.015em; }
.category { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.api-card > p { min-height: 46px; margin: 10px 0 14px; color: var(--muted); }
.signature { display: block; overflow: hidden; padding: 10px 12px; border-radius: 9px; background: var(--surface-hover); color: var(--text); font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.subline { margin-top: 7px; color: var(--muted); font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.card-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; }
.card-links a { color: var(--accent); font-size: 13px; font-weight: 650; text-decoration: none; }
.card-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.header-card > p { min-height: 0; }
.declarations { margin-top: 10px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.empty { display: grid; justify-items: center; gap: 4px; padding: 64px 20px; color: var(--muted); text-align: center; }
.empty strong { color: var(--text); font-size: 17px; }

footer { display: flex; justify-content: space-between; gap: 24px; width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 0 0 34px; color: var(--muted); font-size: 12px; }
footer a { color: var(--accent); text-decoration: none; }

@media (max-width: 820px) {
  main { padding-top: 48px; }
  .intro { display: block; }
  .summary { margin-top: 28px; }
  .toolbar { flex-direction: column; }
  .filter-row { flex-wrap: nowrap; overflow-x: auto; }
  .view-switch button { flex: 1; }
  .results { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .topbar { padding: 0 14px; }
  .topbar nav a { display: none; }
  main, footer { width: min(100% - 24px, 1180px); }
  .explorer { padding: 14px; border-radius: 16px; }
  .summary { gap: 18px; }
  .summary div { min-width: 0; }
  footer { flex-direction: column; }
}
