:root {
  --background: #101014;
  --foreground: #f5f5f7;
  --muted: #a9a9b3;
  --line: #30303a;
  --accent: #b6c2ff;
  --font-body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: ui-serif, Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

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

html {
  background: var(--background);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background-color: var(--background);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 4rem 4rem;
  color: var(--foreground);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.site-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(100%, 1120px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 3rem);
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.site-header {
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.site-footer {
  padding-block: 1.15rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-header p,
.site-footer p {
  margin: 0;
}

.site-mark {
  color: var(--foreground);
  font-family: var(--font-mono);
  font-weight: 700;
  text-decoration: none;
  transition: color 180ms ease;
}

.site-mark span {
  color: var(--accent);
}

.site-mark:focus-visible,
:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

.site-mark:hover {
  color: var(--accent);
}

.site-status {
  color: var(--muted);
}

.site-status span {
  color: var(--accent);
  font-size: 0.6rem;
  vertical-align: 0.08em;
}

main {
  display: flex;
  min-width: 0;
}

.hero {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-height: clamp(28rem, calc(100vh - 10rem), 46rem);
  padding-block: clamp(4.5rem, 12vw, 9rem);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 100%;
  margin: 1rem 0 clamp(3rem, 8vw, 6.5rem);
  color: var(--foreground);
  font-family: var(--font-display);
  font-size: clamp(4rem, 20vw, 13rem);
  font-weight: 500;
  letter-spacing: -0.1em;
  line-height: 0.8;
}

.hero h1[data-scramble-active]::after {
  width: 0.13em;
  height: 0.13em;
  margin-left: 0.1em;
  background: repeating-conic-gradient(currentColor 0% 25%, transparent 0% 50%) 0 0 / 0.04em 0.04em;
  content: "";
  display: inline-block;
  vertical-align: 0.08em;
  animation: scramble-cursor 1s step-end infinite;
}

@keyframes scramble-cursor {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

.not-found {
  position: relative;
  min-height: 100svh;
  padding: 0 clamp(1rem, 4vw, 3rem);
}

.not-found-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 100svh;
  padding-block: clamp(4rem, 14vw, 9rem);
}

.not-found h1 {
  margin: 0;
  color: var(--foreground);
  font-family: var(--font-display);
  font-size: clamp(4rem, 18vw, 11rem);
  font-weight: 500;
  letter-spacing: -0.1em;
  line-height: 0.8;
}

.not-found-message {
  min-height: 1.25em;
  margin: clamp(2rem, 6vw, 4rem) 0 1.5rem;
  color: var(--foreground);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.not-found-return {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-decoration-color: var(--line);
  text-underline-offset: 0.35em;
  text-transform: uppercase;
  transition: color 180ms ease;
}

.not-found-return:hover,
.not-found-return:focus-visible {
  color: var(--foreground);
}

.not-found-metadata {
  position: fixed;
  right: clamp(1rem, 4vw, 3rem);
  bottom: clamp(1rem, 4vw, 3rem);
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  opacity: 0.65;
  text-transform: uppercase;
}

.lost-packet {
  position: fixed;
  top: 0;
  left: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1;
  opacity: 0.45;
  pointer-events: auto;
  transition: transform 180ms ease-out, opacity 180ms ease;
  user-select: none;
}

.hero-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 22rem);
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: start;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.hero-copy {
  max-width: 32rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.45;
}

.text-link {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0 0 0.25rem;
  border-bottom: 1px solid var(--line);
  color: var(--foreground);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.text-link span:first-child {
  color: var(--muted);
}

.text-link code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--accent);
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
}

@media (max-width: 640px) {
  .site-shell {
    padding-inline: 1rem;
  }

  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    gap: 0.6rem;
  }

  .site-status,
  .site-footer p {
    overflow-wrap: anywhere;
  }

  .hero {
    min-height: auto;
    padding-block: clamp(4rem, 20vw, 7rem);
  }

  .hero h1 {
    margin-bottom: clamp(2.75rem, 12vw, 4rem);
    font-size: clamp(4rem, 23vw, 8rem);
  }

  .hero-footer {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .not-found {
    padding-inline: 1rem;
  }

  .not-found-content {
    justify-content: flex-start;
    padding-top: clamp(7rem, 26vw, 10rem);
  }

  .not-found h1 {
    font-size: clamp(4rem, 27vw, 8rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
