/* devisbox.be — landing page, brand « Enveloppe » (indigo, lavande, corail;
   Sora + Fragment Mono, self-hosted). site.js only toggles classes;
   highlight positions live in shots.css (generated by scripts/site-shots.py). */

@font-face {
  font-family: "Sora";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(/fonts/sora-latin-wght-normal.woff2) format("woff2-variations");
}
@font-face {
  font-family: "Fragment Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/fonts/fragment-mono-latin-400-normal.woff2) format("woff2");
}

:root {
  --indigo: #2e2a6b;
  --indigo-hover: #24215a;
  --ink: #1c1a45;
  --mist: #f6f5fb;
  --lavender: #d9d4ff;
  --lavender-hover: #ccc5ff;
  --lavender-soft: #eceaff;
  --coral: #e4572e;
  --coral-text: #b83e1c;
  --muted: #5a5780;
  --line: #dedbf0;
  --track: #e6e3f5;
  --surface: #ffffff;
  --inverse-muted: #b5b0e6;
  --focus: #5b54d6;
  --shadow: 0 1px 2px rgb(28 26 69 / 0.06), 0 22px 48px -16px rgb(28 26 69 / 0.28);
  --sans: "Sora", system-ui, sans-serif;
  --mono: "Fragment Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font: 400 1rem/1.55 var(--sans);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
/* No orphan word or lone punctuation at the end of a title or paragraph. */
h1, h2, h3, dt { text-wrap: balance; }
p, dd, li { text-wrap: pretty; }
ol, ul { list-style: none; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: 90rem; margin-inline: auto; padding-inline: 1.5rem; }
@media (max-width: 40rem) { .wrap { padding-inline: 1rem; } }

.eyebrow { font: 400 0.8125rem/1.4 var(--mono); letter-spacing: 0; color: var(--muted); }
h2 {
  margin-top: 0.75rem;
  max-width: 44rem;
  font: 600 clamp(1.875rem, 4vw, 2.875rem)/1.1 var(--sans);
  letter-spacing: -0.035em;
}

/* ── Logo: envelope whose flap runs on into a tick ──────────── */
.mark { width: 1.75rem; height: 1.75rem; flex: none; fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }

/* ── Buttons: pills ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--indigo);
  color: #fff;
  font: 600 0.9375rem/1.2 var(--sans);
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms;
}
.btn:hover { background: var(--indigo-hover); }
.btn-sm { padding: 8px 16px; font-size: 0.875rem; }
.btn-lg { padding: 15px 26px; font-size: 1rem; }
.btn-ghost { background: var(--lavender); color: var(--ink); }
.btn-ghost:hover { background: var(--lavender-hover); }

/* ── Header ───────────────────────────────────────────────────── */
.top { position: sticky; top: 0; z-index: 20; background: rgb(246 245 251 / 0.94); border-bottom: 1px solid var(--line); }
@supports (backdrop-filter: blur(8px)) { .top { background: rgb(246 245 251 / 0.8); backdrop-filter: blur(10px); } }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); font: 600 1.25rem/1 var(--sans); letter-spacing: -0.04em; text-decoration: none; }
.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav-link { white-space: nowrap; font-size: 0.9375rem; color: var(--muted); text-decoration: none; transition: color 150ms; }
.nav-link:hover { color: var(--indigo); }
@media (max-width: 40rem) { .nav .hide-sm { display: none; } }

/* ── Hero ─────────────────────────────────────────────────────── */
.hero { padding-block: clamp(3rem, 8vw, 6rem) clamp(3.5rem, 7vw, 6rem); }
h1 {
  margin-top: 1rem;
  font: 600 clamp(2.875rem, 6.6vw, 5.5rem)/1.05 var(--sans);
  letter-spacing: -0.035em;
}
.hero-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 2rem 3rem; margin-top: 2rem; }
.lead { max-width: 40rem; font-size: clamp(1.0625rem, 1.7vw, 1.1875rem); color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 0.625rem; }

.window { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.window-bar { display: flex; align-items: center; gap: 6px; height: 2.25rem; padding-inline: 0.9rem; background: var(--mist); border-bottom: 1px solid var(--line); }
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.window-bar span { margin-left: 0.75rem; font: 400 0.75rem/1 var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hero-shot { margin-top: clamp(2.5rem, 6vw, 4rem); }
@media (prefers-reduced-motion: no-preference) {
  .hero-shot { animation: rise 900ms var(--ease) 150ms both; }
  .top .mark .mark-env, .top .mark .mark-tick { stroke-dasharray: 140; stroke-dashoffset: 140; }
  .top .mark .mark-env { animation: draw 900ms var(--ease) 200ms forwards; }
  .top .mark .mark-tick { animation: draw 700ms var(--ease) 900ms forwards; }
}
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ── Workflow ─────────────────────────────────────────────────── */
.flow { background: var(--surface); border-top: 1px solid var(--line); padding-block: clamp(4rem, 8vw, 6rem); }
.flow-head { padding-bottom: 2rem; }
.flow .wrap { max-width: 124rem; padding-inline: clamp(1rem, 3vw, 3rem); }
/* Section intro aligned with the hero text, not with the wide workflow. */
.flow .wrap.flow-head { max-width: 90rem; padding-inline: 1.5rem; }
.flow-head h2 { max-width: 62rem; }
@media (max-width: 40rem) { .flow .wrap.flow-head { padding-inline: 1rem; } }
.flow-body { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 2rem; }

.rail {
  --p: 0;
  position: sticky;
  top: calc(50vh - 4.5rem);
  align-self: start;
  display: grid;
  gap: 0.95rem;
  padding-left: 1.1rem;
  margin-top: calc(50vh - 9rem);
  font-size: 0.8125rem;
  color: var(--muted);
}
.rail::before, .rail::after { content: ""; position: absolute; left: 3px; top: 0.55rem; bottom: 0.55rem; width: 2px; background: var(--track); }
.rail::after { background: var(--indigo); transform-origin: top; transform: scaleY(var(--p)); transition: transform 400ms var(--ease); }
.rail li { position: relative; transition: color 200ms; }
.rail li::before {
  content: "";
  position: absolute;
  left: calc(-1.1rem - 1px);
  top: 0.4rem;
  z-index: 1;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line);
  transition: background-color 200ms, border-color 200ms, transform 200ms;
}
.rail li.is-done { color: var(--ink); }
.rail li.is-done::before { border-color: var(--indigo); background: var(--indigo); }
.rail li.is-active { color: var(--ink); font-weight: 600; }
.rail li.is-active::before { border-color: var(--indigo); background: var(--surface); transform: scale(1.3); box-shadow: 0 0 0 4px var(--lavender); }

/* Each step stays pinned, vertically centred under the header, while you
   scroll through it; then the next one takes its place. */
.step { min-height: 165vh; }
.step-pin {
  position: sticky;
  top: 4rem;
  height: calc(100vh - 4rem);
  display: grid;
  grid-template-columns: minmax(17rem, 0.5fr) minmax(0, 2fr);
  gap: clamp(2rem, 3vw, 3.5rem);
  align-items: center;
  padding-block: 3vh;
}
.stage .shot, .stage .window { margin-left: auto; max-width: calc((100vh - 4rem - 6vh - 2.5rem) * var(--ar, 1.7)); }
.shot-classement { --ar: 1.702; }
.shot-devis { --ar: 1.709; }
.shot-anom { --ar: 3.077; }
.shot-comp { --ar: 1.595; }
.shot-relance { --ar: 1.757; }
.stage .window { --ar: 1.9; }
.step-n { display: inline-block; padding: 3px 9px; border-radius: 999px; background: var(--lavender); font: 400 0.75rem/1.3 var(--mono); color: var(--indigo); }
.step h3 { margin-top: 0.9rem; font: 600 clamp(1.625rem, 2.4vw, 2.125rem)/1.15 var(--sans); letter-spacing: -0.03em; }
.step-text p { margin-top: 1rem; color: var(--muted); }
.step-text .muted { font-size: 0.9375rem; }
.stage figcaption { margin-top: 0.75rem; font: 400 0.75rem/1.4 var(--mono); color: var(--muted); text-align: right; }

@media (max-width: 64rem) {
  .flow-body { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .step { min-height: 0; padding-block: 2.5rem; border-top: 1px solid var(--line); }
  .step-pin { position: static; height: auto; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding: 0; }
}

/* Real screenshots with animated highlights: indigo = sure, coral = doubt. */
.shot { position: relative; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.shot img { border-radius: 13px; }
.hl { position: absolute; border: 2px solid var(--indigo); border-radius: 10px; box-shadow: 0 0 0 5px rgb(46 42 107 / 0.14); pointer-events: none; }
.hl b {
  position: absolute;
  left: -2px;
  bottom: calc(100% + 7px);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--indigo);
  color: #fff;
  font: 600 clamp(0.75rem, 0.75vw, 0.9375rem)/1.2 var(--sans);
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow: 0 8px 18px -8px rgb(28 26 69 / 0.5);
}
.hl-doubt { border-color: var(--coral); box-shadow: 0 0 0 5px rgb(228 87 46 / 0.16); }
.hl-doubt b { background: var(--coral-text); }

.shot-classement .hl-seuil b { bottom: auto; top: calc(100% + 7px); left: auto; right: -2px; }
.shot-classement .hl-valider b { left: auto; right: -2px; }

/* 4 · devis: a scan bar sweeps the PDF line table, then the fields frame up */
.scanband { position: absolute; pointer-events: none; }
.scanband i {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 14%;
  border-radius: 4px;
  background: linear-gradient(90deg, transparent, rgb(217 212 255 / 0.9), transparent);
  box-shadow: 0 0 22px rgb(91 84 214 / 0.45);
  opacity: 0;
}
.shot-devis .hl-d1, .shot-devis .hl-d2, .shot-devis .hl-d3 { border-width: 1.5px; box-shadow: none; background: rgb(217 212 255 / 0.28); }

/* 5 · anomalies: a bar on the left of each row, coral then indigo */
.shot-anom .hl { border: 0; border-left: 4px solid var(--coral); border-radius: 6px; box-shadow: none; background: rgb(228 87 46 / 0.07); }
.shot-anom .hl-a4 { border-left-color: var(--indigo); background: rgb(46 42 107 / 0.06); }

/* 6 · comparateur */
.shot-comp { overflow: hidden; }
.shot-comp .hl b { font-size: clamp(0.6875rem, 0.7vw, 0.875rem); }
.shot-comp .hl-c1 b { left: auto; right: -2px; }
.shot-comp .hl-c2 b { bottom: auto; top: 50%; left: auto; right: calc(100% + 8px); transform: translateY(-50%); }
.shot-comp .hl-c3 b { bottom: auto; top: calc(100% + 7px); left: auto; right: -2px; }

/* 7 · relance */
.toast {
  position: absolute;
  left: 50%;
  bottom: 7%;
  width: max-content;
  max-width: 88%;
  padding: 0.8rem 1.2rem 0.8rem 2.6rem;
  border-radius: 999px;
  background: var(--indigo);
  color: var(--inverse-muted);
  font-size: clamp(0.875rem, 0.85vw, 1rem);
  line-height: 1.35;
  box-shadow: 0 16px 34px -12px rgb(28 26 69 / 0.6);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast b { color: #fff; }
.toast::before {
  content: "";
  position: absolute;
  left: 1.15rem;
  top: 50%;
  width: 0.45rem;
  height: 0.8rem;
  margin-top: -0.5rem;
  border: solid var(--lavender);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* 1 · inbox (HTML, in the app's card style) */
.inbox { display: grid; gap: 8px; padding: 12px; background: var(--mist); }
.inbox li {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 1rem;
  padding: 14px 16px 14px 2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.in-from { font-weight: 600; font-size: 0.9375rem; }
.in-time { font: 400 0.75rem/1.6 var(--mono); color: var(--muted); }
.in-subj { grid-column: 1 / -1; font-size: 0.8125rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.in-att {
  position: relative;
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 0.5rem;
  padding: 0.2rem 0.65rem 0.2rem 1.5rem;
  border-radius: 999px;
  background: var(--lavender-soft);
  font: 400 0.75rem/1.5 var(--mono);
  color: var(--indigo);
}
.in-att::before { content: ""; position: absolute; left: 0.6rem; top: 0.4rem; width: 0.45rem; height: 0.6rem; border: 1.5px solid var(--indigo); border-radius: 1px; }
.inbox-new { border-color: var(--lavender) !important; box-shadow: 0 0 0 3px var(--lavender-soft); overflow: hidden; }
.dot { position: absolute; left: 0.85rem; top: 1.2rem; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }

/* 2 · reading */
.read { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.25rem; padding: 1.25rem; }
@media (max-width: 36rem) { .read { grid-template-columns: minmax(0, 1fr); } }
.read-mail { position: relative; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; font-size: 0.875rem; }
.read-meta { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); color: var(--muted); }
.read-meta + .read-meta { margin-top: 0.25rem; }
.read-meta .k { font: 400 0.75rem/1.9 var(--mono); }
.read-body { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--line); line-height: 1.6; }
.read-att { margin-top: 0.9rem; font: 400 0.75rem/1.4 var(--mono); }
.read-att span { color: var(--muted); }
mark { color: inherit; border-radius: 4px; padding-inline: 3px; background: linear-gradient(var(--lavender), var(--lavender)) no-repeat 0 0 / 100% 100%; }
.scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3.5rem;
  background: linear-gradient(transparent, rgb(217 212 255 / 0.35) 70%, rgb(91 84 214 / 0.55) 98%, transparent);
  pointer-events: none;
  opacity: 0;
}
.signals { display: grid; gap: 0.6rem; align-content: start; }
.signals li { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; font-size: 0.8125rem; color: var(--muted); line-height: 1.45; background: var(--surface); }
.sg-k { display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.2rem; font-weight: 600; color: var(--ink); }
.sg-k::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--indigo); }

/* ── Animations (only with the script, and only if motion is welcome) ── */
@media (prefers-reduced-motion: no-preference) {
  .js .step .hl, .js .step .toast, .js .signals li { opacity: 0; }
  .js .step .inbox-new { opacity: 0; max-height: 0; padding-block: 0; }
  .js .step mark { background-size: 0 100%; }

  .js .step.is-in .hl { animation: hl-in 520ms var(--ease) both; }
  .js .step.is-in .hl-seuil { animation-delay: 300ms; }
  .js .step.is-in .hl-auto { animation-delay: 1100ms; }
  .js .step.is-in .hl-valider { animation-delay: 2000ms; }

  .js .step.is-in .scanband i { animation: band 1500ms ease-in-out 200ms 2 both; }
  .js .step.is-in .hl-d1 { animation-delay: 1300ms; }
  .js .step.is-in .hl-d2 { animation-delay: 1600ms; }
  .js .step.is-in .hl-d3 { animation-delay: 1900ms; }
  .js .step.is-in .hl-dtot { animation-delay: 2700ms; }

  .js .step.is-in .shot-anom .hl { animation-name: bar-in; }
  .js .step.is-in .hl-a1 { animation-delay: 300ms; }
  .js .step.is-in .hl-a2 { animation-delay: 800ms; }
  .js .step.is-in .hl-a3 { animation-delay: 1300ms; }
  .js .step.is-in .hl-a4 { animation-delay: 1800ms; }

  .js .step.is-in .hl-c1 { animation-delay: 600ms; }
  .js .step.is-in .hl-c2 { animation-delay: 1400ms; }
  .js .step.is-in .hl-c3 { animation-delay: 2200ms; }

  .js .step.is-in .toast { animation: toast-in 600ms var(--ease) 900ms both; }

  .js .step.is-in .inbox-new { animation: arrive 700ms var(--ease) 400ms both; }
  .js .step.is-in .dot { animation: pulse 1.8s ease-out 1100ms infinite; }

  .js .step.is-in .scan { animation: scan 1800ms ease-in-out 200ms 2; }
  .js .step.is-in mark { transition: background-size 500ms var(--ease); background-size: 100% 100%; }
  .js .step.is-in .m1 { transition-delay: 700ms; }
  .js .step.is-in .m2 { transition-delay: 1200ms; }
  .js .step.is-in .m3 { transition-delay: 1900ms; }
  .js .step.is-in .signals li { animation: up 500ms var(--ease) both; }
  .js .step.is-in .sg1 { animation-delay: 1000ms; }
  .js .step.is-in .sg2 { animation-delay: 1500ms; }
  .js .step.is-in .sg3 { animation-delay: 2200ms; }

  /* CTA: the envelope is drawn, then its flap runs on into the tick. */
  .js .cta .mark .mark-env, .js .cta .mark .mark-tick { stroke-dasharray: 140; stroke-dashoffset: 140; }
  .js .cta.is-in .mark .mark-env { animation: draw 1100ms var(--ease) 100ms forwards; }
  .js .cta.is-in .mark .mark-tick { animation: draw 800ms var(--ease) 1000ms forwards; }
}

@keyframes hl-in { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes bar-in { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes band { 0% { opacity: 0; top: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { opacity: 0; top: 86%; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes arrive { from { opacity: 0; max-height: 0; padding-block: 0; } to { opacity: 1; max-height: 9rem; padding-block: 14px; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(228 87 46 / 0.5); } 100% { box-shadow: 0 0 0 10px rgb(228 87 46 / 0); } }
@keyframes scan { 0% { opacity: 0; transform: translateY(-3.5rem); } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(17rem); } }
@keyframes up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── Trust, CTA, footer ───────────────────────────────────────── */
.trust { padding-block: clamp(3.5rem, 8vw, 6rem); border-top: 1px solid var(--line); }
.grid { display: grid; gap: 1rem; margin-top: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.grid > div { padding: 22px 22px 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.grid dt { font: 600 1.0625rem/1.3 var(--sans); letter-spacing: -0.02em; }
.grid dd { margin-top: 0.5rem; color: var(--muted); font-size: 0.9375rem; }

.cta { background: var(--indigo); color: var(--mist); }
.cta-in { padding-block: clamp(4rem, 9vw, 6.5rem); text-align: center; }
.cta-mark { display: inline-flex; color: var(--mist); }
.cta-mark .mark { width: 4rem; height: 4rem; stroke-width: 4; }
.cta h2 { margin: 1.5rem auto 0; max-width: none; font-size: clamp(2.125rem, 5.4vw, 3.75rem); }
.cta p { margin: 1rem auto 2.25rem; color: var(--inverse-muted); font-size: 1.0625rem; }
.cta .btn { background: var(--lavender); color: var(--ink); }
.cta .btn:hover { background: #fff; }

.foot { border-top: 1px solid var(--line); font-size: 0.8125rem; color: var(--muted); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; padding-block: 1.75rem; }
.foot-brand { display: inline-flex; align-items: center; gap: 0.5rem; }
.foot-brand .mark { width: 1.1rem; height: 1.1rem; color: var(--ink); }

@media (max-width: 40rem) {
  .hl b { font-size: 0.625rem; padding: 0.2rem 0.5rem; }
  .toast { font-size: 0.75rem; padding: 0.55rem 0.9rem 0.55rem 2.1rem; }
}
