/* ============================================================
   DESIGN: Warm & personal — cream background, terracotta accent
   Fonts: Bricolage Grotesque (headings) + DM Sans (body) + Space Mono (labels/code)
   ============================================================ */

:root {
  --bg:        #fdf8f2;
  --bg-card:   #f5ede2;
  --ink:       #1c1410;
  --ink-head:  #5c3d2e;
  --ink-muted: #6b5a4a;
  --accent:    #b85a34;
  --accent-2:  #6b5a4a;
  --border:    #e0d4c4;
  --code-bg:   #2b2118;
  --code-ink:  #f0e6d8;
  --radius:    6px;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-head: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-mono: 'Fira Code', 'Courier New', monospace;
  --max-w:     740px;
  --wide-w:    1100px;
}

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

html { font-size: 17px; 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;
}

/* ── Nav ── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}

.nav-inner {
  max-width: var(--wide-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.site-name {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

/* ── Main ── */
.page-main {
  flex: 1;
  width: 100%;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.site-footer a { color: var(--ink-muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* ── Hero ── */
.home-hero {
  padding: 6rem 2rem 4rem;
  max-width: var(--wide-w);
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.hero-text h1 {
  font-family: var(--font-head);
  color: var(--ink-head);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.hero-bio {
  font-family: 'Dosis', system-ui, sans-serif;
  font-size: 1.1rem;
  color: #d4805f;
  font-style: normal;
  max-width: 520px;
  margin-bottom: 2rem;
}

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

.hero-nav a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}

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

/* ── Home recent ── */
.home-recent {
  max-width: var(--wide-w);
  margin: 0 auto;
  padding: 3rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

@media (max-width: 640px) { .home-recent { grid-template-columns: 1fr; } }

.recent-group h2 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.card-list { list-style: none; display: flex; flex-direction: column; gap: 1.25rem; }

.card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card a {
  font-size: 1rem;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.card a:hover { color: var(--accent); }
.card p { font-size: 0.875rem; color: var(--ink-muted); }
.card time { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-muted); }

.see-all {
  display: inline-block;
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-2);
  text-decoration: none;
}
.see-all:hover { text-decoration: underline; }

/* ── Page header ── */
.page-header {
  max-width: var(--wide-w);
  margin: 0 auto;
  padding: 4rem 2rem 2rem;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-family: var(--font-head);
  color: var(--ink-head);
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.page-header p {
  font-family: 'Dosis', system-ui, sans-serif;
  color: #d4805f;
  font-style: normal;
  font-size: 1rem;
}

.page-header p a { color: var(--accent-2); }

/* ── Tags ── */
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink-muted);
}

/* ── Status badges ── */
.project-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius);
}

.status-complete    { background: #d4edda; color: #1a5c2a; border: 1px solid #a3d4ad; }
.status-in-progress { background: #fff3cd; color: #7a5a00; border: 1px solid #f0d070; }
.status-archived    { background: #e8e4dc; color: var(--ink-muted); border: 1px solid var(--border); }

/* ── Project list ── */
.filter-bar {
  max-width: var(--wide-w);
  margin: 2rem auto 0;
  padding: 0 2rem;
  display: flex;
  gap: 0.75rem;
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--ink-muted);
  transition: all 0.15s;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.project-list {
  list-style: none;
  max-width: var(--wide-w);
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.project-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.project-card h2 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.project-card h2 a { color: var(--ink); text-decoration: none; }
.project-card h2 a:hover { color: var(--accent); }
.project-card p { font-size: 0.875rem; color: var(--ink-muted); }

/* ── Project page ── */
.project-page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 2rem;
}

.project-header { margin-bottom: 3rem; border-bottom: 1px solid var(--border); padding-bottom: 2rem; }
.project-header h1 { font-family: var(--font-head); color: var(--ink-head); font-size: 2rem; margin: 0.75rem 0; letter-spacing: -0.02em; }
.project-description { font-style: italic; color: var(--ink-muted); }
.project-meta { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem; }

.btn-repo {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--accent-2);
  color: var(--accent-2);
  text-decoration: none;
  border-radius: var(--radius);
  transition: all 0.15s;
}

.btn-repo:hover { background: var(--accent-2); color: var(--bg); }

/* ── Writing list ── */
.post-list { list-style: none; max-width: var(--max-w); margin: 0 auto; padding: 2rem; }

.post-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

@media (max-width: 560px) { .post-item { grid-template-columns: 1fr; } }

.post-item time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  padding-top: 0.2rem;
}

.post-item a {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.post-item a:hover { color: var(--accent); }
.post-item p { font-size: 0.875rem; color: var(--ink-muted); margin-top: 0.25rem; }

/* ── Post page ── */
.post-page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 2rem;
}

.post-header { margin-bottom: 3rem; border-bottom: 1px solid var(--border); padding-bottom: 2rem; }
.post-header time { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-muted); }
.post-header h1 { font-family: var(--font-head); color: var(--ink-head); font-size: 2rem; margin: 0.5rem 0 0.75rem; letter-spacing: -0.02em; }
.post-lede { font-style: italic; color: var(--ink-muted); font-size: 1.05rem; }
.post-footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.back-link { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent-2); text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* ── Prose ── */
.prose { line-height: 1.8; }
.prose h2 { font-family: var(--font-head); color: var(--ink-head); font-size: 1.3rem; margin: 2.5rem 0 0.75rem; }
.prose h3 { font-family: var(--font-head); color: var(--ink-head); font-size: 1.1rem; margin: 2rem 0 0.5rem; }
.prose p { margin-bottom: 1.25rem; }
.prose a { color: var(--accent-2); }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.prose li { margin-bottom: 0.35rem; }
.prose blockquote {
  border-left: 3px solid var(--border);
  padding: 0.25rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--ink-muted);
  font-style: italic;
}
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 1.5rem 0; }

/* ── Code ── */
pre {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.65;
  margin: 1.5rem 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-card);
  padding: 0.1em 0.35em;
  border-radius: 2px;
  border: 1px solid var(--border);
}

pre code { background: none; border: none; padding: 0; font-size: inherit; }

/* ── Code page ── */
.repos-section, .snippets-section {
  max-width: var(--wide-w);
  margin: 0 auto;
  padding: 2.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.repos-section h2, .snippets-section h2 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
}

.repo-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; }

.repo-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  gap: 1rem;
}

.repo-name { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1rem; }
.repo-name:hover { color: var(--accent); }
.repo-desc { font-size: 0.875rem; color: var(--ink-muted); margin: 0.25rem 0 0.5rem; }
.repo-tags { list-style: none; display: flex; gap: 0.4rem; }
.repo-tags li {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink-muted);
}
.repo-link { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent-2); text-decoration: none; white-space: nowrap; }
.repo-link:hover { text-decoration: underline; }

.snippets-intro { font-style: italic; color: var(--ink-muted); margin-bottom: 2rem; }

.snippet { margin-bottom: 2.5rem; }
.snippet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.snippet-header h3 { font-size: 1rem; }
.snippet-lang {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink-muted);
}

/* ── Feedback form ── */
.feedback-section {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.feedback-section h2 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.feedback-section > p { font-style: italic; color: var(--ink-muted); margin-bottom: 2rem; }

.feedback-form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-row { display: flex; flex-direction: column; gap: 0.35rem; }

.form-row label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-muted);
}

.form-row input,
.form-row select,
.form-row textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus { border-color: var(--accent-2); }

.form-row textarea { resize: vertical; min-height: 120px; }

.btn-submit {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.6rem 1.5rem;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-submit:hover { background: var(--accent); }

.empty-state { padding: 3rem 2rem; color: var(--ink-muted); font-style: italic; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .site-header { padding: 0 1rem; }
  .page-main { padding: 0; }
  .project-page, .post-page { padding: 2rem 1.25rem; }
}
