/* Kelvin v2 — feuille unique. Couleurs et axes typo dans palettes.css (un jeu par palette). */
:root {
  --gouttiere: clamp(16px, 3vw, 44px);
  --entete: 64px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --rayon: 12px;   /* un seul rayon : cartes et boutons ; les images restent à angle vif */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--entete) + 8px); }
@media (pointer: fine) { html { overscroll-behavior: none; } }
body { margin: 0; background: var(--fond); color: var(--texte); font: 400 17px/1.55 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent-texte); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--sombre); }

.evitement { position: absolute; left: -9999px; top: 8px; z-index: 20; padding: 8px 12px; background: var(--texte); color: var(--fond); }
.evitement:focus { left: 8px; }

.mono { font-family: 'Martian Mono', ui-monospace, monospace; font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.titre { hyphens: auto; overflow-wrap: break-word; margin: 0; font-family: 'Anybody'; font-stretch: var(--titre-largeur); font-weight: var(--titre-graisse); letter-spacing: var(--titre-approche); line-height: .92; color: var(--titre); text-wrap: balance; }
h2.titre { font-size: clamp(32px, 5.4vw, 84px); }
.chapo { max-width: 46ch; margin: 18px 0 0; }

/* En-tête : la régie, toujours à portée */
.entete { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--entete); padding: 0 var(--gouttiere); background: var(--fond); border-bottom: 1px solid var(--filet); }
.marque { font: 800 22px/1 'Anybody'; font-stretch: 130%; letter-spacing: -.02em; color: var(--titre); text-decoration: none; }
.marque b { color: var(--accent-texte); font-weight: inherit; }
.regie { display: flex; align-items: center; gap: 12px; }
.mini-palettes { display: flex; gap: 6px; }
.mini { display: grid; grid-template-columns: 3fr 2fr 1fr; width: 44px; height: 32px; padding: 0; border: 1px solid var(--filet); border-radius: 6px; overflow: hidden; background: none; cursor: pointer; transition: transform .15s var(--ease); }
.mini i { display: block; }
.mini[data-choisir="energie"] i:nth-child(1) { background: #0A0A0A; } .mini[data-choisir="energie"] i:nth-child(2) { background: #007BA7; } .mini[data-choisir="energie"] i:nth-child(3) { background: #FF2D95; }
.mini[data-choisir="moderne"] i:nth-child(1) { background: #DDE3E8; } .mini[data-choisir="moderne"] i:nth-child(2) { background: #3A0F34; } .mini[data-choisir="moderne"] i:nth-child(3) { background: #EAAA00; }
.mini[data-choisir="futuriste"] i:nth-child(1) { background: #6F4E37; } .mini[data-choisir="futuriste"] i:nth-child(2) { background: #E5E4E2; } .mini[data-choisir="futuriste"] i:nth-child(3) { background: #E6E0F0; }
.mini[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--fond), 0 0 0 4px var(--accent-texte); }
.mini:hover { transform: translateY(-1px); }
.mini:active { transform: scale(.94); }

.bascule-accent { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--texte); border-radius: var(--rayon); background: transparent; font: 600 12px 'Martian Mono', monospace; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; transition: background-color .2s, color .2s, transform .12s; }
.bascule-accent .signe { font-size: 16px; line-height: 1; transition: transform .3s var(--ease); }
.bascule-accent[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--sombre); }
.bascule-accent[aria-pressed="false"] .signe { transform: rotate(45deg); }
.bascule-accent:hover { border-color: var(--accent-texte); }
.bascule-accent:active { transform: scale(.97); }
.bascule-accent.grande { min-height: 52px; padding: 12px 22px; font-size: 13px; }
[aria-busy="true"] { cursor: progress; opacity: .7; }

/* Calques d'image : deux bases dessous, accent dessus. L'accent « s'allume » en fondu. */
[data-cadre] { position: relative; overflow: hidden; background: color-mix(in oklab, var(--sombre) 85%, var(--claire)); }
[data-cadre] .calque { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
[data-cadre] .accent { transition: opacity .7s var(--ease); }
[data-accent="off"] [data-cadre] .accent { opacity: 0; }

/* Hero « nuancier » : la palette est la mise en page. 60 % image, 30 % base claire (ou encre), 10 % accent. */
.hero { display: grid; grid-template-columns: 6fr 3fr 1fr; min-height: calc(100dvh - var(--entete)); }
.bande { position: relative; display: flex; flex-direction: column; min-width: 0; }
.bande-image .calque { object-position: 66% 40%; }
.cartouche { align-self: flex-start; margin: 0; padding: 6px 9px; border-radius: 6px; background: var(--fond); color: var(--texte); font-size: 11px; }
.bande-image .cartouche { position: absolute; left: 16px; bottom: 16px; z-index: 1; }

.bande-surface { justify-content: space-between; gap: 22px; padding: clamp(20px, 2.4vw, 36px); background: var(--surface); color: var(--sur-surface); }
.bande-surface .titre { hyphens: manual; color: var(--sur-surface); font-size: clamp(34px, 3.3vw, 60px); line-height: .95; }
.phrase { display: block; }
/* Sur la surface, tout texte fait au moins 24 px : en énergie, noir sur cerulean = 4,1:1, « grand texte » WCAG seulement */
.bande-surface .chapo { margin: 0; font-size: 24px; line-height: 1.3; max-width: 22ch; }
.choix { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.choix-palette { position: relative; padding: 6px 0 6px 30px; border: 0; background: none; color: var(--sur-surface); font: 700 26px/1.1 'Anybody'; font-stretch: var(--titre-largeur); cursor: pointer; transition: transform .2s var(--ease); }
.choix-palette::before { content: ''; position: absolute; left: 0; top: 50%; width: 18px; height: 18px; margin-top: -9px; border: 2px solid currentColor; border-radius: 50%; }
.choix-palette[aria-pressed="true"]::before { background: currentColor; }
.choix-palette:hover { transform: translateX(4px); }
.choix-palette:active { transform: translateX(4px) scale(.98); }
.bande-surface :focus-visible { outline-color: var(--sur-surface); }
.etat { min-height: 1.4em; }

/* La bande de 10 % est le bouton « + accent » */
.bande-accent { align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; border: 0; background: var(--accent); color: var(--sombre); cursor: pointer; transition: background-color .45s var(--ease), color .45s var(--ease); }
.bande-accent .signe { font: 300 44px/1 'Anybody'; transition: transform .45s var(--ease); }
.bande-accent-texte { writing-mode: vertical-rl; rotate: 180deg; font-size: 12px; }
.bande-accent[aria-pressed="false"] { background: var(--fond); color: var(--accent-texte); box-shadow: inset 0 0 0 2px var(--accent-texte); }
.bande-accent[aria-pressed="true"] .signe { transform: rotate(45deg); }
.bande-accent:hover .signe { transform: rotate(45deg) scale(1.15); }
.bande-accent[aria-pressed="false"]:hover .signe { transform: scale(1.15); }
.bande-accent:active .signe { transform: scale(.9); }
.bande-accent:focus-visible { outline: 3px solid currentColor; outline-offset: -8px; }  /* sombre sur l’accent (≥ 5,7:1), accent sur le fond quand éteinte */

/* Sections */
section:not(.hero) { padding: clamp(64px, 9vw, 136px) var(--gouttiere); scroll-margin-top: var(--entete); }

/* Un rush, trois films : une bande de quatre */
.bande-rush { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: 1.15fr 1fr 1fr 1fr; gap: 8px; align-items: end; }
.bande-rush figure { margin: 0; }
.legende { display: block; padding-top: 10px; }
.bande-rush img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 50%; }
.bande-rush figcaption { padding-top: 10px; }
.rush-source img { aspect-ratio: 4 / 5.6; }
.vers { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.vers img { transition: transform .4s var(--ease); }
.vers:hover img { transform: translateY(-4px); }
.vers[aria-pressed="true"] .legende { color: var(--accent-texte); }
.vers[aria-pressed="true"] .legende::before { content: '▸ '; }

/* Trois rôles : la barre 60 / 30 / 10, puis ce que fait chaque couleur */
.proportions { display: grid; grid-template-columns: 6fr 3fr 1fr; height: clamp(72px, 10vw, 140px); margin-top: 40px; }
.p-fond { background: var(--fond); box-shadow: inset 0 0 0 1px var(--filet); }
.p-surface { background: var(--surface); }
.p-accent { background: var(--accent); }
.roles-grille { display: grid; grid-template-columns: 6fr 3fr minmax(200px, 1.6fr); gap: 0 24px; margin-top: 18px; }
.role h3 { margin: 4px 0 8px; font: 700 26px/1.05 'Anybody'; font-stretch: 112%; color: var(--titre); }
.role p { margin: 0; max-width: 34ch; }
.role-part { font: 300 15px/1 'Martian Mono', monospace; }

/* Planche : quatre plans, une mosaïque asymétrique */
.planche-tete { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.mosaique { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: clamp(130px, 15vw, 230px); gap: 8px; }
.m-fleur { grid-column: 1 / 5; grid-row: 1 / 3; }
.m-chrome { grid-column: 5 / 7; grid-row: 1 / 4; }
.m-atelier { grid-column: 1 / 3; grid-row: 3 / 4; }
.m-bassin { grid-column: 3 / 5; grid-row: 3 / 4; }
.m-chrome .calque { object-position: 42% 50%; }

/* Le fichier : la base « surface » en aplat (les 30 %) */
.fichier { background: var(--surface); color: var(--sur-surface); }
.fichier .titre { color: var(--sur-surface); max-width: 14ch; }
.fichier .chapo { font-size: 24px; line-height: 1.35; max-width: 34ch; }  /* 24 px : texte « grand » au sens WCAG */
.telecharger { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.bouton { display: inline-flex; flex-direction: column; gap: 4px; min-height: 56px; padding: 12px 20px; border-radius: var(--rayon); background: var(--fond); color: var(--texte); text-decoration: none; font: 600 18px/1.1 'Instrument Sans', sans-serif; transition: transform .12s, background-color .2s; }
.bouton .mono { font-size: 11px; font-weight: 400; }
.bouton:hover { background: color-mix(in oklab, var(--fond) 88%, var(--texte)); }
.bouton:active { transform: scale(.97); }
.fichier :focus-visible { outline-color: var(--sur-surface); }
.commande { margin: 28px 0 0; padding: 16px 18px; max-width: 72ch; border-radius: var(--rayon); background: var(--fond); color: var(--texte); white-space: pre-wrap; word-break: break-all; text-transform: none; font-size: 13px; }

/* Pied */
.pied { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; padding: 28px var(--gouttiere) 40px; border-top: 1px solid var(--filet); }
.pied p { margin: 0; max-width: 64ch; font-size: 14px; }

/* Changement de palette : fondu de toute la page (View Transitions), sinon instantané */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .55s; animation-timing-function: ease-out; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; grid-template-rows: 54vh auto auto; }
  .bande-accent { flex-direction: row; padding: 0 20px; min-height: 64px; }
  .bande-accent-texte { writing-mode: horizontal-tb; rotate: none; }
  .bande-rush { grid-template-columns: 1fr 1fr; }
  .roles-grille { grid-template-columns: 1fr; gap: 20px; }
  .mosaique { grid-template-columns: 1fr 1fr; grid-auto-rows: 38vw; }
  .m-fleur { grid-column: 1 / 3; grid-row: auto / span 1; }
  .m-chrome { grid-column: 1 / 2; grid-row: auto / span 2; }
  .m-atelier, .m-bassin { grid-column: 2 / 3; grid-row: auto / span 1; }
}
@media (max-width: 480px) {
  .regie { gap: 8px; }
  .mini { width: 36px; }
  .bascule-accent:not(.grande) [data-nom] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
