/**
 * LGK — Page 404
 * Full-bleed sombre, accent cyan marque, récupération via recherche.
 */

.lgk-404 {
  --lgk-404-cyan: #31e6c3;
  --lgk-404-cyan-dim: rgba(49, 230, 195, 0.32);
  --lgk-404-blue: #3b82f6;
  --lgk-404-ink: #e8edf5;
  --lgk-404-muted: rgba(232, 237, 245, 0.64);
  --lgk-404-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --lgk-404-radius: 10px;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: min(88vh, 52rem);
  display: grid;
  place-items: center;
  padding: clamp(2.75rem, 9vw, 6rem) var(--container-gutter, 1.25rem);
  margin: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -5%, rgba(49, 230, 195, 0.1), transparent 55%),
    radial-gradient(ellipse 55% 40% at 100% 80%, rgba(37, 99, 235, 0.12), transparent 50%),
    #05070b;
}

.lgk-404__atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.lgk-404__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, transparent 30%, rgba(0, 0, 0, 0.55) 100%);
}

.lgk-404__grid {
  position: absolute;
  inset: -25% -10% 10%;
  background-image:
    linear-gradient(rgba(49, 230, 195, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 230, 195, 0.07) 1px, transparent 1px);
  background-size: 52px 52px;
  transform: perspective(720px) rotateX(62deg) translateY(-8%);
  transform-origin: center top;
  mask-image: radial-gradient(ellipse 75% 55% at 50% 28%, #000 15%, transparent 72%);
  opacity: 0.6;
  animation: lgk-404-grid-drift 22s linear infinite;
}

.lgk-404__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(56px);
  opacity: 0.5;
  will-change: transform;
}

.lgk-404__orb--a {
  width: min(48vw, 26rem);
  height: min(48vw, 26rem);
  top: 4%;
  left: 8%;
  background: radial-gradient(circle, rgba(49, 230, 195, 0.5), transparent 68%);
  animation: lgk-404-orb-float 10s var(--lgk-404-ease) infinite alternate;
}

.lgk-404__orb--b {
  width: min(40vw, 20rem);
  height: min(40vw, 20rem);
  right: 6%;
  bottom: 8%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.42), transparent 68%);
  animation: lgk-404-orb-float 13s var(--lgk-404-ease) infinite alternate-reverse;
}

.lgk-404__scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.07) 3px,
    rgba(0, 0, 0, 0.07) 6px
  );
  opacity: 0.4;
  mix-blend-mode: multiply;
  animation: lgk-404-scan 8s linear infinite;
}

.lgk-404__noise {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.lgk-404__stage {
  position: relative;
  z-index: 1;
  width: min(100%, 34rem);
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.75s var(--lgk-404-ease),
    transform 0.75s var(--lgk-404-ease);
}

.lgk-404--ready .lgk-404__stage {
  opacity: 1;
  transform: none;
}

.lgk-404__brand {
  margin: 0 0 1.1rem;
  font-family: var(--font-instrument), var(--font-display), ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.35rem, 4.2vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: 0 0 28px var(--lgk-404-cyan-dim);
  opacity: 0;
  animation: lgk-404-fade-up 0.7s var(--lgk-404-ease) 0.05s forwards;
  animation-play-state: paused;
}

.lgk-404__glitch {
  display: flex;
  justify-content: center;
  gap: 0.06em;
  margin: 0 0 0.85rem;
  font-family: var(--font-instrument), var(--font-display), ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(5rem, 22vw, 9.5rem);
  font-weight: 800;
  line-height: 0.85;
  letter-spacing: -0.07em;
  color: #fff;
}

.lgk-404__digit {
  position: relative;
  display: inline-block;
  text-shadow: 0 0 48px var(--lgk-404-cyan-dim);
  animation: lgk-404-jitter 5s steps(2, end) infinite;
}

.lgk-404__digit::before,
.lgk-404__digit::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0.8;
}

.lgk-404__digit::before {
  color: var(--lgk-404-cyan);
  clip-path: inset(0 0 52% 0);
  transform: translate(-3px, -1px);
  animation: lgk-404-glitch-a 2.6s infinite linear alternate-reverse;
}

.lgk-404__digit::after {
  color: var(--lgk-404-blue);
  clip-path: inset(48% 0 0 0);
  transform: translate(3px, 1px);
  animation: lgk-404-glitch-b 2.1s infinite linear alternate-reverse;
}

.lgk-404__digit--pulse {
  animation:
    lgk-404-jitter 5s steps(2, end) infinite,
    lgk-404-zero-breathe 2.6s var(--lgk-404-ease) infinite;
}

.lgk-404__trace {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: 100%;
  margin: 0 auto 1.15rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(49, 230, 195, 0.22);
  border-radius: var(--lgk-404-radius);
  background: rgba(8, 14, 18, 0.72);
  font-size: 0.72rem;
  line-height: 1.2;
  opacity: 0;
  animation: lgk-404-fade-up 0.7s var(--lgk-404-ease) 0.18s forwards;
  animation-play-state: paused;
}

.lgk-404__trace-label {
  flex: 0 0 auto;
  color: var(--lgk-404-cyan);
  font-weight: 750;
  letter-spacing: 0.12em;
}

.lgk-404__trace-path {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--lgk-404-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
}

.lgk-404__trace-cursor {
  flex: 0 0 auto;
  width: 0.45rem;
  height: 0.9em;
  background: var(--lgk-404-cyan);
  opacity: 0.85;
  animation: lgk-404-blink 1.05s steps(1, end) infinite;
}

.lgk-404__eyebrow {
  margin: 0;
  color: var(--lgk-404-cyan);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0;
  animation: lgk-404-fade-up 0.7s var(--lgk-404-ease) 0.28s forwards;
  animation-play-state: paused;
}

.lgk-404--ready .lgk-404__brand,
.lgk-404--ready .lgk-404__trace,
.lgk-404--ready .lgk-404__eyebrow,
.lgk-404--ready .lgk-404__title,
.lgk-404--ready .lgk-404__text,
.lgk-404--ready .lgk-404__search,
.lgk-404--ready .lgk-404__actions,
.lgk-404--ready .lgk-404__quick {
  animation-play-state: running;
}

.lgk-404__title {
  margin: 0.5rem 0 0;
  color: var(--lgk-404-ink);
  font-family: var(--font-instrument), var(--font-display), ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.65rem, 4.5vw, 2.35rem);
  font-weight: 750;
  letter-spacing: -0.025em;
  opacity: 0;
  animation: lgk-404-fade-up 0.7s var(--lgk-404-ease) 0.38s forwards;
  animation-play-state: paused;
}

.lgk-404__text {
  margin: 0.8rem auto 0;
  max-width: 28rem;
  color: var(--lgk-404-muted);
  font-size: 0.98rem;
  line-height: 1.55;
  opacity: 0;
  animation: lgk-404-fade-up 0.7s var(--lgk-404-ease) 0.48s forwards;
  animation-play-state: paused;
}

.lgk-404__search {
  margin-top: 1.45rem;
  opacity: 0;
  animation: lgk-404-fade-up 0.7s var(--lgk-404-ease) 0.58s forwards;
  animation-play-state: paused;
}

.lgk-404__search-form {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  padding: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--lgk-404-radius);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.lgk-404__search-form:focus-within {
  border-color: rgba(49, 230, 195, 0.45);
  box-shadow: 0 0 0 1px rgba(49, 230, 195, 0.2), 0 16px 44px rgba(0, 0, 0, 0.4);
}

.lgk-404__search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 0.95rem;
  padding: 0.7rem 0.85rem;
  outline: none;
}

.lgk-404__search-input::placeholder {
  color: rgba(232, 237, 245, 0.42);
}

.lgk-404__search-form button,
.lgk-404__search-form [type="submit"] {
  flex: 0 0 auto;
  border: 0;
  border-radius: calc(var(--lgk-404-radius) - 2px);
  padding: 0.65rem 1rem;
  background: var(--lgk-404-cyan);
  color: #05110e;
  font-size: 0.8rem;
  font-weight: 750;
  cursor: pointer;
  transition: filter 160ms ease, transform 160ms var(--lgk-404-ease);
}

.lgk-404__search-form button:hover,
.lgk-404__search-form [type="submit"]:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.lgk-404__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
  opacity: 0;
  animation: lgk-404-fade-up 0.7s var(--lgk-404-ease) 0.68s forwards;
  animation-play-state: paused;
}

.lgk-404__btn {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border-radius: var(--lgk-404-radius);
  font-size: 0.84rem;
  font-weight: 750;
  text-decoration: none;
  transition:
    transform 160ms var(--lgk-404-ease),
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.lgk-404__btn:hover {
  transform: translateY(-2px);
}

.lgk-404__btn:focus-visible {
  outline: 2px solid var(--lgk-404-cyan);
  outline-offset: 3px;
}

.lgk-404__btn--primary {
  background: var(--lgk-404-cyan);
  color: #05110e;
  box-shadow: 0 0 0 1px rgba(49, 230, 195, 0.3), 0 12px 28px rgba(49, 230, 195, 0.2);
}

.lgk-404__btn--primary:hover {
  box-shadow: 0 0 0 1px rgba(49, 230, 195, 0.5), 0 16px 34px rgba(49, 230, 195, 0.28);
}

.lgk-404__btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.lgk-404__btn--ghost:hover {
  border-color: rgba(49, 230, 195, 0.42);
  background: rgba(49, 230, 195, 0.08);
}

.lgk-404__quick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.25rem;
  margin-top: 1.5rem;
  opacity: 0;
  animation: lgk-404-fade-up 0.7s var(--lgk-404-ease) 0.78s forwards;
  animation-play-state: paused;
}

.lgk-404__quick a {
  color: rgba(232, 237, 245, 0.55);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 160ms ease;
}

.lgk-404__quick a:hover {
  color: var(--lgk-404-cyan);
}

@keyframes lgk-404-grid-drift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 104px;
  }
}

@keyframes lgk-404-orb-float {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(20px, -24px, 0) scale(1.07);
  }
}

@keyframes lgk-404-scan {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(10px);
  }
}

@keyframes lgk-404-jitter {
  0%,
  92%,
  100% {
    transform: translate(0);
  }
  93% {
    transform: translate(-2px, 1px);
  }
  95% {
    transform: translate(2px, -1px);
  }
  97% {
    transform: translate(-1px, 0);
  }
}

@keyframes lgk-404-glitch-a {
  0%,
  100% {
    transform: translate(-2px, 0);
  }
  50% {
    transform: translate(-6px, 1px);
  }
}

@keyframes lgk-404-glitch-b {
  0%,
  100% {
    transform: translate(2px, 0);
  }
  50% {
    transform: translate(6px, -1px);
  }
}

@keyframes lgk-404-zero-breathe {
  0%,
  100% {
    opacity: 1;
    filter: brightness(1);
  }
  50% {
    opacity: 0.7;
    filter: brightness(1.28);
  }
}

@keyframes lgk-404-blink {
  0%,
  49% {
    opacity: 0.9;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes lgk-404-fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {
  .lgk-404 {
    min-height: min(82vh, 48rem);
    padding-block: 2.5rem;
  }

  .lgk-404__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .lgk-404__btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lgk-404__grid,
  .lgk-404__orb,
  .lgk-404__scan,
  .lgk-404__digit,
  .lgk-404__digit::before,
  .lgk-404__digit::after,
  .lgk-404__trace-cursor,
  .lgk-404__brand,
  .lgk-404__trace,
  .lgk-404__eyebrow,
  .lgk-404__title,
  .lgk-404__text,
  .lgk-404__search,
  .lgk-404__actions,
  .lgk-404__quick {
    animation: none !important;
  }

  .lgk-404__stage,
  .lgk-404__brand,
  .lgk-404__trace,
  .lgk-404__eyebrow,
  .lgk-404__title,
  .lgk-404__text,
  .lgk-404__search,
  .lgk-404__actions,
  .lgk-404__quick {
    opacity: 1 !important;
    transform: none !important;
  }

  .lgk-404__digit::before,
  .lgk-404__digit::after {
    content: none;
  }
}
