  :root {
    --bg: #06080b;
    --bg-raised: #0e1218;
    --card: #10151d;
    --card-border: #1d2530;
    --text: #e7eaf0;
    --text-dim: #8b95a7;
    --text-faint: #5b6473;
    --tier-a: #59d6b8;
    --tier-a-dim: rgba(89, 214, 184, 0.14);
    --tier-b: #e8ac4d;
    --tier-b-dim: rgba(232, 172, 77, 0.14);
    --caution: #e2543d;
  }

  * { box-sizing: border-box; }

  html { scroll-behavior: smooth; }

  @media (min-width: 641px) {
    html { font-size: 18px; }
  }

  body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
  }

  a { color: inherit; }

  .display {
    font-family: 'Space Grotesk', system-ui, sans-serif;
  }

  .mono {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
  }

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

  /* ---------- header ---------- */

  .top {
    padding: 22px 0;
    border-bottom: 1px solid var(--card-border);
  }

  .top .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
  }

  .top .back {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s;
  }

  .top .back:hover { color: var(--text); }

  .site-nav {
    display: flex;
    align-items: center;
    gap: 22px;
  }

  .site-nav a {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.85rem;
    transition: color 0.15s;
  }

  .site-nav a:hover { color: var(--tier-a); }

  .site-nav a.lang-switch {
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.78rem;
  }
  .site-nav a.lang-switch:hover { border-color: var(--tier-a); }

  .nav-dropdown {
    position: relative;
  }

  .nav-dropdown-label {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-dim);
    font-size: 0.85rem;
    cursor: default;
  }

  .nav-dropdown-label::after {
    content: "▾";
    font-size: 0.65em;
  }

  .nav-dropdown:hover .nav-dropdown-label,
  .nav-dropdown:focus-within .nav-dropdown-label {
    color: var(--tier-a);
  }

  .nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 180px;
    background: var(--bg-raised);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 4px 0;
    z-index: 20;
  }

  .nav-dropdown-menu a {
    display: block;
    padding: 8px 14px;
    white-space: nowrap;
  }

  .nav-dropdown:hover .nav-dropdown-menu,
  .nav-dropdown:focus-within .nav-dropdown-menu {
    display: block;
  }

  .nav-toggle { display: none; }

  .nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 26px;
    height: 20px;
    cursor: pointer;
  }

  .nav-burger span {
    display: block;
    height: 2px;
    background: var(--text-dim);
    border-radius: 2px;
  }

  .top .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
  }

  .top .brand img {
    display: block;
    border-radius: 6px;
  }

  .top .word {
    font-weight: 600;
    letter-spacing: 0.02em;
    font-size: 1rem;
    color: var(--text-faint);
  }

  /* ---------- hero ---------- */

  .hero {
    padding: 76px 0 56px;
    border-bottom: 1px solid var(--card-border);
  }

  .hero .prompt {
    font-size: 0.82rem;
    color: var(--tier-a);
    margin: 0 0 20px;
    letter-spacing: 0.01em;
  }

  .hero .prompt .cursor {
    display: inline-block;
    width: 0.55em;
    height: 1em;
    background: var(--tier-a);
    vertical-align: text-bottom;
    margin-left: 2px;
    animation: blink 1.1s steps(1) infinite;
  }

  @media (prefers-reduced-motion: reduce) {
    .hero .prompt .cursor { animation: none; }
  }

  @keyframes blink { 50% { opacity: 0; } }

  h1.display {
    font-size: clamp(2.1rem, 5vw, 3.1rem);
    font-weight: 700;
    line-height: 1.12;
    margin: 0 0 20px;
    max-width: 15ch;
    letter-spacing: -0.01em;
  }

  .hero p.lede {
    max-width: 62ch;
    color: var(--text-dim);
    font-size: 1.05rem;
    margin: 0 0 34px;
  }

  .tiers-heading {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 14px;
  }

  .legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
  }

  .cat-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
  }

  .cat-nav-label {
    font-size: 0.8rem;
    color: var(--text-faint);
    margin-right: 2px;
  }

  .cat-nav a {
    text-decoration: none;
    font-size: 0.8rem;
    color: var(--text-dim);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 6px 12px;
    transition: color 0.15s, border-color 0.15s;
  }

  .cat-nav a:hover {
    color: var(--tier-a);
    border-color: rgba(89,214,184,0.4);
  }

  .legend .chip {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--card-border);
    background: var(--bg-raised);
    border-radius: 8px;
    padding: 10px 14px;
    max-width: 360px;
  }

  .stamp {
    flex: none;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    padding: 3px 7px;
    border-radius: 4px;
    text-transform: uppercase;
  }

  .stamp.a { color: var(--tier-a); background: var(--tier-a-dim); border: 1px solid rgba(89,214,184,0.4); }
  .stamp.b { color: var(--tier-b); background: var(--tier-b-dim); border: 1px solid rgba(232,172,77,0.4); }

  .legend .chip span.desc {
    font-size: 0.85rem;
    color: var(--text-dim);
  }

  /* ---------- categories ---------- */

  .category {
    padding: 52px 0;
    border-bottom: 1px solid var(--card-border);
  }

  .category:last-of-type { border-bottom: none; }

  .category-head {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 8px;
    flex-wrap: wrap;
  }

  .category-head h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
  }

  .category-head .count {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.84rem;
    color: var(--text-faint);
  }

  .category-blurb {
    color: var(--text-dim);
    max-width: 60ch;
    margin: 0 0 30px;
    font-size: 0.96rem;
  }

  .tier-block { margin-top: 26px; }

  .tier-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
  }

  .tier-label .stamp { font-size: 0.7rem; }

  .tier-label .tier-note {
    font-size: 0.88rem;
    color: var(--text-faint);
  }

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

  /* ---------- app card ---------- */

  .app {
    border: 1px solid var(--card-border);
    background: var(--card);
    border-radius: 10px;
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .app-top {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .badge {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .badge svg { width: 20px; height: 20px; }

  .badge.letter {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-faint);
    background: rgba(255,255,255,0.05);
  }

  .app-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
  }

  .app-tagline {
    font-size: 0.88rem;
    color: var(--text-dim);
    margin-top: 1px;
  }

  .app-sec {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.84rem;
    line-height: 1.55;
    color: #b7c0cf;
    background: var(--bg-raised);
    border-left: 2px solid var(--card-border);
    padding: 9px 11px;
    border-radius: 0 6px 6px 0;
  }

  .app-sec.caution { border-left-color: var(--caution); }

  .app-sec b { color: var(--text); font-weight: 600; }

  .app-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 2px;
  }

  .install-link {
    font-size: 0.87rem;
    font-weight: 500;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
  }

  .install-link.action {
    background: var(--tier-b-dim);
    color: var(--tier-b);
    border: 1px solid rgba(232,172,77,0.4);
  }

  .install-link.action:hover { background: rgba(232,172,77,0.24); }

  .install-link.included {
    color: var(--tier-a);
    background: transparent;
    border: 1px dashed rgba(89,214,184,0.4);
  }

  .install-link.manual {
    color: var(--text-faint);
    background: transparent;
    border: 1px dashed var(--card-border);
  }

  .project-link {
    font-size: 0.85rem;
    color: var(--text-faint);
    text-decoration: none;
    white-space: nowrap;
  }

  .project-link:hover { color: var(--text-dim); }

  /* ---------- footer ---------- */

  footer {
    padding: 40px 0 60px;
  }

  footer p {
    color: var(--text-faint);
    font-size: 0.9rem;
    max-width: 60ch;
  }

  footer a.home {
    color: var(--tier-a);
    text-decoration: none;
  }

  @media (max-width: 480px) {
    .wrap { padding: 0 18px; }
    .hero { padding: 52px 0 40px; }
  }

  @media (max-width: 640px) {
    .nav-burger { display: flex; }

    .site-nav {
      display: none;
      position: absolute;
      top: calc(100% + 1px);
      right: 0;
      min-width: 160px;
      flex-direction: column;
      align-items: flex-start;
      gap: 0;
      background: var(--bg-raised);
      border: 1px solid var(--card-border);
      border-radius: 8px;
      padding: 4px 18px;
      z-index: 20;
    }

    .site-nav a {
      width: 100%;
      padding: 10px 0;
    }

    .site-nav a.lang-switch {
      display: inline-block;
      width: auto;
      margin-top: 4px;
    }

    .nav-toggle:checked ~ .site-nav {
      display: flex;
    }

    .nav-dropdown {
      width: 100%;
    }

    .nav-dropdown-label {
      padding: 10px 0 0;
    }

    .nav-dropdown-menu {
      display: block !important;
      position: static;
      background: none;
      border: none;
      padding: 0 0 4px 14px;
    }

    .nav-dropdown-menu a {
      padding: 8px 0;
    }
  }

/* ---------- spec table (Specs page) ---------- */

.spec-table {
  width: 100%;
  border-collapse: collapse;
}

.spec-table tr {
  border-bottom: 1px solid var(--card-border);
}

.spec-table tr:last-child { border-bottom: none; }

.spec-table th,
.spec-table td {
  text-align: left;
  padding: 12px 0;
  vertical-align: top;
}

.spec-table th {
  width: 38%;
  font-weight: 700;
  color: var(--text-dim);
  font-size: 1.05rem;
  padding-right: 20px;
}

.spec-table td {
  font-size: 0.95rem;
  color: var(--text);
}

/* ---------- FAQ (FAQ page) ---------- */

.faq-list {
  margin: 0;
}

.faq-item {
  border-bottom: 1px solid var(--card-border);
  padding: 20px 0;
}

.faq-item:last-child { border-bottom: none; }

.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.08rem;
  color: var(--text);
}

.faq-item summary::marker,
.faq-item summary::-webkit-details-marker {
  display: none;
  content: '';
}

.faq-item summary .q-icon {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(89,214,184,0.4);
  color: var(--tier-a);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.faq-item[open] summary .q-icon {
  transform: rotate(45deg);
}

.faq-item summary:hover { color: var(--tier-a); }

.faq-answer {
  color: var(--text-dim);
  max-width: 68ch;
  margin: 14px 0 0;
  font-size: 0.96rem;
}

.spec-table td .note {
  display: block;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text-faint);
  font-size: 0.86rem;
  margin-top: 3px;
}

/* ---------- messenger comparison table (Apps page) ---------- */

.compare-table-wrap {
  overflow-x: auto;
  margin: 8px 0 32px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
}

.compare-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.compare-table th,
.compare-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--card-border);
  vertical-align: top;
}

.compare-table thead th {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  background: var(--bg-raised);
}

.compare-table tbody tr:last-child td { border-bottom: none; }

.compare-table td {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.92rem;
  color: var(--text);
}

.compare-table td.app-cell {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.98rem;
  white-space: nowrap;
}

.compare-table td.warn { color: var(--caution); }
.compare-table td.good { color: var(--tier-a); }

.compare-table td .sub {
  display: block;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text-faint);
  font-size: 0.82rem;
  margin-top: 2px;
}
