@font-face {
  font-family: 'Instrument Serif';
  src: url('../fonts/instrument-serif.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Manrope';
  src: url('../fonts/manrope.woff2') format('woff2');
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --vermillion: #f84525;
  --ink: #f2f1ec;
  --slate: #9ba2a9;
  --paper: #121417;
  --concrete: #0b0c0e;
  --card: #1b1e23;
  --line: rgb(242 241 236 / 0.12);
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

::selection {
  background: var(--vermillion);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--vermillion);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
}

.brand img {
  width: 1.75rem;
  height: 1.75rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: 0.005em;
}

.wordmark .i {
  position: relative;
}

.wordmark .i::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0.12em;
  width: 0.15em;
  height: 0.15em;
  border-radius: 50%;
  background: var(--vermillion);
  transform: translateX(-50%);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--gutter);
}

.bar-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.link {
  text-decoration: none;
}

.link:hover,
.link[aria-current='page'] {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.btn {
  display: inline-flex;
  align-items: center;
  height: 2.25rem;
  padding: 0 1rem;
  border-radius: 0.375rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    background-color 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.btn:active {
  transform: scale(0.97);
}

.btn:hover {
  background: #fff;
}

.btn-big {
  height: 2.75rem;
  padding: 0 1.25rem;
  font-size: 0.9375rem;
}

.btn-quiet {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgb(242 241 236 / 0.3);
}

.btn-quiet:hover {
  background: rgb(242 241 236 / 0.08);
}

.home {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  background: var(--concrete);
  overflow: clip;
}

.field {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 55% 80% at 65% 42%, #000 15%, transparent 100%);
}

.field-lines,
.field-pulse {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.field-lines {
  stroke: rgb(242 241 236 / 0.22);
  stroke-width: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw 2.6s 0.15s cubic-bezier(0.45, 0, 0.2, 1) both;
}

.field-flow {
  animation: flow 5s linear infinite;
}

.field-pulse {
  stroke: var(--vermillion);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 6px rgb(248 69 37 / 0.7));
  opacity: 0;
  animation: pulse 11s 2.2s cubic-bezier(0.35, 0, 0.65, 1) infinite;
}

.home .brand {
  animation: fade 0.9s 0.2s both;
}

.home .wordmark .i::after {
  animation: dot 0.6s 0.9s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

.home .wordmark .i + .i::after {
  animation-delay: 1.05s;
}

.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

.line > span {
  display: block;
  animation: up 1.1s 0.35s var(--ease) both;
}

.line + .line > span {
  animation-delay: 0.48s;
}

.home-copy p {
  animation: rise 0.9s 0.75s var(--ease) both;
}

.home-copy .actions {
  animation: rise 0.9s 0.9s var(--ease) both;
}

.home-foot {
  animation: fade 1s 1.1s both;
}

@keyframes draw {
  from {
    stroke-dashoffset: 1;
  }
}

@keyframes flow {
  to {
    transform: translateY(40px);
  }
}

@keyframes pulse {
  0% {
    opacity: 0;
    transform: translateY(-200px);
  }

  6%,
  50% {
    opacity: 1;
  }

  70%,
  100% {
    opacity: 0;
    transform: translateY(2000px);
  }
}

@keyframes dot {
  from {
    opacity: 0;
    transform: translate(-50%, -0.6em) scale(0);
  }
}

@keyframes up {
  from {
    transform: translateY(105%);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.home-copy {
  align-self: end;
  max-width: 44rem;
  padding: 2rem var(--gutter) clamp(2rem, 6vh, 4.5rem);
}

.home-copy h1 {
  font-size: clamp(2.75rem, 6.2vw, 5.75rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.home-copy p {
  max-width: 27rem;
  margin-top: 1.5rem;
  font-size: 1.0625rem;
  color: var(--slate);
}

.home-copy .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 2rem;
}

.home-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 0 var(--gutter) 1.25rem;
  font-size: 0.8125rem;
  color: var(--slate);
}

.home-foot nav {
  display: flex;
  gap: 1.5rem;
}

.home-foot a {
  text-decoration: none;
}

.home-foot a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.page .bar {
  border-bottom: 1px solid var(--line);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

.doc {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 5.5rem) var(--gutter) 5rem;
}

.doc h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.doc .updated {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--slate);
}

.toc {
  margin: 2.5rem 0 0;
  padding: 1rem 0;
  border-block: 1px solid var(--line);
  columns: 2;
  column-gap: 2rem;
  list-style: none;
  font-size: 0.9rem;
}

.toc li {
  padding-block: 0.15rem;
}

.toc a {
  color: var(--slate);
  text-decoration: none;
}

.toc a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.prose {
  margin-top: 2.5rem;
  color: #c4c8cc;
}

.prose h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  scroll-margin-top: 1.5rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin: 1.5rem 0 0.4rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.prose p,
.prose ul {
  margin: 0 0 1rem;
}

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

.prose li {
  margin-bottom: 0.35rem;
}

.prose a {
  text-underline-offset: 0.2em;
}

.optin {
  margin: 1.25rem 0 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--card);
}

.optin label {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink);
}

.optin input {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.15rem 0 0;
}

.optin figcaption {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--slate);
}

.prose .samples {
  padding: 0;
  list-style: none;
}

.samples li {
  max-width: 30rem;
  margin-bottom: 0.6rem;
  padding: 0.7rem 0.95rem;
  border-radius: 1rem 1rem 1rem 0.25rem;
  background: var(--card);
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink);
}

.page-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 1.25rem var(--gutter);
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--slate);
}

.page-foot nav {
  display: flex;
  gap: 1.5rem;
}

.page-foot a {
  text-decoration: none;
}

.page-foot a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.lost {
  max-width: 42rem;
  padding: clamp(4rem, 14vh, 9rem) var(--gutter);
}

.lost h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}

.lost p {
  margin-top: 1rem;
  color: var(--slate);
}

.lost .actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
}

@media (max-width: 40rem) {
  .field {
    left: calc(50vw - 65svh);
    width: 100svh;
    height: 100svh;
    mask-image: radial-gradient(ellipse 50% 45% at 65% 30%, #000 15%, transparent 100%);
  }

  .toc {
    columns: 1;
  }

  .page .bar-links .link {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .field-pulse {
    display: none;
  }
}
