/* =====================================================================
   Aurore : la palette et les interactions. Encre profonde, ivoire, et un dégradé
   froid et doux (glace, pervenche, lilas) utilisé avec parcimonie : un reflet sur
   les titres, un liseré sur les cartes, une lumière qui suit le curseur.
   Chargé après night.css.
   ===================================================================== */
:root {
  --bg: #07080c; --ink: #f3f1ec; --ink-2: #a9abb8; --ink-3: #6f7283;
  --line: rgba(220, 225, 255, .08); --line-2: rgba(220, 225, 255, .16);
  --paper: rgba(220, 225, 255, .03); --white: rgba(220, 225, 255, .05);
  --a1: #86e3ff; --a2: #8f9bff; --a3: #cbb0ff;
  --grad: linear-gradient(100deg, var(--a1), var(--a2) 50%, var(--a3));
  --green: #9cf0cb; --leaf: #7ee8b7; --green-soft: rgba(126, 232, 183, .12);
  --alert: #ff9d8a; --amber: #f4d58d; --amber-soft: rgba(244, 213, 141, .1);
  --navy: #c9cdea;
}
body { background: var(--bg); }

/* le ciel : trois nappes de lumière qui dérivent très lentement */
.aurora { position: fixed; inset: 0 0 -100vh 0; z-index: 0; overflow: hidden; pointer-events: none; will-change: transform; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .34; will-change: transform; }
.aurora i:nth-child(1) { width: 52vw; height: 52vw; left: 52%; top: -22vw; background: radial-gradient(circle, #3d58ff, transparent 65%); animation: drift1 38s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { width: 44vw; height: 44vw; left: -12vw; top: 28vh; background: radial-gradient(circle, #7a45e6, transparent 65%); opacity: .22; animation: drift2 46s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { width: 38vw; height: 38vw; left: 58%; top: 62vh; background: radial-gradient(circle, #1fb6d9, transparent 65%); opacity: .16; animation: drift1 54s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(-9vw, 7vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(10vw, -8vh) scale(1.2); } }
.aurora::after { content: ""; position: absolute; inset: 0; opacity: .5; mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E"); }
.spot { position: fixed; z-index: 0; left: 0; top: 0; width: 640px; height: 640px; margin: -320px 0 0 -320px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(143, 155, 255, .1), transparent 62%); transform: translate(var(--sx, 50vw), var(--sy, 30vh)); transition: opacity .4s; }
main, footer { position: relative; z-index: 1; }
.progress { position: fixed; z-index: 30; top: 0; left: 0; height: 2px; width: 100%; background: var(--grad); transform-origin: left; transform: scaleX(var(--p, 0)); }
[dir="rtl"] .progress { transform-origin: right; }

/* titres : un reflet qui traverse l'ivoire */
.hero h1, .closing h2 { background: linear-gradient(105deg, var(--ink) 0%, var(--ink) 42%, var(--a1) 62%, var(--a2) 80%, var(--a3) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .08em; }
.label { color: var(--ink-3); } .label b { color: var(--ink); }
.scroll-hint { border-image: var(--grad) 1; }

/* barre et boutons */
.nav.solid { background: rgba(7, 8, 12, .7); }
.nav .nav-cta, .btn { position: relative; background: var(--ink); color: #07080c; transition: transform .3s var(--ease), box-shadow .3s; }
.nav .nav-cta:hover, .btn:hover { background: #fff; color: #07080c; box-shadow: 0 0 0 1px rgba(255, 255, 255, .5), 0 8px 40px -6px rgba(143, 155, 255, .7); }
.langs button[aria-pressed="true"], .personas button[aria-selected="true"] { background: var(--ink); color: #07080c; }
.personas button:hover, .steps button:hover { border-color: var(--a2); }
.steps button[aria-selected="true"] { border-image: var(--grad) 1; color: var(--ink); }

/* verre : cartes à liseré, éclairées par le curseur */
.examples li, .card, .check, .rule, .road li { position: relative; }
.examples li, .card, .check { background: linear-gradient(180deg, rgba(220, 225, 255, .05), rgba(220, 225, 255, .015)); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); overflow: hidden; }
.glow::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(143, 155, 255, .16), transparent 60%); }
.glow::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), var(--a1), var(--a2) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.glow:hover::before, .glow:hover::after { opacity: 1; }
.examples li:hover { transform: translateY(-4px); border-color: var(--line); }
.examples time { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.examples p.result, .check b, .msg .verif b { color: var(--green); }
.rules { border-top-color: var(--line-2); }
.rule b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tag-live { color: var(--green); background: var(--green-soft); }
.tag-ready { color: var(--a1); background: rgba(134, 227, 255, .1); }
.road li:first-child::before { background: var(--leaf); box-shadow: 0 0 0 4px var(--green-soft), 0 0 16px var(--leaf); }
.card .who { color: var(--a1); background: rgba(134, 227, 255, .08); }

/* l'écran de Merlin : posé dans la lumière, il suit légèrement le curseur */
.frame { perspective: 1600px; background: none; padding: clamp(10px, 2.2vw, 28px); border-radius: 26px; position: relative; overflow: visible; }
.frame::before { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: radial-gradient(60% 80% at 20% 0%, rgba(61, 88, 255, .5), transparent 70%), radial-gradient(50% 70% at 90% 100%, rgba(140, 80, 240, .42), transparent 70%), radial-gradient(40% 60% at 70% 10%, rgba(31, 182, 217, .3), transparent 70%), #0b0d16;
  border: 1px solid var(--line-2); }
.app { background: rgba(9, 10, 16, .86); border: 1px solid var(--line-2); border-radius: 16px; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s var(--ease); box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .9); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.app-side { background: rgba(5, 6, 10, .6); }
.app-nav li:first-child { background: rgba(143, 155, 255, .12); }
.app-sys li::before { background: var(--leaf); box-shadow: 0 0 8px var(--leaf); }
.app-user i { background: var(--grad); color: #07080c; }
.ask { background: rgba(220, 225, 255, .04); border: 1px solid var(--line-2); transition: border-color .3s, box-shadow .3s; }
.ask:focus-within { border-color: var(--a2); box-shadow: 0 0 0 4px rgba(143, 155, 255, .12), 0 0 50px -10px rgba(143, 155, 255, .5); }
.ask button { background: var(--grad); color: #07080c; }
.chips button { background: rgba(220, 225, 255, .05); border: 1px solid var(--line); color: var(--ink-2); }
.chips button:hover { background: rgba(143, 155, 255, .14); color: var(--ink); border-color: var(--a2); }
.bar i { background: var(--grad); } .bar i.hot { background: linear-gradient(90deg, #ffb38a, var(--alert)); }
.draft { border-inline-start-color: var(--a2); }
.actions button.yes { background: var(--ink); color: #07080c; }
.typing i { background: var(--a2); }
.msg.you { background: rgba(143, 155, 255, .14); }

/* le récit : les systèmes se relient, la lumière circule vers Merlin */
.sys { background: rgba(14, 16, 26, .8); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: left .9s var(--ease), top .9s var(--ease), opacity .5s, border-color .4s, transform .3s; }
.sys:hover { border-color: var(--a2); }
.diagram[data-step="1"] .sys.trio { border-color: var(--alert); }
.diagram[data-step="3"] .sys i { background: var(--leaf); box-shadow: 0 0 10px var(--leaf); }
.diagram[data-step="3"] .wires line.spoke { stroke: var(--a2); stroke-opacity: .55; stroke-dasharray: 3 7; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: 20; } }
.hub { background: #07080c; color: var(--ink); border: 1px solid transparent; background-image: linear-gradient(#07080c, #07080c), var(--grad); background-origin: border-box; background-clip: padding-box, border-box; box-shadow: 0 0 60px -6px rgba(143, 155, 255, .7); }
.hub svg { color: var(--a1); }
.count b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand svg { color: var(--a1); }

/* ---------- défilement aimanté : chaque section vient se caler d'elle-même ---------- */
html { scroll-snap-type: y proximity; scroll-padding-top: 64px; }
.hero, .block, .closing { scroll-snap-align: start; }
.frame { scroll-snap-align: center; }
.story { scroll-snap-align: none; }
.story-text > div { scroll-snap-align: center; scroll-snap-stop: always; }
footer { scroll-snap-align: end; }

/* ---------- ordinateur portable : tout l'accueil tient dans l'écran ---------- */
.hero h1 { max-width: 15ch; font-size: clamp(40px, 5.4vw, 88px); }
.hero-grid { grid-template-columns: 1.35fr .85fr; }
@media (min-width: 901px) and (max-height: 860px) {
  .hero { padding-top: 104px; }
  .hero h1 { font-size: clamp(38px, 4.7vw, 70px); }
  .personas-row { margin-top: 44px; }
  .app { height: clamp(460px, 70vh, 620px); }
  .block { padding-top: clamp(72px, 11vh, 120px); }
  .head { margin-bottom: 38px; }
  .examples li { padding: 22px 22px 18px; }
  .story-text > div { min-height: 86vh; }
  .diagram { height: min(74vh, 560px); }
}
@media (min-width: 901px) and (max-width: 1280px) {
  :root { --pad: clamp(20px, 4vw, 56px); }
  .rules { grid-template-columns: repeat(3, 1fr); row-gap: 8px; }
  .split { grid-template-columns: 240px 1fr; }
  .sys { font-size: 13px; padding: 6px 12px 6px 7px; }
}

/* ---------- téléphone ---------- */
@media (max-width: 900px) {
  .spot { display: none; } .app { transform: none; } .story-stage { background: var(--bg); }
  .aurora i { filter: blur(60px); animation-duration: 60s; }
  .aurora i:nth-child(1) { width: 110vw; height: 110vw; left: 10%; top: -40vw; }
  .aurora i:nth-child(2) { width: 90vw; height: 90vw; left: -40vw; top: 45vh; }
  .aurora i:nth-child(3) { display: none; }
  .examples li, .card, .check, .app, .sys { backdrop-filter: none; -webkit-backdrop-filter: none; }
  html, body { overflow-x: clip; }
  .hero-grid { grid-template-columns: 1fr; gap: 20px; }
  .nav { padding: 10px var(--pad); }
  .nav nav { gap: 2px; } .langs { margin: 0 6px 0 0; }
  .hero { padding-top: 96px; padding-bottom: 24px; }
  .hero h1 { font-size: clamp(38px, 10.6vw, 60px); max-width: none; line-height: 1.02; }
  .lead { font-size: 17px; max-width: none; }
  .scroll-hint { margin-top: 20px; }
  /* les sièges défilent du doigt, sur une seule ligne */
  .personas-row { margin: 36px calc(var(--pad) * -1) 12px; padding: 0 var(--pad); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .personas-row::-webkit-scrollbar { display: none; }
  .personas { flex-wrap: nowrap; } .personas button, .personas-row .muted { white-space: nowrap; flex: none; }
  .frame { padding: 8px; border-radius: 20px; margin: 0 -8px; }
  .app { height: min(74svh, 620px); border-radius: 14px; }
  .app-main { padding: 0 14px 14px; }
  .greet { font-size: 26px; margin-bottom: 18px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; margin-inline: -14px; padding-inline: 14px; max-width: none; }
  .chips::-webkit-scrollbar { display: none; } .chips button { white-space: nowrap; flex: none; }
  .msg.merlin { font-size: 15px; } .msg table { font-size: 12.5px; } .msg th, .msg td { padding: 7px 8px; } .bar { min-width: 44px; }
  .ask input { font-size: 16px; }
  .caption { font-size: 12.5px; padding: 0 8px; }
  /* le récit : le schéma reste en haut, le texte passe dessous */
  .story { padding-top: 10px; gap: 0; }
  .story-stage { top: 52px; height: 44svh; }
  .diagram { height: 38svh; }
  .sys { font-size: 10.5px; padding: 3px 8px 3px 4px; gap: 4px; } .sys i { width: 6px; height: 6px; margin: 0 3px; }
  .hub { padding: 8px 14px 8px 11px; font-size: 16px; }
  .story-text > div { min-height: 56svh; justify-content: flex-start; padding-top: 28px; scroll-snap-align: none; }
  .story-text h2 { font-size: 30px; margin-bottom: 12px; } .story-text p { font-size: 16.5px; }
  .block { padding-top: 76px; } .head { margin-bottom: 30px; }
  h2 { font-size: clamp(30px, 8.4vw, 44px); }
  .examples { gap: 10px; } .examples li { padding: 20px; } .examples li:hover { transform: none; }
  .steps { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad) 4px; }
  .steps::-webkit-scrollbar { display: none; } .steps button { white-space: nowrap; flex: none; }
  .steps button[aria-selected="true"] { background: var(--ink); color: #07080c; border: 1px solid var(--ink); border-image: none; }
  .card { padding: 22px; } .card h3 { font-size: 24px; } .card li { font-size: 15px; padding: 10px 0; }
  .rule { padding: 20px 0 4px; border-top: 1px solid var(--line); } .rules { border-top: 0; }
  .road li { padding-top: 24px; }
  .closing { padding: 90px var(--pad); } .closing h2 { font-size: clamp(34px, 9.6vw, 52px); }
  .btn { padding: 15px 24px; }
  footer { flex-direction: column; align-items: flex-start; gap: 8px; }
  /* sur téléphone, seules les grandes sections s'aimantent */
  html { scroll-snap-type: y proximity; scroll-padding-top: 56px; }
  .frame { scroll-snap-align: none; }
}
/* ---------- téléphone et tablette : le doigt et le clavier d'abord ---------- */
/* pas d'aimant : le défilement reste celui du téléphone */
.phone, .phone body { scroll-snap-type: none !important; }
.phone .hero, .phone .block, .phone .closing, .phone .frame, .phone .story-text > div, .phone footer { scroll-snap-align: none; scroll-snap-stop: normal; }
.phone { scroll-behavior: auto; }
/* un fond fixe et léger : ni flou, ni mouvement, ni grain à recalculer à chaque image */
.phone .aurora { inset: 0; transform: none !important; background: radial-gradient(120% 60% at 70% -10%, rgba(61, 88, 255, .34), transparent 60%), radial-gradient(90% 50% at -10% 60%, rgba(122, 69, 230, .2), transparent 60%); }
.phone .aurora i, .phone .aurora::after { display: none; }
.phone .nav.solid { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(7, 8, 12, .94); }
.phone .examples li, .phone .card, .phone .check, .phone .app, .phone .sys { -webkit-backdrop-filter: none; backdrop-filter: none; }
/* la démonstration n'est plus une fenêtre qui défile dans la page : elle fait partie de la page */
.phone .frame { transform: none; opacity: 1; perspective: none; }
.phone .app { height: auto; min-height: 0; transform: none; display: block; }
.phone .app-side { display: none; }
.phone .app-main { display: flex; flex-direction: column; padding: 18px 14px 16px; }
.phone .app-main.fresh { justify-content: flex-start; }
.phone .greet { order: 0; margin: 6px 0 16px; }
.phone .ask { order: 1; }
.phone .chips { order: 2; margin-top: 10px; }
.phone .feed { order: 3; overflow: visible; flex: none; padding: 18px 0 4px; max-height: none; }
.phone .ask input { font-size: 16px; padding: 8px 2px 12px; }
.phone .ask button { width: 40px; height: 40px; }
.phone .msg { max-width: none; } .phone .msg table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.phone .actions button { padding: 11px 16px; }
.phone .personas button, .phone .chips button, .phone .steps button { padding-block: 10px; }
.phone .reveal { filter: none; }
.phone .stage3d { touch-action: pan-y; }
@media (max-width: 420px) { .langs button { padding: 5px 8px; } .nav .nav-cta { padding: 8px 12px; font-size: 13px; } .brand { font-size: 21px; } }
@media (prefers-reduced-motion: reduce) { .aurora i { animation: none; } .app { transform: none; } html { scroll-snap-type: none; } }

/* =====================================================================
   Le mouvement. Une seule courbe pour tout : rapide au départ, très douce à l'arrivée.
   ===================================================================== */
:root { --expo: cubic-bezier(.22, 1, .36, 1); }

/* l'entrée : le signe se met au point, puis la page se lève */
.intro { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; transition: opacity .8s var(--expo), visibility 0s .8s; }
.intro svg { width: 54px; height: 54px; color: var(--a1); animation: focus 1s var(--expo) both; }
.intro.gone { opacity: 0; visibility: hidden; }
@keyframes focus { from { opacity: 0; filter: blur(14px); transform: scale(.6) rotate(-45deg); } to { opacity: 1; filter: none; transform: none; } }
.nav { opacity: 0; transition: opacity .9s var(--expo) .3s, background .3s, box-shadow .3s; }
.hero .label, .hero .lead, .hero .scroll-hint, .personas-row { opacity: 0; transform: translateY(18px); transition: opacity 1s var(--expo), transform 1s var(--expo); }
.hero h1 { clip-path: inset(0 0 100% 0); transform: translateY(46px); transition: clip-path 1.2s var(--expo) .05s, transform 1.2s var(--expo) .05s; }
.ready .nav, .ready .hero .label, .ready .hero .lead, .ready .hero .scroll-hint, .ready .personas-row { opacity: 1; transform: none; }
.ready .hero h1 { clip-path: inset(-10% -5% -15% -5%); transform: none; }
.ready .hero .lead { transition-delay: .35s; } .ready .hero .scroll-hint { transition-delay: .5s; } .ready .personas-row { transition-delay: .6s; }

/* l'écran de Merlin avance vers le lecteur à mesure qu'on descend */
.frame { --k: 1; transform: scale(calc(.9 + .1 * var(--k))) translateY(calc((1 - var(--k)) * 70px)); opacity: calc(.25 + .75 * var(--k)); transform-origin: 50% 0; will-change: transform; }
.frame.reveal { transition: none; filter: none; }

/* ce qui entre dans l'écran : net, lent à se poser, en cascade */
.reveal { opacity: 0; transform: translateY(34px); filter: blur(10px); transition: opacity 1s var(--expo), transform 1.1s var(--expo), filter 1s var(--expo); transition-delay: calc(var(--i, 0) * 80ms); }
.reveal.in { opacity: 1; transform: none; filter: none; }
.head.reveal { filter: none; transform: none; }
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
.w > span { display: inline-block; transform: translateY(110%); transition: transform 1s var(--expo); transition-delay: calc(var(--i) * 55ms); }
.head.in .w > span, .story-text > div.on .w > span { transform: none; }
.card li { opacity: 0; transform: translateX(-14px); animation: slide .7s var(--expo) forwards; animation-delay: calc(120ms + var(--i, 0) * 70ms); }
[dir="rtl"] .card li { transform: translateX(14px); }
@keyframes slide { to { opacity: 1; transform: none; } }

/* le bandeau des systèmes, qui défile sans fin */
.band { padding: 34px 0 0; text-align: center; overflow: hidden; }
.band .label { margin-bottom: 16px; }
.marquee { -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); direction: ltr; }
.marquee-track { display: inline-flex; align-items: center; gap: 26px; white-space: nowrap; animation: drift 46s linear infinite; font-size: 17px; color: var(--ink-2); }
.marquee-track span { font-family: var(--serif); font-size: 22px; color: var(--ink); opacity: .82; }
.marquee-track i { font-style: normal; color: var(--a2); }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes drift { to { transform: translateX(-33.333%); } }

/* les chiffres */
.stats { padding-top: clamp(70px, 10vh, 120px); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 clamp(18px, 3vw, 48px); }
.stat { border-top: 1px solid var(--line-2); padding-top: 22px; }
.stat b { display: block; font: 400 clamp(54px, 6.4vw, 96px)/1 var(--serif); letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; direction: ltr; text-align: start; }
.stat b small { font-size: .5em; }
.stat p { margin-top: 12px; font-size: 15.5px; max-width: 22ch; }

/* le signal de la démonstration : un point qui respire quand Merlin répond */
.pill b::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--leaf); margin-inline-end: 7px; box-shadow: 0 0 0 0 rgba(126, 232, 183, .6); animation: ripple 2.2s var(--expo) infinite; }
@keyframes ripple { to { box-shadow: 0 0 0 9px rgba(126, 232, 183, 0); } }
.btn, .nav .nav-cta, .personas button, .chips button { transition: transform .42s var(--expo), background-color .5s, color .3s, border-color .3s, box-shadow .4s; }
.btn:active, .nav .nav-cta:active, .chips button:active { transform: scale(.96); }

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); row-gap: 28px; }
  .frame { transform: scale(calc(.95 + .05 * var(--k))); opacity: calc(.4 + .6 * var(--k)); }
  .reveal { filter: none; transform: translateY(22px); }
  .marquee-track span { font-size: 19px; } .band { padding-top: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .intro { display: none; } .nav, .hero .label, .hero .lead, .hero .scroll-hint, .personas-row { opacity: 1; transform: none; }
  .hero h1 { clip-path: none; transform: none; } .frame { transform: none; opacity: 1; } .reveal { opacity: 1; transform: none; filter: none; }
  .w > span { transform: none; } .card li { opacity: 1; transform: none; animation: none; } .marquee-track { animation: none; }
}
