/* =========================================================
   TCE — Techniques Concepts Economie
   Design system + composants + responsive
   ========================================================= */

/* ---------- Variables ---------- */
:root {
  /* Couleurs — palette dérivée du logo TCE (aubergine / turquoise / prune / mauve).
     Les noms historiques --navy-* sont conservés : ils portent désormais les tons aubergine,
     ce qui rebrand l'ensemble des composants sans renommage. */
  --navy-900: #2c2433;  /* aubergine profond — titres & sections sombres */
  --navy-800: #3a2f43;
  --navy-700: #463a4e;
  --navy-600: #5a4a66;
  --accent:   #3f9c98;  /* turquoise — accent principal / CTA */
  --accent-dark: #34827f;
  --ink:      #2b2430;
  --slate:    #5d5566;
  --muted:    #8b8094;
  --line:     #e8e2ea;
  --bg:       #ffffff;
  --bg-soft:  #f7f4f8;
  --bg-softer:#efe9f0;
  --white:    #ffffff;

  /* Accents secondaires de marque */
  --plum:     #6d5170;
  --mauve:    #9d5f74;

  /* Typo */
  --font-head: "Space Grotesk", "Manrope", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  /* Espacements */
  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --space-7: 6.5rem;

  /* Divers */
  --radius:   14px;
  --radius-sm: 10px;
  --shadow:   0 10px 30px rgba(44, 36, 51, .10);
  --shadow-lg:0 24px 60px rgba(44, 36, 51, .16);
  --maxw:     1180px;
  --header-h: 76px;
  --ease:     cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Reset léger ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; font-weight: 600; color: var(--navy-900); letter-spacing: -.01em; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
.section { padding-block: var(--space-7); }
.section--soft { background: var(--bg-soft); }
.section--navy { background: var(--navy-900); color: #efeaf2; }
.section--tight { padding-block: var(--space-6); }
.center { text-align: center; }
.lead { font-size: 1.18rem; color: var(--slate); max-width: 60ch; }
.section--navy .lead { color: #c3b8cb; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-size: .8rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: var(--space-1);
}
.section--navy .eyebrow { color: var(--accent); }

.section-head { max-width: 62ch; margin-bottom: var(--space-5); }
.section-head.center { margin-inline: auto; }
h2.title { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.22rem; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .85rem 1.5rem; border-radius: 999px;
  font-family: var(--font-head); font-weight: 600; font-size: .98rem;
  border: 1.5px solid transparent; transition: transform .2s var(--ease), background .2s, color .2s, border-color .2s;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: #ffffff; }
.btn--primary:hover { background: var(--accent-dark); }
.btn--ghost { border-color: rgba(255,255,255,.35); color: #fff; }
.btn--ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.btn--outline { border-color: var(--line); color: var(--navy-900); background: #fff; }
.btn--outline:hover { border-color: var(--navy-600); }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: .7rem; }
.brand img { height: 60px; width: auto; }
.brand .brand-sub { font-size: .68rem; color: var(--muted); letter-spacing: .03em; }
.nav-links { display: flex; align-items: center; gap: clamp(.6rem, 2vw, 1.9rem); }
.nav-links a {
  font-family: var(--font-head); font-weight: 500; font-size: .98rem; color: var(--slate);
  padding: .4rem 0; position: relative; transition: color .2s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px;
  background: var(--accent); transition: right .25s var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--navy-900); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { right: 0; }
.nav-cta { margin-left: .4rem; }
.nav-cta .btn { color: #fff; padding: .6rem 1.4rem; white-space: nowrap; }
.nav-cta .btn::after { display: none; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 0; padding: .5rem;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--navy-900); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-700) 55%, var(--navy-600) 100%);
  color: #f1ecf3;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.06) 1px, transparent 0);
  background-size: 26px 26px; pointer-events: none;
}
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: var(--space-5); align-items: center; padding-block: clamp(3.5rem, 8vw, 6rem); }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 5vw, 3.5rem); }
.hero .lead { color: #cabfd0; margin-top: var(--space-2); }
.hero-cta { display: flex; gap: .8rem; margin-top: var(--space-4); flex-wrap: wrap; }
.hero-art { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
.hero-meta { display: flex; gap: var(--space-4); margin-top: var(--space-4); flex-wrap: wrap; }
.hero-meta .stat strong { font-family: var(--font-head); font-size: 1.6rem; color: var(--accent); display: block; }
.hero-meta .stat span { font-size: .85rem; color: #b3a6bd; }

/* ---------- Bandeau certification ---------- */
.cert-band { padding-block: var(--space-4); border-bottom: 1px solid var(--line); }
.cert-item {
  display: inline-flex; align-items: center; gap: var(--space-3);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: .8rem 1.2rem .8rem .8rem; box-shadow: var(--shadow);
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}
.cert-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; }
.cert-item img {
  width: 96px; height: auto; border-radius: var(--radius-sm);
  border: 1px solid var(--line); flex: none;
}
.cert-text { display: grid; line-height: 1.3; }
.cert-text strong { font-family: var(--font-head); color: var(--navy-900); font-size: 1.05rem; }
.cert-text { font-size: .92rem; color: var(--slate); }

/* ---------- Grilles & cartes ---------- */
.grid { display: grid; gap: var(--space-3); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
/* Références : pistes fixes — vignettes calées 1/3 même avec < 3 items filtrés */
.grid--fixed { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--space-4); transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.card .ic {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--bg-softer); color: var(--navy-700); margin-bottom: var(--space-2);
}
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--slate); font-size: .98rem; }

/* Carte projet */
.project {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s;
}
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.project .thumb { aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-softer); }
.project .thumb img { width: 100%; height: 100%; object-fit: cover; }
.project .thumb img.logo-thumb { object-fit: contain; background: #fff; padding: 1rem; }
.project .body { padding: var(--space-3); }
.project .tag {
  display: inline-block; font-family: var(--font-head); font-size: .72rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--accent-dark);
  background: #e3f1f0; padding: .25rem .6rem; border-radius: 999px; margin-bottom: .6rem;
}
.project h3 { font-size: 1.05rem; margin-bottom: .3rem; }
.project .loc { font-size: .9rem; color: var(--plum); font-weight: 500; }
.project .meta { font-size: .85rem; color: var(--muted); margin-top: .35rem; }
.project .meta strong { color: var(--slate); font-weight: 600; }

/* ---------- Process / étapes ---------- */
.steps { counter-reset: step; display: grid; gap: var(--space-3); }
.step {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: var(--space-3);
  align-items: start; padding: var(--space-3) 0; border-top: 1px solid var(--line);
}
.step:first-child { border-top: 0; }
.step .num {
  counter-increment: step; width: 52px; height: 52px; flex: none;
  display: grid; place-items: center; border-radius: 14px;
  background: var(--navy-900); color: var(--accent);
  font-family: var(--font-head); font-weight: 700; font-size: 1.25rem;
}
.step .num::before { content: counter(step, decimal-leading-zero); }
.step h3 { margin-bottom: .25rem; }
.step p { color: var(--slate); }

/* ---------- Encart GIE ---------- */
.gie {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-3); align-items: center;
  background: linear-gradient(120deg, var(--plum) 0%, var(--navy-700) 55%, var(--accent-dark) 130%);
  color: #f1ecf3; border-radius: var(--radius); padding: var(--space-4);
}
.gie .gie-badge {
  font-family: var(--font-head); font-weight: 700; letter-spacing: .04em; font-size: 1.05rem;
  color: #fff; border: 1.5px solid rgba(255,255,255,.3); border-radius: 12px; padding: .9rem 1.1rem; white-space: nowrap;
}
.gie p { color: #d9cfe0; font-size: .98rem; }
.gie .gie-link { color: #a9e2df; font-weight: 600; }

/* ---------- Split (texte + media) ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); align-items: center; }
.split--reverse .split-media { order: -1; }
.split-media { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.split-media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 5/4; }
.value-list { display: grid; gap: var(--space-2); margin-top: var(--space-3); }
.value-list li { display: grid; grid-template-columns: auto 1fr; gap: .8rem; align-items: start; }
.value-list .chk { color: var(--accent-dark); font-weight: 700; }
.value-list strong { color: var(--navy-900); }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band h2 { color: #fff; font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
.cta-band p { color: #cabfd0; max-width: 52ch; margin: var(--space-2) auto var(--space-4); }

/* ---------- Filtres références ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: var(--space-4); }
.filter {
  font-family: var(--font-head); font-weight: 500; font-size: .9rem;
  padding: .5rem 1rem; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--slate);
  transition: all .2s;
}
.filter:hover { border-color: var(--navy-600); color: var(--navy-900); }
.filter.is-active { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.project.is-hidden { display: none; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: var(--space-5); align-items: start; }
.info-block { display: grid; gap: var(--space-3); }
.info-item { display: grid; grid-template-columns: auto 1fr; gap: .9rem; align-items: start; }
.info-item .ic { width: 42px; height: 42px; border-radius: 11px; background: var(--bg-softer); display: grid; place-items: center; color: var(--navy-700); }
.info-item h4 { font-size: 1rem; margin-bottom: .15rem; }
.info-item p, .info-item a { color: var(--slate); font-size: .96rem; }
.info-item a:hover { color: var(--navy-900); }

.form { display: grid; gap: var(--space-2); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4); box-shadow: var(--shadow); }
.field { display: grid; gap: .35rem; }
.field.row2 { grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.field label { font-size: .85rem; font-weight: 600; color: var(--navy-900); font-family: var(--font-head); }
.field input, .field textarea {
  font: inherit; font-size: .96rem; padding: .75rem .9rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-soft); color: var(--ink); transition: border-color .2s, background .2s;
}
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--navy-600); background: #fff; }
.field textarea { resize: vertical; min-height: 130px; }
.form .btn { justify-content: center; }
.form .note { font-size: .8rem; color: var(--muted); }
.form-status { font-size: .9rem; font-weight: 600; margin: 0; padding: .6rem .8rem; border-radius: var(--radius); }
.form-status.is-sending { color: var(--muted); }
.form-status.is-success { color: #0a7d3c; background: #e8f7ee; }
.form-status.is-error   { color: #b42318; background: #fdeceb; }

/* ---------- Page header (pages internes) ---------- */
.page-hero {
  background: linear-gradient(160deg, var(--navy-900), var(--navy-700));
  color: #f1ecf3; padding-block: clamp(3rem, 7vw, 5rem);
  position: relative; overflow: hidden;
}
.page-hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.05) 1px, transparent 0);
  background-size: 26px 26px;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { color: #fff; font-size: clamp(1.9rem, 4.5vw, 3rem); }
.page-hero p { color: #cabfd0; max-width: 60ch; margin-top: var(--space-2); }
.breadcrumb { font-size: .85rem; color: #9b8ca6; margin-bottom: var(--space-2); }
.breadcrumb a:hover { color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: #c3b8cb; padding-block: var(--space-6) var(--space-4); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: var(--space-4); }
.site-footer h4 { color: #fff; font-size: .92rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: var(--space-2); }
.site-footer a { color: #c3b8cb; transition: color .2s; }
.site-footer a:hover { color: var(--accent); }
.site-footer .f-links { display: grid; gap: .5rem; font-size: .95rem; }
.footer-brand { text-align: center; }
.footer-brand .logo-chip { display: inline-block; background: #fff; border-radius: 12px; padding: .7rem 1rem; margin-bottom: var(--space-2); }
.footer-brand .logo-chip img { height: 58px; width: auto; display: block; }
.footer-brand p { font-size: .92rem; color: #a193ab; max-width: 32ch; margin-left: auto; margin-right: auto; }
.footer-bottom {
  margin-top: var(--space-5); padding-top: var(--space-3); border-top: 1px solid rgba(255,255,255,.1);
  display: flex; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap;
  font-size: .85rem; color: #8d7f98;
}

/* ---------- Équipe ---------- */
.member { text-align: left; }
.member .avatar {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; color: #fff;
  margin-bottom: var(--space-2); letter-spacing: .5px;
}
.avatar--plum  { background: linear-gradient(135deg, var(--plum), #543f57); }
.avatar--teal  { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); }
.avatar--mauve { background: linear-gradient(135deg, var(--mauve), #7f4a5d); }
.avatar--ink   { background: linear-gradient(135deg, #564861, var(--navy-900)); }
.member h3 { margin-bottom: .15rem; }
.member .member-role { color: var(--accent-dark); font-family: var(--font-head); font-weight: 600; font-size: .92rem; margin-bottom: .6rem; }
.member p { color: var(--slate); font-size: .96rem; }
.member .member-tags { margin-top: var(--space-2); display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.member .member-tags li { font-size: .82rem; color: var(--plum); font-weight: 500; }
.member .member-tags li:not(:last-child)::after { content: "·"; margin-left: .4rem; color: var(--muted); }

.lead-card {
  border-left: 4px solid var(--accent); background: #fff; border-radius: var(--radius);
  padding: var(--space-4); box-shadow: var(--shadow);
}

/* Pastilles / listes d'infos (missions, outils, labels) */
.pill-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: var(--space-2); }
.pill-list li {
  font-size: .9rem; background: var(--bg-softer); color: var(--plum);
  padding: .45rem .9rem; border-radius: 999px; font-weight: 500;
}
.pill-list.pill-list--teal li { background: #e3f1f0; color: var(--accent-dark); }

.mission-col h3 { display: flex; align-items: center; gap: .55rem; margin-bottom: .6rem; }
.mission-col h3 .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.mission-col ul { display: grid; gap: .5rem; }
.mission-col li { position: relative; padding-left: 1.1rem; color: var(--slate); font-size: .97rem; }
.mission-col li::before { content: "›"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* ---------- Animations scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in-view { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .card:hover, .project:hover { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-height: 320px; }
  .split, .contact-grid { grid-template-columns: 1fr; }
  .split--reverse .split-media { order: 0; }
  .gie { grid-template-columns: 1fr; text-align: left; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: var(--space-2) clamp(1.1rem, 4vw, 2rem) var(--space-3);
    box-shadow: var(--shadow);
    transform: translateY(-130%); transition: transform .32s var(--ease); visibility: hidden;
  }
  .nav-links.is-open { transform: translateY(0); visibility: visible; }
  .nav-links a { width: 100%; padding: .8rem 0; border-bottom: 1px solid var(--bg-softer); font-size: 1.05rem; }
  .nav-links a::after { display: none; }
  .nav-cta { margin: var(--space-2) 0 0; }
  .nav-cta .btn { width: 100%; justify-content: center; }
}

@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
  .field.row2 { grid-template-columns: 1fr; }
  .hero-cta .btn { width: 100%; justify-content: center; }
}
