/* ==========================================================================
   Chapitres du parcours guidé par Nour (avalanche, démo, souveraineté, secteurs, étapes)
   DA : émeraude profond, or, cyan LED, Montserrat / Inter.
   ========================================================================== */
.chapter { position: relative; overflow: clip; }
.chapter h2 em, .contact-section h2 em { font-style: normal; color: var(--gold); }
.lead { font-size: clamp(17px, 1.35vw, 20px); line-height: 1.65; color: #d1dbd5; margin: 20px 0 0; max-width: 520px; }
.punch { font-family: var(--heading); font-size: clamp(20px, 1.8vw, 26px); font-weight: 700; letter-spacing: -.03em; line-height: 1.3; margin: 26px 0 0; max-width: 500px; }
.punch em { font-style: normal; color: var(--gold); }

/* Nour's place in the layout: an empty box he stands in (nour.js reads its position) */
.nour-slot { width: 170px; height: 250px; align-self: end; pointer-events: none; }
.chapter-grid { display: grid; gap: clamp(28px, 4vw, 60px); align-items: center; }
.chapter-grid.slot-right { grid-template-columns: 1fr 1fr 170px; }
.chapter-grid.slot-left { grid-template-columns: 170px 1fr 1fr; }
@media (max-width: 1099px) {
  .nour-slot { display: none; }
  .chapter-grid.slot-right, .chapter-grid.slot-left { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .chapter-grid.slot-right, .chapter-grid.slot-left { grid-template-columns: 1fr; }
}

/* ---------- 1. des postes entiers ---------- */
.postes { background: radial-gradient(ellipse at 62% 45%, #07332f 0%, transparent 60%), var(--page); }
.postes h2 { font-size: clamp(30px, 3vw, 46px); }
.postes .claims { margin-top: 22px; gap: 12px; }
.postes-next { margin-top: 26px; }
/* the hub: Nour at the centre, six positions around it, LED lines between (postes.js draws the lines and plays the loop) */
.postes-hub { position: relative; container-type: inline-size; justify-self: center; width: min(540px, 100%); aspect-ratio: 5 / 4; }
.hub-stage { position: absolute; inset: 0; transition: opacity .5s; }
.postes-hub.reset .hub-stage { opacity: 0; }
.hub-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hub-lines path { fill: none; stroke-linecap: round; }
.hub-lines .base { stroke: #2fb9c6; stroke-width: 1.5; opacity: .2; transition: opacity .6s; }
.hub-lines .base.on { opacity: .8; filter: drop-shadow(0 0 4px #2fe0f0); }
.hub-lines .pulse { stroke: #d8fdff; stroke-width: 3.5; stroke-dasharray: .22 2; opacity: 0; filter: drop-shadow(0 0 6px #2fe0f0); }
.hub-core { position: absolute; left: 50%; top: 50%; width: 27%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: radial-gradient(circle at 50% 38%, #0d4a44, #041d1b 72%); border: 1.5px solid #e6bb7899;
  box-shadow: 0 0 0 6px #031a19aa, 0 0 40px #2fe0f033, inset 0 0 24px #2fe0f022; transition: box-shadow .5s, border-color .5s; }
.hub-core::before { content: ""; position: absolute; inset: -11%; border-radius: 50%; border: 1px dashed #5fe6f566; animation: md-spin 26s linear infinite; }
.hub-core svg { width: 28%; fill: none; stroke: var(--gold); stroke-width: 7; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 4px #e6bb7888); }
.hub-count { margin: 3px 0 0; font: 800 clamp(18px, 6.4cqi, 32px)/1 var(--heading); color: #eef4ef; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hub-count b { color: #5fe6f5; transition: color .4s; }
.hub-core small { margin-top: 4px; max-width: 78%; font-size: clamp(8px, 1.9cqi, 10.5px); font-weight: 700; line-height: 1.25; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }
.hub-core.busy { box-shadow: 0 0 0 6px #031a19aa, 0 0 60px #2fe0f066, inset 0 0 30px #2fe0f044; }
.hub-core.done { border-color: var(--gold); box-shadow: 0 0 0 6px #031a19aa, 0 0 70px #e6bb7866, inset 0 0 30px #e6bb7833; }
.hub-core.done .hub-count b { color: var(--gold); }
.hub-node { position: absolute; left: var(--x); top: var(--y); width: 28%; transform: translate(-50%, -50%); padding: 2.2cqi 1.6cqi 1.9cqi; border-radius: 12px; text-align: center;
  background: #061f1de8; border: 1px solid #31534a; box-shadow: 0 10px 30px #0008; transition: border-color .4s, box-shadow .4s, background .4s; }
.hub-node b { display: block; font: 700 clamp(11px, 3.1cqi, 16px)/1.2 var(--heading); color: #e8efe9; white-space: nowrap; }
.hub-node span { display: block; margin-top: 3px; font-size: clamp(9.5px, 2.4cqi, 12.5px); color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-node em { display: inline-block; margin-top: 1.4cqi; padding: 1px 8px; border-radius: 99px; font-style: normal; font-size: clamp(9px, 2.1cqi, 11.5px); font-weight: 700;
  letter-spacing: .03em; color: #8fa39e; background: #ffffff10; transition: color .4s, background .4s; }
.hub-node em i { font-style: normal; }
.hub-node em i + i, .hub-node.on em i:first-child { display: none; }
.hub-node.on em i + i { display: inline; }
.hub-node.on { border-color: #5fe6f5; background: #072a27f2; box-shadow: 0 10px 30px #0008, 0 0 26px #2fe0f040; }
.hub-node.on em { color: #04201e; background: #5fe6f5; }
.hub-node::after { content: ""; position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%; transform: scale(0); transition: transform .45s var(--ease-out);
  background: #5fe6f5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m5 12 4 4L19 6' fill='none' stroke='%2304201e' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat;
  box-shadow: 0 0 10px #2fe0f0aa; }
.hub-node.on::after { transform: scale(1); }
.hub-node.pop { animation: hub-pop .5s var(--ease-out); }
@keyframes hub-pop { 0% { transform: translate(-50%, -50%) scale(.92); } 45% { transform: translate(-50%, -50%) scale(1.08); } 100% { transform: translate(-50%, -50%) scale(1); } }
/* narrow hub (phones): square, the positions a little wider, the core a little smaller */
@container (max-width: 420px) {
  .hub-stage { inset: 0; }
  .hub-node { width: 31%; border-radius: 10px; }
  .hub-node span { display: none; }
  .hub-core { width: 25%; }
}
@media (max-width: 520px) { .postes-hub { aspect-ratio: 1 / 1; } }

/* ---------- 2. l'exemple des e-mails : l'avalanche (the demo's mailbox, mirrored: the mails on the left) ---------- */
.avalanche { background: radial-gradient(ellipse at 30% 45%, #07332f 0%, transparent 60%), var(--page); }
.flood-grid { display: grid; grid-template-columns: 1.65fr 120px minmax(240px, .75fr); grid-template-areas: "mail slot copy"; gap: clamp(20px, 2.6vw, 40px); align-items: center; }
.flood-grid .chapter-copy { grid-area: copy; }
.flood-grid .nour-slot { grid-area: slot; width: auto; }
.flood-grid .webmail { grid-area: mail; }
.avalanche h2 { font-size: clamp(30px, 3vw, 46px); }
.avalanche .lead { font-size: clamp(15px, 1.2vw, 18px); }
.avalanche .punch { font-size: clamp(18px, 1.55vw, 23px); }

/* ---------- 2. la démo ---------- */
.demo { background: linear-gradient(180deg, var(--page), #04201d 20%, #04201d 80%, var(--page)); }
.demo-stage { padding-block: clamp(70px, 10vh, 120px); }
.demo-grid { display: grid; grid-template-columns: minmax(240px, .75fr) 120px 1.65fr; gap: clamp(20px, 2.6vw, 40px); align-items: center; }
.demo-copy h2 { font-size: clamp(30px, 3vw, 46px); }
.demo-grid .nour-slot { width: auto; }                 /* Nour stands in the middle column, never over the mailbox */
.demo-steps { list-style: none; padding: 0; margin: 28px 0 0; counter-reset: s; }
.demo-steps li { position: relative; padding: 12px 0 12px 46px; opacity: .38; transition: opacity .4s, transform .4s var(--ease-out); counter-increment: s; }
.demo-steps li::before { content: attr(data-n); position: absolute; left: 0; top: 12px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid #2fb9c6; color: #9cf9ff; font: 700 13px var(--heading); }
.demo-steps b { display: block; font: 700 17px/1.3 var(--heading); }
.demo-steps span { display: block; margin-top: 4px; font-size: 14px; line-height: 1.55; color: var(--soft); max-height: 0; overflow: hidden; transition: max-height .5s var(--ease-out); }
.demo[data-step="0"] .demo-steps li:nth-child(1), .demo[data-step="1"] .demo-steps li:nth-child(2),
.demo[data-step="2"] .demo-steps li:nth-child(3), .demo[data-step="3"] .demo-steps li:nth-child(4) { opacity: 1; transform: translateX(6px); }
.demo[data-step="0"] .demo-steps li:nth-child(1) span, .demo[data-step="1"] .demo-steps li:nth-child(2) span,
.demo[data-step="2"] .demo-steps li:nth-child(3) span, .demo[data-step="3"] .demo-steps li:nth-child(4) span { max-height: 80px; }
.demo[data-step="0"] .demo-steps li:nth-child(1)::before, .demo[data-step="1"] .demo-steps li:nth-child(2)::before,
.demo[data-step="2"] .demo-steps li:nth-child(3)::before, .demo[data-step="3"] .demo-steps li:nth-child(4)::before { background: #2fb9c6; color: #04201e; box-shadow: 0 0 16px #2fe0f088; }
.demo-progress { height: 3px; background: #1b3f3a; border-radius: 3px; margin-top: 18px; overflow: hidden; }
.demo-progress span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #2fe0f0, var(--gold)); transform-origin: left; transform: scaleX(var(--p, 0)); }


@media (max-width: 1099px) {
  .demo-grid { grid-template-columns: 1fr 1.2fr; }
  .flood-grid { grid-template-columns: 1.2fr 1fr; grid-template-areas: "mail copy"; }
}
@media (max-width: 860px) {
  .flood-grid { grid-template-columns: 1fr; grid-template-areas: "copy" "mail"; gap: 20px; }
  .demo-grid { grid-template-columns: 1fr; gap: 16px; }
  .demo-copy h2 { font-size: 26px; }
  .demo-steps { margin-top: 10px; }
  .demo-steps li { display: none; padding-block: 4px; }
  .demo[data-step="0"] .demo-steps li:nth-child(1), .demo[data-step="1"] .demo-steps li:nth-child(2),
  .demo[data-step="2"] .demo-steps li:nth-child(3), .demo[data-step="3"] .demo-steps li:nth-child(4) { display: block; transform: none; }
  .demo-steps li::before { top: 4px; }
}

/* ---------- 3. la souveraineté ---------- */
.sovereign { background: radial-gradient(ellipse at 35% 50%, #08403a 0%, transparent 55%), #041a19; border-block: 1px solid var(--line); }
.vault { position: relative; justify-self: center; width: min(420px, 100%); }
.vault svg { width: 100%; height: auto; display: block; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.vault .ring circle { stroke: #2fb9c6; stroke-width: 1.4; opacity: .7; }
.vault .ring { transform-origin: 200px 200px; }
.vault .r1 { animation: md-spin 60s linear infinite; }
.vault .r2 { animation: md-spin 34s linear infinite reverse; }
.vault .r3 circle { stroke: var(--gold); stroke-width: 2; opacity: .8; }
.vault .zellige path { stroke: var(--gold); stroke-width: 1.4; }
.vault .star path { stroke: #ffd79a; stroke-width: 3; filter: drop-shadow(0 0 6px #e6bb78); }
.vault .lock * { stroke: #9cf9ff; stroke-width: 3; filter: drop-shadow(0 0 6px #2fe0f0); }
.vault .packets circle { fill: #9cf9ff; filter: drop-shadow(0 0 5px #2fe0f0); }
.vault .packets { transform-origin: 200px 200px; animation: md-spin 12s linear infinite; }
.vault-label { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); margin: 0; white-space: nowrap; padding: 6px 14px; border-radius: 99px;
  border: 1px solid var(--gold); color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; background: #041a19; }
@keyframes md-spin { to { transform: rotate(360deg); } }
.claims { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 14px; }
.claims li { display: flex; gap: 14px; align-items: flex-start; }
.claims .icon { width: 22px; height: 22px; color: #04201e; background: #5fe6f5; border-radius: 50%; padding: 4px; stroke-width: 2.6; flex: none; box-shadow: 0 0 12px #2fe0f066; }
.claims b { display: block; font: 700 17px/1.3 var(--heading); }
.claims span { display: block; color: var(--soft); font-size: 15px; line-height: 1.55; margin-top: 2px; }
.slogan { margin: 30px 0 0; font: 800 clamp(24px, 2.4vw, 34px)/1.15 var(--heading); letter-spacing: -.04em; }
.slogan em { font-style: normal; color: var(--gold); }
.sovereign h2 { font-size: clamp(30px, 3vw, 46px); }

/* ---------- 4. les secteurs ---------- */
.sectors-head { max-width: 640px; }
.sector-grid { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.sector-grid li { position: relative; padding: 22px 20px; min-height: 150px; border-radius: 16px; background: #071e1d; border: 1px solid #31534a; overflow: hidden;
  transition: transform .35s var(--ease-out), border-color .3s, box-shadow .3s; }
.sector-grid li::before { content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 2px; background: linear-gradient(90deg, #2fe0f0, var(--gold));
  transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease-out); }
.sector-grid li:hover { transform: translateY(-4px); border-color: #5fe6f5; box-shadow: 0 0 30px #2fe0f022; }
.sector-grid li:hover::before, .sectors.in-view .sector-grid li::before { transform: scaleX(1); transition-delay: calc(var(--k) * 90ms); }
.sector-grid b { display: block; font: 700 18px/1.25 var(--heading); }
.sector-grid span { display: block; margin-top: 10px; color: var(--soft); font-size: 14px; line-height: 1.55; }
.sector-more { background: linear-gradient(150deg, #0e3d39, #072522) !important; border-color: var(--gold) !important; }
.sector-more b { color: var(--gold); }
@media (max-width: 1099px) { .sector-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .sector-grid { grid-template-columns: 1fr; } .sector-grid li { min-height: 0; } }

/* ---------- 5. les 3 étapes ---------- */
.steps-chapter { background: #041a19; border-block: 1px solid var(--line); }
.led-steps { position: relative; margin-top: 50px; }
.led-path { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 120px; overflow: visible; }
.led-path path { fill: none; stroke: #5fe6f5; stroke-width: 3; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--draw, 0)); filter: drop-shadow(0 0 6px #2fe0f0);
  vector-effect: non-scaling-stroke; }
.led-steps ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; position: relative; }
.led-steps li { padding-top: 92px; text-align: center; }
.led-steps .num { position: absolute; top: 34px; left: 50%; transform: translateX(-50%); width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: #04201e; border: 2px solid var(--gold); color: var(--gold); font: 800 20px var(--heading); box-shadow: 0 0 20px #e6bb7844; }
.led-steps li { position: relative; }
.led-steps b { display: block; font: 700 19px/1.3 var(--heading); }
.led-steps p { margin: 10px auto 0; max-width: 300px; color: var(--soft); font-size: 15px; line-height: 1.6; }
@media (max-width: 760px) {
  .led-path { display: none; }
  .led-steps ol { grid-template-columns: 1fr; gap: 10px; }
  .led-steps li { padding: 0 0 0 70px; text-align: left; min-height: 70px; }
  .led-steps .num { top: 0; left: 0; transform: none; }
  .led-steps p { margin: 6px 0 0; }
}

/* ---------- appel final + bouton flottant ---------- */
.contact-section h2 { font-size: clamp(32px, 3.3vw, 50px); }
.cta-float { position: fixed; left: 24px; bottom: 22px; z-index: 6; display: inline-flex; align-items: center; gap: 10px; padding: 13px 20px; border-radius: 99px;
  background: linear-gradient(122deg, #fae0a8 2%, #eac183 45%, #d9a75e); color: #11211d; font-weight: 700; font-size: 14px;
  box-shadow: 0 8px 30px #000a, 0 0 24px #e6bb7855; opacity: 0; transform: translateY(20px); pointer-events: none; transition: opacity .35s, transform .45s var(--ease-out); }
.cta-float.on { opacity: 1; transform: none; pointer-events: auto; }
.cta-float:hover { box-shadow: 0 8px 30px #000a, 0 0 34px #e6bb7888; }
@media (max-width: 730px) { .cta-float { left: 14px; bottom: 16px; padding: 12px 17px; font-size: 13px; } }

/* entrance */
.reveal-up { opacity: 0; transform: translateY(30px); transition: opacity .8s, transform .9s var(--ease-out); }
.reveal-up.in-view { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .vault .r1, .vault .r2, .vault .packets, .hub-core::before, .hub-node.pop { animation: none; }
  .reveal-up { opacity: 1; transform: none; }
  .demo { height: auto; }
  .demo-stage { position: static; height: auto; padding-block: 60px; }
}
.chapter-grid.slot-left .nour-slot { align-self: center; }
