@font-face {
  font-family: "Commit Mono";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/CommitMono-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Commit Mono";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/CommitMono-Medium.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/Inter-Medium.woff2") format("woff2");
}

:root {
  --paper: #f4f0e8;
  --ink: #1e1b17;
  --text: #2b2722;
  --muted: #7a7366;
  --faint: #948c7e;
  --line: #e2dccf;
  --blue: #3e86c6;
  --ridge-sun: #b7af9f;
  --ridge-1: #cec6b5;
  --ridge-2: #aba494;
  --shadow: rgb(30 27 23 / 0.1);
  --mono: "Commit Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Inter", system-ui, sans-serif;
  color-scheme: light;
}

/* The dark theme, from the brand file's dark frame with the ground lifted a
   touch. It follows the system unless the reader has picked a theme with the
   toggle, which sets data-theme on the root. The ridge colors keep the same
   steps away from the ground as in the light theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1c1a17;
    --ink: #eee8dc;
    --text: #e4ddd0;
    --muted: #8f887c;
    --faint: #6f695f;
    --line: #2f2c28;
    --blue: #7fb0d2;
    --ridge-sun: #59554e;
    --ridge-1: #423f39;
    --ridge-2: #656159;
    --shadow: rgb(0 0 0 / 0.35);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #1c1a17;
  --ink: #eee8dc;
  --text: #e4ddd0;
  --muted: #8f887c;
  --faint: #6f695f;
  --line: #2f2c28;
  --blue: #7fb0d2;
  --ridge-sun: #59554e;
  --ridge-1: #423f39;
  --ridge-2: #656159;
  --shadow: rgb(0 0 0 / 0.35);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Safari on a wide iPhone screen enlarges small text on its own, which
     blows the glyph art up past the edges of the screen. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.75;
}

a {
  color: var(--blue);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

a:hover {
  color: color-mix(in srgb, var(--blue) 75%, var(--ink));
}

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

hr {
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--line);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The page. The ridge sits behind everything, along the bottom, and the
   bottom padding leaves room for it to rise behind the footer. */
.page {
  position: relative;
  min-height: 100svh;
  padding-bottom: 140px;
  overflow: hidden;
}

.content {
  position: relative;
  z-index: 1;
  padding: 0 16px;
}

.masthead {
  padding-top: 88px;
  text-align: center;
}

/* The wordmark is P22 Mackinac Pro outlined to an SVG, with the blue cursor,
   from the brand file. It's centered optically, on the letters alone: they
   run from 3 to 735 of the drawing's 809 units, so their middle is at 369,
   and the left padding (809 - 2 × 369 = 71 units) puts that on the page's
   center line as if the cursor weren't there. */
.wordmark {
  --wordmark-width: 152px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 40px;
  margin: 0;
  padding-left: calc(var(--wordmark-width) * 71 / 809);
}

.wordmark a {
  display: block;
  border-radius: 4px;
}

.wordmark svg {
  display: block;
  width: var(--wordmark-width);
  height: auto;
}

.wordmark-ink {
  fill: var(--ink);
}

.wordmark-cursor {
  fill: var(--blue);
}

/* The theme toggle, quiet in the top right: a moon in the light theme and a
   sun in the dark one. */
.theme-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background-color: transparent;
  color: var(--faint);
  cursor: pointer;
  transition:
    background-color 0.25s ease-out,
    color 0.25s ease-out;
}

/* On hover a soft, neutral square fades in behind the icon: the ink at a
   whisper, so it suits both themes. */
.theme-toggle:hover {
  background-color: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--muted);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.theme-icon {
  width: 22px;
  height: 22px;
}

.theme-icon.sun {
  display: none;
}

:root[data-theme="dark"] .theme-icon.sun {
  display: block;
}

:root[data-theme="dark"] .theme-icon.moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon.sun {
    display: block;
  }

  :root:not([data-theme="light"]) .theme-icon.moon {
    display: none;
  }
}

.intro {
  max-width: 600px;
  margin: 0 auto;
  padding: 56px 0 144px;
  text-align: center;
}

.intro-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.85;
}

/* While the intro scrambles, a character stays faint until it lands. */
.scramble-char {
  color: var(--faint);
  transition: color 0.3s ease-out;
}

.scramble-char.is-set {
  color: inherit;
}

.column {
  max-width: 480px;
  margin: 0 auto;
}

.sections {
  display: grid;
  gap: 48px;
  padding-bottom: 128px;
}

/* Each eyebrow sits on its own rule, the same line as the footer's. */
.label {
  margin: 0 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--faint);
}

.body {
  margin: 0;
  line-height: 1.85;
}

/* A product: its icon beside its name and a muted description, set close
   together, with Phosphor's bold arrow-up-right (MIT) just after the name.
   The whole row is one link, but it doesn't look like one: the name is plain
   text, and the arrow is a quiet tint of the faint gray that darkens to it on
   hover. */
.product,
.product:hover {
  color: inherit;
}

.product {
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 400;
  text-decoration: none;
}

.product-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  line-height: 1.5;
}

.product-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.product-name {
  font-weight: 500;
}

.product-description {
  color: var(--muted);
}

.product-arrow {
  flex: none;
  width: 16px;
  height: 16px;
  color: color-mix(in srgb, var(--faint) 60%, var(--paper));
  transition: color 0.2s ease-out;
}

.product:hover .product-arrow {
  color: var(--faint);
}

/* drop-shadow follows the icon's rounded corners: a tight layer where it meets
   the page and a wide, faint one that lifts it. */
.product-icon {
  flex: none;
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 1px 1px var(--shadow)) drop-shadow(0 6px 14px var(--shadow));
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

/* The name in the footer is set like the eyebrows. */
.footer-name {
  font-family: var(--sans);
  font-weight: 500;
  color: var(--faint);
}

/* The ridge from the brand file: four layers of mono characters, ghosted and
   faded in from the top, centered so a narrow screen shows its middle. */
.ridge {
  position: absolute;
  inset: auto 0 0 0;
  height: 520px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.7;
  /* Two masks, intersected: the fade in from the top, and a sideways one that
     is solid where it rests and only shows its feathered edge while the ridge
     wipes in. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 45%), linear-gradient(90deg, #000 34%, transparent 67%);
  -webkit-mask-size: 100% 100%, 300% 100%;
  -webkit-mask-position: 0 0, 0 0;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0, #000 45%), linear-gradient(90deg, #000 34%, transparent 67%);
  mask-size: 100% 100%, 300% 100%;
  mask-position: 0 0, 0 0;
  mask-repeat: no-repeat;
  mask-composite: intersect;
}

.ridge pre {
  position: absolute;
  top: 0;
  /* The art is centered, so a narrow screen shows its middle. main.js puts a
     mirrored copy, 180 columns wide, on each side of it for wide screens, so
     the pre starts that much further left. */
  left: calc(50% - 750px - 180ch);
  margin: 0;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 16px;
  white-space: pre;
  opacity: 0.5;
}

.ridge [data-layer="sun"] {
  color: var(--ridge-sun);
}

.ridge [data-layer="ridge1"] {
  color: var(--ridge-1);
}

.ridge [data-layer="ridge2"] {
  color: var(--ridge-2);
}

.ridge [data-layer="ridge3"] {
  color: var(--muted);
  font-weight: 500;
}

/* The 404 page: the logo at the top as usual, the message in the middle of the
   screen, and a big 404 drawn in glyphs like the ridge, ghosted behind the
   message in the middle of the page. The 404 is P22 Mackinac Medium sampled
   onto a grid of character cells, and it scrambles in like the intro. The message's bottom padding matches the masthead's height,
   so it centers on the screen rather than on the space under the logo. */
.page-404 {
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.page-404 .content {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.page-404 .intro {
  display: grid;
  flex: 1;
  place-items: center;
  max-width: none;
  padding: 0 0 128px;
}

/* The three layers of the 404 share one grid cell in the middle of the page,
   so their characters line up: the dotted field, the lighter glyphs, then the
   digits themselves. The art is 105 columns of Commit Mono, 0.6em each, so its
   type shrinks with a narrow screen to keep all 63em of it on the page. */
.big-404 {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0.26;
  pointer-events: none;
}

.big-404 pre {
  grid-area: 1 / 1;
  margin: 0;
  font-family: var(--mono);
  font-size: min(14px, (100vw - 32px) / 63);
  line-height: 1;
  white-space: pre;
}

.big-404-field {
  color: var(--ridge-1);
}

.big-404-mid {
  color: var(--ridge-2);
}

.big-404-ink {
  color: var(--faint);
  font-weight: 500;
}

/* The page's entrance, in three blocks a beat apart: the logo and the intro
   fade in where they are, and everything below fades in rising 4px. Then the
   ridge fades in and wipes across from the left. */
@media (prefers-reduced-motion: no-preference) {
  .masthead,
  .intro,
  .column {
    animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) var(--rise-delay) both;
  }

  .masthead {
    --rise: 0px;
    --rise-delay: 0s;
  }

  .intro {
    --rise: 0px;
    --rise-delay: 0.12s;
  }

  .column {
    --rise: 4px;
    --rise-delay: 0.24s;
  }

  .ridge {
    animation: ridge-in 1.8s cubic-bezier(0.33, 1, 0.68, 1) 0.3s both;
  }

  .theme-toggle {
    animation: fade-in 0.9s ease-out 0.3s both;
  }
}

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(var(--rise));
  }
}

@keyframes ridge-in {
  from {
    opacity: 0;
    -webkit-mask-position: 0 0, 100% 0;
    mask-position: 0 0, 100% 0;
  }
}

@media (max-width: 640px) {
  .masthead {
    padding-top: 40px;
  }

  .wordmark {
    --wordmark-width: 132px;
    height: 35px;
  }

  .intro {
    padding: 44px 0 80px;
  }

  .intro-text {
    font-size: 15px;
    line-height: 1.75;
  }

  .body {
    line-height: 1.75;
  }

  .sections {
    gap: 36px;
    padding-bottom: 96px;
  }

  body {
    font-size: 14px;
  }

  .page-404 .intro {
    padding-bottom: 75px;
  }
}
