/* ===================================================================
   Hub.ERT — feuille de style
   Direction : "mettre de l'ordre" — strates de documents, onglets de
   dossier, tampon de validation. Papier + encre, un bleu d'archive
   en accent, un ocre kraft en second plan.
=================================================================== */

:root{
  --paper:        #F1EEE3;
  --paper-deep:   #E7E2D2;
  --paper-line:   rgba(27,36,31,.14);
  --ink:          #1B241E;
  --ink-soft:     #4A554C;
  --ink-faint:    #7C8A7E;
  --blue:         #28456E;
  --blue-deep:    #1B3153;
  --kraft:        #B47F3A;
  --kraft-soft:   #E4C797;
  --white:        #FBFAF5;

  --radius-tab:   3px 14px 3px 3px;
  --shadow-lift:  0 18px 34px -20px rgba(27,36,31,.35);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --wrap: 1180px;
  --ease: cubic-bezier(.22,.68,.16,1);
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; scroll-padding-top: 92px; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

body{
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg{ max-width: 100%; display: block; }

a{ color: inherit; }

.wrap{
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3{
  font-family: var(--font-display);
  font-weight: 560;
  line-height: 1.12;
  margin: 0 0 .5em;
  color: var(--ink);
}

h2{ font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.5rem); max-width: 18ch; }
h3{ font-size: 1.25rem; }

p{ margin: 0 0 1em; max-width: 62ch; color: var(--ink-soft); }

:focus-visible{
  outline: 2.5px solid var(--blue);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- boutons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .85em 1.6em;
  border-radius: 3px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .96rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .25s var(--ease), background-color .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.btn-primary{
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 10px 22px -12px rgba(40,69,110,.65);
}
.btn-primary:hover{ background: var(--blue-deep); transform: translateY(-2px); box-shadow: 0 16px 28px -14px rgba(40,69,110,.75); }
.btn-ghost{
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn-ghost:hover{ background: var(--ink); color: var(--paper); }
.btn-text{
  padding-left: 0; padding-right: 0;
  color: var(--blue);
  border-bottom: 1.5px solid transparent;
  border-radius: 0;
}
.btn-text:hover{ border-bottom-color: var(--blue); }

/* ---------- eyebrow / onglet de dossier ---------- */
.tab-label{
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-size: .82rem;
  font-weight: 600;
  color: var(--blue-deep);
  background: var(--kraft-soft);
  padding: .35em .9em .35em .7em;
  border-radius: var(--radius-tab);
  margin-bottom: 1.1em;
}
.tab-label::before{
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--blue);
}

/* =========================== HEADER =========================== */
.site-header{
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(241,238,227,.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--paper-line);
  transition: box-shadow .3s var(--ease), background-color .3s var(--ease);
}
.site-header.is-scrolled{
  box-shadow: 0 6px 20px -14px rgba(27,36,31,.3);
}
.header-row{
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 84px;
  transition: height .3s var(--ease);
}
.site-header.is-scrolled .header-row{ height: 66px; }

.logo{
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}
.logo span{ color: var(--blue); }

.main-nav{ display: flex; gap: 2rem; }
.main-nav a{
  text-decoration: none;
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
  transition: color .2s;
}
.main-nav a::after{
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1.5px;
  background: var(--blue);
  transition: right .28s var(--ease);
}
.main-nav a:hover, .main-nav a.is-active{ color: var(--ink); }
.main-nav a:hover::after, .main-nav a.is-active::after{ right: 0; }

.header-cta{ margin-left: .5rem; }

.nav-toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none; border: none; cursor: pointer;
}
.nav-toggle span{
  height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform .25s var(--ease), opacity .2s;
}

/* =========================== HERO =========================== */
.hero{
  padding: 76px 0 88px;
  position: relative;
  overflow: clip;
}
.hero-grid{
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 3rem;
  align-items: center;
}
.hero-copy h1{
  font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.4rem);
  max-width: 15ch;
}
.hero-lede{ font-size: 1.1rem; max-width: 46ch; }
.hero-actions{
  display: flex;
  align-items: center;
  gap: 1.6rem;
  margin-top: 1.8rem;
  flex-wrap: wrap;
}

.hero-visual{ position: relative; }
.strata .layer{
  fill: var(--white);
  stroke: var(--paper-line);
  stroke-width: 1;
  filter: drop-shadow(0 14px 22px rgba(27,36,31,.14));
  opacity: 0;
  transform: translateY(26px);
}
.strata .layer-3{ fill: var(--kraft-soft); }
.strata .layer-label{
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  fill: var(--ink);
  text-anchor: middle;
  opacity: 0;
}
.strata .stamp{
  opacity: 0;
  transform: rotate(-9deg) scale(.7);
  transform-origin: 400px 96px;
}
.strata .stamp circle{ fill: none; stroke: var(--blue); stroke-width: 2.5; }
.strata .stamp text{
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  fill: var(--blue);
  text-anchor: middle;
}
.hero-visual.is-ready .layer,
.hero-visual.is-ready .layer-label,
.hero-visual.is-ready .stamp{
  animation: settle .8s var(--ease) forwards;
}
.hero-visual.is-ready .layer-1{ animation-delay: .05s; }
.hero-visual.is-ready .layer-2{ animation-delay: .2s; }
.hero-visual.is-ready .layer-3{ animation-delay: .35s; }
.hero-visual.is-ready .layer-label{ animation: fadeIn .6s var(--ease) forwards; }
.hero-visual.is-ready .layer-label:nth-of-type(1){ animation-delay: .5s; }
.hero-visual.is-ready text.l1{ animation-delay: .5s; }
.hero-visual.is-ready text.l2{ animation-delay: .62s; }
.hero-visual.is-ready text.l3{ animation-delay: .74s; }
.hero-visual.is-ready .stamp{ animation: stampIn .55s var(--ease) forwards; animation-delay: .95s; }

@keyframes settle{ to{ opacity: 1; transform: translateY(0); } }
@keyframes fadeIn{ to{ opacity: 1; } }
@keyframes stampIn{
  0%{ opacity: 0; transform: rotate(-9deg) scale(.7); }
  60%{ opacity: 1; transform: rotate(-9deg) scale(1.08); }
  100%{ opacity: 1; transform: rotate(-9deg) scale(1); }
}

/* =========================== PROBLEM =========================== */
.problem{ padding: 30px 0 90px; }
.problem-grid{ max-width: 74ch; }
.section-intro{ font-size: 1.08rem; }
.section-intro-secondary{ color: var(--ink-faint); }

.stat-row{
  list-style: none;
  margin: 2.6rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
  max-width: none;
}
.stat-row li{
  border-top: 1.5px solid var(--ink);
  padding-top: .9rem;
}
.stat-num{
  display: block;
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--blue-deep);
  font-weight: 600;
}
.stat-text{ display: block; font-size: .92rem; color: var(--ink-soft); margin-top: .3rem; }

/* =========================== SERVICES =========================== */
.services{ padding: 20px 0 96px; }
.services h2{ margin-bottom: 2.4rem; }

.service-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
.service-card{
  background: var(--white);
  border: 1px solid var(--paper-line);
  border-radius: var(--radius-tab);
  padding: 2rem 1.7rem 1.8rem;
  position: relative;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.service-card::before{
  content: '';
  position: absolute;
  top: -1px; left: 1.7rem;
  width: 34px; height: 6px;
  background: var(--kraft);
  border-radius: 0 0 3px 3px;
}
.service-card:hover{
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift);
  border-color: transparent;
}
.service-card.is-upcoming::before{ background: var(--ink-faint); }
.service-icon{
  width: 40px; height: 40px;
  margin-bottom: 1.1rem;
  color: var(--blue);
}
.service-card p{ font-size: .96rem; }
.upcoming-flag{
  display: inline-block;
  margin-top: .4rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink-faint);
}

.service-note{
  margin-top: 2.2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--paper-line);
  font-size: .96rem;
  color: var(--ink-faint);
  max-width: 70ch;
}

/* =========================== METHOD =========================== */
.method{ padding: 20px 0 96px; }
.method-list{
  list-style: none;
  margin: 2.4rem 0 0;
  padding: 0;
  max-width: 62ch;
  position: relative;
}
.method-list::before{
  content: '';
  position: absolute;
  left: 21px; top: 10px; bottom: 10px;
  width: 1.5px;
  background: var(--paper-line);
}
.method-list::after{
  content: '';
  position: absolute;
  left: 21px; top: 10px;
  width: 1.5px;
  background: var(--blue);
  height: var(--fill, 0%);
  transition: height .2s linear;
}
.method-list li{
  display: flex;
  gap: 1.5rem;
  padding: 0 0 2.4rem;
  position: relative;
}
.method-list li:last-child{ padding-bottom: 0; }
.method-index{
  flex: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--paper-line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink-faint);
  z-index: 1;
  transition: border-color .3s, color .3s, background .3s;
}
.method-list li.is-done .method-index{
  border-color: var(--blue);
  color: var(--blue-deep);
  background: var(--white);
}
.method-list h3{ margin-bottom: .25rem; }
.method-list p{ font-size: .96rem; }

/* =========================== RESSOURCES =========================== */
.ressources{ padding: 20px 0 96px; }
.article-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  margin-top: 2.4rem;
}
.article-card{
  background: var(--paper-deep);
  border-radius: var(--radius-tab);
  padding: 1.9rem 1.7rem;
  transition: transform .3s var(--ease), background .3s var(--ease);
}
.article-card:hover{ transform: translateY(-4px) rotate(-.3deg); background: var(--white); box-shadow: var(--shadow-lift); }
.article-tag{
  display: inline-block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--kraft);
  border: 1px solid var(--kraft-soft);
  padding: .25em .7em;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.article-card h3{ font-size: 1.05rem; }
.article-card p{ font-size: .92rem; }

/* =========================== TERRITOIRE =========================== */
.territoire{
  padding: 70px 0;
  background: var(--ink);
  color: var(--paper);
}
.territoire h2{ color: var(--paper); }
.territoire p{ color: rgba(241,238,227,.72); }
.territoire-grid{
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2rem;
}
.territoire-list{
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  justify-content: flex-end;
}
.territoire-list span{
  font-family: var(--font-display);
  font-size: 1rem;
  padding: .5em 1.1em;
  border: 1px solid rgba(241,238,227,.3);
  border-radius: 999px;
  color: var(--paper);
  transition: border-color .25s, background .25s;
}
.territoire-list span:hover{ border-color: var(--kraft-soft); background: rgba(180,127,58,.18); }

/* =========================== CONTACT =========================== */
.contact{ padding: 96px 0 110px; }
.contact-grid{
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 3.5rem;
}
.contact-intro{ align-self: start; position: sticky; top: 110px; }

.contact-form{
  background: var(--white);
  border: 1px solid var(--paper-line);
  border-radius: var(--radius-tab);
  padding: 2.2rem;
  display: grid;
  gap: 1.3rem;
}
.form-row{ display: flex; flex-direction: column; gap: .4rem; }
.form-row label{ font-size: .88rem; font-weight: 600; color: var(--ink); }
.form-row .optional{ font-weight: 400; color: var(--ink-faint); }
.form-row input, .form-row textarea{
  font-family: var(--font-body);
  font-size: .98rem;
  padding: .75em .9em;
  border: 1.5px solid var(--paper-line);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.form-row input:focus, .form-row textarea:focus{
  outline: none;
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(40,69,110,.12);
}
.hp-field{ position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.contact-form .btn-primary{ justify-self: start; margin-top: .3rem; }
.form-status{ font-size: .92rem; min-height: 1.2em; margin: 0; }
.form-status.is-ok{ color: #2E6B4C; }
.form-status.is-error{ color: #A3402E; }

/* =========================== FOOTER =========================== */
.site-footer{
  padding: 28px 0;
  border-top: 1px solid var(--paper-line);
}
.footer-row{
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .88rem;
  color: var(--ink-faint);
}
.footer-row a{ text-decoration: none; color: var(--ink-soft); }
.footer-row a:hover{ color: var(--blue); }

/* =========================== SCROLL REVEAL =========================== */
[data-reveal]{
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
[data-reveal].is-visible{ opacity: 1; transform: translateY(0); }
[data-reveal-group] > *{ transition-delay: calc(var(--i, 0) * 70ms); }

/* =========================== LEGAL PAGE =========================== */
.legal{ padding: 90px 0 100px; max-width: 74ch; }
.legal h1{ font-size: clamp(1.9rem, 1.5rem + 1.5vw, 2.4rem); }
.legal h2{ font-size: 1.15rem; margin-top: 2em; }
.legal p{ max-width: none; }

/* =========================== RESPONSIVE =========================== */
@media (max-width: 900px){
  .hero-grid{ grid-template-columns: 1fr; }
  .hero-visual{ order: -1; max-width: 380px; margin: 0 auto; }
  .service-grid, .article-grid{ grid-template-columns: repeat(2, 1fr); }
  .stat-row{ grid-template-columns: 1fr; gap: 1.2rem; }
  .contact-grid{ grid-template-columns: 1fr; }
  .contact-intro{ position: static; }
  .territoire-grid{ grid-template-columns: 1fr; }
  .territoire-list{ justify-content: flex-start; }
}

@media (max-width: 640px){
  .main-nav{
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--paper-line);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s var(--ease);
  }
  .main-nav.is-open{ max-height: 320px; }
  .main-nav a{ padding: 1em 28px; width: 100%; }
  .main-nav a::after{ display: none; }
  .header-cta{ display: none; }
  .nav-toggle{ display: flex; }
  .service-grid, .article-grid{ grid-template-columns: 1fr; }
  .hero{ padding: 52px 0 60px; }
  .contact-form{ padding: 1.6rem; }
}
