/* ============================================================
   KALPY — Composants multi-pages
   Complète style.css. Chargé sur toutes les pages.
   Toutes les valeurs s'appuient sur les tokens de DESIGN.md.
   ============================================================ */


/* ---------- Navigation : état actif ---------- */
.nav__link.is-active { color: var(--text); }
.nav__link.is-active::before { opacity: 1; transform: scale(1); }
.mobile-menu a.is-active { color: var(--accent); }

/* ---------- Lien d'évitement (accessibilité) ---------- */
.skip-link {
  position: absolute; left: 16px; top: -70px; z-index: 10001;
  background: var(--accent); color: var(--accent-ink); padding: 12px 20px;
  border-radius: var(--radius); font-family: var(--font-head); font-weight: 600;
  transition: top 0.25s var(--ease);
}
.skip-link:focus { top: 16px; }

/* ---------- Focus visible (dette DESIGN.md corrigée) ---------- */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-xs);
}

/* ============================================================
   Page hero (pages intérieures)
   ============================================================ */
.page-hero {
  position: relative; overflow: hidden;
  padding: clamp(140px, 20vh, 210px) 0 clamp(56px, 7vw, 100px);
  border-bottom: 1px solid var(--line);
}
.page-hero__inner {
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(28px, 4vw, 64px); align-items: end;
}

/* Variante pleine hauteur : même signature WebGL que l'accueil */
.page-hero--full {
  min-height: 88vh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-bottom: clamp(50px, 7vh, 96px);
  border-bottom: none;
}
.page-hero--full .page-hero__title { font-size: var(--fs-display-xl); }
.page-hero--full .breadcrumb { margin-bottom: clamp(22px, 3vw, 36px); }
/* Repère de défilement */
.page-hero__scroll {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  pointer-events: none;
}
.page-hero__scroll i { color: var(--accent); animation: scrollNudge 2.2s ease-in-out infinite; }
@keyframes scrollNudge {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50%      { transform: translateY(6px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .page-hero__scroll i { animation: none; } }
@media (max-width: 768px) {
  .page-hero--full { min-height: 80vh; }
  .page-hero__scroll { display: none; }
}
.page-hero__title {
  font-family: var(--font-display); font-weight: 800; font-stretch: 78%; text-transform: uppercase;
  font-size: var(--fs-display-xl); line-height: 0.94; letter-spacing: 0.005em;
}
.page-hero__lead {
  color: var(--muted); font-size: var(--fs-body);
  max-width: 60ch; line-height: 1.6;
}
.breadcrumb {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: clamp(18px, 2.5vw, 30px);
}
.breadcrumb a { transition: color 0.3s; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [aria-current] { color: var(--text); }

/* ============================================================
   Marqueur de section (multi-pages : sans numérotation)
   ============================================================ */
.sec-label {
  display: inline-flex; align-items: center; gap: 11px;
  font-family: var(--font-mono); font-weight: 500;
  font-size: var(--fs-label); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: clamp(20px, 2.6vw, 30px);
}
.sec-label::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}

/* ============================================================
   Listes de socles — fiches techniques des pages projet
   ============================================================ */
.stack__list { display: flex; flex-wrap: wrap; gap: 8px; }
.stack__list li {
  font-family: var(--font-head); font-weight: 500; font-size: var(--fs-body);
  border: 1px solid var(--line); border-radius: var(--r-pill); padding: 7px 15px;
  color: var(--text); transition: border-color 0.3s, transform 0.3s var(--ease);
}
.stack__list li:hover { transform: translateY(-2px); border-color: var(--accent); }

/* Citation de position, sous les cartes d'expertises. Filet superieur et
   centrage : la phrase se detache des cartes sans qu'un encadre supplementaire
   vienne concurrencer celles qui la precedent. */
.xp__quote {
  margin: clamp(42px, 5vw, 74px) auto 0;
  max-width: 60ch; text-align: center;
  padding-top: clamp(34px, 4vw, 52px);
  border-top: 1px solid var(--line);
  font-family: var(--font-head); font-weight: 500;
  font-size: var(--fs-lead); line-height: 1.45; letter-spacing: -0.012em;
  color: var(--text);
}
.xp__quote::before {
  content: "\00AB"; display: block;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.4rem, 4.4vw, 3.6rem); line-height: 0.55;
  color: var(--accent); margin-bottom: clamp(18px, 2vw, 26px);
}

/* ============================================================
   Expertises — cartes catégorielles
   ============================================================ */
/* align-items: start plutot que l'etirement par defaut : une carte de quatre
   points ne se laisse plus etirer a la hauteur d'une carte de sept, ce qui
   supprime les demi-cartes vides. */
.xp__grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: clamp(18px, 2.2vw, 28px); align-items: start;
}
/* Cinquieme carte sur une grille paire : pleine largeur plutot qu'orpheline. */
.xp--wide { grid-column: 1 / -1; }
.xp--wide .xp__list { columns: 2; column-gap: clamp(24px, 3vw, 48px); }
.xp--wide .xp__list li { break-inside: avoid; }
@media (max-width: 720px) { .xp--wide .xp__list { columns: 1; } }

/* Chaque terrain porte une teinte de la palette du logo. Elle ne sert jamais
   au texte (contraste insuffisant sur fond clair) mais a la pastille du
   sur-titre, aux puces et a la bordure au survol. */
.xp { --xp-tone: var(--blue); }
.xp:nth-child(2) { --xp-tone: var(--indigo); }
.xp:nth-child(3) { --xp-tone: var(--teal); }
.xp:nth-child(4) { --xp-tone: var(--royal); }
.xp:nth-child(5) { --xp-tone: var(--pink); }

.xp {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(32px, 3.4vw, 46px);
  display: flex; flex-direction: column; gap: 15px;
  box-shadow: var(--shadow-media);
  transition: border-color 0.45s var(--ease), transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.xp:hover { border-color: var(--xp-tone); transform: translateY(-5px); box-shadow: var(--shadow-card); }
/* Le sur-titre reprend la pastille de .sec-label : c'est la teinte du terrain
   qui la porte, un signal deja present dans le systeme plutot qu'un filet
   colore rapporte en tete de carte. */
.xp__kind {
  display: inline-flex; align-items: center; gap: 11px; align-self: flex-start;
  font-family: var(--font-mono); font-size: var(--fs-label); color: var(--royal);
  letter-spacing: 0.12em; text-transform: uppercase;
}
.xp__kind::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--xp-tone); flex-shrink: 0;
}
.xp__title {
  font-family: var(--font-display); text-transform: uppercase; font-weight: 800; font-stretch: 78%;
  font-size: var(--fs-title); line-height: 1; letter-spacing: 0.005em;
}
.xp__text { color: var(--muted); max-width: 52ch; }
.xp__list {
  display: flex; flex-direction: column; gap: 11px;
  margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--line);
}
.xp__list li { position: relative; padding-left: 24px; color: var(--text); font-size: var(--fs-body); }
.xp__list li::before {
  content: ""; position: absolute; left: 0; top: 0.5em;
  width: 8px; height: 8px; border-radius: 50%; background: var(--xp-tone);
}

/* ============================================================
   Page projet
   ============================================================ */
/* Visuel d'ouverture bord à bord */
.project__hero-media { position: relative; overflow: hidden; }
.project__hero-media img { width: 100%; height: auto; display: block; }

/* Fiche technique : bandeau de spécifications */
.project__specs { padding-top: clamp(40px, 5vw, 66px); padding-bottom: clamp(40px, 5vw, 66px); }
.spec__grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 2.4vw, 34px);
  padding-bottom: clamp(26px, 3vw, 38px);
  border-bottom: 1px solid var(--line);
}
.spec { display: flex; flex-direction: column; gap: 7px; }
.spec__label {
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent);
}
.spec__value { font-family: var(--font-head); font-weight: 600; font-size: var(--fs-md); line-height: 1.35; }
.spec__stack { display: flex; flex-direction: column; gap: 12px; padding-top: clamp(24px, 3vw, 34px); }

/* Sections narratives : titre à gauche, texte à droite */
.project__split {
  display: grid; grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(28px, 4vw, 70px); align-items: start;
}
.project__split .sec-title { margin-bottom: 0; }
.project__body p { color: var(--muted); margin-bottom: 20px; font-size: var(--fs-md); line-height: 1.65; max-width: 62ch; }
.project__body p:last-of-type { margin-bottom: 26px; }
.project__body strong { color: var(--text); font-weight: 600; }

/* Écrans avec légende */
.project__shots {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 28px); margin-top: clamp(38px, 4.5vw, 64px);
}
.project__shots figure { display: flex; flex-direction: column; gap: 14px; }
.project__shots img {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow-media);
}
.project__shots figcaption {
  font-family: var(--font-mono); font-size: var(--fs-label);
  color: var(--muted); line-height: 1.5;
}

/* Visuel large avec légende */
.project__figure { display: flex; flex-direction: column; gap: 16px; margin-bottom: clamp(20px, 2.4vw, 32px); }
.project__figure img {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow-media);
}
.project__figure figcaption {
  font-family: var(--font-mono); font-size: var(--fs-label);
  color: var(--muted); line-height: 1.55; max-width: 70ch;
}
.project__shots--pair { grid-template-columns: repeat(2, 1fr); margin-top: 0; }

/* Signature de fin */
.project__signature { text-align: center; }
.project__signature-logo {
  width: 100%; max-width: 420px; height: auto;
  margin: clamp(20px, 3vw, 34px) auto 0;
}

/* Liste de fonctionnalités / étapes numérotées */
.project__lead {
  color: var(--muted); font-size: var(--fs-md);
  max-width: 62ch; margin: -12px 0 clamp(32px, 4vw, 50px);
}
.feat__list { display: flex; flex-direction: column; gap: 12px; }
.feat {
  display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: start;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(20px, 2.2vw, 28px) clamp(22px, 2.4vw, 32px);
  background: var(--surface);
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.feat:hover { border-color: var(--accent); transform: translateX(4px); }
.feat__num {
  font-family: var(--font-mono); font-size: var(--fs-label);
  color: var(--accent); letter-spacing: 0.1em; padding-top: 3px;
}
.feat__body { display: flex; flex-direction: column; gap: 6px; }
.feat__title {
  font-family: var(--font-head); font-weight: 600;
  font-size: var(--fs-md); line-height: 1.3; letter-spacing: -0.01em;
}
.feat__text { color: var(--muted); font-size: var(--fs-sm); line-height: 1.6; max-width: 74ch; }

/* Signature de fin */
.project__signature-note { color: var(--muted); font-size: var(--fs-sm); margin: 18px 0 26px; }

/* ============================================================
   Formulaire de contact
   ============================================================ */
/* minmax(0, 1fr) et min-width: 0, comme sur le formulaire de brief.
   Un <select> annonce comme largeur minimale celle de sa plus longue option
   (ici « Boutique e-commerce (Magento 2, PrestaShop, WooCommerce) »). Avec des
   pistes en 1fr, la grille ne peut pas descendre sous cette largeur : le
   formulaire deborde et c'est toute la page qui defile horizontalement. */
.cform { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 30px); }
.cfield { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cfield--full { grid-column: 1 / -1; }
.cfield label {
  font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}
.cfield input, .cfield textarea, .cfield select {
  width: 100%; max-width: 100%; min-width: 0;
  background: transparent; border: none; border-bottom: 1px solid var(--line);
  color: var(--text); font-family: var(--font-body); font-size: var(--fs-body);
  /* Un peu de retrait interne : sans lui le texte saisi et le libelle de
     substitution touchent le depart du filet. */
  padding: 11px 12px; outline: none; border-radius: 0;
  transition: border-color 0.3s;
}
.cfield textarea { resize: vertical; min-height: 130px; }
.cfield input:focus, .cfield textarea:focus, .cfield select:focus {
  border-bottom-color: var(--accent);
}
.cfield input::placeholder, .cfield textarea::placeholder { color: var(--muted); }
.cfield select { color: var(--text); }
.cfield select option { background: var(--bg-soft); color: var(--text); }
.cform__submit { grid-column: 1 / -1; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.cform__note { color: var(--muted); font-size: var(--fs-label); }

.contact__grid { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: clamp(36px, 5vw, 80px); align-items: start; }
.contact__aside { display: flex; flex-direction: column; gap: 28px; }
.contact__block { display: flex; flex-direction: column; gap: 7px; }
.contact__block-label {
  font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}
.contact__block a { font-family: var(--font-head); font-size: var(--fs-body); font-weight: 600; transition: color 0.3s; }
.contact__block a:hover { color: var(--accent); }
.contact__block p { color: var(--muted); font-size: var(--fs-body); }

/* ============================================================
   Carte de réalisation : lien plein cadre + variante appel
   ============================================================ */
/* Lien étiré : couvre toute la carte sans casser l'ordre de peinture
   (image → voile dégradé → contenu → zone cliquable). */
.wcard__link {
  position: absolute; inset: 0; z-index: 4;
  font-size: 0; text-indent: -9999px; overflow: hidden;
}
.wcard:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.wcard--cta {
  aspect-ratio: auto; border: 1px solid var(--line);
  display: flex; align-items: center;
}
.wcard--cta::after { display: none; }
.wcard--cta .work__cta { border: none; background: none; padding: clamp(28px, 3.2vw, 46px); }
.wcard--cta .work__title { color: var(--text); }

/* Marqueur de section centré */
.sec-label--center { display: flex; justify-content: center; }

/* ============================================================
   Logos clients — une seule source, inversée selon le thème
   Les fichiers de clients-light/ sont des silhouettes noires :
   invert(1) les rend blanches sur fond sombre. Une seule image
   par logo, donc le marquee boucle proprement.
   ============================================================ */
.clients__track img { filter: invert(1); }
.section--light .clients__track img { filter: none; opacity: 0.6; }
.section--light .clients__track img:hover { opacity: 1; }

/* ============================================================
   Bandeau d'appel (fin de page)
   ============================================================ */
.endcta { border-top: 1px solid var(--line); }
.endcta__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 30px; flex-wrap: wrap;
}
.endcta__title {
  font-family: var(--font-display); text-transform: uppercase; font-weight: 800; font-stretch: 78%;
  font-size: var(--fs-display); line-height: 0.98; letter-spacing: 0.005em;
  max-width: 18ch;
}
.endcta__text { color: var(--muted); margin-top: 14px; max-width: 46ch; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .page-hero__inner { grid-template-columns: 1fr; gap: 22px; align-items: start; }
  .project__grid { grid-template-columns: 1fr; }
  .project__meta { position: static; }
  .contact__grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .xp__grid { grid-template-columns: 1fr; }
  .cform { grid-template-columns: minmax(0, 1fr); }
  .project__shots { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}

@media (max-width: 1024px) {
  .spec__grid { grid-template-columns: repeat(2, 1fr); }
  .project__split { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 640px) {
  .spec__grid { grid-template-columns: 1fr; }
  .project__shots { grid-template-columns: 1fr; }
}

/* ============================================================
   Page 404
   ============================================================ */
/* Le code d'erreur est un reperage, pas un titre : il est enorme mais tres
   attenue, le titre lisible reste le h1. */
.nf__code {
  font-family: var(--font-display); font-weight: 800; font-stretch: 78%;
  font-size: var(--fs-display-mega); line-height: 0.8; letter-spacing: 0.01em;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.16);
  margin-bottom: clamp(10px, 1.6vw, 22px);
  user-select: none;
}
.nf__links {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: clamp(16px, 2.4vw, 30px);
  margin-top: clamp(24px, 3vw, 36px);
}
.nf__alt {
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line); padding-bottom: 3px;
  transition: color 0.3s, border-color 0.3s;
}
.nf__alt:hover { color: var(--accent); border-color: var(--accent); }

/* Remplissage automatique du navigateur : Chrome impose un fond bleu clair et
   un texte sombre, illisibles sur le theme sombre. On ne peut pas surcharger
   ce fond avec `background`, seul un box-shadow interne le recouvre. La
   transition tres longue neutralise le rappel du fond au premier rendu. */
.cfield input:-webkit-autofill,
.cfield input:-webkit-autofill:hover,
.cfield input:-webkit-autofill:focus,
.cfield textarea:-webkit-autofill,
.cfield select:-webkit-autofill,
.bfield input:-webkit-autofill,
.bfield input:-webkit-autofill:hover,
.bfield input:-webkit-autofill:focus,
.bfield textarea:-webkit-autofill,
.bfield select:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--section-bg) inset;
  box-shadow: 0 0 0 1000px var(--section-bg) inset;
  caret-color: var(--text);
  transition: background-color 100000s ease-in-out 0s;
}

/* Retour d'envoi du formulaire de contact */
.cform__status {
  grid-column: 1 / -1; margin-top: -6px;
  font-size: var(--fs-sm); color: var(--muted);
}
.cform__status:empty { display: none; }
.cform__status.is-error { color: var(--pink); }
.cform__status a { color: var(--accent); border-bottom: 1px solid currentColor; }

/* Occupe la cellule laissee libre par le formulaire une fois celui-ci masque :
   la colonne laterale garde sa place, la page ne se reorganise pas. */
.cform__done {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(32px, 4vw, 52px);
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
}
.cform__done-mark {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font-size: var(--fs-md); margin-bottom: 4px;
}
.cform__done-title {
  font-family: var(--font-display); text-transform: uppercase; font-weight: 800; font-stretch: 78%;
  font-size: var(--fs-title); line-height: 1; letter-spacing: 0.005em;
}
.cform__done-text { color: var(--muted); max-width: 46ch; }
.cform__done .btn--pill { margin-top: 8px; }

/* Identifiants legaux : deux colonnes libellé / valeur plutot qu'un
   paragraphe compact, pour qu'un numero se retrouve d'un coup d'oeil. */
.legal__id { margin: 18px 0 26px; display: flex; flex-direction: column; gap: 12px; }
.legal__id > div {
  display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 6px 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.legal__id > div:last-child { border-bottom: none; padding-bottom: 0; }
.legal__id dt {
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.legal__id dd { color: var(--text); }
.legal__id a { color: var(--accent); }
@media (max-width: 620px) { .legal__id > div { grid-template-columns: 1fr; } }

/* Liens dans les fiches techniques et les signatures : sans marque propre ils
   heritent de color: inherit et se lisent comme du texte ordinaire. */
.spec__value a,
.project__signature-note a,
.project__body a {
  border-bottom: 1px solid var(--line);
  transition: color 0.3s, border-color 0.3s;
}
.spec__value a:hover,
.project__signature-note a:hover,
.project__body a:hover { color: var(--accent); border-color: var(--accent); }
