/* blog.pdj.dev - shared design system.
   Dark, minimal, brutalist: flat surfaces, sharp edges, hairline rules,
   monospace chrome, one restrained accent. Zero build, zero runtime JS. */

:root {
  /* Palette - from pdj.dev */
  --bg: #000000;
  --text: #f5f5f7;
  --muted: #8a8a8f;
  --hairline: #2e2e33;
  --body: #cfcfd4;
  --accent: #007aff;
  --accent-soft: #4da3ff;

  /* Surfaces (flat) */
  --raise: #141417;
  --raise-line: #3a3a40;
  /* Faint but legible text (~5:1 on black) - for tertiary text, never use a surface color as text */
  --faint: #777780;

  /* Type: one sans for reading, one mono for chrome. No serif, no web fonts. */
  --font-sans: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Helvetica, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Menlo", monospace;

  /* Spacing scale - 8px base */
  --s1: 0.5rem;
  --s2: 1rem;
  --s3: 1.5rem;
  --s4: 2rem;
  --s5: 3rem;
  --s6: 4rem;
  --s7: 6rem;

  /* Measures */
  --chrome: 820px;
  --read: 720px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { -webkit-text-size-adjust: 100%; }

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

a { color: inherit; -webkit-tap-highlight-color: transparent; }

/* Stark inverted selection */
::selection { background: var(--accent); color: #ffffff; }

/* ----- Navigation: flat bar, monospace, scoped to the top-level <nav> ----- */
body > nav {
  padding: 1rem 0;
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-content {
  max-width: var(--chrome);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-home {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  font-family: var(--font-mono);
  text-decoration: none;
  color: var(--muted);
  transition: color 0.15s linear;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.nav-link:hover,
.nav-link-active { color: var(--text); }

/* ----- Main ----- */
main {
  max-width: var(--chrome);
  margin: 0 auto;
  padding: 2rem;
}

/* ----- Masthead (index): stark wordmark ----- */
.masthead {
  padding: var(--s7) 0 var(--s4);
  border-bottom: 1px solid var(--hairline);
}

.masthead-title {
  font-size: clamp(2.1rem, 6vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}

/* ----- Post list: a ledger of essays, hairline-separated ----- */
.post-list { list-style: none; }

.post { border-bottom: 1px solid var(--hairline); }
.post:last-child { border-bottom: none; }

.post-link {
  display: block;
  text-decoration: none;
  padding: var(--s4) 0;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--s2);
}

.post-topic { color: var(--accent-soft); }

.post-meta-dot {
  width: 3px;
  height: 3px;
  background: var(--raise-line);
}

.post-num { margin-left: auto; color: var(--faint); }

.post-title {
  font-size: clamp(1.4rem, 3.2vw, 1.95rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text);
  transition: color 0.15s linear;
}

.post-link:hover .post-title,
.post-link:focus-visible .post-title { color: var(--accent-soft); }

.post-dek {
  margin-top: 0.75rem;
  max-width: 64ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.5;
}

/* ----- Site footer: centered monospace nodes ----- */
.site-footer {
  max-width: var(--chrome);
  margin: var(--s7) auto 0;
  padding: var(--s5) 2rem var(--s6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s3);
  text-align: center;
}

.footer-nodes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.8rem;
}

.footer-node {
  font-family: var(--font-mono);
  text-decoration: none;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  transition: color 0.15s linear;
}

.footer-node::before { content: "\2192\00a0"; color: var(--faint); }

.footer-node:hover { color: var(--text); }

.footer-sig {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ----- Mobile ----- */
@media (max-width: 768px) {
  .nav-content { padding: 0 1rem; }
  .nav-links { gap: 1.1rem; }
  main { padding: 1rem; }
  .masthead { padding: var(--s5) 0 var(--s3); }
  .site-footer { padding: var(--s4) 1rem var(--s5); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
