/* ============================================================
   HM Design — Refonte 2026
   Palette créative : encre / crème / corail / chartreuse
   ============================================================ */

/* ---------- Variables ---------- */
:root {
  --ink: #16161a;          /* noir encre */
  --ink-soft: #2b2b32;
  --cream: #f7f4ee;        /* fond crème */
  --cream-dark: #ece6da;
  --white: #ffffff;
  --coral: #ff5b3b;        /* accent principal corail */
  --coral-dark: #e8421f;
  --lime: #d7f25a;         /* accent secondaire chartreuse */
  --lime-dark: #c2dd3e;
  --muted: #6c6c75;
  --line: rgba(22, 22, 26, 0.12);

  --font-display: 'Syne', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;

  --radius: 18px;
  --radius-lg: 28px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ---------- Typo ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; }
.display { font-size: clamp(2.6rem, 7vw, 5.6rem); }
h2.section-title { font-size: clamp(2rem, 4.5vw, 3.4rem); }
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--coral);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.eyebrow::before {
  content: ""; width: 28px; height: 2px; background: var(--coral); display: inline-block;
}
.lead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--muted); max-width: 60ch; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
section { padding: clamp(64px, 10vw, 130px) 0; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.95rem 1.6rem;
  border-radius: 50px;
  font-weight: 600; font-size: 0.95rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s;
  will-change: transform;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--ink); color: var(--cream); }
.btn-primary:hover { background: var(--coral); transform: translateY(-3px); box-shadow: 0 14px 30px rgba(255,91,59,0.32); }
.btn-coral { background: var(--coral); color: var(--white); }
.btn-coral:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(255,91,59,0.4); }
.btn-ghost { border: 1.5px solid var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--cream); transform: translateY(-3px); }
.btn .arrow { transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background 0.4s, box-shadow 0.4s, padding 0.4s;
  padding: 18px 0;
}
.site-header.scrolled {
  background: rgba(247,244,238,0.85);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
  padding: 12px 0;
}
.nav { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; }
.brand img { height: 30px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 2.2rem; }
.nav-links a { font-size: 0.95rem; font-weight: 500; position: relative; padding: 4px 0; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--coral); transition: width 0.3s var(--ease);
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--coral); }
.nav-cta { display: flex; align-items: center; gap: 1rem; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; z-index: 110; }
.nav-toggle span { width: 26px; height: 2px; background: var(--ink); transition: transform 0.35s var(--ease), opacity 0.3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(140px, 20vh, 220px); padding-bottom: clamp(60px, 9vw, 110px); position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 60px; align-items: center; }
.hero h1 { margin: 1.2rem 0 1.6rem; }
.hero h1 .accent { color: var(--coral); font-style: italic; }
.hero .lead { margin-bottom: 2.2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--lime); color: var(--ink);
  padding: 0.4rem 0.9rem; border-radius: 50px; font-size: 0.8rem; font-weight: 600;
  margin-left: 0.6rem;
}

/* Hero visual — composition de blocs colorés animés */
.hero-visual { position: relative; aspect-ratio: 1/1.05; }
.blob {
  position: absolute; border-radius: 32px;
  display: flex; align-items: flex-end; padding: 22px;
  font-family: var(--font-display); font-weight: 700; color: var(--ink);
  overflow: hidden;
}
.blob-1 { inset: 0 38% 42% 0; background: var(--coral); color: var(--white); font-size: 1.3rem; animation: float 7s ease-in-out infinite; }
.blob-2 { inset: 0 0 55% 50%; background: var(--ink); color: var(--cream); font-size: 1rem; animation: float 8s ease-in-out infinite 0.4s; }
.blob-3 { inset: 52% 52% 0 0; background: var(--lime); font-size: 1rem; animation: float 6.5s ease-in-out infinite 0.8s; }
.blob-4 { inset: 50% 0 0 40%; background: var(--cream-dark); border: 1.5px solid var(--line); font-size: 0.95rem; animation: float 7.5s ease-in-out infinite 0.2s; }
.blob span { line-height: 1.1; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ---------- Marquee clients ---------- */
.marquee { padding: 30px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; background: var(--cream); }
.marquee-track { display: flex; gap: 4rem; width: max-content; animation: scroll-x 26s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--ink); opacity: 0.32; white-space: nowrap; }
@keyframes scroll-x { to { transform: translateX(-50%); } }

/* ---------- Service cards ---------- */
.grid { display: grid; gap: 26px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.section-head { max-width: 720px; margin-bottom: 56px; }
.section-head.center { margin-left: auto; margin-right: auto; }
.section-head h2 { margin: 1rem 0 1.1rem; }

.card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 34px 30px; border: 1px solid var(--line);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s;
  position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-8px); box-shadow: 0 24px 50px rgba(22,22,26,0.1); border-color: transparent; }
.card .num { font-family: var(--font-display); font-size: 0.9rem; color: var(--coral); font-weight: 700; }
.card h3 { font-size: 1.5rem; margin: 1.2rem 0 0.7rem; }
.card p { color: var(--muted); font-size: 0.98rem; }
.card .icon {
  width: 56px; height: 56px; border-radius: 16px; background: var(--lime);
  display: flex; align-items: center; justify-content: center; margin-bottom: 4px;
}
.card .icon svg { width: 28px; height: 28px; stroke: var(--ink); }
.card.feature { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.card.feature p { color: rgba(247,244,238,0.7); }
.card.feature .icon { background: var(--coral); }
.card.feature .icon svg { stroke: var(--white); }
.card.feature .num { color: var(--lime); }
.tag-pill { position: absolute; top: 22px; right: 22px; background: var(--lime); color: var(--ink); font-size: 0.7rem; font-weight: 700; padding: 0.3rem 0.7rem; border-radius: 50px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Stats ---------- */
.stats { background: var(--ink); color: var(--cream); border-radius: var(--radius-lg); padding: clamp(40px,6vw,70px); display: grid; grid-template-columns: repeat(3,1fr); gap: 40px; }
.stat .figure { font-family: var(--font-display); font-size: clamp(2.6rem,5vw,4rem); color: var(--lime); }
.stat p { color: rgba(247,244,238,0.7); font-size: 0.95rem; margin-top: 0.4rem; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--coral); color: var(--white); border-radius: var(--radius-lg); padding: clamp(48px,7vw,90px); text-align: center; position: relative; overflow: hidden; }
.cta-band h2 { color: var(--white); margin-bottom: 1.2rem; }
.cta-band p { color: rgba(255,255,255,0.9); max-width: 50ch; margin: 0 auto 2rem; }
.cta-band .btn-primary { background: var(--ink); color: var(--white); }
.cta-band .btn-primary:hover { background: var(--lime); color: var(--ink); box-shadow: 0 14px 30px rgba(0,0,0,0.25); }
.cta-band .contact-inline { margin-top: 1.8rem; display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; font-weight: 600; }
.cta-band .contact-inline a { border-bottom: 2px solid rgba(255,255,255,0.4); padding-bottom: 2px; }
.cta-band .contact-inline a:hover { border-color: var(--white); }

/* ---------- Portfolio ---------- */
.filters { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 42px; }
.filter-btn { padding: 0.6rem 1.3rem; border-radius: 50px; border: 1.5px solid var(--line); font-weight: 600; font-size: 0.9rem; transition: all 0.3s var(--ease); }
.filter-btn:hover { border-color: var(--ink); }
.filter-btn.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }

.project { border-radius: var(--radius-lg); overflow: hidden; position: relative; transition: transform 0.45s var(--ease); cursor: pointer; }
.project-visual { aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 2rem; position: relative; transition: transform 0.6s var(--ease); }
.project:hover .project-visual { transform: scale(1.04); }
.project-info { padding: 22px 4px 6px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.project-info h3 { font-size: 1.3rem; }
.project-info .meta { font-size: 0.85rem; color: var(--muted); }
.project-cat { font-size: 0.78rem; font-weight: 700; color: var(--coral); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.project.hide { display: none; }
/* visuals couleurs */
.pv-coral { background: var(--coral); color: #fff; }
.pv-ink { background: var(--ink); color: var(--lime); }
.pv-lime { background: var(--lime); color: var(--ink); }
.pv-cream { background: var(--cream-dark); color: var(--ink); }
.pv-soft { background: linear-gradient(135deg, var(--coral), #ff8a5b); color: #fff; }
.pv-duo { background: linear-gradient(135deg, var(--ink), #3a3a45); color: var(--lime); }

/* ---------- Process steps ---------- */
.step { display: flex; gap: 24px; padding: 30px 0; border-top: 1px solid var(--line); align-items: flex-start; transition: padding-left 0.4s var(--ease); }
.step:hover { padding-left: 12px; }
.step .step-num { font-family: var(--font-display); font-size: 2.4rem; color: var(--coral); min-width: 70px; }
.step h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.step p { color: var(--muted); max-width: 60ch; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 60px; align-items: start; }
.contact-info .info-item { padding: 22px 0; border-bottom: 1px solid var(--line); }
.contact-info .info-item span { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); font-weight: 600; }
.contact-info .info-item a, .contact-info .info-item p { font-family: var(--font-display); font-size: 1.4rem; margin-top: 0.3rem; display: block; }
.contact-info .info-item a:hover { color: var(--coral); }

form { background: var(--white); border-radius: var(--radius-lg); padding: clamp(28px,4vw,46px); border: 1px solid var(--line); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { margin-bottom: 22px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.5rem; }
.field input, .field textarea, .field select {
  width: 100%; padding: 0.9rem 1rem; border: 1.5px solid var(--line); border-radius: 12px;
  font-family: inherit; font-size: 0.97rem; background: var(--cream); color: var(--ink);
  transition: border-color 0.3s, background 0.3s;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--coral); background: var(--white); }
.field textarea { resize: vertical; min-height: 130px; }
.field .error-msg { color: var(--coral-dark); font-size: 0.8rem; margin-top: 0.4rem; display: none; }
.field.invalid input, .field.invalid textarea { border-color: var(--coral-dark); }
.field.invalid .error-msg { display: block; }
.form-success { display: none; background: var(--lime); color: var(--ink); padding: 1rem 1.2rem; border-radius: 12px; font-weight: 600; margin-bottom: 1.4rem; }
.form-success.show { display: block; animation: fadeUp 0.5s var(--ease); }
.form-error { display: none; background: #ffe4dc; color: var(--coral-dark); padding: 1rem 1.2rem; border-radius: 12px; font-weight: 600; margin-bottom: 1.4rem; }
.form-error.show { display: block; animation: fadeUp 0.5s var(--ease); }
/* Honeypot anti-spam : invisible pour les humains, présent pour les bots */
.hp-field { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; pointer-events: none; }

/* ---------- Page hero (sous-pages) ---------- */
.page-hero { padding-top: clamp(150px, 22vh, 230px); padding-bottom: clamp(40px,6vw,70px); }
.page-hero h1 { font-size: clamp(2.6rem,6vw,4.8rem); margin: 1rem 0 1.2rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--cream); padding: 80px 0 36px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 50px; border-bottom: 1px solid rgba(247,244,238,0.12); }
.footer-brand img { height: 32px; filter: brightness(0) invert(1); margin-bottom: 1.2rem; }
.footer-brand p { color: rgba(247,244,238,0.6); max-width: 34ch; }
.footer-col h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--lime); margin-bottom: 1.2rem; font-family: var(--font-body); }
.footer-col a, .footer-col p { color: rgba(247,244,238,0.75); display: block; padding: 0.35rem 0; transition: color 0.3s; }
.footer-col a:hover { color: var(--coral); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 28px; flex-wrap: wrap; gap: 14px; color: rgba(247,244,238,0.5); font-size: 0.85rem; }
.footer-social { display: flex; gap: 1rem; }
.footer-social a { width: 40px; height: 40px; border: 1px solid rgba(247,244,238,0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all 0.3s; }
.footer-social a:hover { background: var(--coral); border-color: var(--coral); transform: translateY(-3px); }
.footer-social svg { width: 18px; height: 18px; stroke: var(--cream); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-visual { max-width: 460px; margin: 0 auto; width: 100%; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .nav-links, .nav-cta .btn { display: none; }
  .nav-toggle { display: flex; }
  .nav-links {
    /* Position en unités viewport (et non inset:0) pour rester plein écran
       même quand le header devient le bloc conteneur via backdrop-filter au scroll */
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* tient compte des barres mobiles */
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--cream); /* fond crème opaque, ne disparaît pas au scroll */
    z-index: 105; /* au-dessus du contenu, sous le bouton burger (110) */
    flex-direction: column; justify-content: center; align-items: center; gap: 2rem;
    padding: 2rem 1.5rem;
    transform: translateX(100%); transition: transform 0.5s var(--ease);
  }
  .nav-links a { font-size: 1.6rem; font-family: var(--font-display); }
  .nav-links.open { display: flex; transform: none; }
  /* Sécurité : neutralise le flou du header tant que le menu est ouvert
     pour éviter tout effet de bloc conteneur résiduel */
  .site-header:has(.nav-links.open) { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; gap: 28px; text-align: center; }
  .form-row { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .step { flex-direction: column; gap: 8px; }
  .cta-band .contact-inline { flex-direction: column; gap: 0.8rem; }
}
@media (max-width: 420px) {
  .container { padding: 0 18px; }
}
