:root {
  color-scheme: dark;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  line-height: 1.35;
  color: #f2efe7;
  background: #173642;
  --world: #e8e4db;
  --enamel: #f2efe7;
  --ink: #173642;
  --soft: #4c6872;
  --line: #c7dad9;
  --sky: #a9e4ff;
  --lilac: #d9c5ff;
  --mint: #c9f1e7;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  background: var(--ink);
}

a {
  color: inherit;
  text-decoration-color: var(--soft);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

a:hover {
  color: var(--sky);
  text-decoration-color: currentColor;
}

a:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 0.3rem;
}

.site-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto minmax(24rem, 1fr) auto;
  min-height: 100svh;
  overflow: hidden;
  color: var(--enamel);
  background: var(--ink);
}

.house-seam,
footer {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 1rem;
  align-items: center;
  min-height: 5rem;
  padding: 1.25rem clamp(1.25rem, 5vw, 2.25rem);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(0.75rem, 2.8vw, 0.9rem);
  letter-spacing: 0.01em;
}

.house-seam {
  border-bottom: 1px solid var(--soft);
}

.seam-signal {
  display: flex;
  gap: 0.45rem;
  margin-left: auto;
}

.seam-signal i {
  display: block;
  width: 0.8rem;
  height: 0.8rem;
  border: 1px solid var(--line);
  background: var(--sky);
}

.seam-signal i:last-child {
  border-radius: 50%;
  background: var(--lilac);
}

main {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  min-height: 0;
  padding: clamp(3.5rem, 11svh, 8rem) clamp(1.25rem, 5vw, 2.25rem) clamp(12rem, 34svh, 19rem);
  border-bottom: 1px solid var(--soft);
}

h1 {
  position: relative;
  z-index: 3;
  max-width: 10ch;
  margin: 0;
  font-size: clamp(3.6rem, 15vw, 8.75rem);
  font-weight: 760;
  line-height: 0.86;
  letter-spacing: -0.075em;
  text-wrap: balance;
}

.not-found-page main {
  align-items: stretch;
  padding-bottom: clamp(3.5rem, 11svh, 8rem);
}

.not-found-copy {
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 100%;
  min-height: 100%;
}

.not-found-code {
  margin: 0;
  color: var(--lilac);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(4.75rem, 27vw, 9rem);
  font-weight: 750;
  line-height: 0.75;
  letter-spacing: -0.1em;
}

.not-found-page h1 {
  align-self: center;
  max-width: 8ch;
}

.not-found-link {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  width: fit-content;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--sky);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(0.75rem, 2.8vw, 0.9rem);
  font-weight: 700;
  text-decoration: none;
}

.not-found-link:hover {
  color: var(--ink);
  background: var(--lilac);
}

.coastline {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 5.75rem;
  left: 0;
  height: clamp(17rem, 48svh, 31rem);
  overflow: hidden;
  pointer-events: none;
}

.coastline img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}

footer {
  align-items: flex-end;
  min-height: 5.75rem;
  color: var(--enamel);
}

footer a {
  text-decoration-color: var(--soft);
}

footer a:hover {
  color: var(--sky);
  text-decoration-color: currentColor;
}

footer a:focus-visible {
  outline-color: var(--sky);
}

.edge-mark {
  position: absolute;
  z-index: 5;
  width: 1.1rem;
  height: 1.1rem;
  pointer-events: none;
}

.edge-mark-nw {
  top: 0.85rem;
  left: 0.85rem;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.edge-mark-ne {
  top: 0.85rem;
  right: 0.85rem;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.edge-mark-sw {
  bottom: 0.85rem;
  left: 0.85rem;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.edge-mark-se {
  right: 0.85rem;
  bottom: 0.85rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

@media (min-width: 48rem) {
  .site-shell {
    width: min(100% - 3rem, 96rem);
    margin-inline: auto;
    border-right: 1px solid var(--soft);
    border-left: 1px solid var(--soft);
  }

  .house-seam,
  footer {
    min-height: 5.75rem;
    padding-inline: clamp(2rem, 4vw, 4rem);
  }

  main {
    padding: clamp(4rem, 12svh, 8rem) clamp(2rem, 4vw, 4rem) clamp(14rem, 35svh, 22rem);
  }

  .not-found-page main {
    padding-bottom: clamp(4rem, 12svh, 8rem);
  }

  h1 {
    max-width: 11ch;
  }

  .coastline {
    bottom: 6.5rem;
    height: clamp(20rem, 52svh, 36rem);
  }

  footer {
    min-height: 6.5rem;
  }
}

@media (min-width: 76rem) {
  h1 {
    font-size: clamp(7.5rem, 10vw, 9.75rem);
  }
}
