@import url("../fonts/fonts.css");

/* ------------------------------------------------------------------
   z311.xyz — « listing »
   La machine parle en mono (IBM Plex Mono), moi en romain (Newsreader).
   Papier d'imprimante, encre noire, stylo bleu pour les actions,
   rouge pour les statuts et les exclusions.
   ------------------------------------------------------------------ */

:root {
  --paper:   #EFEFE9;
  --band:    #E5E8DE;
  --ink:     #1A1D18;
  --ink-2:   #565B53;
  --rule:    #CBCEC2;
  --rule-2:  #DDDFD5;
  --blue:    #1F44C2;
  --blue-in: #EFEFE9;
  --red:     #A93018;

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --serif: "Newsreader", Iowan Old Style, Palatino, Georgia, serif;

  --gutter: 12.5rem;
  --gap: 3rem;
  --wrap: 68rem;
  --pad: clamp(1.25rem, 5vw, 3rem);

  --t-mono: 0.8125rem;
  --t-body: clamp(1.0625rem, 0.98rem + 0.32vw, 1.1875rem);
  --t-lead: clamp(1.1875rem, 1.08rem + 0.5vw, 1.375rem);
  --t-h2:   clamp(1.5rem, 1.28rem + 1.05vw, 2.125rem);
  --t-h3:   clamp(1.1875rem, 1.12rem + 0.34vw, 1.375rem);
  --t-h1:   clamp(2.125rem, 1.5rem + 3.1vw, 3.875rem);

  --sec-space: clamp(3.5rem, 8vw, 6.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:   #151713;
    --band:    #1D211B;
    --ink:     #E7E8E0;
    --ink-2:   #9AA093;
    --rule:    #363B32;
    --rule-2:  #262A23;
    --blue:    #93AAFF;
    --blue-in: #12140F;
    --red:     #E58D77;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--t-body);
  font-weight: 380;
  line-height: 1.62;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--blue); color: var(--blue-in); }

img { max-width: 100%; height: auto; display: block; }

:where(a):focus-visible,
:where(button):focus-visible,
:where(input, textarea):focus-visible,
:where(label):focus-within {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 1px;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }

.skip {
  position: absolute; left: -9999px; top: 0;
  font-family: var(--mono); font-size: var(--t-mono);
  background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; z-index: 50;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- voix machine : mono ---------- */

.mono, .cmd, .kicker, .tag, .statusbar, .btn, .nav a, .nav__brand, .note, .meta {
  font-family: var(--mono);
  font-feature-settings: "ss01";
}

.cmd {
  font-size: var(--t-mono);
  color: var(--ink-2);
  margin: 0;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.cmd i { font-style: normal; color: var(--blue); margin-right: 0.5ch; }
.cmd b { font-weight: 400; color: var(--ink); }

.caret {
  display: inline-block; width: 0.55em; height: 1.05em;
  background: var(--ink); vertical-align: -0.18em; margin-left: 0.15em;
}
.caret.is-blinking { animation: blink 1.05s steps(1) 3; }
@keyframes blink { 0%,50% { opacity: 1 } 51%,100% { opacity: 0 } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }

.kicker {
  font-size: var(--t-mono);
  color: var(--ink-2);
  letter-spacing: 0.02em;
  margin: 0 0 0.45rem;
}
.note {
  font-size: var(--t-mono);
  color: var(--ink-2);
  margin: 0.9rem 0 0;
}
.note::before { content: "// "; color: var(--rule); }

/* ---------- logo : le nom rendu par la machine ----------
   Des blocs pleins sur cinq lignes ; le line-height sous 1 est ce qui
   soude les lignes en aplats. Il tient lieu de wordmark dans l'en-tête. */

.logo {
  font-family: var(--mono);
  font-size: 0.4375rem;
  line-height: 0.8;
  letter-spacing: 0;
  color: var(--ink);
  white-space: pre;
  margin: 0;
  font-weight: 400;
  transition: color .18s ease;
}
@media (min-width: 40rem) { .logo { font-size: 0.5rem; } }
@media (prefers-reduced-motion: reduce) { .logo { transition: none; } }

/* ---------- en-tête ---------- */

.head {
  border-bottom: 1px solid var(--rule);
}
.head .wrap {
  display: flex; align-items: center; gap: 0.9rem 2rem;
  flex-wrap: wrap;
  padding-block: 1.05rem;
}
.nav__brand {
  display: flex; align-items: flex-end; gap: 0.35rem;
  text-decoration: none; margin-right: auto;
}
.nav__proto {
  font-family: var(--mono); font-size: 0.6875rem; line-height: 1;
  color: var(--ink-2); padding-bottom: 0.05rem;
}
.nav__brand:hover .logo, .nav__brand:focus-visible .logo { color: var(--blue); }
.nav { display: flex; gap: 1.35rem; flex-wrap: wrap; }
.nav a {
  font-size: var(--t-mono); color: var(--ink-2); text-decoration: none;
  padding-bottom: 0.15rem; border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--rule); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- sections : gouttière + corps ---------- */

.sec { padding-block: var(--sec-space); border-top: 1px solid var(--rule-2); }
.sec:first-of-type { border-top: 0; }
.sec > .wrap { display: grid; gap: 1.1rem var(--gap); }

@media (min-width: 62rem) {
  .sec > .wrap { grid-template-columns: var(--gutter) minmax(0, 1fr); }
  .sec__gutter { position: sticky; top: 1.75rem; align-self: start; }
}

.sec__body > * + * { margin-top: 1.15rem; }
.prose { max-width: 40rem; }
.prose p { margin: 0; }
.prose p + p { margin-top: 1.05rem; }

h1, h2, h3 { font-weight: 420; letter-spacing: -0.025em; line-height: 1.12; margin: 0; }
h1 { font-size: var(--t-h1); line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); line-height: 1.2; }
.lead { font-size: var(--t-lead); line-height: 1.45; max-width: 34ch; }

/* ---------- hero ---------- */

.hero { padding-block: clamp(3.5rem, 9vw, 7rem) var(--sec-space); }
.hero h1 { max-width: 15ch; margin-bottom: 1.6rem; }
.hero .prose { max-width: 38rem; }

/* ---------- actions : tout ce qui agit est entre crochets ---------- */

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; margin-top: 1.9rem; }

.btn {
  display: inline-block;
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--blue);
  padding: 0.55rem 0;
  border: 0; background: none; cursor: pointer;
  letter-spacing: -0.01em;
}
.btn::before { content: "[ "; color: var(--rule); }
.btn::after  { content: " ]"; color: var(--rule); }
.btn:hover { text-decoration: underline; text-underline-offset: 0.25em; }

.btn--solid {
  background: var(--ink); color: var(--paper);
  padding: 0.7rem 1.15rem;
}
.btn--solid::before, .btn--solid::after { color: var(--ink-2); }
.btn--solid:hover { background: var(--blue); color: var(--blue-in); text-decoration: none; }
.btn--solid:hover::before, .btn--solid:hover::after { color: var(--blue-in); opacity: 0.55; }

.arrow {
  font-family: var(--mono); font-size: var(--t-mono);
  color: var(--blue); text-decoration: none;
  border-bottom: 1px solid transparent;
}
.arrow:hover { border-bottom-color: var(--blue); }

/* ---------- listing en bandes (papier d'imprimante) ---------- */

.rows { margin-top: 0.25rem; }
.row {
  padding: 1.5rem clamp(0.9rem, 2vw, 1.4rem);
  margin-inline: clamp(-1.4rem, -2vw, -0.9rem);
}
.row:nth-child(odd) { background: var(--band); }
.row h3 { margin-bottom: 0.4rem; }
.row p { margin: 0; max-width: 40rem; }
.row p + p { margin-top: 1.05rem; }
.row p + .note, .row .note { margin-top: 0.9rem; }

.comment {
  margin-top: 1.6rem;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  font-family: var(--mono);
  font-size: var(--t-mono);
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 46rem;
}

/* liste des exclusions : le rouge = ce qui n'existe pas ici */
.nope { list-style: none; padding: 0; margin: 0.5rem 0 0; max-width: 44rem; }
.nope li {
  display: grid; grid-template-columns: 1.75rem 1fr; align-items: baseline;
  padding: 0.6rem 0; border-bottom: 1px solid var(--rule-2);
}
.nope li::before {
  content: "\00d7"; font-family: var(--mono); color: var(--red); font-size: 0.95rem;
}

/* ---------- étapes numérotées (c'est une vraie séquence) ---------- */

.steps { counter-reset: step; margin-top: 0.5rem; }
.step { padding: 1.35rem 0; border-top: 1px solid var(--rule-2); }
.step:first-child { border-top: 0; padding-top: 0.35rem; }
.step__n {
  counter-increment: step;
  font-family: var(--mono); font-size: var(--t-mono); color: var(--ink-2);
  display: block; margin-bottom: 0.4rem;
}
.step__n::before { content: counter(step, decimal-leading-zero) " — "; color: var(--blue); }
.step p { margin: 0; max-width: 40rem; }
.step p + p { margin-top: 1.05rem; }
.step strong { font-weight: 560; }

/* ---------- vignettes projets ---------- */

.grid {
  display: grid; gap: clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: 1fr;
  margin-top: 0.5rem;
}
@media (min-width: 34rem) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 62rem) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem; } }
.card { display: flex; flex-direction: column; gap: 0.7rem; }
.card__shot {
  border: 1px solid var(--rule);
  background: var(--band);
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.card__shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .5s cubic-bezier(.2,.7,.3,1); }
.card a:hover .card__shot img { transform: scale(1.02); }
@media (prefers-reduced-motion: reduce) { .card__shot img { transition: none; } }
.card__link { text-decoration: none; color: inherit; display: block; }
.card h3 { margin-bottom: 0.25rem; }
.card p { margin: 0; font-size: 1rem; color: var(--ink-2); }

.tag {
  font-size: 0.75rem; color: var(--ink-2);
  display: flex; flex-wrap: wrap; gap: 0.5ch;
}
.tag span::after { content: " ·"; color: var(--rule); }
.tag span:last-child::after { content: ""; }
.tag .live { color: var(--red); }
.tag .live::before { content: "\25cf "; }

/* ---------- fiche projet ---------- */

.fiche { border-top: 1px solid var(--rule-2); padding-block: var(--sec-space); }
.fiche__shot { border: 1px solid var(--rule); margin-bottom: 1.75rem; }
.fiche h2 { margin-bottom: 0.3rem; }
.fiche__where { font-family: var(--mono); font-size: var(--t-mono); color: var(--ink-2); margin: 0 0 1.75rem; }
.fiche dl { margin: 0; }
.fiche dt {
  font-family: var(--mono); font-size: var(--t-mono); color: var(--ink-2);
  margin-top: 1.5rem;
}
.fiche dd { margin: 0.35rem 0 0; max-width: 40rem; }
.fiche__foot {
  margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--rule-2);
  font-family: var(--mono); font-size: var(--t-mono); color: var(--ink-2);
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; align-items: center;
}

/* liste labo */
.labo { margin-top: 0.5rem; border-top: 1px solid var(--rule-2); }
.labo__item {
  display: grid; grid-template-columns: 1fr; gap: 0.35rem;
  padding: 1.35rem 0; border-bottom: 1px solid var(--rule-2);
}
@media (min-width: 40rem) {
  .labo__item { grid-template-columns: 9rem minmax(0,1fr) auto; gap: 0 1.5rem; align-items: baseline; }
}
.labo__name { font-size: var(--t-h3); }
.labo__desc { margin: 0; color: var(--ink-2); font-size: 1rem; max-width: 40rem; }

/* ---------- formulaire ---------- */

.field--set { border: 0; padding: 0; margin-inline: 0; min-inline-size: 0; }
.field--set > legend { padding: 0; margin-bottom: 0.6rem; }

.form { max-width: 40rem; }
.field { margin-top: 2rem; }
.field:first-child { margin-top: 0.5rem; }
.field > .cmd { margin-bottom: 0.6rem; }

textarea, input[type="email"] {
  width: 100%;
  font-family: var(--serif);
  font-size: 1.0625rem;
  color: var(--ink);
  background: var(--band);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 0.85rem 1rem;
  line-height: 1.55;
}
textarea { min-height: 9.5rem; resize: vertical; }
textarea::placeholder, input::placeholder { color: var(--ink-2); opacity: 0.75; }
textarea:focus, input:focus { border-color: var(--blue); }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips label {
  font-family: var(--mono); font-size: 0.8125rem;
  border: 1px solid var(--rule); padding: 0.5rem 0.8rem;
  cursor: pointer; color: var(--ink-2); background: var(--paper);
}
.chips label:hover { border-color: var(--ink-2); color: var(--ink); }
.chips input:checked + label { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chips input:focus-visible + label { outline: 2px solid var(--blue); outline-offset: 2px; }

.form__foot { margin-top: 2.25rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: center; }
.form__msg { font-family: var(--mono); font-size: var(--t-mono); color: var(--ink-2); margin: 1rem 0 0; min-height: 1.4em; }
.form__msg[data-state="error"] { color: var(--red); }

.aside {
  border: 1px solid var(--rule); background: var(--band);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  max-width: 26rem;
}
.aside p { margin: 1.15rem 0 0; font-size: 1rem; }
.aside p:first-child { margin-top: 0; }
.aside strong { font-weight: 560; }

/* ---------- barre de statut ---------- */

.statusbar {
  font-size: 0.75rem;
  border-top: 1px solid var(--rule);
  background: var(--paper);
}
.statusbar .wrap {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem;
  padding-block: 0.7rem; align-items: center;
}
.statusbar a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule); }
.statusbar a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.statusbar .dot { color: var(--red); }
.statusbar .dot::before { content: "\25cf "; }
.statusbar .path { color: var(--ink-2); margin-left: auto; display: none; }
.statusbar .sep { color: var(--rule); }

@media (min-width: 48rem) {
  body { padding-bottom: 2.6rem; }
  .statusbar { position: fixed; inset: auto 0 0 0; z-index: 20; }
  .statusbar .path { display: block; }
}

.tail { padding-block: var(--sec-space) clamp(2.5rem, 6vw, 4rem); border-top: 1px solid var(--rule-2); }

/* ---------- page contact : formulaire + encadré ---------- */

.sec--full > .wrap { grid-template-columns: minmax(0, 1fr) !important; }
.split { display: grid; gap: 2.75rem; align-items: start; }
@media (min-width: 58rem) {
  .split { grid-template-columns: minmax(0, 1fr) 22rem; gap: 4rem; }
}
