/* ==========================================================================
   AMOPI — Habillage du site (structure inspirée du template "Lana")
   Dépend de amopi-brand.css pour les variables de charte.
   ========================================================================== */

body { background: var(--amopi-noir); }

.sr-only, .skip-link {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; top: 12px; left: 12px; width: auto; height: auto;
  clip: auto; margin: 0; padding: .7em 1.2em; z-index: 200;
  background: var(--amopi-terra); color: #fff; border-radius: var(--radius-sm);
}

/* --- Rails & cadre ------------------------------------------------------- */
.frame { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.frame__line {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: rgba(255,255,255,0.16);
}
.frame__line--left  { left: 46px; }
.frame__line--right { right: 46px; }

.social-rail {
  position: fixed; left: 0; bottom: 40px; width: 46px;
  list-style: none; margin: 0; padding: 0; z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.social-rail a {
  display: grid; place-items: center; width: 22px; height: 22px;
  color: rgba(255,255,255,0.65); transition: var(--transition);
}
.social-rail a:hover { color: var(--amopi-terra); transform: translateY(-2px); }
.social-rail svg { width: 17px; height: 17px; }

.totop-rail {
  position: fixed; right: 0; bottom: 40px; width: 46px; z-index: 60;
  display: grid; place-items: center; text-decoration: none;
  color: rgba(255,255,255,0.55); font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; transition: var(--transition);
}
.totop-rail span { writing-mode: vertical-rl; }
.totop-rail:hover { color: var(--amopi-terra); }

/* --- Navigation ---------------------------------------------------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 22px 0; transition: background 300ms ease, padding 300ms ease, box-shadow 300ms ease;
}
.nav.is-stuck {
  background: rgba(43,29,70,0.92);
  backdrop-filter: blur(14px) saturate(140%);
  padding: 12px 0; box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.nav__inner {
  max-width: 1420px; margin-inline: auto; padding-inline: 78px;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
}
.nav__logo img { height: 81px; width: auto; transition: height 300ms ease; }
.nav.is-stuck .nav__logo img { height: 66px; }

.nav__menu { display: flex; align-items: center; gap: 1.55rem; }
.nav__menu a {
  position: relative; color: rgba(255,255,255,0.82); text-decoration: none;
  font-size: .82rem; font-weight: 500; letter-spacing: .04em;
  padding-bottom: 4px; white-space: nowrap; transition: color 200ms ease;
}
.nav__menu a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: var(--amopi-terra); transition: right 260ms ease;
}
.nav__menu a:hover { color: #fff; }
.nav__menu a:hover::after,
.nav__menu a.is-active::after { right: 0; }
.nav__menu a.is-active { color: #fff; }

.nav__cta {
  background: var(--amopi-terra); color: #fff !important;
  padding: .62em 1.35em !important; border-radius: var(--radius-pill);
  font-weight: 600; transition: var(--transition);
}
.nav__cta::after { display: none !important; }
.nav__cta:hover { background: var(--amopi-terra-600); transform: translateY(-1px); }

.nav__burger {
  display: none; flex-direction: column; gap: 5px; background: none;
  border: 0; cursor: pointer; padding: 8px;
}
.nav__burger span {
  display: block; width: 26px; height: 2px; background: #fff;
  transition: var(--transition); border-radius: 2px;
}
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Panneaux plein écran ------------------------------------------------ */
.panel {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; overflow: hidden;
  isolation: isolate;
}
.panel__bg {
  position: absolute; inset: 0; z-index: -3;
  background-size: cover; background-position: center;
  transform: scale(1.06);
  animation: slowzoom 26s ease-out forwards;
}
@keyframes slowzoom { to { transform: scale(1); } }

.panel__veil {
  position: absolute; inset: 0; z-index: -2;
  background:
    linear-gradient(105deg, rgba(43,29,70,0.94) 0%, rgba(43,29,70,0.80) 42%, rgba(43,29,70,0.42) 100%),
    linear-gradient(to top, rgba(28,22,38,0.55), transparent 45%);
}
/* Voile violet translucide : laisse transparaître la photo de fond. */
.panel__mesh {
  position: absolute; inset: 0; z-index: -2;
  background-color: rgba(64, 44, 103, 0.90);
  background-image:
    radial-gradient(circle at 15% 15%, rgba(165,145,197,0.30), transparent 48%),
    radial-gradient(circle at 88% 78%, rgba(70,186,187,0.24), transparent 46%),
    radial-gradient(circle at 60% 20%, rgba(236,102,92,0.14), transparent 40%);
}

.panel__content {
  position: relative; width: 100%;
  padding: 140px 0 110px;
}
.wrap {
  max-width: 1420px; margin-inline: auto; padding-inline: 78px;
}
.wrap--text { max-width: 1420px; }
.wrap--text > * { max-width: 68ch; }
.wrap--text > .stats { max-width: none; }

/* Texte clair par défaut sur les panneaux */
.panel { color: rgba(255,255,255,0.80); }
.panel h1, .panel h2, .panel h3 { color: #fff; }
.panel .eyebrow { color: var(--amopi-terra); }
.panel .lead { color: rgba(255,255,255,0.88); }


/* --- Hero ---------------------------------------------------------------- */
.panel--hero .display { margin-bottom: var(--space-3); font-weight: 600; letter-spacing: -0.015em; }
.panel--hero .lead { max-width: 60ch; }
.btn-row { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: var(--space-4); }

.btn--outline-light {
  border-color: rgba(255,255,255,0.5); color: #fff; background: transparent;
}
.btn--outline-light:hover { background: #fff; color: var(--amopi-violet); border-color: #fff; }

.scroll-hint {
  position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%);
  width: 24px; height: 40px; border: 1px solid rgba(255,255,255,0.4);
  border-radius: 14px; z-index: 5;
}
.scroll-hint span {
  position: absolute; left: 50%; top: 9px; width: 3px; height: 7px;
  margin-left: -1.5px; border-radius: 2px; background: var(--amopi-terra);
  animation: dot 1.8s ease-in-out infinite;
}
@keyframes dot { 0%,100% { transform: translateY(0); opacity: 1; } 60% { transform: translateY(13px); opacity: 0; } }

/* --- Statistiques -------------------------------------------------------- */
.stats {
  list-style: none; margin: var(--space-5) 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 2.6rem;
}
.stats li { display: flex; flex-direction: column; }
.stats strong {
  font-family: var(--font-heading); font-size: 1.9rem; font-weight: 700;
  color: #fff; line-height: 1.1;
}
.stats span {
  font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--amopi-lavande); margin-top: .4rem; max-width: 22ch;
}

/* --- Layout à deux colonnes ---------------------------------------------- */
.split { display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.split--contact { grid-template-columns: minmax(280px, 420px) 1fr; align-items: start; }
.split--profil  { grid-template-columns: minmax(280px, 400px) 1fr; }

/* --- Prestations : les deux phases de la mission -------------------------- */
.phases {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: clamp(2rem, 4vw, 4rem); margin-top: var(--space-5);
}
.phase__head { padding-bottom: 1.1rem; border-bottom: 1px solid rgba(255,255,255,0.22); margin-bottom: 1.4rem; }
.phase__num {
  display: block; font-size: .72rem; font-weight: 600;
  letter-spacing: var(--ls-label); text-transform: uppercase;
  color: var(--amopi-terra); margin-bottom: .35rem;
}
.phase__head h3 { font-size: 1.5rem; margin-bottom: .35rem; }
.phase__sub { font-size: .9rem; color: rgba(255,255,255,0.65); margin: 0; }

.missions { list-style: none; margin: 0; padding: 0; }
.missions li { display: grid; grid-template-columns: 78px 1fr; gap: 1rem; margin-bottom: 1.35rem; }
.missions li:last-child { margin-bottom: 0; }
.missions strong {
  display: block; font-family: var(--font-heading); font-size: 1rem;
  font-weight: 600; color: #fff; margin-bottom: .2rem;
}
.missions p { font-size: .88rem; line-height: 1.55; color: rgba(255,255,255,0.72); margin: 0; }
.missions em { font-style: normal; color: var(--amopi-azur); }

/* Sigle normalisé de la mission (PROG, DIAG, DET…) */
.sigle {
  display: inline-flex; align-items: center; justify-content: center;
  height: 26px; padding: 0 .5rem; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.28);
  font-family: var(--font-heading); font-size: .68rem; font-weight: 700;
  letter-spacing: .08em; color: var(--amopi-lavande);
  white-space: nowrap; justify-self: start;
}

/* --- Périmètre d'intervention -------------------------------------------- */
.scope {
  margin-top: var(--space-6); padding: var(--space-4);
  border: 1px solid rgba(255,255,255,0.18); border-radius: var(--radius-lg);
  background: rgba(43,29,70,0.45); backdrop-filter: blur(3px);
}
.scope h3 { font-size: 1.25rem; margin-bottom: .6rem; }
.scope > p { font-size: .93rem; color: rgba(255,255,255,0.78); max-width: 80ch; }
.scope__list {
  list-style: none; margin: var(--space-3) 0 var(--space-2); padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .7rem 2rem;
}
.scope__list li {
  font-size: .9rem; color: rgba(255,255,255,0.86);
  padding-left: 1.4rem; position: relative;
}
.scope__list li::before {
  content: "→"; position: absolute; left: 0; color: var(--amopi-terra);
}
.scope__list span {
  display: block; font-size: .78rem; color: var(--amopi-lavande);
  letter-spacing: .04em;
}

/* --- Secteurs ------------------------------------------------------------ */
/* Carré 2 × 2 imposé pour les 4 univers */
.solutions-grid { margin-top: var(--space-5); gap: 2.4rem 4rem; grid-template-columns: repeat(2, 1fr); }
.solution h3 { font-size: 1.2rem; margin-bottom: .5rem; font-weight: 600; }
.solution h3::before {
  content: ""; display: block; width: 28px; height: 2px;
  background: var(--amopi-terra); margin-bottom: .8rem;
}
.solution p { font-size: .94rem; color: rgba(255,255,255,0.74); margin: 0; }

/* --- Méthode ------------------------------------------------------------- */
.steps {
  list-style: none; margin: var(--space-5) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 2.6rem 2.2rem;
}
.step { position: relative; padding-top: 1.6rem; border-top: 1px solid rgba(255,255,255,0.22); }
.step__num {
  display: block; font-family: var(--font-heading); font-size: .8rem;
  font-weight: 700; letter-spacing: .2em; color: var(--amopi-terra); margin-bottom: .7rem;
}
.step h3 { font-size: 1.15rem; margin-bottom: .5rem; font-weight: 600; }
.step p { font-size: .92rem; color: rgba(255,255,255,0.75); margin: 0; }

/* --- Références ---------------------------------------------------------- */
.work-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem; margin-top: var(--space-5);
}
/* L'opération phare occupe deux colonnes : la grille de 5 projets tombe juste. */
.work--lead { grid-column: span 2; }
.work--lead .work__img { aspect-ratio: 21 / 9; transition: background-image 300ms ease; }

/* Bandeau de vignettes de la galerie */
.work__thumbs {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 4px; padding: 4px; background: rgba(0,0,0,0.18);
}
.work__thumbs--2 { grid-template-columns: repeat(2, 1fr); }
.work__thumbs--3 { grid-template-columns: repeat(3, 1fr); }
.thumb {
  aspect-ratio: 16 / 10; border: 0; padding: 0; cursor: pointer;
  background-size: cover; background-position: center;
  opacity: .55; transition: var(--transition);
  outline-offset: -2px;
}
.thumb:hover { opacity: .85; }
.thumb.is-active { opacity: 1; box-shadow: inset 0 0 0 2px var(--amopi-terra); }
.work {
  display: block; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14); border-radius: var(--radius);
  overflow: hidden; transition: var(--transition);
}
.work:hover { transform: translateY(-4px); border-color: rgba(236,102,92,0.6); background: rgba(255,255,255,0.09); }
.work__img {
  display: block; aspect-ratio: 16 / 9;
  background-size: cover; background-position: center;
  filter: saturate(0.85);
  transition: var(--transition);
}
.work:hover .work__img { filter: saturate(1); }
.work__body { display: block; padding: 1.3rem 1.4rem 1.5rem; }
.work__cat {
  display: block; font-size: .7rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--amopi-azur); margin-bottom: .45rem;
}
.work__title { display: block; font-family: var(--font-heading); font-size: 1.08rem; font-weight: 600; color: #fff; margin-bottom: .55rem; }
.work__desc { display: block; font-size: .87rem; line-height: 1.6; color: rgba(255,255,255,0.72); }

/* --- Parcours ------------------------------------------------------------ */
.portrait {
  width: 148px; height: 148px; object-fit: cover; border-radius: 50%;
  margin-bottom: var(--space-3); border: 3px solid rgba(255,255,255,0.85);
  box-shadow: var(--shadow-lg);
}
.timeline { list-style: none; margin: 0; padding: 0; }
.tl {
  position: relative; padding: 0 0 2.1rem 1.9rem;
  border-left: 1px solid rgba(255,255,255,0.22);
}
.tl:last-child { padding-bottom: 0; border-left-color: transparent; }
.tl::before {
  content: ""; position: absolute; left: -5px; top: .45rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--amopi-terra);
}
.tl__date {
  display: block; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--amopi-lavande); font-weight: 600; margin-bottom: .3rem;
}
.tl h3 { font-size: 1.05rem; margin-bottom: .4rem; font-weight: 600; }
.tl p { font-size: .9rem; margin: 0; color: rgba(255,255,255,0.74); }

/* --- Contact ------------------------------------------------------------- */
.contact-list { list-style: none; margin: var(--space-3) 0 0; padding: 0; }
.contact-list li { padding: .55rem 0; border-bottom: 1px solid rgba(255,255,255,0.16); font-size: .95rem; }
.contact-list a { color: #fff; text-decoration: none; }
.contact-list a:hover { color: var(--amopi-terra); }

.contact-form { display: grid; gap: .85rem; max-width: 620px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.contact-form .field {
  background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.22);
  color: #fff; border-radius: var(--radius-sm);
}
.contact-form .field::placeholder { color: rgba(255,255,255,0.55); }
.contact-form .field:focus { background: rgba(255,255,255,0.14); border-color: var(--amopi-terra); box-shadow: none; }
.contact-form select.field option { color: var(--color-text); }
.contact-form .btn { justify-self: start; margin-top: .4rem; }
.form-note { font-size: .78rem; color: rgba(255,255,255,0.55); margin: 0; }

/* --- Footer -------------------------------------------------------------- */
.footer { background: var(--amopi-violet-900); padding: var(--space-5) 0 var(--space-4); }
.footer__inner {
  max-width: 1420px; margin-inline: auto; padding-inline: 78px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .9rem;
}
.footer__logo { height: 58px; width: auto; }

/* Mention informatique et libertés sous le formulaire */
.consent-note { font-size: .8rem; line-height: 1.55; color: rgba(255,255,255,0.66); margin: 0; }
.consent-note a { color: #fff; }
.form-note a { color: #fff; }
.footer__base {
  margin: 0; font-size: .74rem; letter-spacing: var(--ls-label); text-transform: uppercase;
  color: var(--amopi-lavande);
}
.footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.4rem; margin-top: .6rem; }
.footer__links a { color: rgba(255,255,255,0.72); text-decoration: none; font-size: .86rem; }
.footer__links a:hover { color: var(--amopi-terra); }
.footer__legal { margin: .6rem 0 0; font-size: .76rem; color: rgba(255,255,255,0.42); }

/* --- Animations d'apparition --------------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms ease, transform 700ms cubic-bezier(.2,.7,.3,1); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal--d1.is-in { transition-delay: 100ms; }
.reveal--d2.is-in { transition-delay: 200ms; }
.reveal--d3.is-in { transition-delay: 320ms; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1400px) {
  .nav__menu { gap: 1.15rem; }
  .nav__menu a { font-size: .78rem; }
}

@media (max-width: 1280px) {
  .nav__inner, .wrap, .footer__inner { padding-inline: 62px; }
  .split, .split--contact, .split--profil { grid-template-columns: 1fr; gap: 2.5rem; }
  .wrap--text > * { max-width: none; }
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .work--lead { grid-column: span 2; }
  .phases { grid-template-columns: 1fr; gap: var(--space-5); }
}

/* Le menu passe en burger avant que les 7 liens + CTA ne débordent. */
@media (max-width: 1100px) {
  .frame, .social-rail, .totop-rail { display: none; }
  .nav__inner, .wrap, .footer__inner { padding-inline: var(--gutter); }

  .nav { background: rgba(43,29,70,0.92); backdrop-filter: blur(14px); padding: 12px 0; }
  /* Logo plafonné en mobile : la barre reste à 80 px, hauteur du menu déroulant. */
  .nav__logo img, .nav.is-stuck .nav__logo img { height: 56px; }
  .nav__burger { display: flex; }
  .nav__menu {
    position: fixed; inset: 80px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--amopi-violet-900);
    padding: 1rem var(--gutter) 1.6rem;
    max-height: calc(100vh - 80px); overflow-y: auto;
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: opacity 220ms ease, transform 220ms ease;
    box-shadow: 0 20px 40px rgba(0,0,0,.35);
  }
  .nav__menu.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__menu a { padding: .85rem 0; font-size: .98rem; border-bottom: 1px solid rgba(255,255,255,.09); }
  .nav__menu a::after { display: none; }
  .nav__cta { margin-top: 1rem; text-align: center; border-bottom: 0 !important; }

  .panel { min-height: auto; }
  .panel__content { padding: 96px 0 76px; }
  .panel--hero { min-height: 100svh; }
  .panel__veil {
    background: linear-gradient(180deg, rgba(43,29,70,0.92), rgba(43,29,70,0.88));
  }
  .stats { gap: 1.6rem 2rem; }
  .stats strong { font-size: 1.55rem; }
  .form-row { grid-template-columns: 1fr; }
  .scroll-hint { display: none; }
  .btn-row .btn { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 700px) {
  .solutions-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .display { font-size: 2.15rem; }
  .work-grid, .feature-grid { grid-template-columns: 1fr; }
  .work--lead { grid-column: auto; }
  .work--lead .work__img { aspect-ratio: 16 / 9; }
  .missions li { grid-template-columns: 1fr; gap: .4rem; }
  .scope { padding: var(--space-3); }
  .footer__links { gap: .9rem 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .panel__bg { animation: none; transform: none; }
  .scroll-hint span { animation: none; }
}
