:root{
  --navy:#1a2332; --navy-soft:#141b28; --body:#f1f1f1; --accent:#a8c7d5;
  --accent-deep:#356d82; --blue:#5163b8; --nav:#b0bec5; --nav-hover:#4fc3f7;
  --card-title:#e0e0e0; --card-meta:#8a9bb0; --ink:#1f2a3a; --muted:#4a5560;
  --mono:'JetBrains Mono','Monaco','Menlo','Consolas','Courier New',monospace;
}
html,body{ overflow-x:hidden; }
body{ background:var(--body); font-family:var(--mono); color:var(--ink); }

/* full-bleed: no-op when parent is already full width, bleeds out when constrained */
.swr-bleed{ width:100vw; margin-left:calc(50% - 50vw); margin-right:calc(50% - 50vw); }

/* ---------- HEADER ---------- */
.head{ background:var(--navy); }
.head-banner{ padding:26px 24px 6px; text-align:center; }
.typewrite{ font-size:2.4rem; font-weight:700; letter-spacing:-.02em; color:#e0e0e0;
            white-space:nowrap; display:inline-block; min-height:2.6rem; text-decoration:none; }
.typewrite .wrap{ border-right:.08em solid var(--accent); padding-right:2px; }
.head-nav{ display:flex; align-items:center; justify-content:center; gap:22px; flex-wrap:wrap;
           padding:10px 24px 22px; max-width:1180px; margin:0 auto; }
.nav-links{ display:flex; gap:16px; list-style:none; flex-wrap:wrap; justify-content:center; margin:0; padding:0; }
.nav-links a{ color:var(--nav); text-decoration:none; padding:5px 9px; border-radius:10px;
              font-size:17px; transition:all .2s ease; }
.nav-links a:hover{ background:rgba(79,195,247,.15); color:var(--nav-hover); }
.nav-actions{ display:flex; align-items:center; gap:14px; }
.ico-btn{ background:none; border:none; color:var(--nav); cursor:pointer; display:flex; padding:0; }
.ico-btn:hover{ color:var(--nav-hover); }

/* ---------- HERO ---------- */
.hero{ max-width:760px; margin:0 auto; padding:72px 24px 56px; text-align:center; }
.hero-eyebrow{ font-size:.86rem; color:var(--accent-deep); letter-spacing:.02em; margin-bottom:14px; }
.hero h1{ font-size:3rem; line-height:1.05; letter-spacing:-.03em; color:var(--ink); font-weight:700; margin-bottom:10px; }
.hero-role{ font-size:1.18rem; color:var(--accent-deep); font-weight:500; margin-bottom:20px; }
.hero-role b{ color:var(--ink); font-weight:700; }
.hero-bio{ font-size:1rem; line-height:1.7; color:var(--muted); max-width:48ch; margin:0 auto 28px; }
.hero-actions{ display:flex; gap:12px; flex-wrap:wrap; justify-content:center; }
.btn{ font-family:var(--mono); font-size:.95rem; font-weight:600; border-radius:8px; padding:11px 20px;
      text-decoration:none; cursor:pointer; transition:all .2s ease; display:inline-flex; align-items:center; gap:8px; }
.btn-primary{ background:var(--accent); color:var(--navy); border:1px solid var(--accent); }
.btn-primary:hover{ background:#c1d9e3; transform:translateY(-1px); }
.btn-ghost{ background:transparent; color:var(--ink); border:1px solid #c4c9cf; }
.btn-ghost:hover{ border-color:var(--navy); background:#e9e9e9; }
.btn svg{ width:16px; height:16px; fill:currentColor; }

/* ---------- DATAVIZ GALLERY (homepage) ---------- */
.work-section{ max-width:1180px; margin:0 auto; padding:24px 24px 50px; }
.work-head{ display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:10px;
            border-top:1px solid #d9d9d9; padding-top:34px; margin-bottom:34px; }
.work-head h2{ font-size:1.5rem; letter-spacing:-.01em; color:var(--ink); font-weight:700; }
.work-head .eyebrow{ font-size:.82rem; color:var(--accent-deep); }
.work-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(290px,1fr)); gap:22px; }
.work{ background:var(--navy); border-radius:12px; overflow:hidden; text-decoration:none; display:block;
       transition:transform .25s ease,box-shadow .25s ease; }
.work:hover{ transform:translateY(-5px); box-shadow:0 10px 30px rgba(0,0,0,.20); }
.work-preview{ aspect-ratio:16/10; background:var(--navy-soft); display:flex; align-items:center; justify-content:center; }
.work-preview svg{ width:74%; height:74%; }
.work-body{ padding:16px 18px 20px; }
.work-tags{ display:flex; gap:8px; align-items:center; margin-bottom:9px; }
.tag{ font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; color:var(--accent); }
.badge{ font-size:.68rem; text-transform:uppercase; letter-spacing:.04em; color:var(--navy);
        background:var(--accent); padding:2px 8px; border-radius:20px; font-weight:700; }
.work h3{ color:var(--card-title); font-size:1.12rem; line-height:1.32; letter-spacing:-.012em; font-weight:700; }
.work-arrow{ margin-top:12px; color:var(--card-meta); font-size:.8rem; }
.work:hover .work-arrow{ color:var(--accent); }
.work-foot{ text-align:center; margin-top:40px; }
.work-foot a{ font-size:.95rem; color:var(--accent-deep); text-decoration:none; border-bottom:1px solid transparent; padding-bottom:2px; }
.work-foot a:hover{ border-color:var(--accent-deep); }

/* ---------- QUARTO LISTING CARDS (category / archive pages) ---------- */
.quarto-listing .card{ background:var(--navy); border:none; border-radius:12px; overflow:hidden;
                       transition:transform .25s ease, box-shadow .25s ease; }
.quarto-listing .card:hover{ transform:translateY(-5px); box-shadow:0 10px 30px rgba(0,0,0,.20); }
.quarto-listing .card-title, .quarto-listing .listing-title{ color:var(--card-title) !important; font-weight:700; }
.quarto-listing .card-img-top{ aspect-ratio:16/10; object-fit:cover; }
.quarto-grid .card-body{ padding:16px 18px 20px; }

/* glyph cards on listing/category pages (Quarto cards transformed via JS in footer) */
.card-img-top.swr-glyph-preview{ aspect-ratio:16/10; background:var(--navy-soft) !important;
    display:flex !important; align-items:center; justify-content:center; margin:0 !important; padding:0 !important; }
.card-img-top.swr-glyph-preview svg{ width:72%; height:72%; }
.quarto-grid .swr-glyph-link .card-title, .quarto-grid .swr-glyph-link .listing-title{
    font-size:1.12rem; line-height:1.32; letter-spacing:-.012em; }
.quarto-grid .swr-glyph-link .work-tags{ margin-bottom:9px; }
.quarto-grid .swr-glyph-link .work-arrow{ margin-top:12px; }
.swr-glyph-link:hover .work-arrow{ color:var(--accent); }
/* dataviz titles on the thematic (glyph) cards: soft pink, matching the site accent */
.quarto-listing .swr-glyph-link .card-title,
.quarto-listing .swr-glyph-link .listing-title{ color:#edaef3 !important; }

/* ---------- ARTICLE PAGES ---------- */
#title-block-header{ margin-top:2rem; }                              /* breathing room below the header */
#title-block-header .quarto-title h1.title{ color:var(--ink); font-weight:700; letter-spacing:-.02em; }
.quarto-title-meta{ display:none !important; }                       /* hide Quarto's default meta grid */
#title-block-header .quarto-categories{ display:none !important; }   /* we render category + date ourselves */
main a{ color:var(--accent-deep); }

/* post meta line: category + publication date, just under the title */
.swr-postmeta{ display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:0 0 28px; font-size:.82rem; }
.swr-cat{ text-transform:uppercase; letter-spacing:.06em; font-weight:700; color:#c83c3c; }
.swr-dot{ color:var(--card-meta); }
.swr-date{ color:var(--muted); }

/* responsive images coming from the migrated Ghost content */
main figure img, main .kg-card img{ max-width:100%; height:auto; }
figure.kg-image-card{ margin:1.4em 0; text-align:center; }

/* ---- LAYOUT ---- */
/* Below 992px Quarto is already full-width, so this only touches desktop. */
@media (min-width:992px){
  /* drop Quarto's centered-column grid so we control the width ourselves */
  div.quarto-container.page-columns{ display:block !important; }

  /* TEXT / ARTICLE pages (posts, about, dataviz-inspiration) keep generous side margins,
     like the screenshot. ~500px of gutter on a wide screen, shrinking on smaller ones. */
  body.fullcontent main.content{
    max-width:none !important; width:100% !important;
    padding-left:clamp(40px,28vw,500px) !important; padding-right:clamp(40px,28vw,500px) !important;
  }

  /* FULL pages (home, gallery, listings) span the width with just a small gutter */
  body:not(.fullcontent) main.content{
    max-width:none !important; width:100% !important;
    padding-left:clamp(28px,4vw,72px) !important; padding-right:clamp(28px,4vw,72px) !important;
  }
  /* listing / card pages stay contained + centered so cards keep a sane size */
  body:not(.fullcontent) main.content:has(.quarto-listing){ max-width:1160px !important; margin-left:auto !important; margin-right:auto !important; }

  /* GitHub bookmark card at the end of posts: contained + centered */
  main .kg-bookmark-card{ max-width:780px !important; margin-left:auto !important; margin-right:auto !important; }
  /* figures & interactive iframes fill the column */
  main figure.kg-image-card, main .kg-card.kg-width-wide, main iframe{ width:100% !important; max-width:100% !important; margin-left:0 !important; }
  main iframe{ display:block; }
  /* keep the top nav centered, just a little more room (item spacing set in the base rule) */
  .head-nav{ max-width:1320px; }
}

/* full-article-width separators (classes applied by the script in footer.html):
   one above the closing block ("Thanks for reading"), one above the GitHub card.
   Both are block elements in the text column, so they span the full article width. */
.swr-closing-start{ border-top:1px solid #d3d3d3; padding-top:30px; margin-top:30px; }
hr.swr-article-sep{ border:0; border-top:1px solid #d3d3d3; width:100%; height:0; margin:30px 0; }

/* kill the grey strip above the banner:
   on posts it was main's top spacing; on home/gallery it's an EMPTY title block
   sitting above the banner. */
main.content{ margin-top:0 !important; padding-top:0 !important; }
#title-block-header:empty{ display:none !important; }

/* inline code, matching the old Ghost look */
/* inline code + code-wrapped links shown as navy pills.
   The !important + the extra specificity beat Bootstrap/cosmo's default grey code background. */
main :not(pre) > code:not(.sourceCode){ background:#1a2332 !important; color:#fba5e0; border-radius:3px; padding:.15em .4em; font-size:.88em; }
/* a link whose whole text is a code pill: drop the underline, brighten the pill on hover */
main a:has(> code){ text-decoration:none; }
main a:has(> code):hover > code{ color:#ffd1f0; }

/* ---------- GHOST BOOKMARK CARDS (end-of-post GitHub links) ---------- */
.kg-bookmark-card, .kg-bookmark-card *{ box-sizing:border-box; }
.kg-bookmark-card{ margin:1.5em 0; }
.kg-bookmark-container{ display:flex; min-height:148px; border:1px solid rgba(124,139,154,.28);
  border-radius:8px; text-decoration:none; color:inherit; overflow:hidden; background:#fff; }
.kg-bookmark-container:hover{ border-color:var(--accent-deep); }
.kg-bookmark-content{ flex:1 1 auto; min-width:0; display:flex; flex-direction:column;
  align-items:flex-start; justify-content:flex-start; padding:18px 20px; }
.kg-bookmark-title{ font-weight:700; color:var(--ink); font-size:.95rem; line-height:1.3; }
.kg-bookmark-description{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  overflow:hidden; margin-top:6px; color:var(--muted); font-size:.85rem; line-height:1.45; }
.kg-bookmark-metadata{ display:flex; align-items:center; flex-wrap:wrap; gap:6px;
  margin-top:auto; padding-top:14px; font-size:.8rem; color:var(--ink); }
.kg-bookmark-icon{ width:18px; height:18px; margin:0 2px 0 0; }
.kg-bookmark-author::after{ content:"\00B7"; margin:0 2px 0 6px; color:var(--muted); }
.kg-bookmark-publisher{ color:var(--muted); max-width:240px; overflow:hidden;
  white-space:nowrap; text-overflow:ellipsis; }
.kg-bookmark-thumbnail{ position:relative; flex:0 0 30%; min-height:148px; }
.kg-bookmark-thumbnail img{ position:absolute; inset:0; width:100%; height:100%;
  object-fit:cover; border-radius:0 8px 8px 0; }

/* ---------- GHOST FILE CARDS (downloadable files) ---------- */
.kg-file-card{ margin:1.5em 0; }
.kg-file-card-container{ display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:8px 12px; min-height:72px; border:1px solid #8ED1E7; border-radius:6px;
  text-decoration:none; color:inherit; }
.kg-file-card-container:hover{ background:rgba(142,209,231,.10); }
.kg-file-card-title{ font-weight:700; color:var(--ink); }
.kg-file-card-caption{ color:var(--muted); font-size:.85rem; }

/* ---------- CLICK-TO-ENLARGE (custom lightbox) ---------- */
.swr-zoomable{ cursor:zoom-in; }
.swr-lb{ position:fixed; inset:0; background:rgba(12,16,22,.93); display:none;
  align-items:center; justify-content:center; z-index:2000; cursor:zoom-out; padding:24px; }
.swr-lb.open{ display:flex; }
.swr-lb img{ max-width:95vw; max-height:92vh; object-fit:contain; border-radius:4px;
  box-shadow:0 12px 48px rgba(0,0,0,.55); }
.swr-lb-close{ position:fixed; top:16px; right:24px; width:44px; height:44px; border:none;
  background:rgba(255,255,255,.12); color:#fff; font-size:1.7rem; line-height:1; border-radius:50%;
  cursor:pointer; display:flex; align-items:center; justify-content:center; }
.swr-lb-close:hover{ background:rgba(255,255,255,.25); }

/* ---------- FOOTER ---------- */
.swr-foot{ background:var(--body); margin-top:30px; border-top:1px solid #d9d9d9; position:sticky; top:100vh; padding:0; }
.foot{ display:flex; justify-content:center; align-items:center; gap:clamp(32px,7vw,110px); max-width:1180px; margin:0 auto;
       padding:0 24px; flex-wrap:wrap; }
.foot a{ color:#443F45; text-decoration:none; font-family:Arial,Helvetica,sans-serif; padding:24px 0; font-size:14.5px; }
.foot-icons{ display:flex; gap:18px; list-style:none; margin:0; padding:0; }
.foot-icons a{ padding:0; }
.foot-icons svg{ width:24px; height:24px; fill:var(--navy); }
.foot-icons a:hover svg{ fill:var(--nav-hover); }

/* hide Quarto's own default footer to avoid duplication */
.nav-footer{ display:none; }

@media(max-width:720px){
  .hero h1{ font-size:2.3rem; }
  .typewrite{ font-size:1.5rem; white-space:normal; }
}

@media(max-width:600px){
  .kg-bookmark-container{ flex-direction:column; }
  .kg-bookmark-thumbnail{ flex-basis:auto; width:100%; height:160px; min-height:160px; order:-1; }
  .kg-bookmark-thumbnail img{ border-radius:8px 8px 0 0; }
}

/* ---------- NEWSLETTER : bouton menu + pop-up ---------- */
.swr-nav-news{ font-family:var(--mono); font-size:15px; font-weight:600;
  color:var(--navy); background:var(--accent); border:none; border-radius:10px;
  padding:6px 14px; cursor:pointer; transition:all .2s ease; }
.swr-nav-news:hover{ background:var(--nav-hover); transform:translateY(-1px); }

.swr-modal{ position:fixed; inset:0; background:rgba(10,15,25,.72);
  display:none; align-items:center; justify-content:center; z-index:1000; padding:20px; }
.swr-modal.open{ display:flex; }
.swr-modal-card{ position:relative; background:var(--navy); border-radius:14px;
  max-width:440px; width:100%; padding:38px 30px 30px; text-align:center;
  box-shadow:0 20px 60px rgba(0,0,0,.4); }
.swr-modal-close{ position:absolute; top:8px; right:14px; background:none; border:none;
  color:var(--nav); font-size:1.9rem; line-height:1; cursor:pointer; padding:0; }
.swr-modal-close:hover{ color:var(--nav-hover); }
.swr-modal-card h2{ color:#e0e0e0; font-size:1.5rem; font-weight:700; margin:0 0 10px; }
.swr-modal-lead{ color:var(--nav); font-size:.95rem; line-height:1.6;
  margin:0 auto 20px; max-width:38ch; }

/* formulaire (partagé) */
.swr-sub-form{ display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
.swr-sub-form input[type="email"]{
  font-family:var(--mono); font-size:.95rem; color:var(--ink);
  background:#f1f1f1; border:1px solid transparent; border-radius:8px;
  padding:11px 14px; min-width:220px; flex:1 1 220px; max-width:340px; }
.swr-sub-form input[type="email"]:focus{ outline:none; border-color:var(--accent); }
.swr-sub-form .btn-primary{ flex:0 0 auto; }
.swr-sub-hp{ position:absolute; left:-9999px; width:1px; height:1px; opacity:0; }
.swr-sub-msg{ min-height:1.2em; margin:14px 0 0; font-size:.9rem; }
.swr-sub-msg.ok{ color:#5dcaa5; }
.swr-sub-msg.err{ color:#f0997b; }
.swr-sub-fine{ color:var(--card-meta); font-size:.78rem; line-height:1.5;
  margin:16px auto 0; max-width:40ch; }
.swr-sub-fine a{ color:var(--accent); text-decoration:none; border-bottom:1px solid transparent; }
.swr-sub-fine a:hover{ border-color:var(--accent); }
