/* canopy.spinney.dev: the look of spinney.dev (its colours, Inter, plain
   links that turn green), in ordinary sentence case, stretched to fit a home page, a clone
   page and the documentation. The pages are built by main.go from
   templates/. */

/* Colours from clrs.cc, as on spinney.dev. Light or dark follows the
   system; there is no toggle. The muted text, rules and code background
   are black mixed into the background, since the palette's gray is too
   faint to read on white. */
:root {
  --black: #111111;
  --gray: #aaaaaa;
  --silver: #dddddd;
  --white: #ffffff;
  --olive: #3d9970;
  --green: #2ecc40;

  --bg: var(--white);
  --fg: var(--black);
  --muted: color-mix(in srgb, var(--black) 62%, var(--white));
  --rule: var(--silver);
  --code-bg: color-mix(in srgb, var(--black) 5%, var(--white));
  --brand: var(--olive);

  --text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--black);
    --fg: var(--silver);
    --muted: var(--gray);
    --rule: color-mix(in srgb, var(--silver) 16%, var(--black));
    --code-bg: color-mix(in srgb, var(--silver) 6%, var(--black));
    --brand: var(--green);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scrollbar-gutter: stable; background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0 16px;
  background: var(--bg);
  color: var(--fg);
  font: 15px / 1.7 var(--text);
}

a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { color: var(--brand); outline: none; }

/* the links, at the top of every page and under the name on the home page */

.links { display: flex; flex-wrap: wrap; gap: 0 1.5em; }
.links a { color: var(--muted); }
.links a[aria-current] { color: var(--fg); }
.links a:hover, .links a:focus-visible { color: var(--brand); }

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: 72rem;
  margin: 0 auto;
  padding: 20px 0;
}
.bar .home { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.bar img { height: 22px; }

/* the home page: the logo, the name, a line and the links, centred, from
   the top like spinney.dev, then the terminal */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 46rem;
  margin: 0 auto;
  padding-top: 14vh;
  text-align: center;
}
.hero .logo { height: 72px; margin-bottom: 24px; }
.hero h1 { margin: 0; font-size: inherit; font-weight: 500; }
.hero .pitch { max-width: 34rem; margin: 0 0 16px; color: var(--muted); }

/* The terminal stays dark in both schemes, as terminals do. */
.term {
  --t-fg: var(--silver);
  --t-dim: var(--gray);
  width: 100%;
  margin: 48px 0 0;
  background: var(--black);
  border: 1px solid color-mix(in srgb, var(--silver) 16%, var(--black));
  border-radius: 6px;
  text-align: left;
}
.term pre {
  margin: 0;
  padding: 16px 20px;
  overflow-x: auto;
  color: var(--t-fg);
  font: 13px / 1.6 var(--mono);
  scrollbar-width: thin;
  scrollbar-color: var(--muted) transparent;
}
.term .p, .term .u { color: var(--green); }
.term .ts { color: var(--t-dim); }

/* Each line shows after its delay --d; a typed command then grows one
   character at a time. */
.term .l { opacity: 0; animation: term-show 0s var(--d) forwards; }
.term .t {
  display: inline-block;
  vertical-align: bottom;
  overflow: hidden;
  width: 0;
  animation: term-type calc(var(--n) * 45ms) steps(var(--n), end) calc(var(--d) + .25s) forwards;
}
.term .cursor {
  display: inline-block;
  width: 1ch;
  height: 1.15em;
  vertical-align: text-bottom;
  background: var(--t-fg);
  animation: term-blink 1.1s steps(1) infinite;
}
@keyframes term-show { to { opacity: 1; } }
@keyframes term-type { to { width: calc(var(--n) * 1ch); } }
@keyframes term-blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .term .l { opacity: 1; animation: none; }
  .term .t { width: auto; animation: none; }
  .term .cursor { animation: none; }
}

/* text: the home page's features, the clone page and the documents */

.prose { max-width: 42rem; margin: 0 auto; padding-bottom: 32px; }
.home .prose { max-width: 46rem; padding-top: 40px; }
.clone .prose { padding-top: 24px; }

.prose h1 { margin: 0 0 8px; font-size: 26px; font-weight: 500; line-height: 1.3; letter-spacing: -.01em; }
.prose h2 { margin: 40px 0 8px; font-size: 18px; font-weight: 500; line-height: 1.4; }
.prose h3 { margin: 28px 0 4px; font-size: 15px; font-weight: 500; }
.prose h4 { margin: 20px 0 4px; font-size: 15px; font-weight: 500; color: var(--muted); }
.prose :is(h2, h3, h4) { scroll-margin-top: 24px; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 2px 0; }
.prose li > p { margin: 0 0 6px; }
.prose strong { font-weight: 500; }
/* checklists: the box stands in for the bullet */
.prose li:has(> input[type="checkbox"]) { list-style: none; margin-left: -1.4em; }
.prose li > input[type="checkbox"] { margin: 0 8px 0 0; accent-color: var(--brand); }

/* Links in running text are underlined in green, so they show without
   the colour alone. */
.prose a {
  text-decoration: underline;
  text-decoration-color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.prose a:hover, .prose a:focus-visible { color: var(--brand); }

.lead { color: var(--muted); font-size: 17px; }
.crumbs { margin: 0 0 4px !important; color: var(--muted); font-size: 14px; }
.prose .crumbs a { text-decoration: none; }

.prose blockquote { padding: 0 0 0 16px; border-left: 2px solid var(--brand); color: var(--muted); }
.prose blockquote p:last-child { margin: 0; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 32px 0; }

code { font-family: var(--mono); font-size: .9em; }
:not(pre) > code { padding: .1em .3em; background: var(--code-bg); border-radius: 3px; overflow-wrap: anywhere; }
.prose pre {
  padding: 12px 16px;
  background: var(--code-bg);
  border-radius: 6px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.55;
}
.prose pre, .prose table { scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
.prose pre code { font-size: inherit; }

.prose table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 14px;
}
.prose th, .prose td {
  padding: 6px 12px 6px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}
.prose th { font-weight: 500; }
.prose td code { overflow-wrap: normal; }

/* the clone page's facts, and the docs welcome page's documents */

.facts, .doc-index {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 24px;
  margin: 32px 0 0;
}
.facts dt, .doc-index dt { color: var(--muted); }
.facts dd, .doc-index dd { margin: 0; }
.doc-index { margin: 0; }
.doc-index dt a { color: var(--fg); }

.edit { margin-top: 40px !important; font-size: 14px; color: var(--muted); }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}
.prose .pager a { display: flex; flex-direction: column; text-decoration: none; }
.pager span { color: var(--muted); font-size: 13px; }
.pager .next { margin-left: auto; text-align: right; }

/* the documentation: its list, the document and its headings side by
   side, folding into one column */

.docs-layout {
  display: grid;
  grid-template-columns: 10rem minmax(0, 42rem) 12rem;
  justify-content: center;
  gap: 48px;
  align-items: start;
  max-width: 72rem;
  margin: 0 auto;
  padding-top: 24px;
}
.docs-layout .prose { margin: 0; width: 100%; }

.sidebar, .on-page {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  scrollbar-width: thin;
  font-size: 14px;
}
.sidebar a, .on-page a { padding: 2px 0; color: var(--muted); }
.sidebar a[aria-current] { color: var(--fg); font-weight: 500; }
.sidebar a:hover, .on-page a:hover { color: var(--brand); }
.on-page { padding-left: 16px; border-left: 1px solid var(--rule); }

footer {
  max-width: 72rem;
  margin: 32px auto 0;
  padding: 16px 0 40px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
footer a:hover { color: var(--brand); }

@media (max-width: 1100px) {
  .docs-layout { grid-template-columns: 9rem minmax(0, 42rem); gap: 32px; }
  .on-page { display: none; }
}

@media (max-width: 720px) {
  .hero { padding-top: 8vh; }
  .term pre { font-size: 11px; padding: 12px 14px; }
  .term .ts { display: none; }
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 8px; }
  .sidebar { position: static; flex-direction: row; flex-wrap: wrap; gap: 0 16px; max-height: none; }
  .bar { padding: 16px 0; }
}
