:root {
  --bg: #fbfaf8;
  --bg-alt: #f2f0ec;
  --text: #1c1b19;
  --text-muted: #6b6862;
  --accent: #b5502f;
  --border: #e4e1da;
  --radius: 10px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max-width: 780px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --bg-alt: #201f1c;
    --text: #ede9e2;
    --text-muted: #9c968a;
    --accent: #e08a5f;
    --border: #302e29;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }

a {
  color: inherit;
  text-decoration: none;
}

.accent { color: var(--accent); font-style: italic; font-weight: 500; }

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 1rem;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.site-header nav {
  display: flex;
  gap: 1.5rem;
}

.site-header nav a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

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

/* Main sections */

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

section {
  padding: 4.5rem 0;
  border-bottom: 1px solid var(--border);
}

section:last-of-type { border-bottom: none; }

.hero {
  padding-top: 3rem;
  padding-bottom: 4.5rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  max-width: 16ch;
}

.hero-sub {
  max-width: 48ch;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover { opacity: 0.85; }

.btn-ghost {
  border: 1px solid var(--border);
}

.btn-ghost:hover { background: var(--bg-alt); }

/* About */

.about p {
  max-width: 60ch;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.section-sub {
  color: var(--text-muted);
  margin-top: -0.5em;
}

/* Notes: list (used on home preview, /notes/ index) */

.note-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.note-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.note-item:last-child { border-bottom: none; }

.note-item a {
  font-weight: 500;
}

.note-item a:hover { color: var(--accent); }

.note-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Notes: single note page */

.note-single { padding-top: 3rem; }

.note-single h1 { margin-top: 0.5rem; }

.note-single .note-date { margin-bottom: 2rem; }

.note-body {
  max-width: 65ch;
  font-size: 1.05rem;
}

.note-body pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
}

.note-body code {
  background: var(--bg-alt);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
}

.note-body pre code {
  background: none;
  padding: 0;
}

.note-body a { color: var(--accent); text-decoration: underline; }

/* Contact */

.email-link {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-style: italic;
  color: var(--accent);
  display: inline-block;
  margin-bottom: 1rem;
}

.social-links {
  display: flex;
  gap: 1.25rem;
  color: var(--text-muted);
}

.social-links a:hover { color: var(--text); }

/* Footer */

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  section { padding: 3rem 0; }
  .note-item { flex-direction: column; gap: 0.15rem; }
}
