/* ==========================================================================
   NEON STRATA — composants
   En-tête, boutons, repères HUD, hero. Les états animés vivent dans motion.css.
   ========================================================================== */

/* --- Ambiance : scanlines et grain (DESIGN.md §6) ------------------------ */

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  transform: translateZ(0);   /* calque composité : rastérisé une fois, pas à chaque image */
}

/* Scanlines : tuile bitmap 1×3 px (un repeating-linear-gradient plein écran coûte cher) */
body::before {
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAADCAYAAABS3WWCAAAACXBIWXMAAAPoAAAD6AG1e1JrAAAAEElEQVR4nGP4////fwY4AAAx3QP9ww7fgAAAAABJRU5ErkJggg==") repeat;
  opacity: 0.04;
}

/* Grain en fondu normal : un mix-blend-mode plein écran recompose toute la page à chaque image */
body::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035;
}

/* --- Barre de progression de lecture ----------------------------------- */

.ns-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 60;
  pointer-events: none;
}

.ns-progress span {
  display: block;
  height: 100%;
  background: var(--c-cyan-glow);
  box-shadow: var(--glow-cyan);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* --- Dégradé signature et pastille de statut --------------------------- */

.ns-grad {
  background: var(--grad-strata);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ns-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.6em;
  vertical-align: 0.15em;
  background: var(--c-green-glow);
  box-shadow: var(--glow-green);
}

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

body #header,
body.header-dark.header-transparent #header:not(.scrolled) {
  height: 4.5rem;
  background: linear-gradient(to bottom, rgba(7, 10, 18, 0.85), rgba(7, 10, 18, 0));
  border-bottom: 1px solid transparent;
  z-index: 40;
}

body.header-fixed.header-animated #header.scrolled {
  height: 3.5rem;
  background: rgba(7, 10, 18, 0.82);
  border-bottom-color: var(--c-line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

body #header .navbar-section,
body.header-fixed.header-animated #header.scrolled .navbar-section {
  height: 100%;
}

#header .container {
  max-width: 1440px;
  height: 100%;
  padding: 0 clamp(1rem, 3vw, 3rem);
}

#header .navbar {
  height: 100%;
}

#header .navbar-section {
  margin-right: 0;
}

.ns-logo {
  display: block;
  position: relative;
  line-height: 0;
}

body #header .ns-logo img,
body.header-fixed.header-animated #header.scrolled .ns-logo img {
  width: auto;
  height: 26px;
}

body.header-fixed.header-animated #header.scrolled .ns-logo img {
  height: 22px;
}

/* Navigation : mono, majuscules, index numérotés */
#header .dropmenu ul.navigation {
  counter-reset: ns-nav;
  display: flex;
  gap: clamp(1rem, 2vw, 2rem);
}

#header .dropmenu ul.navigation > li {
  counter-increment: ns-nav;
}

body #header .dropmenu a,
body.header-dark #header:not(.scrolled) .dropmenu a {
  position: relative;
  padding: 0.5rem 0;
  color: var(--c-text-muted) !important;
  font-family: var(--f-mono);
  font-size: var(--fs-hud);
  font-weight: 500;
  letter-spacing: var(--ls-hud);
  text-transform: uppercase;
  text-decoration: none;
}

/* Remplace la flèche FontAwesome de Quark (float: right) par l'index */
#header .dropmenu ul.navigation > li > a::before {
  content: counter(ns-nav, decimal-leading-zero);
  float: none;
  display: inline;
  margin: 0 0.6em 0 0;
  color: var(--c-cyan-glow);
  font-family: var(--f-mono);
  opacity: 0.7;
}

#header .dropmenu ul.navigation > li > a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.2rem;
  height: 1px;
  background: var(--c-cyan-glow);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform var(--dur-base) var(--ease-out);
}

body #header .dropmenu a:hover,
body #header .dropmenu a.active,
body.header-dark #header:not(.scrolled) .dropmenu a:hover,
body.header-dark #header:not(.scrolled) .dropmenu a.active {
  color: var(--c-text) !important;
}

#header .dropmenu ul.navigation > li > a:hover::after,
#header .dropmenu ul.navigation > li > a.active::after {
  transform: scaleX(1);
}

/* Menu mobile (burger + surcouche Quark) */

/* Remise à zéro du <button> qui remplace la div de Quark */
.mobile-menu button.button_container,
.mobile-menu button.button_container:hover,
.mobile-menu button.button_container.active {
  -webkit-appearance: none;
  appearance: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  opacity: 1;
}

/* Le burger reste au-dessus de l'en-tête (z-index 40) ; la surcouche passe sous l'en-tête,
   dont le logo reste visible (le logo mobile de Quark, en double, est masqué). */
.mobile-menu {
  z-index: 45;
}

.mobile-menu .button_container span,
.mobile-menu .button_container.active span {
  height: 1px;
  background: var(--c-text);
}

.mobile-container .overlay {
  z-index: 39;
  background: var(--c-void);
}

.mobile-container .overlay.open {
  opacity: 1;
}

.mobile-container .overlay nav {
  height: 100%;
  padding: 6.5rem 1.5rem 2rem;
  text-align: left;
}

.mobile-container .overlay-menu ul.navigation {
  counter-reset: ns-nav;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--c-line);
}

.mobile-container .overlay-menu li {
  counter-increment: ns-nav;
  margin: 0;
  border-bottom: 1px solid var(--c-line);
}

.mobile-container .overlay-menu a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.1rem 0;
  color: var(--c-text);
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 6vw, 2.25rem);
  font-stretch: 112%;
  font-weight: 800;
  letter-spacing: var(--ls-display);
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}

.mobile-container .overlay-menu a::before {
  content: counter(ns-nav, decimal-leading-zero);
  color: var(--c-cyan-glow);
  font-family: var(--f-mono);
  font-size: var(--fs-hud);
  font-weight: 500;
  letter-spacing: var(--ls-hud);
}

.mobile-container .overlay-menu a:hover,
.mobile-container .overlay-menu a:focus-visible {
  color: var(--c-cyan-glow);
}

/* --- Boutons ------------------------------------------------------------ */

.ns-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
  min-height: 48px;
  padding: 0 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-1);
  font-family: var(--f-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: var(--ls-hud);
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
}

.ns-btn--primary {
  background: var(--c-violet);
  color: #fff;
}

.ns-btn--primary::after {
  content: "→";
  transition: transform var(--dur-base) var(--ease-out);
}

.ns-btn--primary:hover {
  background: #8B4DF5;
  box-shadow: var(--glow-violet);
  color: #fff;
}

.ns-btn--primary:hover::after {
  transform: translateX(4px);
}

.ns-btn--ghost {
  border-color: var(--c-line);
  color: var(--c-text);
}

.ns-btn--ghost:hover {
  border-color: var(--c-cyan-glow);
  color: var(--c-cyan-glow);
}

/* --- Coins en équerre HUD ---------------------------------------------- */

.ns-hud-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 0 solid var(--c-cyan-glow);
  opacity: 0.7;
}

.ns-hud-corner--tl { top: 0;    left: 0;  border-top-width: 1px;    border-left-width: 1px; }
.ns-hud-corner--tr { top: 0;    right: 0; border-top-width: 1px;    border-right-width: 1px; }
.ns-hud-corner--bl { bottom: 0; left: 0;  border-bottom-width: 1px; border-left-width: 1px; }
.ns-hud-corner--br { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

/* --- Hero (DESIGN.md §5.2, effet 2) ------------------------------------ */

.ns-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 7rem clamp(1rem, 5vw, 5rem) 6rem;
  overflow: hidden;
  isolation: isolate;
  background: var(--c-void);
}

.ns-hero__stage {
  position: absolute;
  inset: 0;
  z-index: -1;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.ns-hero__layer {
  position: absolute;
  inset: -8%;
}

/* Calque 1 : ville lointaine. Assombrissement et flou de profondeur sont cuits dans
   l'image (1280/1920 ; la 768 mobile reste nette) — un filter CSS coûte trop cher. */
.ns-hero__layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ns-hero__layer--bg img {
  object-position: 50% 40%;
}

.ns-hero__layer--bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 18, 0.25);
}

/* Calque 2 : tour monolithe, détourée (alpha tiré de la luminance, préparé hors ligne) */
.ns-hero__layer--structure img {
  object-position: 100% 100%;
  opacity: 0.55;
  transform: scale(0.72);
  transform-origin: 84% 100%;
}

/* Calque 3 : brume volumétrique + grille au sol fuyant vers l'horizon */
.ns-hero__layer--fog {
  overflow: hidden;
  perspective: 600px;
  background:
    linear-gradient(90deg, rgba(7, 10, 18, 0.9) 0%, rgba(7, 10, 18, 0.6) 42%, rgba(7, 10, 18, 0) 72%),
    radial-gradient(60% 40% at 75% 60%, rgba(124, 58, 237, 0.2), transparent 70%),
    radial-gradient(45% 35% at 92% 30%, rgba(8, 145, 178, 0.16), transparent 70%),
    linear-gradient(to top, var(--c-void) 0%, rgba(7, 10, 18, 0) 24%);
}

.ns-hero__floor {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: -10%;
  height: 70%;
  background-image:
    linear-gradient(to right, rgba(34, 211, 238, 0.3) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(34, 211, 238, 0.3) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: rotateX(72deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 20%, transparent 85%);
  mask-image: linear-gradient(to top, transparent 0%, #000 20%, transparent 85%);
}

/* Calque 4 : poutres et câbles en silhouette, au plus près de la caméra */
.ns-hero__layer--front img {
  object-position: 50% 100%;
  opacity: 0.9;
  transform: scale(1.38);        /* ne garde que l'encadrement des bords */
  transform-origin: 50% 45%;
}

/* Cadre HUD (s'efface au défilement) */
.ns-hero__layer--hud {
  inset: 6.5rem clamp(1rem, 3vw, 3rem) 2rem;
}

.ns-hero__coords,
.ns-hero__depth {
  position: absolute;
  bottom: 0.75rem;
}

.ns-hero__coords { left: 1.75rem; }
.ns-hero__depth  { right: 1.75rem; }

/* Contenu — jamais animé en parallaxe */
.ns-hero__inner {
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.ns-hero__index {
  margin-bottom: var(--sp-4);
}

.ns-hero__content p {
  max-width: none;
  margin: 0 0 var(--sp-3);
  color: var(--c-text-muted);
  font-family: var(--f-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  line-height: 1.9;
  text-transform: uppercase;
}

.ns-hero__content p em {
  font-style: normal;
}

.ns-hero__content h1 {
  max-width: 15ch;
  margin: 0;
  font-size: clamp(2.5rem, 6.2vw + 0.5rem, 7.5rem);
  font-stretch: 125%;
  font-weight: 900;
  line-height: var(--lh-tight);
}

.ns-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3) var(--sp-4);
  margin-top: var(--sp-6);
}

.ns-hero__status {
  margin: 0;
}

.ns-hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 2.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  text-decoration: none;
  transform: translateX(-50%);
}

.ns-hero__scroll:hover {
  color: var(--c-cyan-glow);
}

/* --- Chapitres (strates) ------------------------------------------------ */

.ns-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 5rem);
}

.ns-chapter {
  position: relative;
  isolation: isolate;
  padding: clamp(6rem, 12vw, 10rem) 0;
  overflow: clip;            /* pas « hidden » : garderait la figure collante (sticky) */
  perspective: 1200px;       /* strates en Z (§5.2, effet 1) */
  perspective-origin: 50% 0;
}

/* Grille technique : pas de 8 px, renforcée tous les 64 px (§6) */
.ns-chapter::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--c-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--c-line) 1px, transparent 1px),
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px, 8px 8px, 8px 8px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
  pointer-events: none;
}

/* Fond de strate perdu dans le brouillard (§5.2, effet 6) */
.ns-chapter__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.ns-chapter__bg img {
  position: absolute;
  top: -10%;
  left: 0;
  width: 100%;
  height: 120%;
  object-fit: cover;
  opacity: 0.45;              /* flou cuit dans les versions 1280/1920 */
}

.ns-chapter__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, var(--c-void) 0%, rgba(7, 10, 18, 0.55) 25%, rgba(7, 10, 18, 0.55) 70%, var(--c-void) 100%);
}

.ns-chapter__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}

.ns-chapter__grid--reverse {
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

.ns-chapter__grid--reverse .ns-chapter__aside {
  order: -1;
}

.ns-chapter__aside--sticky {
  position: sticky;
  top: 6rem;
  align-self: start;
}

.ns-chapter__head {
  margin-bottom: var(--sp-6);
}

.ns-chapter__head .hud {
  margin: 0 0 var(--sp-3);
}

.ns-chapter__title {
  margin: 0;
  font-size: var(--fs-h2);
  font-stretch: 125%;
  font-weight: 900;
}

/* Texte courant */
.ns-prose p {
  margin: 0 0 var(--sp-3);
  color: var(--c-text-muted);
}

.ns-prose strong {
  color: var(--c-text);
  font-weight: 600;
}

.ns-prose--lede p:first-child {
  color: var(--c-text);
  font-size: clamp(1.25rem, 0.8vw + 1rem, 1.625rem);
  line-height: 1.45;
}

.ns-prose--lede p:first-child em {
  font-style: normal;
}

.ns-chapter .ns-btn {
  margin-top: var(--sp-4);
}

.ns-btn--ghost::after {
  content: "→";
  transition: transform var(--dur-base) var(--ease-out);
}

.ns-btn--ghost:hover::after {
  transform: translateX(4px);
}

/* Icônes Lucide, trait 1.5 px */
.ns-icon {
  display: inline-flex;
  color: var(--c-cyan-glow);
}

.ns-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.5;
}

.ns-icon img {
  width: 24px;
  height: 24px;
}

/* Blocs numérotés (Compétences) */
.ns-blocks {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.ns-block {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: var(--sp-2);
  margin: 0;
  padding: var(--sp-4) 0;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.ns-block__meta {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding-top: 0.3rem;
}

.ns-block__body h3 {
  margin: 0 0 var(--sp-2);
  font-size: clamp(1.25rem, 1vw + 0.9rem, 1.625rem);
  font-stretch: 112%;
  line-height: 1.1;
}

.ns-block__body p:last-child {
  margin-bottom: 0;
}

/* Figure HUD en duotone violet / cyan */
.ns-figure {
  margin: 0;
}

.ns-figure__frame {
  position: relative;
  padding: 10px;
  border: 1px solid var(--c-line);
  background: rgba(15, 23, 42, 0.6);
}

.ns-figure__frame img {
  display: block;
  width: 100%;
  height: auto;
  filter: grayscale(1) contrast(1.2) brightness(0.8);
}

.ns-figure__frame::before,
.ns-figure__frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 1;                /* au-dessus de l'image (son filtre crée un contexte d'empilement) */
  pointer-events: none;
}

.ns-figure__frame::before {
  background: linear-gradient(160deg, var(--c-violet) 0%, var(--c-indigo) 45%, var(--c-cyan) 100%);
  mix-blend-mode: color;
}

.ns-figure__frame::after {
  background: repeating-linear-gradient(to bottom, rgba(7, 10, 18, 0.35) 0 1px, transparent 1px 3px);
}

.ns-figure figcaption {
  margin-top: 0.75rem;
}

/* Cartes (Points forts) : panneau technique à filets partagés */
.ns-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--c-line);
  border: 1px solid var(--c-line);
}

.ns-card {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: none;
  margin: 0;
  padding: var(--sp-4);
  background:
    linear-gradient(rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.9)),
    url("../images/texture-concrete.webp") 0 0 / 512px;
  transition: background-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}

.ns-card:hover {
  background:
    linear-gradient(rgba(25, 33, 52, 0.88), rgba(25, 33, 52, 0.88)),
    url("../images/texture-concrete.webp") 0 0 / 512px;
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.45), var(--glow-cyan);
  z-index: 1;
}

.ns-card .ns-hud-corner {
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}

.ns-card:hover .ns-hud-corner {
  opacity: 1;
}

.ns-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--sp-6);
}

.ns-card__title {
  margin: 0 0 var(--sp-1);
  font-size: 1.25rem;
  font-stretch: 112%;
  line-height: 1.15;
}

.ns-card__text {
  margin: 0;
  color: var(--c-text-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* Figure aux couleurs d'origine : pas de duotone, scanlines conservées */
.ns-figure--native .ns-figure__frame img {
  filter: saturate(0.95) brightness(0.92);
}

.ns-figure--native .ns-figure__frame::before {
  content: none;
}

/* --- Projets : registre incliné (§5.2, effet 4) ------------------------- */

.ns-projects__stage {
  margin-top: var(--sp-8);
  perspective: 1400px;
  perspective-origin: 50% 0;
}

.ns-projects__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
  transform-origin: 50% 0;       /* pas de preserve-3d : fausse le hit-test des survols dans Chrome */
}

.ns-projects__cell {
  display: flex;
  max-width: none;
  margin: 0;
}

.ns-project {
  --gx: 50%;
  --gy: 0%;
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: var(--sp-4);
  overflow: hidden;
  border: 1px solid var(--c-line);
  background:
    linear-gradient(rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.92)),
    url("../images/texture-concrete.webp") 0 0 / 512px;
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}

/* Bord actif : le dégradé strata, réservé à la carte survolée */
.ns-project::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  background: var(--grad-strata);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
  pointer-events: none;
}

.ns-project:hover {
  border-color: transparent;
  box-shadow: var(--glow-cyan);
}

.ns-project:hover::before {
  opacity: 1;
}

/* Reflet lumineux qui suit le pointeur */
.ns-project__glare {
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--gx) var(--gy), rgba(34, 211, 238, 0.14), transparent 60%);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
  pointer-events: none;
}

.ns-project:hover .ns-project__glare {
  opacity: 1;
}

.ns-project .ns-hud-corner {
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}

.ns-project:hover .ns-hud-corner {
  opacity: 1;
}

.ns-project__logo {
  display: flex;
  align-items: center;
  height: 56px;
  margin-bottom: var(--sp-4);
}

.ns-project__logo img {
  max-width: 100%;
  height: auto;
  opacity: 0.85;
  transition: opacity var(--dur-base) var(--ease-out);
}

.ns-project:hover .ns-project__logo img {
  opacity: 1;
}

.ns-project__index {
  margin: 0 0 var(--sp-1);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-line);
}

.ns-project__title {
  margin: 0 0 var(--sp-1);
  font-size: 1.25rem;
  font-stretch: 112%;
  line-height: 1.15;
}

.ns-project__text {
  margin: 0;
  color: var(--c-text-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

@media (max-width: 1023px) {
  .ns-projects__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 599px) {
  .ns-projects__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Contact : fiche de liaison + panneau de transmission --------------- */

.ns-contact__grid {
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  align-items: start;
}

.ns-dossier {
  position: relative;
  margin-top: var(--sp-6);
  padding: var(--sp-4);
  border: 1px solid var(--c-line);
  background: rgba(15, 23, 42, 0.7);
}

.ns-dossier__label {
  margin: 0 0 var(--sp-2);
}

.ns-dossier__body h3 {
  margin: 0 0 var(--sp-1);
  font-size: var(--fs-h3);
  font-stretch: 112%;
}

.ns-dossier__body p {
  margin: 0 0 var(--sp-1);
  color: var(--c-text-muted);
}

/* Ville en étiquette HUD (2e élément : le paragraphe qui suit le nom) */
.ns-dossier__body h3 + p {
  margin-bottom: var(--sp-3);
  color: var(--c-cyan-glow);
  font-family: var(--f-mono);
  font-size: var(--fs-hud);
  letter-spacing: var(--ls-hud);
  text-transform: uppercase;
}

.ns-dossier__body strong {
  color: var(--c-text);
  font-weight: 500;
}

.ns-dossier__body #email-link {
  margin-bottom: var(--sp-3);
}

.ns-dossier__body p:last-child {
  margin: var(--sp-3) 0 0;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-line);
}

.ns-contact__panel {
  position: relative;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border: 1px solid var(--c-line);
  background:
    linear-gradient(rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.92)),
    url("../images/texture-concrete.webp") 0 0 / 512px;
}

/* Trait de signal en haut du panneau */
.ns-contact__panel::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 96px;
  height: 2px;
  background: var(--c-cyan-glow);
  box-shadow: var(--glow-cyan);
}

.ns-contact__panel-label {
  margin: 0 0 var(--sp-4);
}

/* Formulaire Grav */
.ns-contact .form-field {
  margin: 0 0 var(--sp-3);
}

.ns-contact .form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--c-text-muted);
  font-family: var(--f-mono);
  font-size: var(--fs-hud);
  font-weight: 500;
  letter-spacing: var(--ls-hud);
  text-transform: uppercase;
}

.ns-contact .form-label .required {
  margin-left: 0.25em;
  color: var(--c-cyan-glow);
  font-size: inherit;
  vertical-align: baseline;
}

.ns-contact .form-input::placeholder {
  color: var(--c-text-muted);
  opacity: 0.75;
}

.ns-contact__intro p:first-child {
  color: var(--c-text);
  font-size: 1.125rem;
}

.ns-contact .form-input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: var(--radius-1);
  background: rgba(7, 10, 18, 0.7);
  color: var(--c-text);
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.ns-contact textarea.form-input {
  min-height: 10rem;
  resize: vertical;
}

.ns-contact .form-input:hover {
  border-color: rgba(148, 163, 184, 0.45);
}

.ns-contact .form-input:focus {
  border-color: var(--c-cyan-glow);
  box-shadow: var(--glow-cyan);
  outline: none;
}

.ns-contact .form-input:focus-visible {
  outline: 2px solid var(--c-cyan-glow);
  outline-offset: 2px;
}

.ns-contact .form-label-wrapper:empty,
.ns-contact .form-label:empty {
  display: none;
}

.ns-contact .turnstile-container {
  min-height: 65px;
}

.ns-contact .buttons {
  margin-top: var(--sp-4);
}

.ns-contact .buttons .ns-btn {
  border: 0;
}

/* Messages du plugin Form (succès / erreur) */
.ns-contact .notices,
.ns-contact .alert {
  margin: 0 0 var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--c-line);
  border-left: 2px solid var(--c-green-glow);
  background: rgba(34, 197, 94, 0.08);
  color: var(--c-text);
  font-family: var(--f-mono);
  font-size: 0.875rem;
}

.ns-contact .notices.red,
.ns-contact .alert.red,
.ns-contact .notices.error {
  border-left-color: var(--c-alert);
  background: rgba(255, 77, 94, 0.08);
}

@media (max-width: 1023px) {
  .ns-contact__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Pied de page : fin de la descente ---------------------------------- */

#footer.ns-footer {
  position: relative;
  padding: var(--sp-8) 0 var(--sp-4);
  background: var(--c-void);
  color: var(--c-text-muted);
  text-align: left;
}

/* Filet signature en tête du pied de page (seul dégradé de cet écran) */
.ns-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--grad-strata);
  opacity: 0.8;
}

.ns-footer__grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-bottom: var(--sp-6);
}

.ns-footer__brand .ns-logo img {
  width: auto;
  height: 26px;
}

.ns-footer__brand .hud {
  margin: var(--sp-2) 0 0;
}

.ns-footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ns-footer__nav li {
  margin: 0;
}

.ns-footer__nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 44px;
  color: var(--c-text);
  font-family: var(--f-mono);
  font-size: var(--fs-hud);
  letter-spacing: var(--ls-hud);
  text-decoration: none;
  text-transform: uppercase;
}

.ns-footer__nav a:hover {
  color: var(--c-cyan-glow);
}

.ns-footer__nav .ns-icon svg {
  width: 16px;
  height: 16px;
}

.ns-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-line);
}

.ns-footer__bottom .hud {
  margin: 0;
}

/* --- Page de texte (mentions légales) ----------------------------------- */

.ns-page {
  padding-top: calc(4.5rem + var(--sp-12));
}

.ns-page__inner {
  max-width: 960px;
}

.ns-page__title {
  font-size: var(--fs-h2);
}

.ns-page__content h2,
.ns-page__content h3 {
  margin: var(--sp-6) 0 var(--sp-2);
  font-size: var(--fs-h3);
  font-stretch: 110%;
  text-transform: none;
}

.ns-page__content ul {
  color: var(--c-text-muted);
}

/* --- Tunnel de transition (§5.2, effet 5) ------------------------------- */

.ns-tunnel {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--c-void);
}

/* Bandeaux ambre façon ruban de chantier (signalétique, §6) */
.ns-tunnel::before,
.ns-tunnel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  height: 6px;
  background: repeating-linear-gradient(-45deg, var(--c-amber) 0 10px, transparent 10px 20px);
  opacity: 0.75;
}

.ns-tunnel::before { top: 0; }
.ns-tunnel::after  { bottom: 0; }

.ns-tunnel__viewport {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  perspective: 900px;
}

.ns-tunnel__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  filter: brightness(0.75) saturate(0.9);
}

.ns-tunnel__frames {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.ns-tunnel__frame {
  position: absolute;
  inset: 0;
  width: min(56vw, 760px);
  height: min(35vw, 475px);
  margin: auto;
  border: 1px solid var(--c-cyan-glow);
  box-shadow: var(--glow-cyan), inset 0 0 18px rgba(34, 211, 238, 0.25);
  transform: translateZ(calc(var(--i) * -320px));
  opacity: calc(1 - var(--i) * 0.13);
}

.ns-tunnel__frame:nth-child(even) {
  border-color: var(--c-violet-glow);
  box-shadow: var(--glow-violet), inset 0 0 18px rgba(124, 58, 237, 0.3);
}

.ns-tunnel__label {
  position: relative;
  z-index: 2;
  padding: var(--sp-4) var(--sp-6);
  text-align: center;
  background: radial-gradient(closest-side, rgba(7, 10, 18, 0.85), rgba(7, 10, 18, 0));
}

.ns-tunnel__label .hud {
  margin: 0 auto;
}

.ns-tunnel__title {
  max-width: 18ch;
  margin: var(--sp-2) auto;
  color: var(--c-text);
  font-family: var(--f-display);
  font-size: clamp(1.75rem, 3vw + 0.5rem, 3.25rem);
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: var(--ls-display);
  line-height: var(--lh-tight);
  text-transform: uppercase;
}

@media (max-width: 1023px) {
  .ns-chapter__grid,
  .ns-chapter__grid--reverse {
    grid-template-columns: minmax(0, 1fr);
  }

  .ns-chapter__grid--reverse .ns-chapter__aside {
    order: 0;
  }

  .ns-chapter__aside--sticky {
    position: static;
  }

  .ns-chapter__aside .ns-figure {
    max-width: 32rem;
  }

  .ns-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .ns-chapter__title {
    font-stretch: 110%;
  }

  .ns-block {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-2);
  }

  .ns-block__meta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .ns-tunnel__frame {
    width: 82vw;
    height: 52vw;
  }
}

@media (max-width: 559px) {
  .ns-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .ns-card__top {
    padding-bottom: var(--sp-4);
  }
}

/* --- Responsive du hero ------------------------------------------------- */

@media (max-width: 767px) {
  .ns-hero {
    justify-content: flex-end;
    padding-top: 6rem;
    padding-bottom: 7rem;
  }

  .ns-hero__layer--bg img {
    object-position: 60% 50%;
  }

  .ns-hero__layer--structure img {
    object-position: 80% 30%;
    opacity: 0.6;
  }

  .ns-hero__layer--front {
    display: none;
  }

  .ns-hero__layer--fog {
    background: linear-gradient(to top, rgba(7, 10, 18, 0.95) 15%, rgba(7, 10, 18, 0.45) 70%);
  }

  .ns-hero__layer--hud {
    inset: 5rem 0.75rem 1rem;
  }

  .ns-hero__coords { left: 1rem; }
  .ns-hero__depth  { display: none; }

  .ns-hero__content h1 {
    font-stretch: 112%;
  }

  .ns-hero__actions .ns-btn {
    width: 100%;
    justify-content: center;
  }

  .ns-hero__scroll {
    display: none;
  }
}
