:root {
  --page-width: 900px;
  --link: #8ab4ff;       /* bleu lisible sur fond sombre */
  --link-hover: #b3c7ff;
  --link-visited: #c6a6ff;
  --topbar-h: 56px;      /* Hauteur de la topbar (offset) */
}

html {
  scrollbar-gutter: stable;
}

/* ---------- Liens ---------- */
a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: from-font;
}
a:hover { color: var(--link-hover); }
a:visited { color: var(--link-visited); }
a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Base (sombre forcé) ---------- */
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 24px;
  background-color: #0f0f12;  /* sombre permanent */
  color: #eaeaf0;
  background-image: none;
  /* Offset pour ne pas que la topbar recouvre le contenu */
  padding-top: calc(24px + var(--topbar-h) + 8px) !important;
}

.container {
  max-width: var(--page-width);
  margin: 0 auto;
}

/* ---------- Grille ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}
.grid.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 600px) {
  .grid.two-cols { grid-template-columns: 1fr; }
}

/* ---------- Carte (zoom image uniquement) ---------- */
.card {
  position: relative;
  display: block;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  overflow: hidden;
  background: #1e1e1e;   /* sombre */
  color: #eee;
  text-decoration: none;
  transition: box-shadow 180ms ease;
}
.card:hover,
.card:focus-visible {
  box-shadow: 0 12px 28px rgba(0,0,0,0.38);
  outline: 0;
}

.card-media {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #1e1e1e; /* cohérent sombre */
  overflow: hidden;          /* clip pendant le zoom */
}
.card-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform-origin: center;
  will-change: transform;
  transition: transform 200ms ease;
}
.card:hover .card-media img,
.card:focus-visible .card-media img {
  transform: scale(1.06);
}

/* Meta (icône au-dessus, titre dessous) */
.card-meta {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  background: transparent;
  border: none;
  backdrop-filter: none;
}
.card-meta-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.card-meta-title {
  max-width: 200px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* ---------- Accessibilité ---------- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Navigation (texte) ---------- */
.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.site-nav a {
  color: #ddd;                 /* lisible sur sombre */
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: color 150ms ease, background 150ms ease, transform 120ms ease;
}
.site-nav a:hover {
  color: #fff;
  background: #1a1a1a;
  transform: translateY(-1px);
}

/* Lien actif (menu) — sombre */
.is-active {
  background: #1a1a1a;
  color: #fff !important;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 32px;
  padding: 16px 0;
  border-top: 1px solid #2a2a2a;  /* sombre */
  background: transparent;
}
.site-footer__inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.site-footer .site-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  margin: 0;
  color: #eee;     /* clair sur sombre */
}
.site-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.site-copy {
  font-size: 0.9rem;
  line-height: 1;
  color: #888;     /* gris doux */
}

/* Footer muet (icônes sans feedback visuel) */
.site-footer .site-nav .nav-icon {
  padding: 0;
  border: none;
  background: transparent;
  transition: none;
  cursor: pointer;
}
.site-footer .site-nav .nav-icon img {
  display: block;
  width: 42px;
  height: 42px;
}
.site-footer .site-nav .nav-icon:hover,
.site-footer .site-nav .nav-icon:focus,
.site-footer .site-nav .nav-icon:focus-visible {
  background: transparent;
  border: none;
  transform: none;
  box-shadow: none;
  outline: none;
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 520px) {
  :root { --topbar-h: 52px; }
  .site-nav { gap: 12px; }
  .site-nav a { font-size: 0.95rem; padding: 5px 8px; }
}

/* ---------- Topbar (fixe en haut) ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 2000;
  background: rgba(10,10,10,0.85);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid #2a2a2a;
  box-sizing: border-box;
}
.topbar__inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 10px 24px;    /* même padding que body */
  display: flex;
  align-items: center;
  justify-content: center; /* menu centré */
  gap: 0;
  min-height: var(--topbar-h);
}

/* Les ancres ciblées ne passent pas sous la topbar */
#apps, #tricks, #books, #cards {
  scroll-margin-top: calc(var(--topbar-h) + 12px);
}

/* Skip-link visible au focus (sombre) */
.sr-only-focusable:active,
.sr-only-focusable:focus {
  position: static !important;
  width: auto;
  height: auto;
  padding: 8px 12px;
  margin: 8px 0;
  clip: auto;
  clip-path: none;
  white-space: normal;
  background: #111;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  z-index: 3000;
}





/* Modal fullscreen */
.xt-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.xt-modal.is-open { display: block; }

.xt-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}

.xt-modal__panel {
  position: relative;
  width: min(640px, calc(100% - 32px));
  margin: 10vh auto 0;
  background: #0b0b0b;            /* adapte à ton thème */
  color: #fff;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.xt-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #fff;
  cursor: pointer;
}

/* Optionnel: empêcher le scroll derrière */
body.modal-open { overflow: hidden; }
