:root {
    --bg: #0f1115;
    --bg-elev: #161922;
    --bg-card: #1a1e2a;
    --border: #262b3a;
    --text: #e6e9f2;
    --text-dim: #9aa3b8;
    --text-muted: #6b7488;
    --accent: #ffd166;
    --accent-2: #06d6a0;
    --danger: #ef476f;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.15);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    background: var(--bg-elev);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: "JetBrains Mono", "SF Mono", Menlo, monospace;
}

/* --- Header --- */
.site-header {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand-emoji { font-size: 1.6rem; }

.tagline { margin: 0; color: var(--text-dim); font-size: 0.95rem; }

/* --- Main --- */
#main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1.5rem 4rem;
    min-height: 60vh;
}

.loading, .empty, .error {
    padding: 4rem 1rem;
    text-align: center;
    color: var(--text-dim);
}
.error { color: var(--danger); }

/* --- Tableau d'idées --- */
.ideas-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 0.92rem;
}

.ideas-table thead th {
    background: var(--bg-elev);
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.7rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.ideas-table tbody tr {
    border-top: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.12s ease;
}
.ideas-table tbody tr:first-child { border-top: none; }
.ideas-table tbody tr:hover { background: var(--bg-elev); }

.ideas-table td {
    padding: 0.85rem 0.9rem;
    vertical-align: top;
}

.col-date { width: 110px; white-space: nowrap; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.col-title { min-width: 220px; }
.col-title a {
    color: var(--text);
    font-weight: 600;
    letter-spacing: -0.01em;
}
.col-title a:hover { color: var(--accent); text-decoration: none; }
.row-pitch {
    margin: 0.25rem 0 0;
    color: var(--text-dim);
    font-size: 0.85rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.col-niche {
    color: var(--accent-2);
    font-size: 0.85rem;
    max-width: 220px;
}

th[title] { cursor: help; text-align: center; }
.score-cell {
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    width: 60px;
    white-space: nowrap;
}
.score-cell.high { color: var(--accent-2); }
.score-cell.mid  { color: var(--accent); }
.score-cell.low  { color: var(--danger); }

/* --- Article --- */
.article { max-width: 760px; margin: 0 auto; }

.back {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.md-body h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.5rem; }
.md-body h1 + blockquote { color: var(--text-dim); border: none; padding-left: 0; font-style: italic; margin-bottom: 2rem; }
.md-body h2 { font-size: 1.4rem; margin: 2.5rem 0 1rem; padding-top: 1.5rem; border-top: 1px solid var(--border); letter-spacing: -0.01em; }
.md-body h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; color: var(--accent); }
.md-body h4 { font-size: 0.95rem; margin: 1.2rem 0 0.4rem; color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.05em; }

.md-body p, .md-body ul, .md-body ol { margin: 0.6rem 0; }
.md-body ul, .md-body ol { padding-left: 1.4rem; }
.md-body li { margin: 0.25rem 0; }

.md-body strong { color: var(--text); font-weight: 600; }
.md-body em { color: var(--text-dim); }

.md-body blockquote {
    margin: 1rem 0;
    padding: 0.8rem 1.2rem;
    border-left: 3px solid var(--accent);
    background: var(--bg-elev);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text);
}
.md-body blockquote p { margin: 0; }

.md-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
    background: var(--bg-elev);
    border-radius: var(--radius);
    overflow: hidden;
}
.md-body th, .md-body td {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}
.md-body th { background: var(--bg-card); color: var(--text-dim); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.md-body tr:last-child td { border-bottom: none; }

.md-body pre {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.85rem;
}
.md-body pre code { background: transparent; padding: 0; }

.md-body hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

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

/* --- Footer --- */
.site-footer {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 700px) {
    .site-header { padding-top: 1.5rem; }
    .md-body h1 { font-size: 1.5rem; }
    .md-body table { font-size: 0.8rem; }
    .md-body th, .md-body td { padding: 0.4rem 0.6rem; }

    /* Tableau : on cache niche en mobile pour rester lisible */
    .col-niche { display: none; }
    .ideas-table { font-size: 0.85rem; }
    .ideas-table thead th, .ideas-table td { padding: 0.5rem 0.6rem; }
    .score-cell { width: 44px; }
    .col-date { width: 80px; }
}

/* Scroll-margin pour que les ancres du sommaire ne soient pas masquées par
   un éventuel header sticky (placeholder, harmless si pas de sticky) */
.md-body :is(h1, h2, h3, h4, h5, h6) { scroll-margin-top: 1rem; }
