/* ==========================================================================
   Toco Labs — feuille de styles
   - Thème clair « Solaire » (par défaut) et thème sombre « Canopée »
   - Typographie : Josefin Sans (marque, menu, titres), Plus Jakarta Sans (texte et libellés)
   - Contrastes vérifiés WCAG AA : petits textes ≥ 4,5:1, grands textes et composants ≥ 3:1
   ========================================================================== */

/* Polices auto-hébergées (sous-ensemble latin, licence OFL — voir fonts/LICENSE.md) */
@font-face {
  font-family: 'Josefin Sans';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url('fonts/josefin-sans.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/plus-jakarta-sans.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Mode Solaire */
  --color-bg: #FAF6EF;
  --color-surface: #FFFFFF;
  --color-surface-soft: #F5EFE4;
  --color-surface-card: #FFFFFF;
  --color-surface-trans: rgba(250, 246, 239, 0.94);

  --color-text-main: #0B2420;
  --color-text-muted: #4A635F;

  /* Couleurs Toucan & feuillage */
  --color-toco-orange: #FF661F;        /* orange signature : fonds de boutons, décor */
  --color-toco-orange-hover: #FF7A3D;
  --color-on-accent: #0B2420;          /* texte posé sur l'orange (5,57:1) */
  --color-accent-text: #C2410C;        /* petits textes orange (≥ 4,5:1) */
  --color-accent-display: #E0520C;     /* grands titres orange (≥ 3:1) */
  --color-toco-gold: #E5A823;
  --color-forest: #0D3E34;
  --color-forest-deep: #082620;
  --color-leaf-tint: #E7F0ED;
  --color-logo: #195F63;
  --color-focus: #C2410C;
  --color-topo-line: rgba(176, 131, 58, 0.5);

  /* Bloc contact : fond vert nuit, identique dans les deux thèmes */
  --color-cta-bg: #082620;
  --color-on-dark: #FFFFFF;
  --color-on-dark-soft: #D3E4E0;
  --color-on-dark-muted: #C3DBD5;
  --color-on-dark-accent: #E5A823;

  /* Messages du formulaire */
  --color-error-bg: #FDEDE8;
  --color-error-text: #8A2A0B;

  /* Bordures et ombres */
  --color-border: rgba(13, 62, 52, 0.1);
  --color-border-strong: rgba(13, 62, 52, 0.22);
  --color-border-card: rgba(13, 62, 52, 0.08);
  --color-border-hover: rgba(194, 65, 12, 0.4);

  --shadow-sm: 0 4px 16px rgba(11, 36, 32, 0.04);
  --shadow-card: 0 12px 36px rgba(11, 36, 32, 0.05);
  --shadow-lg: 0 24px 64px rgba(11, 36, 32, 0.08);
  --shadow-header: 0 6px 20px rgba(11, 36, 32, 0.06);

  /* Typographie */
  --font-display: 'Josefin Sans', 'Century Gothic', Futura, sans-serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Échelle : six tailles, rien de lisible sous 13 px */
  --text-xs: 0.8125rem;                        /* 13 px : badges, technos */
  --text-sm: 0.875rem;                         /* 14 px : notes, footer, libellés */
  --text-base: 1.0625rem;                      /* 17 px : texte courant */
  --text-lead: 1.1875rem;                      /* 19 px : sous-titres */
  --text-h3: 1.5rem;                           /* 24 px : titres de rangées et d'étapes */
  --text-h2: clamp(1.875rem, 3.6vw, 2.875rem); /* 30 → 46 px */
  --text-display: clamp(2.125rem, 5.4vw, 4.5rem); /* 34 → 72 px */

  /* Rayons */
  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 9999px;

  /* Structure */
  --container-max: 1240px;
  --gutter: 32px;
  --header-h: 72px;

  color-scheme: light;
}

[data-theme="canopy"] {
  /* Mode sombre Canopée */
  --color-bg: #071917;
  --color-surface: #0E2925;
  --color-surface-soft: #12342F;
  --color-surface-card: #0D2622;
  --color-surface-trans: rgba(7, 25, 23, 0.94);

  --color-text-main: #F2F8F6;
  --color-text-muted: #9BB6B0;

  --color-toco-orange: #FF7527;
  --color-toco-orange-hover: #FF8A4C;
  --color-on-accent: #0B2420;
  --color-accent-text: #FF7527;
  --color-accent-display: #FF7527;
  --color-toco-gold: #FFC02A;
  --color-forest: #195E4F;
  --color-forest-deep: #0D382F;
  --color-leaf-tint: #14352F;
  --color-logo: #86C0B2;
  --color-focus: #FFC02A;
  --color-topo-line: rgba(117, 165, 153, 0.34);

  --color-error-bg: #3A1A10;
  --color-error-text: #FFC4AE;

  --color-border: rgba(255, 255, 255, 0.09);
  --color-border-strong: rgba(255, 255, 255, 0.2);
  --color-border-card: rgba(255, 255, 255, 0.08);
  --color-border-hover: rgba(255, 117, 39, 0.45);

  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 14px 40px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.5);
  --shadow-header: 0 6px 20px rgba(0, 0, 0, 0.35);

  color-scheme: dark;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: var(--color-bg);
  color: var(--color-text-main);
  transition: background-color 0.35s ease, color 0.35s ease;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* La page ne défile pas derrière la fenêtre de contact */
html:has(dialog[open]) {
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  overflow-x: hidden;
  overflow-x: clip;
  background-color: var(--color-bg);
  color: var(--color-text-main);
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

::selection {
  background: var(--color-toco-orange);
  color: var(--color-on-accent);
}

input,
textarea {
  caret-color: var(--color-accent-text);
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

/* Les sections ancrées ne passent pas sous le header fixe */
[id] {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 300;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: var(--color-text-main);
  color: var(--color-bg);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

main:focus {
  outline: none;
}

/* Fond topographique : rendu pré-calculé (plus de mix-blend-mode ni de filtre à l'exécution) */
.topo-bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: var(--color-bg);
  background-image: url('img/topo-light.webp');
  background-image: image-set(url('img/topo-light.avif') type('image/avif'), url('img/topo-light.webp') type('image/webp'));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

[data-theme="canopy"] .topo-bg-layer {
  background-image: url('img/topo-dark.webp');
  background-image: image-set(url('img/topo-dark.avif') type('image/avif'), url('img/topo-dark.webp') type('image/webp'));
}

/* Conteneur */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 2;
}

@media (max-width: 768px) {
  :root {
    --gutter: 20px;
  }
}

@media (max-width: 600px) {
  :root {
    --header-h: 64px;
  }
}

/* ==========================================================================
   Feuillage (Feuilles)
   ========================================================================== */

/* Branche décorative flottante en haut à droite de page */
.page-floating-sprig {
  position: absolute;
  top: 80px;
  right: 3%;
  width: 130px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.92;
  transform: rotate(18deg);
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.05));
}

/* Composition végétale autour de la carte du hero (derrière la carte : rien n'est masqué) */
.hero-foliage-spray,
.hero-foliage-sprig {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-foliage-spray {
  filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.08));
}

.hero-foliage-sprig {
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.06));
}

.hero-foliage-spray-tr {
  top: -70px;
  right: -60px;
  width: 230px;
  transform: scaleX(-1) rotate(15deg);
}

.hero-foliage-spray-bl {
  bottom: -70px;
  left: -60px;
  width: 230px;
  transform: rotate(-30deg);
}

.hero-foliage-sprig-tl {
  top: -40px;
  left: -40px;
  width: 140px;
  transform: rotate(-45deg);
}

.hero-foliage-sprig-br {
  bottom: -40px;
  right: -40px;
  width: 140px;
  transform: scaleX(-1) rotate(140deg);
}

.hero-stage-wrapper:hover .hero-foliage-spray-tr {
  transform: scaleX(-1) rotate(10deg) translate(4px, -4px) scale(1.04);
}

.hero-stage-wrapper:hover .hero-foliage-spray-bl {
  transform: rotate(-24deg) translate(-4px, 4px) scale(1.04);
}

.hero-stage-wrapper:hover .hero-foliage-sprig-tl {
  transform: rotate(-50deg) scale(1.05);
}

.hero-stage-wrapper:hover .hero-foliage-sprig-br {
  transform: scaleX(-1) rotate(146deg) scale(1.05);
}

[data-theme="canopy"] .hero-foliage-spray,
[data-theme="canopy"] .hero-foliage-sprig,
[data-theme="canopy"] .page-floating-sprig {
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 10px rgba(229, 168, 35, 0.22));
}

@media (max-width: 1080px) {
  .hero-foliage-spray-tr,
  .hero-foliage-spray-bl {
    width: 250px;
  }
}

@media (max-width: 900px) {
  .page-floating-sprig,
  .hero-foliage-sprig-tl,
  .hero-foliage-sprig-br {
    display: none;
  }

  .hero-foliage-spray-tr {
    width: 200px;
    top: -50px;
    right: -35px;
  }

  .hero-foliage-spray-bl {
    width: 200px;
    bottom: -50px;
    left: -35px;
  }
}

@media (max-width: 600px) {
  .hero-foliage-spray-tr {
    width: 135px;
    top: -34px;
    right: -14px;
  }

  .hero-foliage-spray-bl {
    width: 135px;
    bottom: -34px;
    left: -14px;
  }
}

/* ==========================================================================
   Typographie
   ========================================================================== */
h1, h2, .headline-display {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--color-text-main);
  letter-spacing: -0.01em;
}

h1, h2, h3 {
  text-wrap: balance;
}

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 56px auto;
  position: relative;
}

/* En-tête aligné sur le bord gauche du contenu (Expertises) */
.section-head-left {
  text-align: left;
  max-width: 760px;
  margin-left: 0;
}

.section-title {
  font-size: var(--text-h2);
  line-height: 1.15;
  margin-bottom: 14px;
}

.section-desc {
  font-size: var(--text-lead);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Icônes du sprite SVG */
.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ==========================================================================
   Header & navigation
   ========================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--color-surface-trans);
  box-shadow: var(--shadow-header);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 34px;
  height: 34px;
  color: var(--color-logo);
  transition: transform 0.3s ease;
}

.brand:hover .brand-icon {
  transform: rotate(-6deg) scale(1.06);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text-main);
  letter-spacing: 0;
  white-space: nowrap;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.25s ease;
  padding: 6px 0;
}

.nav-link:hover {
  color: var(--color-accent-text);
}

/* CTA dupliqué dans le menu : visible uniquement sur petit écran
   (sélecteur à deux classes pour primer sur .btn) */
.nav-menu .nav-menu-cta {
  display: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  color: var(--color-text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.icon-btn:hover {
  border-color: var(--color-accent-text);
  color: var(--color-accent-text);
  transform: scale(1.05);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.theme-toggle-btn .icon-sun,
[data-theme="canopy"] .theme-toggle-btn .icon-moon {
  display: none;
}

[data-theme="canopy"] .theme-toggle-btn .icon-sun {
  display: block;
}

.nav-toggle {
  display: none;
}

.nav-toggle .icon-close,
.nav-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

/* Menu mobile : panneau déroulant sous le header */
@media (max-width: 899.98px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  }

  .header.is-nav-open .nav-menu {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .nav-menu .nav-link {
    padding: 12px 4px;
    font-size: 1.2rem;
    color: var(--color-text-main);
  }
}

@media (max-width: 559.98px) {
  .nav-actions .header-cta {
    display: none;
  }

  .nav-menu .nav-menu-cta {
    display: inline-flex;
    margin-top: 18px;
    align-self: flex-start;
  }

  .brand-title {
    font-size: 1.3rem;
  }

  .nav-actions {
    gap: 8px;
  }
}

/* ==========================================================================
   Boutons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

@media (min-width: 480px) {
  .btn {
    white-space: nowrap;
  }
}

.btn-primary {
  background: var(--color-forest);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--color-forest-deep);
  transform: translateY(-2px);
}

.btn-primary:disabled {
  cursor: progress;
  opacity: 0.75;
  transform: none;
}

.btn-accent {
  background: var(--color-toco-orange);
  color: var(--color-on-accent);
}

.btn-accent:hover {
  background: var(--color-toco-orange-hover);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--color-text-main);
  border-color: var(--color-border-strong);
}

.btn-outline:hover {
  border-color: var(--color-accent-text);
  color: var(--color-accent-text);
  background: var(--color-surface);
}

.btn-lg {
  padding: 15px 32px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
  margin-top: 10px;
}

.btn-with-leaf svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.btn-with-leaf:hover svg {
  transform: rotate(15deg) scale(1.15);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding-top: calc(var(--header-h) + 64px);
  padding-bottom: 80px;
  text-align: center;
  position: relative;
  /* Le feuillage pivoté autour de la carte ne doit pas élargir la page sur mobile */
  overflow: hidden;
  overflow: clip;
}

.hero-content {
  max-width: 840px;
  margin: 0 auto;
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

.hero-subtitle {
  font-size: var(--text-lead);
  line-height: 1.65;
  color: var(--color-text-main);
  max-width: 680px;
  margin: 0 auto 36px auto;
}

.hero-cta-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 64px;
}

@media (max-width: 600px) {
  /* Sur mobile, « Apps » s'affiche à la place d'« Applications » pour tenir en deux lignes.
     Le HTML garde « Applications » (robots, lecteurs d'écran) ; « Apps » est dessiné en CSS,
     avec un texte alternatif vide pour ne pas être lu en double. */
  .hero-word {
    font-size: 0;
  }

  .hero-word::before {
    content: "Apps";
    content: "Apps" / "";
    font-size: var(--hero-title-size);
  }

  .hero-title {
    --hero-title-size: clamp(1.75rem, 8.4vw, 2.125rem);
    font-size: var(--hero-title-size);
  }

  .hero {
    padding-top: calc(var(--header-h) + 36px);
    padding-bottom: 56px;
  }

  .hero-subtitle {
    font-size: var(--text-base);
  }

  .hero-cta-row {
    margin-bottom: 48px;
  }
}

/* Carte topographique du studio (remplace la photo) */
.hero-stage-container {
  max-width: 1040px;
  margin: 0 auto;
  position: relative;
}

.hero-stage-wrapper {
  position: relative;
}

.hero-map {
  position: relative;
  z-index: 2;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  transition: transform 0.35s ease;
}

.hero-map-canvas {
  position: relative;
  aspect-ratio: 16 / 7;
}

.hero-map-contours,
.hero-map-trails {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-map-contours {
  color: var(--color-topo-line);
}

.hero-map-contours path {
  fill: none;
  stroke: currentColor;
  vector-effect: non-scaling-stroke;
}

.hero-map-contours .c-minor {
  stroke-width: 1;
}

.hero-map-contours .c-index {
  stroke-width: 1.8;
}

.hero-map-trails path {
  fill: none;
  stroke: var(--color-toco-orange);
  stroke-width: 1.6;
  stroke-dasharray: 5 7;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.8;
}

.hero-map-compass {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 26px;
  height: 34px;
  color: var(--color-text-muted);
}

.hero-map-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 76px;
  height: 76px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-toco-orange);
  color: var(--color-logo);
}

.hero-map-pin svg {
  width: 40px;
  height: 40px;
}

.hero-map-pin::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid var(--color-toco-orange);
  opacity: 0;
  animation: pin-pulse 3.2s ease-out infinite;
}

@keyframes pin-pulse {
  0% {
    transform: scale(0.85);
    opacity: 0.55;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

.hero-map-wp {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  white-space: nowrap;
}

.hero-map-wp strong {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-accent-text);
}

.hero-map-wp span {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.wp-xr {
  left: 20%;
  top: 24%;
}

.wp-mobile {
  left: 80%;
  top: 30%;
}

.wp-web {
  left: 72%;
  top: 78%;
}

.hero-map-legend {
  position: absolute;
  left: 20px;
  bottom: 20px;
  max-width: 330px;
  padding: 12px 16px;
  text-align: left;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
}

.legend-title {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-accent-text);
}

.legend-coords {
  display: block;
  margin-top: 2px;
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

.legend-text {
  display: block;
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: var(--text-lead);
  line-height: 1.35;
  color: var(--color-text-main);
}

@media (max-width: 900px) {
  .hero-map-canvas {
    aspect-ratio: 4 / 3;
  }

  .hero-map-legend {
    position: static;
    max-width: none;
    border: 0;
    border-radius: 0;
    background: var(--color-surface-soft);
    box-shadow: none;
    padding: 14px 18px 16px;
  }
}

@media (max-width: 600px) {
  .hero-map-canvas {
    aspect-ratio: 1 / 1;
  }

  .hero-map-wp {
    padding: 6px 10px;
  }

  .hero-map-wp span {
    display: none;
  }

  .hero-map-pin {
    width: 64px;
    height: 64px;
  }

  .hero-map-pin svg {
    width: 34px;
    height: 34px;
  }

  .wp-xr {
    left: 24%;
    top: 20%;
  }

  .wp-mobile {
    left: 76%;
    top: 30%;
  }

  .wp-web {
    left: 66%;
    top: 80%;
  }
}

/* ==========================================================================
   Expertises : trois grandes rangées pleine largeur
   ========================================================================== */
.section-craft {
  --row-pad: 32px;
  padding: 96px 0;
  position: relative;
}

/* L'en-tête démarre sur le même bord que le contenu des rangées */
.section-craft .section-head-left {
  padding-left: var(--row-pad);
}

.craft-list {
  display: grid;
  gap: 16px;
}

.craft-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 40px var(--row-pad);
  background: var(--color-surface-card);
  border-radius: var(--radius-md);
}

@media (min-width: 900px) {
  .section-craft {
    --row-pad: 56px;
  }

  .craft-row {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 48px;
    padding-block: 48px;
    align-items: start;
  }
}

@media (max-width: 600px) {
  .section-craft {
    --row-pad: 22px;
  }

  .craft-row {
    padding-block: 28px;
  }
}

.craft-row-title {
  font-size: clamp(1.625rem, 2.6vw, 2.125rem);
  line-height: 1.15;
}

.craft-row-desc {
  font-size: var(--text-base);
  line-height: 1.6;
  max-width: 62ch;
  margin-bottom: 20px;
}

.craft-tags,
.territory-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.craft-tags li,
.territory-chips li {
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 4px 12px;
  background: var(--color-bg);
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
}

/* Illustration toucan filaire */
.lab-toucan-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.toucan-img-wrap {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1.25 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.toucan-img-wrap picture {
  display: block;
  width: 100%;
  height: 100%;
}

.toucan-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.35s ease;
  filter: drop-shadow(0 8px 24px rgba(13, 62, 52, 0.08));
}

.lab-toucan-display:hover .toucan-img {
  transform: translateY(-6px) scale(1.04);
}

[data-theme="canopy"] .toucan-img {
  filter: brightness(1.7) contrast(1.15) drop-shadow(0 0 16px rgba(229, 168, 35, 0.32));
}

.toucan-caption {
  font-size: var(--text-xs);
  font-style: italic;
  color: var(--color-accent-text);
  margin-top: 12px;
}

/* ==========================================================================
   Parcours : introduction + frise verticale
   ========================================================================== */
.section-journey {
  padding: 96px 0;
  position: relative;
}

.journey-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  max-width: 1040px;
  margin: 0 auto 56px;
  text-align: center;
}

.journey-intro .lab-toucan-display {
  max-width: 280px;
  margin: 0 auto;
}

.journey-intro .section-title {
  margin-bottom: 14px;
}

@media (min-width: 900px) {
  .journey-intro {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 48px;
    text-align: left;
  }

  .journey-intro .lab-toucan-display {
    max-width: 340px;
  }
}

/* Frise : un trait plein dans le ton du fond, des jalons orange */
.journey {
  --rail-x: 6px;
  list-style: none;
  position: relative;
  max-width: 1040px;
  margin: 0 auto;
  padding-left: 40px;
}

.journey::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: var(--rail-x);
  width: 2px;
  border-radius: 2px;
  background: var(--color-border-strong);
}

.journey-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.journey-item + .journey-item {
  margin-top: 48px;
}

.journey-item::before {
  content: '';
  position: absolute;
  top: 6px;
  left: calc(var(--rail-x) - 40px - 5px);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-toco-orange);
  box-shadow: 0 0 0 5px var(--color-bg);
}

@media (min-width: 900px) {
  .journey {
    --rail-x: 206px;
    padding-left: 0;
  }

  .journey-item {
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 72px;
  }

  .journey-item::before {
    left: calc(var(--rail-x) - 5px);
  }
}

.journey-when {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-accent-text);
  padding-top: 2px;
}

@media (min-width: 900px) {
  .journey-when {
    text-align: right;
  }
}

.journey-title {
  font-size: var(--text-h3);
  line-height: 1.25;
  margin-bottom: 8px;
}

.journey-desc {
  font-size: var(--text-base);
  line-height: 1.6;
  max-width: 62ch;
}

/* ==========================================================================
   Ancrage régional (Grand Ouest) : trois cartes allégées
   ========================================================================== */
.section-territory {
  padding: 96px 0;
  position: relative;
}

.territory-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (min-width: 960px) {
  .territory-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.territory-card {
  background: var(--color-surface-card);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.territory-tag-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-forest);
  background: var(--color-leaf-tint);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 18px;
}

[data-theme="canopy"] .territory-tag-badge {
  color: var(--color-toco-gold);
  background: rgba(255, 179, 0, 0.12);
}

.territory-card-title {
  font-size: var(--text-h3);
  line-height: 1.25;
  margin-bottom: 12px;
}

.territory-card-desc {
  font-size: var(--text-base);
  line-height: 1.6;
  margin-bottom: 24px;
}

.territory-card-desc em {
  font-style: normal;
  color: var(--color-accent-text);
  font-weight: 600;
}

.territory-chips {
  margin-top: auto;
}

/* Bannière des engagements */
.territory-banner {
  background: var(--color-surface-soft);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  list-style: none;
}

@media (min-width: 900px) {
  .territory-banner {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .territory-banner {
    padding: 26px 22px;
  }
}

.territory-banner-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.territory-banner-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-logo);
}

.territory-banner-item strong {
  display: block;
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 4px;
}

.territory-banner-item span {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.55;
}

/* ==========================================================================
   Appel à l'action final
   ========================================================================== */
.section-cta {
  padding-bottom: 110px;
}

.cta-wrap {
  background: var(--color-cta-bg);
  border-radius: var(--radius-lg);
  padding: 72px 40px;
  color: var(--color-on-dark);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-title {
  font-size: var(--text-h2);
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--color-on-dark);
}

.cta-text {
  font-size: var(--text-lead);
  color: var(--color-on-dark-soft);
  max-width: 620px;
  margin: 0 auto 32px auto;
  line-height: 1.6;
}

.cta-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 12px;
  margin-top: 24px;
  font-size: var(--text-sm);
  color: var(--color-on-dark-muted);
}

.cta-meta a {
  color: var(--color-on-dark-accent);
  font-weight: 600;
}

@media (max-width: 600px) {
  .section-cta {
    padding-bottom: 72px;
  }

  .cta-wrap {
    padding: 44px 22px;
  }

  .cta-text {
    font-size: var(--text-base);
  }
}

/* ==========================================================================
   Fenêtre de contact (<dialog>)
   ========================================================================== */
.modal {
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-main);
  width: min(560px, calc(100% - 32px));
  max-width: none;
  max-height: none;
  overflow: visible;
}

.modal::backdrop {
  background: rgba(7, 26, 23, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.modal[open] {
  animation: modal-in 0.25s ease-out;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-container {
  position: relative;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 40px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

@media (max-width: 480px) {
  .modal-container {
    padding: 30px 20px;
  }
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-main);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.modal-close-btn:hover {
  background: var(--color-surface-soft);
}

.modal-close-btn svg {
  width: 20px;
  height: 20px;
}

.modal-title {
  font-size: 1.875rem;
  line-height: 1.2;
  margin-bottom: 8px;
  padding-right: 44px;
}

.modal-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-form[hidden] {
  display: none;
}

.input-field-group {
  display: flex;
  flex-direction: column;
}

.input-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-main);
  margin-bottom: 6px;
}

.input-underline {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text-main);
}

.input-underline::placeholder {
  color: var(--color-text-muted);
  opacity: 0.8;
}

.input-underline:focus {
  border-color: var(--color-accent-text);
}

.textarea-underline {
  min-height: 110px;
  resize: vertical;
}

/* Champ piège anti-spam, invisible pour les humains */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-legal {
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--color-text-muted);
}

.form-legal a {
  color: var(--color-accent-text);
}

.form-status {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.5;
  background: var(--color-error-bg);
  color: var(--color-error-text);
}

.form-status:empty {
  display: none;
}

.form-status a {
  color: inherit;
  font-weight: 600;
}

.contact-success {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--color-leaf-tint);
}

.contact-success[hidden] {
  display: none;
}

.contact-success-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.35;
  color: var(--color-text-main);
}

/* ==========================================================================
   Pages secondaires (mentions légales, confidentialité, 404, merci)
   ========================================================================== */
.page-main {
  padding: calc(var(--header-h) + 56px) 0 96px;
  position: relative;
}

.legal-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

@media (max-width: 600px) {
  .page-main {
    padding-top: calc(var(--header-h) + 28px);
  }

  .legal-page {
    padding: 28px 20px;
  }
}

.legal-page h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  line-height: 1.2;
  margin-bottom: 12px;
}

.legal-page h2 {
  font-size: 1.45rem;
  line-height: 1.3;
  margin: 36px 0 12px;
}

.legal-page p,
.legal-page li {
  color: var(--color-text-muted);
  line-height: 1.7;
}

.legal-page p + p,
.legal-page ul + p {
  margin-top: 12px;
}

.legal-page ul {
  margin: 8px 0 0 20px;
}

.legal-page li + li {
  margin-top: 6px;
}

.legal-page a:not(.btn) {
  color: var(--color-accent-text);
}

.legal-page strong {
  color: var(--color-text-main);
}

.legal-updated {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.legal-list {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 10px 24px;
  margin-top: 8px;
}

.legal-list dt {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-accent-text);
  padding-top: 2px;
}

.legal-list dd {
  color: var(--color-text-main);
  line-height: 1.6;
}

@media (max-width: 600px) {
  .legal-list {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .legal-list dd {
    margin-bottom: 12px;
  }
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-main);
  text-decoration: none;
}

.back-link:hover {
  color: var(--color-accent-text);
}

/* Sur petit écran, le logo suffit pour revenir à l'accueil */
@media (max-width: 479.98px) {
  .header .back-link {
    display: none;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  padding: 64px 0 32px 0;
  background: var(--color-surface);
  position: relative;
  z-index: 2;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  padding-bottom: 40px;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
}

.footer-desc {
  margin-top: 12px;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.footer-heading {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-main);
  display: block;
  margin-bottom: 14px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a,
.footer-col span {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-col a:hover,
.footer-bottom a:hover {
  color: var(--color-accent-text);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding-top: 24px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.footer-bottom a {
  color: var(--color-text-muted);
}

/* ==========================================================================
   Apparition au défilement
   Le masquage n'existe que si script.js a posé .js-reveal sur <html> :
   sans JavaScript, tout reste visible.
   ========================================================================== */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--reveal-i, 0) * 70ms);
}

.js-reveal [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   Mouvements réduits : pas d'animation ni de défilement doux
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-map-pin::after {
    display: none;
  }

  .js-reveal [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* Impression : tout le contenu, même les sections pas encore apparues */
@media print {
  .js-reveal [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .header,
  .topo-bg-layer,
  .page-floating-sprig {
    display: none;
  }
}
