:root {
  --black: #000;
  --beige: #fbf2df;
  --red: #ff3042;
  --page-gutter: clamp(18px, 3.4vw, 52px);
  --font-main: "Circular Std", sans-serif;
  --font-mono: "Space Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body.error-page {
  color: var(--beige);
  background: var(--black);
  font-family: var(--font-main);
  line-height: var(--leading-copy);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricprecision;
}

a {
  color: inherit;
  text-decoration: none;
}

.error-page__stage {
  isolation: isolate;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(18px, 2.5vh, 30px) var(--page-gutter) clamp(10px, 1.5vh, 18px);
  overflow: hidden;
}

.error-page__stage::before {
  content: "";
  z-index: -1;
  position: absolute;
  width: min(72vw, 960px);
  aspect-ratio: 1;
  right: -28vw;
  bottom: -44vw;
  border-radius: 50%;
  background: radial-gradient(circle, #ff30425c 0, #ff304220 32%, transparent 69%);
  pointer-events: none;
}

.error-page__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  color: #fbf2df9e;
  font-family: var(--font-mono);
  font-size: clamp(8px, 0.72vw, 10px);
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.3;
  text-transform: uppercase;
}

.error-page__meta span:last-child {
  text-align: right;
}

.error-page__content {
  display: grid;
  place-content: center;
  justify-items: center;
  min-height: 0;
  padding: clamp(24px, 4vh, 54px) 0;
  text-align: center;
}

.error-page__status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 clamp(18px, 2.4vh, 28px);
  color: var(--red);
  font-family: var(--font-mono);
  font-size: clamp(9px, 0.8vw, 11px);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.error-page__status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 18px #ff3042a8;
  animation: statusPulse 1.8s ease-in-out infinite;
}

.error-page__content h1 {
  margin: 0;
  color: var(--beige);
  max-width: none;
  font-size: clamp(26px, 5.6vw, 94px);
  font-weight: 700;
  letter-spacing: -0.065em;
  line-height: 0.88;
  white-space: nowrap;
}

.error-page__copy {
  margin: clamp(22px, 3vh, 34px) 0 0;
  color: #fbf2dfe6;
  font-size: clamp(17px, 1.5vw, 22px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: var(--leading-label);
}

.error-page__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 18px 28px;
  margin-top: clamp(28px, 4vh, 44px);
}

.error-page__contact {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1;
}

.error-page__contact span {
  margin-left: 7px;
  font-size: 14px;
}

.error-page__contact {
  color: var(--red);
  padding: 6px 0;
  border-bottom: 1px solid #ff304299;
  transition: color 160ms ease, border-color 160ms ease;
}

.error-page__contact span {
  color: var(--red);
}

.error-page__footer {
  width: 100%;
  min-width: 0;
}

.error-page__footer-brand {
  display: block;
  width: 100%;
}

.error-page__footer-brand img {
  display: block;
  width: 100%;
  height: auto;
}

.error-page__contact:focus-visible,
.error-page__footer-brand:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 5px;
}

@media (hover: hover) and (pointer: fine) {
  .error-page__contact:hover {
    color: var(--red);
    border-color: var(--red);
  }
}

@media (max-width: 640px) {
  .error-page__meta {
    align-items: flex-start;
    font-size: 8px;
  }

  .error-page__meta span {
    max-width: 44%;
  }

  .error-page__content {
    padding: 24px 0;
  }

  .error-page__status {
    margin-bottom: 20px;
  }

  .error-page__content h1 {
    max-width: none;
    font-size: clamp(26px, 7.4vw, 36px);
    line-height: 0.9;
  }

  .error-page__copy {
    max-width: 300px;
    font-size: 16px;
  }

  .error-page__actions {
    flex-direction: column;
    gap: 15px;
    margin-top: 28px;
  }

  .error-page__contact {
    font-size: 9px;
  }

  .error-page__stage::before {
    width: 110vw;
    right: -60vw;
    bottom: -32vw;
  }
}

@media (max-height: 620px) {
  .error-page__stage {
    padding-top: 12px;
    padding-bottom: 8px;
  }

  .error-page__meta {
    display: none;
  }

  .error-page__content {
    padding: 14px 0;
  }

  .error-page__status {
    margin-bottom: 14px;
  }

  .error-page__copy {
    margin-top: 16px;
  }

  .error-page__actions {
    margin-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .error-page__status::before {
    animation: none;
  }

  .error-page__contact {
    transition: none;
  }
}

@keyframes statusPulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.82);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}
