:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1a2233;
  --muted: #5b6472;
  --border: #e3e6ea;
  --accent: #2563eb;
  --accent-contrast: #ffffff;
  --radius: 12px;
  --tile-1: #eef2f8;
  --tile-2: #dfe6f0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1420;
    --surface: #1a2130;
    --text: #e7eaf0;
    --muted: #98a1b3;
    --border: #2a3244;
    --accent: #5b8def;
    --accent-contrast: #0f1420;
    --tile-1: #232c3f;
    --tile-2: #1b2333;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

main.container { flex: 1; padding-bottom: 3rem; }

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

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

.logo { width: 28px; height: 28px; display: block; flex-shrink: 0; }


.nav-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.nav-links a { color: var(--muted); font-weight: 500; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }

/* App grid */
main section h2 { margin-top: 2.5rem; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card h3 { margin: 0; }
.card h3 a { color: var(--text); }
.card p { margin: 0; color: var(--muted); flex: 1; }

.card-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  line-height: 1;
  background: linear-gradient(135deg, var(--tile-1), var(--tile-2));
  border: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}
img.card-icon { object-fit: cover; padding: 0; }
.card-icon.big {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  font-size: 2.9rem;
}

.card-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

/* Buttons and badges */
.btn {
  display: inline-block;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
}
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}
.btn-primary:hover { color: var(--accent-contrast); opacity: 0.9; }

.badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px dashed var(--border);
}

/* App detail */
.app-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 2rem 0 1rem;
}
.app-header h1 { margin: 0; }

/* Prose pages (privacy, terms, support) */
.prose { max-width: 720px; }
.prose h1 { margin-top: 2.5rem; }
.prose h2 { margin-top: 2rem; }
.prose code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.9em;
}

.muted { color: var(--muted); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.5rem 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer p { margin: 0.25rem 0; }
