/* ============================================================
   BizOS v22 — agent « global »
   Header, footer, et finitions transverses (bouton primaire,
   sélection, focus-visible, courbes de reveal, typographie).
   Chargé APRÈS toutes les feuilles existantes.
   ============================================================ */

:root {
  --v22-ease: cubic-bezier(.2, .7, .2, 1);
  --v22-line-soft: rgba(11, 18, 32, .08);
  --v22-ink-2: #3d4956;   /* liens du footer — 9:1 */
  --v22-ink-3: #626d7a;   /* texte courant du footer — 5:1 */
  --v22-ink-4: #667180;   /* intitulés et bas de page — 4,8:1 */
  /* Colonne de page : identique à .content (min(100%, 1320px) + gutter). */
  --v22-rail: max(var(--gutter), calc(50% - 660px + var(--gutter)));
}

/* ------------------------------------------------------------
   1. Transverse — sélection, focus, courbes, typographie
   ------------------------------------------------------------ */

/* Sélection aux couleurs de la marque (bleu très dilué, texte encre). */
html ::selection { background: rgba(8, 116, 232, .16); color: var(--ink); }
html ::-moz-selection { background: rgba(8, 116, 232, .16); color: var(--ink); }
/* Sur les surfaces bleues, on inverse pour rester lisible. */
html .btn-primary ::selection, html .header-cta ::selection { background: rgba(255, 255, 255, .32); color: #fff; }
html .btn-primary ::-moz-selection, html .header-cta ::-moz-selection { background: rgba(255, 255, 255, .32); color: #fff; }

/* Focus-visible unifié : anneau bleu 2,5 px, jamais collé au bord,
   et surtout un rayon qui suit la forme du composant (la règle d'origine
   forçait 4 px et cassait l'arrondi des boutons au clavier). */
html a:focus-visible,
html button:focus-visible,
html summary:focus-visible,
html [tabindex="0"]:focus-visible {
  outline: 2.5px solid var(--blue);
  outline-offset: 3px;
  border-radius: 6px;
}
html .btn-primary:focus-visible { border-radius: 14px; }
html .header-cta:focus-visible { border-radius: 12px; }
html .brand:focus-visible,
html .footer-brand:focus-visible { border-radius: 10px; }
html .skip-link:focus-visible { border-radius: 10px; outline-offset: 2px; }

/* Titres : équilibrage des lignes. On épargne la séquence épinglée
   des capabilities, dont les lignes sont pilotées au pixel. */
html h1,
html h2:not(.capability-headline) { text-wrap: balance; }
html .section-copy, html .intro, html .collaboration-subtitle { text-wrap: pretty; }

/* Reveal : mêmes hooks, courbe et durées affinées.
   L'opacité arrive un peu avant la translation : l'élément « se pose ». */
html.js .reveal {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity .52s var(--v22-ease), transform .66s var(--v22-ease);
}
html.js .reveal.is-visible { opacity: 1; transform: none; }

/* Défilement doux uniquement si l'utilisateur ne demande pas le calme. */
html { scroll-behavior: auto; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ------------------------------------------------------------
   2. Bouton primaire — micro-interactions
   ------------------------------------------------------------ */

html .btn-primary {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .26),
    0 1px 2px rgba(11, 18, 32, .10),
    0 10px 26px -8px rgba(8, 116, 232, .46);
  transition:
    background .2s var(--v22-ease),
    transform .18s var(--v22-ease),
    box-shadow .24s var(--v22-ease);
}
html .btn-primary .apple-icon,
html .btn-primary .button-arrow { transition: transform .24s var(--v22-ease); }
html .btn-primary .button-arrow { display: inline-block; }

html .btn-primary:hover {
  background: var(--blue-hover);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .3),
    0 2px 4px rgba(11, 18, 32, .10),
    0 16px 34px -10px rgba(8, 116, 232, .54);
}
html .btn-primary:hover .apple-icon { transform: translateY(-1px); }
html .btn-primary:hover .button-arrow { transform: translate(1px, -1px); }

/* Appui : le bouton s'enfonce d'un pixel, l'ombre se resserre. */
html .btn-primary:active {
  transform: translateY(1px);
  background: #0059c0;
  box-shadow:
    inset 0 1px 2px rgba(11, 18, 32, .22),
    0 1px 2px rgba(11, 18, 32, .12),
    0 4px 12px -6px rgba(8, 116, 232, .4);
  transition-duration: .08s;
}
html .btn-primary:active .apple-icon,
html .btn-primary:active .button-arrow { transform: none; }

/* Lien texte de repli sous le bouton final. */
html .web-alternative {
  color: var(--muted-2);
  text-decoration-color: rgba(11, 18, 32, .22);
  transition: color .2s var(--v22-ease), text-decoration-color .2s var(--v22-ease);
}
html .web-alternative:hover { color: var(--blue); text-decoration-color: currentColor; }

/* ------------------------------------------------------------
   3. Header
   ------------------------------------------------------------ */

.site-header.site-header-v22 {
  height: 72px;
  /* Le header s'aligne sur la même colonne que le corps de page. */
  padding-inline: var(--v22-rail);
  transition: background .4s var(--v22-ease), box-shadow .4s var(--v22-ease);
}

/* Barre qui se pose au scroll : blanc laiteux, flou, filet --line. */
.v6 .site-header.site-header-v22.scrolled {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  box-shadow: 0 1px 0 var(--line), 0 8px 24px -18px rgba(11, 18, 32, .5);
}

/* La marque : wordmark seul et centré en haut de page, puis lockup complet
   (spirale + wordmark + BETA) qui se glisse à gauche quand la barre se pose. */
.v6 .site-header-v22 .brand {
  gap: 0;
  padding: 4px 6px;
  border-radius: 12px;
  transition:
    left .58s var(--v22-ease),
    transform .58s var(--v22-ease),
    margin-left .58s var(--v22-ease);
}
.v6 .site-header-v22.scrolled .brand { left: var(--v22-rail); margin-left: -6px; }

.v6 .site-header-v22 .brand img {
  display: block;
  width: 0;
  height: 28px;
  margin-right: 0;
  border-radius: 8px;
  opacity: 0;
  transform: scale(.72);
  box-shadow: 0 1px 2px rgba(11, 18, 32, .16);
  transition:
    width .46s var(--v22-ease),
    margin-right .46s var(--v22-ease),
    opacity .34s var(--v22-ease) .06s,
    transform .46s var(--v22-ease) .06s;
}
.v6 .site-header-v22.scrolled .brand img {
  width: 28px;
  margin-right: 10px;
  opacity: 1;
  transform: none;
}

.v6 .site-header-v22 .wordmark {
  font-size: 30px;
  line-height: 1;
  letter-spacing: -.055em;
  color: var(--ink);
  transition: font-size .46s var(--v22-ease), color .22s var(--v22-ease);
}
.v6 .site-header-v22.scrolled .wordmark { font-size: 26px; }

/* Hover de la marque : le bleu de la maison, la spirale respire. */
.v6 .site-header-v22 .brand:hover .wordmark { color: var(--blue); }
.v6 .site-header-v22 .brand:hover img { transform: scale(1.06) rotate(-5deg); }
.v6 .site-header-v22.scrolled .brand:hover img { transform: scale(1.06) rotate(-5deg); }

/* BETA ciselé : capitale minuscule très interlettrée, dans un filet. */
.v6 .site-header-v22 .brand .beta {
  display: inline-block;
  align-self: center;
  max-width: 0;
  overflow: hidden;
  margin: -13px 0 0 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .15em;
  text-indent: .15em;
  color: #6b7280;
  opacity: 0;
  white-space: nowrap;
  transition:
    max-width .46s var(--v22-ease),
    margin .46s var(--v22-ease),
    padding .46s var(--v22-ease),
    opacity .3s var(--v22-ease) .12s;
}
.v6 .site-header-v22.scrolled .brand .beta {
  max-width: 72px;
  margin: -13px 0 0 11px;
  padding: 3.5px 5px 3.5px 6px;
  border-color: var(--v22-line-soft);
  opacity: 1;
}

/* Le bloc de droite garde son fondu, avec un léger décalage de courbe. */
.v6 .site-header-v22 .header-links {
  transition:
    opacity .38s var(--v22-ease),
    transform .46s var(--v22-ease),
    visibility .38s var(--v22-ease);
}

/* Bouton du header : même bleu que le bouton primaire (cohérence de marque),
   même grammaire de micro-interactions, en plus discret. */
.site-header-v22 .header-cta,
.company-page .site-header.site-header-v22 .header-cta {
  height: 40px;
  padding: 0 15px 0 14px;
  gap: 9px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -.008em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    0 1px 2px rgba(11, 18, 32, .10),
    0 8px 20px -10px rgba(8, 116, 232, .55);
  transition:
    background .2s var(--v22-ease),
    transform .18s var(--v22-ease),
    box-shadow .24s var(--v22-ease);
}
.site-header-v22 .header-cta .apple-icon,
.site-header-v22 .header-cta .button-arrow { transition: transform .24s var(--v22-ease); }
.site-header-v22 .header-cta .button-arrow { display: inline-block; margin-left: -1px; font-size: 15px; }
.site-header-v22 .header-cta:hover,
.company-page .site-header.site-header-v22 .header-cta:hover {
  background: var(--blue-hover);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .26),
    0 2px 5px rgba(11, 18, 32, .10),
    0 14px 28px -12px rgba(8, 116, 232, .6);
}
.site-header-v22 .header-cta:hover .apple-icon { transform: translateY(-1px); }
.site-header-v22 .header-cta:hover .button-arrow { transform: translate(1px, -1px); }
.site-header-v22 .header-cta:active,
.company-page .site-header.site-header-v22 .header-cta:active {
  transform: translateY(1px);
  background: #0059c0;
  box-shadow:
    inset 0 1px 2px rgba(11, 18, 32, .2),
    0 3px 10px -6px rgba(8, 116, 232, .45);
  transition-duration: .08s;
}
.site-header-v22 .header-cta:active .apple-icon,
.site-header-v22 .header-cta:active .button-arrow { transform: none; }

/* ------------------------------------------------------------
   4. Footer
   ------------------------------------------------------------ */

.resource-footer.resource-footer-v22 {
  padding: 72px 0 28px;
  border-top: 1px solid var(--line);
  background: #fafbfc;
  color: var(--v22-ink-3);
}

/* Même colonne que le corps de page : le footer s'aligne enfin sur .content. */
.resource-footer-v22 .resource-footer-grid,
.resource-footer-v22 .resource-footer-bottom {
  width: min(100%, 1320px);
  max-width: none;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.resource-footer-v22 .resource-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, 1fr));
  column-gap: clamp(24px, 3.4vw, 58px);
  row-gap: 40px;
  align-items: start;
}

/* Marque : lockup spirale + wordmark, tagline en dessous. */
.resource-footer-v22 .resource-footer-brand .footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  line-height: 1;
}
.resource-footer-v22 .footer-mark {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 7.5px;
  box-shadow: 0 1px 2px rgba(11, 18, 32, .14);
  transition: transform .28s var(--v22-ease);
}
.resource-footer-v22 .footer-wordmark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  letter-spacing: -.06em;
  color: var(--ink);
  transition: color .2s var(--v22-ease);
}
.resource-footer-v22 .footer-brand:hover .footer-wordmark { color: var(--blue); }
.resource-footer-v22 .footer-brand:hover .footer-mark { transform: scale(1.06) rotate(-5deg); }
.resource-footer-v22 .resource-footer-brand p {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -.006em;
  color: var(--v22-ink-3);
}

/* Colonnes : titre discret mais net, liens plus présents que le titre. */
.resource-footer-v22 h3 {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .085em;
  text-transform: uppercase;
  color: var(--v22-ink-4);
}
.resource-footer-v22 nav { display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
.resource-footer-v22 nav a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-size: 13.5px;
  line-height: 1.35;
  letter-spacing: -.006em;
  color: var(--v22-ink-2);
  transition: color .2s var(--v22-ease);
}
/* Le soulignement pousse depuis la gauche, sans décalage de mise en page. */
.resource-footer-v22 nav a > span {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size .3s var(--v22-ease);
}
.resource-footer-v22 nav a:hover { color: var(--blue); }
.resource-footer-v22 nav a:hover > span { background-size: 100% 1px; }

/* Bas de page. */
.resource-footer-v22 .resource-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 52px auto 0;
  padding-top: 22px;
  /* Le filet suit la colonne de texte, pas la boîte avec ses gouttières. */
  border-top: 0;
  background: linear-gradient(var(--line), var(--line)) no-repeat var(--gutter) 0 / calc(100% - var(--gutter) * 2) 1px;
  font-size: 12px;
  letter-spacing: -.002em;
  color: var(--v22-ink-4);
}
.resource-footer-v22 .resource-footer-bottom a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  color: var(--v22-ink-4);
  transition: color .2s var(--v22-ease);
}
.resource-footer-v22 .resource-footer-bottom a .footer-arrow { transition: transform .24s var(--v22-ease); }
.resource-footer-v22 .resource-footer-bottom a:hover { color: var(--blue); }
.resource-footer-v22 .resource-footer-bottom a:hover .footer-arrow { transform: translate(1px, -1px); }

/* ------------------------------------------------------------
   5. Mobile
   ------------------------------------------------------------ */

@media (max-width: 860px) {
  .resource-footer-v22 .resource-footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 24px;
    row-gap: 38px;
  }
  .resource-footer-v22 .resource-footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .resource-footer.resource-footer-v22 { padding: 52px 0 24px; }
  .resource-footer-v22 .resource-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
    row-gap: 32px;
  }
  .resource-footer-v22 nav a { min-height: 40px; font-size: 14px; }
  .resource-footer-v22 .resource-footer-bottom { margin-top: 34px; }
}

@media (max-width: 760px) {
  .site-header.site-header-v22 { height: 64px; }
  .v6 .site-header-v22 .wordmark { font-size: 26px; }
  .v6 .site-header-v22.scrolled .wordmark { font-size: 23px; }
  .v6 .site-header-v22.scrolled .brand img { width: 25px; height: 25px; margin-right: 8px; border-radius: 7px; }
  .v6 .site-header-v22 .brand img { height: 25px; }
  .v6 .site-header-v22.scrolled .brand .beta { max-width: 66px; margin: -12px 0 0 7px; font-size: 8px; padding: 3px 4px 3px 5px; }
  .site-header-v22 .header-cta,
  .company-page .site-header.site-header-v22 .header-cta {
    height: 38px;
    padding: 0 13px 0 12px;
    gap: 7px;
    font-size: 12.5px;
  }
  .site-header-v22 .header-cta .apple-icon { width: 14px; height: 16px; }
  .site-header-v22 .header-cta .button-arrow { font-size: 13px; }
}

/* Sous 360 px, on retire le BETA : la marque et le bouton se croiseraient. */
@media (max-width: 359px) {
  .site-header-v22 .header-cta,
  .company-page .site-header.site-header-v22 .header-cta { padding: 0 11px 0 10px; font-size: 12px; }
  .v6 .site-header-v22.scrolled .brand .beta { max-width: 0; margin-left: 0; padding: 0; border-color: transparent; opacity: 0; }
}

/* ------------------------------------------------------------
   6. Mouvement réduit
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html .btn-primary:hover,
  html .btn-primary:active,
  .site-header-v22 .header-cta:hover,
  .site-header-v22 .header-cta:active { transform: none; }
  html.js .reveal { opacity: 1; transform: none; }
  .v6 .site-header-v22 .brand:hover img,
  .resource-footer-v22 .footer-brand:hover .footer-mark { transform: none; }
}
