/* Page d'accueil : introduction, ouverture, compositeur et formules. */

html:not(.intro-on) .intro { display: none; }
.intro { position: fixed; inset: 0; z-index: 100; background: var(--foret); animation: intro-fond 0s 1.15s forwards; }
.intro-haut, .intro-bas { position: absolute; inset: 0; background: var(--foret); }
.intro-haut { clip-path: polygon(0 0, 100% 0, 100% 10%, 80% 10%, 80% 90%, 20% 10%, 20% 90%, 0 90%); animation: intro-haut .55s 1.15s cubic-bezier(.7, 0, .2, 1) forwards; }
.intro-bas { clip-path: polygon(0 90%, 20% 90%, 20% 10%, 80% 90%, 80% 10%, 100% 10%, 100% 100%, 0 100%); animation: intro-bas .55s 1.15s cubic-bezier(.7, 0, .2, 1) forwards; }
.intro-mot {
  position: absolute; inset: 0; margin: 0; display: grid; place-items: center;
  color: var(--white); font-size: min(20.5vw, 34vh); font-weight: 800; font-stretch: 62%; line-height: 1; letter-spacing: -.03em;
  opacity: 0; animation: intro-mot .75s .35s cubic-bezier(.3, 0, .1, 1) forwards;
}
.intro-fil { position: absolute; inset: 0; width: 100%; height: 100%; animation: intro-efface .15s 1.1s forwards; }
.intro-fil polyline { fill: none; stroke: var(--rose); stroke-width: 4; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: intro-trace .6s .05s cubic-bezier(.6, 0, .2, 1) forwards; }
.intro-passer {
  position: absolute; right: var(--gutter); bottom: max(20px, env(safe-area-inset-bottom)); min-height: 44px; padding: 0 16px;
  border: 2px solid var(--white); background: var(--foret); color: var(--white); font-size: 16px; font-weight: 700;
  animation: intro-efface .15s 1.1s forwards;
}
.intro.is-skipped { animation: none; background: transparent; }
.intro.is-skipped .intro-haut { animation: intro-haut-vite .25s cubic-bezier(.7, 0, .2, 1) forwards; }
.intro.is-skipped .intro-bas { animation: intro-bas-vite .25s cubic-bezier(.7, 0, .2, 1) forwards; }
.intro.is-skipped .intro-fil, .intro.is-skipped .intro-passer { animation: intro-efface .1s forwards; }
@keyframes intro-trace { to { stroke-dashoffset: 0; } }
@keyframes intro-mot { 0% { opacity: 0; font-stretch: 62%; } 30% { opacity: 1; } 100% { opacity: 1; font-stretch: 125%; } }
@keyframes intro-fond { to { background: transparent; } }
@keyframes intro-haut { to { transform: translateY(-105%); } }
@keyframes intro-bas { to { transform: translateY(105%); } }
@keyframes intro-haut-vite { to { transform: translateY(-105%); } }
@keyframes intro-bas-vite { to { transform: translateY(105%); } }
@keyframes intro-efface { to { opacity: 0; visibility: hidden; } }

/* Ouverture */
.hero { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; min-height: calc(100svh - var(--bar-height)); padding: clamp(36px, 5vw, 72px) var(--pad) calc(var(--edge) + clamp(32px, 4vw, 56px)); }
.hero h1 { font-size: inherit; line-height: .9; letter-spacing: 0; }
.ln { display: block; }
.ln-dense { font-size: min(13.1vw, 27svh); font-weight: 900; font-stretch: 62%; letter-spacing: -.008em; }
.ln-large { margin: .1em 0 .16em; font-size: min(9.1vw, 18.8svh); font-weight: 200; font-stretch: 125%; letter-spacing: -.03em; }
.hero-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 24px 48px; }
.hero-foot .page-lead { margin: 0; max-width: 34ch; font-weight: 500; }
.hero-foot .page-actions { margin: 0; }

@media (prefers-reduced-motion: no-preference) {
  .ln { animation: monte .7s var(--snap) both; }
  .ln:nth-child(2) { animation-delay: .07s; }
  .ln:nth-child(3) { animation-delay: .14s; }
  .intro-on .ln { animation-delay: 1.3s; }
  .intro-on .ln:nth-child(2) { animation-delay: 1.37s; }
  .intro-on .ln:nth-child(3) { animation-delay: 1.44s; }
  @keyframes monte { from { opacity: 0; transform: translateY(.22em); } to { opacity: 1; transform: none; } }
}

/* Compositeur */
.compo-head { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 24px 64px; align-items: end; }
.compo-head p { max-width: 40ch; color: var(--muted); }
.compo-field { display: block; margin-top: clamp(32px, 4vw, 56px); }
.compo-field span { display: block; margin-bottom: 6px; font-weight: 600; }
.compo-field input {
  display: block; width: 100%; min-height: 76px; padding: 4px 0;
  border: 0; border-bottom: 3px solid var(--rose); border-radius: 0; background: transparent; color: var(--white);
  font-size: clamp(36px, 5.4vw, 76px); font-weight: 200; font-stretch: 118%; line-height: 1.1; letter-spacing: -.02em;
}
.compo-field input::placeholder { color: var(--muted); opacity: .7; }
.compo-field input:focus { outline: none; border-bottom-width: 6px; margin-bottom: -3px; }
.compo-panels { display: grid; grid-template-columns: 4fr 5fr 4fr; gap: 16px; margin-top: 28px; }
.compo {
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  min-height: clamp(220px, 28vw, 400px); padding: 20px; text-decoration: none; container-type: inline-size;
  transition: transform .22s var(--snap), box-shadow .22s var(--snap);
}
.compo:nth-child(2) { margin-top: 44px; }
.compo:hover { transform: translate(-4px, -4px); box-shadow: 7px 7px 0 var(--rose); }
.compo-nom { display: block; font-size: min(calc(90cqw / (var(--n, 8) * var(--ratio))), var(--plafond)); overflow-wrap: anywhere; }
.compo-legende { font-size: 16px; line-height: 1.35; }
.compo-legende strong { display: block; font-weight: 700; }
.compo-ligne { --ratio: .56; --plafond: 56px; background: var(--white); color: var(--foret); }
.compo-ligne .compo-nom { font-weight: 300; line-height: 1.1; letter-spacing: .01em; }
.compo-surplomb { --ratio: .4; --plafond: 150px; background: var(--vif); color: var(--foret); justify-content: flex-end; flex-direction: column-reverse; }
.compo-surplomb .compo-nom { font-weight: 900; font-stretch: 62%; line-height: .9; }
.compo-neve { --ratio: .78; --plafond: 66px; background: #16213d; color: #f6dfd6; }
.compo-neve .compo-nom { font-weight: 200; font-stretch: 125%; line-height: 1.05; letter-spacing: -.03em; }
.compo-note { margin-top: 18px; font-size: 16px; color: var(--muted); }
@media (scripting: none) { .compo-field { display: none; } }

/* Formules */
.offre-rows { border-bottom: 2px solid var(--foret); }
.offre-row {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 370px); gap: 8px 40px; align-items: center;
  padding: clamp(18px, 2.4vw, 32px) 0; border-top: 2px solid var(--foret);
  transition: background-color .25s, color .25s, padding .3s var(--snap);
}
.offre-nom { font-size: clamp(66px, 8.4vw, 124px); font-weight: 900; font-stretch: 75%; line-height: .96; transition: font-stretch .4s var(--snap); }
.offre-prix { font-size: clamp(26px, 2.6vw, 36px); font-weight: 700; line-height: 1.1; }
.offre-texte { margin-top: 6px; }
.offre-lien { display: inline-block; margin-top: 8px; font-weight: 700; }
.offre-lien::after { content: ""; position: absolute; inset: 0; }
.offre-row:hover { z-index: 1; padding-left: 20px; padding-right: 20px; background: var(--foret); color: var(--white); }
@media (hover: hover) and (min-width: 900px) { .offre-row:hover .offre-nom { font-stretch: 122%; } }
.offre-lien:focus-visible { outline: none; }
.offre-lien:focus-visible::after { outline: 3px solid var(--foret); outline-offset: 2px; }
.offre-rows .badge { vertical-align: .2em; margin-left: 6px; }

/* Étapes : elles suivent les pointes du W */
.steps-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px clamp(28px, 5vw, 72px); counter-reset: etape; }
.steps-list li { counter-increment: etape; }
.steps-list li:nth-child(2) { margin-top: clamp(40px, 7vw, 110px); }
.steps-list li::before { content: counter(etape); display: block; font-size: clamp(110px, 15vw, 220px); font-weight: 900; font-stretch: 62%; line-height: .86; }
.steps-list h3 { margin-top: 16px; font-size: clamp(26px, 2.6vw, 34px); }
.steps-list p { margin-top: 8px; max-width: 30ch; color: var(--muted); }

/* Démonstrations */
.demo-cards { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 48px 24px; }
.demo-card { grid-column: span 7; display: block; text-decoration: none; }
.demo-card:nth-child(2) { grid-column: span 5; margin-top: clamp(40px, 9vw, 140px); }
.demo-card:nth-child(3) { grid-column: 3 / span 7; }
.demo-card img { width: 100%; height: auto; aspect-ratio: 1366 / 820; object-fit: cover; object-position: top; transition: transform .25s var(--snap), box-shadow .25s var(--snap); }
.demo-card:hover img { transform: translate(-5px, -5px); box-shadow: 9px 9px 0 var(--rose); }
.demo-card h3 { margin-top: 18px; font-size: clamp(40px, 5vw, 72px); font-weight: 200; font-stretch: 122%; line-height: 1; letter-spacing: -.02em; }
.demo-card p { margin-top: 8px; max-width: 46ch; color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .demo-card img { animation: ouvre linear both; animation-timeline: view(); animation-range: entry 5% entry 75%; }
    @keyframes ouvre {
      from { clip-path: polygon(0 40%, 25% 62%, 50% 45%, 75% 62%, 100% 40%, 100% 62%, 75% 62%, 50% 62%, 25% 62%, 0 62%); }
      to { clip-path: polygon(0 -10%, 25% 0, 50% -8%, 75% 0, 100% -10%, 100% 110%, 75% 110%, 50% 110%, 25% 110%, 0 110%); }
    }
  }
}

@media (max-width: 900px) {
  .compo-head, .compo-panels, .steps-list { grid-template-columns: minmax(0, 1fr); }
  .compo:nth-child(2), .steps-list li:nth-child(2), .demo-card:nth-child(2) { margin-top: 0; }
  .compo { min-height: 190px; }
  .offre-row { grid-template-columns: minmax(0, 1fr); }
  .demo-card, .demo-card:nth-child(2), .demo-card:nth-child(3) { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .ln-dense { font-size: 23.5vw; }
  .ln-large { font-size: 12.4vw; }
  .hero-foot .btn { width: 100%; }
  .hero-foot .page-actions { width: 100%; }
}
