/* ============================================================
   FLOTARIUM — 404 / "Страница ушла в невесомость"
   Uses the locked Deep Water UI Kit tokens.
   ============================================================ */

.lost-stage {
  --mx: 0px;
  --my: 0px;
  --rx: 0deg;
  --ry: 0deg;
  min-height: 100svh;
  padding-block: clamp(136px, 15vh, 178px) clamp(54px, 7vw, 90px);
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(6,15,29,0) 0 62%, rgba(17,35,56,0.22) 100%),
    var(--bg);
}

.lost-stage::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 52%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong) 20%, var(--accent-soft) 50%, var(--line-strong) 80%, transparent);
  opacity: 0.45;
  pointer-events: none;
}

.lost-glow {
  position: absolute;
  z-index: -1;
  width: min(72vw, 900px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.lost-glow--one {
  right: -18%;
  top: -22%;
  background: radial-gradient(circle, var(--halo-1), transparent 66%);
  opacity: 0.5;
}

.lost-glow--two {
  left: -26%;
  bottom: -44%;
  background: radial-gradient(circle, var(--halo-2), transparent 67%);
  opacity: 0.34;
}

.lost-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  align-items: center;
  gap: clamp(36px, 5vw, 80px);
}

.lost-copy { position: relative; z-index: 3; }

.lost-copy h1 {
  max-width: 590px;
  margin-top: clamp(18px, 2vw, 26px);
  font-size: clamp(2.9rem, 2.25rem + 1.85vw, 4.2rem);
  line-height: 0.98;
}

.lost-copy h1 em {
  color: var(--accent-2);
  font-weight: 400;
}

.lost-copy .lede {
  max-width: 590px;
  margin-top: clamp(24px, 2.6vw, 36px);
  font-size: clamp(1rem, 0.94rem + 0.35vw, 1.2rem);
}

.lost-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(28px, 3.2vw, 44px);
}

.lost-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 25px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.lost-note span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
  animation: lostPulse 2.8s var(--ease) infinite;
}

.lost-visual {
  position: relative;
  min-height: clamp(430px, 43vw, 560px);
  perspective: 1100px;
  transition: --mx 0.5s, --my 0.5s;
}

.error-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(38vw, 510px);
  max-width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  overflow: hidden;
  transform: translate(calc(-50% + var(--mx)), calc(-50% + var(--my))) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  background:
    linear-gradient(180deg, rgba(17,35,56,0.22) 0 49.9%, rgba(39,102,198,0.12) 50.1%, rgba(6,15,29,0.72) 100%),
    radial-gradient(circle at 50% 40%, var(--surface-2), var(--bg) 68%);
  box-shadow: 0 52px 100px -70px rgba(74,142,217,0.9), inset 0 0 90px rgba(74,142,217,0.06);
  transition: transform 0.9s var(--ease-out), border-color 0.45s var(--ease), box-shadow 0.55s var(--ease);
}

.lost-visual:hover .error-orbit {
  border-color: var(--line-strong);
  box-shadow: 0 60px 110px -68px rgba(74,142,217,0.95), inset 0 0 100px rgba(74,142,217,0.09);
}

.error-code {
  position: absolute;
  left: 50%;
  z-index: 5;
  font-family: var(--font-display);
  font-size: clamp(8.6rem, 13vw, 12.5rem);
  font-weight: 400;
  line-height: 0.78;
  letter-spacing: -0.07em;
  white-space: nowrap;
  color: var(--text);
}

.error-code--main {
  bottom: 42%;
  transform: translateX(-51.5%);
  text-shadow: 0 0 44px rgba(136,182,236,0.1);
}

.reflection-mask {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  top: 58%;
  bottom: 0;
  overflow: hidden;
}

.error-code--reflection {
  bottom: 100%;
  color: var(--accent-2);
  opacity: 0.2;
  filter: blur(1.2px);
  transform: translateX(-51.5%) scaleY(-1) skewX(-1.5deg);
  transform-origin: 50% 100%;
}

.waterline {
  position: absolute;
  z-index: 6;
  left: -8%;
  right: -8%;
  top: 58%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-2) 20%, #e8f1f7 50%, var(--accent) 80%, transparent);
  box-shadow: 0 0 18px 2px var(--accent-glow);
  transform: translateY(-50%) rotate(-0.5deg);
}

.waterline span,
.waterline::before,
.waterline::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28%;
  height: 24px;
  border: 1px solid var(--accent-2);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.25);
  animation: surfaceRing 4.8s var(--ease-out) infinite;
}

.waterline::before { animation-delay: 1.6s; }
.waterline::after { animation-delay: 3.2s; }

.orbit {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  border: 1px solid var(--line);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.orbit--outer { width: 84%; height: 31%; animation: orbitBreath 7s var(--ease) infinite; }
.orbit--middle { width: 63%; height: 22%; opacity: 0.72; animation: orbitBreath 7s var(--ease) 1.1s infinite reverse; }
.orbit--inner { width: 38%; height: 13%; opacity: 0.55; animation: orbitBreath 6s var(--ease) 2s infinite; }

.orb-bubble,
.lost-bubble {
  position: absolute;
  display: block;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  box-shadow: inset -4px -5px 12px rgba(74,142,217,0.08), 0 0 14px rgba(74,142,217,0.05);
}

.orb-bubble { z-index: 8; bottom: 18%; animation: bubbleRise 7s ease-in infinite; }
.orb-bubble--one { left: 25%; width: 9px; height: 9px; animation-delay: -1s; }
.orb-bubble--two { right: 28%; width: 16px; height: 16px; animation-delay: -4.2s; animation-duration: 8.5s; }
.orb-bubble--three { left: 58%; width: 6px; height: 6px; animation-delay: -6s; animation-duration: 6.5s; }

.lost-bubble { z-index: -1; opacity: 0.5; animation: freeBubble 10s ease-in-out infinite; }
.lost-bubble--one { left: 6%; top: 34%; width: 9px; height: 9px; }
.lost-bubble--two { right: 7%; top: 24%; width: 19px; height: 19px; animation-delay: -3s; }
.lost-bubble--three { right: 42%; bottom: 13%; width: 7px; height: 7px; animation-delay: -7s; }

.lost-footer { background: var(--bg-2); }
.modal #bookTitle { margin: 14px 0 8px; font-size: var(--step-2); }
.modal-intro { font-size: var(--step--1); }
.modal #bookSubmit { width: 100%; margin-top: 6px; }
.modal-close span, .mclose span { font-size: 1.65rem; font-weight: 300; line-height: 1; transform: translateY(-1px); }
.mobile-menu .eyebrow { margin: 0; }

@keyframes surfaceRing {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.25); }
  14% { opacity: 0.55; }
  82%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(3.1); }
}

@keyframes orbitBreath {
  0%, 100% { transform: translate(-50%, -50%) scale(0.94); opacity: 0.28; }
  50% { transform: translate(-50%, -50%) scale(1.06); opacity: 0.72; }
}

@keyframes bubbleRise {
  0% { transform: translateY(50px) scale(0.72); opacity: 0; }
  18% { opacity: 0.72; }
  80% { opacity: 0.46; }
  100% { transform: translateY(-180px) scale(1.08); opacity: 0; }
}

@keyframes freeBubble {
  0%, 100% { transform: translate3d(0, 12px, 0); opacity: 0.25; }
  50% { transform: translate3d(8px, -18px, 0); opacity: 0.7; }
}

@keyframes lostPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  55% { box-shadow: 0 0 0 8px transparent; }
}

@media (max-width: 1040px) {
  .lost-layout { grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr); gap: 32px; }
  .error-orbit { width: min(43vw, 500px); }
}

@media (max-width: 820px) {
  .lost-stage { padding-top: 124px; }
  .lost-layout { grid-template-columns: 1fr; }
  .lost-copy { text-align: center; }
  .lost-copy .eyebrow { justify-content: center; }
  .lost-copy .eyebrow::after { content: ""; width: 26px; height: 1px; background: var(--accent); opacity: 0.7; }
  .lost-copy h1, .lost-copy .lede { margin-inline: auto; }
  .lost-actions, .lost-note { justify-content: center; }
  .lost-visual { min-height: min(112vw, 560px); }
  .error-orbit { width: min(82vw, 500px); }
}

@media (max-width: 620px) {
  .lost-copy h1 { font-size: clamp(2.85rem, 14vw, 4.2rem); line-height: 0.96; }
  .lost-copy h1 br { display: none; }
  .lost-copy .lede { max-width: 38ch; }
  .lost-actions { flex-direction: column; align-items: stretch; }
  .lost-actions .btn { width: 100%; }
  .lost-note { text-align: left; }
  .error-code { font-size: clamp(7.8rem, 39vw, 11.5rem); }
}

@media (max-width: 390px) {
  .lost-stage { padding-top: 116px; }
  .lost-visual { min-height: 370px; }
  .error-orbit { width: 88vw; }
}

@media (prefers-reduced-motion: reduce) {
  .lost-note span,
  .waterline span,
  .waterline::before,
  .waterline::after,
  .orbit,
  .orb-bubble,
  .lost-bubble { animation: none; }
  .waterline span { opacity: 0.28; transform: translate(-50%, -50%) scale(2); }
  .error-orbit { transition: none; }
}
