/* ==========================================================================
   OptiResto — passe « attractivité » : hero 3D, titres animés, boutons
   magnétiques, enjeux, démarche, preuves, offre, CTA mobile.
   ========================================================================== */

:root { --amber: #FBBF24; }

h1, h2, h3 { text-wrap: balance; }
.section__lead, .card p, .hero__lead { text-wrap: pretty; }

/* ---------- Boutons ---------- */
.btn--lg { --btn-pad: 1.05rem 1.7rem; min-height: 54px; font-size: 1.05rem; }
.btn[data-magnetic] {
  transition-property: transform, translate, box-shadow, background-color, border-color, color;
  transition-duration: .35s, .5s, .35s, .3s, .3s, .3s;
  transition-timing-function: var(--ease);
}
.btn--primary.btn--lg { animation: halo 3.2s ease-in-out 2.4s infinite; }
@keyframes halo {
  0%, 100% { box-shadow: 0 10px 30px -10px rgba(56, 189, 248, .6), 0 0 0 0 rgba(74, 222, 128, .35); }
  50% { box-shadow: 0 14px 36px -10px rgba(74, 222, 128, .6), 0 0 0 10px rgba(74, 222, 128, 0); }
}

/* ---------- Hero ---------- */
.hero__title { font-size: clamp(2.8rem, 1.6rem + 5vw, 6rem); }
.hero__micro {
  display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.1rem;
  color: var(--grey); font-size: .9rem;
}
.hero__micro .icon { color: var(--green); }

.hero__canvas {
  position: absolute; inset: -16%; width: 132%; height: 132%;
  pointer-events: none; opacity: 0; transform: scale(.92);
  transition: opacity 1.6s var(--ease), transform 1.8s var(--ease);
}
.has-3d .hero__canvas { opacity: 1; transform: none; }
.hero__visual .panel, .hero__visual .orbit { transition: opacity .8s var(--ease); }
.has-3d .hero__visual .panel, .has-3d .hero__visual .orbit { opacity: 0 !important; visibility: hidden; }
.has-3d .hero__visual .chip { z-index: 2; }

/* Le texte du hero s'efface en douceur au défilement (navigateurs compatibles).
   Désactivée par le bouton pause et sur les écrans très bas (zoom fort). */
@supports (animation-timeline: scroll()) { @media (min-height: 600px) {
  .hero__copy {
    animation: hero-out linear both;
    animation-timeline: scroll(root);
    animation-range: 0 85vh;
  }
  @keyframes hero-out { to { opacity: .35; transform: translateY(-70px); } }
  .showcase::before { animation: drift linear both; animation-timeline: view(); }
  @keyframes drift { from { translate: -50% 80px; } to { translate: -50% -80px; } }
  .motion-off .hero__copy, .motion-off .showcase::before { animation: none !important; }
} 
}

/* ---------- Titres révélés mot par mot ---------- */
.split-word {
  display: inline-block; overflow: hidden; vertical-align: bottom;
  padding: 0 .03em .14em; margin-bottom: -.14em;
}
.js .split-word > span {
  display: inline-block; transform: translateY(108%) rotate(3deg);
  transition: transform 1.05s var(--ease);
  transition-delay: calc(var(--wi, 0) * 55ms + 120ms);
}
.js .is-split-in .split-word > span { transform: none; }
.text-gradient--host { background: none; color: inherit; -webkit-text-fill-color: currentColor; }
.split-word .text-gradient { padding-right: .02em; }

/* ---------- Cartes : inclinaison 3D au survol ---------- */
.js [data-tilt] { transform-style: preserve-3d; }

/* ---------- Les enjeux ---------- */
.problem::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 70%; z-index: -1;
  background: radial-gradient(ellipse 50% 60% at 15% 30%, rgba(251, 191, 36, .06), transparent 70%);
}
.problem__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.problem__item { padding: clamp(1.5rem, 2.4vw, 2rem); }
.problem__item h3 { font-size: var(--text-h3); font-weight: 600; margin: 1.2rem 0 .5rem; }
.problem__item p { color: var(--grey); }
.problem__icon {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 13px;
  color: var(--amber); background: rgba(251, 191, 36, .08); border: 1px solid rgba(251, 191, 36, .22);
}
.problem__icon .icon { width: 22px; height: 22px; }
.problem__item:hover { border-color: rgba(251, 191, 36, .35); transform: translateY(-4px); }
@media (max-width: 860px) { .problem__grid { grid-template-columns: 1fr; } }

/* ---------- Comment ça se passe ---------- */
.journey__list { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.journey__list::before {
  content: ""; position: absolute; top: 52px; left: 12%; right: 12%; height: 1px; z-index: -1;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--green), transparent); opacity: .5;
}
.journey__step { padding: clamp(1.5rem, 2.4vw, 2.1rem); text-align: center; }
.journey__step:hover { transform: translateY(-6px); }
.journey__num {
  display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: 1rem; border-radius: 50%;
  color: var(--night); background: linear-gradient(135deg, var(--cyan), var(--green));
  box-shadow: 0 0 0 6px rgba(2, 10, 20, .9), 0 12px 30px -8px rgba(56, 189, 248, .6);
}
.journey__num .icon { width: 26px; height: 26px; }
.journey__index { display: block; color: var(--cyan); font-family: var(--font-display); font-weight: 600; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; }
.journey__step h3 { font-size: var(--text-h3); font-weight: 600; margin: .4rem 0 .55rem; }
.journey__step p { color: var(--grey); }
.journey__cta { display: grid; justify-items: center; gap: .9rem; margin-top: clamp(2.5rem, 4vw, 3.5rem); text-align: center; }
.microcopy { color: var(--grey); font-size: .9rem; }
@media (max-width: 860px) {
  .journey__list { grid-template-columns: 1fr; }
  .journey__list::before { display: none; }
}

/* ---------- Preuves (chiffres + avis) ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.1rem; margin-bottom: 2rem; }
.stat {
  display: grid; gap: .35rem; padding: 1.75rem; text-align: center;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
}
.stat__value {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(2.4rem, 1.8rem + 2.4vw, 3.6rem); line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(100deg, var(--cyan), var(--green)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat__label { color: var(--grey); }
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.1rem; }
.quote { margin: 0; padding: 2rem; display: grid; gap: 1.25rem; align-content: space-between; }
.quote__text { margin: 0; position: relative; padding-top: 1.6rem; font-size: 1.08rem; color: var(--white); }
.quote__text::before {
  content: "«"; position: absolute; top: -.4rem; left: 0;
  font-family: var(--font-display); font-size: 3rem; line-height: 1; color: var(--cyan); opacity: .6;
}
.quote__author { display: grid; gap: .1rem; font-size: .9rem; color: var(--grey); }
.quote__author strong { color: var(--white); font-family: var(--font-display); font-weight: 600; }

/* ---------- Offre limitée ---------- */
.offer__card {
  position: relative; isolation: isolate; overflow: hidden;
  max-width: 880px; margin-inline: auto; text-align: center;
  padding: clamp(2.25rem, 5vw, 4rem) clamp(1.25rem, 4vw, 3.5rem);
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse at 50% 0%, rgba(251, 191, 36, .1), transparent 60%), linear-gradient(160deg, rgba(15, 37, 64, .9), rgba(7, 20, 38, .95));
  border: 1px solid rgba(251, 191, 36, .35);
}
.offer__badge {
  display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1.25rem;
  padding: .4rem .9rem; border-radius: 999px;
  color: var(--amber); background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .35);
  font-family: var(--font-display); font-weight: 600; font-size: .85rem;
}
.offer__badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); animation: ping-amber 2s infinite; }
@keyframes ping-amber { 0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, .6); } 70%, 100% { box-shadow: 0 0 0 9px rgba(251, 191, 36, 0); } }
.offer .section__lead { max-width: 38rem; margin-inline: auto; }
.countdown { margin: 2rem 0 1.25rem; }
.countdown__label { color: var(--grey); font-size: .9rem; margin-bottom: .8rem; }
.countdown__units { display: inline-grid; grid-template-columns: repeat(4, minmax(64px, 88px)); gap: .6rem; }
.countdown__units span {
  display: grid; gap: .2rem; padding: .85rem .5rem; border-radius: 14px;
  background: rgba(2, 10, 20, .55); border: 1px solid var(--line-strong);
}
.countdown__units b { font-family: var(--font-display); font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.countdown__units small { color: var(--grey); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; }
.offer__spots { color: var(--amber); font-weight: 600; margin-bottom: .5rem; }
.offer__guarantee { color: var(--grey); margin-bottom: 1.75rem; }
.offer__guarantee::before { content: "✓ "; color: var(--green); font-weight: 700; }
@media (max-width: 420px) { .countdown__units { grid-template-columns: repeat(4, 1fr); width: 100%; } }

/* ---------- Engagements (contact) ---------- */
.pledges { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem .75rem; margin-top: 1.75rem; }
.pledges li {
  display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .85rem; border-radius: 999px;
  background: rgba(2, 10, 20, .45); border: 1px solid var(--line-strong); color: var(--grey); font-size: .88rem;
}
.pledges .icon { color: var(--green); width: 1rem; height: 1rem; }

/* ---------- CTA collant (mobile) ---------- */
.sticky-cta { display: none; }
@media (max-width: 760px) {
  .sticky-cta {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    padding: .75rem var(--gutter) calc(.75rem + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(2, 10, 20, 0), rgba(2, 10, 20, .92) 35%);
    transform: translateY(110%); visibility: hidden;
    transition: transform .45s var(--ease), visibility 0s .45s;
  }
  .sticky-cta.is-shown { transform: none; visibility: visible; transition: transform .45s var(--ease); }
  .sticky-cta .btn { width: 100%; }
  .has-sticky .toast { bottom: 96px; }
}

/* ---------- Aperçu des données d'exemple ---------- */
.preview-ribbon {
  position: fixed; left: 12px; bottom: 12px; z-index: 95;
  padding: .5rem .9rem; border-radius: 10px;
  background: var(--amber); color: var(--night); font-weight: 600; font-size: .85rem;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .8);
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero__copy, .showcase::before { animation: none !important; }
  .js .split-word > span { transform: none; }
}

@media (max-width: 1024px) {
  .hero__micro { display: block; text-align: center; }
  .hero__micro .icon { display: inline-block; vertical-align: -.2em; margin-right: .35rem; }
}
.preview-ribbon { top: 86px; bottom: auto; }

[hidden] { display: none !important; }
.has-sticky { scroll-padding-bottom: 96px; }
@media (forced-colors: active) {
  .stat__value, .split-word .text-gradient { background: none; color: CanvasText; -webkit-text-fill-color: currentColor; }
}

.eyebrow__extra { margin-left: calc(-.65rem + .3em); }
