/* Smanck — tokens tirés du vocabulaire du tableau : fond de tableau, carte, colonne, catégorie done. */
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/fonts/schibsted-grotesk-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/fonts/schibsted-grotesk-latin-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url("/assets/fonts/martian-mono-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --tableau: #0f1211;          /* fond de page : le tableau */
  --colonne: #141817;          /* fond d'une colonne */
  --carte: #1b201e;            /* fond d'une carte */
  --carte-haute: #222826;
  --encre: #ecefe9;            /* texte principal */
  --encre-douce: #b4bcb6;      /* texte secondaire */
  --encre-pale: #8d968f;       /* métadonnées */
  --filet: #2a302d;
  --filet-fort: #3b433f;
  --done: #5fd38d;             /* accent : la catégorie done */
  --done-fond: rgba(95, 211, 141, .1);
  --sur-done: #0b1410;         /* texte posé sur l'accent */
  --bot: #9db7ff;              /* repère des comptes bot */
  --bot-fond: rgba(157, 183, 255, .12);
  --en-cours: #e3c565;         /* pastille in progress */
  --a-faire: #8d968f;          /* pastille to do */

  --police: "Schibsted Grotesk", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --police-mono: "Martian Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --marge: clamp(18px, 4.5vw, 64px);
  --largeur: 1280px;
  --mesure: 64ch;
  --rayon: 10px;
  --rayon-carte: 8px;

  --corps: clamp(17px, 1.05vw + 12px, 19px);
  --chapo: clamp(19px, 1.2vw + 13px, 23px);
  --h1: clamp(40px, 5.4vw + 12px, 84px);
  --h2: clamp(29px, 2.6vw + 14px, 48px);
  --etiquette: 13px;
  --courbe: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--tableau); color: var(--encre); scroll-padding-top: 88px; overflow-x: clip; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--police); font-size: var(--corps); line-height: 1.6; background: var(--tableau); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--done); }
:focus-visible { outline: 2px solid var(--done); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--done); color: var(--sur-done); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.022em; text-wrap: balance; }
p { margin: 0; }
code, .mono { font-family: var(--police-mono); }
code, .section__corps b { font-family: var(--police-mono); font-weight: 400; font-size: .82em; padding: .1em .35em; border-radius: 4px; background: var(--carte); border: 1px solid var(--filet); white-space: nowrap; }
.mono { font-size: var(--etiquette); letter-spacing: .01em; line-height: 1.5; }
[hidden] { display: none !important; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.evitement { position: fixed; top: 12px; left: 12px; z-index: 50; padding: 12px 16px; background: var(--done); color: var(--sur-done); font-weight: 700; border-radius: 6px; transform: translateY(-200%); }
.evitement:focus { transform: none; color: var(--sur-done); }

/* ---------- Boutons ---------- */
.bouton { display: inline-flex; align-items: center; gap: .5em; min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--done); color: var(--sur-done); font: inherit; font-size: 17px; font-weight: 650; text-decoration: none; cursor: pointer; transition: background .2s var(--courbe), transform .2s var(--courbe); }
.bouton:hover { background: #7fe0a5; color: var(--sur-done); }
.bouton:active { transform: translateY(1px); }
.bouton[disabled] { opacity: .6; cursor: progress; }
.bouton--petit { min-height: 40px; padding: 0 16px; font-size: 15px; }
.note { color: var(--encre-pale); font-size: 15px; }
.note a { color: var(--encre-douce); }

/* ---------- Bandeau ---------- */
.bandeau { position: sticky; top: 0; z-index: 20; background: rgba(15, 18, 17, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--filet); }
.bandeau__ligne { max-width: var(--largeur); margin: 0 auto; padding: 12px var(--marge); display: flex; align-items: center; gap: 28px; }
.marque { display: inline-flex; align-items: center; gap: 8px; color: var(--encre); text-decoration: none; font-weight: 750; font-size: 21px; letter-spacing: -.03em; }
.marque:hover { color: var(--encre); }
.marque__signe { width: 30px; height: 30px; color: var(--done); }
.bandeau__nav { display: flex; gap: 24px; margin-right: auto; font-size: 15px; }
.bandeau__nav a { color: var(--encre-douce); text-decoration: none; }
.bandeau__nav a:hover { color: var(--encre); }
.bandeau__actions { display: flex; align-items: center; gap: 14px; }
.langue { font-family: var(--police-mono); font-size: 12px; color: var(--encre-douce); text-decoration: none; padding: 8px 6px; }

/* ---------- Mise en page générale ---------- */
.cle { color: var(--encre-pale); }
.chapo { font-size: var(--chapo); line-height: 1.5; color: var(--encre-douce); max-width: 46ch; }
.section { max-width: var(--largeur); margin: 0 auto; padding: clamp(72px, 9vw, 136px) var(--marge) 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.section > .cle { grid-column: 1 / span 3; padding-top: 14px; border-top: 1px solid var(--filet); }
.section__corps { grid-column: 4 / span 8; padding-top: 14px; border-top: 1px solid var(--filet); }
.section__corps > * + * { margin-top: 28px; }
.section__corps h2 { font-size: var(--h2); line-height: 1.08; max-width: 22ch; }
.section__corps > p { max-width: var(--mesure); color: var(--encre-douce); }
.section__corps > p.chapo { color: var(--encre-douce); }
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; color: var(--encre-douce); }

/* Champs : la page reprend les champs d'un ticket */
.champs { margin-inline: 0; margin-bottom: 0; display: grid; border-top: 1px solid var(--filet); }
.champs > div { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--filet); }
.champs dt { color: var(--done); padding-top: 4px; }
.champs dd { margin: 0; color: var(--encre-douce); max-width: 58ch; }
.champs--serre > div { grid-template-columns: 70px 1fr; padding: 12px 0; font-size: 16px; }

/* ---------- Ouverture : le tableau et le ticket ---------- */
.ouverture { max-width: var(--largeur); margin: 0 auto; padding: clamp(48px, 7vw, 104px) var(--marge) 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 56px; }
.ouverture__texte { grid-column: 1 / span 9; display: grid; gap: 26px; }
.ouverture h1 { font-size: var(--h1); line-height: 1.0; letter-spacing: -.038em; font-weight: 700; max-width: 15ch; }
.ouverture__action { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.planche { grid-column: 1 / -1; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; }
.planche__tableau { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 12px; background: var(--colonne); border: 1px solid var(--filet); border-radius: var(--rayon); }
.colonne { display: flex; flex-direction: column; gap: 8px; padding: 6px; border-radius: var(--rayon-carte); }
.colonne__nom { display: flex; align-items: center; gap: 8px; padding: 4px 4px 8px; font-size: 14px; font-weight: 600; color: var(--encre-douce); }
.colonne__compte { margin-left: auto; font-family: var(--police-mono); font-size: 11px; color: var(--encre-pale); }
.pastille { width: 8px; height: 8px; border-radius: 50%; background: var(--a-faire); flex: none; }
.colonne--cours .pastille { background: var(--en-cours); }
.colonne--revue .pastille { background: var(--bot); }
.colonne--fait .pastille { background: var(--done); }
.carte { display: grid; gap: 8px; padding: 12px; background: var(--carte); border: 1px solid var(--filet); border-radius: var(--rayon-carte); }
.carte__cle { color: var(--encre-pale); font-size: 11px; }
.carte__titre { font-size: 15px; line-height: 1.35; font-weight: 550; }
.carte__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.carte__meta .mono { font-size: 11px; color: var(--encre-pale); }
.carte--active { border-color: var(--filet-fort); background: var(--carte-haute); box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .9); }
.carte--faite .carte__titre { color: var(--encre-pale); }
.assigne { margin-left: auto; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--carte-haute); color: var(--encre-douce); border: 1px solid var(--filet); }
.assigne--bot { color: var(--bot); background: var(--bot-fond); border-color: rgba(157, 183, 255, .3); }

.fil { display: flex; flex-direction: column; background: var(--colonne); border: 1px solid var(--filet); border-radius: var(--rayon); overflow: hidden; }
.fil__entete { padding: 12px 16px; border-bottom: 1px solid var(--filet); font-size: 14px; font-weight: 600; color: var(--encre-douce); }
.fil__entete .mono { color: var(--encre); margin-right: 6px; }
.fil__messages { list-style: none; margin: 0; padding: 8px 0; display: grid; }
.message { display: grid; gap: 4px; padding: 10px 16px; font-size: 15px; line-height: 1.45; color: var(--encre-douce); }
.message__auteur { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 650; color: var(--encre); font-size: 14px; }
.message__auteur .mono { font-weight: 400; font-size: 11px; color: var(--encre-pale); }
.message--bot { border-left: 2px solid var(--bot); background: linear-gradient(90deg, var(--bot-fond), transparent 70%); }
.message--systeme { border-left: 2px solid var(--done); background: linear-gradient(90deg, var(--done-fond), transparent 70%); }
.message--systeme .message__auteur { color: var(--done); }
.badge { font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 4px; color: var(--bot); border: 1px solid rgba(157, 183, 255, .4); line-height: 1.6; }
.mention { color: var(--bot); }
.ref { font-size: .82em; color: var(--encre); border-bottom: 1px dotted var(--encre-pale); }
.legende { grid-column: 1 / -1; color: var(--encre-pale); font-size: 12px; }

/* ---------- MCP ---------- */
.transcription { border: 1px solid var(--filet); border-radius: var(--rayon); background: #0b0d0c; overflow: hidden; max-width: 640px; }
.transcription__titre { padding: 10px 16px; border-bottom: 1px solid var(--filet); color: var(--encre-pale); }
.transcription pre { margin: 0; padding: 18px 16px; overflow-x: auto; font-family: var(--police-mono); font-size: 13px; line-height: 1.7; color: var(--encre); }
.transcription code { all: unset; font: inherit; white-space: pre; }
.transcription .c { color: var(--encre-pale); }
.outils { display: flex; flex-wrap: wrap; gap: 8px; max-width: 640px; }
.outils span { padding: 4px 10px; border: 1px solid var(--filet); border-radius: 999px; color: var(--encre-douce); font-size: 12px; }

/* ---------- Méthode : échelle de Fibonacci ---------- */
.echelle { margin-left: 0; margin-right: 0; display: grid; gap: 14px; }
.echelle__points { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; max-width: 640px; }
.echelle__points li { display: grid; place-items: center; aspect-ratio: 3 / 4; border-radius: var(--rayon-carte); background: var(--carte); border: 1px solid var(--filet); font-family: var(--police-mono); font-size: clamp(14px, 1.6vw, 20px); color: var(--encre); }
.echelle__points .echelle__alerte { border-style: dashed; border-color: var(--en-cours); color: var(--en-cours); background: transparent; }
.echelle figcaption { color: var(--encre-pale); font-size: 15px; max-width: 60ch; }

/* ---------- Périmètre ---------- */
.perimetre { overflow-x: auto; }
.perimetre table { width: 100%; border-collapse: collapse; font-size: 17px; }
.perimetre th { text-align: left; font-family: var(--police-mono); font-size: var(--etiquette); font-weight: 400; padding: 0 16px 12px 0; color: var(--done); border-bottom: 1px solid var(--filet-fort); }
.perimetre th + th { color: var(--encre-pale); }
.perimetre td { padding: 13px 16px 13px 0; border-bottom: 1px solid var(--filet); vertical-align: top; color: var(--encre); width: 50%; }
.perimetre td + td { color: var(--encre-pale); text-decoration: line-through; text-decoration-color: var(--filet-fort); }

/* ---------- Accès ---------- */
.etapes { list-style: none; margin-inline: 0; margin-bottom: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--filet); }
.etapes li { display: grid; align-content: start; gap: 10px; padding: 18px 18px 18px 0; color: var(--encre-douce); font-size: 16px; }
.etapes li + li { padding-left: 18px; border-left: 1px solid var(--filet); }
.etapes strong { display: block; color: var(--encre); font-weight: 650; margin-bottom: 4px; }
.etapes__etat { color: var(--encre-pale); }
.etapes li:last-child .etapes__etat { color: var(--done); }
.acces__action { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }

/* ---------- Demande d'accès ---------- */
.demande { max-width: var(--largeur); margin: 0 auto; padding: clamp(48px, 7vw, 96px) var(--marge) 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 48px; align-items: start; }
.demande__intro { grid-column: 1 / span 5; display: grid; gap: 24px; position: sticky; top: 100px; }
.demande__intro h1 { font-size: clamp(38px, 3.6vw + 12px, 64px); line-height: 1.02; letter-spacing: -.035em; font-weight: 700; }
.demande__formulaire { grid-column: 7 / span 6; }
.formulaire, .recu { display: grid; gap: 20px; padding: clamp(20px, 3vw, 36px); background: var(--colonne); border: 1px solid var(--filet); border-radius: var(--rayon); }
.champ { display: grid; gap: 8px; }
.champ label { font-size: 15px; font-weight: 600; }
.facultatif { font-weight: 400; color: var(--encre-pale); font-size: 13px; margin-left: 4px; }
.champ input, .champ select, .champ textarea { width: 100%; min-height: 48px; padding: 11px 14px; font: inherit; font-size: 17px; color: var(--encre); background: var(--tableau); border: 1px solid var(--filet-fort); border-radius: 8px; }
.champ textarea { resize: vertical; min-height: 128px; line-height: 1.5; }
.champ select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--encre-pale) 50%), linear-gradient(135deg, var(--encre-pale) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: none; border-color: var(--done); box-shadow: 0 0 0 3px var(--done-fond); }
.champ [aria-invalid="true"] { border-color: #ff9a8a; }
.champ--piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.formulaire__erreur { padding: 12px 14px; border-radius: 8px; border: 1px solid rgba(255, 154, 138, .45); background: rgba(255, 154, 138, .08); color: #ffc2b8; font-size: 15px; }
.formulaire .bouton { justify-self: start; }
.recu h2 { font-size: clamp(26px, 2vw + 14px, 36px); line-height: 1.1; }
.recu p { color: var(--encre-douce); }
.recu__etat { display: flex; align-items: center; gap: 8px; color: var(--bot); }
.recu__etat .pastille { background: var(--bot); }
.questions { display: grid; gap: 10px; max-width: var(--mesure); }
.questions h3 { font-size: 21px; margin-top: 20px; }
.questions h3:first-child { margin-top: 0; }
.questions p { color: var(--encre-douce); }

/* ---------- Pages légales et 404 ---------- */
.texte-legal { max-width: calc(var(--mesure) + 2 * var(--marge)); margin: 0 auto; padding: clamp(48px, 7vw, 96px) var(--marge) 0; }
.texte-legal h1 { font-size: clamp(36px, 3vw + 14px, 56px); line-height: 1.05; margin-bottom: 32px; }
.texte-legal h2 { font-size: 22px; margin: 40px 0 12px; }
.texte-legal p { color: var(--encre-douce); }
.texte-legal p + p { margin-top: 14px; }
.introuvable { max-width: var(--largeur); margin: 0 auto; padding: clamp(64px, 10vw, 160px) var(--marge) 0; display: grid; gap: 24px; justify-items: start; }
.introuvable h1 { font-size: var(--h2); max-width: 18ch; }

/* ---------- Pied ---------- */
.pied { max-width: var(--largeur); margin: clamp(96px, 12vw, 168px) auto 0; padding: 0 var(--marge) 40px; }
.pied__ligne { padding-top: 32px; border-top: 1px solid var(--filet); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 28px; }
.pied__marque { grid-column: 1 / span 5; display: grid; gap: 12px; }
.pied__marque p { color: var(--encre-pale); font-size: 15px; max-width: 34ch; }
.pied__nav { grid-column: 7 / span 3; display: grid; gap: 8px; font-size: 15px; align-content: start; }
.pied__nav a { color: var(--encre-douce); text-decoration: none; }
.pied__nav a:hover { color: var(--encre); }
.pied__maison { grid-column: 10 / span 3; font-size: 15px; color: var(--encre-pale); }
.pied__maison a { color: var(--encre-douce); }
.pied__an { margin-top: 36px; color: var(--encre-pale); font-size: 12px; }

/* ---------- Mouvement signature : la carte change de colonne ---------- */
.planche.est-joue [data-message-systeme] { animation: arrivee .5s var(--courbe) both; animation-delay: .7s; }
.planche.est-joue [data-carte] { animation: glisse 1.1s var(--courbe) both; animation-delay: 1.4s; }
.planche.est-joue .colonne--revue { animation: halo 1.6s ease-out both; animation-delay: 2.1s; }
@keyframes arrivee { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes glisse { from { transform: translateX(var(--depart-x, -100%)); } to { transform: none; } }
@keyframes halo { 0% { background: var(--done-fond); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) {
  .planche.est-joue [data-message-systeme], .planche.est-joue [data-carte], .planche.est-joue .colonne--revue { animation: none; }
  .bouton { transition: none; }
}

/* ---------- Tablette ---------- */
@media (max-width: 1080px) {
  .planche { grid-template-columns: 1fr; }
  .fil { max-width: 560px; }
  .section > .cle { grid-column: 1 / -1; border-top: 0; padding-top: 0; margin-bottom: 10px; }
  .section__corps { grid-column: 1 / -1; }
  .etapes { grid-template-columns: 1fr 1fr; }
  .etapes li:nth-child(3) { padding-left: 0; border-left: 0; }
  .etapes li:nth-child(n + 3) { border-top: 1px solid var(--filet); }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .bandeau__nav { display: none; }
  .bandeau__ligne { gap: 12px; justify-content: space-between; }
  .ouverture__texte { grid-column: 1 / -1; }
  .ouverture h1 { max-width: none; }
  .planche__tableau { grid-template-columns: 1fr 1fr; padding: 8px; gap: 6px; }
  .colonne--todo, .colonne--fait { display: none; }
  .colonne { min-height: 0; padding: 4px; }
  .carte { padding: 10px; }
  .assigne { margin-left: 0; }
  .deux-colonnes { grid-template-columns: 1fr; gap: 20px; }
  .champs > div { grid-template-columns: 1fr; gap: 4px; }
  .champs--serre > div { grid-template-columns: 1fr; }
  .etapes { grid-template-columns: 1fr; }
  .etapes li, .etapes li + li { padding: 16px 0; border-left: 0; }
  .etapes li + li { border-top: 1px solid var(--filet); }
  .echelle__points { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .demande__intro, .demande__formulaire { grid-column: 1 / -1; position: static; }
  .pied__marque, .pied__nav, .pied__maison { grid-column: 1 / -1; }
  .perimetre table { font-size: 15px; }
}
@media (max-width: 420px) {
  .bandeau .bouton--petit { padding: 0 12px; font-size: 14px; }
  .marque { font-size: 19px; }
}
