:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --text: #16181d;
  --text-muted: #5c6470;
  --border: #e3e6ea;
  --accent: #1f6feb;
  --max-width: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --bg-alt: #161920;
    --text: #e8eaed;
    --text-muted: #9aa3af;
    --border: #262b34;
    --accent: #6ea8ff;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  /* Column layout keeps the footer at the bottom on short pages. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  /* dvh accounts for mobile browser chrome; ignored where unsupported. */
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.notice {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.notice[hidden] {
  display: none;
}

.notice .wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  text-align: center;
}

.notice p {
  margin: 0;
}

.notice button {
  flex: none;
  background: none;
  border: 0;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  cursor: pointer;
  border-radius: 0.35rem;
}

.notice button:hover {
  background: var(--border);
  color: var(--text);
}

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  display: block;
  height: 22px;
  width: auto;
}

.site-header nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9rem;
}

.site-header nav a {
  color: var(--text-muted);
}

main {
  flex: 1 0 auto;
}

/* Home page: centre the hero in whatever space is left over. */
.home {
  display: flex;
  align-items: center;
}

.home > .wrap {
  width: 100%;
}

.hero {
  position: relative;
  /* Artifacts drift across this box and must not create scrollbars. */
  overflow: hidden;
  padding: 4rem 0;
}

.hero h1 {
  margin: 0;
  /* Above the particles. */
  position: relative;
  z-index: 1;
  text-align: center;
  /* Monospace so a swapped character can't shift the layout. */
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: clamp(1.6rem, 8.5vw, 4.25rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.hero h1 .glitching {
  color: #f4392b;
}

.hero h1.fringe {
  text-shadow: 0.025em 0 rgba(244, 57, 43, 0.75),
    -0.025em 0 rgba(0, 190, 255, 0.55);
}

.particle {
  position: absolute;
  z-index: 0;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  color: var(--text-muted);
  opacity: 0;
  pointer-events: none;
  user-select: none;
  animation-name: fade-drift;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
}

@keyframes fade-drift {
  0% {
    transform: translate(0, 0);
    opacity: 0;
  }
  30% {
    opacity: 0.22;
  }
  60% {
    opacity: 0.22;
  }
  100% {
    transform: translate(var(--dx), var(--dy));
    opacity: 0;
  }
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
  padding: 1.75rem 0 2.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  gap: 1.25rem;
}

.legal h1 {
  font-size: 1.9rem;
  letter-spacing: -0.02em;
  margin: 3rem 0 0.4rem;
}

.legal .updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 2rem;
}

.legal h2 {
  font-size: 1.15rem;
  margin: 2.25rem 0 0.5rem;
}

.legal p,
.legal li {
  color: var(--text);
}

.legal ul {
  padding-left: 1.25rem;
}
