/* TOBY Software : mise en page du site, sur la base du design system « Ingénierie ».
   Les couleurs, espacements et tailles viennent de tokens.css, les composants de system.css.
   Ce fichier ne pose que la grille et l'agencement des pages. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h-mobile) + var(--space-4)); -webkit-text-size-adjust: 100%; background: var(--bg); }
body { overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: var(--text-strong); }
[hidden] { display: none !important; }
::selection { background: var(--text-strong); color: var(--bg); }
/* Focus visible pour tous les liens et contrôles, y compris hors composants tb- */
a:focus-visible, button:focus-visible, summary:focus-visible { outline: var(--stroke-2) solid var(--accent); outline-offset: 2px; }
::placeholder { color: var(--text-muted); }

.skip {
  position: absolute; left: var(--space-4); top: -80px; z-index: 200; padding: var(--space-2) var(--space-4);
  background: var(--text-strong); color: var(--bg); font-weight: 500; text-decoration: none; border-radius: var(--radius-sm);
}
.skip:focus { top: var(--space-3); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Conteneur et grille ---------- */
.wrap { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter-mobile); }
.g12 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--space-5); }
.g12 > * { grid-column: 1 / -1; min-width: 0; }
@media (min-width: 900px) {
  html { scroll-padding-top: calc(var(--header-h) + var(--space-4)); }
  .wrap { padding: 0 var(--gutter); }
  .g12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--space-8); background: var(--bg); color: var(--text); }
.section--alt { background: var(--surface-hover); }
.section__body { margin-top: var(--space-7); }
@media (min-width: 600px) { .section { padding-block: var(--space-9); } }
@media (min-width: 900px) { .section { padding-block: var(--space-10); } }

/* Sur mobile, les cartes plates s'alignent sur la marge : seuls les filets les séparent */
@media (max-width: 599px) {
  .tb-grid > .tb-card:not(.tb-card--raised) { padding-inline: 0; }
  .tb-grid--stats > .tb-stat:first-child { padding-left: 0; }
}

/* L'en-tête de section sur fond alterné : les cartes plates prennent le même fond */
.section--alt .tb-card:not(.tb-card--raised), .section--alt .tb-stat { background: var(--surface-hover); }

/* ---------- En-tête du site ---------- */
.site-header .tb-header__in { max-width: var(--container); }
.tb-header__brand .tb-logo { height: 34px; --cut: var(--bg); }
.tb-header__menu-btn { display: inline-flex; }
@media (min-width: 900px) { .tb-header__menu-btn { display: none; } }
/* Sur mobile : le bouton de contact reste dans la barre, à côté du menu */
.header-cta { margin-left: auto; margin-right: calc(var(--space-2) * -1); }
@media (min-width: 900px) { .header-cta { display: none; } }
/* Section en cours dans la navigation (posée par site.js) */
.tb-header__link[aria-current="location"] { color: var(--text-strong); }
.tb-header__link[aria-current="location"]::before {
  content: ""; position: absolute; left: 50%; bottom: 4px; width: 6px; height: 6px; margin-left: -3px;
  border-radius: var(--radius-full); background: var(--accent);
}
.tb-header__panel { max-height: calc(100vh - var(--header-h-mobile)); overflow-y: auto; }
.tb-header__panel li a { font-size: 21px; font-weight: 600; letter-spacing: -.012em; }
.tb-header__panel .panel-foot { display: grid; gap: var(--space-2); }
.tb-header__panel .panel-foot a { color: var(--text); text-decoration: none; }

/* ---------- Logo (sprite du site) ---------- */
.tb-logo { --cut: var(--bg); }

/* ---------- Hero ---------- */
.hero { padding-block: var(--space-7) var(--space-8); }
.hero__status { margin: 0 0 var(--space-6); }
.hero__title { max-width: 12ch; }
.hero .tb-bar { margin: var(--space-6) 0; }
.hero__grid { row-gap: var(--space-7); }
.hero__lede { max-width: 40ch; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); margin-top: var(--space-6); }
.hero__note { margin-top: var(--space-6); color: var(--text-muted); }
.hero__shot { margin: 0; }
@media (min-width: 900px) {
  .hero { padding-block: var(--space-9); }
  .hero__grid { align-items: center; }
  .hero__main { grid-column: 1 / span 7; }
  .hero__title { max-width: 13ch; }
  .hero__shot { grid-column: 8 / span 5; }
}
@media (min-width: 1200px) {
  /* La capture déborde un peu vers la droite : l'écran du client, pas une vignette */
  .hero__shot { margin-right: calc(var(--gutter) * -1); }
}

/* ---------- Capture dans un cadre ---------- */
.shot { margin: 0; }
.shot__frame { overflow: hidden; background: var(--surface); border: var(--stroke-1) solid var(--border); box-shadow: var(--shadow-frame); }
.shot__bar { display: flex; align-items: center; gap: 6px; padding: var(--space-2) var(--space-3); border-bottom: var(--stroke-1) solid var(--border); }
.shot__bar i { width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--border); flex: none; }
.shot__bar span { margin-left: var(--space-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.shot__frame img { width: 100%; height: auto; }
.shot figcaption { margin-top: var(--space-3); }

/* ---------- Technologies ---------- */
.stack { padding-block: var(--space-5); border-block: var(--stroke-1) solid var(--border); background: var(--bg); }
.stack__in { display: grid; gap: var(--space-3); align-items: center; }
.stack__list { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
@media (min-width: 900px) {
  .stack__in { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--space-5); }
  .stack__in > .tb-caption { grid-column: 1 / span 3; }
  .stack__list { grid-column: 4 / span 9; }
}

/* ---------- Services : trois piliers ---------- */
.pillars { display: grid; gap: var(--space-7); }
.pillar { display: grid; align-content: start; gap: var(--space-5); padding-top: var(--space-4); border-top: var(--stroke-2) solid var(--text-strong); }
.pillar__title { max-width: 12ch; }
.pillar__list { display: grid; margin: 0; padding: 0; list-style: none; }
.pillar__list li { display: grid; grid-template-columns: var(--icon-md) minmax(0, 1fr); gap: var(--space-4); padding: var(--space-5) 0; border-top: var(--stroke-1) solid var(--border); }
.pillar__list li:first-child { border-top: 0; padding-top: var(--space-2); }
.pillar__list .tb-icon { color: var(--text-strong); margin-top: 1px; }
.pillar__list .tb-title-sm { margin: 0 0 var(--space-2); }
.pillar__list .tb-body-sm { max-width: 46ch; }
@media (min-width: 900px) {
  .pillars { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--space-6); }
}

/* ---------- Méthode ---------- */
.steps { display: grid; gap: 0; margin-inline: 0; margin-bottom: 0; padding: 0; list-style: none; }
.steps li { display: grid; gap: var(--space-3); align-content: start; padding: var(--space-5) 0; border-top: var(--stroke-1) solid var(--border-strong); }
.steps .tb-eyebrow { color: var(--text-muted); }
@media (min-width: 600px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-5); } }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Projets ---------- */
.case { row-gap: var(--space-5); padding-block: var(--space-7); border-top: var(--stroke-1) solid var(--border); }
.case:first-child { border-top: 0; padding-top: 0; }
.case__body { display: grid; gap: var(--space-3); align-content: start; }
.case__title a { color: inherit; text-decoration: none; }
.case__title a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: var(--stroke-1); }
.case__tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.case__result { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-3); margin: var(--space-3) 0 0; padding-top: var(--space-4); border-top: var(--stroke-1) solid var(--border); }
.case__result .tb-numeral { font-size: 44px; }
.case__body .tb-link { justify-self: start; }
@media (min-width: 900px) {
  .case { align-items: center; }
  .case__shot { grid-column: 1 / span 7; }
  .case__body { grid-column: 9 / span 4; }
  .case--flip .case__shot { grid-column: 6 / span 7; grid-row: 1; }
  .case--flip .case__body { grid-column: 1 / span 4; grid-row: 1; }
}

/* ---------- Labo ---------- */
.lab-grid { display: grid; gap: var(--space-4); margin-inline: 0; margin-bottom: 0; padding: 0; list-style: none; }
.lab-grid .tb-card { height: 100%; }
.lab-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-5); margin-top: var(--space-6); }
@media (min-width: 600px) { .lab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); } }

/* Labo de l'accueil : un outil en vedette, les autres en liste */
.lab { row-gap: var(--space-7); align-items: start; }
.lab-feature { display: grid; gap: var(--space-5); }
.lab-feature__body { display: grid; gap: var(--space-3); justify-items: start; }
.lab-feature__body .tb-btn { margin-top: var(--space-3); }
.lab-proof { display: flex; align-items: center; gap: var(--space-2); color: var(--text-strong); }
.lab-proof .tb-icon { color: var(--success); }
.lab-list { display: grid; margin: 0; padding: 0; list-style: none; border-top: var(--stroke-2) solid var(--text-strong); }
.lab-item { position: relative; display: grid; grid-template-columns: var(--icon-md) minmax(0, 1fr); gap: var(--space-4); padding: var(--space-5) 0; border-bottom: var(--stroke-1) solid var(--border-control); }
.lab-item .tb-icon { color: var(--text-strong); margin-top: 2px; }
.lab-item .tb-title-md { margin: var(--space-1) 0 var(--space-2); }
.lab-item__link { color: inherit; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; text-decoration-thickness: var(--stroke-1); transition: text-decoration-color var(--tb-base) ease; }
.lab-item__link::after { content: ""; position: absolute; inset: 0; }
@media (hover: hover) { .lab-item:hover .lab-item__link { text-decoration-color: currentColor; } }
@media (min-width: 900px) {
  .lab-feature { grid-column: 1 / span 7; }
  .lab-feature__body { grid-template-columns: minmax(0, 1fr); max-width: 52ch; }
  .lab-list { grid-column: 9 / span 4; }
}

/* ---------- Engagements ---------- */
.promise-n { color: var(--text-muted); }
.pledges { display: grid; gap: 0 var(--space-6); margin-inline: 0; margin-bottom: 0; }
.pledges > div { display: grid; align-content: start; gap: var(--space-2); padding: var(--space-5) 0 var(--space-6); border-top: var(--stroke-1) solid var(--border-strong); }
.pledges dd { margin: 0; }
@media (min-width: 600px) { .pledges { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .pledges { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Studio ---------- */
.studio { row-gap: var(--space-6); align-items: start; }
.studio__statement { max-width: 22ch; }
.studio__text { display: grid; gap: var(--space-4); }
@media (min-width: 900px) {
  .studio__statement { grid-column: 1 / span 7; }
  .studio__text { grid-column: 9 / span 4; padding-top: var(--space-2); }
}

/* ---------- FAQ ---------- */
@media (min-width: 900px) { .faq-body > .tb-faq { grid-column: 4 / span 9; } }

/* ---------- Contact (bandeau sombre) ---------- */
.contact { row-gap: var(--space-7); }
.form { display: grid; gap: var(--space-5); }
.form .full { grid-column: 1 / -1; }
.field-row { display: flex; justify-content: space-between; gap: var(--space-3); }
.field-row .count { margin-left: auto; white-space: nowrap; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); }
.form-foot__note { max-width: 36ch; }
.form-done__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); }
.form-done__status:empty { display: none; }
.form-done__text { font-family: var(--font-mono); font-size: 13px; line-height: 1.5; }
.field-row #h-msg { margin-right: var(--space-3); }
.form-status { color: var(--danger); }
.form-status:empty, .tb-field__error:empty { display: none; }
.form-done { display: grid; gap: var(--space-3); padding: var(--space-6); background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: var(--radius-md); outline: none; }
.form-done .tb-icon { color: var(--success); }
.form-done .tb-link { justify-self: start; }
.contact-info dl { display: grid; margin: 0; }
.contact-info dl > div { display: grid; gap: var(--space-1); padding: var(--space-4) 0; border-top: var(--stroke-1) solid var(--border); }
.contact-info dl > div:last-child { border-bottom: var(--stroke-1) solid var(--border); }
.contact-info dd { margin: 0; color: var(--text-strong); font-size: 17px; overflow-wrap: anywhere; }
.contact-info dd a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: var(--stroke-1); text-decoration-color: var(--border-control); }
.dd-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.contact-info .tb-tag { margin-top: var(--space-5); }
@media (min-width: 600px) { .form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) {
  .contact__form { grid-column: 1 / span 7; }
  .contact-info { grid-column: 9 / span 4; position: sticky; top: calc(var(--header-h) + var(--space-5)); align-self: start; }
}

/* ---------- Pied de page ---------- */
.tb-footer .tb-logo { height: 40px; }
.tb-footer__cta .tb-display-xl { display: inline-flex; align-items: baseline; gap: var(--space-4); }
.tb-footer__list li { color: var(--text); font-size: 15px; }
.footer-mail { justify-self: start; color: var(--text-strong); font-size: 15px; white-space: nowrap; text-underline-offset: 4px; text-decoration-thickness: var(--stroke-1); text-decoration-color: var(--border-control); }
/* Accueil : sans bandeau d'appel (le formulaire est juste au-dessus), on garde de l'air en haut */
.tb-footer__in > .tb-footer__cols:first-child { padding-top: var(--space-8); }
.to-top { display: inline-flex; align-items: center; gap: var(--space-2); }
.footer-contact-title { margin-top: var(--space-5); }
/* Le mot-symbole en pleine largeur, comme une signature en bas de page */
.footer-wordmark { display: block; width: 100%; height: auto; margin-top: var(--space-7); color: var(--text-strong); --cut: var(--bg); }

/* ---------- Tarifs : trois situations, un ordre de grandeur chacune ---------- */
.offers { display: grid; gap: var(--space-7); }
.offer { display: grid; align-content: start; gap: var(--space-3); padding-top: var(--space-4); border-top: var(--stroke-2) solid var(--text-strong); }
.offer__for { color: var(--accent-hover); }
.offer__price { display: grid; gap: var(--space-1); margin: var(--space-2) 0 var(--space-3); }
.offer__amount { font-family: var(--font-sans); font-weight: 600; font-size: clamp(30px, 3.2vw, 40px); line-height: 1.05; letter-spacing: -.03em; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.offer__price .tb-body-sm { color: var(--text-muted); }
.offer__list { display: grid; margin: 0; padding: 0; list-style: none; }
.offer__list li { position: relative; padding: var(--space-3) 0 var(--space-3) var(--space-5); border-top: var(--stroke-1) solid var(--border); font-size: 15px; line-height: 1.45; color: var(--text); }
.offer__list li::before { content: ""; position: absolute; left: 0; top: 1.25em; width: var(--space-3); height: var(--stroke-2); background: var(--text-strong); }
.offers-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4) var(--space-6); margin-top: var(--space-7); padding-top: var(--space-5); border-top: var(--stroke-1) solid var(--border); }
.offers-foot .tb-body { max-width: 60ch; }
@media (min-width: 900px) { .offers { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--space-6); } }

/* =========================================================
   Pages de réalisation
   ========================================================= */
.cs-hero { padding-block: var(--space-7) var(--space-8); }
.cs-hero__eyebrow { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-6); color: var(--text-muted); }
.cs-hero__eyebrow a { color: var(--text-strong); text-decoration: none; }
.cs-hero__eyebrow a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cs-hero .tb-bar { margin: var(--space-6) 0; }
.cs-hero__grid { row-gap: var(--space-5); align-items: end; }
.cs-hero__actions .tb-btn span[aria-hidden] { font-size: 14px; }
.cs-meta {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--stroke-1);
  margin: var(--space-7) 0 0; background: var(--border); border-block: var(--stroke-1) solid var(--border);
}
.cs-meta > div { display: grid; gap: var(--space-2); align-content: start; padding: var(--space-4) var(--space-4) var(--space-5) 0; background: var(--bg); min-width: 0; }
.cs-meta > div:nth-child(2n) { padding-left: var(--space-4); }
.cs-meta dd { margin: 0; color: var(--text-strong); }
.cs-cover { margin-top: var(--space-7); }
.cs-fig { display: flex; gap: var(--space-3); align-items: baseline; }
.cs-fig__n { flex: none; color: var(--text-strong); }
.cs-fig .tb-body-sm { color: var(--text-muted); }
.cs-col { max-width: var(--measure); }

.cs-splits { display: grid; gap: var(--space-8); }
.cs-split { row-gap: var(--space-5); align-items: center; }
.cs-text { display: grid; gap: var(--space-3); align-content: start; }
.cs-ticks { display: grid; gap: var(--space-2); margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.cs-ticks li { position: relative; padding-left: var(--space-5); }
.cs-ticks li::before { content: ""; position: absolute; left: 0; top: .7em; width: var(--space-3); height: var(--stroke-2); background: var(--text-strong); }
.cs-phones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); max-width: 520px; }
.phone { margin: 0; display: grid; gap: var(--space-3); min-width: 0; text-align: center; }
.phone__frame { width: 100%; padding: 6px; background: var(--surface); border: var(--stroke-1) solid var(--border); border-radius: 26px; box-shadow: var(--shadow-frame); }
.phone__frame img { width: 100%; height: auto; border-radius: 20px; }

.cs-num { gap: var(--space-2); }
.cs-num .tb-stat__value { order: 1; }
.cs-num > dt { order: 2; color: var(--text-muted); }

.cs-pair { row-gap: var(--space-4); margin-top: var(--space-8); padding-top: var(--space-5); border-top: var(--stroke-1) solid var(--border); }
.cs-pair__head { display: grid; gap: var(--space-3); align-content: start; }
.cs-pair__body { display: grid; gap: var(--space-4); align-content: start; }
.cs-stack { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.cs-pair--note { margin-top: var(--space-6); padding-top: 0; border-top: 0; }
.cs-rules { margin: 0; padding: 0; list-style: none; gap: 0; }
.cs-rules li { display: grid; gap: var(--space-2); padding: var(--space-5) 0; border-bottom: var(--stroke-1) solid var(--border); }
.cs-rules li:first-child { padding-top: 0; }

.cs-next { padding-block: var(--space-8); }
.cs-next__link { display: grid; gap: var(--space-3); color: var(--text-strong); text-decoration: none; }
.cs-next__link .tb-display-xl { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-4); }
@media (hover: hover) { .cs-next__link:hover .tb-link__arrow { transform: translateX(var(--space-2)); } }

@media (min-width: 600px) {
  .cs-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cs-meta > div + div { padding-left: var(--space-4); }
}
@media (min-width: 900px) {
  .cs-hero { padding-block: var(--space-9) var(--space-9); }
  .cs-hero__title { grid-column: 1 / span 12; }
  .cs-hero__lede { grid-column: 1 / span 7; }
  .cs-hero__actions { grid-column: 10 / span 3; justify-self: end; }
  .cs-col { grid-column: 4 / span 7; }
  .cs-splits { gap: var(--space-10); }
  .cs-split > .cs-text { grid-column: 1 / span 4; }
  .cs-split > .shot, .cs-split > .cs-phones { grid-column: 6 / span 7; }
  .cs-split--flip > .cs-text { grid-column: 9 / span 4; grid-row: 1; }
  .cs-split--flip > .shot, .cs-split--flip > .cs-phones { grid-column: 1 / span 7; grid-row: 1; }
  .cs-split > .cs-phones { justify-self: center; width: 100%; }
  .cs-pair__head { grid-column: 1 / span 3; }
  .cs-pair__body { grid-column: 4 / span 7; }
  .cs-next { padding-block: var(--space-9); }
}

/* =========================================================
   Pages de texte (mentions légales, Labo) et 404
   ========================================================= */
.page-prose { display: grid; gap: var(--space-4); }
.page-prose h2 { margin: var(--space-7) 0 0; font-size: clamp(24px, 3vw, 32px); line-height: 1.12; font-weight: 600; letter-spacing: -.025em; color: var(--text-strong); }
.page-prose h2:first-child, .page-prose > :first-child { margin-top: 0; }
.page-prose h3 { margin: var(--space-5) 0 0; font-size: 21px; line-height: 1.25; font-weight: 600; letter-spacing: -.012em; color: var(--text-strong); }
.page-prose p, .page-prose li { margin: 0; max-width: var(--measure); font-size: 17px; line-height: 1.6; color: var(--text); }
.page-prose ul { display: grid; gap: var(--space-2); margin: 0; padding-left: var(--space-5); }
.page-prose a { color: var(--text-strong); text-underline-offset: 3px; }
.page-todo { padding: 0 .3em; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text-strong); font-family: var(--font-mono); font-size: .88em; }
.lab-grid .tb-card .tb-title-lg { font-size: 21px; line-height: 1.25; }
@media (min-width: 900px) { .lab-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.e404 { min-height: 70vh; }
.e404__grid { row-gap: var(--space-6); align-items: start; }
@media (min-width: 900px) {
  .e404__main { grid-column: 1 / span 6; }
  .e404__term { grid-column: 8 / span 5; }
}

/* =========================================================
   Visuels : appareils, zooms annotés, schémas techniques
   ========================================================= */

/* ---------- Mise en scène sur appareils (dessinés en CSS, aucun gabarit image) ---------- */
.scene { margin: 0; }
.scene__stage { position: relative; padding-bottom: 7%; }
.device { margin: 0; }
.device__screen { position: relative; overflow: hidden; }
.device__screen img { display: block; width: 100%; height: auto; }
.device--laptop { position: relative; z-index: 1; }
.device--laptop .device__screen {
  padding: 1.5% 1.5% 2.1%; background: #161616; border-radius: 14px 14px 0 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), 0 40px 60px -40px rgba(17, 17, 17, .45);
}
.device--laptop .device__screen img { border-radius: 2px; }
.device__base {
  position: relative; height: 0; padding-bottom: 2.3%; margin: 0 -6.5%;
  background: linear-gradient(180deg, #ececea 0%, #d3d3cf 55%, #a8a8a3 100%);
  border-radius: 2px 2px 18px 18px / 2px 2px 100% 100%;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 18px 28px -14px rgba(17, 17, 17, .35);
}
.device__base::before {
  content: ""; position: absolute; left: 50%; top: 0; width: 15%; height: 42%; transform: translateX(-50%);
  background: linear-gradient(#c4c4bf, #b3b3ae); border-radius: 0 0 10px 10px;
}
.device--phone { position: absolute; z-index: 2; bottom: 0; left: -4%; width: 23%; }
.device--phone .device__screen {
  padding: 4.2%; background: #161616; border-radius: 15% / 7%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09), 0 34px 60px -24px rgba(17, 17, 17, .55);
}
.device--phone .device__screen img { border-radius: 11.5% / 5.3%; }
.scene--phone-right .device--phone { left: auto; right: -2%; }
.scene figcaption { margin-top: var(--space-4); }
.cs-cover .scene__stage { width: 88%; margin: 0 auto; }
@media (max-width: 599px) {
  .device--laptop .device__screen { border-radius: 9px 9px 0 0; }
  .device--phone { width: 27%; left: -2%; }
  .scene--phone-right .device--phone { right: -1%; }
  .cs-cover .scene__stage { width: 92%; }
}

/* ---------- Zoom annoté : repères sur la capture, légende à côté ---------- */
.annot__media { position: relative; }
.annot__pin {
  position: absolute; left: var(--x); top: var(--y); z-index: 2; display: grid; place-items: center;
  width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: var(--radius-full);
  background: var(--accent); color: var(--on-accent); font: 500 13px/1 var(--font-mono);
  box-shadow: 0 0 0 4px rgba(217, 56, 30, .2), 0 8px 18px -6px rgba(17, 17, 17, .5);
  transition: transform .35s var(--ease-out-expo, ease), box-shadow .35s var(--ease-out-expo, ease);
}
.annot__pin.is-active { transform: scale(1.22); box-shadow: 0 0 0 9px rgba(217, 56, 30, .22), 0 10px 22px -6px rgba(17, 17, 17, .55); }
.annot__legend { display: grid; margin: 0; padding: 0; list-style: none; }
.annot__legend li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--space-3); padding: var(--space-4) 0; border-top: var(--stroke-1) solid var(--border); }
.annot__legend li:last-child { border-bottom: var(--stroke-1) solid var(--border); }
.annot__num {
  display: grid; place-items: center; width: 26px; height: 26px; border: var(--stroke-1) solid var(--accent); border-radius: var(--radius-full);
  color: var(--accent-hover); font: 500 12px/1 var(--font-mono); transition: background-color .25s ease, color .25s ease;
}
.annot__legend li.is-active .annot__num { background: var(--accent); color: var(--on-accent); }
.annot__legend .tb-title-sm { margin: 1px 0 var(--space-1); font-size: 16px; }
.annot__legend .tb-body-sm { color: var(--text); }
.annot__legend--grid { margin-top: var(--space-5); }
@media (min-width: 600px) {
  .annot__legend--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-6); }
  .annot__legend--grid li:nth-last-child(2):nth-child(odd) { border-bottom: var(--stroke-1) solid var(--border); }
}
.cs-text .annot__legend { margin-top: var(--space-3); }
@media (max-width: 599px) { .annot__pin { width: 24px; height: 24px; margin: -12px 0 0 -12px; font-size: 11px; } }

/* ---------- Schéma technique : un plan, pas une illustration ---------- */
.flow { margin: var(--space-8) 0 0; }
.flow__canvas {
  position: relative; padding: var(--space-6) var(--space-4) var(--space-5); border: var(--stroke-1) solid var(--border);
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--border-control) .7px, transparent 1px);
  background-size: 18px 18px; background-position: 9px 9px;
}
.flow__title { position: absolute; top: calc(-.7em - 1px); left: var(--space-4); margin: 0; padding: 0 var(--space-2); background: var(--bg); }
.flow__row { display: flex; flex-direction: column; align-items: stretch; }
.flow__stage { display: grid; align-content: start; gap: var(--space-2); flex: 1 1 0; min-width: 0; }
.flow__label { justify-self: start; margin: 0 0 var(--space-1) calc(var(--space-1) * -1); padding: 0 var(--space-1); background: var(--bg); }
.flow__node { position: relative; padding: var(--space-3) var(--space-4); background: var(--bg); border: var(--stroke-1) solid var(--text-strong); }
/* repères d'angle, comme sur un tirage technique */
.flow__node::before, .flow__node::after { content: ""; position: absolute; width: 7px; height: 7px; border: 0 solid var(--text-strong); }
.flow__node::before { top: -5px; left: -5px; border-top-width: var(--stroke-1); border-left-width: var(--stroke-1); }
.flow__node::after { right: -5px; bottom: -5px; border-right-width: var(--stroke-1); border-bottom-width: var(--stroke-1); }
.flow__node .tb-title-sm { margin: 0; font-size: 16px; }
.flow__detail { margin: var(--space-1) 0 0; font-size: 13px; line-height: 1.45; color: var(--text); }
.flow__node--soft { border-style: dashed; border-color: var(--border-control); }
.flow__node--soft::before, .flow__node--soft::after { border-color: var(--border-control); }
.flow__node--accent { border-color: var(--accent); }
.flow__node--accent::before, .flow__node--accent::after { border-color: var(--accent); }
.flow__node--accent .tb-title-sm { color: var(--accent-hover); } /* texte rouge sur fond clair : la teinte foncée passe 4,5:1 */
.flow__link { position: relative; flex: none; align-self: center; width: var(--stroke-2); height: 36px; margin: var(--space-3) 0; background: var(--text-strong); transform-origin: 50% 0; }
.flow__link::after {
  content: ""; position: absolute; left: 50%; bottom: -1px; transform: translateX(-50%);
  border-style: solid; border-width: 7px 5px 0; border-color: var(--text-strong) transparent transparent;
}
.flow__zone { position: relative; display: flex; flex-direction: column; flex: 3 1 0; min-width: 0; padding: var(--space-6) var(--space-4) var(--space-4); border: var(--stroke-1) dashed var(--border-control); }
.flow__zone-label { position: absolute; top: calc(-.7em - 1px); left: var(--space-4); margin: 0; padding: 0 var(--space-2); background: var(--bg); }
.flow figcaption { margin-top: var(--space-4); }
@media (min-width: 900px) {
  .flow__canvas { padding: var(--space-7) var(--space-6) var(--space-6); }
  .flow__row, .flow__zone { flex-direction: row; align-items: center; }
  .flow__link { width: 44px; height: var(--stroke-2); margin: 0 var(--space-3); transform-origin: 0 50%; }
  .flow__link::after { left: auto; right: -1px; bottom: auto; top: 50%; transform: translateY(-50%); border-width: 5px 0 5px 7px; border-color: transparent transparent transparent var(--text-strong); }
}

/* =========================================================
   Mouvement (assets/motion.js) : « le tracé »
   Tout ce qui suit ne s'applique que si le script a démarré (classe .motion sur <html>) ;
   sans lui, la page s'affiche telle quelle.
   ========================================================= */
:root { --ease-out-expo: cubic-bezier(.16, 1, .3, 1); }

/* Avant le premier rendu : le hero attend sa séquence (levé par le script, ou au bout de 2 s) */
.motion-pending .hero__status, .motion-pending .hero__title, .motion-pending .hero__lede,
.motion-pending .hero__actions, .motion-pending .hero__note, .motion-pending .hero__shot { opacity: 0; }
.motion-pending .hero .tb-bar { animation: none; transform: scaleX(0); }
.motion-pending .cs-hero__eyebrow, .motion-pending .cs-hero__title, .motion-pending .cs-hero__lede,
.motion-pending .cs-hero__actions, .motion-pending .cs-meta, .motion-pending .cs-cover { opacity: 0; }
.motion-pending .cs-hero .tb-bar { animation: none; transform: scaleX(0); }
/* Lignes masquées de SplitText : le masque ne doit pas rogner les jambages */
.m-line { padding-bottom: .06em; margin-bottom: -.06em; }

/* Défilement fluide (Lenis) */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* En-tête qui s'efface en descendant */
.motion .site-header { transition: transform .6s var(--ease-out-expo); }
.motion .site-header.is-hidden { transform: translateY(-100%); }
.motion .site-header:focus-within { transform: none; }

/* Filets qui se tracent : la bordure d'origine est remplacée par un trait dessiné */
.motion .tb-section-header, .motion .pillar, .motion .lab-list, .motion .pledges > div, .motion .offer { position: relative; border-top-color: transparent; }
.motion .tb-section-header::before, .motion .pillar::before, .motion .lab-list::before, .motion .pledges > div::before, .motion .offer::before {
  content: ""; position: absolute; left: 0; right: 0; top: calc(var(--stroke-1) * -1); height: var(--stroke-1);
  background: var(--border-strong); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform 1.5s var(--ease-out-expo) var(--draw-delay, 0ms);
}
.motion .pillar::before, .motion .lab-list::before, .motion .offer::before { top: calc(var(--stroke-2) * -1); height: var(--stroke-2); background: var(--text-strong); }
.motion .is-drawn::before { transform: none; }

/* Méthode : la ligne de progression rouge, posée sur les filets des étapes */
.steps.has-progress { position: relative; }
.steps.has-progress li { border-top-color: var(--border); }
.steps__progress {
  position: absolute; left: 0; right: 0; top: 0; height: var(--stroke-2); margin-top: calc(var(--stroke-1) * -.5);
  background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; pointer-events: none;
}

/* Boutons : le libellé roule vers le haut au survol (une copie du texte arrive par-dessous) */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .tb-btn { overflow: hidden; }
  .tb-btn > span { display: inline-block; text-shadow: 0 2.2em 0 currentColor; transition: transform .55s var(--ease-out-expo); }
  .tb-btn:hover > span { transform: translateY(-2.2em); }
  .tb-btn > .tb-icon { transition: transform .55s var(--ease-out-expo); }
  .tb-btn:hover > .tb-icon { transform: translateX(2px); }
}

/* FAQ : la réponse s'ouvre et se referme au lieu d'apparaître d'un coup */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .tb-faq__item::details-content {
    block-size: 0; overflow: clip;
    transition: block-size .5s var(--ease-out-expo), content-visibility .5s allow-discrete;
  }
  .tb-faq__item[open]::details-content { block-size: auto; }
}

/* Contact : l'écran final arrive au lieu de remplacer le formulaire d'un coup */
.form-done:not([hidden]) { animation: done-in .6s var(--ease-out-expo) both; }
@keyframes done-in { from { opacity: 0; transform: translateY(12px); } }

/* Navigation entre les pages du site : fondu court (navigateurs compatibles) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: vt-out .28s cubic-bezier(.4, 0, 1, 1) both; }
  ::view-transition-new(root) { animation: vt-in .6s var(--ease-out-expo) both; }
}
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(16px); } }

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tb-faq__item::details-content { transition: none; }
  .form-done:not([hidden]) { animation: none; }
}

/* ---------- Impression ---------- */
@media print {
  .site-header, .contact__form, .tb-footer__cta { display: none !important; }
  [data-theme="dark"] { --bg: #ffffff; --surface: #ffffff; --surface-hover: #f0f0ed; --text: #3a3a37; --text-strong: #111111; --text-muted: #6b6b66; --border: #e6e6e2; --border-control: #85857f; }
}
