:root{
  --bg:#fff;
  --fg:#0b0b0b;
  --muted:#5a5a5a;
  --line:#0b0b0b;
  --soft:#d9d9d9;

  --w:920px;
  --pad:18px;

  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  --b:2px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  background:var(--bg);
  color:var(--fg);
  font-family:var(--sans);
  line-height:1.25;
}

.wrap{
  max-width:var(--w);
  margin:0 auto;
  padding:28px var(--pad) 60px;
  display:grid;
  gap:18px;
}

/* Header */
.site-header{
  border-top:var(--b) solid var(--line);
  border-bottom:var(--b) solid var(--line);
  padding:16px 0;
  display:grid;
  gap:10px;
}

.top{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
  font-family:var(--mono);
  font-size:14px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
}

.brand{
  display:flex;
  align-items:baseline;
  gap:10px;
  min-width:0;
}
.brand-link{ display:inline-flex; align-items:baseline; }

.logo-inline{
  height:22px;
  width:auto;
  display:block;
}

.brand span{ white-space:nowrap; }

.right{
  display:flex;
  align-items:baseline;
  gap:12px;
}

/* Title */
h1{
  margin:0;
  font-size:56px;
  letter-spacing:-0.06em;
  line-height:0.92;
  text-transform:lowercase;
  font-weight:900;
  color:var(--fg);
}

/* Bio */
.bio{
  margin:0;
  max-width:70ch;
  color:var(--muted);
  font-size:14px;
}
/* =========================
   Liens texte (hors cartes)
   ========================= */

/* 1) Reset propre uniquement pour les liens "texte" */
a.link,
a.section-link{
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* évite le violet "visited" */
a.link:visited,
a.section-link:visited{
  color: var(--muted);
}

/* 2) Hover / focus */
a.link:hover,
a.section-link:hover{
  color: var(--fg);
  text-decoration: underline;
  text-decoration-thickness: var(--b);
  text-underline-offset: .22em;
}

a.link:focus-visible,
a.section-link:focus-visible{
  outline: 3px solid var(--line);
  outline-offset: 3px;
}

/* 3) Liens de section (titre cliquable + flèche) */
a.section-link{
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

a.section-link strong{
  color: var(--fg);        /* le mot "art/web/éditions" ressort */
  font-weight: 800;
}

/* 4) Option : un lien "discret" sous le texte d'intro */
a.link--quiet{
  color: var(--muted);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
}

a.link--quiet:hover{
  color: var(--fg);
  text-decoration-thickness: var(--b);
}


a.row{ text-decoration: none; }
/* List links */
.list{
  border:var(--b) solid var(--line);
  padding:0;
  margin:0;
  list-style:none;
}

.item{ border-top:var(--b) solid var(--soft); }
.item:first-child{ border-top:none; }

a.row{
  display:grid;
  grid-template-columns: 44px 1fr auto;
  gap:12px;
  align-items:center;
  padding:14px 14px;
  color:var(--fg);
  text-decoration:none;
  background:transparent;
}
/* bouton retour (carré + flèche) */
.back-btn{
  display:inline-grid;
  place-items:center;
  width:28px;
  height:28px;

  border: var(--b) solid var(--line);
  color: var(--fg);
  background: transparent;

  font-family: var(--mono);
  font-size: 14px;
  line-height: 1;
  text-decoration: none;

  margin-right: 10px; /* espace avant HUB/CONTACT */
}

/* évite le violet */
.back-btn:visited{
  color: var(--fg);
}

/* feedback */
.back-btn:hover{
  background: var(--fg);
  color: var(--bg);
}

.back-btn:focus-visible{
  outline: 3px solid var(--line);
  outline-offset: 3px;
}
.n{
  font-family:var(--mono);
  font-size:12px;
  color:var(--muted);
  align-self: start;
  padding-top: 2px; 
}

.main{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.title{
  font-weight:800;
  letter-spacing:-0.01em;
  text-transform:lowercase;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.desc{
  font-family:var(--mono);
  font-size:14px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.go{
  font-family:var(--mono);
  font-size:14px;
  letter-spacing:.08em;
  text-transform:uppercase;
  border:var(--b) solid var(--line);
  padding:6px 10px;
  background:transparent;
  white-space:nowrap;
}

/* Hover uniquement sur devices “desktop” */
@media (hover:hover) and (pointer:fine){
  a.row:hover{
    background: var(--fg);
    color: var(--bg);
  }

  a.row:hover .desc,
  a.row:hover .n{
    color: currentColor;
    opacity: .8;
  }

  a.row:hover .go{
    border-color: currentColor;
    color: currentColor;
    background: transparent;
  }
}

/* Feedback tactile léger (optionnel) */
a.row:active{
  opacity: .92;
}

/* On garde le focus comme avant */
a.row:focus{
  outline:3px solid var(--line);
  outline-offset:3px;
}

/* Naive block */
.naif{
  border-top:var(--b) solid var(--line);
  padding-top:14px;
  display:grid;
  gap:10px;
}
.naif img{
  width:100%;
  height:auto;
  display:block;
  filter: contrast(1.2) saturate(0);
}

/* Footer */
.site-footer{
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  font-family:var(--mono);
  font-size:12px;
  color:var(--muted);
  margin-top:6px;
  border-top:var(--b) solid var(--soft);
  padding-top:12px;
}

/* Toggle theme button */
.theme-toggle{
  border:0;
  background:transparent;
  padding:0;
  cursor:pointer;
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  color: var(--fg);
}

.theme-toggle .icon{
  width:26px;
  height:26px;
  display:block;
}

/* Force absolue : évite les couleurs “bizarres” */
.theme-toggle .icon *{
  stroke: currentColor !important;
  fill: none !important;
  vector-effect: non-scaling-stroke;
}

/* Switch soleil/lune (scopé au bouton, fiable) */
.theme-toggle .icon-sun{ display:none; }
.theme-toggle .icon-moon{ display:block; }
html[data-theme="dark"] .theme-toggle .icon-moon{ display:none; }
html[data-theme="dark"] .theme-toggle .icon-sun{ display:block; }

/* iPad : évite le hover collant qui inverse les couleurs */
.theme-toggle:hover{
  background: transparent;
  color: var(--fg);
}

.theme-toggle:focus{
  outline:3px solid var(--line);
  outline-offset:3px;
}

/* Dark mode */
html[data-theme="dark"]{
  --bg:#0b0b0b;
  --fg:#f2f2ee;
  --muted:#b9b9b9;
  --line:#f2f2ee;
  --soft:#333333;
}

html[data-theme="dark"] .logo-inline{
  filter: invert(1);
}

/* Inverser uniquement l’illustration (pas tout le bloc) */
html[data-theme="dark"] .naif img{
  filter: invert(1) contrast(1.2) saturate(0);
}

@media (max-width:620px){
  h1{ font-size:44px; }
  .go{ display:none; }
  a.row{ grid-template-columns: 36px 1fr; }
  .top{ align-items:flex-start; }
}
/* Sections (barres au-dessus des cartes) */
.section{
  display:grid;
  gap:10px;
  margin-top:6px;
}

.section-head{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:12px;
  font-family:var(--mono);
  text-transform:uppercase;
  letter-spacing:.12em;
  font-size:14px;
  color:var(--muted);
}
.section-tags{
  margin-left:auto;
  text-align:right;
  white-space:nowrap;
}
.section-head > span{
  white-space:nowrap;
}
/* =========================
   Projets web (grille)
   ========================= */

.projects{
  margin: 0;
  padding: 0;
  list-style: none;

  display: grid;
  gap: 18px;
}

.project-card{
  display: grid;
  gap: 12px;

  border: var(--b) solid var(--line);
  padding: 14px;

  color: var(--fg);
  text-decoration: none;
  background: transparent;
}

.project-card:visited{
  color: inherit;
}

.project-num{
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
}

.project-inner{
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 14px;
  align-items: start;
}

/* capture / animation placeholder */
.project-media{
  border: var(--b) solid var(--soft);
  aspect-ratio: 4 / 3;

  display: grid;
  place-items: center;

  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* texte */
.project-body{
  display: grid;
  gap: 8px;
  min-width: 0;
}

.project-title{
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: lowercase;
  font-size: 18px;
}

.project-meta{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
}

.project-desc{
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 70ch;
}

/* hover cohérent avec tes “cartes” */
.project-card:hover{
  background: var(--fg);
  color: var(--bg);
}
.project-card:hover .project-desc,
.project-card:hover .project-meta,
.project-card:hover .project-num{
  color: rgba(255,255,255,0.8);
}
.project-card:hover .project-media{
  border-color: var(--bg);
  color: rgba(255,255,255,0.8);
}
.project-card:hover .go{
  border-color: var(--bg);
  color: var(--bg);
}
/* bouton projet : pas full width */
.project .go,
.project a.go{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;          /* <= clé */
  max-width: 220px;            /* ajuste : 180–260 */
  padding: 8px 14px;
}

/* si ton layout force la largeur, on neutralise */
.project .actions{
  display: flex;
  gap: 12px;
}

.project .actions .go{
  flex: 0 0 auto;              /* <= empêche l’étirement */
}
/* Projets : empêche le bouton (.go) de s'étirer en largeur dans la grille */
.project-card .go{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;   /* <= clé : stop le "stretch" de grid */
  width: auto;           /* pas de 100% */
}

/* (optionnel) si tu veux un bouton un peu plus "compact" */
.project-card .go{
  padding: 6px 10px;
}
/* Donne le même padding aux rows non cliquables */
.row{
  padding: 14px 14px;
}
.row{
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
}
/* Mobile : capture AVANT le texte, numéro au-dessus reste */
@media (max-width: 620px){
  .project-inner{
    grid-template-columns: 1fr;
  }
}
@media (max-width:620px){
  .title,
  .desc{
    white-space: normal;      /* autorise plusieurs lignes */
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;  /* évite les coupures moches */
    hyphens: auto;}
  .section-tags{
	  visibility: hidden;
  }
  }

  /* optionnel : un peu plus d’air */
  .main{ gap: 8px; }
}
/* --- Livres : version “mini” du composant projets (cover vertical) --- */
/* Livres : même tableau que projets web, mais cover verticale */
.project-row--book .project-inner{
  grid-template-columns: 160px 1fr;
}

.project-media--book{
  aspect-ratio: 2 / 3;
}

/* si tu mets une <img> dans .project-media */
.project-media img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}

@media (max-width:620px){
  .project-row--book .project-inner{
    grid-template-columns: 1fr;
  }

  /* optionnel : éviter une cover trop large en mobile */
  .project-media--book{
    max-width: 260px;
  }
}
.project-card--mini{
  padding: 12px;
}

.project-inner--mini{
  grid-template-columns: 160px 1fr; /* mini colonne cover */
  gap: 12px;
}

.project-media--mini{
  aspect-ratio: 3 / 4;   /* cover vertical */
  overflow: hidden;
}

.project-media--mini img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* mobile : image au-dessus du texte (tu as déjà project-inner -> 1fr, on assure ici aussi) */
@media (max-width: 620px){
  .project-inner--mini{
    grid-template-columns: 1fr;
  }
}