:root {
  color-scheme: dark;
  --page-bg: #303030;
  --page-bg-deep: #282828;
  --text: #f6f4ef;
  --muted: #cfcac1;
  --line: rgba(246, 244, 239, 0.22);
  --button-bg: #f6f4ef;
  --button-text: #222222;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0) 42%),
    var(--page-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(2rem, 6vw, 5rem) 1.5rem;
}

.hero {
  width: min(100%, 46rem);
  display: grid;
  justify-items: center;
  gap: clamp(1.8rem, 4vw, 3.2rem);
  text-align: center;
}

.brand-logo {
  width: min(82vw, 28rem);
  height: auto;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.actions {
  width: min(100%, 27rem);
  display: grid;
  gap: 0.85rem;
}

.error-page {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0) 28rem),
    var(--page-bg);
}

.error-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(1.25rem, 4vw, 3rem);
}

.error-layout {
  width: min(100%, 28rem);
  display: grid;
  gap: 1.35rem;
  justify-items: center;
  text-align: center;
}

.error-code {
  margin: 0;
  color: var(--muted);
  font-size: clamp(4.5rem, 18vw, 9rem);
  font-weight: 200;
  letter-spacing: 0;
  line-height: 0.9;
}

.error-title {
  margin: 0;
  font-size: clamp(1.35rem, 5vw, 2rem);
  font-weight: 300;
  line-height: 1.15;
}

.error-actions {
  width: min(100%, 14rem);
  display: grid;
  gap: 0.85rem;
  margin-top: 0.45rem;
}

.button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible {
  outline: 3px solid rgba(246, 244, 239, 0.42);
  outline-offset: 4px;
}

.button-primary {
  color: var(--button-text);
  background: var(--button-bg);
  border-color: var(--button-bg);
}

.button-primary:hover {
  background: #ffffff;
  border-color: #ffffff;
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

.button-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(246, 244, 239, 0.46);
}

@media (max-width: 35rem) {
  .page-shell {
    align-items: center;
    padding-inline: 1rem;
  }

  .hero {
    gap: 1.55rem;
  }

  .brand-logo {
    width: min(84vw, 21rem);
  }

  .actions {
    width: 100%;
  }

  .error-actions {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}
