/* ==================================================
   SECTION HERO
   Dégradé graphite → laiton plein écran, titre à gauche,
   un seul bouton, illustration à droite, vague en bas qui
   ouvre sur les Exemples. Le hero reste sombre dans les
   deux thèmes : seule la vague suit le fond de la page.
   ================================================= */

.hero {
  --hero-fg: #f4f1ea;
  --hero-fg-soft: rgba(244, 241, 234, 0.78);
  --hero-muted: rgba(244, 241, 234, 0.62);
  --hero-accent: #e2c896;
  --hero-rule: rgba(255, 255, 255, 0.16);
  --hero-wave-h: clamp(72px, 10vw, 150px);

  margin-top: calc(var(--navbar-height) * -1);
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: max(620px, min(92svh, 860px));
  display: flex;
  align-items: center;
  overflow: hidden;
  color: var(--hero-fg);
  background:
    radial-gradient(55% 65% at 82% 38%, rgba(243, 217, 162, 0.22), transparent 70%),
    radial-gradient(40% 50% at 8% 90%, rgba(154, 118, 52, 0.18), transparent 70%),
    linear-gradient(118deg, #17181b 0%, #1f1e1d 28%, #3a3022 52%, #6b5124 76%, #9a7634 100%);
}

/* ---------- Mise en page ---------- */

.hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: calc(var(--content-max) + var(--page-gutter) * 2);
  margin: 0 auto;
  padding: calc(var(--navbar-height) + 2rem) var(--page-gutter) calc(var(--hero-wave-h) + 2.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}

.hero__overlay {
  min-width: 0;
  max-width: 34rem;
}

/* ---------- Titre et bouton ---------- */

.hero__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 5.4vw, 4.9rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.02;
  color: var(--hero-fg);
  text-wrap: balance;
}

/* Une ligne sous le titre : ce que je fais, sans promettre de classement. */
.hero__lead {
  max-width: 30rem;
  margin: clamp(1.1rem, 2vw, 1.5rem) 0 0;
  color: var(--hero-fg-soft);
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.55;
  text-wrap: pretty;
}

/* Un seul bouton, en pilule laiton : il se détache du dégradé sans rien d'autre autour. */
.hero .hero__cta {
  margin-top: clamp(1.8rem, 3vw, 2.4rem);
  padding: 1rem 2.1rem;
  background: linear-gradient(100deg, #ead3a2 0%, #c9a465 100%);
  color: #17181b;
  border: 0;
  box-shadow: 0 16px 32px -14px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), filter 0.25s ease;
}

.hero .hero__cta:hover {
  background: linear-gradient(100deg, #ead3a2 0%, #c9a465 100%);
  color: #17181b;
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 22px 40px -16px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.hero .hero__cta:focus-visible {
  outline: 2px solid #f4f1ea;
  outline-offset: 3px;
}

/* ---------- Illustration ---------- */

.hero__art {
  min-width: 0;
  justify-self: end;
  width: 100%;
  max-width: 540px;
}

.hero-art {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.hero-art__card {
  filter: drop-shadow(0 22px 30px rgba(0, 0, 0, 0.35));
  transform-box: fill-box;
  transform-origin: center;
  animation: heroFloat 7s ease-in-out 1.2s infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Effet « antigravité » : le commerce et l'épingle flottent aussi, chacun à son rythme
   (durées différentes de la fiche, jamais en phase) ; leur ombre au sol se resserre et
   pâlit quand ils montent. */
.hero-art__shop,
.hero-art__ground,
.hero-art__pin-body,
.hero-art__pin-shadow {
  transform-box: fill-box;
  transform-origin: center;
}

.hero-art__shop {
  animation: heroFloatShop 9s ease-in-out infinite;
}

.hero-art__ground {
  animation: heroGround 9s ease-in-out infinite;
}

.hero-art__pin-body {
  animation: heroFloatPin 5.5s ease-in-out 0.6s infinite;
}

.hero-art__pin-shadow {
  animation: heroPinShadow 5.5s ease-in-out 0.6s infinite;
}

@keyframes heroFloatShop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes heroGround {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.94); opacity: 0.75; }
}

@keyframes heroFloatPin {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-11px); }
}

@keyframes heroPinShadow {
  0%, 100% { transform: scale(1); opacity: 0.28; }
  50% { transform: scale(0.68); opacity: 0.12; }
}

/* ---------- Vague ---------- */

.hero__waves {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  z-index: 1;
  height: var(--hero-wave-h);
  overflow: hidden;
  pointer-events: none;
}

/* Trois périodes de 1600 px : un glissement d'une période ramène exactement au départ. */
.hero__wave {
  position: absolute;
  left: 0;
  bottom: 0;
  display: block;
  width: 4800px;
  max-width: none; /* _reset.css borne les svg à 100 % */
  height: 100%;
  fill: var(--color-bg);
  animation: heroWave 8s linear infinite;
  will-change: transform;
}

@keyframes heroWave {
  from { transform: translateX(0); }
  to { transform: translateX(-1600px); }
}

/* ---------- Pastilles métiers ----------
   Plus dans le hero : gardées pour les liens « D'autres métiers » des pages métier
   (templates/metier.html) et l'icône des pages d'erreur (_global.css). */

/* Pastilles « Votre métier » : de vrais liens vers les démos ; avec le JS,
   elles pilotent l'aperçu et le bouton principal sans quitter la page. */
.hero__trades {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.9rem;
  margin-top: 1.7rem;
}

.hero__trades-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--hero-muted);
}

.hero__trades-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Une pastille par métier : son icône dans un petit rond teinté, puis son nom.
   « is-showing » suit la démo affichée dans l'aperçu ; « is-selected », le choix du visiteur. */
.hero__trade {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 36px;
  padding: 0.22rem 0.8rem 0.22rem 0.3rem;
  border: 1px solid var(--hero-rule);
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-surface) 55%, transparent);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--hero-fg-soft);
  text-decoration: none;
  transition:
    color 0.25s ease,
    background-color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.3s var(--ease-out),
    transform 0.3s var(--ease-out);
}

@media (pointer: coarse) {
  .hero__trade {
    min-height: 44px;
    padding-left: 0.4rem;
  }
}

.hero__trade-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--hero-accent) 13%, transparent);
  color: var(--hero-accent);
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.35s var(--ease-out);
}

.hero__trade-icon {
  width: 0.82rem;
  height: 0.82rem;
}

.hero__trade:hover {
  color: var(--hero-fg);
  border-color: color-mix(in srgb, var(--hero-accent) 45%, var(--hero-rule));
  box-shadow: 0 8px 18px -12px rgba(var(--accent-rgb), 0.55);
  text-decoration: none;
  transform: translateY(-1px);
}

.hero__trade:hover .hero__trade-badge {
  transform: rotate(-8deg) scale(1.06);
}

/* La démo en cours dans l'aperçu */
.hero__trade.is-showing {
  color: var(--hero-fg);
  border-color: color-mix(in srgb, var(--hero-accent) 40%, var(--hero-rule));
}

.hero__trade.is-showing .hero__trade-badge,
.hero__trade.is-selected .hero__trade-badge {
  background: var(--hero-accent);
  color: var(--color-bg);
}

.hero__trade.is-selected {
  color: var(--hero-accent);
  border-color: var(--hero-accent);
  background: var(--color-accent-soft);
}

.hero__trade:focus-visible {
  outline: 2px solid var(--hero-accent);
  outline-offset: 2px;
}

/* « Autre métier » : pas une démo, une invitation à écrire. Contour pointillé, un « + »
   au lieu d'une icône de métier, et une flèche qui avance au survol. */
.hero__trade--autre {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--hero-accent) 50%, var(--hero-rule));
  background: transparent;
  color: var(--hero-fg);
}

.hero__trade--autre .hero__trade-badge {
  background: transparent;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hero-accent) 55%, transparent);
}

.hero__trade-arrow {
  width: 0.78rem;
  height: 0.78rem;
  margin-left: -0.08rem;
  color: var(--hero-accent);
  transition: transform 0.3s var(--ease-out);
}

.hero__trade--autre:hover {
  border-style: solid;
  border-color: var(--hero-accent);
}

.hero__trade--autre:hover .hero__trade-badge {
  transform: rotate(90deg);
}

.hero__trade--autre:hover .hero__trade-arrow {
  transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
  .hero__trade,
  .hero__trade-badge,
  .hero__trade-arrow {
    transition: none;
  }

  .hero__trade:hover,
  .hero__trade:hover .hero__trade-badge,
  .hero__trade--autre:hover .hero__trade-arrow {
    transform: none;
  }
}

/* ---------- Apparition ----------
   En CSS seul : le titre s'affiche dès le premier rendu, sans attendre de script.
   Motion (js/anim.js) reprend la main quand il est chargé. */

@keyframes heroRise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero__overlay > *,
.hero__art {
  animation: heroRise 0.8s var(--ease-out) both;
}

.hero__title { animation-delay: 0.05s; }
.hero__lead { animation-delay: 0.14s; }
.hero__cta { animation-delay: 0.22s; }
.hero__art { animation-delay: 0.3s; animation-duration: 1s; }

/* ---------- Responsive ---------- */

@media (max-width: 880px) {
  .hero {
    min-height: 0;
    align-items: flex-start;
  }

  /* Une seule composition : titre, bouton, puis l'illustration, au-dessus de la vague. */
  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    padding-top: calc(var(--navbar-height) + 2.75rem);
    /* L'illustration s'arrête au-dessus de la vague, avec de l'air. */
    padding-bottom: calc(var(--hero-wave-h) + 1.5rem);
  }

  .hero__art {
    justify-self: center;
    max-width: 460px;
  }
}

@media (max-width: 480px) {
  .hero__title {
    font-size: clamp(2.35rem, 10.5vw, 2.9rem);
    letter-spacing: 0;
  }

  .hero .hero__cta {
    padding: 0.9rem 1.7rem;
  }

  .hero__inner {
    gap: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__overlay > *,
  .hero__art,
  .hero-art__card,
  .hero-art__shop,
  .hero-art__ground,
  .hero-art__pin-body,
  .hero-art__pin-shadow,
  .hero__wave {
    animation: none;
  }

  .hero .hero__cta {
    transition: none;
  }

  .hero .hero__cta:hover {
    transform: none;
  }
}
