@keyframes fade-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Section 1 desktop — fade-up sur corps */
.story-body > * {
  animation: fade-up 0.7s ease both;
}
.story-body > *:nth-child(1) { animation-delay: 0.15s; }
.story-body > *:nth-child(2) { animation-delay: 0.28s; }
.story-body > *:nth-child(3) { animation-delay: 0.40s; }
.story-body > *:nth-child(4) { animation-delay: 0.52s; }
.story-body > *:nth-child(5) { animation-delay: 0.64s; }
.story-body > *:nth-child(6) { animation-delay: 0.76s; }

/* Hero story */
.hero-story {
  position: relative;
  width: 100%;          /* ← pas 100vw qui peut causer des scrollbars */
  min-height: 90vh;
  display: flex;
  align-items: flex-start;
  overflow: visible;
}

.story-bg {
  position: fixed;
  inset: 0;
  background: url('../images/background-story.png') calc(100% + 10vw) center / auto 130% no-repeat;
  opacity: 0.75;
  z-index: -1;
  filter: blur(1.5px);
}

/* Safari : ancré dans la section hero uniquement, pas de parallax */
.is-safari .story-bg {
  position: absolute;
  background-position: calc(100% + 25vw) 80% !important;
  opacity: 0.75 !important;
}

.story-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
  filter: blur(60px);
  animation: orb-drift 12s ease-in-out infinite;
}

.orb-1 {
  width: 1000px;
  height: 600px;
  top: -100px;
  left: 20%;
  animation-duration: 14s;
  animation-delay: 0s;
}

.orb-2 {
  width: 800px;
  height: 400px;
  top: 40%;
  right: 10%;
  animation-duration: 10s;
  animation-delay: -4s;
}

.orb-3 {
  width: 700px;
  height: 500px;
  bottom: -100px;
  left: 5%;
  animation-duration: 16s;
  animation-delay: -8s;
}

.orb-dark-1 {
  width: 500px;
  height: 500px;
  top: 10%;
  right: 25%;
  background: radial-gradient(circle, rgba(0,0,0,0.08) 0%, transparent 70%);
  filter: blur(80px);
  animation-duration: 18s;
  animation-delay: -3s;
}

.orb-dark-2 {
  width: 350px;
  height: 350px;
  bottom: 5%;
  right: 5%;
  background: radial-gradient(circle, rgba(0,0,0,0.06) 0%, transparent 70%);
  filter: blur(60px);
  animation-duration: 13s;
  animation-delay: -7s;
}

.orb-dark-3 {
  width: 600px;
  height: 600px;
  top: 50%;
  left: 30%;
  background: radial-gradient(circle, rgba(0,0,0,0.05) 0%, transparent 70%);
  filter: blur(100px);
  animation-duration: 20s;
  animation-delay: -11s;
}

@keyframes orb-drift {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(30px, -40px); }
  66%  { transform: translate(-20px, 20px); }
  100% { transform: translate(0, 0); }
}

.story-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 10fr 5fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "title video"
    "body  video";
  align-items: start;
  gap: 2rem 4rem;
  width: 100%;
  max-width: 2000px;
  margin: 0 auto;
  padding: 7rem 4rem;
}

.story-title {
  grid-area: title;
  font-size: clamp(3rem, 5vw, 5rem);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 0.5rem;
  text-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2);
  animation: fade-up 0.7s ease both;
  animation-delay: 0s;
}

.story-title-top,
.story-title-bottom {
  display: block;
}

.story-body {
  grid-area: body;
  max-width: 900px;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.story-body .story-sub {
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  text-shadow: 0px 2px 6px rgba(0, 0, 0, 0.1);
}

.story-sep {
  width: 280px;
  border: none;
  border-top: 5px solid black;
  margin: 1.8rem 0;
}

.story-body p {
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.75;
  margin-bottom: 1rem;
  text-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);
  text-align: justify;
}

.story-video-wrap,
.story-body {
  transform: translateZ(0);
  backface-visibility: hidden;
}

.story-video-placeholder {
  display: none;
  width: 100%;
  max-width: 700px;
  height: auto;
  -webkit-mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 60%, transparent 100%);
  mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 60%, transparent 100%);
  filter: drop-shadow(0px 20px 60px rgba(255, 255, 255, 1));
}

/* Vidéo — plus grande et centrée haut/bas */
.story-video-wrap {
  grid-area: video;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  position: relative;
  overflow: visible;
  animation: fade-up 0.9s ease 0.25s both;
}

.orb-video {
  position: absolute;
  width: 700px;
  height: 1200px;
  top: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.75) 0%, transparent 70%);
  filter: blur(80px);
  animation: orb-drift 12s ease-in-out infinite;
  animation-delay: -2s;
  pointer-events: none;
}

/* L'ombre est ici, sur le wrapper */
.vid-shadow-wrap {
  filter: drop-shadow(0px 20px 60px rgba(255, 255, 255, 1));
  padding: 60px; /* espace pour que l'ombre ne soit pas clippée */
}

/* Le feather + mask restent sur la vidéo */
#vid {
  pointer-events: none;
  width: 100%;
  max-width: 700px;
  display: block;
  filter: url(#feather);
  -webkit-mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 60%, transparent 100%);
  mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 60%, transparent 100%);
   will-change: transform;
}
.story-page {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* ── Section 2 : Petit Atelier, Grande Qualité ── */

@keyframes slow-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Fade-in au scroll — la section fade rapidement, les enfants animent en stagger */
.story-fade {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.story-fade.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Section 2 — enfants en stagger déclenché par .visible */
.story2-text > * {
  animation: fade-up 0.7s ease both;
  animation-play-state: paused;
}
.story2-text > *:nth-child(1) { animation-delay: 0s; }
.story2-text > *:nth-child(2) { animation-delay: 0.15s; }
.story2-text > *:nth-child(3) { animation-delay: 0.28s; }
.story2-text > *:nth-child(4) { animation-delay: 0.42s; }
.story2-text > *:nth-child(5) { animation-delay: 0.56s; }
.story2-text > *:nth-child(6) { animation-delay: 0.70s; }
.story2-text > *:nth-child(7) { animation-delay: 0.84s; }
.story-fade.visible .story2-text > * { animation-play-state: running; }

/* Section 3 — enfants en stagger déclenché par .visible */
.story3-text > * {
  animation: fade-up 0.7s ease both;
  animation-play-state: paused;
}
.story3-text > *:nth-child(1) { animation-delay: 0s; }
.story3-text > *:nth-child(2) { animation-delay: 0.15s; }
.story3-text > *:nth-child(3) { animation-delay: 0.28s; }
.story3-text > *:nth-child(4) { animation-delay: 0.42s; }
.story3-text > *:nth-child(5) { animation-delay: 0.56s; }
.story3-text > *:nth-child(6) { animation-delay: 0.70s; }
.story-fade.visible .story3-text > * { animation-play-state: running; }

/* Flèche de scroll */
@keyframes bounce-arrow {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(10px); }
}

.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  color: rgba(0, 0, 0, 0.35);
  animation: bounce-arrow 2s ease-in-out infinite;
  z-index: 2;
}

.scroll-hint svg {
  width: clamp(40px, 3.5vw, 70px);
  height: clamp(40px, 3.5vw, 70px);
}

.story-section-2 {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: visible;
  /* clip uniquement l'axe horizontal, au bord gauche du viewport (10px = padding #app) */
  clip-path: inset(-9999px 0 -9999px -10px);
  padding: 3rem 5rem 12rem calc(min(25vw, 560px) + 10rem);
}

.story2-layout {
  display: block;
  max-width: 900px;
}

.story2-image-wrap {
  position: absolute;
  left: -10px; /* compense le padding-left: 10px de #app pour aligner au bord du viewport */
  top: 50%;
  width: min(50vw, 1120px);
  height: min(50vw, 1120px);
  transform: translate(-50%, -50%);
}

.story2-img {
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 50%;
  animation: slow-rotate 200s linear infinite;
  will-change: transform;
  filter: drop-shadow(0px 12px 40px rgba(0, 0, 0, 0.22));
}

.story2-title {
  font-size: clamp(2rem, 3.5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  text-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2);
}

.story2-text p {
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.75;
  margin-bottom: 1rem;
  text-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);
  text-align: justify;
}

.story-list {
  list-style: disc;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.75;
  padding-left: 1.6rem;
  margin: 0.5rem 0 1rem;
  text-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);
}

.story-list li {
  margin-bottom: 0.5rem;
}

.story2-list {
  list-style: disc;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.75;
  padding-left: 1.6rem;
  margin-top: 0.25rem;
}

.story2-list li {
  margin-bottom: 0.75rem;
  text-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);
}

/* ── Section 3 : Made in France ── */

.story-section-3 {
  position: relative;
  z-index: 1;
  width: 100%;
}

.story3-layout {
  display: grid;
  grid-template-columns: 10fr 5fr;
  align-items: center;
  gap: 4rem;
  width: 100%;
  max-width: 2000px;
  margin: 0 auto;
  padding: 10rem 4rem;
}

.story3-text h2 {
  font-size: clamp(2rem, 3.5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  text-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2);
}

.story3-text p {
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.75;
  margin-bottom: 1rem;
  text-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);
  text-align: justify;
}

.story3-img-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  filter: drop-shadow(0px 20px 60px rgba(0, 0, 0, 0.18));
}

.story3-img {
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  object-fit: cover;
  -webkit-mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, black 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, black 55%, transparent 100%);
}

@media (min-width: 1025px) and (max-width: 1200px) {
  .story-layout {
    padding: 5rem 2.5rem;
    gap: 1.5rem 2.5rem;
  }

  .story3-layout {
    padding: 6rem 2.5rem;
    gap: 2.5rem;
  }

  .story-section-2 {
    padding: 3rem 2rem 8rem calc(min(25vw, 560px) + 5rem);
  }
}

@media (max-width: 900px) {
  .story-section-2 {
    padding: 3rem 2rem 5rem calc(45vw + 2rem);
    clip-path: inset(-9999px 0 -9999px -10px);
  }

  .story2-image-wrap {
    width: 90vw;
    height: 90vw;
  }
}

@media (max-width: 1024px) {
  /* Section 1 — image en fond, titre par-dessus */
  .story-layout {
    display: block;
    position: relative;
    padding: 0;
    margin-left: -10px;
    margin-right: -10px;
    width: calc(100% + 20px);
  }

  .story-video-wrap {
    position: absolute;
    top: 3rem;
    left: 0;
    right: 0;
    height: auto;
    z-index: 0;
    overflow: visible;
  }

  .vid-shadow-wrap {
    display: none;
  }

  .story-video-placeholder {
    display: block;
    width: 100%;
    height: auto;
    object-fit: unset;
    border-radius: 0;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .story-title {
    position: relative;
    z-index: 2;
    font-size: 16vw;
    line-height: 1.05;
    padding: 3rem 0 1rem;
    margin-bottom: 12rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.2em;
  }

  .story-title-top {
    text-align: left;
    will-change: transform, opacity;
  }

  .story-title-bottom {
    text-align: right;
  }

  .story-body {
    position: relative;
    z-index: 2;
    background: rgba(230, 229, 229, 0.92);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 2rem 1.5rem 2.5rem;
  }

  .story-body::before {
    content: '';
    position: absolute;
    top: -120px;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, transparent, rgba(230, 229, 229, 0.92));
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;
  }

  .story-body .story-sub {
    font-size: 1rem;
  }

  .story-body p {
    font-size: 1rem;
  }

  .story-sep {
    width: 100%;
    border-top-width: 3px;
    margin: 1rem 0;
  }

  /* Flèche scroll cachée sur mobile */
  .scroll-hint {
    display: none;
  }

  /* Animations scroll desktop désactivées (sauf .mob-fade) */
  .story-fade:not(.mob-fade),
  .story2-text > *:not(.mob-fade),
  .story3-text > *:not(.mob-fade) {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }

  /* Desktop animations désactivées sur titre/corps section 1 */
  .story-title,
  .story-body > * {
    animation: none !important;
  }

  /* Fade-in mobile au scroll */
  .mob-fade {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .mob-fade.visible {
    opacity: 1;
    transform: translateY(0);
  }


  .story-bg {
    filter: none;
    opacity: 0.38;
    position: absolute;
    background-image: url('../images/background-story.webp');
  }

  /* Orbs désactivés sur mobile */
  .story-orbs {
    display: none;
  }

  /* Section 2 — simplifié pour perfs */
  .story2-img {
    filter: none;
    will-change: auto;
  }


  /* Supprime tous les layers GPU superflus */
  .story-body,
  .story-video-wrap,
  .story-title,
  .story2-layout,
  .story3-layout {
    will-change: auto;
    transform: none;
    backface-visibility: visible;
  }

  /* backdrop-filter remplacé par fond solide */
  .story2-content,
  .story3-text {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(230, 229, 229, 0.92);
  }

  .story2-content::before,
  .story3-text::before {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }


  /* Section 2 mobile — soleil au-dessus des nuages */
  .story-section-2 {
    padding: 0;
    clip-path: none;
    overflow: hidden;
    position: relative;
    margin-left: -10px;
    margin-right: -10px;
    width: calc(100% + 20px);
    background: rgba(230, 229, 229, 0.92);
  }

  .story2-layout {
    display: block;
    max-width: 100%;
    position: relative;
    padding-top: 55vw;
  }

  .story2-image-wrap {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150vw;
    height: 150vw;
    z-index: 1;
  }

  .story2-content {
    position: relative;
    z-index: 2;
    background: rgba(230, 229, 229, 0.82);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 0;
    padding: 2rem 1.5rem 2.5rem;
  }

  .story2-content::before {
    content: '';
    position: absolute;
    top: -150px;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to bottom, transparent, rgba(230, 229, 229, 0.82));
    pointer-events: none;
    z-index: 3;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .story2-title {
    font-size: clamp(1.4rem, 5vw, 2rem);
    margin-bottom: 0.75rem;
  }

  .story2-text p,
  .story2-list li,
  .story-list li {
    font-size: 0.95rem;
  }

  /* Section 3 mobile — portrait en fond, texte par-dessus */
  .story-section-3 {
    overflow: hidden;
    margin-left: -10px;
    margin-right: -10px;
    width: calc(100% + 20px);
    content-visibility: auto;
    contain-intrinsic-size: 0 800px;
  }

  .story3-layout {
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
  }

  .story3-img-wrap {
    order: 1;
    width: 100%;
    height: 70vh;
    filter: none;
    overflow: hidden;
    filter: none;
  }

  .story3-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    border-radius: 0;
    -webkit-mask-image: none;
    mask-image: none;
    object-fit: cover;
    object-position: center 40%; /* 15% = coupe un peu le haut */
  }

  .story3-text {
    order: 2;
    position: relative;
    margin-top: -80px;
    z-index: 2;
    background: rgba(230, 229, 229, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2rem 1.5rem 3rem;
  }

  .story3-text::before {
    content: '';
    position: absolute;
    top: -160px;
    left: 0;
    right: 0;
    height: 160px;
    background: linear-gradient(to bottom, transparent, rgba(230, 229, 229, 0.85));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    pointer-events: none;
  }

  .story3-text h2 {
    font-size: clamp(1.4rem, 5vw, 2rem);
  }

  .story3-text p {
    font-size: 0.95rem;
  }
}

/* Vieux appareils iOS (≤ iOS 15, ex: iPhone 7) — backdrop-filter désactivé */
.old-ios .story2-content,
.old-ios .story2-content::before,
.old-ios .story3-text,
.old-ios .story3-text::before {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.old-ios .story2-content { background: rgba(230, 229, 229, 0.92) !important; }
.old-ios .story2-content::before { background: linear-gradient(to bottom, transparent, rgba(230, 229, 229, 0.92)) !important; }
.old-ios .story3-text { background: rgba(230, 229, 229, 0.92) !important; }
.old-ios .story3-text::before { background: linear-gradient(to bottom, transparent, rgba(230, 229, 229, 0.92)) !important; }
