:root {
  --accent: #4f46e5;       /* indigo: site root — links and tinted UI */
  --accent-strong: var(--accent); /* saturated; used as bg for white-on-accent buttons */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1c1e21;
  --text-muted: #5a6068;
  --border: #e3e6ea;
  --shadow-card: 0 6px 20px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 10px 24px rgba(0, 0, 0, 0.10);
}
/* Per-app accent overrides are written to app-accents.css at deploy time
   from each app's app-meta.yaml. */

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 1.5rem 1rem 3rem;
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  background: var(--surface);
  padding: 2rem 2.5rem;
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
}
.container--wide { max-width: 960px; }

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

/* Top nav */
.topnav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.topnav .spacer { flex: 1; }
.topnav a { font-weight: 500; }
.topnav .brand {
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* Site header (homepage hero) */
.site-header { text-align: center; margin: 1rem 0 2.5rem; }
.site-header h1 {
  font-size: 2.4rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.site-header .tagline {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0 0 1rem;
}

/* Trust chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.hero .chips { justify-content: flex-start; }
.chips li {
  font-size: 0.8rem;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  font-weight: 500;
}

/* Announcement / news block (homepage) */
.announce {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 1.1rem 1.4rem;
  margin: 0 0 2rem;
}
.announce h2 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  letter-spacing: -0.005em;
  color: var(--accent);
}
.announce p {
  text-align: left;
  margin: 0.5rem 0;
  font-size: 0.95rem;
}
.announce ul,
.announce ol {
  text-align: left;
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}
.announce li {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}
.announce-alt {
  color: var(--text-muted);
  margin: 0.75rem 0 0;
}

/* App card grid */
.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}
@media (min-width: 720px) {
  .app-grid { grid-template-columns: repeat(2, 1fr); }
}
.app-card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  border-top: 4px solid var(--accent);
  transition: box-shadow 0.15s ease;
}
.app-card:hover { box-shadow: var(--shadow-card-hover); }
.app-card .app-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.app-card .info { flex: 1; min-width: 0; }
.app-card h2 {
  margin: 0 0 0.3rem;
  font-size: 1.2rem;
  letter-spacing: -0.005em;
}
.app-card .blurb {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}
.card-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.card-link {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
}

/* Landing-page hero (split: text left, icon right on wide) */
.hero { margin-bottom: 1.5rem; }
.hero-split {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 560px) {
  .hero-split { grid-template-columns: 1fr auto; }
}
.hero h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.hero .lede {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0 0 1rem;
}
.hero .hero-art {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* CTA buttons */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0 1.5rem;
}
.btn {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.15s ease;
}
.btn:hover {
  background: color-mix(in srgb, var(--text) 4%, transparent);
  text-decoration: none;
}
.btn.primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}
.btn.primary:hover {
  filter: brightness(1.08);
  background: var(--accent-strong);
}
.btn-sm {
  padding: 0.45rem 0.95rem;
  font-size: 0.9rem;
}

/* Sub-page list */
.page-list {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.page-list h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}
.page-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.page-list li { margin-bottom: 0.5rem; }
.page-list-desc {
  color: var(--text-muted);
  font-size: 0.9em;
}

/* Prose (rendered markdown) */
.prose {
  text-align: left;
  font-size: 1rem;
}
.prose h2, .prose h3, .prose h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.prose h2 { font-size: 1.35rem; }
.prose h3 { font-size: 1.15rem; }
.prose ul, .prose ol { padding-left: 1.5rem; }
.prose li { margin-bottom: 0.25rem; }
.prose p { margin: 0.6rem 0; }

/* Footer */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0 1rem;
}
footer p {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}
footer small a { color: var(--text-muted); }
footer small a:hover { color: var(--accent); }
.build-info {
  display: block;
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.5;
  font-variant-numeric: tabular-nums;
}

/* Dark mode.
   `--accent` brightens for legible links / tinted UI on the dark surface;
   `--accent-strong` keeps the saturated 600-level shade for white-on-accent
   button backgrounds (where the brightened accent would fail contrast). */
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #818cf8;        /* indigo-400 */
    --accent-strong: #4f46e5; /* indigo-600 */
    --bg: #18191a;
    --surface: #242526;
    --text: #e4e6eb;
    --text-muted: #b0b3b8;
    --border: #3a3b3c;
    --shadow-card: 0 6px 20px rgba(0, 0, 0, 0.4);
    --shadow-card-hover: 0 10px 24px rgba(0, 0, 0, 0.5);
  }
  .topnav .brand { color: var(--text); }
  .btn:hover {
    background: color-mix(in srgb, #fff 5%, transparent);
  }
}
