:root {
  color-scheme: light dark;
  --bg: #fbfbfa;
  --fg: #16161a;
  --muted: #6b6b73;
  --line: #e3e3df;
  --hover: #f0f0ec;
  --tile: #dededa;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --fg: #ededf0;
    --muted: #8d8d97;
    --line: #26262b;
    --hover: #1b1b1f;
    --tile: #2e2e34;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100vh;
  padding: 10vh 24px 15vh;
  display: flex;
  justify-content: center;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main {
  width: 100%;
  max-width: 34rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 2.75rem);
  font-weight: 650;
  letter-spacing: -0.03em;
}

.tagline {
  margin: 0.4rem 0 0;
  color: var(--muted);
  text-wrap: balance;
}

/* A link list: one row per item, name left, short description right. */
.links {
  margin: 3rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

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

.links a {
  display: flex;
  gap: 1rem;
  /* Centred rather than baseline-aligned: rows carry a favicon, and a baseline
     leaves the note sitting below the name it belongs to. */
  align-items: center;
  justify-content: space-between;
  padding: 1.05rem 0.7rem;
  margin: 0 -0.7rem;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.12s ease;
}

.links a:hover,
.links a:focus-visible {
  background: var(--hover);
}

.links .what {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.125rem;
  font-weight: 500;
}

/* Each site's own favicon, copied into public/icons so a card doesn't depend on
   that site being up. 24px rather than the 20px that suits a glyph: one of
   these is an app icon carrying a wordmark, which needs the extra room. */
.icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 6px;
  /* A hairline ring, so an icon that matches the page background (wrap's is a
     black square) still reads as an icon. */
  box-shadow: 0 0 0 1px var(--line);
}

/* The stand-in for a site with no favicon: its initial on a tile, in the same
   shape and size as the real icons. Both colours are tokens, so the tile
   follows the page into dark mode instead of inverting against it. */
.letter {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tile);
  color: var(--fg);
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1;
}

.links .note {
  color: var(--muted);
  font-size: 0.9375rem;
  text-align: right;
  text-wrap: nowrap;
}

/* Section label for the archive — smaller than the links it follows, so the
   live stuff stays the top of the page. */
h2 {
  margin: 3.5rem 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cards {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1.5rem 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cards a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.cards figure {
  margin: 0;
}

/* A fixed box cropped from the top: whichever source the browser picks, the
   card keeps its shape and the page doesn't shift as the images arrive. */
.cards .shot {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  border-radius: 10px;
  background: var(--tile);
  box-shadow: 0 0 0 1px var(--line);
}

.cards figcaption {
  margin-top: 0.7rem;
}

.cards .what {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
}

.cards .note {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Only the live cards are clickable. */
.cards a:hover .shot,
.cards a:focus-visible .shot {
  box-shadow: 0 0 0 1px var(--muted);
}

/* One column on a phone; the box keeps its 16:10 shape at every width. */
@media (max-width: 34rem) {
  .cards {
    grid-template-columns: 1fr;
  }
}

footer {
  margin-top: 3rem;
  color: var(--muted);
  font-size: 0.875rem;
}

footer a {
  color: inherit;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

footer a:hover {
  text-decoration-color: currentColor;
}

/* The 404 page reuses everything above; it just needs its centre of gravity. */
.centred {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 60vh;
}
