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

:root {
  --bg: #000000;
  --surface: #0d0d0d;
  --text: #d4d4d4;
  --muted: #555555;
  --dim: #333333;
  --white: #f0f0f0;
  --accent: #7eb8f7;
  --max: 660px;
  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  padding: 3.5rem 1.5rem 6rem;
}

main {
  max-width: var(--max);
  margin: 0 auto;
}

h1 {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--white);
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--white);
  margin: 2rem 0 0.5rem;
}

p {
  margin-bottom: 1.35rem;
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent);
  transition: color 0.15s;
}

a:hover {
  color: #a8d0ff;
  text-decoration-color: #a8d0ff;
}

/* ─── Back link ──────────────────────────────────────────── */
.back-link {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}

.back-link:hover {
  color: #a8d0ff;
}

/* ─── Notebook list ──────────────────────────────────────── */
.notebook-list {
  list-style: none;
  margin-top: 2rem;
}

.notebook-list li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0 1rem;
  align-items: baseline;
  padding: 0.65rem 0;
}

.entry-num {
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.entry-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.entry-title {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 0.97rem;
  transition: color 0.15s;
}

.entry-title:hover {
  color: #a8d0ff;
}

.entry-date {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ─── Single entry header ────────────────────────────────── */
.entry-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--dim);
}

.entry-header h1 {
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
  color: var(--white);
}

.entry-header .meta {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  gap: 1rem;
}

/* ─── Entry nav (prev / notebook / next) ─────────────────── */
.entry-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  gap: 1rem;
}

.entry-nav a {
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}

.entry-nav a:hover {
  color: #a8d0ff;
}

.entry-nav .spacer {
  flex: 1;
}

/* ─── Prose ──────────────────────────────────────────────── */
.prose p {
  margin-bottom: 1.4rem;
}

.prose h2 {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--white);
  margin: 2rem 0 0.75rem;
}

.prose img {
  width: 100%;
  height: auto;
  display: block;
  margin: 2rem 0;
}

.prose img+em {
  display: block;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: -1.5rem;
  margin-bottom: 2rem;
}

.prose blockquote {
  border-left: 2px solid var(--dim);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-style: italic;
}

.prose code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.83em;
  background: var(--surface);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.prose pre {
  background: var(--surface);
  padding: 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.83rem;
}

.prose pre code {
  background: none;
  padding: 0;
}

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

/* ─── Social icons ───────────────────────────────────────── */
.social-fixed {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  z-index: 100;
}

.social-fixed a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--dim);
  text-decoration: none;
  opacity: 0.65;
  transition: opacity 0.15s;
}

.social-fixed a:hover {
  opacity: 1;
}

.social-fixed svg {
  display: block;
  fill: var(--white);
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
  html {
    font-size: 16px;
  }

  body {
    padding: 2.5rem 1.25rem 5rem;
  }

  .social-fixed {
    bottom: 1.25rem;
    right: 1.25rem;
  }
}