:root {
  --bg: #fafafa;
  --bg-secondary: #f3f3f3;
  --bg-code: #f7f7f8;
  --text: #1a1a1a;
  --text-secondary: #3d3d3d;
  --text-muted: #6b6b6b;
  --accent: #8b6914;
  --accent-hover: #6b4f0e;
  --border: #e2e2e2;
  --border-light: #eeeeee;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  --font-serif: "Georgia", "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, sans-serif;
  --content-width: 40rem;
  --header-width: 56rem;
}

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

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* ── Header ── */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header nav {
  max-width: var(--header-width);
  margin: 0 auto;
  padding: 0.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  display: flex;
  align-items: center;
}

.site-logo {
  height: 2.4rem;
  width: auto;
  transition: opacity 0.15s ease;
}

.site-title:hover .site-logo {
  opacity: 0.7;
}

.site-header ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.site-header ul a {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 450;
  letter-spacing: 0.01em;
  transition: color 0.15s ease;
}

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

/* ── Main container ── */
main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
  flex: 1;
  width: 100%;
}

/* ── Hero (home) ── */
.hero {
  padding: 3rem 0 3.5rem;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero .signature {
  color: var(--text-muted);
  font-size: 1.05rem;
  font-style: italic;
  margin-bottom: 2.5rem;
}

.hero-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.hero-links a {
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.6rem 1.5rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.hero-links a:first-child {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.hero-links a:first-child:hover {
  background: var(--text-secondary);
  border-color: var(--text-secondary);
  color: var(--bg);
}

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

/* ── Recent posts on home ── */
.home-content {
  padding-top: 3rem;
  border-top: 1px solid var(--border-light);
}

.recent-heading {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ── Page title (list/single static pages) ── */
.page-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  line-height: 1.25;
}

/* ── Section content (a-propos, newsletter, auteur) ── */
.section-content {
  line-height: 1.85;
  color: var(--text-secondary);
  font-size: 1.02rem;
}

.section-content p {
  margin-bottom: 1.25rem;
}

.section-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
}

.section-content a:hover {
  text-decoration-color: var(--accent);
}

/* ── Blog post list ── */
.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.post-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-light);
}

.post-item:first-child {
  padding-top: 0;
}

.post-item a {
  color: var(--text);
  display: block;
}

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

.post-title {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.3rem;
  transition: color 0.15s ease;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.post-meta time {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.post-description {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-top: 0.4rem;
}

/* ── Article (single post) ── */
.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-light);
}

.article-header h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.article-header .post-meta {
  font-size: 0.85rem;
}

.article-content {
  line-height: 1.85;
  color: var(--text-secondary);
  font-size: 1.02rem;
}

.article-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin: 2.5rem 0 0.75rem;
  letter-spacing: -0.01em;
}

.article-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 0.5rem;
}

.article-content p {
  margin-bottom: 1.25rem;
}

.article-content ul,
.article-content ol {
  margin: 0 0 1.25rem 1.25rem;
}

.article-content li {
  margin-bottom: 0.35rem;
}

.article-content pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.15rem 1.25rem;
  overflow-x: auto;
  margin: 1.5rem -1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
}

.article-content code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: var(--bg-code);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

.article-content pre code {
  background: none;
  padding: 0;
  border: none;
  font-size: 1em;
}

.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.25rem 0 0.25rem 1.25rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 1.5rem 0;
}

.article-content blockquote p:last-child {
  margin-bottom: 0;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.5rem 0;
}

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

/* ── Article footer ── */
.article-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.88rem;
}

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.article-nav a {
  color: var(--text-muted);
  transition: color 0.15s ease;
}

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

.article-nav .nav-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 0.25rem;
}

.article-nav .nav-title {
  font-weight: 500;
  color: var(--text);
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.site-footer p {
  margin-bottom: 0.2rem;
}

.site-footer .signature {
  font-style: italic;
}

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

  .site-header nav {
    padding: 0.75rem 1.25rem;
  }

  .site-logo {
    height: 2rem;
  }

  .site-header ul {
    gap: 1.25rem;
  }

  .site-header ul a {
    font-size: 0.82rem;
  }

  main {
    padding: 2.5rem 1.25rem 3rem;
  }

  .hero {
    padding: 2rem 0 2.5rem;
  }

  .hero h1 {
    font-size: 1.7rem;
  }

  .hero-links {
    flex-direction: column;
    gap: 0.75rem;
  }

  .hero-links a {
    text-align: center;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .article-header h1 {
    font-size: 1.6rem;
  }

  .article-content pre {
    margin-left: -1.25rem;
    margin-right: -1.25rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .post-title {
    font-size: 1.05rem;
  }

  .article-nav {
    flex-direction: column;
    gap: 1.25rem;
  }
}

@media (max-width: 420px) {
  .site-header nav {
    flex-direction: column;
    gap: 0.6rem;
  }
}
