/* Le site vitrine d'Ecomify (ecomify.cc). De la famille du « quai de nuit » de la page de connexion :
   l'Encre, la grille isométrique du logo, le symbole irisé avec son grain, Geist et Geist Mono.
   Aucun script, aucune ressource externe : tout est servi par le site (voir _headers). */

@font-face {
  font-family: "Geist";
  src: url("/polices/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/polices/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }

:root {
  --encre: #1A1A1A;
  --craie: #F1F1F1;
  --blanc: #FFFFFF;
  /* Sur l'Encre */
  --nuit-texte: rgb(255 255 255 / .9);
  --nuit-doux: rgb(255 255 255 / .66);
  --nuit-pale: rgb(255 255 255 / .56);
  --nuit-trait: rgb(255 255 255 / .14);
  /* Sur la Craie */
  --jour-doux: #4A4A4A;
  --jour-pale: #636363;
  --jour-trait: rgb(26 26 26 / .14);
  /* L'Irisé, toujours avec son grain (GUIDE.md § 4) */
  --iri: linear-gradient(115deg, #FF7CC8 0%, #C08CFF 38%, #7FA8FF 70%, #6FDDF2 100%);
  --grain: url("/marque/grain.svg");
  --f: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --marge: 56px;
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  font: 400 16px/1.55 var(--f);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" 0;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }

/* Les étiquettes du bordereau : Geist Mono, capitales espacées, posées dans les coins */
.etiquette {
  margin: 0;
  font: 500 11.5px/1.4 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.etiquette span + span {
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid currentColor;
  border-left-color: color-mix(in srgb, currentColor 35%, transparent);
}

/* Aller au contenu : visible seulement au clavier */
.evitement {
  position: absolute; z-index: 20; left: 16px; top: -80px;
  padding: 10px 16px; border-radius: 10px;
  background: var(--blanc); color: var(--encre);
  font-weight: 600; text-decoration: none;
}
.evitement:focus { top: 16px; }

/* Le focus clavier : l'Azur sur l'Encre, l'Encre sur la Craie */
:focus-visible { outline: 3px solid #7FA8FF; outline-offset: 3px; border-radius: 6px; }
.papier :focus-visible { outline-color: var(--encre); }

/* La grille de construction : des points sur un réseau à 30° (comme la page de connexion) */
.grille {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(circle, rgb(255 255 255 / .09) 1.3px, transparent 1.6px),
    radial-gradient(circle, rgb(255 255 255 / .09) 1.3px, transparent 1.6px);
  background-size: 28px 48.5px;
  background-position: 0 0, 14px 24.25px;
}

/* Le logo */
.logo { display: inline-block; border-radius: 4px; }
.logo img { height: 22px; width: auto; }

/* Le bouton irisé, avec son grain ; le texte en Encre (GUIDE.md : sur l'Irisé, jamais de blanc) */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 54px; padding: 0 22px 0 26px; border-radius: 14px;
  font: 600 16px/1 var(--f); letter-spacing: -0.01em; text-decoration: none;
  color: var(--encre);
  background-image: var(--grain), var(--iri);
  background-size: 240px 240px, 100% 100%;
  background-blend-mode: soft-light, normal;
  transition: transform .15s ease;
}
.bouton svg { width: 18px; height: 18px; transition: transform .15s ease; }
.bouton:hover svg { transform: translateX(3px); }
.bouton:active { transform: scale(.985); }

/* ————————————————————————————————————————— l'accueil : le quai de nuit ————————————————— */

.quai {
  position: relative;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  overflow-x: hidden;
  background: var(--encre); color: var(--blanc);
}
.quai .grille { position: fixed; }

/* Le symbole immense, qui déborde en bas à droite ; il se pose une fois, à l'arrivée */
.quai .symbole {
  position: fixed; z-index: 0; pointer-events: none;
  width: min(66vw, 112vh, 940px); height: auto; aspect-ratio: 1;
  right: max(-14vw, -220px); bottom: min(-16vh, -110px);
  animation: poser 1.1s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes poser { from { opacity: 0; transform: translate(4%, 6%) scale(.97); } }

.haut {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 40px var(--marge) 0;
}
.haut .etiquette { color: var(--nuit-pale); }

.accueil {
  position: relative; z-index: 2; flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  padding: 72px var(--marge) 56px;
}
.accueil .etiquette { color: var(--nuit-doux); }
.accueil h1 {
  margin: 18px 0 0; max-width: 12.5ch;
  font-size: clamp(42px, 6.4vw, 88px); line-height: .98; font-weight: 600; letter-spacing: -0.048em;
  text-wrap: balance;
}
.accueil .intro {
  margin: 24px 0 34px; max-width: 44ch;
  color: var(--nuit-doux); font-size: clamp(17px, 1.45vw, 20px); line-height: 1.5;
  text-wrap: pretty;
}
.accueil .note {
  margin: 16px 0 0; max-width: 46ch;
  color: var(--nuit-pale); font-size: 14px; line-height: 1.5;
}
.accueil .note a { color: var(--nuit-texte); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.accueil .note a:hover { color: var(--blanc); }

/* Les quatre gestes, en bordereau : une bande à cases, comme une étiquette d'expédition */
.bordereau {
  list-style: none; margin: 64px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1080px;
  border: 1px solid var(--nuit-trait); border-radius: 16px; overflow: hidden;
  background: rgb(26 26 26 / .74);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.bordereau li { padding: 20px 22px 24px; }
.bordereau li + li { border-left: 1px solid var(--nuit-trait); }
.bordereau .etiquette { color: var(--nuit-pale); }
.bordereau h2 { margin: 14px 0 6px; font-size: 19px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
.bordereau p { margin: 0; color: var(--nuit-doux); font-size: 14.5px; line-height: 1.5; text-wrap: pretty; }

/* ————————————————————————————————————————— les documents : bandeau de nuit, papier de jour ——— */

.doc { background: var(--craie); color: var(--encre); }

.bandeau {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--encre); color: var(--blanc);
}
.bandeau .symbole {
  position: absolute; z-index: 0; pointer-events: none;
  width: min(48vw, 600px); height: auto; aspect-ratio: 1;
  right: -7%; top: -38%;
}
.bandeau .haut { padding-top: 32px; }
.bandeau .titre {
  position: relative; z-index: 1;
  max-width: 980px; padding: 72px var(--marge) 64px;
}
.bandeau .titre .etiquette { color: var(--nuit-doux); }
.bandeau h1 {
  margin: 18px 0 0; max-width: 16ch;
  font-size: clamp(38px, 5.2vw, 66px); line-height: 1.02; font-weight: 600; letter-spacing: -0.045em;
  text-wrap: balance;
}
.bandeau .chapeau {
  margin: 18px 0 0; max-width: 52ch;
  color: var(--nuit-doux); font-size: 18px; line-height: 1.5; text-wrap: pretty;
}

.langue {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px;
  background: rgb(26 26 26 / .72); color: var(--nuit-texte);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .18);
  font-size: 14px; font-weight: 500; text-decoration: none;
}
.langue:hover { color: var(--blanc); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .36); }

.papier {
  display: grid; grid-template-columns: minmax(180px, 250px) minmax(0, 34rem);
  justify-content: center; gap: 72px;
  padding: 64px var(--marge) 104px;
}

.sommaire { position: sticky; top: 32px; align-self: start; max-height: calc(100vh - 64px); overflow: auto; }
.sommaire .etiquette { color: var(--jour-pale); margin-bottom: 14px; }
.sommaire ol { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.sommaire li { counter-increment: s; }
.sommaire a {
  display: flex; gap: 12px; padding: 5px 0;
  color: var(--jour-doux); font-size: 14px; line-height: 1.4; text-decoration: none;
}
.sommaire a::before {
  content: counter(s, decimal-leading-zero);
  flex: none; width: 2.2em; padding-top: 1px;
  font: 500 11.5px/1.6 var(--mono); letter-spacing: .06em; color: var(--jour-pale);
}
.sommaire a:hover { color: var(--encre); }

.texte { min-width: 0; font-size: 17px; line-height: 1.68; counter-reset: h; }
.texte > :first-child { margin-top: 0; }
.texte h2 {
  counter-increment: h;
  margin: 64px 0 14px; scroll-margin-top: 24px;
  font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -0.025em;
  text-wrap: balance;
}
.texte h2::before {
  content: counter(h, decimal-leading-zero);
  display: block; margin-bottom: 10px;
  font: 500 12px/1 var(--mono); letter-spacing: .12em; color: var(--jour-pale);
}
.texte h3 { margin: 34px 0 8px; font-size: 18.5px; line-height: 1.3; font-weight: 600; letter-spacing: -0.015em; }
.texte p, .texte ul, .texte ol, .texte table { margin: 0 0 16px; }
.texte ul, .texte ol { padding-left: 1.25em; }
.texte li { margin: 6px 0; padding-left: 4px; }
.texte li::marker { color: var(--jour-pale); }
.texte strong { font-weight: 600; }
.texte a {
  color: var(--encre);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
  text-decoration-color: rgb(26 26 26 / .4);
  overflow-wrap: anywhere;
}
.texte a:hover { text-decoration-color: var(--encre); }
.texte code {
  padding: 1px 6px; border-radius: 6px;
  background: rgb(26 26 26 / .06);
  font: 500 .86em/1.4 var(--mono); letter-spacing: 0;
  overflow-wrap: anywhere;
}

/* L'encadré « En bref » : une feuille blanche, une bande irisée en tête */
.bref {
  position: relative; overflow: hidden;
  margin: 0 0 8px; padding: 30px 30px 14px;
  border-radius: 16px; background: var(--blanc);
  box-shadow: inset 0 0 0 1px var(--jour-trait);
}
.bref::before {
  content: ""; position: absolute; inset: 0 0 auto;
  height: 7px;
  background-image: var(--grain), var(--iri);
  background-size: 240px 240px, 100% 100%;
  background-blend-mode: soft-light, normal;
}
.bref .etiquette { color: var(--jour-pale); margin-bottom: 12px; }
.bref ul { padding-left: 1.1em; }

/* Les tableaux (durées, témoins) */
.texte table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.5; }
.texte th {
  padding: 0 16px 10px 0; text-align: left; vertical-align: bottom;
  font: 500 11.5px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--jour-pale);
}
.texte td { padding: 12px 16px 12px 0; border-top: 1px solid var(--jour-trait); vertical-align: top; }
.texte td:last-child, .texte th:last-child { padding-right: 0; }

.fin { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--jour-trait); color: var(--jour-doux); font-size: 15px; }

/* ————————————————————————————————————————— le pied de page ————————————————————————————— */

.pied {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px;
  padding: 26px var(--marge) 30px;
  background: var(--encre); color: var(--nuit-doux);
  border-top: 1px solid var(--nuit-trait);
  font-size: 14px;
}
.quai .pied { background: rgb(26 26 26 / .84); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.pied ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 24px; }
.pied a { text-decoration: none; padding: 4px 0; }
.pied a:hover { color: var(--blanc); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.pied a[aria-current="page"] { color: var(--blanc); }
.pied .etiquette { color: var(--nuit-pale); }

/* ————————————————————————————————————————— la page introuvable ————————————————————————— */

.perdu .accueil h1 { max-width: 8.5ch; }

/* ————————————————————————————————————————— écrans moyens et téléphones ——————————————————— */

@media (max-width: 1080px) {
  .bordereau { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bordereau li:nth-child(3) { border-left: 0; }
  .bordereau li:nth-child(n + 3) { border-top: 1px solid var(--nuit-trait); }
}

@media (max-width: 960px) {
  .papier { grid-template-columns: minmax(0, 34rem); gap: 40px; padding-top: 44px; }
  .sommaire {
    position: static; max-height: none; overflow: visible;
    padding: 20px 22px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--jour-trait);
  }
  .sommaire ol { columns: 2; column-gap: 24px; }
  .sommaire li { break-inside: avoid; }
}

@media (max-width: 720px) {
  :root { --marge: 24px; }
  .haut { padding-top: calc(26px + env(safe-area-inset-top)); }
  .haut .etiquette span:first-child { display: none; }
  .haut .etiquette span:nth-child(2) { margin-left: 0; padding-left: 0; border-left: 0; }
  .accueil { padding-top: 64px; padding-bottom: 40px; justify-content: flex-start; }
  .accueil h1 { font-size: clamp(40px, 11.5vw, 56px); }
  .bouton { width: 100%; }
  .bordereau { grid-template-columns: minmax(0, 1fr); margin-top: 48px; }
  .bordereau li + li { border-left: 0; border-top: 1px solid var(--nuit-trait); }
  .quai .symbole { width: 128vw; right: -54vw; bottom: -12vh; opacity: .5; }
  .bandeau .symbole { width: 92vw; right: -40vw; top: -22%; opacity: .4; }
  .bandeau .titre { padding-top: 56px; padding-bottom: 44px; }
  .bandeau .titre .etiquette span:last-child { display: block; margin: 8px 0 0; padding: 0; border: 0; }
  .bandeau .chapeau { font-size: 17px; }
  .sommaire ol { columns: 1; }
  .texte { font-size: 16.5px; }
  .texte h2 { margin-top: 52px; font-size: 23px; }
  .bref { padding: 26px 22px 10px; }
  /* Les tableaux deviennent des fiches : chaque cellule porte le nom de sa colonne */
  .texte table, .texte tbody, .texte tr, .texte td { display: block; }
  .texte thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .texte tr { padding: 12px 0; border-top: 1px solid var(--jour-trait); }
  .texte td { padding: 2px 0; border: 0; }
  .texte td[data-col]::before {
    content: attr(data-col); display: block; margin-top: 6px;
    font: 500 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--jour-pale);
  }
  .texte td:first-child { font-weight: 600; }
  .texte td:first-child::before { display: none; }
  .pied { padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .quai .symbole { animation: none; }
  .bouton, .bouton svg { transition: none; }
}

/* ————————————————————————————————————————— à l'impression : le texte seul ——————————————— */

@media print {
  .evitement, .grille, .symbole, .sommaire, .pied, .langue { display: none !important; }
  .doc, .bandeau { background: #fff; color: #000; }
  .bandeau .titre { padding: 0 0 16px; }
  .bandeau .titre .etiquette, .bandeau .chapeau { color: #333; }
  .bandeau .haut { padding: 0 0 16px; }
  .bandeau .logo img { content: url("/marque/logo-encre.svg"); }
  .papier { display: block; padding: 0; }
  .texte { font-size: 11pt; }
  .texte a::after { content: " (" attr(href) ")"; font-size: .85em; color: #444; }
  .texte a[href^="#"]::after { content: ""; }
  .bref { box-shadow: inset 0 0 0 1px #999; }
}
