/* ============================================================
                            BODY
============================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  overflow-y: scroll;
  overflow-x: hidden;
  background: #000;
  cursor: url('images/cursor.png') 0 0, auto;
}

a, button, .nav-item, .nav-item > a, .grille a {
  cursor: url('images/cursor_hover.png') 0 0, pointer !important;
}

/* ============================================================
                            FONTS
============================================================ */

@font-face {
  font-family: 'BianzhidaiMessy';
  src: url('fonts/bianzhidai_noBG-Messy.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BianzhidaiPearl';
  src: url('fonts/bianzhidai_noBG-Pearl.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Garabosse';
  src: url('fonts/Garabosse-Perle.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
                            MENU
============================================================ */

.topnav {
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4vw;
  width: min(680px, calc(100vw - 1.5rem));
  height: 6vh;
  min-height: 44px;
  position: fixed;
  bottom: 4vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  box-shadow: 0px 0px 10px 10px #ffffff;
  white-space: nowrap;
}

.nav-item {
  height: 100%;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item > a {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 200px;
  text-align: center;
  font-family: 'BianzhidaiPearl', sans-serif;
  color: #463838;
  text-decoration: none;
  font-size: clamp(9px, 2vw, 18px);
  position: relative;
}

.nav-item > a::after {
  content: attr(data-text);
  font-family: 'BianzhidaiMessy', sans-serif;
  font-size: clamp(7px, 1.8vw, 14px);
  color: #463838;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.nav-item > a:hover { color: transparent; }
.nav-item > a:hover::after { opacity: 1; }

/* ============================================================
                            GRILLE
============================================================ */

.grille {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  width: 100%;
  padding-bottom: 14vh;
  background-image: url(images/rosevert_vert3.webp);
  filter: url(#fisheye);
}

.grille a {
  display: block;
  overflow: hidden;
  aspect-ratio: 5 / 3;
  position: relative;
  background: #000;
}

.grille a::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: #7562C7;
  mix-blend-mode: multiply;
  z-index: 1;
  pointer-events: none;
  transition: opacity 1s ease;
}

.grille a:hover::before {
  opacity: 0;
}

/* Cadre cathodique par-dessus chaque case */
.grille a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: url("images/Cadre_Cathodique.png") center / 100% 100% no-repeat;
}

.grille a img {
  width: 100%;
  height: 100%;
  object-fit: cover; 
  display: block;
  mix-blend-mode:luminosity;
}

.grille a:hover img {
  mix-blend-mode: normal;
}

.grille a .overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 1s ease;
}

.grille a:hover .overlay {
  opacity: 1;
}

.grille a .overlay h3 {
  font-family: 'BianzhidaiPearl', sans-serif;
  font-size: clamp(14px, 1.5vw, 24px);
  color: #ffffff;
  margin: 0;
  -webkit-text-stroke: 6px #7562C7;
  paint-order: stroke fill;
}

.grille a .overlay p {
  font-family: 'Garabosse', sans-serif;
  font-size: clamp(11px, 1vw, 16px);
  color: #ffffff;
  margin: 0;
  -webkit-text-stroke: 6px #7562C7;
  paint-order: stroke fill;
}

/* ============================================================
                          RESPONSIVE
============================================================ */

@media (max-width: 900px) {
  .grille {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .topnav {
    bottom: 0.8rem;
    height: auto;
  }

  .nav-item > a {
    font-size: clamp(7px, 2.35vw, 14px);
  }

  .nav-item > a::after {
    font-size: clamp(7px, 2.3vw, 12px);
  }

  .grille a .overlay {
    padding: 10px;
  }

  .grille a .overlay h3 {
    font-size: clamp(13px, 3.4vw, 18px);
    -webkit-text-stroke-width: 3px;
  }

  .grille a .overlay p {
    font-size: clamp(11px, 2.8vw, 14px);
    -webkit-text-stroke-width: 3px;
  }
}

@media (max-width: 500px) {
  .grille {
    grid-template-columns: 1fr;
  }
}