/* ============================================================
   RETOUR À SOI · sections « humaines » de l'accueil :
   mosaïque photo, saisons de maman, cartes de fonctionnement
   ============================================================ */

.d em { font-style: normal; color: var(--magenta); }

/* ---------- LA VRAIE VIE (mosaïque) ---------- */
.life { padding-top: clamp(3rem, 6vw, 5rem); overflow: hidden; }
.life__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(0.8rem, 1.6vw, 1.5rem);
  padding: 0 var(--gutter);
  align-items: start;
}
.life__text {
  grid-column: 4 / span 6;
  grid-row: 1 / span 2;
  align-self: center;
  text-align: center;
  padding: 0 clamp(0.5rem, 2vw, 2rem);
}
.life__text .mono { margin-bottom: 1.4rem; opacity: 0.7; }
.life__photo { position: relative; overflow: hidden; margin: 0; }
.life__photo--1 { grid-column: 1 / span 3; grid-row: 1; aspect-ratio: 3 / 4; }
.life__photo--2 { grid-column: 10 / span 3; grid-row: 1; aspect-ratio: 4 / 5; margin-top: clamp(3rem, 8vw, 8rem); }
.life__photo--3 { grid-column: 2 / span 2; grid-row: 2; aspect-ratio: 1; margin-top: clamp(1rem, 3vw, 3rem); }
.life__photo--4 { grid-column: 10 / span 2; grid-row: 2; aspect-ratio: 3 / 4; margin-top: clamp(2rem, 5vw, 5rem); }
.life__photo--5 { grid-column: 5 / span 4; grid-row: 3; aspect-ratio: 16 / 11; margin-top: clamp(1rem, 3vw, 2rem); }
.life__photo--6 { grid-column: 1 / span 3; grid-row: 3; aspect-ratio: 4 / 5; margin-top: clamp(3rem, 7vw, 7rem); }
.life__photo--7 { grid-column: 10 / span 2; grid-row: 3; aspect-ratio: 3 / 4; margin-top: clamp(5rem, 11vw, 11rem); }

/* Cadre photo : dégradé duotone visible le temps du chargement */
.ph {
  position: absolute;
  inset: -14% 0;
  background:
    radial-gradient(70% 60% at 30% 70%, rgba(255, 126, 74, 0.55), transparent 70%),
    radial-gradient(60% 70% at 80% 30%, rgba(141, 107, 200, 0.55), transparent 70%),
    var(--rose);
}
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.life__photo--2 .ph { background-color: var(--lav); }
.life__photo--3 .ph { background-color: var(--peach); }
.life__photo--4 .ph { background-color: var(--blush); }
.life__photo--5 .ph { background-color: var(--violet); }

/* ---------- SAISONS ---------- */
.seasons__head, .types__head {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}
.seasons__head .d, .types__head .d { grid-column: 1 / span 7; }
.seasons__head > p, .types__head > p { grid-column: 9 / span 4; align-self: end; }
.seasons__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1.5rem, 3vw, 3rem); }
.season__fig {
  display: block;
  width: auto;
  max-width: 100%;
  height: clamp(11rem, 16vw, 14rem);
  margin-bottom: 2rem;
  object-fit: contain;
  object-position: left bottom;
}
/* Aura floue derrière chaque dessin */
.season { position: relative; isolation: isolate; --halo: var(--peach); }
.season:nth-child(2) { --halo: var(--rose); }
.season:nth-child(3) { --halo: #F59A7A; }
.season:nth-child(4) { --halo: var(--lav); }
.season::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 2rem;
  left: -1.5rem;
  width: clamp(10rem, 15vw, 13rem);
  height: clamp(9rem, 13vw, 12rem);
  background: radial-gradient(closest-side, var(--halo), transparent);
  border-radius: 46% 54% 58% 42% / 52% 44% 56% 48%;
  opacity: 0.6;
  filter: blur(18px);
}
.season .mono { opacity: 0.55; }
.season h3 { margin: 0.5rem 0 0.8rem; }

/* ---------- CARTES DE FONCTIONNEMENT ---------- */
.types { overflow: hidden; }
.types__track {
  display: grid;
  grid-template-columns: repeat(5, minmax(16.5rem, 1fr));
  gap: 1rem;
  /* Marge haut/bas : la carte en rotation dépasse sans être coupée */
  padding: 2.5rem var(--gutter) 3rem;
  margin-block: -2.5rem -2rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}
.types__track::-webkit-scrollbar { display: none; }
/* Défilé piloté par le scroll (mobile, tablette) : les cartes glissent dans la piste */
.types__track.is-scrubbed { overflow-x: clip; scroll-snap-type: none; }
.tcard { scroll-snap-align: start; perspective: 2200px; }
.tcard__inner {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4.6;
  text-align: left;
  transform-style: preserve-3d;
  transition: transform 1.4s var(--ease-in-out);
}
.tcard__inner[aria-pressed="true"] { transform: rotateY(180deg); }
.tcard__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 1.3rem;
  border-radius: 0.9rem;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.tcard__front { background: var(--g); color: var(--plum); }
.tcard__back { transform: rotateY(180deg); background: var(--plum); color: var(--cream); gap: 0.55rem; }
.tcard__inner:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; border-radius: 0.9rem; }

.tcard__wave {
  position: absolute;
  inset: 0;
  /* Lignes décalées d'un quart d'onde : motif sans raccord, effet soie */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 96'%3E%3Cg fill='none' stroke='white' stroke-opacity='.42' stroke-width='.8' stroke-linecap='round'%3E%3Cpath d='M-240 12C-200 4 -160 4 -120 12S-40 20 0 12S80 4 120 12S200 20 240 12S320 4 360 12S440 20 480 12'/%3E%3Cpath d='M-180 36C-140 28 -100 28 -60 36S20 44 60 36S140 28 180 36S260 44 300 36S380 28 420 36S500 44 540 36'/%3E%3Cpath d='M-120 60C-80 52 -40 52 0 60S80 68 120 60S200 52 240 60S320 68 360 60S440 52 480 60'/%3E%3Cpath d='M-60 84C-20 76 20 76 60 84S140 92 180 84S260 76 300 84S380 92 420 84S500 76 540 84'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 15rem 6rem repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 70%, transparent);
  animation: wave-flow 24s linear infinite;
}
@keyframes wave-flow { to { background-position: 15rem 0; } }
@media (prefers-reduced-motion: reduce) { .tcard__wave { animation: none; } }
.tcard__whatif, .tcard__name, .tcard__foot { position: relative; }
.tcard__buddy {
  position: relative;
  align-self: center;
  width: 4.6rem;
  height: 4.6rem;
  margin: auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.7rem;
  padding-top: 0.4rem;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.85), var(--b) 70%);
  box-shadow: 0 14px 30px -12px rgba(43, 26, 94, 0.5);
  border-radius: var(--shape);
  transition: transform 0.8s var(--ease);
}
.tcard:hover .tcard__buddy { transform: translateY(-0.4rem) rotate(-6deg); }
.tcard__buddy i { width: 0.34rem; height: 0.5rem; border-radius: 50%; background: var(--plum); animation: blink 3.2s ease-in-out infinite; }
/* Un clignement simple toutes les ~3 s, décalé d'une carte à l'autre */
.tcard:nth-child(2) .tcard__buddy i { animation-delay: -1.1s; }
.tcard:nth-child(3) .tcard__buddy i { animation-delay: -2.3s; }
.tcard:nth-child(4) .tcard__buddy i { animation-delay: -0.6s; }
.tcard:nth-child(5) .tcard__buddy i { animation-delay: -1.8s; }
@keyframes blink {
  0%, 90%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}
@media (prefers-reduced-motion: reduce) { .tcard__buddy i { animation: none; } }
.tcard__whatif { font-size: 1rem; opacity: 0.85; }
.tcard__name { font-size: clamp(1.7rem, 2.3vw, 2.2rem); line-height: 1; margin-top: 0.3rem; }
.tcard__foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  margin-top: 1rem;
  font-size: 0.8rem;
}
.tcard__pct { white-space: nowrap; opacity: 0.7; }
.tcard__hint { white-space: nowrap; opacity: 0.85; }
.tcard__hint .icon { width: 0.8em; height: 0.8em; margin-left: 0.15rem; vertical-align: -0.05em; }
/* Sur ordinateur, la carte se retourne au survol */
@media (hover: hover) and (pointer: fine) {
  .tcard:hover .tcard__inner { transform: rotateY(180deg); transition-delay: 0.15s; }
}

.tcard__back .mono { color: var(--rose); font-size: 0.66rem; }
.tcard__strategy { font-size: clamp(1.4rem, 1.9vw, 1.8rem); line-height: 1.05; }
.tcard__text, .tcard__mum { font-size: 0.9rem; line-height: 1.45; opacity: 0.85; }
.tcard__duo { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; padding: 0.8rem 0; border-block: 1px solid var(--line-light); font-size: 0.92rem; }
.tcard__duo .mono, .tcard__mum .mono { display: block; margin-bottom: 0.25rem; }
.tcard__mum { margin-top: auto; }

.tcard--gen { --g: linear-gradient(165deg, #FFD3BC, #FF9C76 50%, #E58FB0); --b: #FF7E4A; --shape: 50%; }
.tcard--mg { --g: linear-gradient(165deg, #FFB693, #E58FB0 50%, #A783D6); --b: #E58FB0; --shape: 58% 42% 55% 45% / 50% 60% 40% 50%; }
.tcard--pro { --g: linear-gradient(165deg, #E4D4F5, #CDB4EC 45%, #E58FB0); --b: #8D6BC8; --shape: 50% 50% 46% 46% / 62% 62% 38% 38%; }
.tcard--man { --g: linear-gradient(165deg, #E58FB0, #C9507E 45%, #5B3A82); --b: #C9507E; --shape: 30%; color: var(--cream); }
.tcard--man .tcard__front { color: var(--cream); }
.tcard--ref { --g: linear-gradient(165deg, #F7F0E8, #E7DEF3 40%, #CDB4EC); --b: #CDB4EC; --shape: 44% 56% 50% 50% / 50% 44% 56% 50%; }

.types__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-top: clamp(2.4rem, 5vw, 4rem);
}
.types__foot p { max-width: 30rem; font-size: 1.1rem; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 960px) {
  .seasons__grid { grid-template-columns: repeat(2, 1fr); }
  .seasons__head .d, .seasons__head > p, .types__head .d, .types__head > p { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .life__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .life__text { grid-column: 1 / -1; grid-row: auto; order: -1; margin-bottom: 1.5rem; }
  .life__photo { grid-column: auto; grid-row: auto; margin-top: 0; aspect-ratio: 3 / 4; }
  .life__photo:nth-of-type(even) { margin-top: 3rem; }
  .life__photo--5 { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
  .life__photo.life__photo--6 { margin-top: 0; }
  .life__photo--7 { margin-top: 3rem; }
  .types__track { grid-template-columns: repeat(5, 78vw); }
  .types__foot { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .seasons__grid { grid-template-columns: 1fr; }
}
