/* The public site: the home page and the 404 page. One hand-written
   stylesheet, no build step and no JavaScript needed to read a page. Black on
   white, reversed in dark mode, set in one monospace face. `/assets/geist-mono-400.9de6b5e2f9b5c37b.woff2` and
   `/assets/geist-mono-600.de5d63e633b79060.woff2` are replaced with the fonts' content-hashed URLs when the
   site is built (see `site/mod.rs`). */

@font-face {
  font-family: "Geist Mono";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/assets/geist-mono-400.9de6b5e2f9b5c37b.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("/assets/geist-mono-600.de5d63e633b79060.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --paper: #fff;
  --ink: #0a0a0a;
  --soft: #4a4a4a;
  --line: #dadada;
  --line-strong: #b8b8b8;
  --mark: rgb(156 76 8 / 0.3);
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #000;
    --ink: #f5f5f5;
    --soft: #a0a0a0;
    --line: #404040;
    --line-strong: #5a5a5a;
    --mark: rgb(230 170 90 / 0.35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 3px; }
code, pre, kbd { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; padding: 0.4rem 0.7rem; background: var(--paper); border: 1px solid var(--ink); }

/* ---- Home ------------------------------------------------------------- */

/* One centred column: a paragraph, the install command, three links, the
   tree, and the footer at the bottom of the window. The tree is a
   plain rectangular crop of the drawing (the oak and the ground under it). `home.js` lays a canvas over
   the image and moves the dots; the canvas reads the image's object-position,
   so change the crop here. */
.home {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.75;
}
/* The gaps are sized from the window's height, so on a short window they
   close up and the footer stays on the first screen. */
.home-copy { width: 100%; max-width: 42rem; padding: clamp(1.5rem, 6vh, 4rem) 1.5rem 0; }
/* The paragraph. Its opening question is the page's heading, set inline so
   the two sentences read as one block of ordinary text. */
.home-text { max-width: 30rem; margin: 0 auto; text-wrap: pretty; }
.home-text h1, .home-text p { display: inline; margin: 0; font: inherit; }
.home-install {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 22rem;
  margin: clamp(1.1rem, 4vh, 2.5rem) auto 0;
  padding: 0.5rem 0.5rem 0.5rem 0.85rem;
  border: 1px solid var(--line-strong);
  font-size: 0.8125rem;
  line-height: 1.6;
  text-align: left;
}
.home-cmd { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow-x: auto; }
.home-btn {
  flex: none;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
}
.home-btn:hover { background: var(--ink); color: var(--paper); }
.home-copy .home-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 2rem; margin: clamp(1.1rem, 3.5vh, 2.25rem) 0 0; }
.home-links a { font-weight: 600; }
/* The tree takes whatever height the window has left, up to a limit, so the
   page fills one screen without scrolling where it can. At its natural shape
   (1.47 wide to 1 tall) the crop runs from just above the crown to the grass
   in front of it; when the window is too narrow for that width the box gets
   taller instead and shows more sky. */
.home-tree {
  position: relative;
  flex: 1 1 0;
  min-height: 11rem;
  max-height: 60vh;
  max-width: 100%;
  aspect-ratio: 147 / 100;
  margin: clamp(1.1rem, 4vh, 2.5rem) 0 clamp(0.5rem, 2vh, 1.5rem);
  overflow: hidden;
}
.home-tree img, .home-tree canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.home-tree img { object-fit: cover; object-position: 50% 86.5%; }
.home-tree canvas[hidden] { display: none; }
.home .foot { width: 100%; margin-top: auto; padding: clamp(0.75rem, 2.5vh, 2rem) 1.5rem clamp(1rem, 3vh, 2.25rem); border-top: 0; font-size: 0.75rem; }
@media (prefers-color-scheme: dark) {
  .home-tree img { filter: invert(1); }
}
/* On a phone the command has to shrink a little to fit beside its button. */
@media (max-width: 26rem) {
  .home-install { font-size: 0.75rem; }
}

/* ---- Shared chrome ---------------------------------------------------- */

/* The footer of every page: two groups of links, centred. */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 2.5rem;
  padding: 2rem 1.5rem 2.25rem;
  font-size: 0.75rem;
  color: var(--soft);
}
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1.25rem; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }

.plain { max-width: 30rem; margin: 0 auto; padding: 7rem 1.5rem; font-size: 0.875rem; line-height: 1.75; text-align: center; }
.plain h1 { margin: 0 0 1.25rem; font-size: 1rem; }

/* ---- Phones ----------------------------------------------------------- */

/* As in the app (`layout.rs`, "Phones"): a narrower gutter and the text a
   step larger. */
@media (max-width: 640px) {
  .foot, .home .foot { font-size: 0.8125rem; padding-left: 1rem; padding-right: 1rem; }
  .foot nav { gap: 0.4rem 1.25rem; }
}
