.page--404.page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.page--404 .page__main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.page--404 .not-found {
  position: relative;
  overflow: clip;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  padding: clamp(18px, 4vw, 34px) 0 clamp(18px, 4vw, 34px);
}

/* The global `.section` adds large vertical padding — remove it here so we can truly center. */
.page--404 .section.not-found {
  padding: 0;
}

.page--404 .not-found__shell {
  width: 100%;
}

.page--404 .not-found__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.page--404 .not-found__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 520px at 50% 10%, rgba(255, 255, 255, 0.72), transparent 62%),
    radial-gradient(980px 640px at 50% 112%, rgba(152, 131, 131, 0.10), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(249, 250, 251, 0.92));
  opacity: 0.9;
}

.page--404 .not-found__inner {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: 0 auto;
  text-align: center;
  padding: clamp(18px, 3.2vw, 28px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(51, 78, 94, 0.12);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  opacity: 0;
  transform: translateY(10px);
  animation: notFoundIn 720ms ease forwards;
  animation-delay: 90ms;
}

.page--404 .not-found__mark {
  width: 74px;
  height: 74px;
  margin: 14px auto 0;
  display: grid;
  place-items: center;
}

.page--404 .not-found__mark-svg {
  width: 74px;
  height: 74px;
  display: block;
  filter: drop-shadow(0 18px 40px rgba(20, 160, 178, 0.14));
}

.page--404 .not-found__code {
  font-family: var(--font-display, "Montserrat", system-ui, -apple-system, Segoe UI, sans-serif);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.92;
  font-size: clamp(64px, 12vw, 120px);
  background: linear-gradient(135deg, rgba(20, 160, 178, 0.95), rgba(51, 78, 94, 0.92));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 18px 60px rgba(20, 160, 178, 0.12);
}

.page--404 .not-found__title {
  margin: 14px 0 0;
  font-size: clamp(22px, 2.4vw, 34px);
  letter-spacing: -0.02em;
  color: rgba(51, 78, 94, 0.92);
}

.page--404 .not-found__lead {
  margin: 12px auto 0;
  max-width: 56ch;
  color: rgba(51, 78, 94, 0.78);
  font-size: clamp(15px, 1.45vw, 18px);
  line-height: 1.65;
  font-weight: 600;
}

.page--404 .not-found__text {
  margin: 14px auto 0;
  max-width: 62ch;
  color: rgba(51, 78, 94, 0.72);
  font-size: clamp(15px, 1.35vw, 17px);
  line-height: 1.65;
}

.page--404 .not-found__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 22px;
}

.page--404 .not-found__hint {
  margin-top: 18px;
  color: rgba(51, 78, 94, 0.55);
  font-size: 14px;
  line-height: 1.55;
}

.page--404 .not-found__inline-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(20, 160, 178, 0.35);
  text-underline-offset: 3px;
}

.page--404 .not-found__inline-link:hover {
  text-decoration-color: rgba(20, 160, 178, 0.75);
}

@keyframes notFoundIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page--404 .not-found__inner {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 520px) {
  .page--404 .not-found__actions {
    flex-direction: column;
    align-items: stretch;
  }
}
