/* ============================================================
   CREANA CLEANING — BASE
   Reset raisonné, typographie, grille, filets, photographie.
   ============================================================ */

/* ─────────────────────────────────────────────
   RESET
   ───────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Pas de scroll-behavior global : il entre en conflit avec le
     scroll piloté et les ancres. Le lissage est décidé au cas par cas. */
}

body {
  margin: 0;
  background: var(--cc-paper);
  color: var(--cc-ink);
  font-family: var(--cc-font-text);
  font-size: var(--cc-size-body);
  line-height: var(--cc-lh-body);
  letter-spacing: var(--cc-track-text);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: var(--cc-selection-bg);
  color: var(--cc-selection-fg);
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, ul, ol, dl {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

img, svg, video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: var(--cc-hairline) solid var(--cc-line-ink);
  outline-offset: 3px;
}

/* ─────────────────────────────────────────────
   TYPOGRAPHIE
   Display = Instrument Serif, une seule graisse.
   La hiérarchie se fait par la taille et le vide,
   jamais par la graisse.
   ───────────────────────────────────────────── */

.cc-hero-title,
.cc-d1,
.cc-d2,
.cc-d3 {
  font-family: var(--cc-font-display);
  font-weight: 400;
  color: var(--cc-ink);
  /* Le serif a un flanc gauche optique : on le recale sur la grille. */
  margin-left: -0.02em;
}

.cc-hero-title {
  font-size: var(--cc-size-hero);
  line-height: var(--cc-lh-hero);
  letter-spacing: var(--cc-track-hero);
  text-wrap: balance;
}

.cc-d1 {
  font-size: var(--cc-size-d1);
  line-height: var(--cc-lh-display);
  letter-spacing: var(--cc-track-display);
  text-wrap: balance;
}

.cc-d2 {
  font-size: var(--cc-size-d2);
  line-height: var(--cc-lh-display);
  letter-spacing: var(--cc-track-display);
  text-wrap: balance;
}

.cc-d3 {
  font-size: var(--cc-size-d3);
  line-height: var(--cc-lh-title);
  letter-spacing: var(--cc-track-display);
}

/* Accent italique — 1 à 2 mots par page. Au-delà, l'effet meurt. */
.cc-accent-italic {
  font-style: italic;
}

/* Coupures manuelles.
   Les <br/> sont composés pour le desktop. Sous 560 px ils
   produisent des lignes orphelines : on rend la main au moteur
   de rendu et text-wrap: balance recompose proprement. */
@media (max-width: 560px) {
  .cc-hero-title br,
  .cc-d1 br,
  .cc-d2 br { display: none; }

  .cc-hero-title,
  .cc-d1,
  .cc-d2 { text-wrap: balance; }
}

/* Titre de rang 3 : on repasse en Switzer. Le serif s'arrête au display. */
.cc-title {
  font-family: var(--cc-font-text);
  font-weight: 500;
  font-size: var(--cc-size-body);
  line-height: var(--cc-lh-title);
  letter-spacing: -0.012em;
  color: var(--cc-ink);
}

.cc-lead {
  font-size: var(--cc-size-lead);
  line-height: var(--cc-lh-lead);
  color: var(--cc-ink-soft);
  max-width: var(--cc-measure-lead);
  text-wrap: pretty;
}

.cc-body {
  font-size: var(--cc-size-body);
  line-height: var(--cc-lh-body);
  color: var(--cc-ink-soft);
  max-width: var(--cc-measure);
}

.cc-small {
  font-size: var(--cc-size-small);
  line-height: 1.55;
  color: var(--cc-ink-soft);
}

/* Eyebrow — le seul usage d'uppercase du système */
.cc-eyebrow {
  font-family: var(--cc-font-text);
  font-weight: 500;
  font-size: var(--cc-size-label);
  letter-spacing: var(--cc-track-label);
  text-transform: uppercase;
  color: var(--cc-ink-soft);
  line-height: 1;
}

/* Index de scène : 01 — Nettoyage courant */
.cc-index {
  font-family: var(--cc-font-text);
  font-weight: 500;
  font-size: var(--cc-size-index);
  letter-spacing: 0.1em;
  color: var(--cc-ink-soft);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Grand chiffre de progression — Switzer Light, pas le serif :
   le serif est réservé aux mots. */
.cc-numeral {
  font-family: var(--cc-font-text);
  font-weight: 300;
  font-size: var(--cc-size-numeral);
  line-height: 0.85;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--cc-ink);
}

/* ─────────────────────────────────────────────
   GRILLE
   ───────────────────────────────────────────── */

.cc-shell {
  width: 100%;
  max-width: var(--cc-max);
  margin-inline: auto;
  padding-inline: var(--cc-margin);
}

.cc-grid {
  display: grid;
  grid-template-columns: repeat(var(--cc-grid-cols), minmax(0, 1fr));
  column-gap: var(--cc-gutter);
}

/* Placements. Volontairement asymétriques : le centrage
   systématique est ce qui donne le look généré. */
.cc-col-1-5  { grid-column: 1 / 6; }
.cc-col-1-6  { grid-column: 1 / 7; }
.cc-col-1-8  { grid-column: 1 / 9; }
.cc-col-2-8  { grid-column: 2 / 9; }
.cc-col-3-9  { grid-column: 3 / 10; }
.cc-col-6-13 { grid-column: 6 / 13; }
.cc-col-7-13 { grid-column: 7 / 13; }
.cc-col-8-13 { grid-column: 8 / 13; }

@media (max-width: 900px) {
  .cc-col-1-5, .cc-col-1-6, .cc-col-1-8,
  .cc-col-2-8, .cc-col-3-9,
  .cc-col-6-13, .cc-col-7-13, .cc-col-8-13 {
    grid-column: 1 / -1;
  }
}

/* Scènes — l'unité de composition de la homepage.
   On parle de scène, pas de section : elles s'enchaînent. */
.cc-scene {
  position: relative;
  padding-block: var(--cc-scene-pad);
}

.cc-scene--tight { padding-block: var(--cc-scene-pad-tight); }
.cc-scene--vast  { padding-block: var(--cc-scene-pad-vast); }

/* Rythme asymétrique.
   Deux scènes qui se répondent forment un seul mouvement :
   la première se referme, la seconde s'ouvre sans reprendre
   sa respiration. C'est ce qui évite l'effet d'empilement. */
.cc-scene--bind-after  { padding-bottom: var(--cc-scene-pad-tight); }
.cc-scene--bind-before { padding-top: var(--cc-scene-pad-tight); }
.cc-scene--lift        { padding-top: var(--cc-scene-pad-vast); }

.cc-scene--surface { background: var(--cc-surface); }
.cc-scene--ink {
  background: var(--cc-ink-bg);
  color: var(--cc-paper-on-ink);
}

/* Les niveaux typographiques déclarent leur couleur : sur fond
   sombre il faut les reprendre un par un, sinon l'encre reste
   posée sur l'encre. */
.cc-scene--ink .cc-body,
.cc-scene--ink .cc-lead,
.cc-scene--ink .cc-small,
.cc-scene--ink .cc-eyebrow,
.cc-scene--ink .cc-index { color: var(--cc-soft-on-ink); }

.cc-scene--ink .cc-hero-title,
.cc-scene--ink .cc-d1,
.cc-scene--ink .cc-d2,
.cc-scene--ink .cc-d3,
.cc-scene--ink .cc-title,
.cc-scene--ink .cc-numeral,
.cc-scene--ink a { color: var(--cc-paper-on-ink); }

/* ─────────────────────────────────────────────
   FILETS
   Le filet remplace la carte. C'est la structure
   visible du site.
   ───────────────────────────────────────────── */

.cc-rule {
  border: 0;
  height: var(--cc-hairline);
  background: var(--cc-line);
  width: 100%;
  margin: 0;
}

.cc-rule--strong { background: var(--cc-line-strong); }
.cc-scene--ink .cc-rule { background: var(--cc-line-on-ink); }

/* Filet qui se dessine à l'entrée dans le viewport.
   Origine à gauche : le tracé va toujours dans le sens de lecture. */
.cc-rule--draw {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--cc-dur-reveal) var(--cc-ease-clean);
}

.cc-rule--draw.is-in { transform: scaleX(1); }

/* ─────────────────────────────────────────────
   PHOTOGRAPHIE
   Une image n'est jamais dans une carte, jamais
   floutée, jamais assombrie par un calque noir.
   ───────────────────────────────────────────── */

.cc-media {
  position: relative;
  overflow: hidden;
  border-radius: var(--cc-radius-media);
  background: var(--cc-surface);
}

.cc-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: var(--cc-photo-filter);
}

.cc-media--portrait  { aspect-ratio: var(--cc-ratio-portrait); }
.cc-media--editorial { aspect-ratio: var(--cc-ratio-editorial); }
.cc-media--landscape { aspect-ratio: var(--cc-ratio-landscape); }
.cc-media--panorama  { aspect-ratio: var(--cc-ratio-panorama); }
/* Les sources sont carrées : ce ratio ne recadre rien. */
.cc-media--square    { aspect-ratio: 1 / 1; }
.cc-media--fill      { height: 100%; }

/* Points d'ancrage de recadrage : le cadrage est une décision
   éditoriale, il se déclare, il ne se subit pas. */
.cc-media--anchor-top    img { object-position: center 22%; }
.cc-media--anchor-center img { object-position: center center; }
.cc-media--anchor-low    img { object-position: center 72%; }

/* Légende — sous l'image, alignée au filet, jamais en surimpression */
.cc-caption {
  display: flex;
  gap: var(--cc-s4);
  padding-top: var(--cc-s3);
  border-top: var(--cc-hairline) solid var(--cc-line);
  margin-top: var(--cc-s3);
  font-size: var(--cc-size-small);
  color: var(--cc-ink-soft);
}

/* ─────────────────────────────────────────────
   ACCESSIBILITÉ
   ───────────────────────────────────────────── */

.cc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.cc-skip-link {
  position: absolute;
  top: var(--cc-s4);
  left: var(--cc-s4);
  z-index: var(--cc-z-overlay);
  padding: var(--cc-s3) var(--cc-s4);
  background: var(--cc-ink);
  color: var(--cc-paper);
  transform: translateY(-200%);
  transition: transform var(--cc-dur-micro) var(--cc-ease-micro);
}

.cc-skip-link:focus { transform: translateY(0); }
