/*
 * The landing page's stylesheet, shared by `index.html` and `404.html`.
 *
 * **It is its own file rather than `app/globals.css`.** The landing page is not
 * part of the Next build — nothing imports it and `next build` never sees it — so
 * sharing that stylesheet would mean publishing the app shell's whole layout to
 * the `site/` prefix for two pages that use none of it. What the two files do
 * share is the palette and the breakpoint, so the site and the app read as one
 * product: the custom properties below are `app/globals.css`'s, and
 * `site.test.ts` holds both to it.
 *
 * Mobile-first, one column, and the cards become a grid at the one breakpoint
 * `lib/viewport.ts` holds as `desktopMinWidthPx`. There is no media query at any
 * other width, which `site.test.ts` is what fails on.
 *
 * No `@import`, no `@font-face` and no `url()`: a third-party request is a thing
 * to consent to and a thing to break, and this page has neither.
 */

:root {
  color-scheme: light dark;

  --ink: #17202a;
  --ink-dim: #5a6673;
  --paper: #ffffff;
  --paper-sunken: #f4f6f8;
  --rule: #d8dee5;
  --accent: #1a7f47;

  --gutter: 1rem;
  --measure: 60rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e7ecf1;
    --ink-dim: #9aa7b4;
    --paper: #12171d;
    --paper-sunken: #1a2129;
    --rule: #2c3540;
    --accent: #5cc98b;
  }
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

/*
 * Every section is one band across the page, with its content held to a readable
 * measure and centred. One rule, so a section added later needs no layout of its
 * own.
 */
.band {
  margin: 0 auto;
  padding: 2rem var(--gutter);
  max-width: var(--measure);
}

.band-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem var(--gutter);
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.wordmark {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

h1 {
  margin: 0 0 1rem;
  font-size: 2rem;
  line-height: 1.2;
  /* Wrapping is the browser's, but a heading that breaks mid-word at 320px is
     the one case worth naming. */
  overflow-wrap: break-word;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.375rem;
  line-height: 1.25;
}

h3 {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
  line-height: 1.3;
}

p {
  margin: 0 0 1rem;
}

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

.hero {
  padding-top: 1rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--rule);
}

.lead {
  font-size: 1.125rem;
  max-width: 44rem;
}

.cta {
  margin-top: 1.5rem;
}

/* The link that is a button. Both are `<a>`: nothing here posts. */
.action {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 0.375rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  /* 44px, the smallest target a thumb hits reliably. */
  min-height: 2.75rem;
  line-height: 1.75rem;
}

.action-primary {
  border-color: var(--accent);
  background: var(--accent);
  /* Fixed rather than a custom property: the accent is a mid-tone in both
     schemes, and white sits above 4.5:1 on each of the two values above. */
  color: #ffffff;
}

.action:hover,
.action:focus-visible {
  border-color: var(--accent);
}

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

/* The cards: a list, because that is what it is, with its markers taken off. */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cards > li {
  padding: 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  background: var(--paper-sunken);
}

.cards p {
  margin: 0;
  color: var(--ink-dim);
}

.closing {
  border-top: 1px solid var(--rule);
}

.band-footer {
  padding-top: 1rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-dim);
}

/*
 * The desktop layout, at the one breakpoint `lib/viewport.ts` holds. Two columns
 * of cards and nothing else: the bands are already centred and measured, so
 * there is no second layout to switch to.
 */
@media (min-width: 768px) {
  .band {
    padding: 3rem 2rem;
  }

  .band-header {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .hero {
    padding-top: 2rem;
    padding-bottom: 4rem;
  }

  h1 {
    font-size: 2.75rem;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}
