/* The project page. One column of text, system fonts, light and dark from the reader's setting. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-soft: #f5f6f8;
  --text: #1b1f24;
  --muted: #55606c;
  --line: #d5dae1;
  --accent: #0b5cad;
  --on-accent: #ffffff;
  --code-bg: #f1f3f5;
  --measure: 46rem;
  --page: 66rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --bg-soft: #161a20;
    --text: #e6e9ee;
    --muted: #a0a9b4;
    --line: #2c333d;
    --accent: #74b4f6;
    --on-accent: #0b1118;
    --code-bg: #1a1f26;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding-inline: 1.25rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.skip {
  position: absolute;
  left: -100rem;
  top: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: var(--bg);
  border: 1px solid var(--line);
}

.skip:focus {
  left: 0.5rem;
  z-index: 10;
}

/* ---- header and footer ---- */

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

.top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.brand {
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}

nav ul,
.actions,
.links {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav ul {
  gap: 0.25rem 1.25rem;
  font-size: 0.95rem;
}

.bottom {
  margin-top: 4rem;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}

/* ---- text ---- */

section {
  padding-top: 3rem;
}

h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3rem);
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
}

h3 {
  margin: 2rem 0 0.75rem;
  font-size: 1.15rem;
}

section > p,
section > ul,
section > ol,
section > h3,
section > .code,
section > .note {
  max-width: var(--measure);
}

p {
  margin: 0 0 1rem;
}

section > ul:not(.links):not(.actions),
section > ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

li {
  margin-top: 0.35rem;
}

.lede {
  margin: 0.75rem 0 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1.45;
}

.note {
  margin: 1.5rem 0 0;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-soft);
  font-size: 1rem;
}

.links {
  gap: 0.4rem 1.5rem;
}

.links li {
  margin: 0;
}

/* ---- buttons ---- */

.actions {
  gap: 0.75rem;
  margin: 1.5rem 0 2rem;
}

.actions li {
  margin: 0;
}

.button {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  border-color: var(--accent);
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

/* ---- code ---- */

code,
kbd,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 0.9em;
  font-variant-ligatures: none;
}

:not(pre) > code,
kbd {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--code-bg);
}

kbd {
  border: 1px solid var(--line);
}

.code {
  position: relative;
  margin: 0 0 1rem;
  min-width: 0;
}

pre {
  margin: 0;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--code-bg);
  line-height: 1.5;
}

.code button {
  position: absolute;
  top: -0.7rem;
  right: 0.6rem;
  padding: 0.1rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.code button:hover {
  border-color: var(--accent);
}

/* ---- the three steps ---- */

.steps {
  counter-reset: step;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

section > ol.steps {
  padding-left: 0;
}

.steps > li {
  position: relative;
  min-width: 0;
  margin: 0 0 1.25rem;
  padding-left: 2.75rem;
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.1rem;
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-weight: 650;
  line-height: 1.8rem;
  text-align: center;
}

.steps p {
  margin-bottom: 0.6rem;
}

/* ---- screenshots ---- */

figure {
  margin: 0;
}

figure a {
  display: block;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

figcaption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.hero figcaption {
  max-width: var(--measure);
}

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(26rem, 100%), 1fr));
  align-items: start;
  gap: 2rem 1.5rem;
  margin: 0 0 2rem;
}
