/* Certisia public site — the landing (`/`), install (`/download`) and legal pages the gateway serves to
   someone who has neither an account nor the app.

   Deliberately standalone: no build step, no framework, nothing off-origin. These pages must render for a
   first-time visitor on a phone with a bad connection, so they carry their own tokens instead of pulling
   the client bundle. The one webfont is Fraunces (OFL, `fraunces-OFL.txt`), self-hosted and used for
   display type only: body text is the device's own sans, readable at first paint whether or not the
   font has arrived (`font-display: swap`).

   The page is written for the people who will use the product — exporters, fishmongers, cheesemakers
   at Rungis — not for the people who build it. So it SHOWS the app rather than describing it: the
   phones below are drawn with the app's own tokens (`client/src/styles.css`), the chat is the chat the
   client meets, and every surface around them stays quiet enough for the phone to be the picture.

   THE THEMES. Two token sets, one layout, the app's two: light (white and the app's blue, below) and
   dark (the app's navy night, `dark.css`), selected by `data-theme` on <html>. theme.js writes it
   before the first paint — the visitor's choice, else the device's — and a page without the script
   stays light. The legal documents, which cannot run it, get the same choice from their stylesheet
   (`legal/legal.css`). The layout reads tokens only, so a theme is a palette, never a second page. */

@font-face {
  font-family: "Fraunces";
  src: url("/site/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* --- surfaces --- */
  --page: #ffffff;
  --page-2: #f3f7fb; /* the alternate band */
  --card: #ffffff;
  --card-2: #f7f9fc;

  /* --- ink --- */
  --ink: #0f2236;
  --ink-2: #33475c;
  --muted: #5b6b7c;
  --dim: #8795a3;
  --line: #e2e8ef;
  --line-soft: #d3dce6;

  /* --- the product's blues --- */
  --brand: #12395b; /* the app's navy: its rail, its mark, its « Confirmer » */
  --primary: #1f6fc5; /* the one filled button colour */
  --primary-hover: #185ea8;
  --primary-ink: #ffffff;
  --accent: #2a7cc9;
  --accent-ink: #1e6cb0; /* links, eyebrows, numerals */
  --accent-soft: #e7f1fa;
  --hl: #1f6fc5; /* the second, coloured half of a heading */

  /* --- touches --- */
  --warm: #f2b544;
  --warm-soft: #fff3d6;
  --warm-ink: #8a6100;
  --warm-line: #eeddad;
  --ok: #2e7d46;
  --ok-soft: #e3f3e8;
  --ok-ink: #22653a;
  --bad: #c8412f;
  --bad-soft: #fbe9e6;
  --bad-ink: #9d3222;

  /* --- bands with their own ground --- */
  --hero-bg: linear-gradient(180deg, #f2f7fc 0%, #ffffff 78%);
  --glow: rgba(42, 124, 201, 0.2);
  --wave: #2a7cc9;
  --wave-alpha: 0.22;
  --contrast-bg: #12395b;
  --contrast-ink: #f2f6fa;
  --contrast-muted: #b9cadb;
  --contrast-hl: #f2b544;
  --lead-bg: linear-gradient(135deg, #12395b 0%, #1f6fc5 100%);
  --lead-ink: #ffffff;
  --lead-muted: #cfe0f1;
  --closing-bg: linear-gradient(150deg, #1f6fc5 0%, #12395b 100%);
  --closing-ink: #ffffff;
  --closing-muted: #d3e3f3;
  --foot-bg: #f3f7fb;
  --drudge-1: #f6dcd6;
  --drudge-2: #fbe9e6;
  --drudge-ink: #8e2f20;
  --free-bg: #e3f3e8;
  --free-ink: #22653a;
  --store-bg: #0e1620;
  --store-ink: #ffffff;

  /* --- the app inside the phones: its LIGHT theme, token for token --- */
  --app-bg: #eef2f6;
  --app-card: #ffffff;
  --app-card-2: #f7f9fb;
  --app-ink: #17222d;
  --app-muted: #6b7885;
  --app-line: #e3e7ec;
  --app-in: #ffffff;
  --app-in-line: #e3e7ec;
  --app-out: #4a76a8;
  --app-accent: #2a7cc9;
  --app-brand: #12395b;
  --app-brand-ink: #12395b;
  --app-ghost: #edf1f5;
  --app-ok: #2e7d46;
  --app-ok-soft: #e3f3e8;
  --app-warn-bg: #fff3d6;
  --app-warn-ink: #8a6100;
  --app-day: rgba(18, 57, 91, 0.08);
  --phone-frame: #0e1620;

  /* A white tick, for the app's filled checkboxes and chips (a data: URI is `img-src`-allowed). */
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.6 6.3 5 8.6 9.5 3.7' fill='none' stroke='white' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tick-navy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.6 6.3 5 8.6 9.5 3.7' fill='none' stroke='%2312395b' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  --sh-1: 0 1px 2px rgba(15, 34, 54, 0.06), 0 1px 1px rgba(15, 34, 54, 0.04);
  --sh-2: 0 12px 32px rgba(15, 34, 54, 0.12);
  --sh-3: 0 34px 80px rgba(15, 34, 54, 0.24);
  --sh-btn: 0 6px 18px rgba(31, 111, 197, 0.28);
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;

  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, ui-serif, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --w: 72rem; /* the wide measure — grids, cards */
  --w-text: 40rem; /* the reading measure */
  --top-h: 64px;
}

/* The dark palette is `dark.css`: the legal documents share it with these pages. */

/* --- base ------------------------------------------------------------------------------------------ */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-family: var(--display);
  font-weight: 620;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--card);
}

/* The coloured half of a heading: the part a visitor remembers. */
.hl {
  color: var(--hl);
  font-style: normal;
}

.eyebrow,
.kicker {
  margin: 0 0 14px;
  color: var(--accent-ink);
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lead {
  color: var(--ink-2);
  font-size: 1.16rem;
  line-height: 1.6;
}

/* --- buttons --------------------------------------------------------------------------------------
   Pills, like the app's own controls. One filled colour on the whole page: the way in. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 48px;
  padding: 0.7em 1.35em;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  border-color: var(--ink);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: var(--sh-btn);
}

.btn.primary:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
}

.btn-lg {
  min-height: 56px;
  padding: 0.8em 1.7em;
  font-size: 1.06rem;
}

.btn-sm {
  min-height: 40px;
  padding: 0.45em 1.05em;
  font-size: 0.93rem;
  box-shadow: none;
}

.btn.primary.btn-sm {
  box-shadow: none;
}

.btn-quiet {
  border-color: transparent;
  background: transparent;
}

.btn-quiet:hover {
  border-color: var(--line-soft);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

/* --- header ---------------------------------------------------------------------------------------- */

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--top-h);
  padding: 0 20px;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--page) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.top.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 6px 24px rgba(15, 34, 54, 0.06);
}

.top-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: var(--w);
  height: 100%;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.mark {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.nav {
  display: flex;
  gap: 26px;
  margin-right: auto;
}

.nav a {
  color: var(--ink-2);
  font-size: 0.95rem;
  font-weight: 550;
  text-decoration: none;
}

.nav a:hover {
  color: var(--accent-ink);
}

.actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

/* The theme switch — the app's: its sun/moon glyph shows the theme a press switches TO, and its words
   say it (read aloud in the header, printed in the footer). theme.js unhides it; a page without the
   script keeps it hidden, since it could do nothing there. A phone keeps it in the header too — most
   visitors read on one — at a size that leaves the two ways in their room. */
.theme-toggle {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  cursor: pointer;
}

.theme-toggle[hidden] {
  display: none;
}

.theme-toggle:hover {
  border-color: var(--line-soft);
  color: var(--ink);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle svg {
  flex: none;
  width: 18px;
  height: 18px;
}

.theme-name {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.theme-toggle-text {
  width: auto;
  height: auto;
  margin-top: 16px;
  padding: 0.45em 1em 0.45em 0.8em;
  border-color: var(--line-soft);
  font-size: 0.9rem;
  font-weight: 600;
}

.theme-toggle-text .theme-name {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
}

.theme-sun,
.to-light,
:root[data-theme="dark"] .theme-moon,
:root[data-theme="dark"] .to-dark {
  display: none;
}

:root[data-theme="dark"] .theme-sun {
  display: block;
}

:root[data-theme="dark"] .to-light {
  display: inline;
}

/* The other language: a plain link to the same page under `/en` (or back), drawn as the theme switch's
   neighbour. A link and not a control, so it works with every script blocked — and the footer repeats
   it in words, which is where a phone too narrow for it in the header still finds it. */
.lang {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}

/* With its flag (the English page's link to French), the pill widens to hold flag and letters. */
.lang:has(.flag) {
  gap: 6px;
  width: auto;
  padding: 0 12px 0 8px;
  border-color: var(--line-soft);
}

.lang .flag {
  flex: none;
  width: 21px;
  height: 14px;
  border-radius: 999px;
}

.lang:hover {
  border-color: var(--line-soft);
  color: var(--ink);
}

.lang:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The breakpoints below are MEASURED on the French header, the wider of the two: each is the width
   under which the row stops fitting, so the language link moved all of them when it joined the row.
   Change a label, a gap or a button and they are to be measured again. */
@media (max-width: 1000px) {
  .nav {
    display: none;
  }
}

/* A phone: the mark alone stands for the name, and the header's gaps close up so the theme switch and
   the two ways in still sit on one line — measured down to a 360px screen; the rare narrower one gives
   up the switch, which the footer still offers. The language link gives way first, under 397px: a
   phone that narrow keeps the theme switch, and finds the other language in the footer. */
@media (max-width: 600px) {
  .top-inner {
    gap: 12px;
  }

  .top .brand span {
    display: none;
  }
}

@media (max-width: 480px) {
  .top {
    padding: 0 12px;
  }

  .actions {
    gap: 4px;
  }

  .actions .btn-sm {
    padding: 0.45em 0.75em;
    font-size: 0.9rem;
  }

  .actions .btn-quiet {
    padding-inline: 0.5em;
  }

  .top .theme-toggle,
  .top .lang {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 396px) {
  .top .lang {
    display: none;
  }
}

@media (max-width: 359px) {
  .top .theme-toggle {
    display: none;
  }
}

/* --- bands ----------------------------------------------------------------------------------------- */

.band {
  padding: clamp(64px, 9vw, 120px) 20px;
  /* The header is sticky: a nav jump must not park the section's own title underneath it. */
  scroll-margin-top: var(--top-h);
  /* A picture's entrance (the stamp landing large, a card sliding in from the side) may pass the edge of
     a phone's screen; the band trims it rather than let the whole page pan sideways. `clip`, not
     `hidden`: it makes no scroll box, so the story's sticky phone still sticks. */
  overflow-x: clip;
}

.band-alt {
  background: var(--page-2);
}

.inner {
  max-width: var(--w);
  margin: 0 auto;
}

.narrow {
  max-width: 48rem;
}

.measure {
  max-width: var(--w-text);
  margin: 0 auto;
}

.head {
  max-width: 50rem;
  margin: 0 0 clamp(36px, 5vw, 56px);
}

.head.center {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.head h2,
.band h2 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.08;
}

.head .lead {
  margin: 0 auto;
  max-width: var(--w-text);
}

/* Things that arrive as they scroll into view. Visible by default: only a page whose script RAN hides
   them first (landing.js stamps `js` and adds `seen`), so a blocked script costs the motion, never
   the content. */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .reveal.seen {
  opacity: 1;
  transform: none;
}

/* --- the hero -------------------------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(40px, 7vw, 96px) 20px clamp(64px, 8vw, 112px);
  background: var(--hero-bg);
}

/* landing.js draws here: voice waveforms on the left settling into a form's ruled lines on the right. */
.hero-waves {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--wave);
  opacity: var(--wave-alpha);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  max-width: var(--w);
  margin: 0 auto;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 3.95rem);
  font-weight: 640;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

/* The highlight starts its own line but stays inline, so the underline follows each line of it
   rather than painting one block-wide band. */
.hero h1 .hl::before {
  content: "\A";
  white-space: pre;
}

.hero h1 .hl {
  text-decoration: underline;
  text-decoration-color: var(--warm);
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.14em;
}

.hero .lead {
  max-width: 34rem;
  margin: 26px 0 0;
  font-size: clamp(1.1rem, 1.6vw, 1.24rem);
}

.hero .lead strong {
  color: var(--ink);
  font-weight: 650;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 26px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.93rem;
  list-style: none;
}

.hero-points li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-points li::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ok) var(--tick) center / 72% no-repeat;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  font-size: clamp(13px, 1.1vw + 3px, 16px);
  isolation: isolate;
}

.hero-visual::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: 34em;
  height: 34em;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow) 0%, transparent 66%);
  transform: translate(-50%, -50%);
}

.float {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.75em 1em;
  border: 1px solid var(--line);
  border-radius: 1.1em;
  background: var(--card);
  box-shadow: var(--sh-2);
  color: var(--ink);
  line-height: 1.2;
}

.float-time {
  top: 6em;
  right: calc(50% + 5.6em);
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15em;
}

.float-big {
  color: var(--primary);
  font-family: var(--display);
  font-size: 2.1em;
  font-weight: 700;
  line-height: 1;
}

:root[data-theme="dark"] .float-big {
  color: var(--accent-ink);
}

.float-small {
  color: var(--muted);
  font-size: 0.8em;
  font-weight: 600;
}

.float-doc {
  top: 12.5em;
  left: calc(50% + 5.4em);
  font-size: 0.86em;
  white-space: nowrap;
}

.float-doc > span > b {
  display: block;
  font-size: 1.02em;
}

.float-doc > span > span {
  color: var(--ok-ink);
  font-size: 0.9em;
  font-weight: 600;
}

.float-ico {
  flex: none;
  width: 2.4em;
  height: 2.4em;
  padding: 0.45em;
  border-radius: 0.7em;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

@media (prefers-reduced-motion: no-preference) {
  .js .float-time {
    animation: bob 6s ease-in-out infinite alternate;
  }

  .js .float-doc {
    animation: bob 7s ease-in-out -3s infinite alternate;
  }
}

@keyframes bob {
  from {
    transform: translateY(-5px);
  }
  to {
    transform: translateY(6px);
  }
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-copy {
    text-align: center;
  }

  .hero .lead {
    margin-right: auto;
    margin-left: auto;
  }

  .hero .cta-row,
  .hero-points {
    justify-content: center;
  }

  .hero-visual {
    margin-top: 12px;
  }
}

@media (max-width: 560px) {
  .hero-visual {
    font-size: 13px;
  }

  /* The kicker's two halves on two lines, rather than a line ending on its separator. */
  .kicker-dot {
    display: none;
  }

  .hero .kicker span {
    display: block;
  }

  .hero .cta-row .btn {
    flex: 1 1 100%;
  }

  .float-time {
    right: auto;
    left: 0;
    top: 5em;
  }

  .float-doc {
    left: auto;
    right: 0;
    top: 12em;
  }
}

/* --- the hero's film --------------------------------------------------------------------------------
   The French hero stacks: the claim centred on top, the film below it as wide as the page allows, so its
   own captions stay readable on a desktop. A 16:9 frame on the navy the film opens and closes on, so the
   box never flashes another colour while the first frame loads. The player draws its own controls inside
   that frame; the sound button sits under it. */

/* Tighter than the two-column hero above it, so a laptop screen shows the film's top edge under the
   claim and the visitor sees there is something to watch. */
.hero-film {
  padding-top: clamp(32px, 4.5vw, 64px);
}

/* The waves belong to the claim: on the stacked hero they stay behind it instead of running, unseen,
   behind the film — and the canvas landing.js redraws every frame keeps the claim's size, not twice it. */
.hero-film .hero-waves {
  bottom: auto;
  height: min(100%, 46rem);
}

.hero-film .hero-inner {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: clamp(32px, 3.6vw, 48px);
}

.hero-film .hero-copy {
  max-width: 50rem;
  text-align: center;
}

.hero-film .lead {
  margin-right: auto;
  margin-left: auto;
}

.hero-film .cta-row,
.hero-film .hero-points {
  justify-content: center;
}

.film {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: 100%;
  max-width: 68rem;
  margin: 0;
}

.film-frame {
  width: 100%;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: clamp(14px, 1.8vw, 24px);
  background: var(--brand);
  box-shadow: var(--sh-3);
}

.film-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* In full screen the whole frame stays in view whatever the screen's shape — `cover` would crop the film
   to a phone held upright. Two rules: a browser that does not know one selector drops the whole rule. */
.film-video:fullscreen {
  object-fit: contain;
}

.film-video:-webkit-full-screen {
  object-fit: contain;
}

.film-sound {
  cursor: pointer;
}

.film-sound[hidden] {
  display: none;
}

.film-sound svg {
  width: 20px;
  height: 20px;
}

/* Muted shows the way to the sound; playing aloud shows the way back. The label names the action,
   so the state is not also announced through `aria-pressed` — a toggle whose name changes with its
   state is read twice. */
.film-sound .film-sound-on,
.film-sound .to-off,
.film-sound[data-sound="on"] .film-sound-off,
.film-sound[data-sound="on"] .to-on {
  display: none;
}

.film-sound[data-sound="on"] .film-sound-on,
.film-sound[data-sound="on"] .to-off {
  display: inline;
}

/* --- the phone ------------------------------------------------------------------------------------
   Drawn in `em`, so one font-size scales the whole device (hero, story, a small screen). Everything on
   its screen is the app's own look: the light or dark theme's tokens, the blue bubble for the client,
   the grey one for Certisia. */

.phone {
  position: relative;
  flex: none;
  width: 18em;
  height: 38em;
  padding: 0.55em;
  border-radius: 3em;
  background: var(--phone-frame);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 0 0 0.16em #2b3542, var(--sh-3);
}

.phone-island {
  position: absolute;
  top: 1.05em;
  left: 50%;
  z-index: 3;
  width: 5.6em;
  height: 1.65em;
  border-radius: 1em;
  background: #000;
  transform: translateX(-50%);
}

.phone-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 2.5em;
  background: var(--app-bg);
  color: var(--app-ink);
  font-size: 0.8em;
  line-height: 1.38;
  text-align: left;
}

.app-status {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  height: 3.4em;
  padding: 0.5em 2.2em 0;
  background: var(--app-card);
  font-size: 0.92em;
  font-weight: 650;
}

.sigs {
  display: inline-flex;
  align-items: flex-end;
  gap: 0.15em;
  height: 0.8em;
}

.sigs i {
  width: 0.22em;
  border-radius: 0.1em;
  background: currentColor;
}

.sigs i:nth-child(1) {
  height: 40%;
}

.sigs i:nth-child(2) {
  height: 70%;
}

.sigs i:nth-child(3) {
  height: 100%;
}

.sigs b {
  width: 1.6em;
  height: 0.8em;
  margin-left: 0.35em;
  border: 0.1em solid currentColor;
  border-radius: 0.25em;
  background: linear-gradient(90deg, currentColor 0 72%, transparent 72%) 0.08em 0.08em / calc(100% - 0.16em)
    calc(100% - 0.16em) no-repeat;
}

.app-bar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.6em;
  padding: 0.45em 0.9em 0.6em;
  border-bottom: 1px solid var(--app-line);
  background: var(--app-card);
}

.app-bar b {
  font-size: 1.05em;
}

.burger {
  width: 1.25em;
  height: 0.9em;
  margin-right: 0.2em;
  background:
    linear-gradient(currentColor, currentColor) top / 100% 0.14em no-repeat,
    linear-gradient(currentColor, currentColor) center / 100% 0.14em no-repeat,
    linear-gradient(currentColor, currentColor) bottom / 100% 0.14em no-repeat;
}

.app-mark {
  width: 2em;
  height: 2em;
  border-radius: 0.55em;
  background: var(--app-brand) url("/site/logo.svg") center / cover no-repeat;
}

.app-chat,
.scenes {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  padding: 0.8em 0.75em;
}

.app-chat,
.scenes {
  flex: 1;
  justify-content: flex-end;
  min-height: 0;
  overflow: hidden;
}

.day {
  align-self: center;
  padding: 0.25em 0.85em;
  border-radius: 1em;
  background: var(--app-day);
  color: var(--app-muted);
  font-size: 0.76em;
  font-weight: 600;
}

.msg {
  display: flow-root;
  min-width: 0;
  max-width: 84%;
  padding: 0.55em 0.72em;
  border-radius: 1.1em;
  font-size: 1em;
}

.msg.out {
  align-self: flex-end;
  border-bottom-right-radius: 0.35em;
  background: var(--app-out);
  color: #fff;
}

.msg.in {
  align-self: flex-start;
  border: 1px solid var(--app-in-line);
  border-bottom-left-radius: 0.35em;
  background: var(--app-in);
}

.msg .meta {
  position: relative;
  top: 0.45em;
  display: inline-flex;
  float: right;
  align-items: center;
  gap: 0.25em;
  margin-left: 0.7em;
  color: var(--app-muted);
  font-size: 0.72em;
  white-space: nowrap;
}

.msg.out .meta {
  color: rgba(255, 255, 255, 0.85);
}

.tick {
  width: 1.3em;
  height: 0.95em;
}

/* the voice note: play disc, waveform, duration */
.voice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.6em;
  align-items: center;
  min-width: 14em;
}

.voice .play {
  position: relative;
  grid-row: span 2;
  width: 2.3em;
  height: 2.3em;
  border-radius: 50%;
  background: #fff;
}

.voice .play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 55%;
  border-width: 0.45em 0 0.45em 0.72em;
  border-style: solid;
  border-color: transparent transparent transparent var(--app-out);
  transform: translate(-50%, -50%);
}

.bars {
  display: flex;
  align-items: center;
  gap: 0.16em;
  height: 1.9em;
}

.bars i {
  flex: 1;
  max-width: 0.2em;
  height: 45%;
  border-radius: 0.1em;
  background: rgba(255, 255, 255, 0.95);
}

.bars i:nth-child(3n + 2) {
  height: 80%;
}

.bars i:nth-child(3n) {
  height: 58%;
}

.bars i:nth-child(4n + 1) {
  height: 30%;
}

.bars i:nth-child(5),
.bars i:nth-child(12) {
  height: 100%;
}

.bars i:nth-child(n + 8) {
  background: rgba(255, 255, 255, 0.5);
}

.voice .meta {
  top: 0;
  grid-column: 2;
  justify-self: end;
  float: none;
  margin: 0.1em 0 0;
}

.transcript {
  align-self: flex-end;
  max-width: 84%;
  margin: -0.15em 0 0;
  color: var(--app-muted);
  font-size: 0.8em;
  font-style: italic;
  line-height: 1.35;
  text-align: right;
}

.ready {
  min-width: 15em;
}

.ready-head {
  display: block;
  margin-bottom: 0.35em;
  color: var(--app-ok);
  font-weight: 700;
}

.ready-row {
  display: flex;
  justify-content: space-between;
  gap: 1em;
  padding: 0.3em 0;
  border-top: 1px solid var(--app-in-line);
  font-size: 0.92em;
}

.ready-row:nth-of-type(2) {
  color: var(--app-muted);
  font-size: 0.7em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ready .meta {
  top: 0.2em;
}

.app-composer {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.55em;
  margin: 0.4em 0.6em 1.2em;
  padding: 0.35em 0.4em 0.35em 0.8em;
  border: 1px solid var(--app-line);
  border-radius: 1.6em;
  background: var(--app-card);
}

.clip {
  position: relative;
  width: 1.2em;
  height: 1.2em;
  border: 0.14em solid var(--app-muted);
  border-radius: 50%;
}

.clip::after {
  content: "";
  position: absolute;
  inset: 0.3em;
  background:
    linear-gradient(var(--app-muted), var(--app-muted)) center / 100% 0.13em no-repeat,
    linear-gradient(var(--app-muted), var(--app-muted)) center / 0.13em 100% no-repeat;
}

.ph {
  flex: 1;
  color: var(--app-muted);
  font-size: 0.92em;
}

.mic {
  position: relative;
  width: 2.3em;
  height: 2.3em;
  border-radius: 50%;
  background: var(--app-accent);
}

.mic::before {
  content: "";
  position: absolute;
  top: 0.5em;
  left: 50%;
  width: 0.62em;
  height: 0.95em;
  border-radius: 0.35em;
  background: #fff;
  transform: translateX(-50%);
}

.mic::after {
  content: "";
  position: absolute;
  top: 1.05em;
  left: 50%;
  width: 0.95em;
  height: 0.62em;
  border: 0.12em solid #fff;
  border-top: 0;
  border-radius: 0 0 0.5em 0.5em;
  transform: translateX(-50%);
}

/* The hero's conversation plays once on arrival. */
@media (prefers-reduced-motion: no-preference) {
  .js .phone-hero .app-chat > * {
    animation: pop 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .js .phone-hero .app-chat > :nth-child(1) {
    animation-delay: 0.2s;
  }

  .js .phone-hero .app-chat > :nth-child(2) {
    animation-delay: 0.6s;
  }

  .js .phone-hero .app-chat > :nth-child(3) {
    animation-delay: 1s;
  }

  .js .phone-hero .app-chat > :nth-child(4) {
    animation-delay: 1.6s;
  }

  .js .phone-hero .app-chat > :nth-child(5) {
    animation-delay: 2.5s;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(0.9em) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --- your time: the week before, the week after ------------------------------------------------------ */

.weeks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  max-width: 64rem;
  margin: 0 auto;
}

.week {
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--sh-1);
}

.week-after {
  border-color: color-mix(in srgb, var(--ok) 35%, var(--line));
  box-shadow: var(--sh-2);
}

.week header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
}

.tag {
  padding: 0.3em 0.85em;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.tag-before {
  background: var(--bad-soft);
  color: var(--bad-ink);
}

.tag-after {
  background: var(--ok-soft);
  color: var(--ok-ink);
}

.week-total {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 650;
}

.cal {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  height: 200px;
  margin: 20px 0 22px;
}

.col {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 26px 4px 4px;
  border-radius: 12px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 33px, var(--line) 33px 34px) 0 26px / 100% 100% no-repeat,
    var(--card-2);
}

.d {
  position: absolute;
  top: 5px;
  right: 0;
  left: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.blk {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 700;
  transform-origin: top;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.week-before .blk {
  background: repeating-linear-gradient(135deg, var(--drudge-1) 0 7px, var(--drudge-2) 7px 14px);
  color: var(--drudge-ink);
}

.b-xl {
  height: 64%;
}

.b-l {
  height: 50%;
}

.b-m {
  height: 32%;
}

.b-s {
  height: 18%;
}

.b-min {
  height: 22px;
  background: var(--primary);
  color: var(--primary-ink);
  font-size: 0.66rem;
}

.blk.free {
  flex: 1;
  border: 1px dashed color-mix(in srgb, var(--free-ink) 35%, transparent);
  background: var(--free-bg);
  color: var(--free-ink);
}

.js .weeks:not(.seen) .blk:not(.free) {
  transform: scaleY(0);
}

.js .weeks:not(.seen) .blk.free {
  opacity: 0;
}

.blk.free {
  transition: opacity 0.8s ease 0.9s;
}

.col:nth-child(2) .blk:not(.free) {
  transition-delay: 0.08s;
}

.col:nth-child(3) .blk:not(.free) {
  transition-delay: 0.16s;
}

.col:nth-child(4) .blk:not(.free) {
  transition-delay: 0.24s;
}

.col:nth-child(5) .blk:not(.free) {
  transition-delay: 0.32s;
}

.list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.list li {
  position: relative;
  padding-left: 30px;
  color: var(--ink-2);
  font-size: 0.98rem;
  line-height: 1.5;
}

.list li::before {
  content: "";
  position: absolute;
  top: 0.18em;
  left: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.list-before li::before {
  background:
    linear-gradient(var(--bad-ink), var(--bad-ink)) center / 9px 2px no-repeat,
    var(--bad-soft);
}

.list-after li::before {
  background: var(--ok) var(--tick) center / 72% no-repeat;
}

@media (max-width: 820px) {
  .weeks {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* A phone's day column is about 60px wide: the smaller label keeps « Certificat » whole. */
@media (max-width: 480px) {
  .cal {
    gap: 5px;
  }

  .col {
    padding-right: 2px;
    padding-left: 2px;
  }

  .blk {
    font-size: 0.6rem;
    letter-spacing: -0.01em;
  }
}

/* --- the scroll story -----------------------------------------------------------------------------
   The steps are the text; the stage is the picture. With the script, the stage sticks while the steps
   scroll past and plays the scene named by its `data-scene` (landing.js sets it from the step being
   read). The markup ships `data-scene="4"`, the finished draft, which is what a visitor without the
   script sees — a complete picture, never an empty phone. */

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}

/* The room under the last step keeps the stage stuck while that step is the one in the middle of the
   screen: without it a short laptop screen pushes the finished scene up under the header. */
.steps {
  grid-row: 1;
  grid-column: 1;
  margin: 0;
  padding: 0 0 16vh;
  list-style: none;
}

.story-stage {
  position: relative;
  grid-row: 1;
  grid-column: 2;
  display: flex;
  justify-content: center;
  padding: 1em 0;
  font-size: clamp(11px, calc((100vh - 8rem) / 40), 16px);
}

.js .story-stage {
  position: sticky;
  top: max(calc(var(--top-h) + 8px), calc(50vh - 20em + var(--top-h) / 2));
}

.phone-story {
  z-index: 1;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Once the certificate exists the phone steps aside to show it. */
.story-stage[data-scene="4"] .phone-story,
.story-stage[data-scene="5"] .phone-story {
  transform: translateX(-4.6em);
}

.step {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  column-gap: 18px;
  align-content: center;
  padding: 26px 0;
}

.js .step {
  min-height: 72vh;
  opacity: 0.32;
  transition: opacity 0.4s;
}

.js .step.current {
  opacity: 1;
}

.step-n {
  display: grid;
  grid-row: span 2;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  transition: background-color 0.3s, color 0.3s, transform 0.3s;
}

.js .step.current .step-n {
  background: var(--primary);
  color: var(--primary-ink);
  transform: scale(1.08);
}

.step h3 {
  margin: 0.15em 0 10px;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.12;
}

.step p {
  grid-column: 2;
  margin: 0;
  color: var(--ink-2);
  font-size: 1.1rem;
}

/* One conversation that grows: each step adds its messages under the ones before, and the oldest
   leave through the top of the screen as in any messenger. The scenes after the current one are not
   there yet. */
.scene {
  display: contents;
}

.scene > * {
  flex-shrink: 0;
}

.story-stage[data-scene="1"] .scene[data-scene="1"] ~ .scene,
.story-stage[data-scene="2"] .scene[data-scene="2"] ~ .scene,
.story-stage[data-scene="3"] .scene[data-scene="3"] ~ .scene,
.story-stage[data-scene="4"] .scene[data-scene="4"] ~ .scene {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .js .story-stage[data-scene="1"] .scene[data-scene="1"] > *,
  .js .story-stage[data-scene="2"] .scene[data-scene="2"] > *,
  .js .story-stage[data-scene="3"] .scene[data-scene="3"] > *,
  .js .story-stage[data-scene="4"] .scene[data-scene="4"] > *,
  .js .story-stage[data-scene="5"] .scene[data-scene="5"] > * {
    animation: pop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .js .scene > :nth-child(2) {
    animation-delay: 0.45s !important;
  }

  .js .scene > :nth-child(3) {
    animation-delay: 1s !important;
  }

  .js .scene > :nth-child(4) {
    animation-delay: 1.5s !important;
  }
}

/* scene 2 — the photographed label: a photo of the carton's label (etiquette-carton-*.svg, drawn
   240 × 300). `.label` lies exactly over the label in the photo, turned as it is, for the scan. */
.msg.photo {
  position: relative;
  width: 14em;
  padding: 0;
  overflow: hidden;
  background: #b58a5c;
}

.msg.photo .snap {
  display: block;
  width: 100%;
  height: auto;
}

.label {
  position: absolute;
  top: 21%;
  left: 15%;
  width: 68.75%;
  height: 55.73%;
  overflow: hidden;
  transform: rotate(-4deg);
  transform-origin: 0 0;
  pointer-events: none;
}

.msg.photo .meta {
  position: absolute;
  top: auto;
  right: 0.8em;
  bottom: 0.55em;
  float: none;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

@media (prefers-reduced-motion: no-preference) {
  .js .story-stage[data-scene="2"] .label::after {
    content: "";
    position: absolute;
    right: 0;
    left: 0;
    top: 0;
    height: 0.18em;
    background: var(--app-accent);
    box-shadow: 0 0 0.9em 0.2em var(--app-accent);
    animation: scan 1.5s ease-in-out 0.5s 2 both;
  }
}

@keyframes scan {
  0% {
    top: 0;
    opacity: 0;
  }
  10%,
  90% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* scene 3 — what is missing */
.missing > b {
  display: block;
  margin-bottom: 0.35em;
}

.chk {
  display: flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.22em 0;
  font-size: 0.9em;
}

/* A box ticks once the client has answered it, as in the app. While step 3 is read the list arrives
   with its boxes EMPTY, the client's reply lands under it, and only then do they tick, one after the
   other, before Certisia's thanks. Ticked is the resting state, so the later scenes — and a visitor
   without the script or the motion — see the list done, never a question left open. */
.chk::before {
  content: "";
  flex: none;
  width: 1.1em;
  height: 1.1em;
  border: 0.12em solid var(--app-ok);
  border-radius: 0.3em;
  background: var(--app-ok) var(--tick) center / 82% no-repeat;
}

@media (prefers-reduced-motion: no-preference) {
  .js .story-stage[data-scene="3"] .scene[data-scene="3"] > :nth-child(2) {
    animation-delay: 1.3s !important;
  }

  .js .story-stage[data-scene="3"] .chk::before {
    animation: check 0.35s ease 1.95s both;
  }

  .js .story-stage[data-scene="3"] .chk + .chk::before {
    animation-delay: 2.25s;
  }

  .js .story-stage[data-scene="3"] .scene[data-scene="3"] > :nth-child(3) {
    animation-delay: 2.8s !important;
  }
}

@keyframes check {
  from {
    border-color: var(--app-muted);
    background-color: transparent;
    background-size: 0;
  }
}

/* scene 4 — the draft, as the app's card draws it */
.msg.draft {
  align-self: stretch;
  max-width: none;
  padding: 0 0 0.45em;
  overflow: hidden;
}

.draft-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6em;
  padding: 0.75em 0.8em 0.15em;
  line-height: 1.25;
}

.badge {
  flex: none;
  padding: 0.2em 0.6em;
  border-radius: 1em;
  background: var(--app-warn-bg);
  color: var(--app-warn-ink);
  font-size: 0.7em;
  font-weight: 750;
}

.draft-sub {
  display: block;
  padding: 0 0.8em 0.55em;
  color: var(--app-muted);
  font-size: 0.78em;
}

.line {
  display: grid;
  grid-template-columns: 1.7em minmax(0, 1fr);
  gap: 0.55em;
  align-items: start;
  padding: 0.5em 0.8em;
  border-top: 1px solid var(--app-in-line);
}

.line .n {
  display: grid;
  place-items: center;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  background: var(--app-day);
  color: var(--app-brand-ink);
  font-size: 0.78em;
  font-weight: 750;
}

.line b {
  display: block;
  font-size: 0.92em;
}

.line b + span {
  display: block;
  color: var(--app-muted);
  font-size: 0.76em;
}

.draft-foot {
  display: block;
  padding: 0.5em 0.8em;
  border-top: 1px solid var(--app-in-line);
  background: var(--app-card-2);
  color: var(--app-muted);
  font-size: 0.76em;
}

.acts {
  display: flex;
  padding: 0.6em 0.8em 0.15em;
}

.acts .go {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.6em 0.4em;
  overflow: hidden;
  border-radius: 0.8em;
  background: var(--app-brand);
  color: #fff;
  font-size: 0.78em;
  font-weight: 650;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background-color 0.4s;
}

.go b {
  font-weight: inherit;
}

/* Scene 5 is the press: the button reads what the app's does once pressed. */
.go-done,
.story-stage[data-scene="5"] .go-idle {
  display: none;
}

.story-stage[data-scene="5"] .go-done {
  display: inline;
}

.story-stage[data-scene="5"] .acts .go {
  background: var(--app-ok);
}

.go-done::before {
  content: "";
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  margin-right: 0.35em;
  background: var(--tick) center / 100% no-repeat;
  vertical-align: -0.18em;
}

.msg.draft .meta {
  top: 0.2em;
  margin-right: 0.8em;
}

@media (prefers-reduced-motion: no-preference) {
  .js .story-stage[data-scene="4"] .acts .go {
    animation: nudge 1.6s ease-in-out 1.6s 2;
  }
}

@keyframes nudge {
  50% {
    box-shadow: 0 0 0 0.35em color-mix(in srgb, var(--app-accent) 35%, transparent);
  }
}

/* scene 5 — confirmed and filed */
.stages > b {
  display: block;
  margin-bottom: 0.45em;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em;
}

.chip {
  position: relative;
  padding: 0.25em 0.65em 0.25em 1.65em;
  border-radius: 1em;
  background: var(--app-ok-soft);
  color: var(--app-ok);
  font-size: 0.76em;
  font-weight: 700;
}

.chip::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.45em;
  width: 0.95em;
  height: 0.95em;
  border-radius: 50%;
  background: var(--app-ok) var(--tick) center / 78% no-repeat;
  transform: translateY(-50%);
}

.note {
  display: block;
  margin-top: 0.55em;
  padding: 0.4em 0.6em;
  border-radius: 0.55em;
  background: var(--app-warn-bg);
  color: var(--app-warn-ink);
  font-size: 0.8em;
}

.files {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  min-width: 15em;
}

.file {
  display: flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.45em 0.55em;
  border: 1px solid var(--app-in-line);
  border-radius: 0.6em;
  background: var(--app-card-2);
  font-size: 0.82em;
  font-weight: 600;
}

.file::before {
  content: "PDF";
  display: grid;
  flex: none;
  place-items: center;
  width: 2.3em;
  height: 2.8em;
  border-radius: 0.25em;
  background: #d0402b;
  clip-path: polygon(0 0, 70% 0, 100% 25%, 100% 100%, 0 100%);
  color: #fff;
  font-size: 0.62em;
  font-weight: 800;
}

.files-foot {
  margin-top: 0.15em;
  color: var(--app-muted);
  font-size: 0.74em;
}

/* The certificate scene 4 fills, drawn beside the phone: paper in either theme. In scene 5 it goes
   back into the phone, and the Expadon draft it was filed into comes out. */
.sheet {
  position: absolute;
  top: 9em;
  left: calc(50% + 4em);
  z-index: 0;
  width: 14em;
  padding: 1em 1.05em 1.1em;
  border-radius: 0.35em;
  background: #fffefa;
  box-shadow: var(--sh-3);
  color: #1b2733;
  opacity: 0;
  transform: translateX(-9em) rotate(0deg);
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.story-stage[data-scene="4"] .sheet {
  opacity: 1;
  transform: rotate(4deg);
}

.sheet-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5em;
  margin-top: 0.7em;
}

.sheet-stamp {
  flex: none;
  padding: 0.2em 0.5em;
  border: 0.12em solid #b7791f;
  border-radius: 0.3em;
  color: #b7791f;
  font-size: 0.46em;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-5deg);
}

.sheet-title {
  display: block;
  font-family: var(--display);
  font-size: 0.78em;
  font-weight: 720;
  letter-spacing: 0.06em;
}

.sheet-title small {
  display: block;
  color: #6b7885;
  font-family: var(--sans);
  font-size: 0.66em;
  font-weight: 600;
}

.sheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4em;
  margin-top: 0.8em;
}

.f {
  display: flex;
  flex-direction: column;
  gap: 0.25em;
  min-height: 2.5em;
  padding: 0.35em 0.4em;
  border: 1px solid #dfe4ea;
  border-radius: 0.2em;
}

.f small,
.sheet-sign small {
  color: #6b7885;
  font-size: 0.44em;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.f i {
  display: block;
  width: 80%;
  height: 0.42em;
  border-radius: 0.2em;
  background: #c9d3de;
}

.f em {
  color: #12395b;
  font-size: 0.6em;
  font-style: normal;
  font-weight: 800;
}

.sheet-table {
  display: block;
  margin-top: 0.6em;
  overflow: hidden;
  border: 1px solid #dfe4ea;
  border-radius: 0.2em;
}

.tr {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.8fr;
  gap: 0.3em;
  padding: 0.35em 0.45em;
  border-top: 1px solid #e8ecf1;
  color: #12395b;
  font-size: 0.52em;
  font-weight: 700;
}

.tr.th {
  border-top: 0;
  background: #f1f4f8;
  color: #6b7885;
  font-size: 0.44em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sheet-sign {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2em;
}

.sheet-sign i {
  width: 5.5em;
  height: 1.8em;
  border-bottom: 1px dashed #aab6c2;
}

/* The fields ink themselves in while step 4 is read. */
@media (prefers-reduced-motion: no-preference) {
  .js .story-stage[data-scene="4"] .f em,
  .js .story-stage[data-scene="4"] .f i,
  .js .story-stage[data-scene="4"] .tr:not(.th) span {
    animation: ink 0.5s ease both;
  }

  .js .story-stage[data-scene="4"] .f:nth-child(2) i {
    animation-delay: 0.7s;
  }

  .js .story-stage[data-scene="4"] .f:nth-child(1) i {
    animation-delay: 0.5s;
  }

  .js .story-stage[data-scene="4"] .f:nth-child(3) em {
    animation-delay: 0.9s;
  }

  .js .story-stage[data-scene="4"] .f:nth-child(4) em {
    animation-delay: 1.1s;
  }

  .js .story-stage[data-scene="4"] .tr:nth-child(2) span {
    animation-delay: 1.35s;
  }

  .js .story-stage[data-scene="4"] .tr:nth-child(3) span {
    animation-delay: 1.6s;
  }
}

@keyframes ink {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* scene 5 — the draft Certisia filed, as it waits on Expadon: a plain window in the site's own tokens
   (no page of the téléprocédure is copied). Each piece ticks in; the one move left is the client's. */
.portal {
  position: absolute;
  top: 8em;
  left: calc(50% + 4em);
  z-index: 0;
  width: 15em;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.7em;
  background: var(--card);
  box-shadow: var(--sh-3);
  color: var(--ink);
  opacity: 0;
  transform: translateX(-9em);
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.story-stage[data-scene="5"] .portal {
  opacity: 1;
  transform: none;
}

.portal-bar {
  display: flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.55em 0.8em;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
}

.portal-bar i {
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: var(--line-soft);
}

.portal-bar span {
  margin-left: 0.6em;
  color: var(--muted);
  font-size: 0.6em;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5em;
  padding: 0.75em 0.8em 0.1em;
}

.portal-head b {
  font-size: 0.82em;
}

/* Every line keeps the window's one inset (0.8em of the window), whatever its own type size: the paddings
   below are that inset divided by each line's size. */
.portal-sub {
  display: block;
  padding: 0 1.21em 0.9em;
  color: var(--muted);
  font-size: 0.66em;
}

.prow {
  display: flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.45em 1.14em;
  border-top: 1px solid var(--line);
  font-size: 0.7em;
  font-weight: 600;
}

.prow::before {
  content: "";
  flex: none;
  width: 1.3em;
  height: 1.3em;
  border-radius: 50%;
  background: var(--ok) var(--tick) center / 72% no-repeat;
}

.prow > span {
  flex: 1;
  min-width: 0;
}

.prow em {
  color: var(--muted);
  font-style: normal;
  white-space: nowrap;
}

.portal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55em;
  padding: 0.65em 1.18em 0.75em;
  border-top: 1px solid var(--line);
  background: var(--card-2);
  color: var(--muted);
  font-size: 0.68em;
  font-weight: 600;
}

.portal-submit {
  padding: 0.45em 1.05em;
  border-radius: 1em;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 750;
}

@media (prefers-reduced-motion: no-preference) {
  .js .story-stage[data-scene="5"] .prow::before {
    animation: tick-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1.4) 0.5s both;
  }

  .js .story-stage[data-scene="5"] .prow:nth-child(5)::before {
    animation-delay: 0.75s;
  }

  .js .story-stage[data-scene="5"] .prow:nth-child(6)::before {
    animation-delay: 1s;
  }

  .js .story-stage[data-scene="5"] .prow:nth-child(7)::before {
    animation-delay: 1.25s;
  }

  .js .story-stage[data-scene="5"] .prow:nth-child(8)::before {
    animation-delay: 1.5s;
  }

  .js .story-stage[data-scene="5"] .portal-submit {
    animation: nudge 1.6s ease-in-out 2.1s 2;
  }
}

@keyframes tick-in {
  from {
    opacity: 0;
    transform: scale(0);
  }
}

/* One column below 900px: the phone sticks under the header, the steps scroll up beneath it as cards,
   and the one read in the free space under the phone is the one it plays. */
@media (max-width: 900px) {
  .story-grid {
    display: block;
  }

  .story-stage {
    font-size: clamp(9px, calc((52vh - 1.5rem) / 39), 13px);
  }

  .js .story-stage {
    top: var(--top-h);
    z-index: 2;
    padding: 0.5em 0 2.2em;
    background: linear-gradient(var(--page) 82%, transparent);
  }

  /* The phone steps aside a little (--aside) for the certificate, which comes over its right side. */
  .story-stage {
    --aside: 3.4em;
  }

  .story-stage[data-scene="4"] .phone-story,
  .story-stage[data-scene="5"] .phone-story {
    transform: translateX(calc(-1 * var(--aside)));
  }

  .sheet {
    left: calc(50% + 3.4em);
    top: 10em;
    width: 13em;
  }

  .portal {
    left: calc(50% + 3.4em);
    top: 8.5em;
    width: 13.5em;
  }

  .steps {
    position: relative;
    z-index: 1;
    padding-bottom: 12vh;
  }

  .js .step {
    min-height: 0;
    margin: 0 0 34vh;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--card);
    box-shadow: var(--sh-1);
  }

  .js .step:last-child {
    margin-bottom: 0;
  }

  .step p {
    font-size: 1.02rem;
  }
}

/* --- who it is for ---------------------------------------------------------------------------------- */

.sectors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.sector {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  transition: transform 0.25s, box-shadow 0.25s;
}

.sector:hover {
  box-shadow: var(--sh-2);
  transform: translateY(-3px);
}

.sector-ico {
  display: block;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  padding: 9px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.sector h3 {
  margin: 0 0 4px;
  font-size: 1.22rem;
  line-height: 1.2;
}

.sector p {
  margin: 0;
  color: var(--muted);
  font-size: 0.97rem;
  line-height: 1.5;
}

.sector-lead {
  position: relative;
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 26px;
  align-items: center;
  padding: clamp(24px, 4vw, 38px);
  overflow: hidden;
  border-color: transparent;
  background: var(--lead-bg);
  color: var(--lead-ink);
}

/* a slow swell behind the lead tile: three drawn crests, `img-src data:` */
.sector-lead::after {
  content: "";
  position: absolute;
  right: -5%;
  bottom: -30%;
  width: 60%;
  height: 120%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M0 120c50-30 100-30 150 0s100 30 150 0 100-30 150 0' opacity='.18'/%3E%3Cpath d='M0 150c50-30 100-30 150 0s100 30 150 0 100-30 150 0' opacity='.12'/%3E%3Cpath d='M0 90c50-30 100-30 150 0s100 30 150 0 100-30 150 0' opacity='.08'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}

.sector-lead .sector-ico {
  grid-row: span 2;
  width: 76px;
  height: 76px;
  margin: 0;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--warm);
}

.sector-lead h3 {
  color: var(--lead-ink);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.sector-lead p {
  grid-column: 2;
  color: var(--lead-muted);
  font-size: 1.08rem;
}

.sector-tag {
  position: relative;
  z-index: 1;
  grid-row: 1 / span 2;
  grid-column: 3;
  padding: 0.45em 1em;
  border-radius: 999px;
  background: var(--warm);
  color: #3a2a00;
  font-size: 0.85rem;
  font-weight: 750;
  white-space: nowrap;
}

.docs,
.destinations {
  margin-top: clamp(40px, 6vw, 64px);
  text-align: center;
}

.docs-title {
  margin: 0 auto 18px;
  max-width: 44rem;
  color: var(--ink-2);
  font-size: 1.05rem;
  font-weight: 650;
}

.doc-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.doc-chips li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0.55em 1.1em 0.55em 0.8em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
}

.doc-chips li::before {
  content: "";
  width: 14px;
  height: 18px;
  border-radius: 2px;
  background:
    linear-gradient(var(--accent-soft), var(--accent-soft)) 3px 7px / 8px 2px no-repeat,
    linear-gradient(var(--accent-soft), var(--accent-soft)) 3px 11px / 6px 2px no-repeat,
    var(--accent);
  clip-path: polygon(0 0, 65% 0, 100% 28%, 100% 100%, 0 100%);
}

.marquee {
  display: flex;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
  display: flex;
  flex: none;
  gap: 10px;
  margin: 0;
  padding: 4px 10px 4px 0;
  list-style: none;
  animation: marquee 80s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-track li {
  padding: 0.5em 1.05em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}

@keyframes marquee {
  to {
    transform: translateX(-100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .marquee-track {
    flex: 1;
    flex-wrap: wrap;
    justify-content: center;
    animation: none;
  }

  .marquee-copy {
    display: none;
  }
}

@media (max-width: 860px) {
  .sectors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sector-lead {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 10px;
  }

  .sector-lead .sector-ico {
    grid-row: auto;
    width: 60px;
    height: 60px;
  }

  .sector-lead p {
    grid-column: 1;
  }

  .sector-tag {
    grid-row: auto;
    grid-column: 1;
    justify-self: start;
  }
}

@media (max-width: 480px) {
  .sectors {
    gap: 10px;
  }

  .sector:not(.sector-lead) {
    padding: 16px;
  }

  .sector:not(.sector-lead) .sector-ico {
    width: 40px;
    height: 40px;
    padding: 7px;
    border-radius: 12px;
  }

  .sector:not(.sector-lead) h3 {
    font-size: 1.04rem;
  }

  .sector:not(.sector-lead) p {
    font-size: 0.88rem;
  }
}

/* --- the deposit ----------------------------------------------------------------------------------
   Everything Certisia files on one side, the one line left to the client on the other: the imbalance
   IS the message, so the first card is the big one. */

.band-deposit {
  background: var(--hero-bg);
}

.deposit {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 16px;
}

.deposit-card {
  padding: clamp(24px, 3.6vw, 40px);
  border-radius: var(--r-lg);
}

.deposit-us {
  background: var(--lead-bg);
  box-shadow: var(--sh-2);
  color: var(--lead-ink);
}

.deposit-you {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--card);
}

.deposit-title {
  margin: 0 0 20px;
  color: var(--accent-ink);
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.deposit-us .deposit-title {
  color: var(--lead-muted);
}

.ticks {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ticks li {
  position: relative;
  padding-left: 40px;
  font-size: clamp(1.05rem, 1.7vw, 1.22rem);
  font-weight: 600;
  line-height: 1.35;
}

.ticks li::before {
  content: "";
  position: absolute;
  top: -0.05em;
  left: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff var(--tick-navy) center / 70% no-repeat;
}

.deposit-big {
  margin: 0 0 12px;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 650;
  line-height: 1.12;
}

/* Two acts, two lines: a sentence never breaks across them. */
.deposit-big span {
  display: block;
}

.deposit-you p:last-child {
  margin: 0;
  color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  .js .deposit .ticks li::before {
    transform: scale(0);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1.4) 0.3s;
  }

  .js .deposit.seen .ticks li::before {
    transform: none;
  }

  .js .deposit .ticks li:nth-child(2)::before {
    transition-delay: 0.45s;
  }

  .js .deposit .ticks li:nth-child(3)::before {
    transition-delay: 0.6s;
  }

  .js .deposit .ticks li:nth-child(4)::before {
    transition-delay: 0.75s;
  }

  .js .deposit .ticks li:nth-child(5)::before {
    transition-delay: 0.9s;
  }
}

/* Where the deposit goes next: Expadon now, the other platforms after it. */
.platforms {
  margin-top: clamp(28px, 4vw, 44px);
  text-align: center;
}

.platforms-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
}

.pf {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.55em 1.15em;
  border-radius: 999px;
  font-size: 0.97rem;
}

.pf::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.pf-now {
  background: var(--ok-soft);
  color: var(--ok-ink);
}

.pf-now::before {
  background: var(--ok);
}

.pf-next {
  border: 1.5px dashed var(--line-soft);
  color: var(--muted);
}

.pf-next::before {
  border: 1.5px solid var(--dim);
}

.pf-link {
  width: 44px;
  border-top: 2px dotted var(--line-soft);
}

.platforms-note {
  margin: 14px auto 0;
  color: var(--muted);
}

@media (max-width: 820px) {
  .deposit {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .pf-link {
    display: none;
  }
}

/* --- the story ----------------------------------------------------------------------------------- */

.band-contrast {
  background: var(--contrast-bg);
  color: var(--contrast-ink);
}

.band-contrast h2 {
  color: var(--contrast-ink);
}

.band-contrast .eyebrow,
.band-contrast .hl {
  color: var(--contrast-hl);
}

.story-origin {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(36px, 6vw, 88px);
  align-items: center;
}

.origin-copy p {
  margin: 0 0 18px;
  color: var(--contrast-muted);
  font-size: 1.14rem;
  line-height: 1.72;
}

.origin-copy p:last-child {
  margin-bottom: 0;
}

.origin-visual {
  display: flex;
  justify-content: center;
}

.origin-sheet {
  position: relative;
  width: min(100%, 21rem);
  padding: 28px 26px 34px;
  border-radius: 6px;
  background: #fbfaf6;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
  color: #1b2733;
  transform: rotate(-3deg);
}

.os-title {
  display: block;
  margin-bottom: 16px;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 720;
  letter-spacing: 0.08em;
}

.os-line {
  display: block;
  height: 8px;
  margin: 12px 0;
  border-radius: 4px;
  background: #e3e7ec;
}

.os-line.short {
  width: 58%;
}

.os-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: #33475c;
  font-size: 0.82rem;
  line-height: 1.3;
}

.os-box i {
  position: relative;
  flex: none;
  width: 17px;
  height: 17px;
  border: 1.5px solid #6b7885;
  border-radius: 3px;
}

.os-box i.on {
  border-color: #2e7d46;
  background: #2e7d46 var(--tick) center / 85% no-repeat;
}

/* the box nobody ticked, circled by the inspector's red pen */
.os-miss::before {
  content: "";
  position: absolute;
  top: -9px;
  left: -9px;
  width: 34px;
  height: 34px;
  border: 2.5px solid #d0402b;
  border-radius: 52% 44% 56% 46%;
  transform: rotate(-12deg);
  transition: opacity 0.4s ease 0.4s, transform 0.4s ease 0.4s;
}

.os-stamp {
  position: absolute;
  right: 16px;
  bottom: 22px;
  padding: 0.1em 0.45em;
  border: 3px solid #d0402b;
  border-radius: 8px;
  color: #d0402b;
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.88;
  transform: rotate(-14deg);
  transition: opacity 0.25s ease 1s, transform 0.35s cubic-bezier(0.3, 1.5, 0.5, 1) 1s;
}

.js .origin-visual:not(.seen) .os-stamp {
  opacity: 0;
  transform: rotate(-14deg) scale(1.9);
}

.js .origin-visual:not(.seen) .os-miss::before {
  opacity: 0;
  transform: rotate(-12deg) scale(1.6);
}

@media (max-width: 860px) {
  .story-origin {
    grid-template-columns: minmax(0, 1fr);
  }

  .origin-visual {
    order: 2;
  }
}

/* --- trust ---------------------------------------------------------------------------------------- */

.trust {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.trust-item {
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
}

.trust-ico {
  display: block;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  padding: 9px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.trust-item h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  line-height: 1.2;
}

.trust-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.97rem;
  line-height: 1.55;
}

/* Under the security cards: where the full text is, and who to write to. */
.trust-note {
  max-width: var(--w-text);
  margin: clamp(28px, 4vw, 40px) auto 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
  text-align: center;
}

.trust-note a {
  color: var(--accent-ink);
  text-underline-offset: 3px;
}

@media (max-width: 1000px) {
  .trust {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .trust {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- everywhere: the stores and the browser --------------------------------------------------------- */

.everywhere {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(36px, 6vw, 80px);
  align-items: center;
}

.everywhere .lead {
  margin: 0;
}

/* The listings are written by website.py: a link once the store URL exists, a « Bientôt » tile until
   then. Our own buttons naming the store, not the stores' badge artwork — swap in the official badges
   the day the listings go live. */
.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 30px 0 0;
}

.store {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 12.5rem;
  min-height: 60px;
  padding: 10px 20px 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: var(--store-bg);
  color: var(--store-ink);
  line-height: 1.15;
  text-decoration: none;
}

a.store:hover {
  box-shadow: var(--sh-2);
}

.store-glyph {
  flex: none;
  width: 28px;
  height: 28px;
}

.store-text small {
  display: block;
  opacity: 0.8;
  font-size: 0.74rem;
}

.store-text b {
  font-size: 1.15rem;
  font-weight: 650;
}

.store.soon {
  cursor: default;
}

.store.soon .store-glyph,
.store.soon .store-text {
  opacity: 0.72;
}

.store-soon {
  position: absolute;
  top: -10px;
  right: -8px;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  background: var(--warm);
  color: #3a2a00;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.browser-note {
  margin: 22px 0 0;
  color: var(--muted);
}

.devices {
  position: relative;
  min-height: 22rem;
}

.laptop {
  position: absolute;
  top: 1rem;
  right: 16%;
  left: 0;
}

.laptop-screen {
  display: grid;
  grid-template-columns: 28% minmax(0, 1fr);
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 10px solid #1b2530;
  border-radius: 14px 14px 4px 4px;
  background: var(--app-bg);
  box-shadow: var(--sh-2);
}

.lp-side {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 16px 10px;
  background: linear-gradient(180deg, #12395b, #164672);
}

.lp-side i {
  display: block;
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.16);
}

.lp-side i:first-child {
  background: rgba(255, 255, 255, 0.4);
}

.lp-chat {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px;
}

.lp-chat i {
  display: block;
  width: 55%;
  height: 16px;
  border-radius: 9px;
}

.lp-chat .in {
  align-self: flex-start;
  border: 1px solid var(--app-in-line);
  background: var(--app-in);
}

.lp-chat .out {
  align-self: flex-end;
  width: 40%;
  background: var(--app-out);
}

.lp-chat .wide {
  width: 72%;
}

.lp-chat .card {
  align-self: flex-start;
  width: 72%;
  height: 54px;
  border: 1px solid var(--app-in-line);
  border-top: 4px solid var(--app-accent);
  background: var(--app-in);
}

.laptop-base {
  display: block;
  height: 12px;
  margin: 0 -6%;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(#d4dbe3, #a9b4bf);
}

.mini-phone {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 8.8rem;
  aspect-ratio: 9 / 18.5;
  padding: 1.7rem 0.5rem 0.7rem;
  border: 6px solid var(--phone-frame);
  border-radius: 1.5rem;
  background: var(--app-bg);
  box-shadow: var(--sh-3);
}

.mini-phone .lp-chat {
  height: 100%;
  padding: 0;
}

.mini-phone .lp-chat i {
  height: 12px;
}

.mini-phone .lp-chat .card {
  height: 44px;
}

.ping {
  position: absolute;
  top: 0.9rem;
  right: -1.4rem;
  z-index: 1;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--sh-2);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 650;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.6s, opacity 0.6s ease 0.6s;
}

.ping::before {
  content: "";
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--brand) url("/site/logo.svg") center / cover no-repeat;
}

.js .devices:not(.seen) .ping {
  opacity: 0;
  transform: translateY(-16px);
}

@media (max-width: 860px) {
  .everywhere {
    grid-template-columns: minmax(0, 1fr);
  }

  .devices {
    min-height: 0;
    height: min(72vw, 22rem);
    margin-top: 12px;
  }
}

@media (max-width: 480px) {
  .store {
    flex: 1 1 100%;
  }

  .mini-phone {
    width: 6.6rem;
  }

  .ping {
    right: -0.6rem;
    font-size: 0.8rem;
  }
}

/* --- questions ------------------------------------------------------------------------------------- */

.faq {
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  position: relative;
  padding: 22px 44px 22px 0;
  cursor: pointer;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 650;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 8px;
  width: 10px;
  height: 10px;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0;
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s;
}

.faq details[open] summary::after {
  transform: translateY(-25%) rotate(-135deg);
}

.faq details p {
  margin: -6px 0 22px;
  color: var(--ink-2);
  font-size: 1.02rem;
}

/* --- the closing band (website.py writes it) --------------------------------------------------------- */

.band-closing {
  position: relative;
  overflow: hidden;
  background: var(--closing-bg);
  color: var(--closing-ink);
  text-align: center;
}

.band-closing::before {
  content: "";
  position: absolute;
  top: -40%;
  left: 50%;
  width: 70rem;
  height: 70rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 60%);
  transform: translateX(-50%);
  pointer-events: none;
}

.closing {
  position: relative;
  max-width: 46rem;
}

.band-closing h2 {
  color: var(--closing-ink);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
}

.band-closing .hl {
  color: var(--warm);
  background-image: none;
}

.band-closing .lead {
  margin: 0 auto;
  color: var(--closing-muted);
}

.band-closing .cta-row {
  justify-content: center;
}

.band-closing .btn {
  border-color: rgba(255, 255, 255, 0.45);
  background: transparent;
  color: #fff;
}

.band-closing .btn:hover {
  border-color: #fff;
}

.band-closing .btn.primary {
  border-color: #fff;
  background: #fff;
  color: var(--brand);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.contact {
  margin: 28px 0 0;
  color: var(--closing-muted);
}

.contact a {
  color: #fff;
  font-weight: 650;
}

/* --- footer ---------------------------------------------------------------------------------------- */

.foot {
  padding: 48px 20px 56px;
  border-top: 1px solid var(--line);
  background: var(--foot-bg);
  color: var(--muted);
  font-size: 0.93rem;
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px 48px;
  max-width: var(--w);
  margin: 0 auto;
}

.foot-brand p {
  max-width: 22rem;
  margin: 12px 0 0;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  max-width: 36rem;
}

.foot nav a {
  color: var(--ink-2);
  text-decoration: none;
}

.foot nav a:hover {
  color: var(--accent-ink);
  text-decoration: underline;
}

/* --- the install page -----------------------------------------------------------------------------
   Grouped the way telegram.org/apps groups: one heading per PLACE the app can live, the platforms
   under it as rows you scan rather than cards you compare. */

.hero-slim {
  padding-bottom: clamp(36px, 6vw, 64px);
  text-align: center;
}

.hero-slim .hero-inner {
  display: block;
  max-width: 46rem;
}

.hero-slim h1 {
  font-size: clamp(2.3rem, 5.4vw, 3.8rem);
}

.hero-slim .lead {
  margin-right: auto;
  margin-left: auto;
}

/* --- the platform picker ---------------------------------------------------------------------------
   Under the install page's lead: the guess, and the escape from it. Both halves matter — the guess
   alone would strand a visitor whose UA we read wrong, and the links alone would make everyone read
   three installs to find theirs. The links are always all three, in a fixed order, so the row never
   moves under a finger and a desktop visitor sending the link to their phone finds the other card in
   one click. */

.picker {
  margin: 28px auto 0;
  max-width: 36rem;
}

/* Hidden by DEFAULT and revealed by the stamp on <html>: the page with no detection is the page with
   no claim about the visitor — the plain chooser — rather than a page missing a piece. */
.picked,
.other {
  display: none;
  margin: 0 0 12px;
  color: var(--ink-2);
  font-size: 0.97rem;
}

.is-android .picked[data-when="android"],
.is-ios .picked[data-when="ios"],
.is-desktop .picked[data-when="desktop"],
.is-android .other,
.is-ios .other,
.is-desktop .other {
  display: block;
}

/* The sentence names the platform; the row below it offers the other two. Shown together they read as
   one thought, so the link row loses the sentence's bottom margin. */
.is-android .picked[data-when="android"],
.is-ios .picked[data-when="ios"],
.is-desktop .picked[data-when="desktop"] {
  margin-bottom: 18px;
}

.is-android .other,
.is-ios .other,
.is-desktop .other {
  margin-bottom: 8px;
  color: var(--dim);
  font-size: 0.88rem;
}

.platform-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.platform-nav a {
  padding: 8px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.platform-nav a:hover,
.platform-nav a:focus-visible {
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* The guess, said in pixels; site.js says the same thing to the a11y tree with `aria-current`. */
.platform-nav a[aria-current] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* A column, so the group holding the visitor's platform can be pulled to the top. */
.groups {
  display: flex;
  flex-direction: column;
  max-width: 50rem;
}

.group {
  margin: 0 0 44px;
}

.group > h2 {
  margin: 0 0 4px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

/* The glyph holds column one for the whole row however many blocks the platform needs; everything else
   stacks in column two. Spelled as "the glyph, then all the rest" rather than counted rows — a card
   that grows a paragraph must not drop it into the icon's column. */
.platform {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 4px 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  /* The header is sticky, so a picker jump would park the card's own name underneath it. */
  scroll-margin-top: 88px;
}

.platform > * {
  grid-column: 2;
}

.platform .glyph {
  grid-row: 1 / -1;
  grid-column: 1;
  width: 44px;
  height: 44px;
  color: var(--accent);
}

.platform h3 {
  margin: 0;
  align-self: center;
  font-size: 1.25rem;
}

.platform p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.98rem;
}

.platform p + p {
  margin-top: 12px;
}

.platform p strong {
  color: var(--ink);
}

.platform .btn {
  justify-self: start;
  margin-top: 14px;
}

@media (max-width: 560px) {
  .platform {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .platform > *,
  .platform .glyph {
    grid-column: 1;
  }

  .platform .glyph {
    grid-row: auto;
    margin-bottom: 6px;
  }
}

/* The platform the visitor is actually on (site.js stamps <html>) leads: its GROUP moves to the top of
   the page and the card to the top of its group, so the device in their hand is the first thing on the
   page and the accent edge says why. Emphasis only — every other card keeps its place in the same
   list, one scroll or one picker link away. */
.is-android .cards [data-platform="android"],
.is-ios .cards [data-platform="ios"],
.is-desktop .cards [data-platform="desktop"] {
  order: -1;
  border-color: var(--accent);
  box-shadow: var(--sh-2);
}

.is-desktop .groups [data-group="desktop"] {
  order: -1;
}

/* Written in every card and shown on exactly one — the badge is markup the CSS reveals, so it cannot
   be attached to the wrong row by a script that ran at the wrong moment. */
.here {
  display: none;
  justify-self: start;
  margin-bottom: 6px;
  padding: 3px 10px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.is-android .cards [data-platform="android"] .here,
.is-ios .cards [data-platform="ios"] .here,
.is-desktop .cards [data-platform="desktop"] .here {
  display: inline-block;
}

/* --- motion, once more: a visitor who asked for less gets the finished page, still ----------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
