:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1b1f24;
  --muted: #5b6470;
  --border: #e3e6ea;
  --accent: #0b6e99;
  --accent-soft: #e6f2f8;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --surface: #1a1e24;
    --text: #e8eaed;
    --muted: #9aa3ad;
    --border: #2b3139;
    --accent: #5cb8e6;
    --accent-soft: #1b2a33;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* Header and footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.brand span { color: var(--accent); }
.site-header nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--accent); }

.site-footer { border-top: 1px solid var(--border); margin-top: 56px; padding: 24px 0 40px; color: var(--muted); font-size: .875rem; }
.site-footer p { margin: 6px 0; }

/* Home */
.hero { padding: 48px 0 24px; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.2; margin: 0 0 12px; }
.hero p { color: var(--muted); max-width: 640px; margin: 0; font-size: 1.05rem; }
.facts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; padding: 0; list-style: none; }
.facts li { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 4px 14px; font-size: .9rem; font-weight: 600; }

.search { width: 100%; max-width: 420px; margin: 8px 0 8px; padding: 10px 14px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.category h2 { font-size: 1.2rem; margin: 36px 0 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }

.app { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; color: inherit; text-decoration: none; transition: border-color .15s; }
.app:hover { border-color: var(--accent); }
.app img { width: 64px; height: 64px; border-radius: 22%; flex: none; }
.app h3 { font-size: 1rem; margin: 0 0 4px; line-height: 1.3; }
.app p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.app .get { display: inline-block; margin-top: 8px; font-size: .85rem; font-weight: 600; color: var(--accent); }
.empty { color: var(--muted); display: none; }

/* Text pages */
.doc { max-width: 760px; padding: 40px 16px 0; }
.doc h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 6px; }
.doc .meta { color: var(--muted); margin: 0 0 28px; }
.doc h2 { font-size: 1.2rem; margin: 32px 0 8px; }
.doc li { margin: 4px 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin: 20px 0; }
.card p { margin: 6px 0; }
details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin: 10px 0; }
details summary { cursor: pointer; font-weight: 600; }
details p, details ul { margin: 10px 0 2px; }
