@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@300;400&family=Inter:wght@400;500&family=JetBrains+Mono:wght@400&display=swap');

:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-hover: #161616;
  --text: #e8e8e8;
  --muted: #888888;
  --dim: #555555;
  --border: #1a1a1a;
  --border-accent: #2a2a2a;
  --accent: #c4a35a;
  --accent-dim: rgba(196, 163, 90, 0.1);
}

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

html {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  line-height: 1.75;
}

body {
  padding-top: 72px;
  min-height: 100vh;
  background: var(--bg);
}

/* Nav */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

nav a.site-name {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

nav a.site-name:hover {
  color: var(--accent);
}

/* Main content */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Index page */

.index-top {
  padding-top: 3rem;
}

.toc-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.sort-arrow {
  font-size: 0.75rem;
  color: var(--accent);
  margin-right: 0.25rem;
}

.sort-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--dim);
}

.sort-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--dim);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.sort-btn:hover {
  color: var(--muted);
}

.sort-btn.active {
  color: var(--accent);
}

.post-list {
  list-style: none;
}

.post-row {
  display: flex;
  gap: 1.75rem;
  align-items: baseline;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.2s;
}

.post-row:last-child {
  border-bottom: none;
}

.post-row:hover {
  border-color: var(--border-accent);
}

.post-date {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
  flex-shrink: 0;
}

.post-title a {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.post-title a:hover {
  color: var(--accent);
}

.post-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}


/* Tag pills */
.tag {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}

/* Article page */
.article-header {
  padding: 3.5rem 0 2rem;
}

.article-header h1 {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 2.2rem;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
}

.article-meta .meta-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.article-downloads {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.download-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--dim);
}

.download-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border-accent);
  border-radius: 4px;
  padding: 2px 8px;
  transition: color 0.15s, border-color 0.15s;
}

.download-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.article-divider {
  border: none;
  border-top: 1px solid var(--border-accent);
  margin: 1.5rem 0 2rem;
}

/*
 * Color tier system (article pages):
 *   --text    primary content — paragraphs, lists, h2/h3, table cells
 *   --muted   labels & framing — th, h4, blockquotes, footnotes, back link
 *   --dim     pure metadata — date, reading time, sort controls
 *   --accent  interactive & code — links, inline code, active states
 */

/* Article prose */
.article-body {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.8;
}

.article-body p {
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.article-body p:last-child {
  margin-bottom: 0;
}

.article-body li {
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 0.4rem;
}

.article-body ul,
.article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.article-body h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--text);
  margin: 3rem 0 1rem;
  line-height: 1.3;
}

.article-body h3 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--text);
  margin: 2.5rem 0 0.75rem;
  line-height: 1.35;
}

.article-body h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 2rem 0 0.6rem;
}

.article-body a {
  color: var(--accent);
  text-decoration: none;
}

.article-body a:hover {
  text-decoration: underline;
}

.article-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875em;
  background: rgba(255, 255, 255, 0.07);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
}

.article-body pre {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.article-body pre code {
  background: none;
  color: var(--text);
  padding: 0;
  border-radius: 0;
  font-size: 0.875rem;
}

.article-body blockquote {
  border-left: 2px solid var(--accent);
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem 1.25rem;
  margin: 2rem 0;
  border-radius: 0 6px 6px 0;
}

.article-body blockquote p {
  color: var(--muted);
  margin-bottom: 0.5rem;
  font-style: italic;
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

/* Footnote — closing italic line e.g. *March 2026. Confidential...* */
.article-body > p:last-child > em:only-child {
  color: var(--muted);
  font-size: 0.875rem;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* Tables */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 1.5rem 0;
  display: block;
  overflow-x: auto;
}

.article-body thead tr {
  border-bottom: 1px solid var(--border-accent);
}

.article-body th {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-align: left;
  padding: 0.6rem 1rem 0.6rem 0;
  white-space: nowrap;
}

.article-body td {
  padding: 0.6rem 1rem 0.6rem 0;
  color: var(--text);
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

.article-body tbody tr:last-child td {
  border-bottom: none;
}

.article-body td strong {
  color: var(--text);
  font-weight: 500;
}

.article-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-bottom: 3rem;
}

.back-link {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
  main {
    padding: 0 1.25rem;
  }

  .post-row {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .post-tags {
    margin-left: 0;
  }

  .article-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .article-header h1 {
    font-size: 1.6rem;
  }
}
