:root {
  color-scheme: light dark;
  --background: #fdfcf8;
  --foreground: #222638;
  --focus: #41627c;
  --water-texture: url("/assets/water-day.webp");
  background: var(--background);
  color: var(--foreground);
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
}

main {
  display: grid;
  place-items: center;
  padding: 48px 24px;
}

.identity {
  width: clamp(260px, 32vw, 400px);
  max-width: 100%;
  text-align: center;
}

picture,
img {
  display: block;
  width: 100%;
}

img {
  height: auto;
}

.carrier {
  position: relative;
}

.water {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .water {
    display: block;
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    /* Keep the hull and the water's outer edge stationary. */
    mask: url("/assets/water-mask.webp") center / 100% 100% no-repeat;
  }

  .water::before {
    content: "";
    position: absolute;
    inset: -50%;
    background: var(--water-texture) 0 0 / 320px 60px repeat;
    transform: rotate(22deg);
    animation: water-drift 48s linear infinite;
  }
}

@keyframes water-drift {
  to {
    background-position: -320px 0;
  }
}

h1 {
  margin: 18px 0 0;
  font-size: 20px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  font-weight: 400;
}

footer {
  padding: 12px 24px max(32px, env(safe-area-inset-bottom));
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
}

a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: inherit;
  font-size: 11px;
  line-height: 1.5;
  text-decoration: none;
  text-underline-offset: 5px;
}

a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 5px;
  border-radius: 2px;
}

@media (hover: hover) {
  a:hover {
    text-decoration: underline;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #07152b;
    --foreground: #f6f2e8;
    --focus: #b7cfe4;
    --water-texture: url("/assets/water-night.webp");
  }
}
