/* ===== /lost+found/ 404 — meta-world wayfinding sign ===== */

.lf-body {
  background:
    radial-gradient(ellipse at 50% 30%, #1a1430 0%, #0a0a18 55%, #03030a 100%);
  position: relative;
  overflow-x: hidden;
}

/* Scanlines */
.lf-scanlines {
  position: fixed;
  inset: 0;
  z-index: 998;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.025) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: overlay;
}

.lf-vignette {
  position: fixed;
  inset: 0;
  z-index: 997;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.75) 100%);
}

/* Meta-world perspective floor grid */
.lf-body::before {
  content: "";
  position: fixed;
  left: 50%;
  bottom: -20vh;
  width: 300vw;
  height: 80vh;
  transform: translateX(-50%) perspective(600px) rotateX(62deg);
  background:
    linear-gradient(to right, rgba(124,106,247,0.28) 1px, transparent 1px) 0 0 / 60px 60px,
    linear-gradient(to bottom, rgba(124,106,247,0.28) 1px, transparent 1px) 0 0 / 60px 60px;
  mask-image: radial-gradient(ellipse at center top, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center top, #000 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: lf-grid-move 12s linear infinite;
}

@keyframes lf-grid-move {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 60px, 60px 0; }
}

/* Page layout */
.lf-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.lf-page::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  background: rgba(124,106,247,0.25);
  filter: blur(140px);
  border-radius: 50%;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
}

.lf-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.6rem;
  animation: lf-boot 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes lf-boot {
  from { opacity: 0; transform: translateY(20px); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* 404 */
.lf-header { text-align: center; }

.lf-code {
  font-family: var(--font-en);
  font-size: clamp(5rem, 16vw, 8rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
  color: #fff;
  position: relative;
  display: inline-block;
  text-shadow:
    0 0 30px rgba(124,106,247,0.6),
    0 0 80px rgba(124,106,247,0.3);
}

.lf-code::before,
.lf-code::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
}

.lf-code::before {
  color: #f87171;
  mix-blend-mode: screen;
  animation: lf-glitch-1 3.2s infinite steps(1);
}

.lf-code::after {
  color: var(--accent2);
  mix-blend-mode: screen;
  animation: lf-glitch-2 3.2s infinite steps(1);
}

@keyframes lf-glitch-1 {
  0%, 100% { clip-path: inset(0 0 0 0); transform: translate(0, 0); }
  20%      { clip-path: inset(20% 0 55% 0); transform: translate(-3px, 1px); }
  40%      { clip-path: inset(70% 0 10% 0); transform: translate(2px, -1px); }
  60%      { clip-path: inset(45% 0 40% 0); transform: translate(-2px, 2px); }
  80%      { clip-path: inset(10% 0 75% 0); transform: translate(3px, 0); }
}

@keyframes lf-glitch-2 {
  0%, 100% { clip-path: inset(0 0 0 0); transform: translate(0, 0); }
  20%      { clip-path: inset(60% 0 15% 0); transform: translate(3px, -1px); }
  40%      { clip-path: inset(15% 0 65% 0); transform: translate(-2px, 1px); }
  60%      { clip-path: inset(75% 0 5% 0); transform: translate(2px, -2px); }
  80%      { clip-path: inset(35% 0 45% 0); transform: translate(-3px, 0); }
}

.lf-sub {
  margin-top: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

/* === Wayfinding Signboard (Kyoto station style) === */
.lf-sign {
  position: relative;
  display: inline-block;
  animation: lf-float-sign 5s ease-in-out infinite alternate;
}

@keyframes lf-float-sign {
  from { transform: translateY(0); }
  to   { transform: translateY(-8px); }
}

.lf-sign-board {
  --sign-blue: #1f5bb6;
  --sign-text: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1rem 1.6rem;
  background: #f4f4ee;
  border: 2px solid #d6d6cc;
  border-radius: 2px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.15),
    0 8px 28px rgba(0,0,0,0.55),
    0 0 60px rgba(124,106,247,0.35);
  font-family: 'Noto Sans JP', sans-serif;
  position: relative;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lf-sign-board:hover {
  transform: translateY(-3px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.2),
    0 14px 40px rgba(0,0,0,0.6),
    0 0 90px rgba(124,106,247,0.55);
}

.lf-sign-board:hover .lf-sign-arrow {
  animation: lf-arrow-nudge 0.8s ease infinite;
}

@keyframes lf-arrow-nudge {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-5px); }
}

/* Subtle holo shimmer on the sign */
.lf-sign-board::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg,
    transparent 30%,
    rgba(124,106,247,0.12) 48%,
    rgba(62,207,207,0.12) 52%,
    transparent 70%);
  pointer-events: none;
  mix-blend-mode: screen;
  animation: lf-shimmer 6s linear infinite;
}

@keyframes lf-shimmer {
  from { transform: translateX(-30%); }
  to   { transform: translateX(30%); }
}

.lf-sign-arrow {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--sign-blue);
  line-height: 1;
  padding-right: 0.3rem;
  border-right: 1px solid rgba(0,0,0,0.12);
}

.lf-sign-icon {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  /* tint black SVG → sign-blue */
  filter: brightness(0) saturate(100%)
          invert(26%) sepia(91%) saturate(1520%)
          hue-rotate(204deg) brightness(92%) contrast(88%);
}

.lf-sign-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.25;
}

.lf-sign-ja {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--sign-text);
  letter-spacing: 0.02em;
}

.lf-sign-en {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--sign-text);
  letter-spacing: 0.04em;
}

.lf-sign-hours {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #555;
  letter-spacing: 0.02em;
  margin-top: 0.15rem;
}

/* Home button */
.lf-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  padding: 0.85em 2em;
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid rgba(124,106,247,0.6);
  background: rgba(124,106,247,0.1);
  color: #fff;
  text-transform: uppercase;
  transition: transform 0.25s, background 0.25s, box-shadow 0.25s;
  box-shadow: 0 0 16px rgba(124,106,247,0.3);
}

.lf-btn:hover {
  background: rgba(124,106,247,0.25);
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(124,106,247,0.6);
}

.lf-btn-arrow { transition: transform 0.25s; }
.lf-btn:hover .lf-btn-arrow { transform: translateX(-3px); }

/* Responsive */
@media (max-width: 700px) {
  .lf-page { padding: 3rem 1rem; }
  .lf-container { gap: 2rem; }

  .lf-sign-board {
    gap: 0.8rem;
    padding: 0.8rem 1.1rem;
  }

  .lf-sign-arrow { font-size: 2rem; padding-right: 0.2rem; }
  .lf-sign-icon  { width: 52px; height: 52px; }
  .lf-sign-ja    { font-size: 1rem; }
  .lf-sign-en    { font-size: 0.78rem; }
  .lf-sign-hours { font-size: 0.62rem; }

  .lf-btn { font-size: 0.72rem; padding: 0.7em 1.6em; }
}

@media (prefers-reduced-motion: reduce) {
  .lf-code,
  .lf-code::before,
  .lf-code::after,
  .lf-sign,
  .lf-sign-board::before,
  .lf-body::before { animation: none !important; }
}
