@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

/* ===== POLICES ===== */
@font-face {
  font-family: 'CrackedCode';
  src: url('Cracked Code.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'AtmaMedium';
  src: url('Atma-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

/* ===== ANIMATIONS ===== */
@keyframes collapseText {
  0% { opacity: 1; letter-spacing: 0; filter: blur(0); }
  40% { opacity: 0.8; letter-spacing: 3px; filter: blur(1px); }
  70% { opacity: 0.4; letter-spacing: 8px; filter: blur(3px); }
  100% { opacity: 0; letter-spacing: 15px; filter: blur(6px); transform: scale(1.05); }
}

@keyframes textComicFlicker {
  0%   { opacity: 0.9; transform: rotate(0deg) scale(1); }
  10%  { opacity: 0.7; transform: rotate(-1deg) scale(1.03); }
  25%  { opacity: 1; transform: rotate(1deg) scale(0.98); }
  40%  { opacity: 0.8; transform: rotate(-1deg) scale(1); }
  60%  { opacity: 1; transform: rotate(1deg) scale(1.02); }
  80%  { opacity: 0.6; transform: rotate(-2deg) scale(1.05); }
  100% { opacity: 1; transform: rotate(0deg) scale(1); }
}

/* ===== STYLE GLOBAL ===== */
body {
  margin: 0;
  padding: 0;
  height: 100vh;
  background: #0a0a0a;
  color: #ff0000;
  font-family: 'Share Tech Mono', monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><text x="0" y="20" font-size="20" fill="red">✖</text></svg>'), auto;
  animation:
    flickerBg 8s infinite,
    screenFlash 20s infinite,
    siteCollapse 0.3s infinite ease-in-out 15s;
}

.glitch-container {
  text-align: center;
  position: relative;
  z-index: 5;
}

/* ===== TITRE PRINCIPAL ===== */
h1.glitch {
  font-family: 'CrackedCode', 'Share Tech Mono', monospace;
  font-size: 6rem;
  position: relative;
  color: #ff0000;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(255, 0, 0, 0.7);
  animation:
    appearGlitch 1.5s ease-out forwards,
    shake 0.4s infinite,
    glitch-flicker 1.5s infinite alternate;
}

/* ===== GLITCH EFFET ===== */
h1.glitch::before,
h1.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  mix-blend-mode: lighten;
  color: inherit;
}

h1.glitch::before {
  text-shadow: 2px 0 red;
  animation: glitchBefore 1.5s infinite linear alternate-reverse;
}

h1.glitch::after {
  text-shadow: -2px 0 blue;
  animation: glitchAfter 1.2s infinite linear alternate;
}

.message {
  margin-top: 1rem;
  line-height: 1.6;
  font-size: 1.1rem;
  color: #ff4444;
  animation: textFlicker 5s infinite ease-in-out, collapseText 6s ease-in-out 10s forwards;
}

.message span {
  display: block;
  opacity: 0.8;
}


.atma {
  font-family: 'AtmaMedium', 'Share Tech Mono', monospace;
  font-size: 1.3rem;
  color: #ff5555;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
  animation: textFlicker 4s infinite ease-in-out;
}

.comic {
  font-family: "Comic Sans MS", "Comic Sans", cursive;
  font-size: 1.2rem;
  color: #ff8888;
  letter-spacing: 0.6px;
  text-shadow: 0 0 6px rgba(255, 0, 0, 0.4);
  display: inline-block;
  transform-origin: center;
  animation: textComicFlicker 3s infinite ease-in-out;
}

/* ===== BOUTON ===== */
.return-btn {
  display: inline-block;
  margin-top: 3rem;
  padding: 12px 24px;
  background: transparent;
  border: 1px solid #ff0000;
  color: #ff0000;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 1px;
  transition: 0.3s;
  animation: shakeSmall 1.2s infinite alternate;
}

.return-btn:hover {
  background: #ff0000;
  color: #0a0a0a;
  box-shadow: 0 0 20px #ff0000;
}

/* ===== GRÉSILLEMENT (contrasté) ===== */
.static-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.22) 0px,
      rgba(255,255,255,0.22) 1px,
      rgba(0,0,0,0.25) 3px
    ),
    url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAAr0lEQVR42u3ZMQrCQBQE0f3/H+pgQZ8EgpJzpu1sErEGKIVW0vFz7Sfv7bn8CP6zwvQxvwsYzYywZP4IAFAMxWjzP1cY5CrSLcZbSGtQl2WyhLrWnYV9S5u6Em2r2hrbBzIhajZ1dJdA2Rzaw36qZuzjWsZ7WOmQ7rIT8iPNJzB7pOZlW8Tkp7x5tHeLZPx3DzhqUyGnNsAAAAASUVORK5CYII=");
  background-size: cover;
  mix-blend-mode: hard-light;
  opacity: 0.6;
  animation: staticNoise 0.08s infinite steps(2), flickerNoise 2s infinite;
}

/* ===== AUTRES ANIMATIONS ===== */
@keyframes appearGlitch {
  0% { opacity: 0; filter: blur(10px); transform: scale(1.1) rotate(1deg); }
  50% { opacity: 0.8; filter: blur(2px); }
  100% { opacity: 1; filter: blur(0); transform: scale(1) rotate(0); }
}

@keyframes glitchBefore {
  0% { transform: translate(0, 0); clip-path: inset(0 0 70% 0); }
  20% { transform: translate(-2px, -2px); clip-path: inset(10% 0 40% 0); }
  40% { transform: translate(2px, 2px); clip-path: inset(30% 0 20% 0); }
  60% { transform: translate(-3px, 1px); clip-path: inset(50% 0 10% 0); }
  80% { transform: translate(3px, -1px); clip-path: inset(20% 0 40% 0); }
  100% { transform: translate(0, 0); clip-path: inset(0 0 70% 0); }
}

@keyframes glitchAfter {
  0% { transform: translate(0, 0); clip-path: inset(60% 0 0 0); }
  20% { transform: translate(2px, 2px); clip-path: inset(30% 0 10% 0); }
  40% { transform: translate(-2px, -2px); clip-path: inset(10% 0 50% 0); }
  60% { transform: translate(3px, 1px); clip-path: inset(40% 0 20% 0); }
  80% { transform: translate(-3px, -1px); clip-path: inset(0 0 60% 0); }
  100% { transform: translate(0, 0); clip-path: inset(60% 0 0 0); }
}

@keyframes shake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  20% { transform: translate(-1px, -2px) rotate(-1deg); }
  40% { transform: translate(-3px, 0px) rotate(1deg); }
  60% { transform: translate(3px, 2px) rotate(0deg); }
  80% { transform: translate(1px, -1px) rotate(1deg); }
  100% { transform: translate(-1px, 2px) rotate(-1deg); }
}

@keyframes shakeSmall {
  from { transform: translate(0); }
  to { transform: translate(2px, -1px); }
}

@keyframes flickerText {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: 0.3; }
}

@keyframes glitch-flicker {
  0% { opacity: 1; }
  50% { opacity: 0.85; }
  100% { opacity: 1; }
}

@keyframes flickerBg {
  0% { background-color: #0a0a0a; }
  50% { background-color: #0d0d0d; }
  100% { background-color: #0a0a0a; }
}

@keyframes textFlicker {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; color: #ff6666; }
}

@keyframes staticNoise {
  0% { background-position: 0 0; opacity: 0.6; }
  25% { background-position: 10px -10px; opacity: 0.65; }
  50% { background-position: -10px 10px; opacity: 0.5; }
  75% { background-position: 5px 15px; opacity: 0.7; }
  100% { background-position: 0 0; opacity: 0.6; }
}

@keyframes flickerNoise {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}

@keyframes screenFlash {
  0%, 100% { background-color: transparent; }
  95% { background-color: rgba(255,255,255,0.6); }
}

@keyframes siteCollapse {
  0%, 100% { transform: translate(0,0); }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -3px); }
  75% { transform: translate(-2px, -1px); }
}
