/* ==========================================================================
   Nilton — couche « tech / dither »
   Chargée après main.css : elle redéfinit les tokens et remplace les effets
   flous (orbes, verre, ombres larges, pilules) par des trames Bayer, des
   filets fins et une typo mono / pixel. Les motifs tramés viennent de
   /assets/js/dither.js (variables --dither-*). Sans JS, la page reste nette,
   simplement sans trame.
   ========================================================================== */

:root {
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --font-pixel: 'Geist Pixel', 'Geist Mono', ui-monospace, monospace;

  --color-ink: #161b22;
  --color-text: #161b22;
  --color-muted: rgba(22, 27, 34, 0.66);
  --color-line: rgba(22, 27, 34, 0.12);
  --color-line-strong: rgba(22, 27, 34, 0.28);
  --color-night: #0f1319;

  --dither-accent: #e84b3c;
  --dither-ink: #161b22;

  --radius-xl: 14px;
  --radius-lg: 10px;
  --radius-md: 8px;
  --radius-sm: 4px;
  --shadow-soft: none;
  --shadow-strong: 0 24px 48px -32px rgba(22, 27, 34, 0.35);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

body {
  background: #ffffff;
  counter-reset: section-index;
}

::selection {
  background: var(--color-accent);
  color: #fff;
}

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

/* ---- Typo ---------------------------------------------------------------- */

h1,
h2,
h3 {
  letter-spacing: -0.02em;
}

.section-title {
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
}

/* Index de section : [01], [02]… en mono, au-dessus de chaque titre. */
.section-heading {
  counter-increment: section-index;
}

.section-heading::before {
  content: '[' counter(section-index, decimal-leading-zero) ']';
  display: block;
  margin-bottom: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--color-accent);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
}

.eyebrow::before {
  content: '';
  width: 0.6em;
  height: 0.6em;
  flex: none;
  background: currentColor;
  animation: dither-blink 1.1s steps(1) infinite;
}

/* ---- Boutons : coins nets, label mono, remplissage tramé au survol -------- */

.btn {
  isolation: isolate;
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.45rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.2;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(100% + 64px);
  z-index: -1;
  background:
    var(--dither-ramp, linear-gradient(90deg, var(--color-ink), transparent)) right top / 64px 32px repeat-y,
    linear-gradient(var(--color-ink), var(--color-ink)) left top / calc(100% - 64px) 100% no-repeat;
  image-rendering: pixelated;
  transform: translateX(-100%);
  transition: transform 0.55s var(--ease-out);
  pointer-events: none;
}

.btn:hover::before,
.btn:focus-visible::before {
  transform: translateX(0);
}

.btn-primary,
.btn-primary:hover {
  box-shadow: none;
  transform: none;
}

.btn-tertiary,
.btn-tertiaire {
  border: 1px solid var(--color-line-strong);
  background: transparent;
  color: var(--color-text);
}

.btn-tertiary:hover,
.btn-tertiaire:hover,
.btn-tertiaire:focus-visible {
  background: transparent;
  border-color: var(--color-ink);
  color: #fff;
}

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

.site-header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-line);
}

/* Curseur de terminal après le logo. */
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.12em;
  letter-spacing: -0.01em;
}

.brand::after {
  content: '';
  width: 0.5em;
  height: 0.14em;
  background: var(--color-accent);
  animation: dither-blink 1.1s steps(1) infinite;
}

.site-nav__indicator {
  height: 3px;
  border-radius: 0;
  background: var(--color-accent);
}

.nav-cta {
  padding: 0.8rem 1.2rem;
}

.nav-toggle {
  border-radius: var(--radius-sm);
}

.nav-line {
  border-radius: 0;
}

/* ---- Héros ---------------------------------------------------------------- */

.hero__orb {
  display: none;
}

/* Grille de points fine à la place du quadrillage. */
.hero__grid {
  background: radial-gradient(circle, rgba(22, 27, 34, 0.18) 1px, transparent 1.4px) 0 0 / 24px 24px;
  opacity: 0.55;
  animation: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 60%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 60%, transparent 100%);
}

.dither-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 1;
}

/* Le fond du héros forme sa propre pile : ses calques restent derrière le contenu. */
.hero__background {
  z-index: 0;
}

.hero__inner {
  z-index: 1;
}

/* Grille « low pixel » (dither.js) : remplace la grille de points. */
.has-dither .hero__grid {
  display: none;
}

.pixel-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 70%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 70%, transparent 100%);
}

.pixel-grid__tags {
  position: absolute;
  inset: 1.4rem 1.6rem;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr auto;
  align-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: rgba(22, 27, 34, 0.42);
  pointer-events: none;
}

.pixel-grid__tags span:nth-child(even) {
  justify-self: end;
}

.pixel-grid__tags span:nth-child(n + 3) {
  grid-row: 3;
}

@media (max-width: 1080px) {
  .pixel-grid__tags span:nth-child(n + 3) {
    display: none;
  }
}

@media (max-width: 720px) {
  .pixel-grid__tags {
    display: none;
  }
}

.hero__background .dither-field {
  opacity: 0.92;
}

.hero__title {
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

/* Le showreel devient un moniteur : filet fin, repères d'angle, métadonnées mono. */
.hero__reel {
  position: relative;
  padding: 0.75rem;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: none;
  backdrop-filter: none;
}

.hero__reel::before {
  content: '';
  position: absolute;
  inset: -7px;
  pointer-events: none;
  --tick: var(--color-ink);
  background:
    linear-gradient(var(--tick), var(--tick)) top left / 14px 2px no-repeat,
    linear-gradient(var(--tick), var(--tick)) top left / 2px 14px no-repeat,
    linear-gradient(var(--tick), var(--tick)) top right / 14px 2px no-repeat,
    linear-gradient(var(--tick), var(--tick)) top right / 2px 14px no-repeat,
    linear-gradient(var(--tick), var(--tick)) bottom left / 14px 2px no-repeat,
    linear-gradient(var(--tick), var(--tick)) bottom left / 2px 14px no-repeat,
    linear-gradient(var(--tick), var(--tick)) bottom right / 14px 2px no-repeat,
    linear-gradient(var(--tick), var(--tick)) bottom right / 2px 14px no-repeat;
}

.hero__reel::after {
  content: '00:01:21:00';
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  height: 1.9rem;
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--color-muted);
}

.hero__badge {
  gap: 0.6em;
  align-items: center;
  height: 1.9rem;
  padding: 0 0.15rem;
  margin-bottom: 0.6rem;
  border-radius: 0;
  background: none;
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero__badge::before {
  content: 'REC';
  padding: 0.2em 0.5em;
  background: var(--color-accent);
  color: #fff;
  letter-spacing: 0.1em;
  animation: dither-blink 1.4s steps(1) infinite;
}

.hero__reel-frame {
  border-radius: 2px;
  border: none;
  background: var(--color-ink);
}

.hero__metrics {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero__metrics {
  position: relative;
  gap: 0.75rem;
}

/* Tuiles de données posées sur la trame. */
.hero__metrics li {
  min-width: 9.5rem;
  padding: 0.9rem 1.1rem 0.8rem;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
}

.metric__value {
  font-family: var(--font-pixel);
  font-size: clamp(2.2rem, 3.4vw, 3rem);
  font-weight: 400;
  line-height: 1;
  margin-bottom: 0.45rem;
}

.metric__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---- Taches tramées à la place des orbes floues -------------------------- */

.section.has-orb::before,
.section.has-orb::after {
  width: 384px;
  height: 384px;
  border-radius: 0;
  filter: none;
  background: var(--dither-blob) center / 100% 100% no-repeat;
  image-rendering: pixelated;
  opacity: 0.28;
}

.section.has-orb::after {
  background-image: var(--dither-ring);
  opacity: 0.12;
}

/* ---- Logos clients -------------------------------------------------------- */

.clients {
  background: transparent;
  backdrop-filter: none;
  border-block: 1px solid var(--color-line);
}

.client-logo {
  border-radius: var(--radius-sm);
  border-color: var(--color-line);
  background: #fff;
  box-shadow: none;
}

/* ---- Méthode (timeline) --------------------------------------------------- */

.timeline {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: none;
}

.timeline__progress {
  width: 2px;
  background: repeating-linear-gradient(180deg, var(--color-line-strong) 0 4px, transparent 4px 8px);
}

.timeline__progress span {
  border-radius: 0;
  background: repeating-linear-gradient(180deg, var(--color-accent) 0 4px, transparent 4px 8px);
}

.timeline-step::before {
  width: 14px;
  height: 14px;
  border-radius: 0;
  border-width: 2px;
}

.timeline-step.is-active::before {
  background: var(--color-accent);
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--color-accent);
  transform: none;
}

.timeline-step__index {
  padding: 0;
  border-radius: 0;
  background: none;
  font-family: var(--font-pixel);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0;
}

/* ---- Filtres de la galerie ------------------------------------------------ */

.filters--sticky {
  background: rgba(255, 255, 255, 0.95);
}

/* Respiration entre les filtres (Réinitialiser, Galerie complète) et la grille de vidéos. */
.filters__inner {
  margin-bottom: clamp(2rem, 3.5vw, 3rem);
}

.filter-chip {
  border-radius: var(--radius-sm);
  border-color: var(--color-line-strong);
  background: #fff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-chip.is-active {
  background: var(--color-ink);
  box-shadow: none;
}

.filters__count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---- Cartes projet -------------------------------------------------------- */

.project-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-line);
  background: #fff;
  box-shadow: none;
  transition: transform 0.35s var(--ease-out), border-color 0.25s ease;
}

.project-card::before {
  display: none;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-ink);
  box-shadow: none;
}

.project-card__media {
  background: var(--color-ink);
}

/* Vague de pixels au survol (dither.js). */
.card-wave {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
}

.project-card:hover .project-card__media > img,
.project-card:hover .project-card__media > .project-card__video {
  transform: scale(1.02);
}

.project-card__content {
  padding: 1.4rem 1.5rem 1.6rem;
  gap: 0.75rem;
}

.project-card__badge {
  padding: 0.3rem 0.55rem;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.project-card__title {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.project-card__footer {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-empty {
  border-radius: var(--radius-sm);
}

/* ---- Forfait -------------------------------------------------------------- */

.plan {
  background: transparent;
  border-block: 1px solid var(--color-line);
}

.plan__card {
  border-radius: var(--radius-lg);
  background: var(--color-night);
  isolation: isolate;
  box-shadow: none;
}

.plan__card::before,
.plan__card::after {
  display: none;
}

.plan__card:hover,
.plan__card.is-active {
  box-shadow: none;
}

.plan__card > :not(.dither-field) {
  position: relative;
  z-index: 1;
}

.plan__card .dither-field {
  opacity: 0.5;
}

.plan__amount {
  font-family: var(--font-pixel);
  font-weight: 400;
  letter-spacing: 0;
}

.plan__tag {
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 2px;
}

/* ---- Expertises ----------------------------------------------------------- */

.expertise-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-line);
  background: #fff;
  box-shadow: none;
  transition: transform 0.35s var(--ease-out), border-color 0.25s ease;
}

.expertise-card::before {
  display: none;
}

.expertise-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-ink);
}

/* Liseré tramé qui monte du bas de la carte, par paliers. Il reste dans la marge
   intérieure (moins haut que le padding) pour ne jamais passer sous le texte. */
.expertise-card::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 18px;
  z-index: -1;
  /* On ne montre que le bas, le plus dense, du motif (points de 2 px conservés). */
  background: var(--dither-rise) 0 100% / 256px 96px repeat-x;
  image-rendering: pixelated;
  transform: translateY(100%);
  transition: transform 0.3s steps(3, end);
  pointer-events: none;
}

.expertise-card:hover::after {
  transform: translateY(0);
}

/* Cadre de l'animation pixel : petit écran à trame de points. */
.expertise-card__icon {
  width: 100%;
  height: 120px;
  margin: 0 0 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background:
    radial-gradient(circle, rgba(22, 27, 34, 0.12) 1px, transparent 1.4px) 0 0 / 12px 12px,
    #fafafa;
  filter: none;
}

.pixel-scene {
  display: block;
  flex: none;
  image-rendering: pixelated;
}

/* ---- Témoignages ---------------------------------------------------------- */

.testimonials {
  background: transparent;
  backdrop-filter: none;
}

.testimonials__carousel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-line);
  background: #fff;
  box-shadow: none;
}

.testimonials__carousel::before {
  display: none;
}

.testimonial-card {
  border-radius: var(--radius-md);
  border-color: var(--color-line);
  box-shadow: none;
}

.testimonial-logo {
  border-radius: 2px;
  font-family: var(--font-pixel);
  font-weight: 400;
}

.carousel__control {
  border-radius: var(--radius-sm);
  border-color: var(--color-line-strong);
  background: #fff;
  box-shadow: none;
}

/* ---- Contact (section sombre, entrée en fondu tramé) ---------------------- */

.contact {
  isolation: isolate;
  background: var(--color-night);
}

.contact::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 64px;
  z-index: 1;
  background: var(--dither-fade-paper) 0 0 / 256px 64px repeat-x;
  image-rendering: pixelated;
  pointer-events: none;
}

.contact .dither-field {
  opacity: 0.75;
}

.contact > .container {
  position: relative;
  z-index: 1;
}

.contact .section-heading::before,
.contact .eyebrow {
  color: var(--color-accent);
}

.contact__form {
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(4px);
}

.contact__form label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.contact__form input,
.contact__form textarea {
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
}

.contact__form input:focus,
.contact__form textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.contact .btn::before {
  background:
    var(--dither-ramp-paper, linear-gradient(90deg, #fff, transparent)) right top / 64px 32px repeat-y,
    linear-gradient(#fff, #fff) left top / calc(100% - 64px) 100% no-repeat;
}

.contact .btn-primary:hover,
.contact .btn-primary:focus-visible {
  color: var(--color-ink);
}

/* ---- À propos ------------------------------------------------------------- */

.about__frame {
  border-radius: var(--radius-sm);
  border-color: var(--color-line-strong);
  box-shadow: none;
}

/* ---- Pied de page : fondu tramé et grand logotype pixel ------------------- */

.site-footer {
  position: relative;
  overflow: hidden;
  background: var(--color-night);
  padding-top: calc(3rem + 48px);
  padding-bottom: 0;
}

.site-footer::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 64px;
  background: var(--dither-fade-paper) 0 0 / 256px 64px repeat-x;
  image-rendering: pixelated;
  pointer-events: none;
}

.site-footer::after {
  content: 'NILTON' / '';
  display: block;
  margin-top: 1.5rem;
  font-family: var(--font-pixel);
  font-size: clamp(5rem, 24vw, 22rem);
  line-height: 0.78;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--color-accent);
  opacity: 0.9;
  pointer-events: none;
  user-select: none;
}

/* Version JS : le logotype devient des particules qui fuient le curseur. */
.has-wordmark .site-footer::after {
  display: none;
}

.footer-wordmark {
  display: block;
  width: 100%;
  margin-top: 1.5rem;
}

.footer-block h3 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
}

.footer-bottom {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

/* ---- Sections tramées génériques (data-dither="halftone|ascii") ----------- */

[data-dither] {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

[data-dither] > :not(.dither-field) {
  position: relative;
  z-index: 1;
}

/* ---- Fiches projet -------------------------------------------------------- */

.project-detail__hero {
  position: relative;
  overflow: hidden;
  padding-top: clamp(4rem, 8vw, 6rem);
}

.project-detail__hero > .container {
  position: relative;
  z-index: 1;
}

.project-detail__breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.72rem !important;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.project-detail__back {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Numéro de fiche en police pixel, comme un index d'archive. */
.project-detail__index {
  margin: 0.4rem 0 1rem;
  font-family: var(--font-pixel);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1;
  color: var(--color-accent);
}

.project-detail__index span {
  color: var(--color-line-strong);
}

.project-detail__tag {
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project-detail__title {
  font-weight: 600;
  letter-spacing: -0.04em;
}

.project-detail__client {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-detail__info,
.project-detail__media,
.project-detail__markdown {
  border-radius: var(--radius-lg);
  border-color: var(--color-line);
  background: #fff;
  box-shadow: none;
}

.project-detail__client-logo {
  border-radius: var(--radius-sm);
  background:
    radial-gradient(circle, rgba(22, 27, 34, 0.14) 1px, transparent 1.4px) 0 0 / 12px 12px,
    #fafafa;
}

.project-detail__domain {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

/* Fiche technique : clé à gauche, valeur à droite, pointillés entre les deux. */
.project-detail__specs {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.project-detail__specs div {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.project-detail__specs div::after {
  content: '';
  order: 1;
  flex: 1;
  min-width: 1rem;
  border-bottom: 1px dotted var(--color-line-strong);
}

.project-detail__specs dt {
  order: 0;
  color: var(--color-muted);
  text-transform: uppercase;
}

.project-detail__specs dd {
  order: 2;
  margin: 0;
  color: var(--color-text);
  text-align: right;
}

/* Aperçu façon moniteur. */
.project-detail__media {
  position: relative;
  background: var(--color-ink);
}

.media-hud {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
}

.media-hud > span {
  position: absolute;
  padding: 0.25em 0.55em;
  background: rgba(15, 19, 25, 0.78);
}

.media-hud__rec {
  top: 0.75rem;
  left: 0.75rem;
  background: var(--color-accent) !important;
  animation: dither-blink 1.4s steps(1) infinite;
}

.media-hud__name {
  top: 0.75rem;
  left: 3.6rem;
  max-width: calc(100% - 8.5rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-hud__format {
  top: 0.75rem;
  right: 0.75rem;
}

.media-hud__bar {
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  height: 6px;
  padding: 0 !important;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.28) 0 calc(100% / 24 - 2px), transparent calc(100% / 24 - 2px) calc(100% / 24)) !important;
}

.media-hud__bar i {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, var(--color-accent) 0 calc(100% / 24 - 2px), transparent calc(100% / 24 - 2px) calc(100% / 24));
  transform: scaleX(0);
  transform-origin: left;
}

/* La façade YouTube a son propre bouton : le moniteur reste discret en haut. */
.project-detail__media:has(.yt-facade) .media-hud__name {
  display: none;
}

.dither-reveal {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
}

/* Texte du projet : intertitres numérotés, puces carrées. */
.project-detail__markdown {
  counter-reset: project-heading;
}

.project-detail__markdown h2 {
  counter-increment: project-heading;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.project-detail__markdown h2::before {
  content: counter(project-heading, decimal-leading-zero) ' /';
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--color-accent);
}

.project-detail__markdown ul {
  list-style: none;
  padding-left: 0;
}

.project-detail__markdown li {
  position: relative;
  padding-left: 1.2rem;
}

.project-detail__markdown li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 6px;
  height: 6px;
  background: var(--color-accent);
}

.project-detail__related-links h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.project-detail__related-links ul {
  list-style: none;
  padding-left: 0 !important;
  border-top: 1px solid var(--color-line);
}

.project-detail__related-links li {
  margin: 0 !important;
  border-bottom: 1px solid var(--color-line);
}

.project-detail__related-links a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  color: var(--color-text) !important;
  transition: padding 0.25s var(--ease-out), color 0.2s ease;
}

.project-detail__related-links a::after {
  content: '→';
  font-family: var(--font-mono);
  color: var(--color-accent);
}

.project-detail__related-links a:hover {
  padding-left: 0.6rem;
  color: var(--color-accent) !important;
}

/* Appel à l'action : section sombre, demi-teinte qui suit la souris. */
.project-detail__cta {
  background: var(--color-night);
  color: #fff;
}

.project-detail__cta::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 64px;
  z-index: 1;
  background: var(--dither-fade-paper) 0 0 / 256px 64px repeat-x;
  image-rendering: pixelated;
  pointer-events: none;
}

.project-detail__cta h2 {
  color: #fff;
}

.project-detail__cta p {
  color: rgba(255, 255, 255, 0.74);
}

.project-detail__cta .dither-field {
  opacity: 0.45;
}

.project-detail__cta .btn::before {
  background:
    var(--dither-ramp-paper, linear-gradient(90deg, #fff, transparent)) right top / 64px 32px repeat-y,
    linear-gradient(#fff, #fff) left top / calc(100% - 64px) 100% no-repeat;
}

.project-detail__cta .btn:hover,
.project-detail__cta .btn:focus-visible {
  color: var(--color-ink);
}

.project-detail__cta .btn-tertiary {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* ---- Pages services ------------------------------------------------------- */

/* Les atouts d'une prestation (3 en général) occupent toute la largeur, quel que soit leur nombre. */
.service-benefits {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.service-steps__index {
  font-family: var(--font-pixel);
  font-weight: 400;
}

.service-faq__item summary {
  cursor: pointer;
}

/* ---- Animations ----------------------------------------------------------- */

@keyframes dither-blink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .eyebrow::before,
  .brand::after,
  .hero__badge::before {
    animation: none;
  }

  .btn::before {
    transition: none;
  }

  .expertise-card::after {
    transition: none;
  }

  .media-hud__rec {
    animation: none;
  }
}

@media (max-width: 720px) {
  .hero__reel::after {
    display: none;
  }

  .section.has-orb::before,
  .section.has-orb::after {
    width: 256px;
    height: 256px;
  }
}

/* ---- Finitions & accessibilité (phase 1) ---------------------------------- */

/* Rouge « texte » : le rouge de marque (#e84b3c) ne fait que 3,8:1 sur blanc.
   On garde le rouge vif pour les grands titres et les trames, et on utilise
   une teinte un cran plus dense (4,7:1) pour le petit texte et les boutons. */
:root {
  --color-accent-text: #d63a2c;
}

.btn-primary,
.nav-cta,
.hero__badge::before {
  background: var(--color-accent-text);
}

.section-heading::before,
.eyebrow,
.project-card__footer,
.btn-link,
.seo-intro__copy a {
  color: var(--color-accent-text);
}

/* Le héros reprend la grille du reste de la page (logo, sections). */
@media (min-width: 1081px) {
  .hero .hero__inner {
    width: min(1160px, 100% - 3rem);
  }
}

/* Mobile : les repères de la grille ne passent plus sur le surtitre. */
.hero__copy .eyebrow {
  position: relative;
  z-index: 1;
  padding: 0.25em 0.45em 0.25em 0;
  background: var(--color-bg);
}

/* Carte « Tout est inclus » : le contenu reste groupé en haut de la carte. */
.plan__features {
  align-content: start;
  align-self: start;
}

/* Défilé de logos : pause au survol et au focus (WCAG 2.2.2). */
.clients__marquee:hover .clients__track,
.clients__marquee:focus-within .clients__track {
  animation-play-state: paused;
}

/* Curseurs clignotants : quelques battements puis fixes (WCAG 2.2.2). */
@keyframes dither-blink-settle {
  0%, 49% { opacity: 1; }
  50%, 99% { opacity: 0; }
  100% { opacity: 1; }
}

.eyebrow::before,
.brand::after,
.hero__badge::before {
  animation: dither-blink-settle 1.1s steps(1) 4 forwards;
}

/* Les champs du formulaire héritent de la typo du site. */
.contact__form input,
.contact__form select,
.contact__form textarea,
.contact__form button {
  font: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .eyebrow::before,
  .brand::after,
  .hero__badge::before {
    animation: none;
  }
}

/* Mobile : bouton du sous-menu assez grand pour le pouce. */
@media (max-width: 920px) {
  .site-nav__sub-toggle {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ---- Phase 2 : page mobile plus courte ----------------------------------- */
@media (max-width: 720px) {
  .section {
    padding: 3rem 0;
  }
}
