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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--pg-bg);
  background-image: radial-gradient(var(--pg-dot) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--pg-text);
  font-family: var(--pg-font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--pg-accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* En-tête */

.top {
  width: min(1120px, 100% - 32px);
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--pg-mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.logo { width: 38px; height: 38px; flex: none; }

.logo .cursor { animation: blink 1.2s steps(1) infinite; }

@keyframes blink { 50% { opacity: 0; } }

.gh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--pg-line);
  border-radius: 999px;
  background: var(--pg-surface);
  text-decoration: none;
  font-family: var(--pg-mono);
  font-size: 13px;
  transition: border-color .2s;
}
.gh svg { width: 16px; height: 16px; }
.gh:hover { border-color: var(--pg-muted); }

/* Hero */

main {
  flex: 1;
  width: min(1120px, 100% - 32px);
  margin: 0 auto;
}

.hero { padding: clamp(48px, 10vw, 112px) 0 clamp(40px, 6vw, 64px); max-width: 760px; }

.kicker {
  margin: 0 0 18px;
  font-family: var(--pg-mono);
  font-size: 14px;
  color: var(--pg-muted);
}
.count {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--pg-surface-2);
  color: var(--pg-text);
  font-size: 12px;
}

h1 {
  margin: 0;
  font-size: clamp(44px, 9vw, 92px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-variation-settings: "opsz" 96;
}

.grad {
  background: var(--pg-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  margin: 24px 0 0;
  max-width: 580px;
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--pg-muted);
}

/* Filtres (sans script : boutons radio + :has) */

.kicker [data-f]:not([data-f="tout"]),
.kicker .grep { display: none; }
.kicker .grep { color: var(--pg-text); }

body:has(.filtres input:checked:not(#f-tout)) .kicker [data-f="tout"] { display: none; }
body:has(.filtres input:checked:not(#f-tout)) .kicker .grep,
body:has(#f-windows:checked) .kicker [data-f="windows"],
body:has(#f-android:checked) .kicker [data-f="android"],
body:has(#f-web:checked) .kicker [data-f="web"],
body:has(#f-jeux:checked) .kicker [data-f="jeux"] { display: inline; }

body:has(#f-windows:checked) .card:not([data-p~="windows"]),
body:has(#f-android:checked) .card:not([data-p~="android"]),
body:has(#f-web:checked) .card:not([data-p~="web"]),
body:has(#f-jeux:checked) .card:not([data-p~="jeux"]) { display: none; }

.filtres {
  margin: 0 0 22px;
  padding: 0;
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.filtres input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.filtres label {
  padding: 7px 15px;
  border: 1px solid var(--pg-line);
  border-radius: 999px;
  background: var(--pg-surface);
  font-family: var(--pg-mono);
  font-size: 13px;
  color: var(--pg-muted);
  cursor: pointer;
  user-select: none;
  transition: border-color .2s;
}
.filtres label:hover { border-color: var(--pg-muted); color: var(--pg-text); }

.filtres input:checked + label {
  border-color: transparent;
  background: var(--pg-grad);
  color: var(--pg-on-accent);
}

.filtres input:focus-visible + label {
  outline: 2px solid var(--pg-accent);
  outline-offset: 3px;
}

/* Grille de projets */

.grid {
  list-style: none;
  margin: 0;
  padding: 0 0 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 18px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--pg-line);
  border-radius: 22px;
  background: var(--pg-surface);
  box-shadow: var(--pg-shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--pg-shadow-hover);
  border-color: color-mix(in srgb, var(--pg-accent) 40%, var(--pg-line));
}

.icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: contain;
}

/* « nouveau » / « mis à jour » : à retirer 30 jours après la date (tools/check.mjs le rappelle) */
.card .badge {
  position: absolute;
  top: 26px;
  right: 26px;
  margin: 0;
  padding: 3px 10px;
  border: 1px solid color-mix(in srgb, var(--pg-accent) 45%, var(--pg-line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--pg-accent) 10%, var(--pg-surface));
  font-family: var(--pg-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--pg-accent);
}

.card h2 {
  margin: 20px 0 8px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

/* Toute la carte est cliquable via le titre */
.card h2 a { text-decoration: none; }
.card h2 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }

.card p {
  margin: 0;
  font-size: 15.5px;
  color: var(--pg-muted);
}

.tags {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tags li {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--pg-surface-2);
  font-family: var(--pg-mono);
  font-size: 12px;
  color: var(--pg-muted);
}

/* Dernière mise à jour, écrite chaque jour par tools/dates.mjs (CI) */
.card .maj {
  margin: 14px 0 0;
  font-family: var(--pg-mono);
  font-size: 12px;
  color: var(--pg-muted);
}

.links {
  margin-top: auto;
  padding-top: 22px;
  display: flex;
  gap: 10px;
}

.links a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--pg-line);
  border-radius: 12px;
  text-decoration: none;
  font-family: var(--pg-mono);
  font-size: 13.5px;
  font-weight: 500;
  transition: border-color .2s, transform .2s, filter .2s;
}
.links a:hover { border-color: var(--pg-muted); }

.links .primary {
  border-color: transparent;
  background: var(--pg-grad);
  color: #fff;
}
.links .primary:hover { filter: brightness(1.08); }
.links .primary span { transition: transform .2s; }
.links .primary:hover span { transform: translateX(3px); }

/* Pied de page */

footer {
  width: min(1120px, 100% - 32px);
  margin: 0 auto;
  padding: 28px 0 36px;
  border-top: 1px solid var(--pg-line);
  font-family: var(--pg-mono);
  font-size: 13px;
  color: var(--pg-muted);
}
footer p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
