/* =============================================================================
   NOCODLY — nocodly.fr
   Système : monographie académique claire. Papier blanc, encre noire, filets
   1px comme seul dispositif de séparation, angles vifs (0 radius), typographie
   monumentale, aucun ombrage ni dégradé. Un accent unique — bleu Klein #002FA7 —
   strictement réservé à l'interaction et à l'emphase. Le mono ne sert qu'aux
   index et libellés techniques. Imagerie : plans techniques SVG (blueprint →
   app), jamais de photo d'illustration.
   ========================================================================== */

@font-face { font-family: 'Switzer'; src: url('/assets/fonts/switzer-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('/assets/fonts/switzer-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('/assets/fonts/switzer-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('/assets/fonts/switzer-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Cabinet'; src: url('/assets/fonts/cabinet-grotesk-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Cabinet'; src: url('/assets/fonts/cabinet-grotesk-900.woff2') format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'JB Mono'; src: url('/assets/fonts/jetbrains-mono-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --paper: #ffffff;
  --paper-2: #f4f4f2;
  --ink: #0a0a0a;
  --ink-2: #3a3a3a;
  --ink-3: #767676;
  --rule: #d8d8d4;
  --rule-strong: #0a0a0a;
  --klein: #002fa7;
  --klein-ink: #00227a;

  --sans: 'Switzer', system-ui, -apple-system, sans-serif;
  --display: 'Cabinet', 'Switzer', system-ui, sans-serif;
  --mono: 'JB Mono', ui-monospace, 'SFMono-Regular', monospace;

  --gut: clamp(20px, 4.5vw, 72px);   /* marge latérale */
  --band: clamp(80px, 11vw, 168px);  /* respiration verticale entre sections */
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--klein); color: #fff; }

:focus-visible { outline: 2px solid var(--klein); outline-offset: 3px; }

/* ── Primitives typographiques ─────────────────────────────────────────── */

.display {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(3.1rem, 11.5vw, 11.5rem);
  line-height: 0.86;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  text-wrap: balance;
}

.display--md { font-size: clamp(2.4rem, 7vw, 6rem); line-height: 0.9; }

.h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.9rem, 4.6vw, 3.9rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  text-wrap: balance;
}

.h3 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.lede {
  font-size: clamp(1.05rem, 1.45vw, 1.3rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 46ch;
  text-wrap: pretty;
}

/* Libellé technique : mono, capitales, très tracké. Jamais pour de la prose. */
.label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.label--ink { color: var(--ink); }
.label--klein { color: var(--klein); }

.idx { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; color: var(--klein); }

/* ── Boutons : filet ou aplat, jamais d'ombre, jamais d'arrondi ────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 17px 28px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.btn:hover { background: var(--ink); color: var(--paper); }

.btn--klein { background: var(--klein); border-color: var(--klein); color: #fff; }
.btn--klein:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

.btn--invert { border-color: rgba(255, 255, 255, 0.5); color: #fff; }
.btn--invert:hover { background: #fff; border-color: #fff; color: var(--ink); }

.btn__arrow { display: inline-block; transition: transform 0.18s ease; }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* ── En-tête ───────────────────────────────────────────────────────────── */

.hdr {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--gut);
  border-bottom: 1px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.hdr.is-stuck { background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(8px); border-bottom-color: var(--rule); }

.hdr__logo { display: block; color: var(--ink); }
.hdr__logo svg { height: 22px; width: auto; }

.nav { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 34px); }

.nav a {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}

.nav a:hover { border-bottom-color: var(--ink); }
.nav a[aria-current='page'] { color: var(--klein); border-bottom-color: var(--klein); }
.nav .btn { padding: 11px 20px; }

.burger { display: none; }

@media (max-width: 820px) {
  .burger {
    display: inline-flex;
    align-items: center;
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    background: none;
    border: 1px solid var(--ink);
    color: var(--ink);
    padding: 10px 16px;
    cursor: pointer;
  }
  .nav {
    position: fixed;
    inset: 0;
    background: var(--paper);
    flex-direction: column;
    justify-content: center;
    gap: 26px;
    transform: translateY(-101%);
    transition: transform 0.4s cubic-bezier(0.7, 0, 0.2, 1);
  }
  .nav.is-open { transform: none; }
  .nav a { font-family: var(--display); font-weight: 800; font-size: 2rem; letter-spacing: -0.02em; text-transform: uppercase; }
  .nav .btn { font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; }
}

/* ── Héros : typographie seule, calé en bas, filets techniques ─────────── */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(78px + var(--gut) / 2) var(--gut) 0;
  position: relative;
}

.hero__top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}

.hero__mid { padding: clamp(34px, 6vh, 76px) 0; }

.hero .display { margin-bottom: clamp(24px, 3.4vh, 44px); }

.hero__cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(24px, 4vw, 72px);
  align-items: end;
}

@media (max-width: 760px) { .hero__cols { grid-template-columns: 1fr; align-items: start; } }

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Bandeau de pied du héros : trois colonnes séparées par des filets */
.specimen {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
}

.specimen > div {
  padding: 22px 0 26px;
  border-right: 1px solid var(--rule);
  padding-right: 22px;
}

.specimen > div:last-child { border-right: none; }
.specimen > div + div { padding-left: 22px; }
.specimen p { font-size: 14px; color: var(--ink-2); margin-top: 8px; max-width: 34ch; }

@media (max-width: 700px) {
  .specimen { grid-template-columns: 1fr; }
  .specimen > div { border-right: none; border-top: 1px solid var(--rule); padding-left: 0 !important; }
  .specimen > div:first-child { border-top: none; }
}

/* ── Sections ──────────────────────────────────────────────────────────── */

.section { padding: var(--band) var(--gut); }
.section--flush { padding-top: 0; }
.section--ink { background: var(--ink); color: var(--paper); }
.section--ink .lede { color: rgba(255, 255, 255, 0.72); }
.section--ink .label { color: rgba(255, 255, 255, 0.6); }
.section--klein { background: var(--klein); color: #fff; }

.wrap { max-width: 1440px; margin-inline: auto; }

.sec-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: clamp(20px, 4vw, 80px);
  align-items: end;
  padding-bottom: clamp(28px, 4vw, 56px);
  margin-bottom: clamp(28px, 4vw, 56px);
  border-bottom: 1px solid var(--rule);
}

.section--ink .sec-head { border-bottom-color: rgba(255, 255, 255, 0.22); }

.sec-head .label { margin-bottom: 18px; display: block; }

@media (max-width: 820px) { .sec-head { grid-template-columns: 1fr; align-items: start; } }

/* ── Plan technique : blueprint → app ──────────────────────────────────── */

.plan {
  position: relative;
  border: 1px solid var(--rule);
  background:
    repeating-linear-gradient(to right, rgba(0, 47, 167, 0.055) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(to bottom, rgba(0, 47, 167, 0.055) 0 1px, transparent 1px 44px),
    var(--paper);
  padding: clamp(32px, 5vw, 76px) clamp(20px, 4vw, 64px);
}

.plan__grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(20px, 4vw, 64px);
}

@media (max-width: 900px) {
  .plan__grid { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .plan__arrow { transform: rotate(90deg); }
}

.plan__side { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.plan__side .label { text-align: center; }
.plan__side figcaption { font-size: 14px; color: var(--ink-2); max-width: 30ch; text-align: center; }

.device { width: min(280px, 62vw); }

.plan__arrow { color: var(--klein); }
.plan__arrow svg { width: 64px; height: auto; }

/* ── Index numéroté (le protocole) ─────────────────────────────────────── */

.index { border-top: 1px solid var(--rule); }
.section--ink .index { border-top-color: rgba(255, 255, 255, 0.22); }

.index__row {
  display: grid;
  grid-template-columns: 62px minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(14px, 3vw, 48px);
  align-items: start;
  padding: clamp(22px, 3vw, 40px) 0;
  border-bottom: 1px solid var(--rule);
}

.section--ink .index__row { border-bottom-color: rgba(255, 255, 255, 0.22); }

.index__row p { color: var(--ink-2); max-width: 58ch; }
.section--ink .index__row p { color: rgba(255, 255, 255, 0.72); }

@media (max-width: 820px) {
  .index__row { grid-template-columns: 44px 1fr; }
  .index__row p { grid-column: 2; }
}

/* ── Catalogue : table éditoriale, pas des cartes ──────────────────────── */

.cat { border-top: 1px solid var(--rule-strong); }

.cat__row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) minmax(0, 0.9fr) auto auto;
  gap: clamp(14px, 2.4vw, 40px);
  align-items: center;
  padding: clamp(24px, 3vw, 38px) 0;
  border-bottom: 1px solid var(--rule);
  transition: background 0.2s ease, padding 0.2s ease;
}

.cat__row:hover { background: var(--paper-2); }

.cat__desc { color: var(--ink-2); font-size: 15px; max-width: 52ch; white-space: pre-line; }

.cat__price {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.5rem, 2.6vw, 2.3rem);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.cat__price sup { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; vertical-align: super; color: var(--ink-3); margin-left: 6px; }

@media (max-width: 1000px) {
  .cat__row { grid-template-columns: 44px 1fr; row-gap: 14px; }
  .cat__desc, .cat__price, .cat__row .btn { grid-column: 2; }
  .cat__row .btn { justify-self: start; }
}

.empty {
  border: 1px dashed var(--rule);
  padding: clamp(40px, 7vw, 90px) 24px;
  text-align: center;
  color: var(--ink-3);
}

/* ── Énoncés (section noire) ───────────────────────────────────────────── */

.claims { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1px; background: rgba(255, 255, 255, 0.22); border: 1px solid rgba(255, 255, 255, 0.22); }
.claims > div { background: var(--ink); padding: clamp(26px, 3vw, 42px); min-height: 230px; display: flex; flex-direction: column; gap: 14px; }
.claims .idx { color: #fff; opacity: 0.5; }
.claims h3 { font-family: var(--display); font-weight: 800; font-size: 1.4rem; line-height: 1.05; text-transform: uppercase; letter-spacing: -0.01em; }
.claims p { font-size: 14.5px; color: rgba(255, 255, 255, 0.7); margin-top: auto; }

/* ── Bloc final Klein ──────────────────────────────────────────────────── */

.cta-klein { display: grid; gap: clamp(26px, 4vw, 48px); }
.cta-klein .lede { color: rgba(255, 255, 255, 0.82); }

/* ── Formulaire ────────────────────────────────────────────────────────── */

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(30px, 6vw, 96px);
  align-items: start;
}

@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr; } }

.form { display: flex; flex-direction: column; gap: 22px; }

.field { display: flex; flex-direction: column; gap: 8px; }

.field label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }

.field input, .field select, .field textarea {
  font: 400 16px/1.5 var(--sans);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  padding: 10px 0;
  width: 100%;
  border-radius: 0;
}

.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom-color: var(--klein); border-bottom-width: 2px; padding-bottom: 9px; }
.field select { cursor: pointer; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }

.errors { border: 1px solid var(--klein); padding: 14px 18px; color: var(--klein-ink); font-size: 15px; }
.errors p + p { margin-top: 6px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.contact-meta { display: flex; flex-direction: column; gap: 26px; }
.contact-meta a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--klein); }

/* ── Pages légales ─────────────────────────────────────────────────────── */

.legal { max-width: 760px; }
.legal h2 { font-family: var(--display); font-weight: 800; font-size: 1.3rem; text-transform: uppercase; letter-spacing: -0.01em; margin: 46px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.legal h2:first-of-type { margin-top: 0; }
.legal p, .legal li { color: var(--ink-2); margin-bottom: 12px; }
.legal ul { padding-left: 20px; }
.legal strong { color: var(--ink); font-weight: 600; }
.legal a { color: var(--klein); }

/* ── Pied de page ──────────────────────────────────────────────────────── */

.ftr { border-top: 1px solid var(--rule-strong); padding: clamp(48px, 6vw, 90px) var(--gut) 28px; }

.ftr__logo { color: var(--ink); margin-bottom: clamp(34px, 5vw, 60px); }
.ftr__logo svg { width: min(100%, 1180px); height: auto; }

.ftr__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 32px; padding-top: 30px; border-top: 1px solid var(--rule); }
.ftr__grid h4 { margin-bottom: 16px; }
.ftr__grid ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.ftr__grid a { text-decoration: none; font-size: 15px; }
.ftr__grid a:hover { color: var(--klein); }
.ftr__grid p { font-size: 14px; color: var(--ink-2); }

.ftr__legal { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }

/* ── Bandeau titre des pages internes ──────────────────────────────────── */

.page-head { padding: calc(78px + var(--band) / 1.6) var(--gut) clamp(30px, 4vw, 56px); }
.page-head .label { display: block; margin-bottom: 20px; }
.page-head .lede { margin-top: 26px; }

/* ── Apparition au défilement ──────────────────────────────────────────── */

html.js .rv { opacity: 0; transform: translateY(20px); transition: opacity 0.65s ease, transform 0.65s ease; }
html.js .rv.on { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html.js .rv { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ── Barre de progression de lecture ───────────────────────────────────── */

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--klein);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 90;
  pointer-events: none;
}

/* ── Révélation du titre, ligne par ligne ──────────────────────────────── */

.ln { display: block; overflow: hidden; }
.ln > span { display: block; }

html.js .ln > span { transform: translateY(105%); transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1); }
html.js .ln.on > span { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html.js .ln > span { transform: none; transition: none; }
}

/* ── Bandeau typographique défilant ────────────────────────────────────── */

.ticker {
  overflow: hidden;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  padding: 18px 0;
  background: var(--paper);
}

.ticker__track { display: flex; width: max-content; animation: ticker 34s linear infinite; }

.ticker span {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.3rem, 2.8vw, 2.4rem);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding-right: clamp(24px, 4vw, 56px);
}

.ticker span::after { content: ''; width: 9px; height: 9px; background: var(--klein); flex: none; }

@keyframes ticker { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) { .ticker__track { animation: none; } }

/* ── Planches photographiques ──────────────────────────────────────────── */

.plates { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 2vw, 32px); }

@media (max-width: 880px) { .plates { grid-template-columns: 1fr 1fr; } .plates .plate:last-child { grid-column: 1 / -1; } }
@media (max-width: 520px) { .plates { grid-template-columns: 1fr; } .plates .plate:last-child { grid-column: auto; } }

.plate { margin: 0; }

.plate__frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ink);
  aspect-ratio: 4 / 5;
  background: var(--paper-2);
}

.plate--wide .plate__frame { aspect-ratio: 16 / 10; }

.plate__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08);
  transform: scale(1.02);
  transition: filter 0.5s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.plate:hover .plate__frame img { filter: grayscale(0) contrast(1.02); transform: scale(1.06); }

/* Voile Klein qui se retire au survol : la planche « s'imprime » */
.plate__frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--klein);
  mix-blend-mode: screen;
  opacity: 0.2;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.plate:hover .plate__frame::after { opacity: 0; }

.plate figcaption {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--rule);
}

.plate figcaption b { font-weight: 500; font-size: 14.5px; }

/* ── Bandeau image pleine largeur, en parallaxe ────────────────────────── */

.band { position: relative; height: clamp(320px, 58vh, 620px); overflow: hidden; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }

.band img {
  position: absolute;
  inset: -18% 0 -18% 0;
  width: 100%;
  height: 136%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.15) brightness(0.82);
  will-change: transform;
}

.band__veil { position: absolute; inset: 0; background: rgba(0, 47, 167, 0.38); mix-blend-mode: multiply; }

.band__txt {
  position: absolute;
  inset: auto 0 0 0;
  padding: var(--gut);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  background: linear-gradient(to top, rgba(10, 10, 10, 0.55), transparent);
}

.band__txt .label { color: rgba(255, 255, 255, 0.8); }
.band__txt p { font-family: var(--display); font-weight: 800; font-size: clamp(1.5rem, 3.6vw, 3rem); line-height: 1; letter-spacing: -0.025em; text-transform: uppercase; max-width: 18ch; }

/* ── Vis-à-vis texte / planche ─────────────────────────────────────────── */

.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); gap: clamp(24px, 5vw, 80px); align-items: start; }
@media (max-width: 900px) { .duo { grid-template-columns: 1fr; } }
.duo .plate__frame { aspect-ratio: 3 / 4; }
