/* site.css — la feuille unique du hub. Les valeurs nommées dans le design validé (couleurs, tailles, rayons, ombres,
   grille, marges) sont reprises telles quelles ; celles que le design ne fixait pas sont marquées « hors maquette »
   et attendent la vérification de Jordi sur le site en ligne (DEC-003). Les URL de polices reçoivent ?v= au build. */

@font-face { font-family: "Unbounded"; src: url(/assets/fonts/unbounded-latin-700.woff2?v=477fa23002) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Unbounded"; src: url(/assets/fonts/unbounded-latin-800.woff2?v=fe6d4ea7ed) format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(/assets/fonts/ibm-plex-sans-latin-400.woff2?v=3b646991d3) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(/assets/fonts/ibm-plex-sans-latin-500.woff2?v=0717336fb3) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(/assets/fonts/ibm-plex-sans-latin-600.woff2?v=8960851d69) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --bg: #03050B;
  --card: #0A0F1C;
  --thumb: #0D1426;
  --text: #F4F8FF;
  --text-2: #C9D4E4;
  --muted: #93A3BC;
  --accent: #4DA8FF;
  --border: rgba(120,170,255,0.16);
  --border-hover: rgba(77,168,255,0.6);
  --gutter: 64px;
  --display: "Unbounded", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
}
@media (max-width: 599.98px) { :root { --gutter: 20px; } }

html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-weight: 400; line-height: 1.5; }

/* Le fond : fixé à la fenêtre, derrière tout ; le contenu défile par-dessus. Les clics le traversent :
   sky.js les écoute sur le document. */
canvas[data-sky] { position: fixed; inset: 0; width: 100vw; height: 100lvh; display: block; z-index: 0; pointer-events: none; }
.page { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
.site-header, main, .site-footer { box-sizing: border-box; } /* pleine largeur, marges latérales --gutter (décision de Jordi) */

a { color: inherit; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* En-tête */
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px;
  padding: 32px var(--gutter); /* hors maquette : 32px en hauteur */ }
.brand { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(32px, 4vw, 56px); letter-spacing: -0.01em;
  line-height: 1.1; text-shadow: 0 0 40px rgba(77,168,255,0.28); transition: text-shadow 0.35s; }
.brand.is-lit { text-shadow: 0 0 18px rgba(210,232,255,0.95), 0 0 70px rgba(77,168,255,0.9); }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 8px 28px; /* hors maquette */ margin: 0; padding: 0; list-style: none; }
.site-nav a { font-family: var(--body); font-weight: 500; font-size: 15px; color: var(--text-2); text-decoration: none; }
.site-nav a:hover { color: var(--text); /* hors maquette */ }

main { padding: 0 var(--gutter); }

/* Blocs de catégorie (décision de Jordi) : côte à côte, à la ligne quand la place manque, dans l'ordre du HTML.
   Largeur de base d'un bloc de n cartes : n × carte minimale + (n − 1) × gouttière ; croissance et réduction
   proportionnelles à n. L'espace libre d'une rangée se répartit donc à parts égales par carte : toutes les cartes
   d'une rangée ont la même largeur. Plafond : n × 640 px + (n − 1) × gouttière (cartes de 640 px au plus). Entre
   deux blocs, et entre deux rangées : 64 px ; entre cartes d'un même bloc : 32 px (décision de Jordi, passe 14). n vient de data-cartes (la CSP interdit les styles en ligne) : une règle par
   valeur, de 1 à 12 ; check.mjs vérifie que chaque valeur servie a la sienne. */
main.blocs { --carte-min: 320px; --carte-max: 640px; --gouttiere: 32px; --espace-blocs: 64px; display: flex; flex-wrap: wrap;
  align-items: flex-start; align-content: flex-start; /* sans lui, les rangées se partagent la hauteur libre de main */
  gap: var(--espace-blocs); padding-top: 24px; /* hors maquette : 24 px au-dessus du premier bloc */ }
.bloc { --n: 1; flex: var(--n) var(--n) calc(var(--n) * var(--carte-min) + (var(--n) - 1) * var(--gouttiere));
  max-width: calc(var(--n) * var(--carte-max) + (var(--n) - 1) * var(--gouttiere)); min-width: 0; margin: 0; }
.bloc[data-cartes="2"] { --n: 2; } .bloc[data-cartes="3"] { --n: 3; } .bloc[data-cartes="4"] { --n: 4; }
.bloc[data-cartes="5"] { --n: 5; } .bloc[data-cartes="6"] { --n: 6; } .bloc[data-cartes="7"] { --n: 7; }
.bloc[data-cartes="8"] { --n: 8; } .bloc[data-cartes="9"] { --n: 9; } .bloc[data-cartes="10"] { --n: 10; }
.bloc[data-cartes="11"] { --n: 11; } .bloc[data-cartes="12"] { --n: 12; }
/* Dans un bloc : au plus n colonnes, jamais sous la carte minimale ; plus étroit que ses n cartes, il passe à la
   ligne ; sous la carte minimale (téléphone), une carte par ligne sur toute la largeur. */
.bloc .grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, max(var(--carte-min),
  calc((100% - (var(--n) - 1) * var(--gouttiere)) / var(--n)))), 1fr)); gap: var(--gouttiere); }

/* Cartes */
.card { display: block; position: relative; background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden; color: var(--text); text-decoration: none;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; /* hors maquette : 0,2 s */ }
.card:hover { transform: translateY(-4px); border-color: var(--border-hover); box-shadow: 0 18px 60px -20px rgba(77,168,255,0.45); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.thumb { aspect-ratio: 1200 / 630; background: var(--thumb); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Vignette de repli : sans texte, un éclair bleu atténué centré sur le fond (variante choisie par Jordi, passe 14).
   Découpé en CSS (clip-path) : ni fichier SVG servi, ni URI data: (la CSP les refuse). Mêmes proportions que le dessin
   de la proposition (boîte 100 × 160, hauteur 58 % de la vignette, accent #4DA8FF à 30 %). */
.thumb--fallback { display: grid; place-items: center; }
.thumb--fallback::before { content: ""; height: 58%; aspect-ratio: 100 / 160; background: rgba(77,168,255,0.3);
  clip-path: polygon(62% 0, 18% 46.25%, 46% 46.25%, 30% 100%, 84% 38.75%, 54% 38.75%, 74% 0); }
.card-title { margin: 0; padding: 20px 24px; /* hors maquette */ font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.25; }

/* Sections Music, Games, Applications : titre, ligne fine sur la largeur du bloc, grille */
.section-head { display: flex; align-items: center; gap: 24px; margin: 0 0 32px; /* hors maquette */ }
.section-head h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 40px; line-height: 1.1; }
.section-rule { flex: 1; height: 1px; background: var(--border); /* hors maquette : couleur de la ligne */ }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: 32px; margin: 0; padding: 0; list-style: none; }

/* 404 */
.notfound h2 { margin: 48px 0 16px; font-family: var(--display); font-weight: 700; font-size: 40px; }
.notfound-links { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 12px 32px; }
.notfound-links a { color: var(--accent); }

/* Pied de page */
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 32px;
  padding: 32px var(--gutter); color: var(--muted); font-size: 14px; /* hors maquette */ }
.footer-brand { font-family: var(--display); font-weight: 800; letter-spacing: -0.01em; }

@media (prefers-reduced-motion: reduce) {
  .brand, .card { transition: none; }
  .card:hover { transform: none; }
}
