/* Fonts */
@font-face {
  font-family: 'Lora';
  src: url('/fonts/lora-v37-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Lora';
  src: url('/fonts/lora-v37-latin-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
}
@font-face {
  font-family: 'Lora';
  src: url('/fonts/lora-v37-latin-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('/fonts/AtkinsonHyperlegibleNext-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('/fonts/AtkinsonHyperlegibleNext-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
}

/* Variables */
:root {
  --bg:        #0f1a0f;
  --surface:   #152015;
  --border:    #2a3d2a;
  --ink:       #c8d8b0;
  --ink-muted: #7a9870;
  --accent:    #6abf5e;
  --accent-2:  #4a9e7a;
  --code-bg:   #0a120a;
  --code-bg:   #1e1e1e;
  --font-body: 'Lora', Georgia, serif;
  --font-ui:   'Atkinson Hyperlegible', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-w:     1000px;
  --max-w-wide:1200px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 18px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.site-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.site-title:hover { color: var(--accent); }

h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
  scroll-margin-top: 4rem; /* adjust to match your header height */
}

nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin-left: auto;
}
nav a {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.15s;
}
nav a:hover, nav a.active { color: var(--accent); }
.rss-link { font-size: 0.75rem; opacity: 0.6; }
.rss-link:hover { opacity: 1; color: var(--accent) !important; }

/* Main */
.site-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  width: 100%;
  flex: 1;
}

/* Post list */
.post-list-header h1 {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 2rem;
}
.post-list {
  list-style: none;
}
.post-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.post-item:first-child { border-top: 1px solid var(--border); }
.post-title {
  color: var(--ink);
  text-decoration: none;
  font-size: 1rem;
  line-height: 1.4;
}
.post-title:hover { color: var(--accent); }
.post-date {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--ink-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.empty {
  color: var(--ink-muted);
  font-style: italic;
}

/* Article / Post */
.post-header, .page .post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.post-header h1 {
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.post-header .post-date {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--ink-muted);
}

/* Post content typography */
.post-content { line-height: 1.8; }

.post-content p  { margin-bottom: 1.4rem; }
.post-content p:last-child { margin-bottom: 0; }

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  font-weight: 600;
  line-height: 1.3;
  margin: 2.2rem 0 0.8rem;
  letter-spacing: -0.015em;
}
.post-content h1 { font-size: 1.7rem; }
.post-content h2 { font-size: 1.35rem; }
.post-content h3 { font-size: 1.1rem; }
.post-content h4 { font-size: 1rem; font-style: italic; }

.post-content a { color: var(--accent-2); text-underline-offset: 3px; }
.post-content a:hover { color: var(--accent); }

.post-content strong { font-weight: 600; }
.post-content em { font-style: italic; }
.post-content del { opacity: 0.5; }

.post-content ul, .post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.4rem;
}
.post-content li { margin-bottom: 0.3rem; }

.post-content blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  color: var(--ink-muted);
  font-style: italic;
}
.post-content blockquote p { margin-bottom: 0; }

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

.post-content img {
  max-width: 100%;
  border-radius: 3px;
  display: block;
  margin: 1.5rem auto;
}

/* Code */
.post-content code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.1em 0.4em;
  border-radius: 3px;
}
.post-content pre {
  background: var(--code-bg);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.82rem;
  line-height: 1.6;
}
.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: #cdd6f4;
}

/* Post footer */
.post-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: 0.85rem;
}
.post-footer a { color: var(--ink-muted); text-decoration: none; }
.post-footer a:hover { color: var(--accent); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  padding: 1.25rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--ink-muted);
}
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* Responsive */
@media (max-width: 640px) {
  html { font-size: 16px; }
  .site-main { padding: 2rem 1rem 3rem; }
  .post-header h1 { font-size: 1.5rem; }
  .post-item { flex-direction: column; gap: 0.2rem; }
  .header-inner { gap: 1rem; }
  nav { gap: 0.9rem; }
}
