/* ─────────────────────────────────────────────────────────────────────────
   Postarmor — open-source project site
   Plain CSS, no build step, no JavaScript. System font stack.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --bg:         #ffffff;
  --bg-alt:     #f8f9fb;
  --surface:    #ffffff;
  --text:       #111827;
  --text-2:     #4b5563;
  --text-3:     #9ca3af;
  --border:     #e5e7eb;
  --border-hi:  #d1d5db;
  --accent:     #4f46e5;
  --accent-hi:  #4338ca;
  --accent-dim: rgba(79, 70, 229, 0.08);
  --code-bg:    #f3f4f6;

  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, sans-serif;
}

/* ── Reset & base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

code, pre {
  font-family: var(--mono);
  font-size: 0.875rem;
}

code {
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  color: var(--accent-hi);
  font-size: 0.85em;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  line-height: 1.5;
}

pre code {
  background: transparent;
  padding: 0;
  color: var(--text);
  font-size: 0.85rem;
}

h1, h2, h3 {
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-top: 0;
}

h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; }
h2 { font-size: 1.75rem; font-weight: 600; margin-bottom: 1.5rem; }
h3 { font-size: 1.15rem; font-weight: 600; margin: 2rem 0 0.75rem; }

p  { margin: 0 0 1rem; color: var(--text-2); }

ul { margin: 0 0 1rem; padding-left: 1.25rem; color: var(--text-2); }
li { margin-bottom: 0.5rem; }

/* ── Container ──────────────────────────────────────────────────────────── */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container.narrow { max-width: 760px; }

/* ── Header / nav ───────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(79, 70, 229, 0.25);
  border-radius: 4px;
}

.brand-name { letter-spacing: -0.01em; }

.site-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.site-nav a {
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 500;
}
.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-github {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border-hi);
  border-radius: 5px;
  color: var(--text) !important;
  font-weight: 600;
}
.nav-github:hover {
  background: var(--code-bg);
  border-color: var(--text-3);
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
}

.hero h1 {
  max-width: 780px;
}

.lede {
  font-size: 1.15rem;
  max-width: 680px;
  color: var(--text-2);
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 5px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hi);
  border-color: var(--accent-hi);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-hi);
}
.btn-ghost:hover {
  background: var(--code-bg);
  border-color: var(--text-3);
}

.hero-code {
  max-width: 680px;
  margin: 0;
}

/* ── Sections ───────────────────────────────────────────────────────────── */
.section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}
.section:last-of-type { border-bottom: none; }

.section-alt {
  background: var(--bg-alt);
}

/* ── Feature grid ───────────────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem 1.4rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.feature:hover {
  border-color: var(--border-hi);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.feature h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}
.feature p {
  font-size: 0.9rem;
  margin: 0;
  color: var(--text-2);
  line-height: 1.55;
}

/* ── ASCII architecture diagram ─────────────────────────────────────────── */
.ascii-diagram {
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 1.25rem 1rem;
  overflow-x: auto;
}
.ascii-diagram code { color: var(--text-2); }

/* ── Link list ──────────────────────────────────────────────────────────── */
.link-list {
  list-style: none;
  padding: 0;
}
.link-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
.link-list li:last-child { border-bottom: none; }
.link-list a { font-weight: 600; }

/* ── Notes ──────────────────────────────────────────────────────────────── */
.note {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: var(--accent-dim);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  font-size: 0.9rem;
}

.muted {
  color: var(--text-3);
  font-size: 0.85rem;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-2);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.45rem; }

  .header-inner {
    height: auto;
    padding: 0.75rem 0;
    flex-direction: column;
    gap: 0.75rem;
  }
  .site-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .hero { padding: 3rem 0 2.5rem; }
  .section { padding: 2.5rem 0; }

  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
}

/* ── Dark mode (class-based toggle) ────────────────────────────────────── */
.dark {
  --bg:         #0f172a;
  --bg-alt:     #111a2e;
  --surface:    #162036;
  --text:       #e2e8f0;
  --text-2:     #94a3b8;
  --text-3:     #64748b;
  --border:     #1e293b;
  --border-hi:  #334155;
  --accent:     #818cf8;
  --accent-hi:  #a5b4fc;
  --accent-dim: rgba(129, 140, 248, 0.12);
  --code-bg:    #1a2338;
}

.dark .site-header {
  background: rgba(15, 23, 42, 0.92);
}
.dark .btn-primary { color: #0f172a; }
.dark code { color: var(--accent); }

/* ── Theme toggle ──────────────────────────────────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-hi);
  border-radius: 5px;
  background: transparent;
  color: var(--text-2);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
  padding: 0;
}
.theme-toggle:hover {
  background: var(--code-bg);
  border-color: var(--text-3);
  color: var(--text);
}
