/* Page Histoire — mise en page éditoriale et frise animée sur ordinateur */
@media (min-width: 1024px) {
  body.histoire-page main {
    --history-gutter: max(88px, calc((100% - 1440px) / 2));
    --history-space: 88px;
  }

  /* Ouverture */
  body.histoire-page .history-wow-hero {
    min-height: 0 !important;
    padding: 152px var(--history-gutter) 80px !important;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr) !important;
    gap: 56px !important;
    align-items: start;
  }

  body.histoire-page .history-wow-copy h1 {
    max-width: 760px !important;
    margin: 16px 0 36px !important;
    font-size: 3.5rem !important;
    line-height: 1.08 !important;
    letter-spacing: 0 !important;
    text-wrap: balance;
  }

  body.histoire-page .history-wow-copy .lead {
    max-width: 66ch !important;
    margin: 0 0 20px;
    padding-left: 20px;
    border-left: 1px solid var(--border);
    font-size: 1rem !important;
    line-height: 1.8 !important;
  }

  body.histoire-page .history-wow-copy .lead:first-of-type {
    border-left-color: var(--logada);
  }

  body.histoire-page .history-wow-pills {
    margin: 28px 0 18px !important;
  }

  body.histoire-page .history-wow-visual {
    position: sticky;
    top: 128px;
    min-height: 520px !important;
    margin-top: 80px;
  }

  /* Frise chronologique */
  body.histoire-page .timeline-section {
    padding: var(--history-space) var(--history-gutter);
  }

  body.histoire-page .timeline-section .section-title,
  body.histoire-page .team-story-head .section-title {
    max-width: 24ch;
    margin: 12px 0 0;
    font-size: 2.75rem !important;
    line-height: 1.16 !important;
    letter-spacing: 0 !important;
  }

  body.histoire-page .timeline-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 48px;
    border-left: 0;
    isolation: isolate;
  }

  /* Rail fixe et progression violette */
  body.histoire-page .timeline-grid::before,
  body.histoire-page .timeline-grid::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    pointer-events: none;
  }

  body.histoire-page .timeline-grid::before {
    background: rgba(255, 255, 255, 0.16);
  }

  body.histoire-page .timeline-grid::after {
    background: linear-gradient(180deg, #8278ff 0%, #6257ff 65%, rgba(98, 87, 255, 0.38) 100%);
    box-shadow: 0 0 14px rgba(98, 87, 255, 0.45);
    transform: scaleY(0);
    transform-origin: top;
  }

  body.histoire-page .timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1.65fr);
    align-items: start;
    gap: 32px;
    min-height: 0;
    padding: 32px 0 32px 28px;
    border-width: 0 0 1px;
    border-radius: 0;
    background: none;
    overflow: visible;
  }

  body.histoire-page .timeline-item::before {
    content: "";
    position: absolute;
    z-index: 1;
    top: 39px;
    left: -5px;
    width: 9px;
    height: 9px;
    border: 2px solid rgba(160, 153, 255, 0.65);
    border-radius: 50%;
    background: #11101d;
    box-shadow: 0 0 0 5px rgba(98, 87, 255, 0.08);
    opacity: 0.55;
    transform: scale(0.82);
  }

  body.histoire-page .timeline-item span {
    display: block;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: none;
    color: var(--logada2);
    box-shadow: none;
    font-size: 0.85rem;
    line-height: 1.6;
  }

  body.histoire-page .timeline-item h3 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.35;
    letter-spacing: 0;
    text-wrap: balance;
  }

  body.histoire-page .timeline-item p {
    max-width: 64ch;
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.8;
  }

  /* Étape de reconnaissance intégrée à la chronologie */
  body.histoire-page .timeline-item.history-recognition-v69 {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1.65fr);
    align-items: start;
    gap: 32px;
    max-width: none;
    margin: 0;
    padding: 32px 0 32px 28px;
    border-width: 0 0 1px;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  body.histoire-page .timeline-item.history-recognition-v69 > div:not(.history-recognition-orbit) {
    grid-column: 1 / span 2;
  }

  body.histoire-page .timeline-item.history-recognition-v69 > p {
    grid-column: 3;
    max-width: 64ch;
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.8;
  }

  body.histoire-page .history-recognition-orbit {
    display: none;
  }

  /* Animation liée au défilement, prise en charge par les navigateurs récents */
  @supports (animation-timeline: view()) {
    body.histoire-page .timeline-grid::after {
      animation: history-timeline-draw 1s linear both;
      animation-timeline: view(block);
      animation-range: entry 0% exit 100%;
    }

    body.histoire-page .timeline-item::before {
      animation: history-timeline-node 1s linear both;
      animation-timeline: view(block);
      animation-range: entry 35% cover 55%;
    }
  }

  @keyframes history-timeline-draw {
    from {
      transform: scaleY(0);
    }
    to {
      transform: scaleY(1);
    }
  }

  @keyframes history-timeline-node {
    from {
      opacity: 0.5;
      transform: scale(0.82);
      background: #11101d;
      box-shadow: 0 0 0 5px rgba(98, 87, 255, 0.08);
    }
    to {
      opacity: 1;
      transform: scale(1.12);
      background: #8278ff;
      box-shadow:
        0 0 0 5px rgba(98, 87, 255, 0.16),
        0 0 18px rgba(130, 120, 255, 0.8);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    body.histoire-page .timeline-grid::after {
      animation: none !important;
      transform: scaleY(1);
    }

    body.histoire-page .timeline-item::before {
      animation: none !important;
      opacity: 1;
      transform: none;
      background: #8278ff;
    }
  }

  /* Les trois fondateurs */
  body.histoire-page .team-story-section {
    padding: 24px var(--history-gutter) var(--history-space);
  }

  body.histoire-page .team-story-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 16px 64px;
    max-width: none;
    margin: 0 0 48px;
  }

  body.histoire-page .team-story-head > .section-kicker {
    grid-column: 1 / -1;
  }

  body.histoire-page .team-story-head .section-title {
    margin: 0;
  }

  body.histoire-page .team-story-head > p:last-child {
    max-width: 64ch;
  }

  body.histoire-page .founders-editorial {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 28px;
    max-width: none;
  }

  body.histoire-page .founder-editorial-card,
  body.histoire-page .founder-editorial-card.reverse {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  body.histoire-page .founder-editorial-card .founder-editorial-media {
    flex-shrink: 0;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    max-height: 460px;
    aspect-ratio: 4 / 5;
    border-radius: 8px;
  }

  /* Portrait de Gautier : le cadrage retenu tient dans le cadre, on l'aligne en haut. */
  body.histoire-page .founder-gautier img {
    object-position: center 0% !important;
  }

  body.histoire-page .founder-editorial-copy {
    flex: 1;
    justify-content: flex-start;
    padding: 28px 0 0;
  }

  body.histoire-page .founder-editorial-copy h3 {
    min-height: 2.4em;
    margin: 12px 0;
    font-size: 1.75rem;
    line-height: 1.2;
    letter-spacing: 0;
  }

  body.histoire-page .founder-editorial-copy .role {
    min-height: 3.4em;
    margin: 0 0 20px;
    font-size: 0.75rem;
    line-height: 1.7;
    letter-spacing: 0;
  }

  body.histoire-page .founder-editorial-copy p:not(.role) {
    margin: 0 0 24px;
    font-size: 0.98rem;
    line-height: 1.85;
  }

  body.histoire-page .founder-mission {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: 150px;
    margin-top: auto;
    padding: 20px 0 0;
    border-width: 1px 0 0;
    border-radius: 0;
    background: none;
    font-size: 0.9rem;
  }

  body.histoire-page .founder-mission strong {
    letter-spacing: 0;
  }

  /* Galerie des coulisses */
  body.histoire-page .team-secret-entry {
    max-width: none;
    margin-top: var(--history-space);
    padding: 48px 0 0;
    border-top: 1px solid var(--border);
  }

  body.histoire-page .secret-entry-copy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 16px 64px;
    margin-bottom: 56px;
  }

  body.histoire-page .secret-entry-copy > .section-kicker {
    grid-column: 1 / -1;
  }

  body.histoire-page .secret-entry-copy h3 {
    max-width: 24ch;
    font-size: 2.5rem;
    line-height: 1.16;
    letter-spacing: 0;
  }

  body.histoire-page .secret-entry-copy p:last-child {
    margin: 0;
  }

  body.histoire-page .team-secret-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    padding: 0 12px;
  }

  body.histoire-page .team-secret-strip figure {
    height: 400px;
  }

  body.histoire-page .secret-gallery-link {
    margin-top: 36px;
  }

  /* Conclusion */
  body.histoire-page .story-manifesto {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 20px 64px;
    margin: 0;
    padding: 64px var(--history-gutter) 80px;
    border-width: 1px 0 0;
    border-radius: 0;
    box-shadow: none;
  }

  body.histoire-page .story-manifesto > .section-kicker {
    grid-column: 1 / -1;
    margin: 0;
  }

  body.histoire-page .story-manifesto h2 {
    margin: 0;
    font-size: 2.5rem !important;
    line-height: 1.16 !important;
    letter-spacing: 0 !important;
    text-wrap: balance;
  }

  body.histoire-page .story-manifesto > p:last-child {
    max-width: 64ch;
    margin: 0;
    font-size: 1rem;
    line-height: 1.85;
  }
}
/* Page Histoire — ouverture plus lumineuse et plus lisible */
@media (min-width: 761px) {
  body.histoire-page .history-wow-hero {
    min-height: min(88svh, 900px) !important;
    align-items: center !important;
    gap: clamp(36px, 5vw, 72px) !important;
    padding-top: clamp(132px, 15vh, 174px) !important;
    padding-bottom: clamp(64px, 8vh, 96px) !important;
  }

  body.histoire-page .history-wow-bg::before {
    background:
      radial-gradient(circle at 72% 36%, rgba(92, 79, 255, 0.3), transparent 36%),
      linear-gradient(90deg, rgba(4, 4, 10, 0.78) 0%, rgba(4, 4, 10, 0.38) 48%, rgba(4, 4, 10, 0.58) 100%);
  }

  body.histoire-page .history-wow-bg img[src*="agency-sofa-daniel-gautier"] {
    object-position: center 46% !important;
    filter: saturate(1.06) contrast(1.03) brightness(0.7) !important;
    opacity: 0.66 !important;
  }

  body.histoire-page .history-wow-copy h1 {
    max-width: 13ch !important;
    margin-bottom: 28px !important;
    font-size: clamp(3.4rem, 5vw, 5.3rem) !important;
    line-height: 1.02 !important;
    letter-spacing: -0.055em !important;
    text-wrap: balance;
  }

  body.histoire-page .history-wow-copy .lead {
    max-width: 58ch !important;
    padding-left: 0;
    border-left: 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 1.04rem !important;
    line-height: 1.75 !important;
  }

  body.histoire-page .history-wow-visual {
    width: 100%;
    max-width: 560px;
    min-height: 500px !important;
    margin-top: 24px;
    justify-self: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 32px;
    background:
      radial-gradient(circle at 50% 38%, rgba(91, 78, 255, 0.22), transparent 52%),
      linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(15, 14, 28, 0.48));
    box-shadow:
      0 32px 100px rgba(0, 0, 0, 0.34),
      inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }

  body.histoire-page .history-main-logo {
    top: 13%;
    left: 10%;
    width: 72%;
  }

  body.histoire-page .history-app-float {
    right: 2%;
    bottom: 3%;
    width: 48%;
    max-width: 340px;
  }

  body.histoire-page .history-mini-card {
    left: 7%;
    right: auto;
    bottom: 10%;
    max-width: 78%;
    padding: 16px 19px;
    border-radius: 18px;
    background: rgba(17, 16, 29, 0.66);
  }
}

/* Tablettes (761–1023 px) : portrait de Gautier, cadrage décalé pour écarter le premier plan. */
@media (min-width: 761px) and (max-width: 1023px) {
  body.histoire-page .founder-gautier img {
    object-position: 38% 50% !important;
  }
}
