/* ==========================================================================
   2G Labs — Design system « Le point de rencontre »
   Un point = une personne. Une ligne = une rencontre.
   Noir encre, papier, et un seul orange : celui du point du logo.
   ========================================================================== */

@layer reset, tokens, base, layout, components, games, pages, utilities;

/* ── Polices (auto-hébergées, SIL Open Font License) ───────────────────── */
@font-face {
  font-family: "Darker Grotesque";
  src: url("/assets/fonts/darker-grotesque-var-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/atkinson-hyperlegible-next-var-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { min-height: 100vh; line-height: 1.6; -webkit-font-smoothing: antialiased; }
  img, svg, video, canvas { display: block; max-width: 100%; }
  img { height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { cursor: pointer; background: none; border: 0; padding: 0; }
  p, h1, h2, h3, h4, li, dd, dt, blockquote { overflow-wrap: break-word; }
  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
  table { border-collapse: collapse; }
  [hidden] { display: none !important; }
}

/* ── Tokens ─────────────────────────────────────────────────────────────── */
@layer tokens {
  :root {
    /* Marque */
    --orange: #FD881F;          /* point du logo — aplats, éléments graphiques */
    --orange-deep: #A64A00;     /* orange lisible sur fond clair (5,1:1) */
    --ink: #0E0E0E;
    --ink-2: #171717;
    --ink-3: #242424;
    --paper: #F6F3EE;
    --paper-2: #EDE8E0;
    --white: #FFFFFF;
    --togather: #FDD835;        /* réservé aux sections ToGather */

    /* Couleurs d'intérêts (mini-jeux) — toujours doublées d'une icône */
    --c-hike: #2F9E6B;
    --c-music: #6C5CE7;
    --c-food: #E2553F;
    --c-games: #1F8FD6;
    --c-books: #C2862B;

    /* Rôles — thème clair */
    --bg: var(--paper);
    --bg-raised: #FFFFFF;
    --bg-sunken: var(--paper-2);
    --text: var(--ink);
    --text-muted: #5E5A54;      /* 6,2:1 sur --paper */
    --line: #D9D3C9;
    --line-strong: #B9B1A5;
    --field-border: #857D72;     /* bord des champs : 4,1:1 sur blanc (WCAG 1.4.11) */
    --accent: var(--orange);
    --accent-text: var(--orange-deep);
    --on-accent: var(--ink);
    --focus: var(--orange-deep);
    --grid-dot: rgb(14 14 14 / 0.13);
    --btn-bg: var(--ink);
    --btn-text: var(--paper);
    --shadow: 0 1px 2px rgb(14 14 14 / 0.06), 0 8px 24px -12px rgb(14 14 14 / 0.18);
    --shadow-lg: 0 2px 4px rgb(14 14 14 / 0.06), 0 24px 60px -24px rgb(14 14 14 / 0.35);
    color-scheme: light;

    /* Typographie */
    --font-display: "Darker Grotesque", "Arial Narrow", system-ui, sans-serif;
    --font-body: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;

    --step--2: clamp(0.72rem, 0.7rem + 0.1vw, 0.78rem);
    --step--1: clamp(0.86rem, 0.83rem + 0.15vw, 0.94rem);
    --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
    --step-1: clamp(1.2rem, 1.12rem + 0.4vw, 1.45rem);
    --step-2: clamp(1.5rem, 1.33rem + 0.85vw, 2.05rem);
    --step-3: clamp(1.95rem, 1.6rem + 1.75vw, 3rem);
    --step-4: clamp(2.5rem, 1.9rem + 3vw, 4.5rem);
    --step-5: clamp(3rem, 2rem + 5.2vw, 6.75rem);
    --step-6: clamp(3.4rem, 1.6rem + 8.4vw, 9.5rem);

    /* Espacements */
    --space-3xs: 0.25rem;
    --space-2xs: 0.5rem;
    --space-xs: 0.75rem;
    --space-s: 1rem;
    --space-m: 1.5rem;
    --space-l: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4.5rem;
    --space-section: clamp(4rem, 2.5rem + 7vw, 9rem);

    --container: 76rem;
    --container-narrow: 46rem;
    --gutter: clamp(1rem, 0.5rem + 3vw, 2.5rem);
    --header-h: 4.25rem;

    --radius-s: 0.5rem;
    --radius-m: 1rem;
    --radius-l: 1.5rem;
    --radius-xl: 2rem;
    --radius-full: 999px;

    --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --dur-fast: 150ms;
    --dur: 280ms;
  }

  /* Thème sombre : préférence système, sauf choix explicite « clair » */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: var(--ink);
      --bg-raised: #1C1C1C;
      --bg-sunken: #171717;
      --text: var(--paper);
      --text-muted: #ABA59C;
      --line: #2B2B2B;
      --line-strong: #444;
      --field-border: #8A847A;
      --accent-text: var(--orange);
      --focus: var(--orange);
      --grid-dot: rgb(246 243 238 / 0.1);
      --btn-bg: var(--paper);
      --btn-text: var(--ink);
      --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px -12px rgb(0 0 0 / 0.6);
      --shadow-lg: 0 24px 60px -24px rgb(0 0 0 / 0.8);
      color-scheme: dark;
    }
  }
  :root[data-theme="dark"] {
    --bg: var(--ink);
    --bg-raised: #1C1C1C;
    --bg-sunken: #171717;
    --text: var(--paper);
    --text-muted: #ABA59C;
    --line: #2B2B2B;
    --line-strong: #444;
    --field-border: #8A847A;
    --accent-text: var(--orange);
    --focus: var(--orange);
    --grid-dot: rgb(246 243 238 / 0.1);
    --btn-bg: var(--paper);
    --btn-text: var(--ink);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px -12px rgb(0 0 0 / 0.6);
    --shadow-lg: 0 24px 60px -24px rgb(0 0 0 / 0.8);
    color-scheme: dark;
  }
}

/* ── Base ───────────────────────────────────────────────────────────────── */
@layer base {
  html {
    scroll-padding-top: calc(var(--header-h) + 1rem);
    background: var(--bg);
  }
  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }
  body {
    font-family: var(--font-body);
    font-size: var(--step-0);
    color: var(--text);
    background: var(--bg);
    overflow-x: clip;
    text-rendering: optimizeLegibility;
  }
  h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 750;
    line-height: 0.95;
    letter-spacing: -0.015em;
    text-wrap: balance;
  }
  h1 { font-size: var(--step-5); }
  h2 { font-size: var(--step-4); }
  h3 { font-size: var(--step-2); line-height: 1.05; }
  h4 { font-size: var(--step-1); line-height: 1.1; }
  p { text-wrap: pretty; }
  a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: text-decoration-thickness var(--dur-fast), color var(--dur-fast);
  }
  a:hover { text-decoration-thickness: 2px; }
  strong { font-weight: 700; }
  ::selection { background: var(--orange); color: var(--ink); }
  :focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    border-radius: 4px;
  }
  hr { border: 0; border-top: 1px solid var(--line); }
  main:focus { outline: none; }
  abbr[title] { text-decoration: underline dotted; cursor: help; }
}

/* ── Mise en page ───────────────────────────────────────────────────────── */
@layer layout {
  .container {
    width: min(100% - 2 * var(--gutter), var(--container));
    margin-inline: auto;
  }
  .container--narrow { width: min(100% - 2 * var(--gutter), var(--container-narrow)); }

  .section { padding-block: var(--space-section); position: relative; }
  .section--tight { padding-block: calc(var(--space-section) * 0.6); }
  /* Deux sections « simples » consécutives partagent leur espacement */
  .section:not(.section--ink, .section--sunken) + .section:not(.section--ink, .section--sunken) { padding-top: 0; }
  .section--sunken { background: var(--bg-sunken); }
  .section--ink {
    background: var(--ink);
    color: var(--paper);
    --text: var(--paper);
    --text-muted: #ABA59C;
    --line: #2E2E2E;
    --line-strong: #4A4A4A;
    --bg-raised: var(--ink-2);
    --accent-text: var(--orange);
    --focus: var(--orange);
    --grid-dot: rgb(246 243 238 / 0.09);
    --btn-bg: var(--paper);
    --btn-text: var(--ink);
    color-scheme: dark;
  }
  :root[data-theme="dark"] .section--ink { background: #050505; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .section--ink { background: #050505; }
  }

  /* Grilles à paliers explicites : une seule colonne sur mobile, puis 2, 3 ou 4
     colonnes — jamais de carte orpheline sur une ligne (3, 6 ou 4 éléments). */
  .grid { display: grid; gap: var(--space-m); }
  @media (min-width: 40rem) {
    .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (min-width: 64rem) {
    .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  }

  .split {
    display: grid;
    gap: var(--space-xl) var(--space-2xl);
    align-items: center;
  }
  @media (min-width: 60rem) {
    .split { grid-template-columns: 1fr 1fr; }
    .split--wide-left { grid-template-columns: 1.15fr 0.85fr; }
    .split--wide-right { grid-template-columns: 0.85fr 1.15fr; }
    .split--top { align-items: start; }
  }

  .stack > * + * { margin-top: var(--stack, var(--space-s)); }
  .stack-l > * + * { margin-top: var(--space-l); }

  .cluster { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; }

  .bg-grid {
    background-image: radial-gradient(circle at 1px 1px, var(--grid-dot) 1.2px, transparent 1.6px);
    background-size: 28px 28px;
    background-position: -14px -14px;
  }
}

/* ── Composants ─────────────────────────────────────────────────────────── */
@layer components {

  /* Lien d'évitement */
  .skip-link {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1000;
    padding: 0.75rem 1.25rem;
    background: var(--orange);
    color: var(--ink);
    font-weight: 700;
    border-radius: var(--radius-full);
    transform: translateY(-200%);
    transition: transform var(--dur) var(--ease-out);
  }
  .skip-link:focus { transform: none; }

  /* Icônes (sprite SVG) */
  .icon {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .icon--l { width: 2rem; height: 2rem; }
  .icon--xl { width: 2.75rem; height: 2.75rem; stroke-width: 1.5; }
  .icon--flip { transform: scaleX(-1); }

  /* Le point orange — signature de la marque */
  .dot {
    color: var(--orange);
  }
  .dot-mark {
    display: inline-block;
    width: 0.62em;
    height: 0.62em;
    border-radius: 50%;
    background: var(--orange);
    vertical-align: baseline;
  }

  /* Surtitre façon carnet de labo : « ● EXP. 01 — MISSION » */
  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    font-family: var(--font-mono);
    font-size: var(--step--2);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
  }
  .eyebrow::before {
    content: "";
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: var(--orange);
    flex-shrink: 0;
  }

  .lead {
    font-size: var(--step-1);
    line-height: 1.5;
    color: var(--text-muted);
    max-width: 38rem;
  }
  .muted { color: var(--text-muted); }

  /* En-tête de section */
  .section-head {
    display: grid;
    gap: var(--space-s);
    margin-bottom: var(--space-xl);
    max-width: 52rem;
  }
  .section-head--center { margin-inline: auto; text-align: center; justify-items: center; }
  .section-head h2 { margin-top: var(--space-2xs); }

  /* Boutons */
  .btn {
    --_bg: var(--btn-bg);
    --_fg: var(--btn-text);
    --_bd: var(--_bg);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6em;
    min-height: 3rem;
    padding: 0.7rem 1.4rem;
    border: 1.5px solid var(--_bd);
    border-radius: var(--radius-full);
    background: var(--_bg);
    color: var(--_fg);
    font-family: var(--font-body);
    font-size: var(--step-0);
    font-weight: 650;
    line-height: 1.1;
    text-decoration: none;
    isolation: isolate;
    overflow: hidden;
    transition: transform var(--dur) var(--ease-out), background-color var(--dur), color var(--dur), border-color var(--dur);
  }
  /* Le point qui grandit au survol */
  .btn::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: 1.1rem;
    top: 50%;
    width: 0.5rem;
    height: 0.5rem;
    margin-top: -0.25rem;
    border-radius: 50%;
    background: var(--orange);
    transform: scale(0);
    transition: transform 450ms var(--ease-out);
  }
  .btn:hover::before { transform: scale(60); }
  .btn:hover { --_fg: var(--ink); --_bd: var(--orange); text-decoration: none; }
  .btn:active { transform: scale(0.97); }
  .btn .icon { transition: transform var(--dur) var(--ease-out); }
  .btn:hover .icon--move { transform: translateX(3px); }
  .btn:hover .icon--out { transform: translate(2px, -2px); }

  .btn--accent { --_bg: var(--orange); --_fg: var(--ink); }
  .btn--accent::before { background: var(--ink); }
  .btn--accent:hover { --_fg: var(--paper); --_bd: var(--ink); }
  .section--ink .btn--accent::before { background: var(--paper); }
  .section--ink .btn--accent:hover { --_fg: var(--ink); --_bd: var(--paper); }

  .btn--ghost { --_bg: transparent; --_fg: var(--text); --_bd: var(--line-strong); }
  .btn--small { min-height: 2.5rem; padding: 0.45rem 1.05rem; font-size: var(--step--1); }
  .btn--small::before { left: 0.8rem; }

  .btn-row { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; }
  .btn-row--center { justify-content: center; }

  /* Lien fléché */
  .link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-weight: 650;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1.5px solid var(--orange);
    padding-bottom: 0.1em;
  }
  .link-arrow .icon { transition: transform var(--dur) var(--ease-out); }
  .link-arrow:hover .icon { transform: translateX(3px); }

  /* ── En-tête du site ─────────────────────────────────────────────── */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    transition: background-color var(--dur), box-shadow var(--dur), border-color var(--dur);
    border-bottom: 1px solid transparent;
  }
  .site-header.is-scrolled {
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
    border-bottom-color: var(--line);
  }
  .site-header__inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-m);
  }
  .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--text);
    margin-right: auto;
    border-radius: var(--radius-full);
  }
  .brand .mark { width: 2.4rem; height: 2.4rem; }
  .brand .wordmark { height: 1.45rem; width: auto; }
  .mark__bg { fill: var(--ink); }
  .mark__glyphs { fill: #fff; }
  .mark__dot, .wordmark__dot { fill: var(--orange); }
  .brand .mark__dot { view-transition-name: brand-dot; }
  :root[data-theme="dark"] :is(.brand, .spec__title) .mark__bg { fill: var(--paper); }
  :root[data-theme="dark"] :is(.brand, .spec__title) .mark__glyphs { fill: var(--ink); }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) :is(.brand, .spec__title) .mark__bg { fill: var(--paper); }
    :root:not([data-theme="light"]) :is(.brand, .spec__title) .mark__glyphs { fill: var(--ink); }
  }
  @media (prefers-reduced-motion: no-preference) {
    .brand:hover .mark__dot { animation: dot-bounce 600ms var(--ease-spring); transform-box: fill-box; transform-origin: center; }
  }

  .nav { display: flex; align-items: center; gap: var(--space-m); }
  .nav__list { display: flex; gap: 0.25rem; }
  .nav__link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: var(--step--1);
    text-decoration: none;
    border-radius: var(--radius-full);
    color: var(--text);
  }
  .nav__link::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0.1rem;
    width: 0.38rem;
    height: 0.38rem;
    margin-left: -0.19rem;
    border-radius: 50%;
    background: var(--orange);
    transform: scale(0);
    transition: transform var(--dur) var(--ease-spring);
  }
  .nav__link:hover::after { transform: scale(0.7); }
  .nav__link[aria-current]::after { transform: scale(1); }

  .header-actions { display: flex; align-items: center; gap: 0.35rem; }
  .icon-btn {
    display: inline-grid;
    place-items: center;
    min-width: 2.75rem;
    height: 2.75rem;
    padding-inline: 0.6rem;
    border-radius: var(--radius-full);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: var(--step--2);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-decoration: none;
    border: 1px solid transparent;
    transition: border-color var(--dur), background-color var(--dur);
  }
  .icon-btn:hover { border-color: var(--line-strong); }
  .icon-btn .icon { width: 1.3rem; height: 1.3rem; }
  .theme-toggle .icon--sun { display: none; }
  :root[data-theme="dark"] .theme-toggle .icon--sun { display: block; }
  :root[data-theme="dark"] .theme-toggle .icon--moon { display: none; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon--sun { display: block; }
    :root:not([data-theme="light"]) .theme-toggle .icon--moon { display: none; }
  }
  html:not(.js) .theme-toggle, html:not(.js) .menu-toggle { display: none; }

  .menu-toggle { display: none; }
  .header-cta { margin-left: 0.4rem; }

  @media (max-width: 63.99rem) {
    .menu-toggle { display: inline-grid; }
    .header-cta { display: none; }
    .js .nav {
      position: fixed;
      inset: var(--header-h) 0 0 0;
      z-index: 99;
      flex-direction: column;
      align-items: stretch;
      justify-content: space-between;
      gap: var(--space-l);
      padding: var(--space-l) var(--gutter) calc(var(--space-l) + env(safe-area-inset-bottom));
      background: var(--bg);
      overflow-y: auto;
      visibility: hidden;
      opacity: 0;
      transform: translateY(-0.75rem);
      transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out), visibility 0s linear var(--dur);
    }
    .js .nav.is-open {
      visibility: visible;
      opacity: 1;
      transform: none;
      transition-delay: 0s;
    }
    .js .nav__list { flex-direction: column; gap: 0; }
    .js .nav__link {
      font-family: var(--font-display);
      font-size: var(--step-4);
      font-weight: 750;
      line-height: 1;
      padding: 0.55rem 0;
      border-radius: 0;
      border-bottom: 1px solid var(--line);
    }
    .js .nav__link::after { left: auto; right: 0.25rem; top: 50%; bottom: auto; margin: -0.3rem 0 0; width: 0.6rem; height: 0.6rem; }
    .nav .btn { align-self: flex-start; }
    html:not(.js) .nav { flex-wrap: wrap; }
    html:not(.js) .site-header { height: auto; position: static; }
  }
  @media (min-width: 64rem) {
    .nav .nav__cta-mobile { display: none; }
  }
  .menu-toggle .icon--close { display: none; }
  .menu-toggle[aria-expanded="true"] .icon--close { display: block; }
  .menu-toggle[aria-expanded="true"] .icon--menu { display: none; }
  body.menu-open { overflow: hidden; }

  /* ── Fil d'Ariane ────────────────────────────────────────────────── */
  .breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: var(--step--2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
  }
  .breadcrumb li + li::before { content: "/"; margin-right: 0.4rem; opacity: 0.6; }
  .breadcrumb a { text-decoration: none; }
  .breadcrumb a:hover { text-decoration: underline; color: var(--text); }

  /* ── Hero de page ────────────────────────────────────────────────── */
  .page-hero {
    padding-block: clamp(3rem, 2rem + 5vw, 7rem) clamp(3rem, 2rem + 4vw, 6rem);
    border-bottom: 1px solid var(--line);
  }
  .page-hero__inner { display: grid; gap: var(--space-m); }
  .page-hero h1 { font-size: var(--step-5); max-width: 18ch; }
  .page-hero .lead { max-width: 44rem; }
  .page-hero__meta { display: flex; flex-wrap: wrap; gap: var(--space-s) var(--space-l); align-items: center; }

  /* ── Cartes ──────────────────────────────────────────────────────── */
  .card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-s);
    padding: clamp(1.4rem, 1rem + 1.2vw, 2rem);
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    transition: transform var(--dur) var(--ease-out), border-color var(--dur), box-shadow var(--dur);
  }
  .card h3 { font-size: var(--step-2); }
  .card p { color: var(--text-muted); }
  .card p.statement, .card p.lead { color: var(--text); }
  .card__num {
    font-family: var(--font-mono);
    font-size: var(--step--2);
    letter-spacing: 0.1em;
    color: var(--text-muted);
  }
  .card__icon {
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    color: var(--text);
  }
  .card__icon .icon { width: 1.5rem; height: 1.5rem; }
  /* Le coin « point » qui s'allume */
  .card--hover::after {
    content: "";
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--line-strong);
    transition: background-color var(--dur), transform var(--dur) var(--ease-spring);
  }
  .card--hover:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-3px); }
  .card--hover:hover::after { background: var(--orange); transform: scale(1.4); }
  .card--link { text-decoration: none; color: inherit; }
  .card--link .link-arrow { margin-top: auto; }
  .card--link:focus-visible { outline-offset: 4px; }
  .card--ink { background: var(--ink); color: var(--paper); border-color: var(--ink); --text-muted: #ABA59C; }

  /* Titre d'un projet mis en avant (niveau h3, taille de titre de section) */
  .project-title { font-size: var(--step-4); }

  /* Liste à coches */
  .checklist { display: grid; gap: 0.55rem; padding: 0; list-style: none; }
  .checklist li { display: flex; gap: 0.6rem; align-items: flex-start; }
  .checklist .icon { color: var(--accent-text); margin-top: 0.2rem; }

  /* Badges officiels des stores (Apple, Google) : artwork non modifié, sans animation,
     même hauteur que les boutons (3rem), espace libre d'au moins ¼ de la hauteur */
  .store-block { display: grid; gap: var(--space-s); justify-items: start; }
  .store-links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
  .store-badge { display: block; flex: none; border-radius: 0.6rem; line-height: 0; }
  .store-badge img { height: 3rem; width: auto; }
  /* Très petits écrans : 40 px (minimum Apple à l'écran) pour garder les deux badges sur une ligne */
  @media (max-width: 23rem) {
    .store-badge img { height: 2.5rem; }
  }

  /* Liste numérotée façon « règles du labo » */
  /* La mise en page dépend de la largeur réelle de la liste (container query) */
  .rules { display: grid; gap: 0; counter-reset: rule; border-top: 1px solid var(--line); container-type: inline-size; }
  .rules > li {
    counter-increment: rule;
    display: grid;
    grid-template-columns: 2.75rem 1fr;
    column-gap: var(--space-s);
    row-gap: 0.4rem;
    padding-block: var(--space-m);
    border-bottom: 1px solid var(--line);
  }
  .rules > li::before {
    content: counter(rule, decimal-leading-zero);
    grid-row: span 2;
    font-family: var(--font-mono);
    font-size: var(--step--1);
    color: var(--accent-text);
    padding-top: 0.35rem;
  }
  .rules > li > * { grid-column: 2; }
  .rules h3 { font-size: var(--step-2); }
  .rules p { color: var(--text-muted); max-width: 44rem; }
  @container (min-width: 46rem) {
    .rules > li { grid-template-columns: 5rem 1fr 1.2fr; align-items: baseline; }
    .rules > li::before { grid-row: auto; }
    .rules > li > h3 { grid-column: 2; }
    .rules > li > p { grid-column: 3; }
  }

  /* Fiche « spécimen » (infos légales, repères) */
  .spec {
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    padding: clamp(1.25rem, 1rem + 1vw, 2rem);
    position: relative;
  }
  .spec__title {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding-bottom: var(--space-s);
    margin-bottom: var(--space-2xs);
    border-bottom: 2px solid var(--text);
    font-family: var(--font-mono);
    font-size: var(--step--2);
    text-transform: uppercase;
    letter-spacing: 0.12em;
  }
  .spec__title .mark { width: 1.75rem; height: 1.75rem; flex: none; }
  .spec dl { display: grid; }
  .spec dl > div {
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
    padding-block: 0.7rem;
    border-bottom: 1px dashed var(--line-strong);
    font-size: var(--step--1);
  }
  .spec dl > div:last-child { border-bottom: 0; }
  .spec dt { color: var(--text-muted); flex: 0 0 auto; }
  .spec dd { margin-left: auto; text-align: right; font-weight: 650; }

  /* Repères chiffrés */
  .facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
  }
  .fact {
    padding: var(--space-m);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 0.35rem;
    align-content: start;
    container-type: inline-size; /* le chiffre s'adapte à la largeur réelle de sa cellule */
  }
  .facts--2 { grid-template-columns: 1fr 1fr; }
  /* Mobile et tablette : deux colonnes, le dernier repère impair occupe toute la ligne */
  @media (max-width: 63.99rem) {
    .facts { grid-template-columns: 1fr 1fr; }
    .fact:last-child:nth-child(odd) { grid-column: 1 / -1; }
  }
  .fact__value {
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 32cqi, 5.5rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.03em;
  }
  .fact__value .dot { font-size: 0.9em; }
  .fact__label { font-size: var(--step--1); color: var(--text-muted); max-width: 18ch; }

  /* Frise chronologique */
  .timeline { position: relative; display: grid; gap: var(--space-l); padding-left: 2rem; }
  .timeline::before {
    content: "";
    position: absolute;
    left: 0.45rem;
    top: 0.6rem;
    bottom: 0.6rem;
    width: 2px;
    background: linear-gradient(var(--text) 0 66%, transparent 66% 100%) 0 0 / 2px 100% no-repeat,
                repeating-linear-gradient(var(--line-strong) 0 6px, transparent 6px 12px);
  }
  .timeline__item { position: relative; }
  .timeline__item::before {
    content: "";
    position: absolute;
    left: -2rem;
    top: 0.35rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: var(--text);
    border: 3px solid var(--bg);
    box-shadow: 0 0 0 1.5px var(--text);
  }
  .timeline__item--now::before { background: var(--orange); box-shadow: 0 0 0 1.5px var(--orange); }
  .timeline__item--next::before { background: var(--bg); box-shadow: 0 0 0 1.5px var(--line-strong); }
  .timeline__date {
    font-family: var(--font-mono);
    font-size: var(--step--2);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-text);
  }
  .timeline h3 { margin-block: 0.35rem 0.5rem; }
  .timeline p { color: var(--text-muted); max-width: 40rem; }

  /* Badge */
  .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--line-strong);
    font-size: var(--step--2);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  /* Pastille « Disponible » : le halo du point (3 px) ne colle ni au bord ni au texte,
     et la marge droite compense l'interlettrage final pour un rendu symétrique */
  .badge--live {
    flex: none;
    white-space: nowrap;
    gap: 0.7em;
    padding: 0.35rem calc(0.8rem - 0.08em) 0.35rem 0.6rem;
  }
  .badge--live::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    margin-left: 3px;
    border-radius: 50%;
    background: #2F9E6B;
    box-shadow: 0 0 0 3px rgb(47 158 107 / 0.25);
  }

  /* Bannière d'appel à l'action */
  .cta-panel {
    position: relative;
    display: grid;
    gap: var(--space-m);
    padding: clamp(2rem, 1rem + 5vw, 5rem);
    border-radius: var(--radius-xl);
    background: var(--orange);
    color: var(--ink);
    overflow: hidden;
    --text-muted: rgb(14 14 14 / 0.78);
    --focus: var(--ink);
    --btn-bg: var(--ink);
    --btn-text: var(--paper);
  }
  .cta-panel h2 { font-size: var(--step-5); max-width: 14ch; }
  /* Le réseau de points décoratif n'apparaît que lorsqu'il a la place */
  @media (min-width: 64rem) {
    .cta-panel__dots { display: block; }
    .cta-panel > :not(.cta-panel__dots) { max-width: 40rem; }
  }
  .cta-panel .lead { color: var(--text-muted); }
  .cta-panel .btn::before { background: var(--paper); }
  .cta-panel .btn:hover { --_fg: var(--ink); --_bd: var(--ink); }
  .cta-panel .btn--ghost { --_fg: var(--ink); --_bd: var(--ink); }
  .cta-panel__dots {
    display: none;
    position: absolute;
    right: -4rem;
    bottom: -4rem;
    width: min(28rem, 60%);
    opacity: 0.9;
    pointer-events: none;
  }

  /* Accordéon (FAQ) */
  .faq { border-top: 1px solid var(--line); }
  .faq:has(> .faq__group:first-child) { border-top: 0; }
  .faq > .faq__group:first-child { margin-top: 0; }
  .faq details { border-bottom: 1px solid var(--line); }
  .faq summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-m);
    padding-block: var(--space-m);
    cursor: pointer;
    list-style: none;
    font-family: var(--font-display);
    font-size: var(--step-2);
    font-weight: 700;
    line-height: 1.1;
  }
  .faq summary::-webkit-details-marker { display: none; }
  .faq summary::after {
    content: "";
    flex-shrink: 0;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    border: 1.5px solid var(--line-strong);
    background:
      linear-gradient(var(--text), var(--text)) center / 0.7rem 1.5px no-repeat,
      linear-gradient(var(--text), var(--text)) center / 1.5px 0.7rem no-repeat;
    transition: transform var(--dur) var(--ease-out), background-color var(--dur), border-color var(--dur);
  }
  .faq details[open] summary::after {
    transform: rotate(45deg);
    background-color: var(--orange);
    border-color: var(--orange);
  }
  .faq summary:hover::after { border-color: var(--text); }
  .faq__answer { padding-bottom: var(--space-m); max-width: 46rem; color: var(--text-muted); }
  .faq__answer > * + * { margin-top: 0.75rem; }
  .faq__answer a { color: var(--accent-text); }
  .faq h2.faq__group {
    font-size: var(--step-1);
    font-family: var(--font-mono);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin: var(--space-xl) 0 var(--space-xs);
  }

  /* Texte long (mentions, confidentialité, guides) */
  .prose { max-width: 70ch; }
  .prose > * + * { margin-top: 1.1em; }
  .prose h2 { font-size: var(--step-3); margin-top: 2.2em; scroll-margin-top: calc(var(--header-h) + 1rem); }
  .prose h3 { font-size: var(--step-2); margin-top: 1.8em; }
  .prose h2 + *, .prose h3 + * { margin-top: 0.8em; }
  .prose p, .prose li { color: var(--text); }
  .prose a { color: var(--accent-text); }
  .prose ul, .prose ol { padding-left: 1.3em; }
  .prose li + li { margin-top: 0.4em; }
  .prose ul li::marker { color: var(--orange); content: "● "; font-size: 0.8em; }
  .prose blockquote {
    border-left: 4px solid var(--orange);
    padding: 0.4em 0 0.4em 1.2em;
    font-family: var(--font-display);
    font-size: var(--step-2);
    font-weight: 700;
    line-height: 1.15;
  }
  .prose table { width: 100%; font-size: var(--step--1); }
  .prose th, .prose td { text-align: left; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
  .prose thead th { font-family: var(--font-mono); font-size: var(--step--2); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); border-bottom: 2px solid var(--text); }
  .prose tbody th { font-weight: 650; width: 38%; }
  .table-wrap { overflow-x: auto; }

  .callout {
    padding: var(--space-m);
    border-radius: var(--radius-m);
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-left: 4px solid var(--orange);
  }
  .callout > * + * { margin-top: 0.6rem; }
  .callout ul { padding-left: 1.2em; }

  .toc {
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
    font-size: var(--step--1);
  }
  .toc ol { display: grid; gap: 0.15rem; padding: 0; list-style: none; }
  .toc a { display: block; padding: 0.3rem 0; color: var(--text-muted); text-decoration: none; }
  .toc a:hover { color: var(--text); }
  /* minmax(0, 1fr) : un tableau large défile dans son cadre au lieu d'élargir toute la page */
  .doc-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); }
  @media (min-width: 64rem) {
    .doc-layout { grid-template-columns: 15rem minmax(0, 1fr); }
  }
  @media (max-width: 63.99rem) {
    .toc { position: static; }
  }

  /* Formulaires */
  .form { display: grid; gap: var(--space-m); }
  .form__row { display: grid; gap: var(--space-m); }
  @media (min-width: 40rem) { .form__row { grid-template-columns: 1fr 1fr; } }
  .field { display: grid; gap: 0.4rem; }
  .field label { font-weight: 650; font-size: var(--step--1); }
  .req { color: var(--accent-text); }
  .field input, .field select, .field textarea {
    width: 100%;
    min-height: 3rem;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--field-border);
    border-radius: var(--radius-m);
    background: var(--bg-raised);
    color: var(--text);
    transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  }
  .field textarea { min-height: 9rem; resize: vertical; }
  .field input:hover, .field select:hover, .field textarea:hover { border-color: var(--text-muted); }
  .field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
    outline: none;
    border-color: var(--text);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 45%, transparent);
  }
  .field__hint { font-size: var(--step--2); color: var(--text-muted); }
  /* Case à cocher (consentement) : case à gauche, libellé, information et erreur alignés à droite */
  .field--check { grid-template-columns: auto 1fr; column-gap: var(--space-xs); align-items: start; }
  .field--check > :not(input) { grid-column: 2; }
  .field--check label { font-weight: 400; font-size: var(--step--1); line-height: 1.45; }
  .field.field--check input {
    width: 1.375rem;
    height: 1.375rem;
    min-height: 0;
    margin-top: 0.1rem;
    padding: 0;
    accent-color: var(--orange);
    cursor: pointer;
  }
  .field.field--check input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; box-shadow: none; }
  .field__error { font-size: var(--step--1); font-weight: 600; color: #B3261E; min-height: 0; }
  :root[data-theme="dark"] .field__error { color: #FF8A80; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .field__error { color: #FF8A80; } }
  .field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #B3261E; }
  .form__status { padding: var(--space-s) var(--space-m); border-radius: var(--radius-m); font-weight: 600; }
  .form__status--ok { background: color-mix(in srgb, #2F9E6B 16%, var(--bg-raised)); border: 1px solid #2F9E6B; }
  .form__status--error { background: color-mix(in srgb, #B3261E 12%, var(--bg-raised)); border: 1px solid #B3261E; }
  .hp-field { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

  /* Liste de contacts */
  .contact-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
  .contact-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 1rem;
    align-items: center;
    padding-block: var(--space-s);
    border-bottom: 1px solid var(--line);
  }
  .contact-item .icon { grid-row: span 2; width: 1.6rem; height: 1.6rem; color: var(--accent-text); }
  .contact-item__label { font-size: var(--step--1); color: var(--text-muted); }
  .contact-item a { font-weight: 650; }

  /* Onglets (kit média) */
  .tabs__list {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.3rem;
    border-radius: var(--radius-full);
    background: var(--bg-sunken);
    border: 1px solid var(--line);
    margin-bottom: var(--space-l);
  }
  .tabs__tab {
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius-full);
    font-weight: 650;
    color: var(--text-muted);
  }
  .tabs__tab[aria-selected="true"] { background: var(--btn-bg); color: var(--btn-text); }
  .tabs__panel:focus-visible { outline-offset: 8px; }
  html:not(.js) .tabs__list { display: none; }
  html:not(.js) .tabs__panel[hidden] { display: block !important; margin-top: var(--space-xl); }

  .assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr)); gap: var(--space-s); }
  .asset {
    display: grid;
    grid-template-rows: auto 1fr;
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    overflow: hidden;
    text-decoration: none;
    background: var(--bg-raised);
    transition: border-color var(--dur), transform var(--dur) var(--ease-out);
  }
  .asset:hover { border-color: var(--text); transform: translateY(-2px); }
  .asset__preview {
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: var(--bg-sunken);
    background-image: linear-gradient(45deg, var(--line) 25%, transparent 25%, transparent 75%, var(--line) 75%),
                      linear-gradient(45deg, var(--line) 25%, transparent 25%, transparent 75%, var(--line) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
  }
  .asset__preview--dark { background-color: var(--ink); background-image: none; color: var(--paper); }
  .asset__preview--light { background-color: #fff; background-image: none; }
  .asset__preview img { max-height: 6.5rem; width: auto; object-fit: contain; }
  .asset__meta { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.75rem 0.9rem; }
  .asset__name { font-weight: 650; font-size: var(--step--1); display: block; }
  .asset__type { font-family: var(--font-mono); font-size: var(--step--2); color: var(--text-muted); }
  .asset__meta .icon { color: var(--accent-text); }

  .swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: var(--space-s); }
  .swatch {
    display: grid;
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    overflow: hidden;
    text-align: left;
    background: var(--bg-raised);
  }
  .swatch__chip { height: clamp(4rem, 3rem + 3vw, 6rem); box-shadow: inset 0 -1px 0 var(--line); }
  .swatch__chip--orange { background: var(--orange); }
  .swatch__chip--ink { background: var(--ink); }
  .swatch__chip--paper { background: var(--paper); }
  .swatch__chip--deep { background: var(--orange-deep); }
  .swatch__chip--togather { background: var(--togather); }
  .swatch__body { padding: 0.75rem 0.9rem; display: grid; gap: 0.15rem; }
  .swatch__name { font-weight: 650; }
  .swatch__hex { font-family: var(--font-mono); font-size: var(--step--1); color: var(--text-muted); }
  .swatch__copy { font-size: var(--step--2); color: var(--accent-text); font-weight: 600; }
  .swatch:hover { border-color: var(--text); }

  .boilerplate {
    position: relative;
    padding: var(--space-m);
    padding-top: 3.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    background: var(--bg-raised);
  }
  .boilerplate__copy { position: absolute; top: 0.75rem; right: 0.75rem; }
  .boilerplate__label { position: absolute; top: 1.1rem; left: var(--space-m); }

  /* ── Pied de page ────────────────────────────────────────────────── */
  .site-footer {
    background: var(--ink);
    color: var(--paper);
    --text: var(--paper);
    --text-muted: #ABA59C;
    --line: #2B2B2B;
    --focus: var(--orange);
    --accent-text: var(--orange);
    padding-top: var(--space-2xl);
    overflow: hidden;
    color-scheme: dark;
  }
  :root[data-theme="dark"] .site-footer { background: #050505; border-top: 1px solid #1d1d1d; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .site-footer { background: #050505; border-top: 1px solid #1d1d1d; }
  }
  .footer-grid {
    display: grid;
    gap: var(--space-xl) var(--space-l);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-brand { grid-column: 1 / -1; display: grid; gap: var(--space-s); max-width: 30rem; }
  @media (min-width: 40rem) {
    .footer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  }
  @media (min-width: 64rem) {
    .footer-grid { grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); gap: var(--space-xl); }
    .footer-brand { grid-column: auto; }
  }
  .footer-brand p { color: var(--text-muted); }
  .footer-col h2 {
    font-family: var(--font-mono);
    font-size: var(--step--2);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: var(--space-s);
  }
  .footer-col ul { display: grid; gap: 0.5rem; }
  .footer-col a { text-decoration: none; font-weight: 500; }
  .footer-col a:hover { color: var(--orange); }
  .footer-social { display: flex; gap: 0.5rem; }
  .footer-social a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    text-decoration: none;
    font-size: var(--step--1);
  }
  .footer-social a:hover { border-color: var(--orange); }
  .footer-giant {
    position: relative;
    margin-block: var(--space-2xl) clamp(1.75rem, 1rem + 3vw, 3.5rem); /* le jambage du « g » ne touche pas le filet */
    color: var(--paper);
    line-height: 0;
    user-select: none;
  }
  .footer-giant .wordmark { width: 100%; height: auto; }
  .footer-giant__dot {
    position: absolute;
    /* positionné au-dessus du point du logotype (proportions du viewBox) */
    right: 0.9%;
    bottom: 26.5%;
    width: 7.8%;
    aspect-ratio: 1;
    border-radius: 50%;
    cursor: pointer;
  }
  .footer-giant__dot:focus-visible { outline-offset: 2px; border-radius: 50%; }
  .footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-s);
    padding-block: var(--space-m) var(--space-l);
    border-top: 1px solid var(--line);
    font-size: var(--step--1);
    color: var(--text-muted);
  }
  .footer-bottom nav ul { display: flex; flex-wrap: wrap; gap: var(--space-m); }
  .footer-bottom a { display: inline-flex; align-items: center; gap: 0.4rem; text-decoration: none; }
  .footer-bottom a:hover { color: var(--paper); text-decoration: underline; }

  /* Particules de l'easter egg */
  .burst-dot {
    position: fixed;
    z-index: 999;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border-radius: 50%;
    background: var(--orange);
    pointer-events: none;
  }
}

/* ── Mini-jeux (habillage commun) ───────────────────────────────────────── */
@layer games {
  .game {
    --game-bg: var(--bg-raised);
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr auto;
    border: 1.5px solid var(--text);
    border-radius: var(--radius-l);
    background: var(--game-bg);
    overflow: hidden;
    box-shadow: 6px 6px 0 var(--text);
  }
  .game__head, .game__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 0.7rem 1rem;
    font-family: var(--font-mono);
    font-size: var(--step--2);
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }
  .game__head { border-bottom: 1.5px solid var(--text); }
  .game__foot { border-top: 1px solid var(--line); text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: var(--step--1); color: var(--text-muted); }
  .game__title { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; }
  .game__title::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--orange); }
  .game__counter { font-variant-numeric: tabular-nums; }
  .game__board { position: relative; min-height: 18rem; }
  .game__board.bg-grid { background-color: var(--bg); }
  .game__status { min-height: 1.5em; }
  .game__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: var(--step--2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
  }
  .game__btn:hover { border-color: var(--text); }
  .game__btn .icon { width: 1rem; height: 1rem; }

  /* Écran de lancement (chargement à la demande) */
  .game__launch {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: var(--space-s);
    padding: var(--space-m);
    text-align: center;
  }
  .game__launch p { max-width: 26rem; color: var(--text-muted); font-size: var(--step--1); }
  .game__launch-icon {
    display: grid;
    place-items: center;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    border: 1.5px solid var(--text);
    background: var(--bg-raised);
    color: var(--text);
    box-shadow: 4px 4px 0 var(--orange);
  }

  /* Écran de fin */
  .game__end {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    align-content: center;
    gap: var(--space-s);
    padding: var(--space-l);
    text-align: center;
    background: color-mix(in srgb, var(--game-bg) 90%, transparent);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
  }
  .game__end h3 { font-size: var(--step-3); max-width: 16ch; }
  .game__end p { max-width: 30rem; color: var(--text-muted); }
  @media (prefers-reduced-motion: no-preference) {
    .game__end { animation: pop-in 420ms var(--ease-spring) both; }
  }

  /* Pastille « intérêt » : couleur + icône (jamais la couleur seule) */
  .interest {
    --c: var(--text);
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--c);
    color: #fff;
  }
  .interest--hike { --c: var(--c-hike); }
  .interest--music { --c: var(--c-music); }
  .interest--food { --c: var(--c-food); }
  .interest--games { --c: var(--c-games); }
  .interest--books { --c: var(--c-books); }
  .interest .icon { width: 55%; height: 55%; stroke-width: 2; }

  .skip-game {
    position: absolute;
    left: 50%;
    top: 0.5rem;
    z-index: 10;
    transform: translate(-50%, -300%);
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-full);
    background: var(--orange);
    color: var(--ink);
    font-weight: 700;
    font-size: var(--step--1);
  }
  .skip-game:focus { transform: translate(-50%, 0); }
}

/* ── Pages ──────────────────────────────────────────────────────────────── */
@layer pages {
  /* Accueil — hero */
  .hero {
    position: relative;
    padding-block: clamp(2.5rem, 1rem + 5vw, 6rem) clamp(3.5rem, 2rem + 5vw, 7rem);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
  }
  .hero__grid { display: grid; gap: var(--space-xl); align-items: center; }
  /* Tablette : le plateau de jeu ne s'étire pas sur toute la largeur */
  .hero__grid > .game { width: 100%; max-width: 36rem; }
  @media (min-width: 64rem) {
    /* Le jeu peut être haut : le texte reste en haut et accompagne le défilement */
    .hero__grid { grid-template-columns: 1.08fr 0.92fr; gap: var(--space-2xl); align-items: start; }
    .hero__grid > :first-child { position: sticky; top: calc(var(--header-h) + var(--space-l)); padding-top: var(--space-l); }
  }
  .hero h1 {
    /* Plafonné : au-delà de 1280 px, la colonne ne s'élargit plus, le titre non plus */
    font-size: clamp(3.4rem, 1.6rem + 8.4vw, 8.25rem);
    font-weight: 800;
    line-height: 0.86;
    letter-spacing: -0.035em;
  }
  .hero h1 .line { display: block; }
  .hero__lead { margin-block: var(--space-m) var(--space-l); }
  .hero .btn-row { margin-bottom: var(--space-l); }
  .hero__note {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: var(--step--1);
    color: var(--text-muted);
  }
  .hero__note .icon { color: var(--accent-text); }
  /* Ligne de disponibilité (pastille + plateformes) : le texte passe sous la pastille
     quand la place manque, au lieu de s'écraser à côté d'elle */
  .availability { flex-wrap: wrap; gap: var(--space-2xs) var(--space-xs); }

  /* Grand énoncé de section */
  .statement {
    font-family: var(--font-display);
    font-size: var(--step-4);
    font-weight: 750;
    line-height: 1;
    letter-spacing: -0.02em;
    max-width: 22ch;
    text-wrap: balance;
  }
  .statement em {
    font-style: normal;
    background: linear-gradient(transparent 62%, color-mix(in srgb, var(--orange) 70%, transparent) 62% 92%, transparent 92%);
    padding-inline: 0.05em;
  }
  .statement--center { margin-inline: auto; text-align: center; }

  /* Téléphone ToGather : vraies captures d'écran dans un cadre sobre */
  .phone {
    position: relative;
    width: min(100%, 19rem);
    margin-inline: auto;
    padding: 0.55rem;
    border-radius: 2.5rem;
    background: #151515;
    box-shadow: inset 0 0 0 1.5px #3a3a3a, var(--shadow-lg);
  }
  /* Bouton latéral, pour la silhouette */
  .phone::before {
    content: "";
    position: absolute;
    right: -3px;
    top: 22%;
    width: 3px;
    height: 12%;
    border-radius: 0 3px 3px 0;
    background: #2a2a2a;
  }
  .phone__screen {
    position: relative;
    display: grid;
    aspect-ratio: 1280 / 2772;
    border-radius: 2rem;
    overflow: hidden;
    background: var(--togather);
  }
  /* Caméra « poinçon », dans la zone libre de la barre d'état */
  .phone__screen::after {
    content: "";
    position: absolute;
    top: 1.6%;
    left: 50%;
    width: 0.62rem;
    height: 0.62rem;
    margin-left: -0.31rem;
    border-radius: 50%;
    background: #0b0b0b;
    box-shadow: 0 0 0 2px rgb(0 0 0 / 0.15);
  }
  .phone__shot {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 380ms var(--ease-out);
  }
  .phone__shot.is-active { opacity: 1; }
  /* Galerie de captures (page ToGather) — défilement horizontal aimanté */
  .screens__controls { display: flex; justify-content: flex-end; gap: 0.5rem; margin-bottom: var(--space-s); }
  .screens__btn { border-color: var(--line-strong); }
  .screens__btn[aria-disabled="true"] { opacity: 0.35; cursor: default; }
  html:not(.js) .screens__controls { display: none; }
  .screens__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(15rem, 66vw);
    gap: clamp(1.25rem, 0.75rem + 2vw, 2.5rem);
    margin: 0;
    padding: 0.75rem 0.5rem 1.5rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
    border-radius: var(--radius-m);
  }
  .screens__track:focus-visible { outline-offset: 2px; }
  .screens__item { scroll-snap-align: start; }
  .screens figure { display: grid; gap: var(--space-m); }
  .screens figcaption { display: grid; gap: 0.3rem; }
  .screens figcaption strong { font-family: var(--font-display); font-size: var(--step-2); font-weight: 750; line-height: 1.05; }
  .screens figcaption span:last-child { color: var(--text-muted); font-size: var(--step--1); }
  .screens__num { font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: 0.1em; color: var(--accent-text); }
  .phone--small { width: 100%; padding: 0.42rem; border-radius: 2rem; box-shadow: inset 0 0 0 1.5px #3a3a3a, var(--shadow); }
  .phone--small .phone__screen { border-radius: 1.65rem; }
  .phone--small .phone__screen::after { width: 0.5rem; height: 0.5rem; margin-left: -0.25rem; }
  @media (prefers-reduced-motion: no-preference) {
    .screens__track { scroll-behavior: smooth; }
  }

  .mode-switch {
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    width: min(100%, 24rem);
    padding: 0.3rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--line-strong);
    margin-bottom: var(--space-m);
  }
  .mode-switch button {
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: var(--step--1);
    font-weight: 650;
    white-space: nowrap;
    color: var(--text-muted);
    transition: background-color var(--dur), color var(--dur);
  }
  .mode-switch button[aria-pressed="true"] { background: var(--togather); color: var(--ink); }
  .mode-desc { min-height: 7.5rem; }

  .togather-mark {
    display: inline-flex;
    justify-self: start;
    width: fit-content;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem 0.35rem 0.4rem;
    border-radius: var(--radius-full);
    background: var(--togather);
    color: var(--ink);
    font-weight: 700;
    font-size: var(--step--1);
  }
  .togather-mark::before { content: ""; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--ink); box-shadow: inset 0 0 0 5px var(--togather), inset 0 0 0 9px var(--ink); }

  /* Comparatif de modes */
  .modes { display: grid; gap: var(--space-m); }
  @media (min-width: 56rem) { .modes { grid-template-columns: 1fr 1fr; } }
  .mode-card { padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); border-radius: var(--radius-l); border: 1px solid var(--line); background: var(--bg-raised); display: grid; gap: var(--space-s); align-content: start; }
  .mode-card--balanced { border-top: 6px solid var(--togather); }
  .mode-card--discovery { border-top: 6px solid var(--orange); }
  .mode-card ul { display: grid; gap: 0.5rem; list-style: none; padding: 0; margin-top: var(--space-2xs); }
  .mode-card li { display: flex; gap: 0.6rem; align-items: flex-start; }
  .mode-card li .icon { color: var(--accent-text); margin-top: 0.15rem; }

  /* 404 */
  @media (min-width: 64rem) {
    .notfound { min-height: 70vh; display: grid; align-items: center; }
  }
  .notfound__code { font-family: var(--font-display); font-weight: 800; font-size: clamp(6rem, 4rem + 14vw, 16rem); line-height: 0.8; letter-spacing: -0.05em; }

  /* Guides */
  .article-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: var(--step--1); color: var(--text-muted); }
  .key-takeaways { padding: var(--space-m); border-radius: var(--radius-m); background: var(--bg-raised); border: 1px solid var(--line); }
  .key-takeaways h2 { font-size: var(--step-1); font-family: var(--font-mono); font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; margin: 0 0 0.6rem; }
  .key-takeaways ul { padding-left: 1.2em; }
}

/* ── Utilitaires ────────────────────────────────────────────────────────── */
@layer utilities {
  .visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .text-center { text-align: center; }
  .mt-s { margin-top: var(--space-s); }
  .mt-m { margin-top: var(--space-m); }
  .mt-l { margin-top: var(--space-l); }
  .mt-xl { margin-top: var(--space-xl); }
  .mb-l { margin-bottom: var(--space-l); }
  .mx-auto { margin-inline: auto; }
  .max-prose { max-width: 62ch; }
  .nowrap { white-space: nowrap; }
}

/* ── Mouvement ──────────────────────────────────────────────────────────── */
@keyframes dot-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-38%) scale(1.15); }
  65% { transform: translateY(6%) scale(0.92, 1.08); }
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: none; }
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}
@keyframes shake {
  0%, 100% { transform: translate(-50%, -50%); }
  25% { transform: translate(calc(-50% - 5px), -50%); }
  75% { transform: translate(calc(-50% + 5px), -50%); }
}

/* Apparition au scroll — CSS pur, sans JavaScript (amélioration progressive) */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }

  /* Transitions entre pages (navigateurs compatibles) */
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: 180ms ease-in both vt-out; }
  ::view-transition-new(root) { animation: 320ms var(--ease-out) both vt-in; }
  ::view-transition-group(brand-dot) { animation-duration: 450ms; animation-timing-function: var(--ease-spring); }
}
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Impression ─────────────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .game, .skip-link, .cta-panel, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
  .section { padding-block: 1.5rem; }
}
