/* =====================================================================
   JustiComm · en-tête « Le coup de marteau » · v7 (13/10/2026 ; v6 + retours d’Octave et de Pauline)
   La scène (marteau, pictogrammes, logo et fils de lumière) occupe toute la largeur du premier écran ;
   le descripteur (h1), le titre (h2), le slogan, le sous-titre et les boutons sont dessous, centrés.
   Composant autonome : toutes les classes commencent par .marteau ; le script (js/hero-marteau.js) ne lit
   que des attributs data-. À charger avec css/boutons.css (plaque gravée, cartouche).
   La page règle --m-entete (hauteur de sa barre du haut, posée par-dessus la scène).
   ===================================================================== */

.marteau {
  /* Charte (06-charte/couleurs.md) */
  --m-petrole: #0A393A;
  --m-profond: #062A2B;
  --m-halo: #11403F;
  --m-or: #E0BD8E;
  --m-or-clair: #F2D9AC;
  --m-creme: #EEEAE1;
  --m-creme-doux: rgba(238, 234, 225, .84);
  --m-titre: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --m-texte: "Jost", "Futura", "Avenir Next", system-ui, sans-serif;
  --m-sortie: cubic-bezier(.22, 1, .36, 1);
  /* Mise en page (lus aussi par le script) */
  --m-marge: clamp(20px, 4vw, 56px);
  --m-entete: 88px;           /* barre du haut de la page, posée sur la scène */
  --m-amorce: 64px;           /* v7 : bas du premier écran réservé à l’amorce (filet or) : le logo s’arrête au moins 64 px au-dessus (v6 : 36) */
  --m-bande: 0px;             /* téléphone : bande du logo et des fils, sous la couronne */

  position: relative; isolation: isolate; overflow: hidden;
  background: var(--m-profond); color: var(--m-creme);
}

/* ---------- La scène : tout le premier écran ---------- */
.marteau__cadre {
  position: relative;
  height: clamp(540px, 100vh, 1100px);
  height: clamp(540px, 100svh, 1100px);
  /* sous le canvas (et sans WebGL) : même fond que la scène, pétrole profond uni en bas, comme les textes */
  background:
    radial-gradient(ellipse 42% 38% at 50% 48%, var(--m-halo) 0%, rgba(17, 64, 63, 0) 70%),
    linear-gradient(180deg, var(--m-petrole) 0%, #08312F 64%, var(--m-profond) 100%);
}
.marteau__scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.marteau__stage { position: absolute; inset: 0; }
.marteau__bande { position: absolute; left: 0; right: 0; bottom: 0; height: var(--m-bande); pointer-events: none; }

/* Liste des neuf services : vrai texte. Par défaut (sans script, sans WebGL) lue par les lecteurs d’écran sans être affichée ;
   avec la scène (.est-anime), chaque libellé est placé par le script sous son pictogramme. */
.marteau__services {
  list-style: none; margin: 0; padding: 0;
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.marteau.est-anime .marteau__services {
  inset: 0; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none; white-space: normal;
  z-index: 1; pointer-events: none;
}
.marteau.est-anime .marteau__services li {
  position: absolute; left: 0; top: 0; width: max-content; max-width: var(--libelle-max, 132px);
  text-align: center; color: var(--m-creme);
  font-family: var(--m-texte); font-size: var(--libelle-taille, 12px); font-weight: 500; line-height: 1.35;
  letter-spacing: var(--libelle-espace, .14em); text-transform: uppercase;
  text-shadow: 0 0 12px rgba(6, 42, 43, .95), 0 0 2px rgba(6, 42, 43, .9);
  text-wrap: balance; opacity: 0; will-change: transform, opacity;
}

/* Image de repli (sans JavaScript : <noscript> ; sans WebGL ou contexte perdu : le script insère le <template>) :
   la scène détourée, posée sur une lueur en dégradé radial sous le socle */
.marteau__repli { display: block; position: absolute; inset: 0; --lueur-x: 50%; --lueur-y: 70%; }
.marteau__repli::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 26% 14% at var(--lueur-x) var(--lueur-y), rgba(224, 189, 142, .15), rgba(224, 189, 142, 0) 72%),
    radial-gradient(ellipse 52% 28% at var(--lueur-x) var(--lueur-y), rgba(224, 189, 142, .055), rgba(224, 189, 142, 0) 75%);
}
.marteau__repli img {
  position: relative; display: block; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%;
}

/* Pause / Reprendre (WCAG 2.2.2), en bas à droite de la scène ; visible seulement quand la scène tourne */
.marteau__commandes { position: absolute; right: calc(var(--m-marge) - 12px); bottom: 8px; z-index: 4; display: none; }
.marteau.est-anime:not(.est-fixe) .marteau__commandes { display: flex; }
.marteau__commandes button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 0 12px;
  background: transparent; border: 0; border-radius: 2px; cursor: pointer;
  color: rgba(238, 234, 225, .74); font: 500 11px/1 var(--m-texte); letter-spacing: .16em; text-transform: uppercase;
  transition: color .16s ease;
}
.marteau__commandes button:hover { color: var(--m-or); }
.marteau__commandes button:focus-visible { outline: 2px solid var(--m-or-clair); outline-offset: 3px; }
.marteau__commandes svg { width: 12px; height: 12px; flex: none; }
.marteau__commandes [hidden] { display: none; }

/* Amorce (v7, Octave) : un fin filet or sous le logo, 52 px dans le premier écran (dégradé jusqu’à 0,65), qui se prolonge
   jusqu’au descripteur. Une goutte de lumière le descend : elle est pilotée par le temps de la scène (js : elle part quand
   le point du logo s’allume), donc arrêtée par Pause, absente en mouvement réduit (le filet reste, fixe). Décorative. */
.marteau__amorce {
  position: absolute; left: 50%; bottom: 0; z-index: 2; width: 1px; height: calc(var(--m-amorce) - 12px); margin-left: -.5px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(224, 189, 142, 0) 0%, rgba(224, 189, 142, .3) 45%, rgba(224, 189, 142, .65) 100%);
}
/* la goutte : une perle d’or clair (en écho au point du logo) et sa traînée fine ; placée par le script (transform, opacity) */
.marteau__goutte {
  position: absolute; left: 50%; top: 0; z-index: 4; width: 1px; height: 18px; margin: -18px 0 0 -.5px;
  pointer-events: none; opacity: 0; will-change: transform, opacity;
  background: linear-gradient(180deg, rgba(242, 217, 172, 0), rgba(242, 217, 172, .9));
}
.marteau__goutte::after {
  content: ""; position: absolute; left: -1.5px; bottom: -2px; width: 4px; height: 4px; border-radius: 50%;
  background: #F2D9AC; box-shadow: 0 0 6px 1px rgba(242, 217, 172, .55);
}
.marteau:not(.est-anime) .marteau__goutte, .marteau.est-fixe .marteau__goutte { display: none; }

/* ---------- Les textes, sous la scène : centrés, en écho au marteau ---------- */
.marteau__textes {
  position: relative; z-index: 3;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(48px, 5vw, 80px) var(--m-marge) clamp(80px, 8vw, 136px);
}
/* le filet de l’amorce continue jusqu’au descripteur (la goutte y descend aussi) */
.marteau__textes::before {
  content: ""; position: absolute; left: 50%; top: 0; width: 1px; height: clamp(30px, 3.2vw, 46px); margin-left: -.5px;
  background: linear-gradient(180deg, rgba(224, 189, 142, .65), rgba(224, 189, 142, 0));
}
.marteau__titre {          /* h1 : le descripteur */
  margin: 0; max-width: 19em;
  font-family: var(--m-titre); font-weight: 500; color: var(--m-creme);
  font-size: clamp(1.85rem, 1.1rem + 2.25vw, 3.4rem); line-height: 1.1; letter-spacing: -.008em; text-wrap: balance;
}
.marteau__titre .insecable { white-space: nowrap; }
/* v7 (Octave) : coupure imposée « Agence de communication / des professions du droit et du chiffre » (aucun mot changé),
   sur ordinateur et dès 640 px (tablette : même « des » orphelin sinon) ; en dessous, la coupure naturelle */
@media (min-width: 640px) { .marteau__titre .marteau__ligne { display: block; } }
.marteau__accroche {       /* h2 : le titre, nettement sous le h1 ; v7 : 40 px sous le h1 à 1440 */
  margin: clamp(26px, 2.8vw, 40px) 0 0; max-width: 24em;
  font-family: var(--m-titre); font-weight: 500; color: var(--m-creme);
  font-size: clamp(1.5rem, 1rem + 1.2vw, 2.3rem); line-height: 1.15; letter-spacing: -.006em; text-wrap: balance;
}
/* une phrase par bloc : le titre passe à la ligne entre les phrases, jamais au milieu (aucun mot changé) */
.marteau__accroche .phrase { display: inline-block; }
.marteau__slogan {         /* v7 : un temps à lui : 28 px au-dessus, 18 px dessous (1440) */
  margin: clamp(20px, 1.95vw, 28px) 0 0;
  font-family: var(--m-titre); font-style: italic; font-weight: 500; color: var(--m-or);
  font-size: clamp(1.3rem, 1rem + .6vw, 1.65rem); line-height: 1.25;
}
.marteau__sous-titre {
  margin: clamp(14px, 1.25vw, 18px) 0 0; max-width: 34em;
  font-family: var(--m-texte); font-size: 1.0625rem; line-height: 1.65; color: var(--m-creme-doux); text-wrap: pretty;
}
.marteau__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px 18px; margin-top: clamp(30px, 2.8vw, 40px); }

/* ---------- Téléphone et tablette (< 960 px) : couronne, bande du logo et des fils, Pause, puis les textes ---------- */
@media (max-width: 959px) {
  .marteau { --m-entete: 68px; --m-marge: 22px; --m-amorce: 0px; --m-bande: clamp(92px, 26vw, 128px); }
  .marteau.sans-signature { --m-bande: 0px; }
  .marteau__cadre { height: auto; padding-top: var(--m-entete); display: flex; flex-direction: column; }
  .marteau__stage {
    position: relative; inset: auto; flex: none;
    height: calc(clamp(300px, 84vw, 420px) + var(--m-bande));
    height: calc(clamp(300px, min(84vw, 46svh), 420px) + var(--m-bande));
  }
  .marteau__repli { --lueur-x: 44%; --lueur-y: 50%; }
  .marteau.est-anime:not(.est-fixe) .marteau__commandes { position: static; align-self: flex-end; margin-right: calc(var(--m-marge) - 12px); }
  .marteau__amorce, .marteau__goutte, .marteau__textes::before { display: none; }
  .marteau__textes { padding: 28px var(--m-marge) 72px; }
  .marteau__accroche { margin-top: 22px; }
  .marteau__slogan { margin-top: 20px; font-size: 1.4rem; }
  .marteau__sous-titre { font-size: 1rem; margin-top: 12px; }
  .marteau__actions { margin-top: 26px; gap: 14px; }
}
@media (max-width: 599px) {
  .marteau__actions { flex-direction: column; align-items: stretch; width: 100%; }
  .marteau__actions .btn-plaque, .marteau__actions .btn-cartouche { width: 100%; }
  .marteau__stage {
    height: calc(clamp(300px, 100vw, 440px) + var(--m-bande));
    height: calc(clamp(300px, min(100vw, 48svh), 440px) + var(--m-bande));
  }
}

/* ---------- Téléphone (< 600 px) : la scène en vidéo (js : lireEnVideo), sans WebGL ; libellés dans l’image ---------- */
.marteau__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; display: block; }
.marteau.lecture-video .marteau__scene { display: none; }
/* au-dessus et au-dessous de la vidéo : les couleurs exactes de ses bords (#0A3435 en haut, #06292A en bas), sans raccord visible */
.marteau.lecture-video .marteau__cadre {
  background: linear-gradient(180deg, var(--m-petrole) 0, #0A3435 var(--m-entete), #06292A var(--m-entete), #06292A 100%);
}
.marteau.lecture-video:not(.est-fixe) .marteau__commandes {
  display: flex; position: static; align-self: flex-end; margin-right: calc(var(--m-marge) - 12px);
}

/* ---------- Outillage : vidéo (?mode=video), image de repli (?fond=plat) ---------- */
.marteau.mode-video .marteau__cadre { height: 100vh; padding: 0; }
.marteau.mode-video .marteau__stage { position: absolute; inset: 0; height: auto; }
.marteau.mode-video .marteau__textes, .marteau.mode-video .marteau__commandes, .marteau.mode-video .marteau__amorce, .marteau.mode-video .marteau__goutte { display: none !important; }
.marteau.fond-plat, .marteau.fond-plat .marteau__cadre { background: #0A393A !important; }
.marteau.fond-plat .marteau__textes, .marteau.fond-plat .marteau__commandes, .marteau.fond-plat .marteau__amorce, .marteau.fond-plat .marteau__goutte { visibility: hidden !important; }

@media (prefers-reduced-motion: reduce) {
  .marteau *, .marteau *::before, .marteau *::after { transition-duration: .01ms !important; animation: none !important; }
}
/* Contraste élevé (Windows) : la scène dessinée est décorative et resterait sombre ; on l’enlève. La liste des services reste lue. */
@media (forced-colors: active) {
  .marteau__scene, .marteau__repli, .marteau__amorce, .marteau__goutte, .marteau__textes::before { display: none !important; }
  .marteau, .marteau__cadre { background: Canvas; }
}
/* Impression (v7) : les textes, sans la scène dessinée */
@media print {
  .marteau { background: none !important; color: #000 !important; }
  .marteau__cadre, .marteau__goutte, .marteau__textes::before { display: none !important; }
  .marteau__titre, .marteau__accroche, .marteau__sous-titre { color: #000 !important; }
  .marteau__slogan { color: #5A4630 !important; }
  .marteau__textes { padding-block: 0 24px; }
}
