/* Kainen public site (W-59, W-52b, W-52c, W-82; UX-3 round 3, MR-3 D1108–D1131, UX-5 D1214–D1228): plain, fast, no third-party fonts or scripts.
   W-292 (D1919–D1927, D2031–D2060) adds the three hero tabs, the Mapping slider and the case row; W-293 the Problems and Analytics stories and the As-Is / To-Be switch; W-294 the examples hub and template pages.
   W-82 draws the landing as the app (D1214): the app's tokens (copied from app/src/styles/theme.css; scripts/landing.test.mjs fails if they drift, D1215),
   a dot-grid canvas that scrolls with the page (D1222), floating top-bar pills, the hero map in app cards, white 12 px panels for the sections.
   WCAG AA contrast is checked by scripts/landing.test.mjs. The CSP allows no inline style, so everything lives here.
   Motion: 150 / 240 / 400 ms, cubic-bezier(0.2, 0, 0, 1), 12–16 px travel, transform and opacity only, once, never on text.
   Every page is written in its final state; `html.js` (set by lang.js only when motion is allowed) arms the start states, and with
   `prefers-reduced-motion: reduce`, without JavaScript, or when landing.js does not load, the finished page shows at once. */
:root {
  /* The app's tokens, same names and values as app/src/styles/theme.css (D1215). */
  --bg: #f8fafc; --surface: #ffffff; --soft: #eef2f6; --hover: #f1f5f9; --border: #e2e8f0; --border-2: #cbd5e1;
  --ink: #0f172a; --text: #1e293b; --text-3: #334155; --text-2: #475569; --muted: #5c6b80; --faint: #94a3b8; --on-accent: #ffffff;
  /* Steel blue (D1359+, docs/BRAND.md): the site moves first; the app follows with the ui brand pass, and the token test lists this one difference. */
  --accent: #2f5b8f; --accent-soft: #eef3f9; --accent-strong: #244a76; --accent-deep: #1b3a5e; --accent-line: #a9bfd9;
  --warn: #92400e; --warn-soft: #fffbeb; --warn-line: #fde68a; --danger: #b91c1c; --danger-soft: #fef2f2;
  --blue-tint-3: #d9dfe7; --brown-dark-2: #6b4f3a; --brown-mid-2: #9a6b4b;
  --ink-rgb: 15 23 42;
  --shadow: 0 1px 2px rgb(var(--ink-rgb) / 0.05), 0 2px 8px rgb(var(--ink-rgb) / 0.05);
  --shadow-lg: 0 8px 28px rgb(var(--ink-rgb) / 0.14);
  --r: 8px; --r-sm: 6px; --r-md: 10px; --r-pill: 999px;
  /* Site only: the 12 px radius of panels and floating bars (D1215, 727), the six type sizes (724) and the motion tokens (D1112). */
  --r-lg: 12px;
  --t-note: 14px; --t-small: 15px; --t-body: 17px; --t-lead: 20px; --t-h2: 28px; --t-h1: clamp(32px, 16px + 1.4vw, 44px);
  --m-fast: 150ms; --m-base: 240ms; --m-slow: 400ms; --ease: cubic-bezier(0.2, 0, 0, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; font: var(--t-body)/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--surface); }
a { color: var(--accent-strong); }
a:focus-visible, summary:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { color: var(--ink); }
.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem; z-index: 60; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn { display: inline-block; background: var(--ink); color: var(--on-accent); font-weight: 600; padding: .7rem 1.4rem; border-radius: var(--r-md); text-decoration: none; font-size: var(--t-body); border: 1px solid var(--ink); cursor: pointer; white-space: nowrap; transition: background-color var(--m-fast), border-color var(--m-fast); }
.btn:hover { background: var(--text); border-color: var(--text); }
.btn.small { padding: .4rem .85rem; font-size: var(--t-small); }
.link-arrow { margin-left: 1.1rem; font-weight: 600; }
/* Lucide shapes inlined, 16 px in chips and 20 px large, stroke 1.75, grey (730, 731) */
.ico { flex: none; width: 16px; height: 16px; stroke: var(--text-2); fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ico.big { width: 20px; height: 20px; }
figcaption { color: var(--muted); }
.tpl { font-weight: 600; } /* "Ouvrir ce modèle": opens the example's template in the app (?template=, D1117) */
figcaption { font-size: var(--t-note); margin-top: .6rem; }

/* Header of the legal and error pages */
header.top { border-bottom: 1px solid var(--border); background: rgb(255 255 255 / .94); position: sticky; top: 0; z-index: 5; }
header.top .wrap { display: flex; align-items: center; gap: 1.5rem; height: 60px; }
.brand { font-weight: 700; letter-spacing: .01em; color: var(--ink); text-decoration: none; font-size: var(--t-lead); margin-right: auto; }
nav.lang { font-size: var(--t-small); }

/* ---------- The landing: the app's canvas (D1214, D1222) ---------- */
body.landing { background-color: var(--bg); background-image: radial-gradient(var(--blue-tint-3) 1.2px, transparent 1.3px); background-size: 22px 22px; }

/* Top bar: the app's floating pills, kept at the top while scrolling (D1218). The bar itself is 0 px tall, so it covers nothing. */
header.bar { position: sticky; top: 12px; z-index: 20; height: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 0 14px; }
.pill { display: flex; align-items: center; gap: 16px; min-height: 48px; padding: 6px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); font-size: var(--t-small); white-space: nowrap; }
.pill a:not(.btn) { color: var(--text-2); text-decoration: none; padding: 6px 0; }
.pill a:not(.btn):hover { color: var(--ink); text-decoration: underline; }
.brand-pill .brand { margin: 0; color: var(--ink); }
.brand-pill .brand:hover { text-decoration: none; }
.tagline { padding-left: 14px; border-left: 1px solid var(--border); color: var(--text-2); }
.pill.end { padding: 6px 6px 6px 14px; gap: 12px; }

/* First screen: the map on the canvas, the side panel with the headline (D1214, D1217) */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 440px; grid-template-areas: "stage side"; min-height: 740px; border-bottom: 1px solid var(--border); }
.side { grid-area: side; background: var(--surface); border-left: 1px solid var(--border); padding: 100px 32px 32px; }
.stage { grid-area: stage; position: relative; min-width: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 96px 12px 40px; }
.scene { width: 100%; }
.scene-map { position: relative; display: flex; justify-content: center; }
.cap { align-self: stretch; margin: -8px 0 0; padding: 0 12px; color: var(--muted); font-size: var(--t-note); }
/* One picture per tab (D2031–D2036): Mapping is the map; Analytics is the same map with its analysis panel; Problems is the board. Without JavaScript all show. */
.ui .hero[data-tab="prob"] .scene-map, .ui .hero:not([data-tab="prob"]) .scene-prob { display: none; }
.ui .hero:not([data-tab="ana"]) .hero-map .ana { display: none; }
.ui .hero:not([data-tab="map"]) .ctl[data-for="map"], .ui .hero:not([data-tab="prob"]) .ctl[data-for="prob"], .ui .hero:not([data-tab="ana"]) .ctl[data-for="ana"] { display: none; }
.eyebrow { margin: 0 0 .5rem; color: var(--muted); font-size: var(--t-note); font-weight: 600; }
.hero h1 { font-size: var(--t-h1); line-height: 1.1; margin: 0 0 .8rem; letter-spacing: -.01em; text-wrap: balance; }
.lead { font-size: var(--t-lead); line-height: 1.45; color: var(--text-2); margin: 0 0 1.4rem; }
.cta { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem 0; }
.under { color: var(--muted); font-size: var(--t-note); margin: .9rem 0 0; }
.phone-only { display: none; }
.costfig { max-width: 28rem; margin-top: 1.8rem; border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px 12px; background: var(--bg); }
.fig-k { margin: 0; color: var(--muted); font-size: var(--t-note); }
.fig-v { margin: 2px 0 0; color: var(--ink); font-size: var(--t-h2); line-height: 1.25; font-weight: 700; font-variant-numeric: tabular-nums; }
.fig-y { margin: 0 0 10px; color: var(--text-2); font-size: var(--t-note); font-variant-numeric: tabular-nums; }
.fig-n { margin: 8px 0 0; color: var(--muted); font-size: var(--t-note); }
.fig-v.cause { font-size: var(--t-lead); line-height: 1.3; }

/* The three tabs (D1883–D1885, D2031): one-word labels under the call to action; each panel holds its H2, line, demo and final figure.
   Without JavaScript the tab buttons stay hidden and the three panels show one under the other. */
.tabs { display: none; gap: 4px; width: fit-content; margin: 1.6rem 0 0; padding: 3px; background: var(--soft); border-radius: var(--r-md); }
.ui .tabs { display: flex; }
.tabs [role="tab"] { min-height: 44px; padding: 0 16px; background: none; color: var(--text-2); border: 1px solid transparent; border-radius: var(--r); font: inherit; font-size: var(--t-small); font-weight: 600; cursor: pointer; transition: background-color var(--m-fast), color var(--m-fast), border-color var(--m-fast); }
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [aria-selected="true"] { background: var(--surface); color: var(--ink); border-color: var(--text-2); box-shadow: var(--shadow); }
.tabpanel { margin-top: 1.2rem; }
.tabpanel:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
html:not(.ui) .tabpanel + .tabpanel { border-top: 1px solid var(--border); padding-top: 1.2rem; }
.tabpanel h2 { font-size: var(--t-lead); line-height: 1.3; margin: 0 0 .3rem; }
.line { margin: 0; color: var(--text-2); font-size: var(--t-small); }
.tabpanel .costfig { margin-top: 1rem; }
/* The Mapping slider (D2047): card 4's work time, 5–30 min; the build writes its six results into the input's data. */
.demo { display: none; align-items: center; flex-wrap: wrap; gap: .2rem .8rem; margin: 1rem 0 0; font-size: var(--t-small); }
.ui .demo { display: flex; }
.demo label { flex: 1 0 100%; font-weight: 600; color: var(--text); }
.demo input { flex: 1 1 140px; min-height: 44px; margin: 0; accent-color: var(--text-2); cursor: pointer; }
.demo input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.demo output { min-width: 4.5em; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Hero map: one inline SVG of app cards; it shows the finished frame and landing.js plays the build-up twice. Read-only: no hover, normal cursor (D1219).
   It is a picture of the app (its <title> carries the content), drawn no narrower than 760 px so its text stays legible (D1384, D1386: a complete slice that ends at a phase boundary; a narrower stage shows its left part; a phone shows it as a swipe strip, D1882). */
.hero-map { display: block; flex: none; width: max(760px, 100%); max-width: 1304px; height: auto; cursor: default; }
.strip { display: contents; } /* the phone strip's scroller; wider screens lay the map out as before */
.swipe, .snap { display: none; }
@media (max-width: 1180px) { .stage { align-items: flex-start; } .scene-map { justify-content: flex-start; } }
/* Pause and Replay at the picture's top right (D2036); after the second play only Replay stays. */
.ctl { position: absolute; right: 16px; top: 72px; z-index: 2; display: flex; gap: 8px; }
.map-ctl, .demo-ctl { display: none; min-width: 44px; min-height: 44px; padding: .35rem .9rem; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow); font: inherit; font-size: var(--t-small); cursor: pointer; transition: border-color var(--m-fast); }
.js .map-ctl, .js .demo-ctl, .demo-ctl:not([hidden]) { display: block; } /* .demo-ctl (Problems, Analytics) stays with reduced motion: Replay then steps through the beats without movement (Y/N 1452) */
.map-ctl:hover, .demo-ctl:hover { border-color: var(--border-2); }
.map-ctl[hidden], .demo-ctl[hidden] { display: none !important; }

/* The Problems picture: the board's final frame (D1931), from the template's own board (W-290). The top cause has a word label and an ink frame, never colour alone. */
.scene-prob { max-width: 920px; padding: 20px 22px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.bq { margin: 0 0 14px; color: var(--ink); font-size: var(--t-lead); font-weight: 700; line-height: 1.3; }
.causes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; align-items: start; }
.bcause { padding: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); }
.bcause.top { padding: 11px; border: 2px solid var(--text); }
.first { margin: 0 0 2px; color: var(--ink); font-size: var(--t-note); font-weight: 700; }
.cn { margin: 0; color: var(--ink); font-size: var(--t-small); font-weight: 600; line-height: 1.35; }
.votes { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; color: var(--text-2); font-size: var(--t-note); font-variant-numeric: tabular-nums; }
.dots { display: flex; gap: 3px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
/* The five whys of the top cause (D1931 beat 3), a chain of short boxes */
.why { margin-top: 4px; }
.whys { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.whys li { position: relative; padding: 5px 9px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text); font-size: var(--t-note); line-height: 1.35; }
.whys li + li::before { content: "→"; position: absolute; left: -17px; top: 5px; color: var(--muted); }
/* The board's story (W-293, D1931, five beats; demos.js sets .armed and data-step 0–5; the markup is the final frame). Beat 1 notes appear
   scattered (--sx, --sy), beat 2 they slide under their causes (700 ms), 3 the whys, 4 votes and the top cause's ink frame and word label,
   5 the draft map (its cards start on the top cause's notes) while the other notes dim (Y/N 1453). */
.scene-prob [data-s], .scene-prob .bcause { transition: opacity var(--m-slow) var(--ease), transform var(--m-slow) var(--ease), background-color var(--m-base), border-color var(--m-base); }
.scene-prob li[data-s="1"] { transition-duration: var(--m-base), 700ms, var(--m-base), var(--m-base); transition-delay: var(--d, 0ms), 0ms, 0ms, 0ms; }
.scene-prob.armed [data-s]:not(.on) { opacity: 0; }
.scene-prob.armed:is([data-step="0"], [data-step="1"]) li[data-s="1"] { transform: translate(var(--sx, 0), var(--sy, 0)); }
.snap, .snap * { transition: none !important; } /* demos.js: the instant reset between plays and jumps to the final frame (Y/N 1451) */
.scene-prob.armed:is([data-step="0"], [data-step="1"]) .bcause { background-color: transparent; border-color: transparent; }
.scene-prob.armed:is([data-step="0"], [data-step="1"], [data-step="2"], [data-step="3"]) .bcause.top { padding: 12px; border-width: 1px; border-color: var(--border); }
.scene-prob.armed:is([data-step="0"], [data-step="1"]) .bcause.top { border-color: transparent; } /* no frame before the causes exist (beat 2) */
/* The dim is a colour step, not 30 % opacity (ui review: 30 % takes the notes to about 1.6:1; --muted keeps 5.4:1, AA) */
.scene-prob:not(.armed) .bcause:not(.top) li, .scene-prob.armed[data-step="5"] .bcause:not(.top) li { color: var(--muted); background: var(--soft); border-color: transparent; }
.draft li { transition: transform 700ms var(--ease), opacity var(--m-base) var(--ease); }

/* Analytics (W-293, D1932, three beats; demos.js sets data-ana 0–3 on the hero, absent = final frame): 1 heat tints, cost chips and the
   legend in words (Y/N 1455), 2 the analysis panel in the map's empty lower left (Y/N 1454) and its 12 bars, 3 the what-if savings. */
.ana .legend, .ana .apanel, .ana .wi, .ana .hb { transition: opacity var(--m-slow) var(--ease), transform var(--m-slow) var(--ease); }
.ana .hb { transform-box: fill-box; transform-origin: 50% 100%; transition-delay: calc(var(--i, 0) * 60ms); }
.hero[data-ana="0"] .hero-map .tint, .hero[data-ana="0"] .hero-map g.chip[data-beat="5"], .hero[data-ana="0"] .ana .legend { opacity: 0; }
.hero:is([data-ana="0"], [data-ana="1"]) .ana .apanel, .hero:is([data-ana="0"], [data-ana="1"], [data-ana="2"]) .ana .wi { opacity: 0; transform: translateY(12px); }
.hero:is([data-ana="0"], [data-ana="1"]) .ana .hb { transform: scaleY(0); }
/* The As-Is / To-Be switch (D1933, Y/N 1458): two pictures made at build time, the switch only alternates them, on the Analytics tab only.
   To-Be: card 3 (email) and its connectors go, card 2 enters the request in SAP, the histogram moves left. The text says which state shows. */
.hero-map .tb { display: none; }
.hero[data-tab="ana"][data-state="tobe"] .hero-map .tb { display: inline; }
.hero[data-tab="ana"][data-state="tobe"] .hero-map .as, .hero[data-tab="ana"][data-state="tobe"] .hero-map [data-c="3"] { display: none; }
.hero[data-tab="ana"][data-state="tobe"] .hero-map [data-c="2"] .tint { fill: #f4e9e0; } /* card 2 costs less in the To-Be: the lighter heat */
.seg { display: none; gap: 4px; width: fit-content; margin: 1rem 0 0; padding: 3px; background: var(--soft); border-radius: var(--r-md); }
.ui .seg { display: flex; }
.seg button { min-height: 44px; padding: 0 14px; background: none; color: var(--text-2); border: 1px solid transparent; border-radius: var(--r); font: inherit; font-size: var(--t-small); font-weight: 600; cursor: pointer; transition: background-color var(--m-fast), color var(--m-fast), border-color var(--m-fast); }
.seg button:hover { color: var(--ink); }
.seg [aria-pressed="true"] { background: var(--surface); color: var(--ink); border-color: var(--text-2); box-shadow: var(--shadow); }
.bcause ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bcause li { padding: 6px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text); font-size: var(--t-note); line-height: 1.35; }
.draft-k { margin: 18px 0 8px; color: var(--text-2); font-size: var(--t-note); font-weight: 600; }
.draft { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; counter-reset: draft; }
.draft li { position: relative; counter-increment: draft; padding: 8px 12px 8px 34px; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r); box-shadow: var(--shadow); color: var(--ink); font-size: var(--t-note); font-weight: 600; }
.draft li::before { content: counter(draft); position: absolute; left: 9px; top: 9px; width: 18px; height: 18px; border-radius: var(--r-sm); background: var(--text); color: var(--on-accent); font-size: var(--t-note); font-weight: 700; line-height: 18px; text-align: center; }

/* Sections: #208's HTML, each framed as an app panel in a reading column on the canvas (D1220) */
section.block { padding: 5rem 0; }
.landing section.block { width: calc(100% - 48px); max-width: 1040px; margin: 28px auto 0; padding: 36px 0 40px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.landing .hero + section.block { margin-top: 56px; }
.landing section.block > .wrap { max-width: none; padding: 0 40px; }
h2 { font-size: var(--t-h2); line-height: 1.2; margin: 0 0 .7rem; letter-spacing: -.005em; }
h3 { font-size: var(--t-lead); line-height: 1.3; }
.intro { color: var(--text-2); margin: 0 0 2rem; max-width: 44rem; }
.intro.tight { margin-bottom: 1.2rem; }

/* The method (789, 790), folded into How it works behind « Voir comment une fiche est chiffrée » (D2037): four lines of arithmetic beside one sample step worked through with its real figures. No chart, no new colour. */
.method { margin-top: 1.6rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.method > summary { display: flex; align-items: center; width: fit-content; min-height: 44px; color: var(--accent-strong); font-weight: 600; cursor: pointer; }
.method .how { margin-top: 1.2rem; }
.how { display: grid; grid-template-columns: 1fr 1.15fr; gap: 2.5rem; align-items: start; }
.formulas { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.formulas h3 { margin: 0 0 .15rem; font-size: var(--t-body); }
.formulas p { margin: 0; color: var(--text-2); font-size: var(--t-small); }
.calc { border-collapse: collapse; width: 100%; font-size: var(--t-small); font-variant-numeric: tabular-nums; background: var(--surface); }
.calc th, .calc td { padding: .5rem .6rem; border: 0; border-bottom: 1px solid var(--border); text-align: right; background: none; }
.calc th:first-child { text-align: left; font-weight: 400; color: var(--text); }
.calc thead th { color: var(--ink); font-weight: 600; }
.calc thead th:first-child { font-weight: 700; }
.calc td:nth-child(2) { color: var(--text-2); white-space: nowrap; }
.calc tr.total th, .calc tr.total td { font-weight: 700; color: var(--ink); border-bottom: 0; border-top: 1px solid var(--border-2); }
.calc caption { caption-side: bottom; text-align: left; padding-top: .6rem; color: var(--muted); font-size: var(--t-note); }

/* How it works: three app cards with number badges */
.steps { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; counter-reset: step; }
.steps li { position: relative; counter-increment: step; border: 1px solid var(--border); border-radius: var(--r); padding: 1rem 1rem .9rem; background: var(--surface); box-shadow: var(--shadow); }
.steps li::before { content: counter(step); position: absolute; left: -9px; top: -10px; width: 22px; height: 22px; border-radius: var(--r-sm); background: var(--text); color: var(--on-accent); font-size: var(--t-note); font-weight: 700; line-height: 22px; text-align: center; }
.step-ico { display: inline-block; }
.steps h3 { margin: .4rem 0 .3rem; }
.steps p { margin: 0; color: var(--text-2); font-size: var(--t-small); }

/* The case row under the hero (D1920, D2050–D2052): the active tab's three examples in MR-4's order, each with its own size band.
   All nine cards are in the HTML; with JavaScript only the active tab's set shows. A page not built yet says so. */
.rowhead { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .4rem 1rem; }
.rowhead h2 { margin: 0; }
.more { font-weight: 600; }
.case-set h3 { margin: 1.1rem 0 .7rem; color: var(--text-2); font-size: var(--t-small); font-weight: 600; }
.cases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.case { position: relative; display: flex; flex-direction: column; padding: 1rem 1rem .9rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }
.case-k { margin: 0; color: var(--muted); font-size: var(--t-note); }
.case h4 { margin: .35rem 0 .15rem; color: var(--ink); font-size: var(--t-body); line-height: 1.3; }
.case-s { margin: 0; color: var(--text-2); font-size: var(--t-small); }
.case-go { margin: auto 0 0; padding-top: .8rem; font-size: var(--t-small); }
.case-go.soon { color: var(--muted); }

/* Before and after */
.ba { max-width: 46rem; }
.compare { width: 100%; border-collapse: collapse; font-size: var(--t-small); font-variant-numeric: tabular-nums; background: var(--surface); }
.compare th, .compare td { padding: .55rem .75rem; border: 0; border-bottom: 1px solid var(--border); text-align: right; background: none; }
.compare th:first-child { text-align: left; font-weight: 600; color: var(--text); }
.compare thead th { color: var(--muted); font-weight: 600; font-size: var(--t-note); }
.compare td.col-gain { font-weight: 700; color: var(--accent-strong); }
.compare caption { caption-side: bottom; text-align: left; padding-top: .6rem; color: var(--muted); font-size: var(--t-note); }

/* Trust: the facts as the app's chips */
.trust-row .facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.trust-row .facts li { display: flex; gap: .5rem; align-items: center; padding: .35rem .85rem .35rem .6rem; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg); color: var(--text); font-weight: 600; font-size: var(--t-small); }
.trust-links { margin: 1.2rem 0 0; font-size: var(--t-small); }
.trust-links a { margin-right: 1.2rem; }

/* FAQ */
.faq details { border-top: 1px solid var(--border); padding: 1rem 0; max-width: 46rem; }
.faq > .wrap > details:last-of-type, .faq .more > details:last-of-type { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; font-weight: 600; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: var(--t-lead); line-height: 1; transition: transform var(--m-fast) var(--ease); }
.faq details[open] > summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text-2); margin: .55rem 0 0; max-width: 44rem; }
.faq .more { border-top: 1px solid var(--border); padding: 0; }
.faq .more > summary { padding: 1rem 0; color: var(--accent-strong); }
.faq .more > details:first-of-type { border-top: 1px solid var(--border); }

/* The doorway (D1224, D1226–D1228): the shared app picture, blurred once, with one button on a frosted plate. Text sits only on the plate (5:1 or more). */
.landing section.block.final { background: none; border: 0; box-shadow: none; padding: 0; margin: 28px auto 72px; }
.landing section.block.final > .wrap { padding: 0; }
.door { position: relative; height: 380px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); box-shadow: var(--shadow); }
.pic, .frost-pic { position: absolute; inset: -24px; filter: blur(7px); }
.pic svg, .frost-pic svg { display: block; width: 100%; height: 100%; }
.plate { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100% - 32px)); padding: 22px 26px 18px; text-align: center; background: rgb(255 255 255 / .93); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.plate .wm { margin: 0; color: var(--text-2); font-weight: 700; font-size: var(--t-lead); }
.plate h2 { font-size: var(--t-lead); margin: .5rem 0 1rem; text-wrap: balance; }
.plate .note { margin: .7rem 0 0; color: var(--text-2); font-size: var(--t-small); }
.plate .note a { display: inline-block; padding: 4px 0; }
.plate .note.price { color: var(--text); }

/* The click frost (D1225): only with html.js (motion allowed); landing.js copies the doorway's picture in. Opacity and transform only. */
.frost { display: none; }
.js .frost { display: block; position: fixed; inset: 0; z-index: 50; overflow: hidden; background: var(--bg); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--m-base) var(--ease), visibility 0s linear var(--m-base); }
.frosting .frost { opacity: 1; visibility: visible; transition: opacity var(--m-base) var(--ease); }
.frost .plate { width: auto; min-width: 240px; transform: translate(-50%, -50%) scale(.97); transition: transform var(--m-base) var(--ease); }
.frosting .frost .plate { transform: translate(-50%, -50%); }
.frost-msg { margin: .4rem 0 0; color: var(--text-2); font-size: var(--t-small); }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 2.5rem 0; color: var(--muted); font-size: var(--t-small); background: var(--surface); }
.cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.cols h2 { font-size: var(--t-small); font-weight: 600; color: var(--muted); margin: 0 0 .6rem; } /* sentence-case labels (725) */
.cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.cols p { margin: .4rem 0 0; }
.cols .brand { display: inline-block; }

/* Legal and error pages */
main.page { padding: 2rem 0 3rem; }
main.page h1 { font-size: var(--t-h2); }
main.page .wrap { max-width: 52rem; }
main.page h2 { font-size: var(--t-lead); margin: 2rem 0 .5rem; }
main.page h3 { font-size: var(--t-body); margin: 1.4rem 0 .4rem; }
main.page ul, main.page ol { padding-left: 1.4rem; }
main.page li { margin: .25rem 0; }
.tablewrap { overflow-x: auto; margin: 1rem 0; }
table { border-collapse: collapse; width: 100%; font-size: var(--t-small); }
th, td { text-align: left; vertical-align: top; padding: .5rem .65rem; border: 1px solid var(--border); }
th { background: var(--bg); }
code { background: var(--soft); padding: 0 .25em; border-radius: var(--r-sm); font-size: .92em; }

/* Motion: start states exist only under html.js (motion allowed) and .playing; the markup is the finished state */
[data-reveal] { transition: opacity var(--m-slow) var(--ease), transform var(--m-slow) var(--ease); transition-delay: var(--d, 0ms); }
.js [data-reveal]:not(.in) { opacity: 0; transform: translateY(16px); }
.hero [data-beat] { transition: opacity var(--m-base) var(--ease), transform var(--m-base) var(--ease); }
.hero-map .tint { transition-duration: var(--m-slow); }
.hero .hero-map, .hero .costfig { transition: opacity var(--m-base) var(--ease); }
.hero.fade .hero-map { opacity: 0; }
.playing [data-beat]:not(.in) { opacity: 0; }
.playing g.card:not(.in), .playing g.chip:not(.in) { transform: translateY(12px); }
.playing path.conn { stroke-dasharray: 1; transition: stroke-dashoffset var(--m-slow) ease-in-out, opacity var(--m-fast); }
.playing path.conn:not(.in) { stroke-dashoffset: 1; }
.playing path.conn.in { stroke-dashoffset: 0; }
@media print {
  .js [data-reveal], .playing [data-beat], .playing g.card, .playing g.chip, .scene-prob [data-s], .scene-prob .draft li, .hero[data-ana] .ana *, .hero[data-ana] .hero-map .tint, .hero[data-ana] .hero-map g.chip { opacity: 1 !important; transform: none !important; }
  .playing path.conn { stroke-dashoffset: 0 !important; }
  .map-ctl, .demo-ctl, .frost, header.bar { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .map-ctl { display: none !important; } .frost { display: none !important; } * { transition-duration: 0s !important; animation-duration: 0s !important; transition-delay: 0s !important; } }

/* Layout breakpoints */
@media (min-width: 1800px) { .wrap { max-width: 80rem; } }
@media (max-width: 1180px) { .hero { grid-template-columns: minmax(0, 1fr) 380px; } .side { padding-left: 24px; padding-right: 24px; } .tagline { display: none; } }
@media (max-width: 900px) {
  nav.sections { display: none; }
  /* Phones and narrow windows: the panel first, then the map (D1221) */
  .hero { display: flex; flex-direction: column; min-height: 0; }
  /* The cost figure is revealed by the map's animation, which is below the fold on a phone: keep it in view so the hero has no blank gap (W-106). */
  .hero .costfig { opacity: 1 !important; }
  .side { border-left: 0; padding: 84px 24px 28px; }
  .stage { padding: 20px 12px 28px; border-top: 1px solid var(--border); }
  .ctl { top: 12px; right: 12px; }
  .landing section.block { width: calc(100% - 24px); padding: 28px 0 32px; }
  .landing section.block > .wrap { padding: 0 22px; }
  .steps, .how { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  header.bar { top: 8px; padding: 0 8px; }
  .pill { min-height: 44px; padding: 4px 10px; }
  .pill.end { padding: 4px 4px 4px 10px; }
  .side { padding: 72px 18px 24px; }
  /* The map as a swipe strip (D1882): drawn 1200 px wide (card titles 11 px), snap points per card column, a fade at the right edge and a
     « Glissez → » hint until the visitor scrolls it. Only the strip scrolls sideways; vertical page scroll is never held. */
  .stage { padding: 16px 0 24px; gap: 16px; }
  .js .stage, .ui .hero:is([data-tab="prob"], [data-tab="ana"]) .stage.demos { padding-top: 60px; } /* room for Pause/Replay (with reduced motion, the demos' Replay) */
  .ctl { top: 10px; right: 10px; }
  .scene-prob { width: calc(100% - 24px); margin: 0 12px; padding: 16px; }
  .scene-prob .bq { font-size: var(--t-body); }
  /* The case row as a sideways strip of 78 %-wide cards (D2051) */
  .cases { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 2px; padding: 2px 2px 8px; }
  .case { scroll-snap-align: start; }
  .strip { display: block; flex: 1 1 auto; min-width: 0; position: relative; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity; scroll-padding-inline: 12px; padding: 0 12px; scrollbar-width: none; }
  .strip::-webkit-scrollbar { display: none; }
  .strip:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .hero-map { width: 1200px; max-width: none; }
  .snap { display: block; position: absolute; top: 0; width: 1px; height: 1px; scroll-snap-align: start; }
  .scene-map { padding-bottom: 32px; }
  .scene-map::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 40px; background: linear-gradient(to right, rgba(248, 250, 252, 0), var(--bg)); pointer-events: none; transition: opacity var(--m-base); }
  .scene-map.at-end::after { opacity: 0; }
  .swipe { display: block; position: absolute; left: 18px; bottom: 4px; margin: 0; color: var(--muted); font-size: var(--t-note); transition: opacity var(--m-base); }
  .scene-map.swiped .swipe, .scene-map.at-end .swipe { opacity: 0; visibility: hidden; }
  .link-arrow { margin-left: 0; width: 100%; }
  .landing section.block > .wrap { padding: 0 16px; }
  .compare, .calc { font-size: var(--t-note); }
  .compare th, .compare td, .calc th, .calc td { padding: .5rem .35rem; }
  .calc td:nth-child(2) { white-space: normal; }
  .door { height: 420px; }
  .plate { padding: 18px 16px 14px; }
  .cols { grid-template-columns: 1fr; }
  .phone-only { display: block; }
}
@media (max-width: 400px) { .tabs { width: 100%; } .tabs [role="tab"] { flex: 1 1 auto; padding: 0 10px; } } /* « Cartographie · Problèmes · Analyse » fit 320 px */

/* The examples hub and the template pages (W-294, UX-13 §7–§8): the plain page shell of the legal pages, wider for the hub's grid. Filters reuse the .seg buttons. */
main.page.examples .wrap { max-width: 64rem; }
main.page.examples .lead { margin: .4rem 0 0; }
.crumb { margin: 0 0 .8rem; color: var(--muted); font-size: var(--t-note); }
.crumb a { color: var(--text-2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: .8rem 0 0; padding: 0; }
.label { padding: 2px 10px; background: var(--soft); border: 1px solid var(--border); border-radius: var(--r-pill); color: var(--text-2); font-size: var(--t-note); }
.muted { color: var(--muted); font-size: var(--t-small); }
.btn.quiet { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.btn.quiet:hover { background: var(--hover); border-color: var(--text-2); }
.js .filters, .filters.on { display: flex; }
.filters { display: none; flex-wrap: wrap; align-items: end; gap: 12px 20px; margin: 1.4rem 0 0; }
/* the filters need hub.js (.js is set by lang.js and the filters then do not jump in; without scripts the hub lists every example) */
.filters .seg { display: flex; margin: 0; flex-wrap: wrap; }
.filters .sector { display: grid; gap: 4px; color: var(--text-2); font-size: var(--t-note); font-weight: 600; }
.filters select { min-height: 44px; padding: 0 10px; background: var(--surface); color: var(--text); border: 1px solid var(--border-2); border-radius: var(--r); font: inherit; font-size: var(--t-small); }
.filters select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.count { margin: 1rem 0 .6rem; color: var(--text-2); font-size: var(--t-small); }
.hub-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hub-grid .ex[hidden] { display: none; }
.thumb { margin: -2px -2px .6rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.thumb svg { display: block; width: 100%; height: auto; }
.case h2, .case h3 { margin: .35rem 0 .15rem; color: var(--ink); font-size: var(--t-body); line-height: 1.3; }
.case h2 a, .case h3 a, .case h4 a { color: inherit; text-decoration: none; }
.case h2 a:hover, .case h3 a:hover, .case h4 a:hover { text-decoration: underline; }
.case-fig { margin: .5rem 0 0; color: var(--ink); font-size: var(--t-small); font-weight: 600; font-variant-numeric: tabular-nums; }
.empty { margin: 1.4rem 0; padding: 1.2rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); }
.empty p { margin: 0 0 .8rem; color: var(--text-2); }
.mapbox { overflow-x: auto; margin: .6rem 0; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.mapbox:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mapbox svg { display: block; width: auto; max-width: none; height: 380px; }
.dl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: .6rem 0 0; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tile { padding: 14px 16px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); }
.tile .fig-v { font-size: var(--t-lead); }
.tile .fig-y { margin-bottom: 0; }
.tobe { margin: .4rem 0; }
.cta2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 1.6rem 0 0; }
.related { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: .6rem 0 1rem; }
.related .case { padding: .8rem; }
@media (max-width: 900px) { .hub-grid, .related { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tiles { grid-template-columns: 1fr; } }
.dl .btn, .empty .btn { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 560px) { .hub-grid, .related { grid-template-columns: 1fr; grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; scroll-snap-type: none; padding: 0; } .mapbox svg { height: 300px; } .filters .seg button { padding: 0 10px; } }
@media print { .filters, .empty, .dl, .cta2 { display: none; } .mapbox { overflow: visible; } .mapbox svg { width: 100%; height: auto; } .case { break-inside: avoid; } }
