:root {
  --bg: #fafaf8;
  --text: #1a1a1a;
  --muted: #666;
  --border: #e0e0e0;
  --accent: #2c5282;
}

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

body {
  font-family: 'Charter', 'Bitstream Charter', 'Sitka Text', Cambria, Georgia, serif;
  font-size: 18px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

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

header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.home-link {
  color: var(--text);
  text-decoration: none;
  font-size: 1.08rem;
}
.home-link:hover { text-decoration: none; }

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.8rem;
  font-size: 0.95rem;
}
nav a { color: var(--muted); }

h1 { font-size: 2.2rem; line-height: 1.15; margin-bottom: 0.8rem; }

.lede { font-size: 1.1rem; color: #222; max-width: 44rem; margin-bottom: 1rem; }

.section-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #444;
  margin: 2.2rem 0 0.9rem;
  font-weight: 600;
}

.list { list-style: none; }
.list li { padding: 0.8rem 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: none; }
.meta { color: var(--muted); font-size: 0.92rem; }

/* Article / essay styles */
article h1 { font-size: 2rem; margin-bottom: 0.3rem; }
article h2 { font-size: 1.35rem; margin: 2rem 0 1rem; }
article h3 { font-size: 1.08rem; margin: 1.4rem 0 0.7rem; }
article p, article ul, article ol, article table, article pre, article blockquote { margin-bottom: 1rem; }
article ul, article ol { padding-left: 1.4rem; }
article li { margin-bottom: 0.25rem; }
article hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f1f1f1; padding: 0.12rem 0.35rem; border-radius: 4px; font-size: 0.9em;
}
article pre { background: #f5f5f5; padding: 1rem; border-radius: 6px; overflow-x: auto; }
article pre code { background: none; padding: 0; }
article blockquote {
  border-left: 3px solid var(--accent);
  padding: 1rem 1.2rem;
  background: #f8f6f0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #333;
}
article img {
  width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border-radius: 4px;
}
article table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
article th, article td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--border); }
article th { font-weight: 600; border-bottom: 2px solid var(--border); }

/* Lightbox (native <dialog>) */
dialog.lightbox {
  border: none;
  background: transparent;
  padding: 0;
  margin: auto;
  max-width: none;
  max-height: none;
  cursor: pointer;
}
dialog.lightbox:not([open]) {
  display: none;
}
dialog.lightbox[open] {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
dialog.lightbox::backdrop {
  background: transparent;
}
dialog.lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 0;
  cursor: default;
}

article img { cursor: pointer; transition: opacity 0.15s; }
article img:hover { opacity: 0.85; }

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

/* Lab stats */
.lab-stats {
  margin-top: 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}
.stats-line {
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0.3rem 0;
}
.stats-line.muted {
  color: var(--muted);
  font-size: 0.85rem;
}
.stats-line strong {
  color: var(--text);
}

/* Title row */
.title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.title-row h1 {
  margin-bottom: 0;
}
.est {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Subtitle */
.subtitle {
  font-size: 1.05rem;
  color: var(--text);
  margin: -0.3rem 0 0.3rem 0;
  line-height: 1.5;
}
