*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  background-color: #fff;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.5;
  color: #1e3347;
  background-color: #fff;
}

img {
  max-width: 100%;
  height: auto;
}

.error-page-body {
  min-height: 100svh;
  background-color: #fff;
  background-image: linear-gradient(180deg, #fd9340 0%, #ffd2b0 42%, #fff4ec 58%, #fff 72%);
}

.error-page {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  color: #1e3347;
}

.error-page__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding:
    max(clamp(1rem, 2.4vw, 1.5rem), env(safe-area-inset-top))
    max(clamp(1.15rem, 4vw, 2.5rem), env(safe-area-inset-right))
    clamp(1rem, 2.4vw, 1.5rem)
    max(clamp(1.15rem, 4vw, 2.5rem), env(safe-area-inset-left));
}

.error-page__brand {
  display: inline-flex;
}

.error-page__brand img {
  display: block;
  width: clamp(7.8rem, 14vw, 9.6rem);
  height: auto;
}

.site-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  max-width: 100%;
  padding: 0.55rem 0.55rem 0.55rem 1.45rem;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  color: #1e3347;
  background: #fff;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.site-btn:hover {
  transform: translateY(-2px);
}

.site-btn:focus-visible {
  outline: 2px solid #f15a07;
  outline-offset: 3px;
}

.site-btn--light {
  background: #fff;
  color: #1e3347;
  font-weight: 600;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.14);
}

.site-btn--compact {
  gap: 0.45rem;
  padding: 0.38rem 0.4rem 0.38rem 1rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.site-btn__label-short {
  display: none;
}

.error-page__bar .site-btn.site-btn--light.site-btn--compact {
  flex-shrink: 0;
  box-shadow: 0 16px 40px rgba(21, 36, 51, 0.28);
}

.site-btn__arrow {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: #f15a07;
  color: #fff;
}

.site-btn--compact .site-btn__arrow {
  width: 1.9rem;
  height: 1.9rem;
}

.site-btn__arrow::before {
  content: "";
  display: block;
  width: 0.95rem;
  height: 0.95rem;
  background-color: currentColor;
  mask: url("/assets/img/icons/right-arrows.svg") center / contain no-repeat;
  -webkit-mask: url("/assets/img/icons/right-arrows.svg") center / contain no-repeat;
}

.site-btn--compact .site-btn__arrow::before {
  width: 0.82rem;
  height: 0.82rem;
}

.error-page__hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0
    max(clamp(1.15rem, 4vw, 2.5rem), env(safe-area-inset-right))
    max(clamp(2.4rem, 6vw, 4rem), env(safe-area-inset-bottom))
    max(clamp(1.15rem, 4vw, 2.5rem), env(safe-area-inset-left));
  text-align: center;
}

.error-page__art {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 64rem);
  min-height: clamp(16rem, 48vw, 30rem);
  margin: 0 0 -0.6rem;
}

.error-page__mascot {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  height: clamp(16rem, 48vw, 28rem);
  max-width: min(88vw, 30rem);
  object-fit: contain;
  filter: drop-shadow(0 22px 28px rgba(30, 51, 71, 0.16));
}

@media (prefers-reduced-motion: no-preference) {
  .error-page__mascot {
    animation: error-page-float 4.8s ease-in-out infinite;
  }
}

@keyframes error-page-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-0.45rem);
  }
}

.overheadline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 0 0 0.65rem;
  font-size: clamp(0.82rem, 1.4vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f15a07;
}

.overheadline::before {
  content: "";
  flex-shrink: 0;
  width: 2.15rem;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, #fd9340, #f15a07);
}

.error-page__hero h1 {
  max-width: 16em;
  margin: 0.15rem 0 0.7rem;
  font-size: clamp(1.9rem, 4.2vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.error-page__lead {
  max-width: 34rem;
  margin: 0 0 1.55rem;
  font-size: clamp(1.12rem, 2.1vw, 1.38rem);
  font-weight: 500;
  line-height: 1.5;
  color: rgba(30, 51, 71, 0.58);
}

.error-page__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  padding: 0.55rem 1.35rem 0.55rem 0.55rem;
  border-radius: 999px;
  background: #fff;
  color: #1e3347;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 14px 32px rgba(30, 51, 71, 0.12);
}

.error-page__cta--note {
  cursor: default;
  max-width: 100%;
  padding: 0.7rem 1.45rem;
  white-space: normal;
  text-wrap: balance;
}

.error-page__cta--note .error-page__cta-icon {
  display: none;
}

.error-page__cta-icon {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  background: #f15a07;
  color: #fff;
}

.error-page__cta-icon::before {
  content: "";
  display: block;
  width: 0.82rem;
  height: 0.82rem;
  background-color: currentColor;
  mask: url("/assets/img/icons/right-arrows.svg") center / contain no-repeat;
  -webkit-mask: url("/assets/img/icons/right-arrows.svg") center / contain no-repeat;
}

@media (max-width: 640px) {
  .error-page__brand img {
    width: clamp(6.4rem, 28vw, 8rem);
  }

  .error-page__bar .site-btn .site-btn__label {
    display: none;
  }

  .error-page__bar .site-btn .site-btn__label-short {
    display: inline;
  }

  .error-page__art {
    min-height: 0;
    width: min(100%, 22rem);
  }

  .error-page__mascot {
    height: clamp(11rem, 42vw, 16rem);
    max-width: min(70vw, 18rem);
  }

  .error-page__hero h1 {
    font-size: clamp(1.55rem, 7vw, 2rem);
  }

  .error-page__lead {
    font-size: clamp(1.05rem, 4.2vw, 1.2rem);
  }
}

@media (max-width: 380px) {
  .error-page__cta--note {
    font-size: 0.95rem;
    padding: 0.62rem 1.15rem;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .error-page__art {
    min-height: 0;
    margin-bottom: 0.2rem;
  }

  .error-page__mascot {
    height: 8.5rem;
    max-width: 11rem;
  }

  .error-page__hero {
    padding-bottom: max(1.1rem, env(safe-area-inset-bottom));
  }

  .error-page__hero h1 {
    margin-bottom: 0.4rem;
    font-size: 1.45rem;
  }

  .error-page__lead {
    margin-bottom: 0.9rem;
    font-size: 1.02rem;
  }
}
