.aurora-text {
  font-size: 3rem;
  font-weight: 800;
  margin: 0;
  position: relative;
  display: inline-block;
  background: linear-gradient(
    45deg,
    #00c2ff,
    #33ff8c,
    #ffc640,
    #e54cff,
    #00c2ff
  );
  background-size: 400% 400%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: aurora-gradient 4s ease-in-out infinite;
}

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;800&display=swap");

:root {
  --clr-1: #00c2ff;
  --clr-2: #33ff8c;
  --clr-3: #ffc640;
  --clr-4: #e54cff;
}

@keyframes aurora-gradient {
  0% {
    background-position: 0% 50%;
  }

  25% {
    background-position: 100% 50%;
  }

  50% {
    background-position: 100% 100%;
  }

  75% {
    background-position: 0% 100%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Animations pour directions aléatoires */
@keyframes zoom-in-from-top {
  0% {
    transform: translateY(-100vh) translateZ(-1000px);
    opacity: 0;
    filter: blur(5px);
  }

  50% {
    transform: translateY(0px) translateZ(0px);
    opacity: 1;
    filter: blur(0px);
  }

  100% {
    transform: translateY(100vh) translateZ(1000px);
    opacity: 0;
    filter: blur(5px);
  }
}

@keyframes zoom-in-from-bottom {
  0% {
    transform: translateY(100vh) translateZ(-1000px);
    opacity: 0;
    filter: blur(5px);
  }

  50% {
    transform: translateY(0px) translateZ(0px);
    opacity: 1;
    filter: blur(0px);
  }

  100% {
    transform: translateY(-100vh) translateZ(1000px);
    opacity: 0;
    filter: blur(5px);
  }
}

@keyframes zoom-in-from-left {
  0% {
    transform: translateX(-100vw) translateZ(-1000px);
    opacity: 0;
    filter: blur(5px);
  }

  50% {
    transform: translateX(0px) translateZ(0px);
    opacity: 1;
    filter: blur(0px);
  }

  100% {
    transform: translateX(100vw) translateZ(1000px);
    opacity: 0;
    filter: blur(5px);
  }
}

@keyframes zoom-in-from-right {
  0% {
    transform: translateX(100vw) translateZ(-1000px);
    opacity: 0;
    filter: blur(5px);
  }

  50% {
    transform: translateX(0px) translateZ(0px);
    opacity: 1;
    filter: blur(0px);
  }

  100% {
    transform: translateX(-100vw) translateZ(1000px);
    opacity: 0;
    filter: blur(5px);
  }
}

@keyframes fade-out-center {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) translateZ(0px) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translateZ(0px) scale(1);
  }
}

@keyframes fade-in-text {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.stuck-grid {
  block-size: 100svh;
  perspective: 1000px;
  transform-style: preserve-3d;
  display: grid;
  grid-template: repeat(4, 1fr) / repeat(4, 1fr);
  place-items: center;
  position: sticky;
  top: 0;
  overflow: clip;
  background: white;
}

.stuck-grid > .grid-item {
  transform-style: preserve-3d;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.stuck-grid > .grid-item img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Logo central Bii Group */
.stuck-grid > .grid-item.special {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  z-index: 10;
  opacity: 1;
  transition: width 0.3s ease, height 0.3s ease;
}

.stuck-grid > .grid-item.special img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.4));
}

/* Pour les grands écrans */
@media (min-width: 900px) {
  .stuck-grid > .grid-item.special {
    width: 400px;
    height: 400px;
  }
}

.stuck-grid > .grid-item:not(.special) {
  opacity: 0;
  transform: translateZ(-1000px);
}

/* Texte final */
.final-text {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  font-size: 3rem;
  font-weight: bold;
  text-align: left;
  opacity: 0;
  width: 300px;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .stuck-grid > .grid-item.special {
      animation: fade-out-center linear both;
      animation-timeline: scroll(root block);
      animation-range: 75% 85%;
      will-change: transform, opacity;
    }

    .final-text {
      animation: fade-in-text linear both;
      animation-timeline: scroll(root block);
      animation-range: 85% 100%;
      will-change: transform, opacity;
    }

    /* Animations avec directions aléatoires */
    .stuck-grid > .grid-item:nth-of-type(1) {
      animation: zoom-in-from-top linear both;
      animation-timeline: scroll(root block);
      animation-range: 10% 20%;
      will-change: transform, opacity, filter;
    }

    .stuck-grid > .grid-item:nth-of-type(2) {
      animation: zoom-in-from-bottom linear both;
      animation-timeline: scroll(root block);
      animation-range: 15% 25%;
      will-change: transform, opacity, filter;
    }

    .stuck-grid > .grid-item:nth-of-type(3) {
      animation: zoom-in-from-left linear both;
      animation-timeline: scroll(root block);
      animation-range: 20% 30%;
      will-change: transform, opacity, filter;
    }

    .stuck-grid > .grid-item:nth-of-type(4) {
      animation: zoom-in-from-right linear both;
      animation-timeline: scroll(root block);
      animation-range: 25% 35%;
      will-change: transform, opacity, filter;
    }

    .stuck-grid > .grid-item:nth-of-type(5) {
      animation: zoom-in-from-top linear both;
      animation-timeline: scroll(root block);
      animation-range: 30% 40%;
      will-change: transform, opacity, filter;
    }

    .stuck-grid > .grid-item:nth-of-type(6) {
      animation: zoom-in-from-left linear both;
      animation-timeline: scroll(root block);
      animation-range: 35% 45%;
      will-change: transform, opacity, filter;
    }

    .stuck-grid > .grid-item:nth-of-type(7) {
      animation: zoom-in-from-bottom linear both;
      animation-timeline: scroll(root block);
      animation-range: 40% 50%;
      will-change: transform, opacity, filter;
    }

    .stuck-grid > .grid-item:nth-of-type(8) {
      animation: zoom-in-from-right linear both;
      animation-timeline: scroll(root block);
      animation-range: 45% 55%;
      will-change: transform, opacity, filter;
    }

    .stuck-grid > .grid-item:nth-of-type(9) {
      animation: zoom-in-from-left linear both;
      animation-timeline: scroll(root block);
      animation-range: 50% 60%;
      will-change: transform, opacity, filter;
    }

    .stuck-grid > .grid-item:nth-of-type(10) {
      animation: zoom-in-from-top linear both;
      animation-timeline: scroll(root block);
      animation-range: 55% 65%;
      will-change: transform, opacity, filter;
    }

    .stuck-grid > .grid-item:nth-of-type(11) {
      animation: zoom-in-from-right linear both;
      animation-timeline: scroll(root block);
      animation-range: 60% 70%;
      will-change: transform, opacity, filter;
    }

    .stuck-grid > .grid-item:nth-of-type(12) {
      animation: zoom-in-from-bottom linear both;
      animation-timeline: scroll(root block);
      animation-range: 65% 75%;
      will-change: transform, opacity, filter;
    }
  }
}

@supports (animation-timeline: scroll()) {
  .stuck-grid > .grid-item:nth-of-type(1) {
    grid-area: 1 / 1;
  }

  .stuck-grid > .grid-item:nth-of-type(2) {
    grid-area: 1 / 2;
  }

  .stuck-grid > .grid-item:nth-of-type(3) {
    grid-area: 1 / 3;
  }

  .stuck-grid > .grid-item:nth-of-type(4) {
    grid-area: 1 / 4;
  }

  .stuck-grid > .grid-item:nth-of-type(5) {
    grid-area: 2 / 1;
  }

  .stuck-grid > .grid-item:nth-of-type(6) {
    grid-area: 2 / 4;
  }

  .stuck-grid > .grid-item:nth-of-type(7) {
    grid-area: 3 / 1;
  }

  .stuck-grid > .grid-item:nth-of-type(8) {
    grid-area: 3 / 4;
  }

  .stuck-grid > .grid-item:nth-of-type(9) {
    grid-area: 4 / 1;
  }

  .stuck-grid > .grid-item:nth-of-type(10) {
    grid-area: 4 / 2;
  }

  .stuck-grid > .grid-item:nth-of-type(11) {
    grid-area: 4 / 3;
  }

  .stuck-grid > .grid-item:nth-of-type(12) {
    grid-area: 4 / 4;
  }
}

/* Support layer */
* {
  box-sizing: border-box;
  margin: 0;
}

html {
  block-size: 100%;
  color-scheme: dark light;
}

body {
  min-block-size: 400vh;
  font-family: system-ui, sans-serif;
  background: white;
}

/* Coins fixes - marges égalisées */
.container-coin {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 5;
}

.container-coin > * {
  pointer-events: auto;
}

.fixed-left-top-coin {
  position: absolute;
  top: 20px;
  left: 20px;
}

.fixed-right-top-coin {
  position: absolute;
  top: 20px;
  right: 20px;
}

.fixed-left-coin {
  position: absolute;
  bottom: 20px;
  left: 20px;
}

.fixed-right-coin {
  position: absolute;
  bottom: 20px;
  right: 20px;
}

.fixed-right-coin a {
  text-decoration: none;
  color: #333;
  cursor: pointer;
}

.fixed-right-coin a:hover {
  color: #007bff;
}

/* Égalisation des tailles d'images dans les coins */
.container-coin img {
  width: auto;
  height: auto;
  max-width: 60px;
  max-height: 30px;
  object-fit: contain;
}

/* Placeholder pour les images manquantes */
.placeholder-logo {
  width: 140px;
  height: 140px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  border-radius: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  text-align: center;
  font-size: 16px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.placeholder-logo.center {
  width: 300px;
  height: 300px;
  font-size: 28px;
}

@media (min-width: 900px) {
  .placeholder-logo.center {
    width: 400px;
    height: 400px;
    font-size: 36px;
  }
}

.language-switcher span {
    cursor: pointer;
}

.language-switcher span.active {
    color: #007bff;
}

.content {
    margin-top: 20px;
}

[data-translate] {
    transition: opacity 0.3s ease;
}

.translating {
    opacity: 0.7;
}
