/*
 * Skeleton for the product micro-sites under /projects/<app>/.
 *
 * Each product page paints itself in its app's own colours on top of this file:
 * it overrides the tokens below on `body.<xx>-page` and adds page-scoped styles.
 * The rest of the site uses /content.css. This file is frozen on purpose: the
 * product pages were drawn against these exact rules, so changing one here can
 * move every app page at once. Only the shared header is meant to change.
 */
:root {
  color-scheme: light;
  --paper: #f7f7f3;
  --ink: #151515;
  --muted: #4b4b46;
  --line: #b8b8af;
  --focus: #0047cc;
  --sans: Arial, Helvetica, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --measure: 68rem;
  --content-measure: 52rem;
}

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

html {
  min-width: 20rem;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(#c4c4bc 0.75px, transparent 0.75px);
  background-attachment: fixed;
  background-size: 12px 12px;
  color: var(--ink);
  font: 1rem/1.65 var(--sans);
}

body::before {
  display: none;
  position: fixed;
  z-index: 0;
  inset: 0;
  background-image: radial-gradient(
    circle,
    rgba(110, 110, 104, 0.5) 0 1px,
    transparent 1.15px
  );
  background-size: 12px 12px;
  content: "";
  pointer-events: none;
  -webkit-mask-image: linear-gradient(
    110deg,
    transparent 35%,
    rgba(0, 0, 0, 0.35) 44%,
    #000 50%,
    rgba(0, 0, 0, 0.35) 56%,
    transparent 65%
  );
  mask-image: linear-gradient(
    110deg,
    transparent 35%,
    rgba(0, 0, 0, 0.35) 44%,
    #000 50%,
    rgba(0, 0, 0, 0.35) 56%,
    transparent 65%
  );
  -webkit-mask-position: 100% 50%;
  mask-position: 100% 50%;
  -webkit-mask-size: 300% 100%;
  mask-size: 300% 100%;
  animation: dot-wave 14s linear infinite;
}

@supports ((-webkit-mask-image: linear-gradient(#000, transparent)) or (mask-image: linear-gradient(#000, transparent))) {
  body::before {
    display: block;
  }
}

@keyframes dot-wave {
  0%,
  10% {
    -webkit-mask-position: 100% 50%;
    mask-position: 100% 50%;
  }

  90%,
  100% {
    -webkit-mask-position: 0 50%;
    mask-position: 0 50%;
  }
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.15em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.page {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 2rem), var(--measure));
  margin-inline: auto;
  padding-bottom: 5rem;
}

main {
  width: min(100%, var(--content-measure));
  margin-inline: auto;
}

/* The house header, identical on every page of the site. The wordmark is the
   /wordmark.svg sprite (Literata outlines), so no page loads a font for it; its
   letters take currentColor, which each product page sets to the flame. */
header {
  display: flex;
  min-height: clamp(3.5rem, 10svh, 5.5rem);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  line-height: 1.6;
}

.wordmark {
  display: block;
  padding: 0.5rem 0;
  color: var(--ink);
  text-decoration: none;
}

.wordmark svg {
  display: block;
  width: auto;
  height: 1.375rem;
  fill: currentColor;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(0.25rem, 2vw, 1rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 0.55rem 0.5rem;
  color: var(--muted);
  font: 500 0.9375rem/1 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

/* Specific enough to survive each page's own `.xx-page .site-nav a` colours. */
header .site-nav li a.hire {
  margin-left: 0.25rem;
  padding-inline: 0.95rem;
  border-radius: 999px;
  background: #F4B860;
  color: #23222E;
  font-weight: 600;
}

header .site-nav li a.hire:hover {
  background: #F1EBE3;
  color: #23222E;
}

.intro {
  padding: clamp(3rem, 10vh, 7rem) 0 clamp(2.5rem, 7vh, 5rem);
}

.eyebrow,
time,
.when {
  color: var(--muted);
  font: 600 0.72rem/1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1 {
  margin: 0.4rem 0 1rem;
  font-size: clamp(3.25rem, 10vw, 6.5rem);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.07em;
}

.lede {
  max-width: 40rem;
  margin: 0;
  color: #30302d;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.entries {
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--ink);
  list-style: none;
}

.entry {
  display: grid;
  grid-template-columns: minmax(8rem, 0.28fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 5vw, 3.5rem);
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.entry h2,
.entry h3,
.article h2 {
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.entry h2,
.entry h3,
.article h2 {
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.entry p,
.article p,
.article ul {
  margin: 0.5rem 0 0;
}

.articles {
  border-top: 2px solid var(--ink);
}

.article {
  max-width: 43rem;
  padding: 2.25rem 0 3rem;
  border-bottom: 1px solid var(--line);
}

.article h2 {
  margin-top: 0.35rem;
}

.article h3 {
  margin: 1.75rem 0 0;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid #77776f;
  background: #fff;
  font: 0.82rem/1.55 var(--mono);
}

code {
  font-family: var(--mono);
}

.prose {
  max-width: 43rem;
  padding-left: clamp(1rem, 2.5vw, 1.5rem);
  border-left: 2px solid var(--ink);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
}

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

.prose p:last-child {
  margin-bottom: 0;
}

.experience,
.subsection {
  margin-top: clamp(4rem, 10vh, 7rem);
}

.experience-heading,
.subsection > h2 {
  margin: 0 0 1.5rem;
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.055em;
}

.experience .lede,
.subsection .lede {
  margin-bottom: 1.5rem;
}

.entry-links,
.entry .entry-links {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font: 600 0.72rem/1.4 var(--mono);
  letter-spacing: 0.06em;
}

.entry-links a {
  color: var(--ink);
}

.doc-intro {
  padding-bottom: clamp(1.5rem, 4vh, 2.5rem);
}

.doc-intro h1 {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
}

.doc {
  max-width: 43rem;
  padding-top: 2rem;
  border-top: 2px solid var(--ink);
}

.doc > :first-child {
  margin-top: 0;
}

.doc h2 {
  margin: 2.75rem 0 0;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.doc h3 {
  margin: 2rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

.doc p,
.doc ul {
  margin: 0.75rem 0 0;
}

.doc ul {
  padding-left: 1.15rem;
}

.doc li {
  margin-top: 0.3rem;
}

@media (max-width: 38rem) {
  .entry {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }

  body::before {
    content: none;
  }
}

@media (prefers-contrast: more), (forced-colors: active) {
  body {
    background-image: none;
  }

  body::before {
    content: none;
  }
}

@media print {
  body::before {
    content: none;
  }
}
