/* Styles for the new page only. Cloned site CSS lives in assets/ and stays untouched.
   Values come from the live theme (em-wp): Gilroy families, 1200px container,
   expertise colour pairs, 35px pills. Motion lives in offre.js. */

.offre {
  --ink: #222222;
  --paper: #f2f1ef;
  --pill: #e6e5df;
  --cream: #f3f0e6;
  --blue: #125ed4;
  --sky: #a6d4f9;
  --green: #1d4520;
  --pink: #ecc6c7;
  --amber: #f2bd41;
  --orange: #e0643a;
  --wire: #9d9c96;

  font-family: "Gilroy-Medium", sans-serif;
  color: var(--ink);
  overflow-x: clip;
}

.offre__container {
  width: 1200px;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 15px;
}

/* ---------- Hero ---------- */

.offre__hero {
  padding-top: 0;
}

/* First screen: eyebrow, title and the whole tile row always fit the viewport.
   The tiles take whatever height is left under the title. */
.offre__fold {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  padding: clamp(160px, 22vh, 200px) 0 32px;
}

/* Eyebrow and title use the live expertise-page values (em-wp theme):
   Gilroy-SemiBold 14px label, Gilroy-SemiBold 56/66 title, no tracking. */
.offre__eyebrow {
  font-family: "Gilroy-SemiBold", sans-serif;
  font-size: 14px;
  line-height: 17px;
  color: var(--ink);
  margin-bottom: 14px;
}

.offre__title {
  font-family: "Gilroy-SemiBold", sans-serif;
  font-weight: normal;
  font-size: 56px;
  line-height: 66px;
  color: var(--ink);
}

/* Each word sits in a mask so it can rise into place. */
.offre__title .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.16em;
  margin-bottom: -0.16em;
}

.offre__title .w > span { display: inline-block; }

/* ---------- Deck: five pillar tiles, one open at a time ---------- */

.deck {
  display: flex;
  gap: 12px;
  flex: 1 1 0;
  min-height: 0;
  margin-top: clamp(36px, 12vh, 140px);
}

.deck__tile {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  border-radius: 26px;
  background: var(--bg);
  color: var(--fg);
  text-decoration: none;
  transition: flex-grow 0.75s cubic-bezier(0.65, 0, 0.2, 1);
}

.deck__tile.is-open { flex-grow: 3.4; }
.deck__tile:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

/* Each tile takes the background of its e&m expertise logo, so the logo sits flush. */
.deck__tile--design    { --bg: #f4c4c6; --fg: #1d4520; }
.deck__tile--content   { --bg: #f25a28; --fg: #f1efe5; }
.deck__tile--seo       { --bg: #a6d4f9; --fg: #125ed4; }
.deck__tile--ia        { --bg: #125ed4; --fg: #f3f0e6; }
.deck__tile--evolution { --bg: #1d4520; --fg: #f2f1ef; }

.deck__shape {
  position: absolute;
  top: 12px;
  right: 12px;
  width: clamp(100px, 8.8vw, 128px);
  aspect-ratio: 1;
  transform-origin: 100% 0;
  transition: transform 0.75s cubic-bezier(0.65, 0, 0.2, 1);
}

.deck__shape img {
  display: block;
  width: 100%;
  height: 100%;
}

.deck__tile.is-open .deck__shape { transform: translate(-10px, 10px) scale(1.5); }

.deck__name {
  position: absolute;
  left: 28px;
  bottom: 26px;
  font-family: "Gilroy-SemiBold", sans-serif;
  font-size: clamp(24px, 2.3vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.25s ease, transform 0.45s ease;
}

/* Small label on closed tiles, so every pillar is named before it opens. */
.deck__tag {
  position: absolute;
  left: 20px;
  right: 14px;
  bottom: 22px;
  font-family: "Gilroy-SemiBold", sans-serif;
  font-size: 15px;
  line-height: 1.25;
  text-wrap: balance;
  transition: opacity 0.3s ease 0.4s;
}

.deck__tile.is-open .deck__tag { opacity: 0; transition: opacity 0.12s ease; }

.deck__go {
  position: absolute;
  right: 22px;
  bottom: 20px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.25s ease, transform 0.45s ease;
}

.deck__tile.is-open .deck__name { opacity: 1; transform: none; transition-delay: 0.3s; }
.deck__tile.is-open .deck__go { opacity: 1; transform: none; transition-delay: 0.38s; }
.deck__tile.is-open:hover .deck__go { transform: translateY(4px); transition-delay: 0s; }

/* ---------- Intro ---------- */

.offre__intro {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 90px;
  align-items: start;
  padding: 130px 0 150px;
}

.offre__lead {
  font-family: "Gilroy-Medium", sans-serif;
  font-size: 32px;
  line-height: 42px;
  letter-spacing: -0.012em;
}

.offre__intro-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 36px;
  padding-top: 6px;
}

.offre__intro-side p {
  font-size: 18px;
  line-height: 28px;
  text-wrap: pretty;
}

.offre__cta {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 19px 28px;
  border-radius: 35px;
  background: var(--ink);
  color: var(--cream);
  font-family: "Gilroy-Medium", sans-serif;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.offre__cta svg { transition: transform 0.25s ease; }
.offre__cta:hover { background: var(--blue); color: #fff; }
.offre__cta:hover svg { transform: translate(2px, -2px); }
.offre__cta:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

/* ---------- Pillars: base layout (small screens, reduced motion) ---------- */

.offre__pillars {
  padding-bottom: 150px;
}

.build__panel {
  width: 1200px;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 15px;
}

.build__copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.build__stage,
.build__progress {
  display: none;
}

.pillar {
  --bg: var(--pill);
  --fg: var(--ink);
  --body: var(--fg);

  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "label label"
    "title text";
  column-gap: 80px;
  row-gap: 90px;
  padding: 60px 70px 64px;
  border-radius: 26px;
  background: var(--bg);
  color: var(--fg);
}

.pillar__label {
  grid-area: label;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: "Gilroy-SemiBold", sans-serif;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

/* The pillar's e&m expertise logo (copy without its background square). */
.pillar__label img {
  display: block;
  width: 40px;
  height: 40px;
}

.pillar h2 {
  grid-area: title;
  align-self: end;
  font-family: "Gilroy-SemiBold", sans-serif;
  font-weight: normal;
  font-size: 42px;
  line-height: 50px;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.pillar__text {
  grid-area: text;
  align-self: end;
  font-size: 20px;
  line-height: 30px;
  color: var(--body);
  text-wrap: pretty;
}

/* Each pillar takes the colours of its e&m expertise logo, as in the hero tiles. */
.pillar--design    { --bg: #f4c4c6; --fg: var(--green); }
.pillar--content   { --bg: #f25a28; --fg: var(--ink); }
.pillar--seo       { --bg: var(--sky);   --fg: var(--blue);  --body: #0d3c94; }
.pillar--ia        { --bg: var(--blue);  --fg: var(--cream); }
.pillar--evolution { --bg: var(--green); --fg: var(--paper); }

/* ---------- Pillars: pinned build scene (class added by offre.js) ---------- */

.build.is-build {
  height: 100vh;
  padding: 16px;
}

.build.is-build .build__panel {
  position: relative;
  width: auto;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: 50px;
  padding: 64px 70px 128px;
  border-radius: 26px;
  overflow: hidden;
}

.build.is-build .build__copy {
  display: grid;
  gap: 0;
}

.build.is-build .pillar {
  grid-area: 1 / 1;
  /* Top-aligned so the label holds one position across all five pillars. */
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
  padding: 0;
  background: none;
  border-radius: 0;
}

/* Only the first pillar shows until the scroll timeline hands over. */
.build.is-build .pillar + .pillar {
  opacity: 0;
}

.build.is-build .pillar h2 {
  align-self: auto;
  font-family: "Gilroy-Medium", sans-serif;
  font-size: clamp(34px, 3.5vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.build.is-build .pillar__text {
  align-self: auto;
  max-width: 500px;
}

.build.is-build .build__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-width: 0;
}

/* Pillar rail: names the five pillars, shows progress, jumps on click. */
.build.is-build .build__progress {
  position: absolute;
  left: 70px;
  right: 70px;
  bottom: 38px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.build__progress button {
  appearance: none;
  /* Padding above the line widens the click target without moving it. */
  padding: 14px 0 8px;
  margin-top: -14px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  opacity: 0.68;
  transition: opacity 0.3s ease;
}

.build__progress button:hover,
.build__progress button.is-current { opacity: 1; }
.build__progress button:focus-visible { outline: 2px solid currentColor; outline-offset: 6px; opacity: 1; }

.build__progress i {
  display: block;
  height: 2px;
  overflow: hidden;
  background: color-mix(in srgb, currentColor 28%, transparent);
}

.build__progress b {
  display: block;
  height: 100%;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
}

.build__progress span {
  display: block;
  margin-top: 14px;
  font-family: "Gilroy-SemiBold", sans-serif;
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Same hidden state the theme uses for body.hide__header, held for the whole pin. */
body.offre-pinned header .logo,
body.offre-pinned header .dropdowns-header {
  top: -10px;
  opacity: 0;
  visibility: hidden;
  z-index: -1;
}

/* ---------- The mock site ---------- */

.mock {
  position: relative;
  flex: none;
  width: 760px;
  height: 560px;
  font-family: "Gilroy-Medium", sans-serif;
}

.mock i, .mock b, .mock em { font-style: normal; font-weight: normal; }

.wire {
  border: 1.5px dashed var(--wire);
  background-color: rgba(255, 255, 255, 0);
}

.site {
  position: absolute;
  left: 40px;
  top: 40px;
  width: 640px;
  height: 450px;
  border: 1.5px dashed var(--wire);
  border-radius: 18px;
  background-color: rgba(255, 255, 255, 0);
  box-shadow: 0 0 0 rgba(29, 69, 32, 0);
  overflow: hidden;
}

/* Frosts the page content (below the browser bar) once the site is secured. */
.site__veil {
  position: absolute;
  inset: 45px 0 0;
  border-radius: 0 0 17px 17px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  opacity: 0;
  pointer-events: none;
}

.site__bar {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  border-bottom: 1.5px dashed var(--wire);
}

.site__dots { display: flex; gap: 5px; }
.site__dots i { width: 9px; height: 9px; border-radius: 50%; background: #c9c8c2; }

.site__url {
  flex: 1;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 13px;
  background-color: rgba(34, 34, 34, 0.07);
  font-size: 12px;
  color: #454545;
}

.site__ver {
  width: 34px;
  height: 22px;
  overflow: hidden;
  border-radius: 11px;
  background: var(--ink);
  color: var(--cream);
  font-family: "Gilroy-SemiBold", sans-serif;
  font-size: 11px;
  line-height: 22px;
  text-align: center;
}

.site__ver-roll { display: block; }
.site__ver-roll b { display: block; height: 22px; }

.site__body { padding: 20px 28px; }

.site__nav { display: flex; align-items: center; justify-content: space-between; }
.site__logo { width: 26px; height: 26px; border-radius: 6px; }
.site__links { display: flex; gap: 14px; }
.site__links i { position: relative; display: block; width: 62px; height: 12px; border-radius: 6px; }
.site__links em {
  position: absolute;
  inset: -3px 0;
  font-family: "Gilroy-SemiBold", sans-serif;
  font-size: 11px;
  line-height: 18px;
  text-align: right;
  color: var(--ink);
  opacity: 0;
}

.site__hero { display: flex; justify-content: space-between; gap: 28px; margin-top: 26px; }
.site__copy { flex: 1; display: flex; flex-direction: column; align-items: flex-start; }

.site__h { position: relative; width: 100%; height: 84px; }
.site__h-bars { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }
.site__h-bars i { display: block; width: 100%; height: 26px; border-radius: 4px; transform-origin: left center; }
.site__h-bars i + i { width: 70%; }
.site__h-text {
  position: absolute;
  inset: 0;
  font-family: "Gilroy-SemiBold", sans-serif;
  font-size: 25px;
  line-height: 28px;
  letter-spacing: -0.01em;
  color: var(--ink);
  clip-path: inset(0 100% 0 0);
}

.site__p { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 18px; }
.site__p i { display: block; height: 9px; border-radius: 5px; }
.site__p i:nth-child(2) { width: 88%; }
.site__p i:nth-child(3) { width: 56%; }

.site__btn { width: 118px; height: 32px; margin-top: 20px; border-radius: 3px; }

.site__img { position: relative; flex: none; width: 210px; height: 196px; border-radius: 3px; overflow: hidden; }
.site__img-circle { position: absolute; left: 24px; top: 22px; width: 120px; height: 120px; border-radius: 50%; background: var(--pink); transform: scale(0); }
.site__img-diamond { position: absolute; right: 22px; bottom: 22px; width: 62px; height: 62px; background: var(--cream); transform: scale(0); }

.site__cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 24px; }
.site__cards i { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; height: 74px; padding: 12px; border-radius: 3px; }
.site__cards b { display: block; height: 6px; border-radius: 3px; background: rgba(34, 34, 34, 0.55); transform: scaleX(0); transform-origin: left center; }
.site__cards b + b { width: 60%; }
.site__slot { border: 1.5px dashed var(--wire); background-color: rgba(29, 69, 32, 0); }
.site__slot b { background: var(--cream); }

/* Search results card (SEO/GEO) */
.serp {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 330px;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(13, 60, 148, 0.3);
  opacity: 0;
}

.serp__search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 7px 0 14px;
  border-radius: 19px;
  background: var(--paper);
  color: var(--ink);
}
.serp__search i { flex: 1; max-width: 120px; height: 8px; margin-right: auto; border-radius: 4px; background: #c9c8c2; }
.serp__tag {
  padding: 7px 9px 6px;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-family: "Gilroy-SemiBold", sans-serif;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.12em;
}

.serp__list { display: flex; gap: 10px; margin-top: 10px; }
.serp__ranks { width: 20px; margin: 0; padding: 0; list-style: none; }
.serp__ranks li { height: 40px; margin-bottom: 4px; font-family: "Gilroy-SemiBold", sans-serif; font-size: 12px; line-height: 40px; text-align: center; color: #646464; }
.serp__rows { position: relative; flex: 1; height: 128px; }
.serp__row {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 10px;
  background-color: var(--paper);
}
.serp__row:nth-child(2) { top: 44px; }
.serp__row:nth-child(3) { top: 88px; }
.serp__row i { flex: none; width: 16px; height: 16px; border-radius: 4px; background-color: #c9c8c2; }
.serp__row b { flex: 1; max-width: 150px; height: 8px; border-radius: 4px; background: #d5d4ce; }
.serp__row--site i { background-color: var(--green); }
.serp__row--site span { font-family: "Gilroy-SemiBold", sans-serif; font-size: 13px; color: var(--ink); }

/* Module switches (IA & modules) */
.mods {
  position: absolute;
  right: 0;
  top: 118px;
  width: 268px;
  padding: 10px;
  border-radius: 18px;
  background: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  opacity: 0;
}
.mods__row { display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 8px 0 12px; }
.mods__row + .mods__row { border-top: 1px solid rgba(255, 255, 255, 0.09); }
.mods__row span { font-size: 13px; color: var(--cream); }
.mods__row i { position: relative; flex: none; width: 34px; height: 20px; border-radius: 10px; background-color: #505050; }
.mods__row i b { position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background-color: var(--cream); }

/* Shield and badges (Évolution & sécurité) */
.guard { position: absolute; inset: 0; pointer-events: none; }
.guard__shield {
  position: absolute;
  /* Centred on the mock page (.site is 640x450 at 40,40). */
  left: 300px;
  top: 205px;
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--pink);
  color: var(--green);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  transform: scale(0);
}
.guard__shield svg { width: 54px; height: 62px; }
.guard__pill {
  position: absolute;
  padding: 12px 17px 11px;
  border-radius: 20px;
  background: var(--cream);
  color: var(--green);
  font-family: "Gilroy-SemiBold", sans-serif;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  opacity: 0;
}
/* Either side of the shield, on its centre line (shield spans 300-420px, centre y 265px). */
.guard__pill--a { right: 474px; top: 248px; }
.guard__pill--b { left: 434px; top: 248px; }

/* ---------- Responsive (breakpoints follow the theme) ---------- */

@media (max-width: 1370px) {
  .offre__container, .build:not(.is-build) .build__panel { width: 1100px; }
  .pillar { padding: 52px 56px 56px; column-gap: 60px; }
  .build.is-build .build__panel { padding: 56px 50px 120px; }
  .build.is-build .build__progress { left: 50px; right: 50px; }
}

/* Small desktops and landscape tablets: rail labels and slide copy get tighter. */
@media (max-width: 1200px) {
  .build__progress span { letter-spacing: 0.14em; white-space: normal; }
  .build.is-build .pillar__text { font-size: 18px; line-height: 27px; }
}

/* Short desktop windows: tighten the first screen so the tiles keep a usable height. */
@media (min-width: 901px) and (max-height: 740px) {
  .offre__fold { padding-top: 150px; padding-bottom: 24px; }
  .deck { margin-top: 32px; }
  .deck__tile.is-open .deck__shape { transform: translate(-8px, 8px) scale(1.15); }
}

@media (max-width: 900px) {
  .offre__fold { display: block; height: auto; min-height: 0; padding: 150px 0 0; }
  .offre__br { display: none; }
  .offre__title { font-size: 38px; line-height: 46px; }
  .offre__intro { grid-template-columns: 1fr; gap: 28px; padding: 64px 0 80px; }
  .offre__lead { font-size: 24px; line-height: 33px; }
  .offre__intro-side { gap: 28px; }

  /* Tiles become a swipeable row, all open. */
  .deck {
    height: 230px;
    margin: 40px -15px 0;
    padding: 0 15px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .deck::-webkit-scrollbar { display: none; }
  .deck__tile, .deck__tile.is-open { flex: none; width: 240px; scroll-snap-align: center; border-radius: 20px; }
  .deck .deck__tile .deck__shape,
  .deck .deck__tile.is-open .deck__shape { transform: none; width: 120px; top: 18px; right: 18px; }
  .deck__tile .deck__name { opacity: 1; transform: none; font-size: 22px; left: 20px; bottom: 20px; }
  .deck__go, .deck__tag { display: none; }
  .offre__pillars { padding-bottom: 90px; }
  .build__copy { gap: 14px; }

  .pillar {
    grid-template-columns: 1fr;
    grid-template-areas: "label" "title" "text";
    row-gap: 22px;
    padding: 28px 24px 32px;
    border-radius: 20px;
  }
  .pillar h2 { font-size: 28px; line-height: 34px; margin-top: 26px; }
  .pillar__text { font-size: 18px; line-height: 27px; }
}

/* Theme footer: its right column (fixed 90px gap) runs past the window between
   roughly 780 and 930px wide. Let it wrap instead of widening the page. */
@media (max-width: 1000px) {
  .page-offre footer .info { flex-wrap: wrap; row-gap: 36px; }
  .page-offre footer .info .right-side { gap: 40px; }
}

/* Tablets: all five tiles fit side by side, so no swiping. */
@media (min-width: 601px) and (max-width: 900px) {
  .deck { height: 250px; margin: 40px 0 0; padding: 0; overflow: visible; }
  .deck__tile, .deck__tile.is-open { flex: 1 1 0; width: auto; }
  .deck .deck__tile .deck__shape,
  .deck .deck__tile.is-open .deck__shape { width: min(120px, calc(100% - 28px)); top: 14px; right: 14px; }
  .deck__tile .deck__name { left: 14px; right: 10px; bottom: 16px; font-size: 15px; line-height: 1.25; white-space: normal; }
}

@media (max-width: 550px) {
  .offre__title { font-size: 30px; line-height: 38px; }
  .offre__cta { font-size: 13px; letter-spacing: 0.24em; padding: 18px 22px; }
  .pillar__label { font-size: 11px; letter-spacing: 0.24em; }
}

@media (prefers-reduced-motion: reduce) {
  .deck__tile, .deck__tile * { transition: none !important; }
  .offre__cta, .offre__cta svg { transition: none; }
}
