/* ==========================================================================
   Loan Héron Studio — feuille de style unique
   --------------------------------------------------------------------------
   Organisation en cascade layers : l'ordre de priorité est déclaré ici, une
   seule fois. Plus bas = plus prioritaire, quel que soit le sélecteur.
   ========================================================================== */
@layer reset, tokens, base, layout, components, motion, utilities;

/* ==========================================================================
   1. TOKENS — couleurs, espacements, typographie fluide
   ========================================================================== */
@layer tokens {
  :root {
    color-scheme: light dark;

    /* Marque : bleu du logo (Loan Héron Studio). Les navy ne servent plus que
       de texte très foncé ; tout ce qui était « aplat sombre » est passé au bleu. */
    --navy-950: #0a1220;
    --navy-900: #141d2c;
    --navy-800: #1b2434;
    --navy-700: #26334a;
    --navy-600: #3a4a66;
    /* Bleu de la marque. Volontairement un cran plus profond que le bleu vif
       « écran » : le blanc du bouton principal doit rester lisible (4,5:1 au
       minimum). #2f6bf3 tombait juste en dessous, à 4,41:1. */
    --accent: #2563eb;
    --accent-deep: #1d4ed8;
    --accent-soft: color-mix(in oklab, var(--accent) 12%, white);

    /* Surfaces (thème clair par défaut) : blanc franc, les gris sont bleutés
       pour que l'ensemble reste lumineux au lieu de virer au gris terne. */
    --bg: #ffffff;
    --bg-soft: #f6f9ff;
    --bg-card: #ffffff;
    --bg-inset: #eef3fd;
    --ink: #0c1524;
    --ink-soft: #46536a;
    --ink-mute: #5f6c80;
    --line: #e3e8ef;
    --line-strong: #ccd5e1;
    --on-dark: #f2f6fc;
    --on-dark-soft: #a9b6c9;

    /* Teintes utilisées par les maquettes illustratives (SVG intégrés) :
       bleu de la marque au lieu du navy, pour rester clair et cohérent. */
    --mock-strong: #2563eb;
    --mock-line: #d8e4fb;
    --mock-soft: #f0f5ff;
    --mock-ink: #9fb0cc;
    --mock-on-strong: #ffffff;

    /* Ombres : deux couches, une nette + une diffuse (rendu « produit ») */
    --shadow-xs: 0 1px 2px rgba(12, 21, 36, 0.05);
    --shadow-sm: 0 1px 2px rgba(12, 21, 36, 0.06), 0 4px 12px -4px rgba(12, 21, 36, 0.08);
    --shadow-md: 0 2px 4px rgba(12, 21, 36, 0.05), 0 16px 32px -12px rgba(12, 21, 36, 0.16);
    --shadow-lg: 0 32px 72px -28px rgba(12, 21, 36, 0.34);

    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 26px;
    --radius-xl: 34px;
    --radius-pill: 999px;

    /* Rythme */
    --shell: 1200px;
    --gutter: clamp(1.15rem, 4vw, 2.5rem);
    --section: clamp(4rem, 9vw, 8rem);
    --gap: clamp(1rem, 2.2vw, 1.75rem);

    /* Typographie fluide : une seule variable par rôle, pas de media query */
    --fs-display: clamp(2.3rem, 6.2vw, 4.5rem);
    --fs-h1: clamp(2rem, 4.4vw, 3.2rem);
    --fs-h2: clamp(1.55rem, 3vw, 2.35rem);
    --fs-h3: clamp(1.15rem, 1.6vw, 1.4rem);
    --fs-lead: clamp(1.05rem, 1.5vw, 1.3rem);
    --fs-body: clamp(0.99rem, 1.05vw, 1.06rem);
    --fs-small: 0.9rem;
    --fs-xs: 0.78rem;
    --tracking-caps: 0.14em;

    /* Animations */
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --dur: 0.45s;

    --header-h: 76px;
  }

  /* Thème sombre : suit le réglage du système, aucune bascule manuelle */
  @media (prefers-color-scheme: dark) {
    :root {
      --bg: #080e1a;
      --bg-soft: #0d1524;
      --bg-card: #111b2c;
      --bg-inset: #162136;
      --ink: #eef3f9;
      --ink-soft: #b3c0d2;
      --ink-mute: #8b99ad;
      --line: #1f2b40;
      --line-strong: #2c3a52;
      --accent: #5b8cff;
      --accent-deep: #8fb0ff;
      --accent-soft: color-mix(in oklab, var(--accent) 22%, #0d1524);
      --mock-strong: #4a7bf0;
      --mock-line: #26344c;
      --mock-soft: #16223a;
      --mock-ink: #7f8ea6;
      --mock-on-strong: #eaf1ff;
      --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
      --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
      --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.5), 0 16px 32px -12px rgba(0, 0, 0, 0.6);
      --shadow-lg: 0 32px 72px -28px rgba(0, 0, 0, 0.85);
    }
  }
}

/* ==========================================================================
   2. POLICES — Inter variable auto-hébergée (aucun appel à un tiers)
   ========================================================================== */
@font-face {
  font-family: "Inter var";
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter var";
  src: url("/assets/fonts/inter-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ==========================================================================
   3. RESET minimal
   ========================================================================== */
@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  * {
    margin: 0;
  }
  html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1rem);
  }
  body {
    min-height: 100svh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  img,
  svg,
  video {
    display: block;
    max-width: 100%;
  }
  input,
  button,
  textarea,
  select {
    font: inherit;
    color: inherit;
  }
  button {
    background: none;
    border: 0;
    cursor: pointer;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
  ul,
  ol {
    list-style: none;
    padding: 0;
  }
  h1,
  h2,
  h3,
  h4 {
    font-weight: 640;
    line-height: 1.08;
    letter-spacing: -0.022em;
    text-wrap: balance;
  }
  p {
    text-wrap: pretty;
  }
  :target {
    scroll-margin-top: calc(var(--header-h) + 1.5rem);
  }
}

/* ==========================================================================
   4. BASE
   ========================================================================== */
@layer base {
  body {
    font-family: "Inter var", system-ui, -apple-system, "Segoe UI", Roboto,
      "Helvetica Neue", sans-serif;
    font-size: var(--fs-body);
    line-height: 1.62;
    color: var(--ink);
    background: var(--bg);
    font-feature-settings: "cv11" 1, "ss01" 1;
  }

  h1 {
    font-size: var(--fs-h1);
  }
  h2 {
    font-size: var(--fs-h2);
  }
  h3 {
    font-size: var(--fs-h3);
  }

  strong {
    font-weight: 620;
  }

  ::selection {
    background: color-mix(in oklab, var(--accent) 26%, transparent);
  }

  /* Anneau de focus visible uniquement au clavier */
  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
  }

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

  hr {
    border: 0;
    border-top: 1px solid var(--line);
  }

  .visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .skip-link {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    background: var(--navy-800);
    color: var(--on-dark);
    border-radius: var(--radius-sm);
    transform: translateY(-200%);
    transition: transform 0.2s var(--ease);
  }
  .skip-link:focus {
    transform: none;
  }
}

/* ==========================================================================
   5. MISE EN PAGE
   ========================================================================== */
@layer layout {
  .shell {
    width: min(var(--shell), 100% - (var(--gutter) * 2));
    margin-inline: auto;
  }
  .shell-narrow {
    width: min(760px, 100% - (var(--gutter) * 2));
    margin-inline: auto;
  }

  .section {
    padding-block: var(--section);
  }
  .section-sm {
    padding-block: calc(var(--section) * 0.6);
  }
  .bg-soft {
    background: var(--bg-soft);
  }
  .rule {
    border-top: 1px solid var(--line);
  }

  .stack > * + * {
    margin-top: var(--flow, 1.1rem);
  }

  .grid {
    display: grid;
    gap: var(--gap);
  }
  .grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  }
  /* Une grille auto-fit qui reçoit exactement 4 blocs tombe sur 3 colonnes en
     grand écran : le quatrième reste seul et laisse un trou de deux colonnes.
     On force alors le 2×2, qui est équilibré. Uniquement au-delà de 700 px :
     en dessous, une seule colonne pleine largeur. Deux colonnes de 160 px
     rendent les cartes illisibles sur téléphone (texte cassé mot à mot). */
  @media (min-width: 700px) {
    .grid-2:has(> :nth-child(4):last-child) {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
  .grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  }

  .split {
    display: grid;
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
  }
  @media (min-width: 900px) {
    .split {
      grid-template-columns: 1.05fr 0.95fr;
    }
    .split-reverse > :first-child {
      order: 2;
    }
  }

  .head {
    max-width: 62ch;
    margin-bottom: clamp(2rem, 4vw, 3.5rem);
  }
  .head-center {
    margin-inline: auto;
    text-align: center;
  }
}

/* ==========================================================================
   6. COMPOSANTS
   ========================================================================== */
@layer components {
  /* --- Étiquettes & titres de section ------------------------------------ */
  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55em;
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
    color: var(--ink-mute);
  }
  .eyebrow::before {
    content: "";
    width: 1.9rem;
    height: 1px;
    background: var(--line-strong);
  }

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

  .tag {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    font-size: var(--fs-xs);
    font-weight: 560;
    line-height: 1.4;
    color: var(--ink-soft);
    background: var(--bg-inset);
    border-radius: var(--radius-pill);
  }
  .tag-accent {
    color: color-mix(in oklab, var(--accent) 78%, var(--ink));
    background: var(--accent-soft);
  }
  .tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  /* --- Boutons ------------------------------------------------------------ */
  .btn {
    --btn-bg: var(--accent);
    --btn-fg: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 0.85rem 1.5rem;
    font-size: 0.97rem;
    font-weight: 580;
    letter-spacing: -0.01em;
    line-height: 1;
    color: var(--btn-fg);
    background: var(--btn-bg);
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
      background-color 0.25s var(--ease), border-color 0.25s var(--ease),
      color 0.25s var(--ease);
  }
  .btn:hover {
    color: var(--btn-fg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
  .btn:active {
    transform: translateY(0);
  }
  .btn-primary:hover {
    --btn-bg: var(--accent-deep);
  }
  .btn-line {
    --btn-bg: transparent;
    --btn-fg: var(--ink);
    border-color: var(--line-strong);
  }
  .btn-line:hover {
    --btn-fg: var(--ink);
    border-color: var(--ink);
    background: var(--bg-soft);
  }
  .btn-sm {
    padding: 0.62rem 1.05rem;
    font-size: 0.88rem;
  }
  .btn-block {
    width: 100%;
  }
  .btn-arrow::after {
    content: "→";
    transition: transform 0.25s var(--ease);
  }
  .btn-arrow:hover::after {
    transform: translateX(3px);
  }

  .btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
  }

  .link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-weight: 560;
    color: var(--accent);
  }
  .link-arrow::after {
    content: "→";
    transition: transform 0.25s var(--ease);
  }
  .link-arrow:hover::after {
    transform: translateX(4px);
  }

  /* --- En-tête sticky ----------------------------------------------------- */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in oklab, var(--bg) 88%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
    view-transition-name: site-header;
  }
  .site-header[data-scrolled] {
    border-bottom-color: var(--line);
  }
  .header-inner {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 3vw, 2.5rem);
    min-height: var(--header-h);
  }

  .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin-right: auto;
    font-weight: 640;
    letter-spacing: -0.02em;
  }
  .brand:hover {
    color: var(--ink);
  }
  /* Le <picture> est un conteneur en ligne : une hauteur posée sur lui est
     ignorée par le navigateur et l'image s'affiche alors en taille réelle
     (247×304 px). La taille doit donc être posée sur le CONTENEUR en tant que
     boîte, ET sur l'<img> qui est le vrai élément remplacé. */
  .brand-mark {
    --logo: 28px;
    display: inline-flex;
    align-items: center;
    width: auto;
    height: var(--logo);
    view-transition-name: brand-mark;
  }
  .brand-mark img {
    display: block;
    height: var(--logo);
    width: auto;
  }
  .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    font-size: 0.98rem;
  }
  .brand-text span {
    font-size: 0.72rem;
    font-weight: 520;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-top: 1px;
  }

  .nav {
    display: flex;
    align-items: center;
    gap: clamp(0.35rem, 1.4vw, 1.1rem);
  }
  .nav a {
    position: relative;
    padding: 0.4rem 0.15rem;
    font-size: 0.94rem;
    font-weight: 520;
    color: var(--ink-soft);
  }
  .nav a::after {
    content: "";
    position: absolute;
    inset: auto 0.15rem 0.05rem;
    height: 1.5px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease-out);
  }
  .nav a:hover {
    color: var(--ink);
  }
  .nav a:hover::after,
  .nav a[aria-current="page"]::after {
    transform: none;
  }
  .nav a[aria-current="page"] {
    color: var(--ink);
  }

  .header-cta {
    display: inline-flex;
  }

  .nav-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-left: auto;
    font-size: 0.85rem;
    font-weight: 560;
    color: var(--ink);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
  }
  .nav-toggle-bars {
    display: grid;
    gap: 3px;
    width: 15px;
  }
  .nav-toggle-bars i {
    height: 1.5px;
    background: currentColor;
    border-radius: 2px;
  }

  @media (max-width: 860px) {
    .nav,
    .header-cta {
      display: none;
    }
    .nav-toggle {
      display: inline-flex;
    }
  }

  /* Menu mobile : <dialog> natif (piège le focus, ferme avec Échap) */
  .menu-sheet {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--bg);
    color: var(--ink);
    opacity: 0;
    transform: translateY(-1.5rem);
    transition: opacity 0.3s var(--ease), transform 0.35s var(--ease-out),
      overlay 0.3s allow-discrete, display 0.3s allow-discrete;
  }
  .menu-sheet[open] {
    opacity: 1;
    transform: none;
  }
  @starting-style {
    .menu-sheet[open] {
      opacity: 0;
      transform: translateY(-1.5rem);
    }
  }
  .menu-sheet::backdrop {
    background: rgba(8, 14, 26, 0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s var(--ease), overlay 0.3s allow-discrete,
      display 0.3s allow-discrete;
  }
  .menu-sheet[open]::backdrop {
    opacity: 1;
  }
  @starting-style {
    .menu-sheet[open]::backdrop {
      opacity: 0;
    }
  }
  .menu-sheet-inner {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.1rem var(--gutter) 2.5rem;
  }
  .menu-sheet-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: calc(var(--header-h) - 1.1rem);
    margin-bottom: 1.5rem;
  }
  .menu-sheet nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
  }
  .menu-sheet nav a {
    padding: 0.85rem 0;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
  }
  .menu-sheet .btn {
    margin-top: 1.5rem;
  }
  .menu-sheet-contact {
    margin-top: auto;
    padding-top: 2rem;
    display: grid;
    gap: 0.35rem;
    font-size: var(--fs-small);
    color: var(--ink-mute);
  }
  .menu-sheet-contact a {
    color: var(--ink);
    font-weight: 560;
  }

  /* --- Hero -------------------------------------------------------------- */
  .hero {
    position: relative;
    padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(3rem, 7vw, 6rem);
    overflow: clip;
  }
  /* Halo lumineux qui suit le curseur : --mx/--my sont posés par le JS */
  .hero::after {
    content: "";
    position: absolute;
    inset: -30% -10% auto;
    height: 120%;
    background: radial-gradient(
      460px 460px at var(--mx, 72%) var(--my, 12%),
      color-mix(in oklab, var(--accent) 13%, transparent),
      transparent 70%
    );
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.6s var(--ease);
  }
  .hero[data-pointer]::after {
    opacity: 1;
  }

  .hero-title {
    font-size: var(--fs-display);
    font-weight: 660;
    letter-spacing: -0.035em;
    line-height: 1.02;
    max-width: 17ch;
  }
  .hero-title em {
    font-style: normal;
    background: linear-gradient(
      100deg,
      var(--accent),
      var(--accent-deep) 55%,
      var(--accent)
    );
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: sheen 9s var(--ease) infinite;
  }
  @keyframes sheen {
    0%,
    100% {
      background-position: 0% 50%;
    }
    50% {
      background-position: 100% 50%;
    }
  }

  .hero-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.5rem;
    margin-top: clamp(1.6rem, 3vw, 2.4rem);
    padding-top: 1.4rem;
    border-top: 1px solid var(--line);
    font-size: var(--fs-small);
    color: var(--ink-mute);
  }
  .hero-facts li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .hero-facts li::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex: none;
  }

  /* --- Maquette navigateur (visuel du hero) ------------------------------ */
  .mock {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
  }
  .mock-bar {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 0.9rem;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
  }
  .mock-bar i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--line-strong);
  }
  .mock-url {
    flex: 1;
    margin-left: 0.6rem;
    padding: 0.28rem 0.7rem;
    font-size: 0.7rem;
    color: var(--ink-mute);
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .mock-body {
    padding: clamp(0.9rem, 2vw, 1.4rem);
  }
  .mock-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.9rem;
    font-size: var(--fs-xs);
    color: var(--ink-mute);
  }
  .mock-caption b {
    color: var(--ink-soft);
    font-weight: 560;
  }

  /* --- Cartes ------------------------------------------------------------ */
  .card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: clamp(1.4rem, 2.6vw, 2rem);
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
      border-color 0.35s var(--ease);
  }
  .card-hover:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
  }
  /* Carte « mise en avant » : blanche, soulignée d'un liseré et d'une lueur
     bleue. Elle était navy plein écran, ce qui assombrissait toute la page. */
  .card-dark {
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--accent) 7%, var(--bg-card)),
      var(--bg-card)
    );
    border-color: color-mix(in oklab, var(--accent) 26%, var(--line));
    color: var(--ink);
    box-shadow: 0 24px 50px -30px color-mix(in oklab, var(--accent) 50%, transparent);
  }
  .card-dark h3 {
    color: var(--ink);
  }
  .card-dark .lead,
  .card-dark p {
    color: var(--ink-soft);
  }
  .card-dark .tag {
    background: var(--accent-soft);
    color: color-mix(in oklab, var(--accent) 72%, var(--ink));
  }
  .card-dark .btn-line {
    --btn-fg: var(--accent);
    border-color: color-mix(in oklab, var(--accent) 34%, var(--line));
  }
  .card-dark .btn-line:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
  }

  .price {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 1.55rem;
    font-weight: 660;
    letter-spacing: -0.03em;
  }
  .price small {
    font-size: var(--fs-small);
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ink-mute);
  }
  .card-dark .price small {
    color: var(--ink-mute);
  }

  .check-list {
    display: grid;
    gap: 0.6rem;
    font-size: var(--fs-small);
    color: var(--ink-soft);
  }
  .check-list li {
    position: relative;
    padding-left: 1.75rem;
  }
  .check-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.18rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: var(--accent-soft)
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f6bf3' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
      center / 0.7rem no-repeat;
  }
  .card-dark .check-list li::before {
    background-color: rgba(255, 255, 255, 0.12);
  }

  .card-price-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  /* --- Réalisations ------------------------------------------------------ */
  .work {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
      border-color 0.35s var(--ease);
    container-type: inline-size;
  }
  .work:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
  }
  .work-shot {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(160deg, var(--bg-inset), var(--bg-soft));
    border-bottom: 1px solid var(--line);
    overflow: hidden;
  }
  .work-shot img,
  .work-shot svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  /* Le visuel glisse légèrement quand la carte est survolée */
  .work-shot > * {
    transition: transform 0.7s var(--ease-out);
  }
  .work:hover .work-shot > * {
    transform: scale(1.035);
  }
  .work-body {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: clamp(1.2rem, 2.4vw, 1.7rem);
    flex: 1;
  }
  .work-body p {
    font-size: var(--fs-small);
    color: var(--ink-soft);
  }
  .work-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
    padding-top: 0.4rem;
  }
  .work-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: var(--fs-xs);
    color: var(--ink-mute);
  }
  .work-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  .work-status.is-concept::before {
    background: var(--ink-mute);
    box-shadow: 0 0 0 3px var(--bg-inset);
  }

  /* --- Étapes de la méthode --------------------------------------------- */
  .steps {
    counter-reset: step;
    display: grid;
    gap: var(--gap);
  }
  .step {
    position: relative;
    padding-top: 1.6rem;
    border-top: 2px solid var(--line);
    counter-increment: step;
  }
  .step::before {
    content: "0" counter(step);
    position: absolute;
    top: 0.9rem;
    left: 0;
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    color: var(--accent);
  }
  .step h3 {
    margin-bottom: 0.4rem;
  }
  .step p {
    font-size: var(--fs-small);
    color: var(--ink-soft);
  }

  /* --- Bandeau d'appel --------------------------------------------------- */
  /* Bandeau d'appel : carte blanche à liseré bleu (il était bleu nuit plein,
     il fermait la page sur une masse sombre). */
  .cta-band {
    position: relative;
    overflow: clip;
    padding: clamp(2.5rem, 6vw, 4.5rem);
    border-radius: var(--radius-xl);
    border: 1px solid color-mix(in oklab, var(--accent) 22%, var(--line));
    background: radial-gradient(
        120% 140% at 8% 0%,
        color-mix(in oklab, var(--accent) 9%, var(--bg-card)),
        var(--bg-card) 62%
      );
    color: var(--ink);
    box-shadow: var(--shadow-md);
  }
  .cta-band::after {
    content: "";
    position: absolute;
    inset: auto -8% -55% 42%;
    aspect-ratio: 1;
    background: radial-gradient(
      circle,
      color-mix(in oklab, var(--accent) 26%, transparent),
      transparent 62%
    );
    opacity: 0.6;
  }
  .cta-band > * {
    position: relative;
    z-index: 1;
  }
  .cta-band h2 {
    max-width: 22ch;
    color: var(--ink);
  }
  .cta-band p {
    max-width: 46ch;
    margin-top: 0.9rem;
    color: var(--ink-soft);
  }
  .cta-band .btn-row {
    margin-top: 1.8rem;
  }
  .cta-band-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.6rem;
    margin-top: 1.8rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--line);
    font-size: var(--fs-small);
    color: var(--ink-mute);
  }
  .cta-band-contacts a {
    color: var(--accent);
    font-weight: 560;
  }

  /* --- Formulaires ------------------------------------------------------- */
  .form {
    display: grid;
    gap: 1.1rem;
  }
  .field {
    display: grid;
    gap: 0.4rem;
  }
  .field-row {
    display: grid;
    gap: 1.1rem;
  }
  @media (min-width: 640px) {
    .field-row {
      grid-template-columns: 1fr 1fr;
    }
  }
  .field label {
    font-size: var(--fs-small);
    font-weight: 560;
    color: var(--ink);
  }
  .field label span {
    color: var(--ink-mute);
    font-weight: 460;
  }
  .field input,
  .field select,
  .field textarea {
    width: 100%;
    padding: 0.78rem 0.9rem;
    font-size: 0.98rem;
    color: var(--ink);
    background: var(--bg-card);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease),
      background-color 0.2s var(--ease);
  }
  .field textarea {
    min-height: 8.5rem;
    resize: vertical;
  }
  .field select {
    appearance: none;
    padding-right: 2.4rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236d7a8d' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 1.05rem;
  }
  .field input:focus,
  .field select:focus,
  .field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3.5px var(--accent-soft);
  }
  /* Signalement natif : le navigateur sait quand un champ est mal rempli */
  .field input:user-invalid,
  .field textarea:user-invalid {
    border-color: #d94b4b;
    box-shadow: 0 0 0 3.5px color-mix(in oklab, #d94b4b 12%, transparent);
  }
  .field-hint {
    font-size: var(--fs-xs);
    color: var(--ink-mute);
  }
  .consent {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.7rem;
    align-items: start;
    font-size: var(--fs-small);
    color: var(--ink-soft);
  }
  .consent input {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.22rem;
    accent-color: var(--accent);
  }
  /* Pot de miel anti-robot : invisible pour un humain, pas pour un bot */
  .honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }
  .form-status {
    display: none;
    gap: 0.7rem;
    align-items: flex-start;
    padding: 1rem 1.1rem;
    font-size: var(--fs-small);
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--bg-soft);
  }
  .form-status[data-visible] {
    display: flex;
  }
  .form-status[data-state="ok"] {
    border-color: color-mix(in oklab, #1f9d63 40%, var(--line));
    background: color-mix(in oklab, #1f9d63 8%, var(--bg));
  }
  .form-status[data-state="error"] {
    border-color: color-mix(in oklab, #d94b4b 40%, var(--line));
    background: color-mix(in oklab, #d94b4b 8%, var(--bg));
  }
  .form-status b {
    display: block;
  }

  .contact-direct {
    display: grid;
    gap: 0.85rem;
  }
  .contact-line {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-card);
    transition: border-color 0.25s var(--ease), transform 0.25s var(--ease),
      box-shadow 0.25s var(--ease);
  }
  .contact-line:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
  }
  .contact-line-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: var(--radius-sm);
    background: var(--bg-inset);
    color: var(--accent);
  }
  .contact-line svg {
    width: 1.15rem;
    height: 1.15rem;
  }
  .contact-line-text {
    display: grid;
  }
  .contact-line-text span {
    font-size: var(--fs-xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-mute);
  }
  .contact-line-text b {
    font-weight: 580;
    font-size: 1rem;
    letter-spacing: -0.01em;
  }

  /* --- FAQ (balises natives details/summary) ---------------------------- */
  .faq {
    border-top: 1px solid var(--line);
  }
  .faq details {
    border-bottom: 1px solid var(--line);
  }
  .faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 0;
    font-size: 1.05rem;
    font-weight: 580;
    letter-spacing: -0.015em;
    cursor: pointer;
    list-style: none;
  }
  .faq summary::-webkit-details-marker {
    display: none;
  }
  .faq summary::after {
    content: "";
    flex: none;
    width: 1.15rem;
    height: 1.15rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236d7a8d' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E")
      center / contain no-repeat;
    transition: transform 0.3s var(--ease);
  }
  .faq details[open] summary::after {
    transform: rotate(135deg);
  }
  .faq p {
    padding-bottom: 1.35rem;
    max-width: 68ch;
    font-size: var(--fs-small);
    color: var(--ink-soft);
  }

  /* --- Pied de page ------------------------------------------------------ */
  .site-footer {
    margin-top: var(--section);
    padding-block: clamp(2.5rem, 5vw, 4rem) 2rem;
    background: var(--bg-soft);
    border-top: 1px solid var(--line);
  }
  .footer-grid {
    display: grid;
    gap: clamp(1.5rem, 4vw, 3rem);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  }
  .footer-brand {
    display: grid;
    gap: 0.9rem;
    max-width: 34ch;
    font-size: var(--fs-small);
    color: var(--ink-soft);
  }
  .footer-brand .brand {
    margin: 0;
  }
  .footer-col h3 {
    font-size: var(--fs-xs);
    font-weight: 620;
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
    color: var(--ink-mute);
    margin-bottom: 0.9rem;
  }
  .footer-col ul {
    display: grid;
    gap: 0.55rem;
    font-size: var(--fs-small);
  }
  .footer-col a {
    color: var(--ink-soft);
  }
  .footer-col a:hover {
    color: var(--accent);
  }
  .footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: clamp(2rem, 4vw, 3rem);
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    font-size: var(--fs-xs);
    color: var(--ink-mute);
  }

  /* --- Bandeau de confiance (défilement continu) ------------------------ */
  .marquee {
    display: flex;
    gap: 2.5rem;
    padding-block: 1.1rem;
    border-block: 1px solid var(--line);
    overflow: hidden;
    mask-image: linear-gradient(
      90deg,
      transparent,
      #000 12%,
      #000 88%,
      transparent
    );
  }
  .marquee-track {
    display: flex;
    flex: none;
    gap: 2.5rem;
    padding-right: 2.5rem;
    animation: slide 32s linear infinite;
  }
  .marquee span {
    font-size: var(--fs-small);
    font-weight: 520;
    color: var(--ink-mute);
    white-space: nowrap;
  }
  @keyframes slide {
    to {
      transform: translateX(-100%);
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .marquee-track {
      animation: none;
    }
    .marquee {
      flex-wrap: wrap;
      justify-content: center;
    }
  }

  /* --- Démo pizzeria (aperçu embarqué dans la fiche projet) ------------- */
  .work-shot-plain {
    aspect-ratio: 4 / 3;
  }

  /* Aperçu vivant : le vrai site est chargé dans un cadre réduit (pas une image) */
  .work-frame {
    width: 360%;
    height: 360%;
    border: 0;
    transform: scale(0.2778);
    transform-origin: 0 0;
    pointer-events: none;
    background: var(--bg-card);
  }

  /* --- Page légale ------------------------------------------------------- */
  .legal {
    display: grid;
    gap: 2.2rem;
    max-width: 72ch;
  }
  .legal h2 {
    font-size: var(--fs-h3);
    margin-bottom: 0.5rem;
  }
  .legal p,
  .legal li {
    font-size: var(--fs-small);
    color: var(--ink-soft);
  }
  .legal ul {
    display: grid;
    gap: 0.4rem;
    list-style: disc;
    padding-left: 1.2rem;
  }
  .legal dl {
    display: grid;
    gap: 0.35rem;
  }
  .legal dt {
    font-weight: 580;
    font-size: var(--fs-small);
  }
  .legal dd {
    font-size: var(--fs-small);
    color: var(--ink-soft);
  }
  .todo-field {
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: color-mix(in oklab, #e8b93b 22%, transparent);
    border-bottom: 1px dashed #c79a20;
  }
}

/* ==========================================================================
   7. MOUVEMENT — apparitions au défilement + transitions de page
   ========================================================================== */
@layer motion {
  /* Transition entre pages (API View Transitions, Chromium) : le logo et
     l'en-tête sont conservés d'une page à l'autre, le reste se fond. */
  @view-transition {
    navigation: auto;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.32s;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  }

  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      opacity: 0;
      transform: translateY(18px);
      transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
      transition-delay: var(--d, 0ms);
    }
    .reveal.is-in {
      opacity: 1;
      transform: none;
    }

    /* Quand le navigateur gère les animations pilotées par le défilement,
       on s'en sert pour les éléments purement décoratifs. */
    @supports (animation-timeline: view()) {
      .hero-visual {
        animation: lift linear both;
        animation-timeline: view();
        animation-range: cover 0% cover 70%;
      }
      @keyframes lift {
        to {
          transform: translateY(-34px);
        }
      }
    }
  }

  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
    .reveal {
      opacity: 1;
      transform: none;
    }
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
      animation: none !important;
    }
  }

  /* Sans JavaScript, rien ne doit rester invisible : les blocs animés
     à l'apparition sont affichés d'emblée. */
  /* --- Téléphone : boutons plus sobres ----------------------------------- */
  @media (max-width: 640px) {
    .btn {
      padding: 0.68rem 1.15rem;
      font-size: 0.9rem;
    }
    .btn-sm {
      padding: 0.55rem 0.9rem;
      font-size: 0.83rem;
    }
    .btn-row {
      gap: 0.5rem;
    }
  }

  /* --- Cartes de réalisation repliées quand elles sont étroites ---------- */
  /* Sur téléphone, c'est la description qui fait toute la hauteur des cartes.
     On ne la supprime pas : on la replie derrière un bouton « Détails ».
     Le repli dépend de la LARGEUR DE LA CARTE et non de celle de l'écran
     (requête de conteneur) : une carte étroite est illisible de toute façon,
     même sur un grand écran. Seul le clic a besoin de JavaScript : sans JS la
     classe .is-pliable n'existe pas et la description reste affichée — aucun
     contenu ne peut disparaître. */
  /* Contrôle secondaire, volontairement discret : il ne doit pas concurrencer
     le bouton d'action de la carte. La zone tapable reste confortable (40 px)
     alors que le dessin, lui, est petit. */
  .work-more {
    display: none;
    align-items: center;
    gap: 0.4em;
    align-self: flex-start;
    min-height: 40px;
    margin: -0.55rem 0;
    padding: 0;
    font-size: 0.79rem;
    font-weight: 640;
    letter-spacing: 0.01em;
    color: var(--accent);
    background: none;
    border: 0;
    cursor: pointer;
  }
  .work-more:hover {
    color: var(--accent-deep);
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  .work-more::after {
    content: "";
    width: 0.4em;
    height: 0.4em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-0.15em) rotate(45deg);
    transition: transform 0.3s var(--ease);
  }
  .work.is-open .work-more::after {
    transform: translateY(0.05em) rotate(225deg);
  }
  @keyframes deplier {
    from {
      opacity: 0;
      transform: translateY(-4px);
    }
  }
  .work.is-open .work-desc {
    animation: deplier 0.28s var(--ease) both;
  }

  @container (max-width: 430px) {
    .work.is-pliable .work-more {
      display: inline-flex;
    }
    .work.is-pliable .work-desc {
      display: none;
    }
    .work.is-pliable.is-open .work-desc {
      display: block;
    }
    .work-body {
      gap: 0.55rem;
      padding: 1.1rem;
    }
    .tag {
      padding: 0.28rem 0.6rem;
      font-size: 0.7rem;
    }
    .tag-row {
      gap: 0.35rem;
    }
  }

  @media (scripting: none) {
    .reveal {
      opacity: 1;
      transform: none;
      transition: none;
    }
  }
}

/* ==========================================================================
   8. UTILITAIRES
   ========================================================================== */
@layer utilities {
  .center {
    text-align: center;
  }
  .mt-0 {
    margin-top: 0;
  }
  .legal-updated {
    color: var(--ink-mute);
    font-size: var(--fs-small);
    margin-top: 2.4em;
    padding-top: 1.2em;
    border-top: 1px solid var(--line);
  }

  .mt-s {
    margin-top: 0.7rem;
  }
  .mt-m {
    margin-top: 1.5rem;
  }
  .mt-l {
    margin-top: 2.5rem;
  }
  .mb-m {
    margin-bottom: 1.5rem;
  }
  .shell-tight {
    width: min(980px, 100% - (var(--gutter) * 2));
  }
  .nowrap {
    white-space: nowrap;
  }
  .mono {
    font-variant-numeric: tabular-nums;
  }
}
