/* david.burke.nyc — see STYLEGUIDE.md. This file is that document, in CSS.
   No web fonts, no JS, no external requests. Designed light (e-ink); dark is
   a courtesy for OLED. Color is never load-bearing. */

/* ---- Tokens ---------------------------------------------------------- */
:root {
  --paper:       #f4f1e8;
  --paper-2:     #eae5d6;
  --ink:         #1b1a17;
  --ink-soft:    #57534a;
  --accent:      #b4451f;
  --accent-deep: #7d2f13;
  --rule:        #c9c2ae;

  --measure: 66ch;

  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem;
  --s-5: 1.5rem;  --s-6: 2rem;   --s-7: 3rem;    --s-8: 4rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:       #16150f;
    --paper-2:     #22201a;
    --ink:         #ece7da;
    --ink-soft:    #a8a293;
    --accent:      #e0794f;
    --accent-deep: #f0a07d;
    --rule:        #3a382f;
  }
}

/* ---- Reset-ish ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 18px; -webkit-text-size-adjust: 100%; }
@media (min-width: 40rem) { html { font-size: 20px; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.65;
  /* Optical breathing room; single centered column. */
  padding: var(--s-5) var(--s-4) var(--s-8);
}

.wrap { max-width: var(--measure); margin: 0 auto; }

/* ---- Links: accent + ALWAYS underline (e-ink / a11y) ----------------- */
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover, a:focus { color: var(--accent-deep); text-decoration-thickness: 2px; }
a:visited { color: var(--ink-soft); }
a:visited:hover { color: var(--accent-deep); }

/* ---- Typography ------------------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--mono);
  font-weight: 700;
  line-height: 1.2;
  margin: var(--s-6) 0 var(--s-3);
}
h1 { font-size: 1.9rem; margin-top: 0; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p, ul, ol, blockquote { margin: 0 0 var(--s-4); }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: var(--s-1); }

small, .meta {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

/* ---- Header / nav ---------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--rule);
  padding-bottom: var(--s-3);
  margin-bottom: var(--s-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  align-items: baseline;
  justify-content: space-between;
}
.wordmark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
  /* Static chromatic aberration — a whisper of RGB split. No motion; on e-ink
     it's a faint gray fringe. See STYLEGUIDE.md "The glitch". */
  text-shadow: 0.5px 0 0 rgba(0, 180, 200, 0.45),
              -0.5px 0 0 rgba(200, 0, 90, 0.45);
}
.wordmark:hover { color: var(--ink); text-decoration: none; }
/* Optional rare flicker — only when the reader hasn't asked to reduce motion. */
@media (prefers-reduced-motion: no-preference) {
  .wordmark:hover {
    animation: glitch 1.2s steps(2, jump-none) 1;
  }
  @keyframes glitch {
    0%, 100% { text-shadow: 0.5px 0 0 rgba(0,180,200,.45), -0.5px 0 0 rgba(200,0,90,.45); }
    46%      { text-shadow: 1.5px 0 0 rgba(0,180,200,.5),  -1.5px 0 0 rgba(200,0,90,.5); }
    48%      { text-shadow: -1px 0 0 rgba(0,180,200,.5),    1px 0 0 rgba(200,0,90,.5); }
    50%      { text-shadow: 0.5px 0 0 rgba(0,180,200,.45), -0.5px 0 0 rgba(200,0,90,.45); }
  }
}
.site-nav { font-family: var(--mono); font-size: 0.9rem; }
.site-nav a { margin-left: var(--s-4); }

/* ---- Home: about + link lists --------------------------------------- */
.linklist { list-style: none; padding-left: 0; }
.linklist li { margin-bottom: var(--s-2); }
.linklist .desc { color: var(--ink-soft); }
.group-label {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: var(--s-6) 0 var(--s-2);
}

/* ---- Blog index ------------------------------------------------------ */
.post-list { list-style: none; padding-left: 0; }
.post-list li {
  display: flex;
  gap: var(--s-4);
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.post-list time {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
  flex: 0 0 auto;
  min-width: 6.5em;
}

/* ---- Post ------------------------------------------------------------ */
.post-meta { margin-bottom: var(--s-6); }
article img { max-width: 100%; height: auto; border: 1px solid var(--rule); }
figure { margin: var(--s-5) 0; }
figcaption { font-family: var(--mono); font-size: 0.82rem; color: var(--ink-soft); }

blockquote {
  border-left: 3px solid var(--accent);
  padding-left: var(--s-4);
  margin-left: 0;
  color: var(--ink-soft);
}

hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s-6) 0; }

table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { border: 1px solid var(--rule); padding: var(--s-2) var(--s-3); text-align: left; }

/* ---- Code ------------------------------------------------------------ */
code, pre, kbd, samp { font-family: var(--mono); }
:not(pre) > code {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.05em 0.35em;
  font-size: 0.88em;
}
pre {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  padding: var(--s-4);
  overflow-x: auto;              /* never mangle code by wrapping */
  font-size: 0.85rem;
  line-height: 1.5;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }
/* Pygments token colors live in static/pygments.css (generated at build). */

/* ---- Pagination ------------------------------------------------------ */
.pagination {
  display: flex;
  gap: var(--s-3);
  align-items: baseline;
  font-family: var(--mono);
  font-size: 0.9rem;
  margin-top: var(--s-7);
  padding-top: var(--s-4);
  border-top: 1px solid var(--rule);
}
.pagination .current { font-weight: 700; color: var(--ink); }  /* weight, not just color */
.pagination .spacer { flex: 1; }

/* ---- Footer ---------------------------------------------------------- */
.site-footer {
  margin-top: var(--s-8);
  padding-top: var(--s-4);
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.site-footer a { color: var(--ink-soft); }

/* ---- Print ----------------------------------------------------------- */
@media print {
  a { color: var(--ink); }
  .site-nav, .pagination { display: none; }
}
