:root {
  color-scheme: dark;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --page-max: 88rem;
  --page-gutter: clamp(1.25rem, 5vw, 3rem);
  --background: #0d1821;
  --text: #f4ead8;
  --muted-text: #a7a39b;
  --accent: #7f9aac;
  background: var(--background);
  color: var(--text);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-kerning: normal;
  font-optical-sizing: auto;
  -webkit-text-size-adjust: 100%;
  background-color: var(--background);
  background-image:
    url("/noise.svg"),
    linear-gradient(
      135deg,
      #08131b 0%,
      #0d1821 34%,
      #162b3e 68%,
      #2f4962 100%
    );
  background-position: 0 0, center;
  background-repeat: repeat, no-repeat;
  background-size: 160px 160px, cover;
  background-blend-mode: soft-light, normal;
}

.page {
  display: flex;
  width: min(100%, var(--page-max));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding-left: max(var(--page-gutter), env(safe-area-inset-left));
  padding-right: max(var(--page-gutter), env(safe-area-inset-right));
  align-items: center;
}

main {
  max-width: 100%;
  padding-block: clamp(5rem, 14vh, 10rem);
}

h1, p { margin: 0; }

h1 {
  color: var(--text);
  font-weight: 500;
}

.accent {
  width: 4.5rem;
  height: 2px;
  background: var(--accent);
}

.copy {
  color: var(--muted-text);
  font-weight: 400;
  letter-spacing: 0;
}

.nowrap { white-space: nowrap; }

.home main { width: 100%; }

.home-title {
  max-width: 100%;
  margin-inline-start: -.018em;
  font-size: clamp(3.25rem, 9.5vw, 8.5rem);
  letter-spacing: -.032em;
  line-height: .96;
  overflow-wrap: normal;
  word-break: normal;
}

.home .accent {
  margin: clamp(2.25rem, 5vw, 4rem) 0 1.9rem;
}

.home-copy {
  max-width: 26rem;
  font-size: clamp(1.15rem, 2vw, 1.65rem);
  line-height: 1.48;
}

.error-page main {
  width: min(100%, 48rem);
}

.error-code {
  display: block;
  margin-bottom: 1rem;
  color: var(--accent);
  font-size: .9rem;
  letter-spacing: .08em;
}

.error-title {
  margin-inline-start: -.026em;
  font-size: clamp(3rem, 8.5vw, 6.75rem);
  letter-spacing: -.028em;
  line-height: .98;
}

.error-page .accent {
  margin: 2.5rem 0 1.75rem;
}

.error-copy {
  max-width: 32rem;
  margin-bottom: 1.75rem;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.55;
  text-wrap: balance;
}

.error-link {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: .25em;
}

.error-link:focus-visible {
  border-radius: .125rem;
  outline: 2px solid var(--accent);
  outline-offset: .3rem;
}

@media (hover: hover) {
  .error-link:hover { text-decoration-thickness: 2px; }
}

@media (max-width: 40rem) {
  .page { align-items: flex-start; }
  main { padding-top: 24vh; }
  .home-title {
    font-size: clamp(3rem, 14.25vw, 5.25rem);
    letter-spacing: -.022em;
    line-height: .98;
  }
}

@media (max-width: 16rem) {
  .home-title,
  .error-title { overflow-wrap: anywhere; }
}
