/* ==========================================================================
   CriCri Document Builder — site vitrine
   Couleurs tirées de l'icône : marine, orange du criquet, bleu des écrans.
   Orange = flexibilité, vert = sécurité.
   ========================================================================== */

:root {
  --orange: #f7941d;
  --yellow: #ffc21a;
  --red: #e8432f;
  --navy: #0d2552;
  --blue: #3d8bff;
  --green: #2bb673;
  --flex: var(--orange);
  --sec: var(--green);

  --radius: 16px;
  --radius-sm: 10px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "Cascadia Code", Consolas, "Courier New", monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

[data-theme="dark"] {
  --bg: #07142e;
  --bg-2: #0b1c3e;
  --surface: #10254d;
  --surface-2: #163061;
  --line: rgba(160, 190, 255, .15);
  --text: #eaf0fb;
  --muted: #9fb0cf;
  --accent: var(--orange);
  --accent-ink: #1b1204;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .7);
  --glass: rgba(10, 26, 58, .74);
  --page: #f4f1e8;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f6f4ef;
  --bg-2: #ece8df;
  --surface: #ffffff;
  --surface-2: #f2f0ea;
  --line: rgba(13, 37, 82, .13);
  --text: #0d2552;
  --muted: #56637f;
  --accent: #e27b00;
  --accent-ink: #ffffff;
  --shadow: 0 22px 50px -26px rgba(13, 37, 82, .4);
  --glass: rgba(255, 255, 255, .8);
  --page: #ffffff;
  --green: #17955a;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  font: 16px/1.6 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
[hidden] { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; }
h2 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -.01em; }
h3 { font-size: 20px; }
h4 { font-size: 17px; }
p { margin: 0 0 1em; }
em { font-style: normal; color: var(--accent); }

.wrap { width: min(1200px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.lead { font-size: 18px; color: var(--muted); max-width: 760px; }
.kicker { text-transform: uppercase; letter-spacing: .14em; font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 10px; }
.kicker--flex { color: var(--flex); }
.kicker--sec { color: var(--sec); }

/* ------------------------------------------------------------------ NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; gap: 24px; height: 64px; width: min(1240px, 100% - 32px); margin-inline: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 17px var(--font-display); white-space: nowrap; }
.brand img { border-radius: 9px; }
.brand b { color: var(--accent); font-weight: 700; }
.nav__links { display: flex; gap: 4px; margin-left: auto; }
.nav__links a { text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 15px; color: var(--muted); transition: color .2s, background .2s; }
.nav__links a:hover { color: var(--text); background: var(--surface-2); }
.nav__tools { display: flex; align-items: center; gap: 8px; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.lang button { background: none; border: 0; padding: 6px 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.icon-btn { background: none; border: 1px solid var(--line); border-radius: 9px; width: 38px; height: 34px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); }
[data-theme="dark"] .sun, [data-theme="light"] .moon { display: none; }
.nav__burger { display: none; }

/* ----------------------------------------------------------------- BOUTONS */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 20px; border-radius: 12px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 650; text-decoration: none; transition: transform .2s var(--ease), box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -12px var(--accent); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn--small { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.btn--download { font-size: 17px; padding: 14px 24px; background: linear-gradient(135deg, var(--orange), var(--yellow)); color: #1b1204; }
.btn--danger:hover { border-color: var(--red); color: var(--red); }
.download { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 26px 0 14px; }
.download small { color: var(--muted); }
.download small a { color: var(--accent); }

/* ------------------------------------------------------------------ HERO */
.hero { position: relative; padding: 70px 0 40px; overflow: hidden; }
.hero__bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(800px 500px at 78% 30%, rgba(247, 148, 29, .20), transparent 60%),
    radial-gradient(700px 500px at 10% 0%, rgba(61, 139, 255, .18), transparent 60%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 44px 44px;
  mask-image: linear-gradient(to bottom, #000 60%, transparent);
}
.hero__grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-block; padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; font-size: 13px; color: var(--muted); background: var(--surface); }
.hero h1 { font-size: clamp(44px, 6.4vw, 78px); letter-spacing: -.025em; margin: 18px 0 18px; }
.hero h1 em { background: linear-gradient(90deg, var(--orange), var(--yellow)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* Le criquet et ses fichiers */
.mascot { position: relative; height: 460px; display: grid; place-items: center; }
.mascot__img { width: 300px; height: 300px; border-radius: 44px; box-shadow: 0 30px 80px -20px rgba(247, 148, 29, .45), 0 0 0 1px var(--line); position: relative; z-index: 2; animation: bob 5s ease-in-out infinite; }
.mascot__rings { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; }
.mascot__rings i { position: absolute; width: 300px; height: 300px; border-radius: 50%; border: 2px solid var(--orange); opacity: 0; animation: ring 4.5s linear infinite; }
.mascot__rings i:nth-child(2) { animation-delay: 1.5s; }
.mascot__rings i:nth-child(3) { animation-delay: 3s; }
.mascot__in, .mascot__out { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.chip {
  position: absolute; display: flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 7px 12px; border-radius: 10px; font-size: 13px; font-family: var(--mono);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.chip b { font-family: var(--font); font-size: 11px; padding: 2px 6px; border-radius: 5px; background: var(--surface-2); color: var(--muted); }
.chip i { font-style: normal; font-family: var(--font); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--surface-2); }
.chip i.ok { background: rgba(43, 182, 115, .18); color: var(--green); }
.chip i.lock { background: rgba(61, 139, 255, .18); color: var(--blue); }
.chip--out b { background: var(--orange); color: #1b1204; }
.chip--in { left: -4%; animation: chipIn 6s var(--ease) infinite; }
.chip--in.c1 { top: 16%; }
.chip--in.c2 { top: 46%; animation-delay: 2s; }
.chip--in.c3 { top: 76%; animation-delay: 4s; }
.chip--out { right: -6%; animation: chipOut 6s var(--ease) infinite; }
.chip--out.c1 { top: 10%; animation-delay: 1s; }
.chip--out.c2 { top: 40%; animation-delay: 3s; }
.chip--out.c3 { top: 70%; animation-delay: 5s; }
@keyframes chipIn { 0% { transform: translateX(-30px); opacity: 0; } 12%, 40% { transform: translateX(0); opacity: 1; } 60% { transform: translateX(120px) scale(.6); opacity: 0; } 100% { opacity: 0; } }
@keyframes chipOut { 0% { transform: translateX(-120px) scale(.6); opacity: 0; } 20%, 55% { transform: translateX(0) scale(1); opacity: 1; } 75%, 100% { transform: translateX(30px); opacity: 0; } }
@keyframes ring { 0% { transform: scale(.9); opacity: .6; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-10px) rotate(1deg); } }

.stats { list-style: none; padding: 0; margin: 50px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stats li { background: var(--surface); padding: 20px 18px; text-align: center; }
.stats b { display: block; font: 700 30px var(--font-display); color: var(--accent); }
.stats span { font-size: 14px; color: var(--muted); }

/* --------------------------------------------------------------- SECTIONS */
.section { padding: 100px 0; position: relative; }
.section--alt { background: var(--bg-2); }
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.subhead { margin-top: 70px; font-size: 26px; }

/* --------------------------------------------------------------- POUR QUI */
.scale { margin-top: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.scale__tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.scale__tabs button { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px; background: none; border: 0; font-weight: 650; color: var(--muted); position: relative; transition: color .2s, background .2s; }
.scale__tabs button svg { width: 22px; height: 22px; }
.scale__tabs button + button { border-left: 1px solid var(--line); }
.scale__tabs button:hover { background: var(--surface-2); }
.scale__tabs button[aria-selected="true"] { color: var(--text); background: var(--surface-2); }
.scale__tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: -1px; height: 3px; border-radius: 3px; background: var(--accent); }
.scale__body { display: grid; grid-template-columns: 1.1fr 1fr; gap: 30px; padding: 34px; align-items: center; }
.scale__scene { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-height: 300px; display: grid; place-items: center; }
.scale__scene svg { width: 100%; height: auto; animation: fadeUp .5s var(--ease); }
.scale__text h3 { font-size: 26px; }
.scale__mode { margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.scale__mode b { color: var(--accent); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.sc .sc-dev rect, .sc .sc-dev path { stroke: var(--muted); stroke-width: 2; fill: var(--surface); }
.sc .sc-dev--mini rect { fill: var(--surface-2); }
.sc .sc-led { fill: var(--green); stroke: none; animation: blink 1.6s infinite; }
.sc .sc-label { fill: var(--muted); stroke: none; font: 600 12px var(--font); text-anchor: middle; }
.sc .sc-photo rect { fill: var(--surface-2); stroke: var(--muted); stroke-width: 2; }
.sc .sc-photo path { stroke: var(--blue); stroke-width: 2; }
.sc .sc-doc path { fill: var(--page); stroke: var(--orange); stroke-width: 2; }
.sc .sc-doc text { fill: var(--orange); stroke: none; font: 800 11px var(--font); text-anchor: middle; }
.sc .sc-wire { stroke: var(--orange); stroke-width: 2; stroke-dasharray: 5 6; opacity: .6; fill: none; }
.sc .sc-wire--soft { stroke: var(--blue); opacity: .45; }
.sc .sc-wire--net { stroke: var(--green); opacity: .45; }
.sc .sc-dot { fill: var(--orange); stroke: none; filter: drop-shadow(0 0 4px var(--orange)); }
.sc .sc-dot.sc-wire--soft { fill: var(--blue); filter: drop-shadow(0 0 4px var(--blue)); }
.sc .sc-dot.sc-wire--net { fill: var(--green); filter: drop-shadow(0 0 4px var(--green)); }
.sc .sc-gauge { stroke: var(--green); stroke-width: 3; fill: none; }
.sc .sc-needle { stroke: var(--orange); stroke-width: 2.5; transform-box: view-box; }
.sc-needle--a { animation: needleA 3s ease-in-out infinite; transform-origin: 332px 122px; }
.sc-needle--b { animation: needleB 3.6s ease-in-out infinite; transform-origin: 380px 122px; }
@keyframes needleA { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-50deg); } }
@keyframes needleB { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(45deg); } }
@keyframes blink { 50% { opacity: .3; } }

.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 30px; }
.checks li::before { content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: rgba(43, 182, 115, .18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232bb673' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat; }

/* ---------------------------------------------------------------- PILIERS */
.section--pillars h2 .amp { color: var(--muted); font-weight: 400; }
.pillars { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 34px; }
.pillar {
  position: relative; display: block; text-decoration: none; padding: 38px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s;
}
.pillar::before { content: ""; position: absolute; inset: 0; opacity: .14; pointer-events: none; }
.pillar--flex::before { background: radial-gradient(500px 260px at 100% 0%, var(--flex), transparent 70%); }
.pillar--sec::before { background: radial-gradient(500px 260px at 100% 0%, var(--sec), transparent 70%); }
.pillar:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.pillar h3 { font-size: 30px; }
.pillar p { color: var(--muted); font-size: 17px; }
.pillar__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; margin-bottom: 22px; }
.pillar__icon svg { width: 34px; height: 34px; stroke-width: 2; }
.pillar--flex .pillar__icon { background: rgba(247, 148, 29, .16); color: var(--flex); }
.pillar--sec .pillar__icon { background: rgba(43, 182, 115, .16); color: var(--sec); }
.pillar__more { font-weight: 650; }
.pillar--flex .pillar__more { color: var(--flex); }
.pillar--sec .pillar__more { color: var(--sec); }

/* ------------------------------------------------------ DÉMO REGROUPEMENT */
.demo { margin-top: 40px; padding: 30px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.demo__head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.demo__head h3 { margin: 0; }
.demo__modes { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.demo__modes button { border: 0; background: none; padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.demo__modes button[aria-checked="true"] { background: var(--flex); color: #1b1204; }
.demo__desc { margin: 18px 0; color: var(--muted); min-height: 1.6em; }
.demo__files { display: flex; gap: 10px; font: 12px var(--mono); color: var(--muted); }
.demo__files span { border-bottom: 2px solid var(--line); padding-bottom: 4px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo__pages { display: grid; grid-template-columns: repeat(11, 1fr); gap: 10px; margin-top: 10px; }
.pg {
  position: relative; aspect-ratio: 3 / 4; border-radius: 6px; background: var(--page); border: 2px solid transparent;
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .5); display: grid; place-items: center; overflow: hidden;
  transition: border-color .35s, transform .35s var(--ease), opacity .35s; animation: pgIn .45s var(--ease) both; animation-delay: calc(var(--i) * 30ms);
}
@keyframes pgIn { from { transform: translateY(10px) scale(.94); opacity: 0; } }
.pg__n { position: absolute; top: 3px; left: 5px; font-size: 10px; color: #8c96a8; }
.pg__lines { width: 64%; height: 56%; background: repeating-linear-gradient(#c8cfdb 0 3px, transparent 3px 9px); }
.pg__bars { width: 70%; height: 32%; background: repeating-linear-gradient(90deg, #111 0 2px, transparent 2px 4px, #111 4px 5px, transparent 5px 8px); }
.pg__code { position: absolute; bottom: 14%; font: 700 8px var(--mono); color: #222; }
.pg__blank { font-size: 10px; color: #a4adbb; }
.pg--c0 { border-color: var(--orange); }
.pg--c1 { border-color: var(--blue); }
.pg--c2 { border-color: var(--green); }
.pg--c3 { border-color: #c06bff; }
.pg--removed { opacity: .35; transform: scale(.9); }
.pg__tag { position: absolute; bottom: 4px; font-style: normal; font-size: 9px; font-weight: 700; color: #fff; background: var(--red); padding: 1px 5px; border-radius: 4px; }
.demo__arrow { display: grid; place-items: center; color: var(--muted); margin: 14px 0; }
.demo__docs { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.gdoc { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 12px; background: var(--bg); border: 2px solid; font: 600 14px var(--mono); animation: pgIn .45s var(--ease) both; animation-delay: calc(var(--i) * 90ms + 150ms); }
.gdoc svg { width: 20px; height: 20px; }
.gdoc small { font-family: var(--font); color: var(--muted); font-weight: 400; }
.gdoc--c0 { border-color: var(--orange); } .gdoc--c0 svg { color: var(--orange); }
.gdoc--c1 { border-color: var(--blue); } .gdoc--c1 svg { color: var(--blue); }
.gdoc--c2 { border-color: var(--green); } .gdoc--c2 svg { color: var(--green); }
.gdoc--c3 { border-color: #c06bff; } .gdoc--c3 svg { color: #c06bff; }
.demo__note { margin: 20px 0 0; font-size: 14px; color: var(--muted); }

/* ------------------------------------------------------------------ CARTES */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px; }
.card { padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: transform .3s var(--ease), border-color .3s; }
.card:hover { transform: translateY(-3px); border-color: var(--flex); }
.card svg { width: 32px; height: 32px; color: var(--flex); margin-bottom: 14px; }
.card p { color: var(--muted); margin: 0; font-size: 15px; }

/* -------------------------------------------------------------- DÉCLENCHEURS */
.triggers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 20px; }
.trigger { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.trigger p { color: var(--muted); font-size: 15px; margin: 0; }
.trigger__viz { position: relative; height: 92px; margin-bottom: 14px; border-radius: 12px; background: var(--bg); border: 1px dashed var(--line); overflow: hidden; }
.tf { position: absolute; left: 22%; top: 18px; width: 34px; height: 44px; border-radius: 4px; background: var(--page); box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .4); animation: drop 3.6s var(--ease) infinite; }
.tf::after { content: ""; position: absolute; inset: 9px 7px; background: repeating-linear-gradient(#c8cfdb 0 2px, transparent 2px 6px); }
.tf--2 { left: 42%; animation-delay: .5s; }
.tf--3 { left: 62%; animation-delay: 1s; }
.tf--dir { left: 30%; top: 14px; width: 110px; height: 64px; background: var(--flex); border-radius: 6px; box-shadow: none; animation: none; }
.tf--dir::after { display: none; }
.tf--dir .tf { top: 10px; left: 14px; width: 30px; height: 40px; }
.tf--dir .tf--2 { left: 54px; }
.tf--sig { left: 64%; width: auto; height: auto; padding: 5px 8px; top: 30px; font: 700 12px var(--mono); color: #1b1204; background: var(--yellow); animation-delay: 1.4s; }
.tf--sig::after { display: none; }
@keyframes drop { 0% { transform: translateY(-80px); opacity: 0; } 20%, 80% { transform: none; opacity: 1; } 100% { transform: translateY(10px); opacity: 0; } }

/* ---------------------------------------------------------------- SÉCURITÉ */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; margin-top: 40px; }
.signflow { padding: 30px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.signflow p { color: var(--muted); }
.signflow__row { display: flex; align-items: center; gap: 8px; margin: 22px 0 16px; }
.sf { flex: none; padding: 12px 14px; border-radius: 12px; font-weight: 700; font-size: 14px; background: var(--surface-2); border: 2px solid var(--line); transition: border-color .3s, background .3s, color .3s; }
.sf--pdf { background: var(--page); color: var(--red); border-color: transparent; font-family: var(--mono); }
.sf__arrow { flex: 1; height: 2px; min-width: 12px; background: var(--line); position: relative; overflow: hidden; }
.sf__arrow::after { content: ""; position: absolute; inset: 0; background: var(--sec); transform: translateX(-100%); }
.signflow.play .sf__arrow:nth-of-type(1)::after { animation: wire .4s .0s forwards; }
.signflow.play .sf__arrow:nth-of-type(2)::after { animation: wire .4s .5s forwards; }
.signflow.play .sf__arrow:nth-of-type(3)::after { animation: wire .4s 1s forwards; }
@keyframes wire { to { transform: none; } }
.signflow[data-state="ok"] .sf--out { border-color: var(--sec); color: var(--sec); }
.signflow[data-state="ok"] .sf--step { border-color: var(--sec); }
.signflow:not([data-state="ok"]) .sf--out { border-color: var(--red); color: var(--red); background: rgba(232, 67, 47, .1); }
.signflow[data-state="nocert"] .sf--s1, .signflow[data-state="signed"] .sf--s1 { border-color: var(--red); }
.signflow[data-state="bad"] .sf--s1 { border-color: var(--sec); }
.signflow[data-state="bad"] .sf--s2 { border-color: var(--red); }
.signflow:not([data-state="ok"]).play .sf__arrow::after { background: var(--red); }
.signflow__msg { min-height: 3.2em; font-size: 15px; }
.signflow__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.shields { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.shields li { position: relative; padding: 18px 20px 18px 64px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.shields li::before { content: ""; position: absolute; left: 18px; top: 18px; width: 30px; height: 30px; border-radius: 9px; background: rgba(43, 182, 115, .16) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232bb673' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 4 6v6c0 4.5 3.4 8.3 8 9 4.6-.7 8-4.5 8-9V6l-8-3Z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E") center / 18px no-repeat; }
.shields b { display: block; margin-bottom: 4px; }
.shields span { color: var(--muted); font-size: 15px; }

/* ----------------------------------------------------------- ARCHITECTURE */
.section--arch { background:
  radial-gradient(900px 500px at 50% 40%, rgba(247, 148, 29, .08), transparent 70%), var(--bg); }
.arch { margin-top: 36px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.arch__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.arch__hint { margin-left: auto; font-size: 14px; color: var(--muted); }
.arch__stage { display: grid; grid-template-columns: 1fr 330px; }
.arch__svg { width: 100%; height: auto; padding: 10px; }
.arch__info { padding: 26px; border-left: 1px solid var(--line); background: var(--bg-2); min-height: 100%; transition: background .3s; }
.arch__info--crash { background: rgba(232, 67, 47, .08); }
.arch__info h3 { font-size: 22px; }
.arch__info p { color: var(--muted); font-size: 15px; }
.arch__step { color: var(--accent) !important; font-weight: 700; font-size: 13px !important; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; min-height: 1.2em; }
.arch__tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.arch__tags li { font-size: 12px; font-weight: 650; padding: 4px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); }
.arch--shake .arch__svg { animation: shake .4s 2; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.machine { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 6 6; opacity: .55; }
.machine__label, .net__label { fill: var(--muted); stroke: none; font: 700 13px var(--font); letter-spacing: .08em; text-transform: uppercase; }
.net__label { text-anchor: middle; font-size: 12px; fill: var(--green); }
.link { stroke: var(--muted); stroke-width: 2; opacity: .35; fill: none; transition: opacity .3s, stroke .3s, stroke-width .3s; }
.link--net { stroke: var(--green); stroke-dasharray: 7 6; opacity: .5; }
.link--on, .link--live { opacity: 1; stroke: var(--accent); stroke-width: 3; }
.link--net.link--on, .link--net.link--live { stroke: var(--green); }
.node { cursor: pointer; outline: none; }
.node rect { fill: var(--surface-2); stroke: var(--line); stroke-width: 1.5; transition: stroke .3s, fill .3s; }
.node:hover rect, .node:focus-visible rect { stroke: var(--accent); }
.node--active > rect { stroke: var(--accent); stroke-width: 3; }
.node__t { fill: var(--text); stroke: none; font: 700 15px var(--font-display); text-anchor: middle; }
.node__s { fill: var(--muted); stroke: none; font: 11.5px var(--font); text-anchor: middle; }
.node__ico { stroke: var(--accent); stroke-width: 2; }
.node--service > rect { fill: var(--surface); stroke: var(--orange); stroke-width: 2.5; }
.node--service .node__t { font-size: 18px; }
.service__glow { stroke: none; animation: glow 3s ease-in-out infinite; transform-origin: 90px 72px; transform-box: fill-box; }
@keyframes glow { 50% { opacity: .5; transform: scale(.92); } }
.node--monitor > rect, .node--fleet > rect { stroke: var(--green); stroke-dasharray: 5 4; }
.mini-gauge path { stroke: var(--green); stroke-width: 3; }
.mini-gauge line { stroke: var(--orange); stroke-width: 2.5; }
.mini-srv rect { fill: var(--surface); stroke: var(--muted); }
.node--ocr > rect { stroke: var(--blue); }
.node--out > rect { stroke: var(--sec); }
.node--done > rect { fill: rgba(43, 182, 115, .25); stroke-width: 3; }
.node--crashed > rect { fill: rgba(232, 67, 47, .35); stroke: var(--red); stroke-width: 3; }
.node--crashed .node__t { fill: var(--red); }
.node--crashed { animation: dim 1.3s forwards; }
@keyframes dim { 70% { opacity: 1; } 100% { opacity: .15; } }
.node--reborn { animation: reborn .5s var(--ease); }
.node--reborn > rect { stroke: var(--green); stroke-width: 3; }
@keyframes reborn { from { opacity: 0; } to { opacity: 1; } }
.packet { fill: var(--orange); filter: drop-shadow(0 0 6px var(--orange)); stroke: none; }
.packet--doc { fill: var(--yellow); }
.packet--page { fill: #ffffff; filter: drop-shadow(0 0 5px var(--blue)); }
.packet--text { fill: var(--blue); filter: drop-shadow(0 0 5px var(--blue)); }
.packet--signed { fill: var(--green); filter: drop-shadow(0 0 7px var(--green)); }
.packet--report { fill: #c06bff; filter: drop-shadow(0 0 5px #c06bff); }
.packet--enc { fill: var(--green); filter: drop-shadow(0 0 6px var(--green)); }
.packet--bad { fill: var(--red); filter: drop-shadow(0 0 8px var(--red)); }
.packet--dim { opacity: .55; }
[data-theme="light"] .packet--page { fill: var(--blue); }

/* ---------------------------------------------------------------- MONITEUR */
.split--monitor { margin-top: 70px; align-items: center; }
.h3big { font-size: 30px; }
.monitor { display: grid; gap: 12px; }
.host { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.host--small { padding: 12px 18px; box-shadow: none; }
.host__head { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 14px; }
.host__head small { margin-left: auto; font-family: var(--font); color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot--ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot--warn { background: var(--red); box-shadow: 0 0 8px var(--red); animation: blink 1.2s infinite; }
.gauges { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; }
.gauge { text-align: center; padding: 10px; border-radius: 12px; background: var(--bg); }
.gauge svg { width: 100%; max-width: 180px; margin: 0 auto; }
.gauge__track { stroke: var(--surface-2); stroke-width: 9; }
.gauge__arc { stroke: var(--green); stroke-width: 9; stroke-linecap: round; transition: stroke-dasharray 1.2s var(--ease), stroke .4s; }
.gauge__arc.hot { stroke: var(--red); }
.gauge__needle { stroke: var(--orange); stroke-width: 3; transition: transform 1.2s var(--ease); }
.gauge__hub { fill: var(--orange); stroke: none; }
.gauge span { display: block; font: 700 22px var(--font-display); }
.gauge small { color: var(--muted); font-size: 13px; }
.jobs { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; }
.jobs li { display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; align-items: center; }
.jobs progress { width: 100%; height: 8px; accent-color: var(--orange); }

/* ------------------------------------------------------------ INSTALLATION */
.types { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 34px; }
.type { position: relative; padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.type svg { width: 36px; height: 36px; color: var(--accent); margin-bottom: 14px; }
.type p { color: var(--muted); }
.tag { display: inline-block; font-size: 13px; font-weight: 650; padding: 4px 12px; border-radius: 99px; background: rgba(247, 148, 29, .15); color: var(--accent); }
.install { margin: 30px 0 18px; padding-left: 22px; display: grid; gap: 8px; }
.notice { padding: 16px 20px; border-radius: 12px; background: rgba(255, 194, 26, .1); border: 1px solid rgba(255, 194, 26, .35); font-size: 15px; }

/* -------------------------------------------------------------------- CTA */
.section--cta { background: linear-gradient(135deg, rgba(247, 148, 29, .14), rgba(61, 139, 255, .10)), var(--bg); }
.cta { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: center; }
.cta img { border-radius: 32px; box-shadow: var(--shadow); }
.cta .download { margin-top: 18px; }
.cta a:not(.btn) { color: var(--accent); }

/* ----------------------------------------------------------------- FOOTER */
.footer { padding: 40px 0; border-top: 1px solid var(--line); }
.footer__inner { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer p { margin: 0 0 6px; }
.footer__links { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.footer__links a { color: var(--muted); text-decoration: none; font-size: 15px; }
.footer__links a:hover { color: var(--accent); }

/* ------------------------------------------------------------- RESPONSIVE */
@media (max-width: 1080px) {
  .nav__links { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; padding: 10px 16px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .nav__links.open { display: flex; }
  .nav__burger { display: grid; }
  .nav__tools { margin-left: auto; }
  .arch__stage { grid-template-columns: 1fr; }
  .arch__info { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .hero__grid, .scale__body, .split, .pillars, .types, .cta { grid-template-columns: 1fr; }
  .mascot { height: 400px; }
  .mascot__img { width: 230px; height: 230px; }
  .mascot__rings i { width: 230px; height: 230px; }
  .chip--in { left: 0; } .chip--out { right: 0; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .cards, .triggers { grid-template-columns: 1fr 1fr; }
  .demo__pages { grid-template-columns: repeat(6, 1fr); }
  .demo__files { display: none; }
  .cta img { width: 120px; height: 120px; }
}
@media (max-width: 600px) {
  .section { padding: 70px 0; }
  .brand span { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .cards, .triggers { grid-template-columns: 1fr; }
  .scale__tabs button span { font-size: 13px; }
  .scale__tabs button svg { display: none; }
  .scale__body, .demo, .signflow, .pillar { padding: 20px; }
  .demo__pages { grid-template-columns: repeat(4, 1fr); }
  .signflow__row { flex-wrap: wrap; }
  .chip { font-size: 11px; }
  .arch__hint { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .chip { opacity: 1; }
}

/* Schéma : défilement horizontal sur les petits écrans plutôt qu'un schéma illisible. */
.arch__canvas { min-width: 0; }
@media (max-width: 700px) {
  .arch__canvas { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .arch__canvas .arch__svg { width: 760px; max-width: none; }
}
