/* The site's own look, on modest-ui's defaults: black and white, one quiet accent
   (green, for "secure"), a faint grid behind the opening, and code that looks like
   an editor. No images to load and no JavaScript: it's all CSS and inline SVG. */

:root {
  --mdst-font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mdst-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --accent: #1f7a5a;
  --accent-soft: #e8f3ee;
  --ink: #151515;
  --line: #e4e4e1;
  --muted: #5f5f5a;
  --code-bg: #141614;
  --code-fg: #e6e6e1;
}

body {
  margin: 0;
}

a {
  text-underline-offset: 0.18em;
}

.wrap {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 var(--mdst-space-5);
}

.narrow {
  max-width: 46rem;
}

/* ---------------------------------------------------------------- The bar -- */

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--mdst-space-2) var(--mdst-space-5);
  padding-block: var(--mdst-space-4);
}

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

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

.site-nav .name {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-inline-end: auto;
  font-family: var(--mdst-font-mono);
  font-weight: 700;
  color: var(--ink);
}

/* GitHub and npm, as their marks. */
.nav-icons {
  display: inline-flex;
  align-items: center;
  gap: var(--mdst-space-3);
}

.nav-icons a {
  display: inline-flex;
}

.nav-icons svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* On a phone, the name has the first line, and the links share the second. */
@media (max-width: 30rem) {
  .site-nav .name {
    flex-basis: 100%;
  }
}

.mark {
  width: 1.5rem;
  height: 1.5rem;
}

/* ------------------------------------------------------------ The opening -- */

.hero {
  position: relative;
  padding-block: var(--mdst-space-8) var(--mdst-space-6);
}

/* A faint grid of dots behind it, fading out towards the edges. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(circle, #d4d4cf 1px, transparent 1.2px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 60% 70% at 50% 30%, #000 30%, transparent 75%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--mdst-space-8);
  align-items: center;
}

@media (min-width: 60rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: var(--mdst-text-sm);
  color: var(--muted);
}

.dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.dot.amber {
  background: #c27c0e;
  box-shadow: 0 0 0 3px #fbf1df;
}

.hero h1 {
  font-size: clamp(2.4rem, 5.4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: var(--mdst-space-4) 0;
}

.hero h1 .quiet {
  color: var(--muted);
}

.lead {
  font-size: var(--mdst-text-lg);
  line-height: 1.55;
  color: var(--muted);
  max-width: 34rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mdst-space-3);
  margin-block-start: var(--mdst-space-5);
}

.actions .mdst-button {
  text-decoration: none;
}

/* The install line, under the buttons. */
.hero .install {
  margin: var(--mdst-space-4) 0 0;
}

.hero .install code {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: var(--mdst-text-sm);
}

.hero .install span {
  color: var(--muted);
}

/* ----------------------------------------------------- Code, as an editor -- */

.window {
  position: relative;
  border-radius: 12px;
  background: var(--code-bg);
  color: var(--code-fg);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 24px 48px -24px rgb(0 0 0 / 0.45);
  overflow: hidden;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  font-family: var(--mdst-font-mono);
  font-size: var(--mdst-text-xs);
  color: #9a9a94;
}

.window-bar i {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: #3a3c3a;
}

.window-bar span {
  margin-inline-start: 0.6rem;
}

.window pre {
  margin: 0;
  padding: 1.1rem 1.25rem 1.3rem;
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 0.82rem;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
}

@media (max-width: 30rem) {
  .window pre { font-size: 0.7rem; padding: 1rem 1rem 2.25rem; }
}

.window pre code {
  white-space: pre;
  background: none;
  color: inherit;
  padding: 0;
  border: 0;
}

/* Coloured by hand: keywords, strings, comments. */
.k { color: #9fd4bd; }
.s { color: #e8c98f; }
.c { color: #7d807b; font-style: italic; }
.f { color: #c7d8ff; }

/* The little card that floats over the code: what just happened. */
.status {
  position: relative;
  margin: -1.75rem 1rem 0 auto;
  width: max-content;
  max-width: calc(100% - 2rem);
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px -14px rgb(0 0 0 / 0.3);
  font-size: var(--mdst-text-sm);
}

.status p {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.status p + p {
  margin-block-start: 0.3rem;
  color: var(--muted);
  font-family: var(--mdst-font-mono);
  font-size: var(--mdst-text-xs);
}

/* ------------------------------------------------------------- Numbers -- */

.facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin: var(--mdst-space-6) 0;
  padding: 0;
  list-style: none;
  background: var(--line);
  border-block: 1px solid var(--line);
}

@media (min-width: 48rem) {
  .facts { grid-template-columns: repeat(4, 1fr); }
}

.facts li {
  margin: 0;
  padding: var(--mdst-space-5) var(--mdst-space-4);
  background: var(--mdst-color-bg, #fff);
}

.facts strong {
  display: block;
  font-family: var(--mdst-font-mono);
  font-size: 2.2rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

.facts span {
  display: block;
  margin-block-start: 0.4rem;
  color: var(--muted);
  font-size: var(--mdst-text-sm);
}

/* ---------------------------------------------------------- Sections -- */

section {
  padding-block: var(--mdst-space-8) var(--mdst-space-4);
}

.eyebrow {
  margin: 0 0 var(--mdst-space-2);
  font-family: var(--mdst-font-mono);
  font-size: var(--mdst-text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

section h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 var(--mdst-space-3);
}

.section-lead {
  color: var(--muted);
  max-width: 40rem;
}

/* The usual way, and this way: two cards side by side. */
.compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: var(--mdst-space-4);
  margin-block-start: var(--mdst-space-5);
}

.compare > div {
  padding: var(--mdst-space-5);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.compare > div:last-child {
  border-color: #b9dccb;
  background: linear-gradient(180deg, var(--accent-soft), #fff 70%);
}

.compare h3 {
  margin: 0 0 var(--mdst-space-3);
  font-size: var(--mdst-text-base);
}

.compare ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.compare li {
  display: flex;
  gap: 0.6rem;
  padding-block: 0.45rem;
  border-top: 1px solid var(--line);
}

.compare li::before {
  flex: none;
  width: 1.1rem;
  font-family: var(--mdst-font-mono);
  color: var(--muted);
  content: "×";
}

.compare > div:last-child li::before {
  color: var(--accent);
  content: "✓";
}

/* What happens on every sign-in: four steps in a row. */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--mdst-space-3);
  margin: var(--mdst-space-5) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  margin: 0;
  padding: var(--mdst-space-4);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  counter-increment: step;
}

.steps li::before {
  display: block;
  margin-block-end: var(--mdst-space-2);
  font-family: var(--mdst-font-mono);
  font-size: var(--mdst-text-xs);
  color: var(--accent);
  content: "0" counter(step);
}

.steps strong {
  display: block;
  margin-block-end: 0.3rem;
}

.steps span {
  color: var(--muted);
  font-size: var(--mdst-text-sm);
}

/* Features: small cards, each with a line icon. */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: var(--mdst-space-3);
  margin-block-start: var(--mdst-space-5);
}

.features > div {
  padding: var(--mdst-space-5);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.features svg {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--accent);
}

.features h3 {
  margin: var(--mdst-space-3) 0 0.35rem;
  font-size: var(--mdst-text-base);
}

.features p {
  margin: 0;
  color: var(--muted);
  font-size: var(--mdst-text-sm);
}

/* The proof: real output from the checks. */
.terminal {
  margin-block-start: var(--mdst-space-5);
}

.terminal .ok {
  color: #9fd4bd;
}

/* Where it runs. */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mdst-space-2);
  margin: var(--mdst-space-4) 0 0;
  padding: 0;
  list-style: none;
}

.pills li {
  margin: 0;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mdst-font-mono);
  font-size: var(--mdst-text-sm);
}

/* The close: one line, two buttons. */
.closing {
  margin-block: var(--mdst-space-8) 0;
  padding: var(--mdst-space-8) var(--mdst-space-5);
  border-radius: 16px;
  background: var(--code-bg);
  color: var(--code-fg);
  text-align: center;
}

.closing h2 {
  color: #fff;
}

.closing p {
  color: #b8b8b2;
}

.closing .install code {
  display: inline-block;
  margin-block: var(--mdst-space-2);
  padding: 0.5rem 1rem;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 8px;
  background: rgb(255 255 255 / 0.06);
  color: var(--code-fg);
  font-size: var(--mdst-text-sm);
}

.closing .install span {
  color: #7d807b;
}

.closing .actions {
  justify-content: center;
}

.closing .mdst-button {
  --mdst-button-bg: #fff;
  --mdst-button-fg: #151515;
  --mdst-button-border: #fff;
}

.closing .mdst-button--borderless {
  --mdst-button-bg: transparent;
  --mdst-button-fg: #e6e6e1;
}

/* ------------------------------------------------------- Inner pages -- */

/* The head: the same faint grid as the opening. */
.page-head {
  position: relative;
  padding-block: var(--mdst-space-8) var(--mdst-space-6);
  border-block-end: 1px solid var(--line);
}

.page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(circle, #d4d4cf 1px, transparent 1.2px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 50% 90% at 30% 40%, #000 20%, transparent 75%);
}

.page-head h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 var(--mdst-space-3);
}

.page-head .lead {
  margin: 0;
}

/* The unaudited note: amber, quiet. */
.note {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  max-width: 44rem;
  margin: var(--mdst-space-5) 0 0;
  padding: var(--mdst-space-3) var(--mdst-space-4);
  border: 1px solid #ecd7b0;
  border-radius: 10px;
  background: #fdf8ee;
  font-size: var(--mdst-text-sm);
}

.note .dot {
  flex: none;
  transform: translateY(-0.1em);
}

/* Contents beside the article on wide screens; above it on narrow ones. */
.doc {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--mdst-space-6);
  padding-block-start: var(--mdst-space-6);
}

@media (min-width: 60rem) {
  .doc {
    grid-template-columns: 13rem minmax(0, 46rem);
    gap: var(--mdst-space-8) 4rem;
  }

  .toc {
    position: sticky;
    top: var(--mdst-space-6);
    align-self: start;
  }
}

.toc p {
  margin: 0 0 var(--mdst-space-2);
  font-family: var(--mdst-font-mono);
  font-size: var(--mdst-text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  font-size: var(--mdst-text-sm);
}

@media (max-width: 59.99rem) {
  .toc {
    padding: var(--mdst-space-4);
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  .toc ol {
    columns: 2 11rem;
  }
}

.toc li {
  display: flex;
  margin: 0;
  padding-block: 0.3rem;
  break-inside: avoid;
  counter-increment: toc;
}

.toc li::before {
  flex: none;
  width: 1.75rem;
  padding-block-start: 0.15em;
  font-family: var(--mdst-font-mono);
  font-size: var(--mdst-text-xs);
  color: var(--muted);
  content: counter(toc, decimal-leading-zero);
}

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

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

.article section {
  padding-block: 0 var(--mdst-space-8);
}

.article section + section {
  padding-block-start: var(--mdst-space-6);
  border-block-start: 1px solid var(--line);
}

.article section h2 {
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  scroll-margin-top: var(--mdst-space-6);
}

.article p,
.article li {
  line-height: 1.65;
}

.article .window,
.article .table-card,
.article .cards,
.article .steps {
  margin-block: var(--mdst-space-4);
}

.article .closing {
  margin-block: var(--mdst-space-6) 0;
  padding: var(--mdst-space-8) var(--mdst-space-6);
  border: 0;
}

.article .closing p {
  max-width: 34rem;
  margin-inline: auto;
}

.article .closing strong {
  color: #fff;
}

/* Inline code: a light chip. */
.article :not(pre) > code {
  padding: 0.1em 0.35em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f7f7f5;
  font-size: 0.86em;
}

/* In tables, code is already set apart by its column: no chip. */
.article .table-card code {
  white-space: nowrap;
  padding: 0;
  border: 0;
  background: none;
}

.article .window {
  box-shadow: none;
}

/* Tables, as cards. */
.table-card {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.table-card table {
  width: 100%;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  font-size: var(--mdst-text-sm);
}

.table-card th,
.table-card td {
  padding: 0.65rem 1rem;
  border: 0;
  border-block-start: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
}

.table-card thead th {
  border-block-start: 0;
  background: #fafaf8;
  font-family: var(--mdst-font-mono);
  font-size: var(--mdst-text-xs);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Three columns need room: on a phone they scroll sideways, in their card. */
.table-card table:has(th:nth-child(3)) {
  min-width: 46rem;
}

/* Promises: one sentence each, so the bold part runs on. */
.promises strong {
  display: inline;
}

.promises span {
  font-size: inherit;
}

/* Settings: small cards. */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--mdst-space-3);
}

.cards > div {
  padding: var(--mdst-space-4);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.cards h3 {
  margin: 0 0 0.35rem;
  font-size: var(--mdst-text-base);
}

.cards p {
  margin: 0;
  color: var(--muted);
  font-size: var(--mdst-text-sm);
}

/* Lists of things done (✓) or not done yet (–), ruled like the comparison. */
.checks {
  margin: var(--mdst-space-4) 0 0;
  padding: 0;
  list-style: none;
}

.checks li {
  position: relative;
  margin: 0;
  padding: 0.6rem 0 0.6rem 1.75rem;
  border-block-start: 1px solid var(--line);
}

.checks li::before {
  position: absolute;
  inset-inline-start: 0.1rem;
  font-family: var(--mdst-font-mono);
  color: var(--accent);
  content: "✓";
}

.checks.not li::before {
  color: #c27c0e;
  content: "–";
}

.article blockquote {
  margin: var(--mdst-space-4) 0;
  padding: var(--mdst-space-4) var(--mdst-space-5);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafaf8;
  color: var(--muted);
  font-size: var(--mdst-text-sm);
}

.article blockquote p {
  margin: 0;
  font-style: normal;
}

/* --------------------------------------------------------------- Foot -- */

footer {
  margin-block-start: var(--mdst-space-8);
  padding-block: var(--mdst-space-5) var(--mdst-space-8);
  border-block-start: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--mdst-text-sm);
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--mdst-space-3);
}

footer a {
  color: inherit;
}
