/* ─── Variables ─── */
:root {
  --bg:         #f7f4f0;
  --bg-subtle:  #ede9e3;
  --text:       #111;
  --text-mid:   #555;
  --text-muted: #999;
  --accent:     #c0783a;
  --divider:    #e0dbd4;
  --logo:       #1a1a1a;
  --copyright:  #ccc;
  --grain:      0.04;
}

[data-theme="dark"] {
  --bg:         #1a1714;
  --bg-subtle:  #2a2521;
  --text:       #e8e2d9;
  --text-mid:   #a89e96;
  --text-muted: #5a5550;
  --accent:     #c0783a;
  --divider:    #2e2a26;
  --logo:       #e8e2d9;
  --copyright:  #3a3530;
  --grain:      0.06;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

body {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 18px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ─── i18n ─── */
[lang="fr"] .en { display: none; }
[lang="en"] .fr { display: none; }

/* ─── Grain overlay ─── */
#grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  opacity: var(--grain);
}

/* ─── Header ─── */
.site-header {
  padding: 32px 32px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--logo);
  text-decoration: none;
  transition: color 0.15s;
}

.logo:hover {
  color: var(--accent);
}

.controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-btn,
.theme-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  transition: color 0.15s;
}

.lang-btn.active { color: var(--accent); }

.lang-btn:hover:not(.active),
.theme-btn:hover { color: var(--text-mid); }

.sep {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
}

/* ─── Hero ─── */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 32px;
}

.hero-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.hero h1 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(42px, 8vw, 72px);
  font-weight: 400;
  font-style: italic;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 24px;
}

.cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1s step-end infinite;
  font-style: normal;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-mid);
  max-width: 400px;
}

/* ─── Divider ─── */
.divider-line {
  width: 48px;
  height: 1px;
  background: var(--divider);
  margin: 48px auto;
}

/* ─── Teaser ─── */
.teaser {
  text-align: center;
  padding: 0 32px 64px;
}

.teaser-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.back-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  border-radius: 24px;
  padding: 8px 20px;
  display: inline-block;
  transition: background 0.2s, color 0.2s;
}

.back-link:hover {
  background: var(--accent);
  color: #fff;
}

.arrow {
  display: inline-block;
  transition: transform 0.2s;
}

.back-link:hover .arrow {
  transform: translate(2px, -2px);
}

/* ─── Footer ─── */
footer {
  padding: 24px 32px;
  text-align: center;
}

footer p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--copyright);
}

/* ─── Article page ─── */
.article-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 32px 64px;
}

.article {
  max-width: 680px;
  width: 100%;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.article-back {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s;
}

.article-back:hover {
  opacity: 0.7;
}

.article-read-time::before {
  content: '·';
  margin-right: 16px;
}

.article-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(32px, 6vw, 48px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 16px;
}

.article-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-mid);
  margin-bottom: 32px;
}

.article-body {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 19px;
  line-height: 1.75;
  color: var(--text);
}

.article-body p {
  margin-bottom: 24px;
}

.article-body h2 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 28px;
  font-weight: 500;
  color: var(--text);
  margin-top: 56px;
  margin-bottom: 20px;
  letter-spacing: -0.3px;
}

.article-body h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 40px;
  margin-bottom: 12px;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: opacity 0.15s;
}

.article-body a:hover {
  opacity: 0.7;
}

.article-body strong {
  font-weight: 500;
  color: var(--text);
}

.article-body ul,
.article-body ol {
  margin-bottom: 24px;
  padding-left: 24px;
}

.article-body li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.article-body ol li {
  padding-left: 4px;
}

.article-timeline {
  background: var(--bg-subtle);
  border-left: 3px solid var(--accent);
  padding: 24px 28px;
  margin: 32px 0;
  border-radius: 0 8px 8px 0;
}

.article-timeline p {
  margin-bottom: 12px;
  font-size: 17px;
}

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

.article .divider-line {
  margin: 48px 0;
}

.article-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.article-author {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
}

.article-author a {
  color: var(--accent);
  text-decoration: none;
}

.article-author a:hover {
  text-decoration: underline;
}

/* ─── Blog listing ─── */
.blog-list {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 0 32px 64px;
}

.blog-list-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.post-card {
  display: block;
  text-decoration: none;
  padding: 28px 0;
  border-bottom: 1px solid var(--divider);
  transition: opacity 0.15s;
}

.post-card:first-of-type {
  border-top: 1px solid var(--divider);
}

.post-card:hover {
  opacity: 0.75;
}

.post-card-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.post-card-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  font-style: italic;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}

.post-card-excerpt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-mid);
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
  .site-header { padding: 24px 20px 0; }
  .hero { padding: 0 20px; }
  .hero h1 { letter-spacing: -0.5px; }
  .teaser { padding: 0 20px 48px; }
  .article-page { padding: 32px 20px 48px; }
  .article-meta { flex-wrap: wrap; gap: 8px; }
  .article-footer { flex-direction: column; gap: 16px; align-items: flex-start; }
  .blog-list { padding: 0 20px 48px; }
  footer { padding: 20px; }
}
