@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;1,300&display=swap');

:root {
  --bg:       oklch(97.5% 0.008 75);
  --text:     oklch(20%   0.020 75);
  --muted:    oklch(54%   0.015 75);
  --rule:     oklch(91%   0.008 75);
  --accent:   #4f7bd9;
  --code-bg:  oklch(16%   0.015 240);
  --code-fg:  oklch(88%   0.010 200);
  --font: 'Plus Jakarta Sans', sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:    oklch(12%  0.030 240);
    --text:  oklch(92%  0.010 220);
    --muted: oklch(56%  0.018 220);
    --rule:  oklch(20%  0.025 240);
  }
}

html, body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Nav ─────────────────────────────────── */
.site-nav {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 3rem;
}

.site-nav-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  transition: color 0.15s;
}

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

.site-nav .sep {
  color: var(--rule);
  font-size: 0.84rem;
  user-select: none;
}

/* ── Archive ─────────────────────────────── */
.archive-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
}

.archive-heading {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

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

.archive-item {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
}

.archive-item:first-child { border-top: 1px solid var(--rule); }

.archive-date {
  font-size: 0.775rem;
  color: var(--muted);
  white-space: nowrap;
  min-width: 86px;
  flex-shrink: 0;
}

.archive-link {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  text-wrap: pretty;
  transition: color 0.15s;
}

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

/* ── Post ────────────────────────────────── */
.post-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
}

.post-header { margin-bottom: 2.25rem; }

.post-title {
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 0.45rem;
  text-wrap: pretty;
}

.post-date {
  font-size: 0.78rem;
  color: var(--muted);
}

.post-rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin-bottom: 2.25rem;
}

/* ── Prose ───────────────────────────────── */
.post-body { font-size: 0.9375rem; }

.post-body p { margin-bottom: 1.2rem; line-height: 1.75; }
.post-body p:last-child { margin-bottom: 0; }

.post-body h2 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 0.7rem;
  line-height: 1.3;
}

.post-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 2rem 0 0.55rem;
}

.post-body h4 {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 1.75rem 0 0.5rem;
}

.post-body ul, .post-body ol {
  margin: 0.25rem 0 1.25rem 1.4rem;
}

.post-body li { margin-bottom: 0.3rem; line-height: 1.65; }
.post-body li ul, .post-body li ol { margin-top: 0.25rem; margin-bottom: 0.25rem; }

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.post-body a:hover { opacity: 0.75; }
.post-body strong { font-weight: 600; }
.post-body em { font-style: italic; }
.post-body del { text-decoration: line-through; color: var(--muted); }

.post-body sup {
  font-size: 0.7em;
  vertical-align: super;
}

/* ── Code ────────────────────────────────── */
.post-body code {
  font-family: var(--mono);
  font-size: 0.8em;
  background: var(--rule);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: oklch(28% 0.06 230);
}

.post-body pre {
  background: var(--code-bg);
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  margin: 1.25rem 0 1.5rem;
  line-height: 1.6;
}

.post-body pre code {
  background: transparent;
  color: var(--code-fg);
  padding: 0;
  font-size: 0.8rem;
}

/* ── Figures ─────────────────────────────── */
.post-body figure {
  margin: 1.75rem 0;
  text-align: center;
}

.post-body figure img, .post-body .img-center {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.post-body figcaption {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
}

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

/* ── Footnotes ───────────────────────────── */
.footnotes {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.65;
}

.footnotes p { margin-bottom: 0.5rem; }

/* ── Note / callout ──────────────────────── */
.post-note {
  background: color-mix(in oklch, var(--accent) 8%, var(--bg));
  border-left: 3px solid var(--accent);
  padding: 0.85rem 1.1rem;
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  color: var(--text);
}
