 /* ── TOKENS ─────────────────────────────────────── */
  :root {
    --bg:        #eef4fb;
    --surface:   #ddeaf7;
    --card:      #ffffff;
    --border:    #b0cde8;
    --accent:    #1a72c4;
    --accent2:   #e05a1a;
    --text:      #1e3347;
    --muted:     #6a8faa;
    --white:     #ffffff;
    --radius:    12px;
    --font-head: 'Bebas Neue', sans-serif;
    --font-body: 'Syne', sans-serif;
    --font-mono: 'Space Mono', monospace;
  }

  /* ── RESET ───────────────────────────────────────── */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }

  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    overflow-x: hidden;
  }

  /* ── BACKGROUND GRAIN ────────────────────────────── */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: .5;
  }

  a { color: var(--accent); text-decoration: none; transition: color .2s; }
  a:hover { color: var(--accent2); }
  a:visited { color: #7db8d4; }

  /* ── LAYOUT ──────────────────────────────────────── */
  .wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
    position: relative;
    z-index: 1;
  }

  /* ── HEADER ──────────────────────────────────────── */
  header {
    background: linear-gradient(135deg, #1a72c4 0%, #2386d8 60%, #3a9de8 100%);
    border-bottom: 2px solid var(--border);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(26,114,196,.2);
  }

  .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    max-width: 1100px;
    margin: 0 auto;
  }

  .logo {
    font-family: var(--font-head);
    font-size: 2.4rem;
    letter-spacing: 3px;
    color: var(--white);
    line-height: 1;
    text-decoration: none;
  }

  .logo span { color: #ffe066; }

  .logo-sub {
    font-family: var(--font-mono);
    font-size: .65rem;
    color: #ffe066;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 2px;
  }

  /* ── MAIN GRID ────────────────────────────────────── */
  .page-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    padding: 28px 0 60px;
    align-items: start;
  }

  @media (max-width: 760px) {
    .page-grid { grid-template-columns: 1fr; }
  }

  /* ── SIDEBAR ──────────────────────────────────────── */
  .sidebar { display: flex; flex-direction: column; gap: 16px; }

  .card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .25s;
  }
  .card:hover { border-color: var(--accent); }

  .card-head {
    background: linear-gradient(90deg, #cce0f5, #ddeaf7);
    padding: 10px 16px;
    font-family: var(--font-head);
    font-size: 1.1rem;
    letter-spacing: 2px;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
  }

  .card-body { padding: 16px; font-size: .88rem; color: var(--text); }

  /* sidebar avatar area */
  .avatar-card {
    background: linear-gradient(160deg, #ddeaf7 0%, #eef4fb 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
  }

  .avatar-card img {
    width: 100%;
    max-width: 220px;
    border-radius: var(--radius);
    display: block;
    margin: 0 auto 14px;
    object-fit: cover;
  }

  .avatar-card p { font-size: .85rem; color: var(--text); line-height: 1.6; }

  /* youtube embed */
  .yt-wrap { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 8px; }
  .yt-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

  /* archives accordion */
  .accordion { width: 100%; }
  .accordion input[type="checkbox"] { display: none; }
  .accordion label {
    display: block;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: .8rem;
    color: var(--accent);
    margin-bottom: 4px;
    transition: background .2s;
  }
  .accordion label:hover { background: #cce0f5; }
  .accordion-content {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: .82rem;
    margin-bottom: 8px;
  }
  .accordion input:checked + label + .accordion-content { display: block; }

  /* exit link */
  .exit-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    text-align: center;
    font-size: .8rem;
    color: var(--muted);
  }
  .exit-box a { color: var(--accent2); font-family: var(--font-mono); }

  /* ── MAIN FEED ────────────────────────────────────── */
  .feed { display: flex; flex-direction: column; gap: 24px; }

  /* ── POST CARD ────────────────────────────────────── */
  .post {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    animation: fadeUp .5s ease both;
  }

  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: linear-gradient(90deg, #1a72c4, #2386d8);
    border-bottom: 1px solid var(--border);
    gap: 12px;
  }

  .post-num {
    font-family: var(--font-head);
    font-size: 1.4rem;
    color: #ffe066;
    letter-spacing: 1px;
  }

  .post-title {
    font-family: var(--font-head);
    font-size: 1.3rem;
    color: var(--white);
    letter-spacing: 1px;
    flex: 1;
  }

  .post-date {
    font-family: var(--font-mono);
    font-size: .72rem;
    color: var(--muted);
    white-space: nowrap;
  }

  .post-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  /* comment bubble */
  .comment-bubble {
    background: var(--surface);
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
    font-size: .9rem;
    line-height: 1.8;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 18px;
  }

  .comment-bubble-text { flex: 1; }

  .comment-bubble-img {
    flex-shrink: 0;
    width: 30%;
    object-fit: cover;
    border-radius: 8px;
    
  }

  /* ── CONTENT TABLE ────────────────────────────────── */
  .content-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
  }

  .content-table th {
    background: linear-gradient(90deg, #1a72c4, #2386d8);
    color: #ffe066;
    font-family: var(--font-head);
    font-size: .95rem;
    letter-spacing: 1px;
    padding: 10px 14px;
    text-align: center;
    border: 1px solid var(--border);
  }

  .content-table td {
    border: 1px solid var(--border);
    padding: 12px 14px;
    vertical-align: top;
    text-align: center;
    line-height: 2;
  }

  .content-table tr:nth-child(even) td { background: rgba(0,198,255,.04); }
  .content-table tr:hover td { background: rgba(0,198,255,.08); }

  .content-table td a {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: .75rem;
    background: rgba(0,198,255,.1);
    border: 1px solid rgba(0,198,255,.2);
    transition: background .2s, border-color .2s;
  }
  .content-table td a:hover {
    background: rgba(0,198,255,.25);
    border-color: var(--accent);
    color: var(--white);
  }

  /* text links in td */
  .content-table td .text-link {
    display: block;
    padding: 3px 0;
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: .82rem;
    color: var(--accent);
  }
  .content-table td .text-link:hover { color: var(--accent2); }

  /* ── BOUTON COMMENTAIRES ─────────────────────────── */
  .btn-open-comments {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 16px;
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--accent);
    cursor: pointer;
    transition: background .2s, border-color .2s;
  }
  .btn-open-comments:hover { background: #cce0f5; border-color: var(--accent); }
  .btn-open-comments .badge {
    background: var(--accent);
    color: #fff;
    border-radius: 20px;
    padding: 1px 8px;
    font-size: .7rem;
  }

  /* ── MODAL OVERLAY ───────────────────────────────── */
  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,30,55,.55);
    backdrop-filter: blur(4px);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 16px;
  }
  .modal-overlay.open { display: flex; }

  .modal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 580px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: modalIn .25s ease both;
  }

  @keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }

  .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(90deg, #1a72c4, #2386d8);
    border-radius: 15px 15px 0 0;
    gap: 10px;
    flex-shrink: 0;
  }

  .modal-title {
    font-family: var(--font-head);
    font-size: 1.2rem;
    letter-spacing: 2px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .modal-title .count {
    font-family: var(--font-mono);
    font-size: .7rem;
    background: rgba(255,255,255,.2);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    border-radius: 20px;
    padding: 2px 9px;
  }

  .modal-close {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background .2s;
    flex-shrink: 0;
  }
  .modal-close:hover { background: rgba(255,255,255,.3); }

  .modal-body {
    padding: 18px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
  }

  /* ── FORM DANS MODAL ─────────────────────────────── */
  .comment-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
  }

  .comment-form input,
  .comment-form textarea {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 13px;
    font-family: var(--font-body);
    font-size: .88rem;
    color: var(--text);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
  }
  .comment-form input:focus,
  .comment-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(26,114,196,.1);
  }
  .comment-form textarea { resize: vertical; min-height: 70px; }

  .comment-form-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: end;
  }

  .btn-comment {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-family: var(--font-head);
    font-size: .95rem;
    letter-spacing: 1px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .2s, transform .1s;
  }
  .btn-comment:hover { opacity: .88; }
  .btn-comment:active { transform: scale(.97); }
  .btn-comment:disabled { opacity: .5; cursor: not-allowed; }

  /* ── LISTE COMMENTAIRES ──────────────────────────── */
  .comments-list { display: flex; flex-direction: column; gap: 10px; }

  .comment-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    animation: fadeUp .35s ease both;
  }

  .comment-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
  }

  .comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #3a9de8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
    border: 2px solid var(--border);
  }

  .comment-pseudo {
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--accent);
    font-weight: bold;
  }

  .comment-date {
    font-family: var(--font-mono);
    font-size: .68rem;
    color: var(--muted);
    margin-left: auto;
  }

  .comment-text {
    font-size: .88rem;
    color: var(--text);
    line-height: 1.6;
    word-break: break-word;
  }

  .comment-loading {
    text-align: center;
    font-family: var(--font-mono);
    font-size: .75rem;
    color: var(--muted);
    padding: 16px 0;
  }

  .comment-empty {
    text-align: center;
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--muted);
    padding: 20px 0;
    border: 1px dashed var(--border);
    border-radius: 8px;
  }

  .comment-error {
    color: #c0392b;
    font-family: var(--font-mono);
    font-size: .75rem;
    padding: 4px 0;
  }

  /* ── BOUTON COMMENTAIRES ─────────────────────────── */
  .btn-open-comments {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 16px;
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--accent);
    cursor: pointer;
    transition: background .2s, border-color .2s;
  }
  .btn-open-comments:hover { background: #cce0f5; border-color: var(--accent); }
  .btn-open-comments .badge {
    background: var(--accent);
    color: #fff;
    border-radius: 20px;
    padding: 1px 8px;
    font-size: .7rem;
  }

  /* ── MODAL OVERLAY ───────────────────────────────── */
  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,30,55,.55);
    backdrop-filter: blur(4px);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 16px;
  }
  .modal-overlay.open { display: flex; }

  .modal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 580px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: modalIn .25s ease both;
  }

  @keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }

  .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(90deg, #7c6bc4, #9b8ad4);
    border-radius: 15px 15px 0 0;
    gap: 10px;
    flex-shrink: 0;
  }

  .modal-title {
    font-family: var(--font-head);
    font-size: 1.2rem;
    letter-spacing: 2px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .modal-title .count {
    font-family: var(--font-mono);
    font-size: .7rem;
    background: rgba(255,255,255,.2);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    border-radius: 20px;
    padding: 2px 9px;
  }

  .modal-close {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background .2s;
    flex-shrink: 0;
  }
  .modal-close:hover { background: rgba(255,255,255,.3); }

  .modal-body {
    padding: 18px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
  }

  .comment-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
  }

  .comment-form input,
  .comment-form textarea {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 13px;
    font-family: var(--font-body);
    font-size: .88rem;
    color: var(--text);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
  }
  .comment-form input:focus,
  .comment-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124,107,196,.15);
  }
  .comment-form textarea { resize: vertical; min-height: 70px; }

  .comment-form-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: end;
  }

  .btn-comment {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-family: var(--font-head);
    font-size: .95rem;
    letter-spacing: 1px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .2s, transform .1s;
  }
  .btn-comment:hover { opacity: .88; }
  .btn-comment:active { transform: scale(.97); }
  .btn-comment:disabled { opacity: .5; cursor: not-allowed; }

  .comments-list { display: flex; flex-direction: column; gap: 10px; }

  .comment-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    animation: fadeUp .35s ease both;
  }

  .comment-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
  }

  .comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #9b8ad4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
    border: 2px solid var(--border);
  }

  .comment-pseudo {
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--accent);
    font-weight: bold;
  }

  .comment-date {
    font-family: var(--font-mono);
    font-size: .68rem;
    color: var(--muted);
    margin-left: auto;
  }

  .comment-text {
    font-size: .88rem;
    color: var(--text);
    line-height: 1.6;
    word-break: break-word;
  }

  .comment-loading {
    text-align: center;
    font-family: var(--font-mono);
    font-size: .75rem;
    color: var(--muted);
    padding: 16px 0;
  }

  .comment-empty {
    text-align: center;
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--muted);
    padding: 20px 0;
    border: 1px dashed var(--border);
    border-radius: 8px;
  }

  .comment-error {
    color: #c0392b;
    font-family: var(--font-mono);
    font-size: .75rem;
    padding: 4px 0;
  }

  /* ── FOOTER ───────────────────────────────────────── */
  footer {
    border-top: 1px solid var(--border);
    padding: 24px 16px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: .72rem;
    color: var(--muted);
  }
