/* ============================================================
   labs/composer • Couche « page » v1 (PROPOSITION, hors BUS)

   Le BUS s'arrête à --im-fs-4 (15 px) et --im-space-8 (40 px) et n'a ni
   fond d'ambiance ni tracking de capitales. Cette couche propose les
   tokens --cx-* manquants, dérivés du BUS et des rôles (cf. tickets.md
   BUS-1, BUS-2 et references/ANALYSE.md). Rien ici n'est en dur côté
   couleur : tout vient des rôles --im-* (repli sur les primitives).

   v1 (votes de JM, cycle 001 : « lourd », « gris », « noir agressif »,
   « pas de gradation », « flotte ») : titres plus fins, fond d'ambiance,
   niveaux de surface et ancrage (.cx-band, .cx-rule, .cx-frame).
   v1.1 (notes de JM sur les pages du site : premium-story est l'étalon) :
   typo petite (titre ≤ 36 px, corps 15 px, libellés 12 px en capitales),
   lumière diffuse forte et fixe en sombre, bande = verre léger.
   v1.2 (votes du cycle 002) : intensité de lumière par page (data-light="douce|forte").
   v1.4 : la lumière d'ambiance est un réglage du BUS (<html data-ambient>, css/bus.ambient.css,
   branche ambiance-bus). .cx-ambient reste un alias historique, sans lumière propre.
   ============================================================ */

:root{
  /* Typo éditoriale : 4 niveaux utiles, fins */
  --cx-fs-display: clamp(1.75rem, 1.35rem + 1.3vw, 2.25rem); /* 28 → 36 px, hero seulement */
  --cx-fs-h1: clamp(1.5rem, 1.3rem + 0.7vw, 2rem);           /* 24 → 32 px */
  --cx-fs-h2: 1.25rem;                                       /* 20 px */
  --cx-fs-h3: 1rem;                                          /* 16 px */
  --cx-fs-lead: 1rem;
  --cx-fs-body: 0.9375rem;                                   /* 15 px */
  --cx-fs-small: var(--im-fs-2);                             /* 13 px */
  --cx-fs-caption: var(--im-fs-1);                           /* 12 px */
  --cx-w-display: var(--im-w-medium);
  --cx-w-title: var(--im-w-medium);
  --cx-w-label: var(--im-w-semibold);
  --cx-lh-tight: 1.12;
  --cx-lh-snug: 1.3;
  --cx-lh-body: 1.55;
  --cx-tracking-tight: -0.015em;
  --cx-tracking-caps: 0.06em;
  /* Longueur de ligne */
  --cx-measure: 65ch;
  --cx-measure-narrow: 45ch;
  /* Rythme : prolonge --im-space-* (4…40) vers les sections */
  --cx-space-section: clamp(48px, 4vw + 24px, 96px);
  --cx-space-block: var(--im-space-8);
}
.cx-page{
  font-family: var(--im-font-ui);
  font-size: var(--cx-fs-body);
  line-height: var(--cx-lh-body);
  color: var(--im-on-surface, var(--text-fg));
  /* transparent : le fond et la lumière d'ambiance du BUS sont portés par <body> */
  background: transparent;
  -webkit-font-smoothing: antialiased;
}
.cx-page *, .cx-page *::before, .cx-page *::after{ box-sizing: border-box; }
.cx-page :where(h1, h2, h3, h4){
  margin: 0;
  font-weight: var(--cx-w-title);
  line-height: var(--cx-lh-snug);
  text-wrap: balance;
}
.cx-page :where(h1){ font-size: var(--cx-fs-h1); line-height: var(--cx-lh-tight); letter-spacing: var(--cx-tracking-tight); }
.cx-page :where(h2){ font-size: var(--cx-fs-h2); letter-spacing: var(--cx-tracking-tight); }
.cx-page :where(h3){ font-size: var(--cx-fs-h3); font-weight: var(--cx-w-label); }
.cx-page :where(h4){ font-size: var(--cx-fs-body); font-weight: var(--cx-w-label); }
.cx-page :where(p, ul, ol, dl, blockquote, figure){ margin: 0; }
.cx-page :where(p, li, dd){ max-width: var(--cx-measure); text-wrap: pretty; }
.cx-page :where(ul, ol){ padding-left: var(--im-space-5); }
.cx-page :where(small){ font-size: var(--cx-fs-small); }
.cx-page :where(img){ display: block; max-width: 100%; height: auto; border-radius: var(--radius-md); }
.cx-page :where(a){ color: var(--im-on-surface, currentColor); text-decoration-thickness: var(--stroke-1); text-decoration-color: var(--im-line, var(--line)); text-underline-offset: 0.25em; }
.cx-page :where(a:hover){ text-decoration-color: currentColor; }
/* Pas de rôle « texte d'accent » lisible sur --im-bg dans tous les thèmes (deep est sombre en dark) : cf. tickets BUS-2 */
.cx-page :where(strong){ font-weight: var(--im-w-semibold); }

/* ---------- Typo ---------- */
.cx-display{ font-size: var(--cx-fs-display); font-weight: var(--cx-w-display); line-height: var(--cx-lh-tight); letter-spacing: var(--cx-tracking-tight); }
.cx-lead{ font-size: var(--cx-fs-lead); color: var(--im-on-surface-muted, var(--text-muted)); }
.cx-muted{ color: var(--im-on-surface-muted, var(--text-muted)); }
.cx-eyebrow{ font-size: var(--cx-fs-caption); font-weight: var(--im-w-bold); letter-spacing: var(--cx-tracking-caps); text-transform: uppercase; color: var(--im-on-surface-muted, var(--text-muted)); }
.cx-title{ font-size: var(--cx-fs-h3); font-weight: var(--im-w-bold); line-height: var(--cx-lh-snug); }
.cx-kpi{ font-size: var(--cx-fs-h2); font-weight: var(--cx-w-title); line-height: var(--cx-lh-tight); font-variant-numeric: tabular-nums; }
.cx-num{ font-variant-numeric: tabular-nums; }
.cx-measure{ max-width: var(--cx-measure); }
.cx-center{ text-align: center; margin-inline: auto; }
.cx-sr{ position: absolute; inline-size: var(--stroke-1); block-size: var(--stroke-1); overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cx-block{ display: block; inline-size: 100%; }

/* ---------- Rythme ---------- */
.cx-section{ padding-block: var(--cx-space-section); }

/* ---------- Niveau 0 : lumière d'ambiance ----------
   Réglage du BUS : le cadre pose <html data-ambient> d'après la déclaration ambient=… de la composition.
   .cx-ambient ne dessine plus rien : il garde seulement la hauteur minimale de la page. */
.cx-ambient{ min-block-size: 100vh; }

/* ---------- Niveau 1 : bande ----------
   Verre léger posé sur l'ambiance : grand rayon, filet très léger, pas d'ombre,
   très translucide pour laisser passer la lumière (équivalent de glass="ghost"). */
.cx-band{
  background: color-mix(in oklab, var(--im-surface, var(--bg-card)) 22%, transparent);
  border: var(--stroke-1) solid var(--im-line-soft, var(--line-soft));
  border-radius: var(--radius-2xl);
  backdrop-filter: blur(var(--im-space-5)) saturate(1.1);
}

/* ---------- Ancrage ---------- */
.cx-rule{ border-block-end: var(--stroke-1) solid var(--im-line-soft, var(--line-soft)); }
.cx-rule-top{ border-block-start: var(--stroke-1) solid var(--im-line-soft, var(--line-soft)); }
.cx-topbar{
  position: sticky; top: 0; z-index: var(--z-header);
  background: color-mix(in oklab, var(--im-bg, var(--bg-page)) 72%, transparent);
  backdrop-filter: blur(var(--im-space-4)) saturate(1.2);
  border-block-end: var(--stroke-1) solid var(--im-line-soft, var(--line-soft));
}

/* ---------- Images encadrées ---------- */
.cx-frame{
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: var(--stroke-1) solid var(--im-line-soft, var(--line-soft));
  box-shadow: var(--shadow-shadow2);
}
.cx-frame img{ border-radius: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
