/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --text:           #E6EDF3;
  --muted:          #888;
  --border:         #2e2e2e;
  --bg:             #0d1117;
  --surface:        #161b22;
  --accent:         #6ea8fe;
  --accent-purple:  #a78bfa;
  --accent-light:   #c0d8ff;
  --hover-text:     #a8c8ff;
  --draft-bg:       #2a2200;
  --draft-border:   #6b5500;
  --draft-text:     #ffd966;
  --max-width:      68ch;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.05rem;
  font-weight: 350;
  line-height: 1.75;
  letter-spacing: 0.012em;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0;
}


h1, h2, h3, h4, h5, h6 { font-weight: 600; }

main h2 { color: var(--accent-light); font-size: 1.4rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }

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

/* ── Site header / nav ── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.site-title-group { display: flex; flex-direction: column; gap: 0.1rem; }
.site-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1.2;
}
.site-name { color: var(--accent); }
.site-title:hover { text-decoration: none; }
.site-title:hover .site-name { color: var(--hover-text); }
.site-title .dev-suffix {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 400;
  font-style: italic;
  font-size: 0.9rem;
  margin-left: 0.25rem;
  letter-spacing: -0.01em;
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.site-title:hover .dev-suffix {
  background: linear-gradient(100deg, var(--hover-text) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.site-tagline {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  font-weight: 300;
}
nav { display: flex; gap: 1.25rem; margin-left: auto; }
nav a { font-size: 1rem; color: var(--accent); font-weight: 600; }
nav a:hover { color: var(--hover-text); text-decoration: none; }

/* ── Main content ── */
main {
  max-width: var(--max-width);
  margin: 3rem auto;
  padding: 0 1.5rem;
}

/* ── Site footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 1.2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.site-footer p { margin: 0; }

/* ── Draft banner (essays & notes) ── */
.draft-banner {
  background: var(--draft-bg);
  border: 1px solid var(--draft-border);
  border-radius: 4px;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 2.5rem;
  color: var(--draft-text);
}
.draft-banner a { color: var(--draft-text); text-decoration: underline; }

/* ── Placeholder block ── */
.placeholder {
  background: var(--surface);
  border-left: 3px solid var(--border);
  padding: 0.75rem 1rem;
  color: var(--muted);
  font-style: italic;
  border-radius: 0 4px 4px 0;
  margin: 1rem 0 1.5rem;
}

/* ── Feedback section ── */
.feedback-section {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding-top: 2rem;
}
.feedback-section h2 { font-size: 1.1rem; margin-top: 0; }

/* ── Essay layout ── */
.essay-header { margin-bottom: 3rem; }
.essay-header h1 {
  font-size: 1.9rem;
  line-height: 1.25;
  margin: 0 0 0.5rem;
}
.content-subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 1rem;
  font-style: italic;
}
.content-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
}
.essay-opening {
  border-left: 3px solid var(--accent);
  margin: 0;
  padding: 0.5rem 0 0.5rem 1.25rem;
  font-style: italic;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}
.essay-body h2 {
  margin-top: 2.5rem;
}
.essay-body p { margin: 0 0 1.25rem; }

/* ── Table of contents ── */
#markdown-toc-label {
  margin-bottom: 0.8rem;
  font-size: 1.15rem;
  color: var(--accent-light);
}

#markdown-toc {
  padding-left: 1.25rem;
  margin: 0 0 1.5rem 1.5rem;
}
#markdown-toc li {
  margin-bottom: 0.15rem;
  line-height: 1.3;
}
#markdown-toc a:hover {
  text-decoration: none;
}

/* ── Note layout ── */
.note-header { margin-bottom: 1.5rem; }
.note-header h1 {
  font-size: 1.9rem;
  line-height: 1.25;
  margin: 0 0 1rem;
}
.note-body p { margin: 0 0 1.25rem; }
.section-lead {
  font-style: italic;
  font-size: 1.05rem;
  color: var(--muted);
}
.note-body ul {
  padding-left: 1.25rem;
  margin: 0 0 1.25rem;
}
.note-body li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}
.note-body li ul {
  margin-top: 0.4rem;
  margin-bottom: 0;
}
.note-body li ul li {
  margin-bottom: 0.3rem;
}

/* ── Homepage post cards ── */
.essay-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  color: inherit;
  display: block;
  background: var(--surface);
}
.essay-card:hover { border-color: var(--accent); }
.essay-card h2 {
  font-size: 1.2rem;
  margin: 0 0 0.3rem;
  color: var(--accent);
}
.essay-card:hover h2 {
  color: var(--hover-text);
  text-decoration: underline;
}
.essay-card .card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.essay-card .subtitle {
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
  margin: 0 0 0.5rem;
}
.essay-card .meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}
